text:
#include "hidescriptorparser.h"

const char * const ReportDescParserBase::usagePageTitles0[] PROGMEM = {
        pstrUsagePageGenericDesktopControls,
        pstrUsagePageSimulationControls,
        pstrUsagePageVRControls,
        pstrUsagePageSportControls,
        pstrUsagePageGameControls,
        pstrUsagePageGenericDeviceControls,
        pstrUsagePageKeyboardKeypad,
        pstrUsagePageLEDs,
        pstrUsagePageButton,
        pstrUsagePageOrdinal,
        pstrUsagePageTelephone,
        pstrUsagePageConsumer,
        pstrUsagePageDigitizer,
        pstrUsagePagePID,
        pstrUsagePageUnicode
};

const char * const ReportDescParserBase::usagePageTitles1[] PROGMEM = {
        pstrUsagePageBarCodeScanner,
        pstrUsagePageScale,
        pstrUsagePageMSRDevices,
        pstrUsagePagePointOfSale,
        pstrUsagePageCameraControl,
        pstrUsagePageArcade
};
const char * const ReportDescParserBase::genDesktopTitles0[] PROGMEM = {
        pstrUsagePointer,
        pstrUsageMouse,
        pstrUsageJoystick,
        pstrUsageGamePad,
        pstrUsageKeyboard,
        pstrUsageKeypad,
        pstrUsageMultiAxisController,
        pstrUsageTabletPCSystemControls

};
const char * const ReportDescParserBase::genDesktopTitles1[] PROGMEM = {
        pstrUsageX,
        pstrUsageY,
        pstrUsageZ,
        pstrUsageRx,
        pstrUsageRy,
        pstrUsageRz,
        pstrUsageSlider,
        pstrUsageDial,
        pstrUsageWheel,
        pstrUsageHatSwitch,
        pstrUsageCountedBuffer,
        pstrUsageByteCount,
        pstrUsageMotionWakeup,
        pstrUsageStart,
        pstrUsageSelect,
        pstrUsagePageReserved,
        pstrUsageVx,
        pstrUsageVy,
        pstrUsageVz,
        pstrUsageVbrx,
        pstrUsageVbry,
        pstrUsageVbrz,
        pstrUsageVno,
        pstrUsageFeatureNotification,
        pstrUsageResolutionMultiplier
};
const char * const ReportDescParserBase::genDesktopTitles2[] PROGMEM = {
        pstrUsageSystemControl,
        pstrUsageSystemPowerDown,
        pstrUsageSystemSleep,
        pstrUsageSystemWakeup,
        pstrUsageSystemContextMenu,
        pstrUsageSystemMainMenu,
        pstrUsageSystemAppMenu,
        pstrUsageSystemMenuHelp,
        pstrUsageSystemMenuExit,
        pstrUsageSystemMenuSelect,
        pstrUsageSystemMenuRight,
        pstrUsageSystemMenuLeft,
        pstrUsageSystemMenuUp,
        pstrUsageSystemMenuDown,
        pstrUsageSystemColdRestart,
        pstrUsageSystemWarmRestart,
        pstrUsageDPadUp,
        pstrUsageDPadDown,
        pstrUsageDPadRight,
        pstrUsageDPadLeft
};
const char * const ReportDescParserBase::genDesktopTitles3[] PROGMEM = {
        pstrUsageSystemDock,
        pstrUsageSystemUndock,
        pstrUsageSystemSetup,
        pstrUsageSystemBreak,
        pstrUsageSystemDebuggerBreak,
        pstrUsageApplicationBreak,
        pstrUsageApplicationDebuggerBreak,
        pstrUsageSystemSpeakerMute,
        pstrUsageSystemHibernate
};
const char * const ReportDescParserBase::genDesktopTitles4[] PROGMEM = {
        pstrUsageSystemDisplayInvert,
        pstrUsageSystemDisplayInternal,
        pstrUsageSystemDisplayExternal,
        pstrUsageSystemDisplayBoth,
        pstrUsageSystemDisplayDual,
        pstrUsageSystemDisplayToggleIntExt,
        pstrUsageSystemDisplaySwapPriSec,
        pstrUsageSystemDisplayLCDAutoscale
};
const char * const ReportDescParserBase::simuTitles0[] PROGMEM = {
        pstrUsageFlightSimulationDevice,
        pstrUsageAutomobileSimulationDevice,
        pstrUsageTankSimulationDevice,
        pstrUsageSpaceshipSimulationDevice,
        pstrUsageSubmarineSimulationDevice,
        pstrUsageSailingSimulationDevice,
        pstrUsageMotocicleSimulationDevice,
        pstrUsageSportsSimulationDevice,
        pstrUsageAirplaneSimulationDevice,
        pstrUsageHelicopterSimulationDevice,
        pstrUsageMagicCarpetSimulationDevice,
        pstrUsageBicycleSimulationDevice
};
const char * const ReportDescParserBase::simuTitles1[] PROGMEM = {
        pstrUsageFlightControlStick,
        pstrUsageFlightStick,
        pstrUsageCyclicControl,
        pstrUsageCyclicTrim,
        pstrUsageFlightYoke,
        pstrUsageTrackControl
};
const char * const ReportDescParserBase::simuTitles2[] PROGMEM = {
        pstrUsageAileron,
        pstrUsageAileronTrim,
        pstrUsageAntiTorqueControl,
        pstrUsageAutopilotEnable,
        pstrUsageChaffRelease,
        pstrUsageCollectiveControl,
        pstrUsageDiveBrake,
        pstrUsageElectronicCountermeasures,
        pstrUsageElevator,
        pstrUsageElevatorTrim,
        pstrUsageRudder,
        pstrUsageThrottle,
        pstrUsageFlightCommunications,
        pstrUsageFlareRelease,
        pstrUsageLandingGear,
        pstrUsageToeBrake,
        pstrUsageTrigger,
        pstrUsageWeaponsArm,
        pstrUsageWeaponsSelect,
        pstrUsageWingFlaps,
        pstrUsageAccelerator,
        pstrUsageBrake,
        pstrUsageClutch,
        pstrUsageShifter,
        pstrUsageSteering,
        pstrUsageTurretDirection,
        pstrUsageBarrelElevation,
        pstrUsageDivePlane,
        pstrUsageBallast,
        pstrUsageBicycleCrank,
        pstrUsageHandleBars,
        pstrUsageFrontBrake,
        pstrUsageRearBrake
};
const char * const ReportDescParserBase::vrTitles0[] PROGMEM = {
        pstrUsageBelt,
        pstrUsageBodySuit,
        pstrUsageFlexor,
        pstrUsageGlove,
        pstrUsageHeadTracker,
        pstrUsageHeadMountedDisplay,
        pstrUsageHandTracker,
        pstrUsageOculometer,
        pstrUsageVest,
        pstrUsageAnimatronicDevice
};
const char * const ReportDescParserBase::vrTitles1[] PROGMEM = {
        pstrUsageStereoEnable,
        pstrUsageDisplayEnable
};
const char * const ReportDescParserBase::sportsCtrlTitles0[] PROGMEM = {
        pstrUsageBaseballBat,
        pstrUsageGolfClub,
        pstrUsageRowingMachine,
        pstrUsageTreadmill
};
const char * const ReportDescParserBase::sportsCtrlTitles1[] PROGMEM = {
        pstrUsageOar,
        pstrUsageSlope,
        pstrUsageRate,
        pstrUsageStickSpeed,
        pstrUsageStickFaceAngle,
        pstrUsageStickHeelToe,
        pstrUsageStickFollowThough,
        pstrUsageStickTempo,
        pstrUsageStickType,
        pstrUsageStickHeight
};
const char * const ReportDescParserBase::sportsCtrlTitles2[] PROGMEM = {
        pstrUsagePutter,
        pstrUsage1Iron,
        pstrUsage2Iron,
        pstrUsage3Iron,
        pstrUsage4Iron,
        pstrUsage5Iron,
        pstrUsage6Iron,
        pstrUsage7Iron,
        pstrUsage8Iron,
        pstrUsage9Iron,
        pstrUsage10Iron,
        pstrUsage11Iron,
        pstrUsageSandWedge,
        pstrUsageLoftWedge,
        pstrUsagePowerWedge,
        pstrUsage1Wood,
        pstrUsage3Wood,
        pstrUsage5Wood,
        pstrUsage7Wood,
        pstrUsage9Wood
};
const char * const ReportDescParserBase::gameTitles0[] PROGMEM = {
        pstrUsage3DGameController,
        pstrUsagePinballDevice,
        pstrUsageGunDevice
};
const char * const ReportDescParserBase::gameTitles1[] PROGMEM = {
        pstrUsagePointOfView,
        pstrUsageTurnRightLeft,
        pstrUsagePitchForwardBackward,
        pstrUsageRollRightLeft,
        pstrUsageMoveRightLeft,
        pstrUsageMoveForwardBackward,
        pstrUsageMoveUpDown,
        pstrUsageLeanRightLeft,
        pstrUsageLeanForwardBackward,
        pstrUsageHeightOfPOV,
        pstrUsageFlipper,
        pstrUsageSecondaryFlipper,
        pstrUsageBump,
        pstrUsageNewGame,
        pstrUsageShootBall,
        pstrUsagePlayer,
        pstrUsageGunBolt,
        pstrUsageGunClip,
        pstrUsageGunSelector,
        pstrUsageGunSingleShot,
        pstrUsageGunBurst,
        pstrUsageGunAutomatic,
        pstrUsageGunSafety,
        pstrUsageGamepadFireJump,
        pstrUsageGamepadTrigger
};
const char * const ReportDescParserBase::genDevCtrlTitles[] PROGMEM = {
        pstrUsageBatteryStrength,
        pstrUsageWirelessChannel,
        pstrUsageWirelessID,
        pstrUsageDiscoverWirelessControl,
        pstrUsageSecurityCodeCharEntered,
        pstrUsageSecurityCodeCharErased,
        pstrUsageSecurityCodeCleared
};
const char * const ReportDescParserBase::ledTitles[] PROGMEM = {
        pstrUsageNumLock,
        pstrUsageCapsLock,
        pstrUsageScrollLock,
        pstrUsageCompose,
        pstrUsageKana,
        pstrUsagePower,
        pstrUsageShift,
        pstrUsageDoNotDisturb,
        pstrUsageMute,
        pstrUsageToneEnable,
        pstrUsageHighCutFilter,
        pstrUsageLowCutFilter,
        pstrUsageEqualizerEnable,
        pstrUsageSoundFieldOn,
        pstrUsageSurroundOn,
        pstrUsageRepeat,
        pstrUsageStereo,
        pstrUsageSamplingRateDetect,
        pstrUsageSpinning,
        pstrUsageCAV,
        pstrUsageCLV,
        pstrUsageRecordingFormatDetect,
        pstrUsageOffHook,
        pstrUsageRing,
        pstrUsageMessageWaiting,
        pstrUsageDataMode,
        pstrUsageBatteryOperation,
        pstrUsageBatteryOK,
        pstrUsageBatteryLow,
        pstrUsageSpeaker,
        pstrUsageHeadSet,
        pstrUsageHold,
        pstrUsageMicrophone,
        pstrUsageCoverage,
        pstrUsageNightMode,
        pstrUsageSendCalls,
        pstrUsageCallPickup,
        pstrUsageConference,
        pstrUsageStandBy,
        pstrUsageCameraOn,
        pstrUsageCameraOff,
        pstrUsageOnLine,
        pstrUsageOffLine,
        pstrUsageBusy,
        pstrUsageReady,
        pstrUsagePaperOut,
        pstrUsagePaperJam,
        pstrUsageRemote,
        pstrUsageForward,
        pstrUsageReverse,
        pstrUsageStop,
        pstrUsageRewind,
        pstrUsageFastForward,
        pstrUsagePlay,
        pstrUsagePause,
        pstrUsageRecord,
        pstrUsageError,
        pstrUsageSelectedIndicator,
        pstrUsageInUseIndicator,
        pstrUsageMultiModeIndicator,
        pstrUsageIndicatorOn,
        pstrUsageIndicatorFlash,
        pstrUsageIndicatorSlowBlink,
        pstrUsageIndicatorFastBlink,
        pstrUsageIndicatorOff,
        pstrUsageFlashOnTime,
        pstrUsageSlowBlinkOnTime,
        pstrUsageSlowBlinkOffTime,
        pstrUsageFastBlinkOnTime,
        pstrUsageFastBlinkOffTime,
        pstrUsageIndicatorColor,
        pstrUsageIndicatorRed,
        pstrUsageIndicatorGreen,
        pstrUsageIndicatorAmber,
        pstrUsageGenericIndicator,
        pstrUsageSystemSuspend,
        pstrUsageExternalPowerConnected
};
const char * const ReportDescParserBase::telTitles0 [] PROGMEM = {
        pstrUsagePhone,
        pstrUsageAnsweringMachine,
        pstrUsageMessageControls,
        pstrUsageHandset,
        pstrUsageHeadset,
        pstrUsageTelephonyKeyPad,
        pstrUsageProgrammableButton
};
const char * const ReportDescParserBase::telTitles1 [] PROGMEM = {
        pstrUsageHookSwitch,
        pstrUsageFlash,
        pstrUsageFeature,
        pstrUsageHold,
        pstrUsageRedial,
        pstrUsageTransfer,
        pstrUsageDrop,
        pstrUsagePark,
        pstrUsageForwardCalls,
        pstrUsageAlternateFunction,
        pstrUsageLine,
        pstrUsageSpeakerPhone,
        pstrUsageConference,
        pstrUsageRingEnable,
        pstrUsageRingSelect,
        pstrUsagePhoneMute,
        pstrUsageCallerID,
        pstrUsageSend
};
const char * const ReportDescParserBase::telTitles2 [] PROGMEM = {
        pstrUsageSpeedDial,
        pstrUsageStoreNumber,
        pstrUsageRecallNumber,
        pstrUsagePhoneDirectory
};
const char * const ReportDescParserBase::telTitles3 [] PROGMEM = {
        pstrUsageVoiceMail,
        pstrUsageScreenCalls,
        pstrUsageDoNotDisturb,
        pstrUsageMessage,
        pstrUsageAnswerOnOff
};
const char * const ReportDescParserBase::telTitles4 [] PROGMEM = {
        pstrUsageInsideDialTone,
        pstrUsageOutsideDialTone,
        pstrUsageInsideRingTone,
        pstrUsageOutsideRingTone,
        pstrUsagePriorityRingTone,
        pstrUsageInsideRingback,
        pstrUsagePriorityRingback,
        pstrUsageLineBusyTone,
        pstrUsageReorderTone,
        pstrUsageCallWaitingTone,
        pstrUsageConfirmationTone1,
        pstrUsageConfirmationTone2,
        pstrUsageTonesOff,
        pstrUsageOutsideRingback,
        pstrUsageRinger
};
const char * const ReportDescParserBase::telTitles5 [] PROGMEM = {
        pstrUsagePhoneKey0,
        pstrUsagePhoneKey1,
        pstrUsagePhoneKey2,
        pstrUsagePhoneKey3,
        pstrUsagePhoneKey4,
        pstrUsagePhoneKey5,
        pstrUsagePhoneKey6,
        pstrUsagePhoneKey7,
        pstrUsagePhoneKey8,
        pstrUsagePhoneKey9,
        pstrUsagePhoneKeyStar,
        pstrUsagePhoneKeyPound,
        pstrUsagePhoneKeyA,
        pstrUsagePhoneKeyB,
        pstrUsagePhoneKeyC,
        pstrUsagePhoneKeyD
};
const char * const ReportDescParserBase::consTitles0[] PROGMEM = {
        pstrUsageConsumerControl,
        pstrUsageNumericKeyPad,
        pstrUsageProgrammableButton,
        pstrUsageMicrophone,
        pstrUsageHeadphone,
        pstrUsageGraphicEqualizer
};
const char * const ReportDescParserBase::consTitles1[] PROGMEM = {
        pstrUsagePlus10,
        pstrUsagePlus100,
        pstrUsageAMPM
};
const char * const ReportDescParserBase::consTitles2[] PROGMEM = {
        pstrUsagePower,
        pstrUsageReset,
        pstrUsageSleep,
        pstrUsageSleepAfter,
        pstrUsageSleepMode,
        pstrUsageIllumination,
        pstrUsageFunctionButtons

};
const char * const ReportDescParserBase::consTitles3[] PROGMEM = {
        pstrUsageMenu,
        pstrUsageMenuPick,
        pstrUsageMenuUp,
        pstrUsageMenuDown,
        pstrUsageMenuLeft,
        pstrUsageMenuRight,
        pstrUsageMenuEscape,
        pstrUsageMenuValueIncrease,
        pstrUsageMenuValueDecrease
};
const char * const ReportDescParserBase::consTitles4[] PROGMEM = {
        pstrUsageDataOnScreen,
        pstrUsageClosedCaption,
        pstrUsageClosedCaptionSelect,
        pstrUsageVCRTV,
        pstrUsageBroadcastMode,
        pstrUsageSnapshot,
        pstrUsageStill
};
const char * const ReportDescParserBase::consTitles5[] PROGMEM = {
        pstrUsageSelection,
        pstrUsageAssignSelection,
        pstrUsageModeStep,
        pstrUsageRecallLast,
        pstrUsageEnterChannel,
        pstrUsageOrderMovie,
        pstrUsageChannel,
        pstrUsageMediaSelection,
        pstrUsageMediaSelectComputer,
        pstrUsageMediaSelectTV,
        pstrUsageMediaSelectWWW,
        pstrUsageMediaSelectDVD,
        pstrUsageMediaSelectTelephone,
        pstrUsageMediaSelectProgramGuide,
        pstrUsageMediaSelectVideoPhone,
        pstrUsageMediaSelectGames,
        pstrUsageMediaSelectMessages,
        pstrUsageMediaSelectCD,
        pstrUsageMediaSelectVCR,
        pstrUsageMediaSelectTuner,
        pstrUsageQuit,
        pstrUsageHelp,
        pstrUsageMediaSelectTape,
        pstrUsageMediaSelectCable,
        pstrUsageMediaSelectSatellite,
        pstrUsageMediaSelectSecurity,
        pstrUsageMediaSelectHome,
        pstrUsageMediaSelectCall,
        pstrUsageChannelIncrement,
        pstrUsageChannelDecrement,
        pstrUsageMediaSelectSAP,
        pstrUsagePageReserved,
        pstrUsageVCRPlus,
        pstrUsageOnce,
        pstrUsageDaily,
        pstrUsageWeekly,
        pstrUsageMonthly
};
const char * const ReportDescParserBase::consTitles6[] PROGMEM = {
        pstrUsagePlay,
        pstrUsagePause,
        pstrUsageRecord,
        pstrUsageFastForward,
        pstrUsageRewind,
        pstrUsageScanNextTrack,
        pstrUsageScanPreviousTrack,
        pstrUsageStop,
        pstrUsageEject,
        pstrUsageRandomPlay,
        pstrUsageSelectDisk,
        pstrUsageEnterDisk,
        pstrUsageRepeat,
        pstrUsageTracking,
        pstrUsageTrackNormal,
        pstrUsageSlowTracking,
        pstrUsageFrameForward,
        pstrUsageFrameBackwards,
        pstrUsageMark,
        pstrUsageClearMark,
        pstrUsageRepeatFromMark,
        pstrUsageReturnToMark,
        pstrUsageSearchMarkForward,
        pstrUsageSearchMarkBackwards,
        pstrUsageCounterReset,
        pstrUsageShowCounter,
        pstrUsageTrackingIncrement,
        pstrUsageTrackingDecrement,
        pstrUsageStopEject,
        pstrUsagePlayPause,
        pstrUsagePlaySkip
};
const char * const ReportDescParserBase::consTitles7[] PROGMEM = {
        pstrUsageVolume,
        pstrUsageBalance,
        pstrUsageMute,
        pstrUsageBass,
        pstrUsageTreble,
        pstrUsageBassBoost,
        pstrUsageSurroundMode,
        pstrUsageLoudness,
        pstrUsageMPX,
        pstrUsageVolumeIncrement,
        pstrUsageVolumeDecrement
};
const char * const ReportDescParserBase::consTitles8[] PROGMEM = {
        pstrUsageSpeedSelect,
        pstrUsagePlaybackSpeed,
        pstrUsageStandardPlay,
        pstrUsageLongPlay,
        pstrUsageExtendedPlay,
        pstrUsageSlow
};
const char * const ReportDescParserBase::consTitles9[] PROGMEM = {
        pstrUsageFanEnable,
        pstrUsageFanSpeed,
        pstrUsageLightEnable,
        pstrUsageLightIlluminationLevel,
        pstrUsageClimateControlEnable,
        pstrUsageRoomTemperature,
        pstrUsageSecurityEnable,
        pstrUsageFireAlarm,
        pstrUsagePoliceAlarm,
        pstrUsageProximity,
        pstrUsageMotion,
        pstrUsageDuresAlarm,
        pstrUsageHoldupAlarm,
        pstrUsageMedicalAlarm
};
const char * const ReportDescParserBase::consTitlesA[] PROGMEM = {
        pstrUsageBalanceRight,
        pstrUsageBalanceLeft,
        pstrUsageBassIncrement,
        pstrUsageBassDecrement,
        pstrUsageTrebleIncrement,
        pstrUsageTrebleDecrement
};
const char * const ReportDescParserBase::consTitlesB[] PROGMEM = {
        pstrUsageSpeakerSystem,
        pstrUsageChannelLeft,
        pstrUsageChannelRight,
        pstrUsageChannelCenter,
        pstrUsageChannelFront,
        pstrUsageChannelCenterFront,
        pstrUsageChannelSide,
        pstrUsageChannelSurround,
        pstrUsageChannelLowFreqEnhancement,
        pstrUsageChannelTop,
        pstrUsageChannelUnknown
};
const char * const ReportDescParserBase::consTitlesC[] PROGMEM = {
        pstrUsageSubChannel,
        pstrUsageSubChannelIncrement,
        pstrUsageSubChannelDecrement,
        pstrUsageAlternateAudioIncrement,
        pstrUsageAlternateAudioDecrement
};
const char * const ReportDescParserBase::consTitlesD[] PROGMEM = {
        pstrUsageApplicationLaunchButtons,
        pstrUsageALLaunchButtonConfigTool,
        pstrUsageALProgrammableButton,
        pstrUsageALConsumerControlConfig,
        pstrUsageALWordProcessor,
        pstrUsageALTextEditor,
        pstrUsageALSpreadsheet,
        pstrUsageALGraphicsEditor,
        pstrUsageALPresentationApp,
        pstrUsageALDatabaseApp,
        pstrUsageALEmailReader,
        pstrUsageALNewsreader,
        pstrUsageALVoicemail,
        pstrUsageALContactsAddressBook,
        pstrUsageALCalendarSchedule,
        pstrUsageALTaskProjectManager,
        pstrUsageALLogJournalTimecard,
        pstrUsageALCheckbookFinance,
        pstrUsageALCalculator,
        pstrUsageALAVCapturePlayback,
        pstrUsageALLocalMachineBrowser,
        pstrUsageALLANWANBrow,
        pstrUsageALInternetBrowser,
        pstrUsageALRemoteNetISPConnect,
        pstrUsageALNetworkConference,
        pstrUsageALNetworkChat,
        pstrUsageALTelephonyDialer,
        pstrUsageALLogon,
        pstrUsageALLogoff,
        pstrUsageALLogonLogoff,
        pstrUsageALTermLockScrSav,
        pstrUsageALControlPannel,
        pstrUsageALCommandLineProcessorRun,
        pstrUsageALProcessTaskManager,
        pstrUsageALSelectTaskApplication,
        pstrUsageALNextTaskApplication,
        pstrUsageALPreviousTaskApplication,
        pstrUsageALPreemptiveHaltTaskApp,
        pstrUsageALIntegratedHelpCenter,
        pstrUsageALDocuments,
        pstrUsageALThesaurus,
        pstrUsageALDictionary,
        pstrUsageALDesktop,
        pstrUsageALSpellCheck,
        pstrUsageALGrammarCheck,
        pstrUsageALWirelessStatus,
        pstrUsageALKeyboardLayout,
        pstrUsageALVirusProtection,
        pstrUsageALEncryption,
        pstrUsageALScreenSaver,
        pstrUsageALAlarms,
        pstrUsageALClock,
        pstrUsageALFileBrowser,
        pstrUsageALPowerStatus,
        pstrUsageALImageBrowser,
        pstrUsageALAudioBrowser,
        pstrUsageALMovieBrowser,
        pstrUsageALDigitalRightsManager,
        pstrUsageALDigitalWallet,
        pstrUsagePageReserved,
        pstrUsageALInstantMessaging,
        pstrUsageALOEMFeaturesBrowser,
        pstrUsageALOEMHelp,
        pstrUsageALOnlineCommunity,
        pstrUsageALEntertainmentContentBrow,
        pstrUsageALOnlineShoppingBrowser,
        pstrUsageALSmartCardInfoHelp,
        pstrUsageALMarketMonitorFinBrowser,
        pstrUsageALCustomCorpNewsBrowser,
        pstrUsageALOnlineActivityBrowser,
        pstrUsageALResearchSearchBrowser,
        pstrUsageALAudioPlayer
};
const char * const ReportDescParserBase::consTitlesE[] PROGMEM = {
        pstrUsageGenericGUIAppControls,
        pstrUsageACNew,
        pstrUsageACOpen,
        pstrUsageACClose,
        pstrUsageACExit,
        pstrUsageACMaximize,
        pstrUsageACMinimize,
        pstrUsageACSave,
        pstrUsageACPrint,
        pstrUsageACProperties,
        pstrUsageACUndo,
        pstrUsageACCopy,
        pstrUsageACCut,
        pstrUsageACPaste,
        pstrUsageACSelectAll,
        pstrUsageACFind,
        pstrUsageACFindAndReplace,
        pstrUsageACSearch,
        pstrUsageACGoto,
        pstrUsageACHome,
        pstrUsageACBack,
        pstrUsageACForward,
        pstrUsageACStop,
        pstrUsageACRefresh,
        pstrUsageACPreviousLink,
        pstrUsageACNextLink,
        pstrUsageACBookmarks,
        pstrUsageACHistory,
        pstrUsageACSubscriptions,
        pstrUsageACZoomIn,
        pstrUsageACZoomOut,
        pstrUsageACZoom,
        pstrUsageACFullScreenView,
        pstrUsageACNormalView,
        pstrUsageACViewToggle,
        pstrUsageACScrollUp,
        pstrUsageACScrollDown,
        pstrUsageACScroll,
        pstrUsageACPanLeft,
        pstrUsageACPanRight,
        pstrUsageACPan,
        pstrUsageACNewWindow,
        pstrUsageACTileHoriz,
        pstrUsageACTileVert,
        pstrUsageACFormat,
        pstrUsageACEdit,
        pstrUsageACBold,
        pstrUsageACItalics,
        pstrUsageACUnderline,
        pstrUsageACStrikethrough,
        pstrUsageACSubscript,
        pstrUsageACSuperscript,
        pstrUsageACAllCaps,
        pstrUsageACRotate,
        pstrUsageACResize,
        pstrUsageACFlipHorizontal,
        pstrUsageACFlipVertical,
        pstrUsageACMirrorHorizontal,
        pstrUsageACMirrorVertical,
        pstrUsageACFontSelect,
        pstrUsageACFontColor,
        pstrUsageACFontSize,
        pstrUsageACJustifyLeft,
        pstrUsageACJustifyCenterH,
        pstrUsageACJustifyRight,
        pstrUsageACJustifyBlockH,
        pstrUsageACJustifyTop,
        pstrUsageACJustifyCenterV,
        pstrUsageACJustifyBottom,
        pstrUsageACJustifyBlockV,
        pstrUsageACIndentDecrease,
        pstrUsageACIndentIncrease,
        pstrUsageACNumberedList,
        pstrUsageACRestartNumbering,
        pstrUsageACBulletedList,
        pstrUsageACPromote,
        pstrUsageACDemote,
        pstrUsageACYes,
        pstrUsageACNo,
        pstrUsageACCancel,
        pstrUsageACCatalog,
        pstrUsageACBuyChkout,
        pstrUsageACAddToCart,
        pstrUsageACExpand,
        pstrUsageACExpandAll,
        pstrUsageACCollapse,
        pstrUsageACCollapseAll,
        pstrUsageACPrintPreview,
        pstrUsageACPasteSpecial,
        pstrUsageACInsertMode,
        pstrUsageACDelete,
        pstrUsageACLock,
        pstrUsageACUnlock,
        pstrUsageACProtect,
        pstrUsageACUnprotect,
        pstrUsageACAttachComment,
        pstrUsageACDeleteComment,
        pstrUsageACViewComment,
        pstrUsageACSelectWord,
        pstrUsageACSelectSentence,
        pstrUsageACSelectParagraph,
        pstrUsageACSelectColumn,
        pstrUsageACSelectRow,
        pstrUsageACSelectTable,
        pstrUsageACSelectObject,
        pstrUsageACRedoRepeat,
        pstrUsageACSort,
        pstrUsageACSortAscending,
        pstrUsageACSortDescending,
        pstrUsageACFilter,
        pstrUsageACSetClock,
        pstrUsageACViewClock,
        pstrUsageACSelectTimeZone,
        pstrUsageACEditTimeZone,
        pstrUsageACSetAlarm,
        pstrUsageACClearAlarm,
        pstrUsageACSnoozeAlarm,
        pstrUsageACResetAlarm,
        pstrUsageACSyncronize,
        pstrUsageACSendReceive,
        pstrUsageACSendTo,
        pstrUsageACReply,
        pstrUsageACReplyAll,
        pstrUsageACForwardMessage,
        pstrUsageACSend,
        pstrUsageACAttachFile,
        pstrUsageACUpload,
        pstrUsageACDownload,
        pstrUsageACSetBorders,
        pstrUsageACInsertRow,
        pstrUsageACInsertColumn,
        pstrUsageACInsertFile,
        pstrUsageACInsertPicture,
        pstrUsageACInsertObject,
        pstrUsageACInsertSymbol,
        pstrUsageACSaveAndClose,
        pstrUsageACRename,
        pstrUsageACMerge,
        pstrUsageACSplit,
        pstrUsageACDistributeHorizontaly,
        pstrUsageACDistributeVerticaly
};
const char * const ReportDescParserBase::digitTitles0[] PROGMEM = {
        pstrUsageDigitizer,
        pstrUsagePen,
        pstrUsageLightPen,
        pstrUsageTouchScreen,
        pstrUsageTouchPad,
        pstrUsageWhiteBoard,
        pstrUsageCoordinateMeasuringMachine,
        pstrUsage3DDigitizer,
        pstrUsageStereoPlotter,
        pstrUsageArticulatedArm,
        pstrUsageArmature,
        pstrUsageMultiplePointDigitizer,
        pstrUsageFreeSpaceWand
};
const char * const ReportDescParserBase::digitTitles1[] PROGMEM = {
        pstrUsageStylus,
        pstrUsagePuck,
        pstrUsageFinger

};
const char * const ReportDescParserBase::digitTitles2[] PROGMEM = {
        pstrUsageTipPressure,
        pstrUsageBarrelPressure,
        pstrUsageInRange,
        pstrUsageTouch,
        pstrUsageUntouch,
        pstrUsageTap,
        pstrUsageQuality,
        pstrUsageDataValid,
        pstrUsageTransducerIndex,
        pstrUsageTabletFunctionKeys,
        pstrUsageProgramChangeKeys,
        pstrUsageBatteryStrength,
        pstrUsageInvert,
        pstrUsageXTilt,
        pstrUsageYTilt,
        pstrUsageAzimuth,
        pstrUsageAltitude,
        pstrUsageTwist,
        pstrUsageTipSwitch,
        pstrUsageSecondaryTipSwitch,
        pstrUsageBarrelSwitch,
        pstrUsageEraser,
        pstrUsageTabletPick
};
const char * const ReportDescParserBase::aplphanumTitles0[] PROGMEM = {
        pstrUsageAlphanumericDisplay,
        pstrUsageBitmappedDisplay
};
const char * const ReportDescParserBase::aplphanumTitles1[] PROGMEM = {
        pstrUsageDisplayAttributesReport,
        pstrUsageASCIICharacterSet,
        pstrUsageDataReadBack,
        pstrUsageFontReadBack,
        pstrUsageDisplayControlReport,
        pstrUsageClearDisplay,
        pstrUsageDisplayEnable,
        pstrUsageScreenSaverDelay,
        pstrUsageScreenSaverEnable,
        pstrUsageVerticalScroll,
        pstrUsageHorizontalScroll,
        pstrUsageCharacterReport,
        pstrUsageDisplayData,
        pstrUsageDisplayStatus,
        pstrUsageStatusNotReady,
        pstrUsageStatusReady,
        pstrUsageErrorNotALoadableCharacter,
        pstrUsageErrorFotDataCanNotBeRead,
        pstrUsageCursorPositionReport,
        pstrUsageRow,
        pstrUsageColumn,
        pstrUsageRows,
        pstrUsageColumns,
        pstrUsageCursorPixelPosition,
        pstrUsageCursorMode,
        pstrUsageCursorEnable,
        pstrUsageCursorBlink,
        pstrUsageFontReport,
        pstrUsageFontData,
        pstrUsageCharacterWidth,
        pstrUsageCharacterHeight,
        pstrUsageCharacterSpacingHorizontal,
        pstrUsageCharacterSpacingVertical,
        pstrUsageUnicodeCharset,
        pstrUsageFont7Segment,
        pstrUsage7SegmentDirectMap,
        pstrUsageFont14Segment,
        pstrUsage14SegmentDirectMap,
        pstrUsageDisplayBrightness,
        pstrUsageDisplayContrast,
        pstrUsageCharacterAttribute,
        pstrUsageAttributeReadback,
        pstrUsageAttributeData,
        pstrUsageCharAttributeEnhance,
        pstrUsageCharAttributeUnderline,
        pstrUsageCharAttributeBlink
};
const char * const ReportDescParserBase::aplphanumTitles2[] PROGMEM = {
        pstrUsageBitmapSizeX,
        pstrUsageBitmapSizeY,
        pstrUsagePageReserved,
        pstrUsageBitDepthFormat,
        pstrUsageDisplayOrientation,
        pstrUsagePaletteReport,
        pstrUsagePaletteDataSize,
        pstrUsagePaletteDataOffset,
        pstrUsagePaletteData,
        pstrUsageBlitReport,
        pstrUsageBlitRectangleX1,
        pstrUsageBlitRectangleY1,
        pstrUsageBlitRectangleX2,
        pstrUsageBlitRectangleY2,
        pstrUsageBlitData,
        pstrUsageSoftButton,
        pstrUsageSoftButtonID,
        pstrUsageSoftButtonSide,
        pstrUsageSoftButtonOffset1,
        pstrUsageSoftButtonOffset2,
        pstrUsageSoftButtonReport
};
const char * const ReportDescParserBase::medInstrTitles0[] PROGMEM = {
        pstrUsageVCRAcquisition,
        pstrUsageFreezeThaw,
        pstrUsageClipStore,
        pstrUsageUpdate,
        pstrUsageNext,
        pstrUsageSave,
        pstrUsagePrint,
        pstrUsageMicrophoneEnable
};
const char * const ReportDescParserBase::medInstrTitles1[] PROGMEM = {
        pstrUsageCine,
        pstrUsageTransmitPower,
        pstrUsageVolume,
        pstrUsageFocus,
        pstrUsageDepth
};
const char * const ReportDescParserBase::medInstrTitles2[] PROGMEM = {
        pstrUsageSoftStepPrimary,
        pstrUsageSoftStepSecondary
};
const char * const ReportDescParserBase::medInstrTitles3[] PROGMEM = {
        pstrUsageZoomSelect,
        pstrUsageZoomAdjust,
        pstrUsageSpectralDopplerModeSelect,
        pstrUsageSpectralDopplerModeAdjust,
        pstrUsageColorDopplerModeSelect,
        pstrUsageColorDopplerModeAdjust,
        pstrUsageMotionModeSelect,
        pstrUsageMotionModeAdjust,
        pstrUsage2DModeSelect,
        pstrUsage2DModeAdjust
};
const char * const ReportDescParserBase::medInstrTitles4[] PROGMEM = {
        pstrUsageSoftControlSelect,
        pstrUsageSoftControlAdjust
};

void ReportDescParserBase::Parse(const uint16_t len, const uint8_t *pbuf, const uint16_t &offset) {
        uint16_t cntdn = (uint16_t)len;
        uint8_t *p = (uint8_t*)pbuf;

        totalSize = 0;

        while (cntdn) {
                //USB_HOST_SERIAL.println("");
                //PrintHex<uint16_t>(offset + len - cntdn);
                //USB_HOST_SERIAL.print(":");

                ParseItem(&p, &cntdn);

                //if (ParseItem(&p, &cntdn))
                //	return;
        }
        //USBTRACE2("Total:", totalSize);
}

void ReportDescParserBase::PrintValue(uint8_t *p, uint8_t len) {
        E_Notify(PSTR("("), 0x80);
        for (; len; p++, len--)
                PrintHex<uint8_t > (*p, 0x80);
        E_Notify(PSTR(")"), 0x80);
}

void ReportDescParserBase::PrintByteValue(uint8_t data) {
        E_Notify(PSTR("("), 0x80);
        PrintHex<uint8_t > (data, 0x80);
        E_Notify(PSTR(")"), 0x80);
}

void ReportDescParserBase::PrintItemTitle(uint8_t prefix) {
        switch (prefix & (TYPE_MASK | TAG_MASK)) {
                case (TYPE_GLOBAL | TAG_GLOBAL_PUSH):
                        E_Notify(PSTR("\r\nPush"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_POP):
                        E_Notify(PSTR("\r\nPop"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE):
                        E_Notify(PSTR("\r\nUsage Page"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMIN):
                        E_Notify(PSTR("\r\nLogical Min"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMAX):
                        E_Notify(PSTR("\r\nLogical Max"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMIN):
                        E_Notify(PSTR("\r\nPhysical Min"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMAX):
                        E_Notify(PSTR("\r\nPhysical Max"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_UNITEXP):
                        E_Notify(PSTR("\r\nUnit Exp"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_UNIT):
                        E_Notify(PSTR("\r\nUnit"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE):
                        E_Notify(PSTR("\r\nReport Size"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT):
                        E_Notify(PSTR("\r\nReport Count"), 0x80);
                        break;
                case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID):
                        E_Notify(PSTR("\r\nReport Id"), 0x80);
                        break;
                case (TYPE_LOCAL | TAG_LOCAL_USAGE):
                        E_Notify(PSTR("\r\nUsage"), 0x80);
                        break;
                case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
                        E_Notify(PSTR("\r\nUsage Min"), 0x80);
                        break;
                case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX):
                        E_Notify(PSTR("\r\nUsage Max"), 0x80);
                        break;
                case (TYPE_MAIN | TAG_MAIN_COLLECTION):
                        E_Notify(PSTR("\r\nCollection"), 0x80);
                        break;
                case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION):
                        E_Notify(PSTR("\r\nEnd Collection"), 0x80);
                        break;
                case (TYPE_MAIN | TAG_MAIN_INPUT):
                        E_Notify(PSTR("\r\nInput"), 0x80);
                        break;
                case (TYPE_MAIN | TAG_MAIN_OUTPUT):
                        E_Notify(PSTR("\r\nOutput"), 0x80);
                        break;
                case (TYPE_MAIN | TAG_MAIN_FEATURE):
                        E_Notify(PSTR("\r\nFeature"), 0x80);
                        break;
        } // switch (**pp & (TYPE_MASK | TAG_MASK))
}

uint8_t ReportDescParserBase::ParseItem(uint8_t **pp, uint16_t *pcntdn) {
        //uint8_t	ret = enErrorSuccess;

        switch (itemParseState) {
                case 0:
                        if (**pp == HID_LONG_ITEM_PREFIX)
                                USBTRACE("\r\nLONG\r\n");
                        else {
                                uint8_t size = ((**pp) & DATA_SIZE_MASK);

                                itemPrefix = (**pp);
                                itemSize = 1 + ((size == DATA_SIZE_4) ? 4 : size);

                                PrintItemTitle(itemPrefix);
                        }
                        (*pp)++;
                        (*pcntdn)--;
                        itemSize--;
                        itemParseState = 1;

                        if (!itemSize)
                                break;

                        if (!pcntdn)
                                return enErrorIncomplete;
                case 1:
                        //USBTRACE2("\r\niSz:",itemSize);

                        theBuffer.valueSize = itemSize;
                        valParser.Initialize(&theBuffer);
                        itemParseState = 2;
                case 2:
                        if (!valParser.Parse(pp, pcntdn))
                                return enErrorIncomplete;
                        itemParseState = 3;
                case 3:
                {
                        uint8_t data = *((uint8_t*)varBuffer);

                        switch (itemPrefix & (TYPE_MASK | TAG_MASK)) {
                                case (TYPE_LOCAL | TAG_LOCAL_USAGE):
                                        if (pfUsage) {
                                                if (theBuffer.valueSize > 1)
                                                        pfUsage(*((uint16_t*)varBuffer));
                                                else
                                                        pfUsage(data);
                                        }
                                        break;
                                case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE):
                                        rptSize = data;
                                        PrintByteValue(data);
                                        break;
                                case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT):
                                        rptCount = data;
                                        PrintByteValue(data);
                                        break;
                                case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMIN):
                                case (TYPE_GLOBAL | TAG_GLOBAL_LOGICALMAX):
                                case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMIN):
                                case (TYPE_GLOBAL | TAG_GLOBAL_PHYSMAX):
                                case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID):
                                case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
                                case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX):
                                case (TYPE_GLOBAL | TAG_GLOBAL_UNITEXP):
                                case (TYPE_GLOBAL | TAG_GLOBAL_UNIT):
                                        PrintValue(varBuffer, theBuffer.valueSize);
                                        break;
                                case (TYPE_GLOBAL | TAG_GLOBAL_PUSH):
                                case (TYPE_GLOBAL | TAG_GLOBAL_POP):
                                        break;
                                case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE):
                                        SetUsagePage(data);
                                        PrintUsagePage(data);
                                        PrintByteValue(data);
                                        break;
                                case (TYPE_MAIN | TAG_MAIN_COLLECTION):
                                case (TYPE_MAIN | TAG_MAIN_ENDCOLLECTION):
                                        switch (data) {
                                                case 0x00:
                                                        E_Notify(PSTR(" Physical"), 0x80);
                                                        break;
                                                case 0x01:
                                                        E_Notify(PSTR(" Application"), 0x80);
                                                        break;
                                                case 0x02:
                                                        E_Notify(PSTR(" Logical"), 0x80);
                                                        break;
                                                case 0x03:
                                                        E_Notify(PSTR(" Report"), 0x80);
                                                        break;
                                                case 0x04:
                                                        E_Notify(PSTR(" Named Array"), 0x80);
                                                        break;
                                                case 0x05:
                                                        E_Notify(PSTR(" Usage Switch"), 0x80);
                                                        break;
                                                case 0x06:
                                                        E_Notify(PSTR(" Usage Modifier"), 0x80);
                                                        break;
                                                default:
                                                        E_Notify(PSTR(" Vendor Defined("), 0x80);
                                                        PrintHex<uint8_t > (data, 0x80);
                                                        E_Notify(PSTR(")"), 0x80);
                                        }
                                        break;
                                case (TYPE_MAIN | TAG_MAIN_INPUT):
                                case (TYPE_MAIN | TAG_MAIN_OUTPUT):
                                case (TYPE_MAIN | TAG_MAIN_FEATURE):
                                        totalSize += (uint16_t)rptSize * (uint16_t)rptCount;
                                        rptSize = 0;
                                        rptCount = 0;
                                        E_Notify(PSTR("("), 0x80);
                                        PrintBin<uint8_t > (data, 0x80);
                                        E_Notify(PSTR(")"), 0x80);
                                        break;
                        } // switch (**pp & (TYPE_MASK | TAG_MASK))
                }
        } // switch (itemParseState)
        itemParseState = 0;
        return enErrorSuccess;
}

ReportDescParserBase::UsagePageFunc ReportDescParserBase::usagePageFunctions[] /*PROGMEM*/ = {
        &ReportDescParserBase::PrintGenericDesktopPageUsage,
        &ReportDescParserBase::PrintSimulationControlsPageUsage,
        &ReportDescParserBase::PrintVRControlsPageUsage,
        &ReportDescParserBase::PrintSportsControlsPageUsage,
        &ReportDescParserBase::PrintGameControlsPageUsage,
        &ReportDescParserBase::PrintGenericDeviceControlsPageUsage,
        NULL, // Keyboard/Keypad
        &ReportDescParserBase::PrintLEDPageUsage,
        &ReportDescParserBase::PrintButtonPageUsage,
        &ReportDescParserBase::PrintOrdinalPageUsage,
        &ReportDescParserBase::PrintTelephonyPageUsage,
        &ReportDescParserBase::PrintConsumerPageUsage,
        &ReportDescParserBase::PrintDigitizerPageUsage,
        NULL, // Reserved
        NULL, // PID
        NULL // Unicode
};

void ReportDescParserBase::SetUsagePage(uint16_t page) {
        pfUsage = NULL;

        if (page > 0x00 && page < 0x11)
                pfUsage = /*(UsagePageFunc)pgm_read_pointer*/(usagePageFunctions[page - 1]);
                //else if (page > 0x7f && page < 0x84)
                //	E_Notify(pstrUsagePageMonitor);
                //else if (page > 0x83 && page < 0x8c)
                //	E_Notify(pstrUsagePagePower);
                //else if (page > 0x8b && page < 0x92)
                //	E_Notify((char*)pgm_read_pointer(&usagePageTitles1[page - 0x8c]));
                //else if (page > 0xfeff && page <= 0xffff)
                //	E_Notify(pstrUsagePageVendorDefined);
        else
                switch (page) {
                        case 0x14:
                                pfUsage = &ReportDescParserBase::PrintAlphanumDisplayPageUsage;
                                break;
                        case 0x40:
                                pfUsage = &ReportDescParserBase::PrintMedicalInstrumentPageUsage;
                                break;
                }
}

void ReportDescParserBase::PrintUsagePage(uint16_t page) {
        E_Notify(pstrSpace, 0x80);

        if (page > 0x00 && page < 0x11)
                E_Notify((char*)pgm_read_pointer(&usagePageTitles0[page - 1]), 0x80);
        else if (page > 0x7f && page < 0x84)
                E_Notify(pstrUsagePageMonitor, 0x80);
        else if (page > 0x83 && page < 0x8c)
                E_Notify(pstrUsagePagePower, 0x80);
        else if (page > 0x8b && page < 0x92)
                E_Notify((char*)pgm_read_pointer(&usagePageTitles1[page - 0x8c]), 0x80);
        else if (page > 0xfeff && page <= 0xffff)
                E_Notify(pstrUsagePageVendorDefined, 0x80);
        else
                switch (page) {
                        case 0x14:
                                E_Notify(pstrUsagePageAlphaNumericDisplay, 0x80);
                                break;
                        case 0x40:
                                E_Notify(pstrUsagePageMedicalInstruments, 0x80);
                                break;
                        default:
                                E_Notify(pstrUsagePageUndefined, 0x80);
                }
}

void ReportDescParserBase::PrintButtonPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);
        E_Notify(PSTR("Btn"), 0x80);
        PrintHex<uint16_t > (usage, 0x80);
        E_Notify(PSTR("\r\n"), 0x80);
        //USB_HOST_SERIAL.print(usage, HEX);
}

void ReportDescParserBase::PrintOrdinalPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);
        E_Notify(PSTR("Inst"), 0x80);
        // Sorry, HEX for now...
        PrintHex<uint16_t > (usage, 0x80);
        E_Notify(PSTR("\r\n"), 0x80);
        //USB_HOST_SERIAL.print(usage, DEC);
}

void ReportDescParserBase::PrintGenericDesktopPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x0a)
                E_Notify((char*)pgm_read_pointer(&genDesktopTitles0[usage - 1]), 0x80);
        else if (usage > 0x2f && usage < 0x49)
                E_Notify((char*)pgm_read_pointer(&genDesktopTitles1[usage - 0x30]), 0x80);
        else if (usage > 0x7f && usage < 0x94)
                E_Notify((char*)pgm_read_pointer(&genDesktopTitles2[usage - 0x80]), 0x80);
        else if (usage > 0x9f && usage < 0xa9)
                E_Notify((char*)pgm_read_pointer(&genDesktopTitles3[usage - 0xa0]), 0x80);
        else if (usage > 0xaf && usage < 0xb8)
                E_Notify((char*)pgm_read_pointer(&genDesktopTitles4[usage - 0xb0]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintSimulationControlsPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x0d)
                E_Notify((char*)pgm_read_pointer(&simuTitles0[usage - 1]), 0x80);
        else if (usage > 0x1f && usage < 0x26)
                E_Notify((char*)pgm_read_pointer(&simuTitles1[usage - 0x20]), 0x80);
        else if (usage > 0xaf && usage < 0xd1)
                E_Notify((char*)pgm_read_pointer(&simuTitles2[usage - 0xb0]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintVRControlsPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x0b)
                E_Notify((char*)pgm_read_pointer(&vrTitles0[usage - 1]), 0x80);
        else if (usage > 0x1f && usage < 0x22)
                E_Notify((char*)pgm_read_pointer(&vrTitles1[usage - 0x20]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintSportsControlsPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x05)
                E_Notify((char*)pgm_read_pointer(&sportsCtrlTitles0[usage - 1]), 0x80);
        else if (usage > 0x2f && usage < 0x3a)
                E_Notify((char*)pgm_read_pointer(&sportsCtrlTitles1[usage - 0x30]), 0x80);
        else if (usage > 0x4f && usage < 0x64)
                E_Notify((char*)pgm_read_pointer(&sportsCtrlTitles2[usage - 0x50]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintGameControlsPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x04)
                E_Notify((char*)pgm_read_pointer(&gameTitles0[usage - 1]), 0x80);
        else if (usage > 0x1f && usage < 0x3a)
                E_Notify((char*)pgm_read_pointer(&gameTitles1[usage - 0x20]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintGenericDeviceControlsPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x1f && usage < 0x27)
                E_Notify((char*)pgm_read_pointer(&genDevCtrlTitles[usage - 0x20]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintLEDPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x4e)
                E_Notify((char*)pgm_read_pointer(&ledTitles[usage - 1]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintTelephonyPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x08)
                E_Notify((char*)pgm_read_pointer(&telTitles0[usage - 1]), 0x80);
        else if (usage > 0x1f && usage < 0x32)
                E_Notify((char*)pgm_read_pointer(&telTitles1[usage - 0x1f]), 0x80);
        else if (usage > 0x4f && usage < 0x54)
                E_Notify((char*)pgm_read_pointer(&telTitles2[usage - 0x4f]), 0x80);
        else if (usage > 0x6f && usage < 0x75)
                E_Notify((char*)pgm_read_pointer(&telTitles3[usage - 0x6f]), 0x80);
        else if (usage > 0x8f && usage < 0x9f)
                E_Notify((char*)pgm_read_pointer(&telTitles4[usage - 0x8f]), 0x80);
        else if (usage > 0xaf && usage < 0xc0)
                E_Notify((char*)pgm_read_pointer(&telTitles5[usage - 0xaf]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintConsumerPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x07)
                E_Notify((char*)pgm_read_pointer(&consTitles0[usage - 1]), 0x80);
        else if (usage > 0x1f && usage < 0x23)
                E_Notify((char*)pgm_read_pointer(&consTitles1[usage - 0x1f]), 0x80);
        else if (usage > 0x2f && usage < 0x37)
                E_Notify((char*)pgm_read_pointer(&consTitles2[usage - 0x2f]), 0x80);
        else if (usage > 0x3f && usage < 0x49)
                E_Notify((char*)pgm_read_pointer(&consTitles3[usage - 0x3f]), 0x80);
        else if (usage > 0x5f && usage < 0x67)
                E_Notify((char*)pgm_read_pointer(&consTitles4[usage - 0x5f]), 0x80);
        else if (usage > 0x7f && usage < 0xa5)
                E_Notify((char*)pgm_read_pointer(&consTitles5[usage - 0x7f]), 0x80);
        else if (usage > 0xaf && usage < 0xcf)
                E_Notify((char*)pgm_read_pointer(&consTitles6[usage - 0xaf]), 0x80);
        else if (usage > 0xdf && usage < 0xeb)
                E_Notify((char*)pgm_read_pointer(&consTitles7[usage - 0xdf]), 0x80);
        else if (usage > 0xef && usage < 0xf6)
                E_Notify((char*)pgm_read_pointer(&consTitles8[usage - 0xef]), 0x80);
        else if (usage > 0xff && usage < 0x10e)
                E_Notify((char*)pgm_read_pointer(&consTitles9[usage - 0xff]), 0x80);
        else if (usage > 0x14f && usage < 0x156)
                E_Notify((char*)pgm_read_pointer(&consTitlesA[usage - 0x14f]), 0x80);
        else if (usage > 0x15f && usage < 0x16b)
                E_Notify((char*)pgm_read_pointer(&consTitlesB[usage - 0x15f]), 0x80);
        else if (usage > 0x16f && usage < 0x175)
                E_Notify((char*)pgm_read_pointer(&consTitlesC[usage - 0x16f]), 0x80);
        else if (usage > 0x17f && usage < 0x1c8)
                E_Notify((char*)pgm_read_pointer(&consTitlesD[usage - 0x17f]), 0x80);
        else if (usage > 0x1ff && usage < 0x29d)
                E_Notify((char*)pgm_read_pointer(&consTitlesE[usage - 0x1ff]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintDigitizerPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x0e)
                E_Notify((char*)pgm_read_pointer(&digitTitles0[usage - 1]), 0x80);
        else if (usage > 0x1f && usage < 0x23)
                E_Notify((char*)pgm_read_pointer(&digitTitles1[usage - 0x1f]), 0x80);
        else if (usage > 0x2f && usage < 0x47)
                E_Notify((char*)pgm_read_pointer(&digitTitles2[usage - 0x2f]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintAlphanumDisplayPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage > 0x00 && usage < 0x03)
                E_Notify((char*)pgm_read_pointer(&aplphanumTitles0[usage - 1]), 0x80);
        else if (usage > 0x1f && usage < 0x4e)
                E_Notify((char*)pgm_read_pointer(&aplphanumTitles1[usage - 0x1f]), 0x80);
        else if (usage > 0x7f && usage < 0x96)
                E_Notify((char*)pgm_read_pointer(&digitTitles2[usage - 0x80]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

void ReportDescParserBase::PrintMedicalInstrumentPageUsage(uint16_t usage) {
        E_Notify(pstrSpace, 0x80);

        if (usage == 1)
                E_Notify(pstrUsageMedicalUltrasound, 0x80);
        else if (usage > 0x1f && usage < 0x28)
                E_Notify((char*)pgm_read_pointer(&medInstrTitles0[usage - 0x1f]), 0x80);
        else if (usage > 0x3f && usage < 0x45)
                E_Notify((char*)pgm_read_pointer(&medInstrTitles1[usage - 0x40]), 0x80);
        else if (usage > 0x5f && usage < 0x62)
                E_Notify((char*)pgm_read_pointer(&medInstrTitles2[usage - 0x60]), 0x80);
        else if (usage == 0x70)
                E_Notify(pstrUsageDepthGainCompensation, 0x80);
        else if (usage > 0x7f && usage < 0x8a)
                E_Notify((char*)pgm_read_pointer(&medInstrTitles3[usage - 0x80]), 0x80);
        else if (usage > 0x9f && usage < 0xa2)
                E_Notify((char*)pgm_read_pointer(&medInstrTitles4[usage - 0xa0]), 0x80);
        else
                E_Notify(pstrUsagePageUndefined, 0x80);
}

uint8_t ReportDescParser2::ParseItem(uint8_t **pp, uint16_t *pcntdn) {
        //uint8_t	ret = enErrorSuccess;

        switch (itemParseState) {
                case 0:
                        if (**pp == HID_LONG_ITEM_PREFIX)
                                USBTRACE("\r\nLONG\r\n");
                        else {
                                uint8_t size = ((**pp) & DATA_SIZE_MASK);
                                itemPrefix = (**pp);
                                itemSize = 1 + ((size == DATA_SIZE_4) ? 4 : size);
                        }
                        (*pp)++;
                        (*pcntdn)--;
                        itemSize--;
                        itemParseState = 1;

                        if (!itemSize)
                                break;

                        if (!pcntdn)
                                return enErrorIncomplete;
                case 1:
                        theBuffer.valueSize = itemSize;
                        valParser.Initialize(&theBuffer);
                        itemParseState = 2;
                case 2:
                        if (!valParser.Parse(pp, pcntdn))
                                return enErrorIncomplete;
                        itemParseState = 3;
                case 3:
                {
                        uint8_t data = *((uint8_t*)varBuffer);

                        switch (itemPrefix & (TYPE_MASK | TAG_MASK)) {
                                case (TYPE_LOCAL | TAG_LOCAL_USAGE):
                                        if (pfUsage) {
                                                if (theBuffer.valueSize > 1)
                                                        pfUsage(*((uint16_t*)varBuffer));
                                                else
                                                        pfUsage(data);
                                        }
                                        break;
                                case (TYPE_GLOBAL | TAG_GLOBAL_REPORTSIZE):
                                        rptSize = data;
                                        break;
                                case (TYPE_GLOBAL | TAG_GLOBAL_REPORTCOUNT):
                                        rptCount = data;
                                        break;
                                case (TYPE_GLOBAL | TAG_GLOBAL_REPORTID):
                                        rptId = data;
                                        break;
                                case (TYPE_LOCAL | TAG_LOCAL_USAGEMIN):
                                        useMin = data;
                                        break;
                                case (TYPE_LOCAL | TAG_LOCAL_USAGEMAX):
                                        useMax = data;
                                        break;
                                case (TYPE_GLOBAL | TAG_GLOBAL_USAGEPAGE):
                                        SetUsagePage(data);
                                        break;
                                case (TYPE_MAIN | TAG_MAIN_OUTPUT):
                                case (TYPE_MAIN | TAG_MAIN_FEATURE):
                                        rptSize = 0;
                                        rptCount = 0;
                                        useMin = 0;
                                        useMax = 0;
                                        break;
                                case (TYPE_MAIN | TAG_MAIN_INPUT):
                                        OnInputItem(data);

                                        totalSize += (uint16_t)rptSize * (uint16_t)rptCount;

                                        rptSize = 0;
                                        rptCount = 0;
                                        useMin = 0;
                                        useMax = 0;
                                        break;
                        } // switch (**pp & (TYPE_MASK | TAG_MASK))
                }
        } // switch (itemParseState)
        itemParseState = 0;
        return enErrorSuccess;
}

void ReportDescParser2::OnInputItem(uint8_t itm) {
        uint8_t byte_offset = (totalSize >> 3); // calculate offset to the next unhandled byte i = (int)(totalCount / 8);
        uint32_t tmp = (byte_offset << 3);
        uint8_t bit_offset = totalSize - tmp; // number of bits in the current byte already handled
        uint8_t *p = pBuf + byte_offset; // current byte pointer

        if (bit_offset)
                *p >>= bit_offset;

        uint8_t usage = useMin;

        bool print_usemin_usemax = ((useMin < useMax) && ((itm & 3) == 2) && pfUsage) ? true : false;

        uint8_t bits_of_byte = 8;

        // for each field in field array defined by rptCount
        for (uint8_t field = 0; field < rptCount; field++, usage++) {

                union {
                        uint8_t bResult[4];
                        uint16_t wResult[2];
                        uint32_t dwResult;
                } result;

                result.dwResult = 0;
                uint8_t mask = 0;

                if (print_usemin_usemax)
                        pfUsage(usage);

                // bits_left		- number of bits in the field(array of fields, depending on Report Count) left to process
                // bits_of_byte		- number of bits in current byte left to process
                // bits_to_copy		- number of bits to copy to result buffer

                // for each bit in a field
                for (uint8_t bits_left = rptSize, bits_to_copy = 0; bits_left;
                        bits_left -= bits_to_copy) {
                        bits_to_copy = (bits_left > bits_of_byte) ? bits_of_byte : bits_left;

                        result.dwResult <<= bits_to_copy; // Result buffer is shifted by the number of bits to be copied into it

                        uint8_t val = *p;

                        val >>= (8 - bits_of_byte); // Shift by the number of bits already processed

                        mask = 0;

                        for (uint8_t j = bits_to_copy; j; j--) {
                                mask <<= 1;
                                mask |= 1;
                        }

                        result.bResult[0] = (result.bResult[0] | (val & mask));

                        bits_of_byte -= bits_to_copy;

                        if (bits_of_byte < 1) {
                                bits_of_byte = 8;
                                p++;
                        }
                }
                PrintByteValue(result.dwResult);
        }
        E_Notify(PSTR("\r\n"), 0x80);
}

void UniversalReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf) {
        ReportDescParser2 prs(len, buf);

        uint8_t ret = hid->GetReportDescr(0, &prs);

        if (ret)
                ErrorMessage<uint8_t > (PSTR("GetReportDescr-2"), ret);
}


text:
#ifndef _MObjectSetMessage
#define _MObjectSetMessage
//
//-
// ==========================================================================
// Copyright (C) 1995 - 2005 Alias Systems Corp. and/or its licensors.  All
// rights reserved.
//
// The coded instructions, statements, computer programs, and/or related
// material (collectively the "Data") in these files contain unpublished
// information proprietary to Alias Systems Corp. ("Alias") and/or its
// licensors, which is protected by Canadian and US federal copyright law and
// by international treaties.
//
// The Data may not be disclosed or distributed to third parties or be copied
// or duplicated, in whole or in part, without the prior written consent of
// Alias.
//
// THE DATA IS PROVIDED "AS IS". ALIAS HEREBY DISCLAIMS ALL WARRANTIES RELATING
// TO THE DATA, INCLUDING, WITHOUT LIMITATION, ANY AND ALL EXPRESS OR IMPLIED
// WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE. IN NO EVENT SHALL ALIAS BE LIABLE FOR ANY DAMAGES
// WHATSOEVER, WHETHER DIRECT, INDIRECT, SPECIAL, OR PUNITIVE, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, OR IN EQUITY,
// ARISING OUT OF ACCESS TO, USE OF, OR RELIANCE UPON THE DATA.
// ==========================================================================
//+
// *****************************************************************************
//
// CLASS:    MObjectSetMessage
//
// *****************************************************************************
//
// CLASS DESCRIPTION (MObjectSetMessage)
//
// This class is used to register callbacks with set specific event types.
// Using the addCallback() methods, a function can be registered that will
// be executed whenever the callback specific message/event occurs.
//
// To remove a callback, use MMessage::removeCallback(). All callbacks that
// are registered by a plug-in must be removed by that plug-in when it is
// unloaded. Failure to do so will result in a fatal error.
//
// *****************************************************************************

#if defined __cplusplus

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

// INCLUDED HEADER FILES

#include <maya/MMessage.h>

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

// DECLARATIONS

class MObject;

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

// CLASS DECLARATION (MObjectSetMessage)

/// Object Set Messages
/**
*/
#ifdef _WIN32
#pragma warning(disable: 4522)
#endif // _WIN32

class OPENMAYA_EXPORT MObjectSetMessage : public MMessage
{
public:
	///
	static MCallbackId	addSetMembersModifiedCallback(
								MObject& node,
								void (*func)( MObject& node,
											  void* clientData ),
								void * clientData = NULL,
								MStatus * ReturnStatus = NULL );

private:
	static const char* className();
};

#ifdef _WIN32
#pragma warning(default: 4522)
#endif // _WIN32

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

#endif /* __cplusplus */
#endif /* _MObjectSetMessage */

redpajama_set_name: RedPajamaGithub


text:
module RestArea
  class Engine < ::Rails::Engine
    isolate_namespace RestArea
  end
end


text:
class PlayController < ApplicationController
  before_action :require_login
end


text:
require "spec_helper"

describe Git do
  describe "BIN" do
    it "should set binary path" do
      expect(::Git::BIN).to match(/git/)
    end
  end

  describe "#initialize" do
  end

  describe "#fetch" do
  end

  describe "#pull" do
  end

  describe "#log" do
    git = Git.new

    it "should get history of git repository" do
      expect(git.log).to be_a_kind_of(String)
    end
  end

  describe "#parse_log" do
    git = Git.new
    it "should return blob objects" do
      expect(git.blobs).to eq([])
      git.parse_log(git.log)
      expect(git.blobs).to be_a_kind_of(Array)
    end
  end

end


text:
require 'spec_helper'

describe Sqs::Client do
  let(:client) do
    Sqs::Client.new(:config => { :access_key_id => "abc", :secret_access_key => "def" })
  end

  it "retries if there is a problem with sending request" do
    count = 0
    stub_request(:put, /.*/).to_raise(Timeout::Error).with do |request|
      count += 1
    end

    expect {
      client.put("/")
    }.to raise_error

    count.should == 3
  end

  context "#create_queue" do
    it "throws error if there is any problem with request" do
      body = sample_response("error")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=CreateQueue/ &&
          request.uri.to_s =~ /QueueName=foo/
      end.to_return(:status => 404, :body => body)

      expect {
        client.create_queue("foo")
      }.to raise_error { |error| error.should be_a_kind_of(Sqs::RequestError) }
    end

    it "makes a request to create and returns a queue" do
      body = sample_response("create_queue")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=CreateQueue/ &&
          request.uri.to_s =~ /QueueName=foo/
      end.to_return(:status => 200, :body => body)

      queue = client.create_queue("foo")
      queue.name.should == "foo"
      queue.url.should  == "http://sqs.us-east-1.amazonaws.com/123456789012/foo"
    end

    it "passes the options for creation (camel cased)" do
      body = sample_response("create_queue")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=CreateQueue/ &&
          request.uri.to_s =~ /QueueName=foo/ &&
          request.uri.to_s =~ /MaximumMessageSize=1/
      end.to_return(:status => 200, :body => body)

      queue = client.create_queue("foo", :maximum_message_size => 1)
      queue.name.should == "foo"
    end
  end

  context "#get_queue" do
    it "returns nil if queue can't be found" do
      body = sample_response("queue_not_found")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=GetQueueUrl/ &&
          request.uri.to_s =~ /QueueName=foo/
      end.to_return(:status => 404, :body => body)

      client.get_queue("foo").should == nil
    end

    it "throws error if there is any problem with request" do
      body = sample_response("error")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=GetQueueUrl/ &&
          request.uri.to_s =~ /QueueName=foo/
      end.to_return(:status => 500, :body => body)

      expect {
        client.get_queue("foo")
      }.to raise_error { |error| error.should be_a_kind_of(Sqs::RequestError) }
    end

    it "returns a queue" do
      body = sample_response("get_queue_url")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=GetQueueUrl/ &&
          request.uri.to_s =~ /QueueName=foo/
      end.to_return(:status => 200, :body => body)

      queue = client.get_queue("foo")
      queue.name.should == "foo"
      queue.url.should  == "http://sqs.us-east-1.amazonaws.com/123456789012/foo"
    end
  end

  context "#receive_message" do
    it "throws error if there is any problem with request" do
      body = sample_response("error")
      queue = Sqs::Queue.new("foo", "https://queue.url/queue/foo")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=ReceiveMessage/
      end.to_return(:status => 404, :body => body)

      expect {
        client.receive_message(queue)
      }.to raise_error { |error| error.should be_a_kind_of(Sqs::RequestError) }
    end

    it "returns a message" do
      body = sample_response("receive_message")
      queue = Sqs::Queue.new("foo", "https://queue.url/queue/foo")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=ReceiveMessage/ &&
          request.uri.to_s =~ /https:\/\/queue.url:443\/queue\/foo/
      end.to_return(:status => 200, :body => body)

      message = client.receive_message(queue)
      message.receipt_handle.should == "MbZj6wDWli"
      message.id.should == "5fea7756-0ea4-451a-a703-a558b933e274"
      message.body.should == "This is a test message"
    end

    context "without any messages returned" do
      it "returns nil" do
        body = sample_response("empty_message")
        queue = Sqs::Queue.new("foo", "https://queue.url/queue/foo")

        stub_request(:get, /.*/).with do |request|
          request.uri.to_s =~ /Action=ReceiveMessage/ &&
            request.uri.to_s =~ /https:\/\/queue.url:443\/queue\/foo/
        end.to_return(:status => 200, :body => body)

        client.receive_message(queue).should be_nil
      end
    end
  end

  context "#send_message" do
    it "throws error if there is any problem with request" do
      body = sample_response("error")
      queue = Sqs::Queue.new("foo", "https://queue.url/queue/foo")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=SendMessage/
      end.to_return(:status => 404, :body => body)

      expect {
        client.send_message(queue, "foo")
      }.to raise_error { |error| error.should be_a_kind_of(Sqs::RequestError) }
    end

    it "sends and returns mesage" do
      body = sample_response("send_message")
      queue = Sqs::Queue.new("foo", "https://queue.url/queue/foo")

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=SendMessage/ &&
          request.uri.to_s =~ /MessageBody=message-body/ &&
          request.uri.to_s =~ /https:\/\/queue.url:443\/queue\/foo/
      end.to_return(:status => 200, :body => body)

      message = client.send_message(queue, "message-body")
      message.id.should == "5fea7756-0ea4-451a-a703-a558b933e274"
    end
  end

  context "#delete_message" do
    it "throws error if there is any problem with request" do
      body = sample_response("error")
      queue = Sqs::Queue.new("foo", "https://queue.url/queue/foo")
      message = Sqs::Message.new(queue, { :receipt_handle => "abc123" })

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=DeleteMessage/
      end.to_return(:status => 404, :body => body)

      expect {
        client.delete_message(message)
      }.to raise_error { |error| error.should be_a_kind_of(Sqs::RequestError) }
    end

    it "deletes a message" do
      body = sample_response("delete_message")
      queue = Sqs::Queue.new("foo", "https://queue.url/queue/foo")
      message = Sqs::Message.new(queue, { :receipt_handle => "abc123" })

      stub_request(:get, /.*/).with do |request|
        request.uri.to_s =~ /Action=DeleteMessage/ &&
          request.uri.to_s =~ /https:\/\/queue.url:443\/queue\/foo/ &&
          request.uri.to_s =~ /ReceiptHandle=abc123/
      end.to_return(:status => 200, :body => body)

      client.delete_message(message).should be_true
    end
  end
end


text:
using PaintTracker.Core.DependencyInterfaces;
using PaintTracker.Core.Services;
using PaintTracker.Core.ViewModels;
using PaintTracker.Core.Views;
using Xamarin.Forms;

namespace PaintTracker.Core.IoC
{
    public static class ContainerRegister
    {
        public static void InitialiseContainer(Container container)
        {
            var dbConn = DependencyService.Get<IDatabaseConnection>();
            container.RegisterInstance(dbConn);

            var sqlConn = dbConn.GetConnection();
            container.RegisterInstance(sqlConn);

            // TODO: Find a way to have Unity search for implementations automatically
            container.RegisterType<IView<AboutVM>, AboutPage>();
            container.RegisterType<IView<PaintsVM>, PaintPage>();
            container.RegisterType<IView<SearchPaintsVM>, SearchPage>();
            container.RegisterType<IView<SettingsVM>, SettingsPage>();
            container.RegisterType<IView<ErrorVM>, ErrorPage>();

            container.RegisterType<NavigationService>(true);
            container.RegisterType<ViewModelService>(true);
            container.RegisterType<DataCache>(true);

            container.RegisterType<HtmlParser>(false);
            container.RegisterType<UpdateService>(false);

            container.RegisterInstance(container);

            container.RegisterType<PaintGroupVM>(false);
            container.RegisterType<PaintDataVM>(false);

            var settings = DependencyService.Get<IAppSettings>();
            container.RegisterInstance(settings);

            var messageSender = DependencyService.Get<IExternalMessageSender>();
            container.RegisterInstance(messageSender);

            var credentialVault = DependencyService.Get<ICredentialVault>();
            container.RegisterInstance(credentialVault);

            var progressDialog = DependencyService.Get<IProgressDialog>();
            container.RegisterInstance(progressDialog);

            var oneDriveWebAuthenticationUI = DependencyService.Get<IOneDriveWebUI>();
            container.RegisterInstance(oneDriveWebAuthenticationUI);

            var dropboxWebAuthenticationUI = DependencyService.Get<IDropboxWebUI>();
            container.RegisterInstance(dropboxWebAuthenticationUI);
        }
    }
}


text:
package com.ideaknow.api.client.model.transfer;

import android.os.Parcel;
import android.os.Parcelable;
import com.ideaknow.api.client.model.AccountModel;
import com.ideaknow.api.client.model.AmountModel;
import com.ideaknow.api.client.model.CardModel;

public class AccountTransferToCardModel implements Parcelable {

    private CardModel card;
    private AccountModel account;
    private AmountModel amount;

    public AccountTransferToCardModel() {

    }

    public CardModel getCard() {
        return card;
    }

    public void setCard(CardModel card) {
        this.card = card;
    }

    public AccountModel getAccount() {
        return account;
    }

    public void setAccount(AccountModel account) {
        this.account = account;
    }

    public AmountModel getAmount() {
        return amount;
    }

    public void setAmount(AmountModel amount) {
        this.amount = amount;
    }

    @Override
    public String toString() {
        return "AccountTransferToCardModel{" +
                "card=" + card +
                ", account=" + account +
                ", amount=" + amount +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.card, 0);
        dest.writeParcelable(this.account, 0);
        dest.writeParcelable(this.amount, 0);
    }

    private AccountTransferToCardModel(Parcel in) {
        this.card = in.readParcelable(CardModel.class.getClassLoader());
        this.account = in.readParcelable(AccountModel.class.getClassLoader());
        this.amount = in.readParcelable(AmountModel.class.getClassLoader());
    }

    public static final Parcelable.Creator<AccountTransferToCardModel> CREATOR = new Parcelable.Creator<AccountTransferToCardModel>() {
        public AccountTransferToCardModel createFromParcel(Parcel source) {
            return new AccountTransferToCardModel(source);
        }

        public AccountTransferToCardModel[] newArray(int size) {
            return new AccountTransferToCardModel[size];
        }
    };
}


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

namespace TestSystem.Common.Helpers
{
    public static class ExceptionHelpers
    {
        public static void ThrowIfNotEnum<TEnum>()
            where TEnum : struct
        {
            if (!typeof(TEnum).IsEnum)
            {
                throw new Exception($"Invalid generic method argument of type {typeof(TEnum)}");
            }
        }

        public static void ThrowIfNull<T>(this T source, Exception exception)
            where T : class
        {
            if(source == null)
            {
                throw exception;
            }
        }

        public static void ThrowIfNull<T>(this Nullable<T> source, Exception exception)
            where T : struct
        {
            if(!source.HasValue)
            {
                throw exception;
            }
        }
    }
}


text:
using System;
using System.Collections;
using NUnit.Core;
using NUnit.Framework;

namespace NUnit.Util.Tests
{
	[TestFixture]
	public class EventDispatcherTests
	{
		private TestEventDispatcher dispatcher;
		private TestEventCatcher catcher;
		private TestInfo test;
		private TestResult result;
		private Exception exception;

		private readonly string FILENAME = "MyTestFileName";
		private readonly string TESTNAME = "MyTestName";
		private readonly string MESSAGE = "My message!";

		[SetUp]
		public void SetUp()
		{
			dispatcher = new TestEventDispatcher();
			catcher = new TestEventCatcher( dispatcher );
			test = new TestInfo( new TestSuite( TESTNAME ) );
			result = new TestResult( test );
			exception = new Exception( MESSAGE );
		}

		[Test]
		public void ProjectLoading()
		{
			dispatcher.FireProjectLoading( FILENAME );
			CheckEvent( TestAction.ProjectLoading, FILENAME );
		}

		[Test]
		public void ProjectLoaded()
		{
			dispatcher.FireProjectLoaded( FILENAME );
			CheckEvent( TestAction.ProjectLoaded, FILENAME );
		}

		[Test]
		public void ProjectLoadFailed()
		{
			dispatcher.FireProjectLoadFailed( FILENAME, exception );
			CheckEvent( TestAction.ProjectLoadFailed, FILENAME, exception );
		}

		[Test]
		public void ProjectUnloading()
		{
			dispatcher.FireProjectUnloading( FILENAME );
			CheckEvent( TestAction.ProjectUnloading, FILENAME );
		}

		[Test]
		public void ProjectUnloaded()
		{
			dispatcher.FireProjectUnloaded( FILENAME );
			CheckEvent( TestAction.ProjectUnloaded, FILENAME );
		}

		[Test]
		public void ProjectUnloadFailed()
		{
			dispatcher.FireProjectUnloadFailed( FILENAME, exception );
			CheckEvent( TestAction.ProjectUnloadFailed, FILENAME, exception );
		}

		[Test]
		public void TestLoading()
		{
			dispatcher.FireTestLoading( FILENAME );
			CheckEvent( TestAction.TestLoading, FILENAME );
		}

		[Test]
		public void TestLoaded()
		{
			dispatcher.FireTestLoaded( FILENAME, test );
			CheckEvent( TestAction.TestLoaded, FILENAME, test );
		}

		[Test]
		public void TestLoadFailed()
		{
			dispatcher.FireTestLoadFailed( FILENAME, exception );
			CheckEvent( TestAction.TestLoadFailed, FILENAME, exception );
		}

		[Test]
		public void TestUnloading()
		{
			dispatcher.FireTestUnloading( FILENAME );
			CheckEvent( TestAction.TestUnloading, FILENAME );
		}

		[Test]
		public void TestUnloaded()
		{
			dispatcher.FireTestUnloaded( FILENAME );
			CheckEvent( TestAction.TestUnloaded, FILENAME );
		}

		[Test]
		public void TestUnloadFailed()
		{
			dispatcher.FireTestUnloadFailed( FILENAME, exception );
			CheckEvent( TestAction.TestUnloadFailed, FILENAME, exception );
		}

		[Test]
		public void TestReloading()
		{
			dispatcher.FireTestReloading( FILENAME );
			CheckEvent( TestAction.TestReloading, FILENAME );
		}

		[Test]
		public void TestReloaded()
		{
			dispatcher.FireTestReloaded( FILENAME, test );
			CheckEvent( TestAction.TestReloaded, FILENAME, test );
		}

		[Test]
		public void TestReloadFailed()
		{
			dispatcher.FireTestReloadFailed( FILENAME, exception );
			CheckEvent( TestAction.TestReloadFailed, FILENAME, exception );
		}

		[Test]
		public void RunStarting()
		{
			dispatcher.FireRunStarting( test.TestName.FullName, test.TestCount );
			CheckEvent( TestAction.RunStarting, test.TestName.FullName, test.TestCount );
		}

		[Test]
		public void RunFinished()
		{
			dispatcher.FireRunFinished( result );
			CheckEvent( TestAction.RunFinished, result );
		}

		[Test]
		public void RunFailed()
		{
			dispatcher.FireRunFinished( exception );
			CheckEvent( TestAction.RunFinished, exception );
		}

		[Test]
		public void SuiteStarting()
		{
			dispatcher.FireSuiteStarting( test.TestName );
			CheckEvent( TestAction.SuiteStarting, test.TestName );
		}

		[Test]
		public void SuiteFinished()
		{
			dispatcher.FireSuiteFinished( result );
			CheckEvent( TestAction.SuiteFinished, result );
		}

		[Test]
		public void TestStarting()
		{
			dispatcher.FireTestStarting( test.TestName );
			CheckEvent( TestAction.TestStarting, test.TestName );
		}

		[Test]
		public void TestFinished()
		{
			dispatcher.FireTestFinished( result );
			CheckEvent( TestAction.TestFinished, result );
		}

		private void CheckEvent( TestAction action )
		{
			Assert.AreEqual( 1, catcher.Events.Count );
			Assert.AreEqual( action, ((TestEventArgs)catcher.Events[0]).Action );
		}

		private void CheckEvent( TestAction action, string fileName )
		{
			CheckEvent( action );
			Assert.AreEqual( fileName, ((TestEventArgs)catcher.Events[0]).Name );
		}

		private void CheckEvent( TestAction action, string fileName, int testCount )
		{
			CheckEvent( action, fileName );
			Assert.AreEqual( testCount, ((TestEventArgs)catcher.Events[0]).TestCount );
		}

		private void CheckEvent( TestAction action, string fileName, TestInfo test )
		{
			CheckEvent( action, fileName );
			Assert.AreEqual( TESTNAME, ((TestEventArgs)catcher.Events[0]).Test.TestName.Name );
		}

		private void CheckEvent( TestAction action, string fileName, Exception exception )
		{
			CheckEvent( action, fileName );
			Assert.AreEqual( MESSAGE, ((TestEventArgs)catcher.Events[0]).Exception.Message );
		}

		private void CheckEvent( TestAction action, TestName testName )
		{
			CheckEvent( action );
			Assert.AreEqual( TESTNAME, ((TestEventArgs)catcher.Events[0]).TestName.Name );
		}

		private void CheckEvent( TestAction action, TestResult result )
		{
			CheckEvent( action );
			Assert.AreEqual( TESTNAME, result.Name );
		}

		private void CheckEvent( TestAction action, Exception exception )
		{
			CheckEvent( TestAction.RunFinished );
			Assert.AreEqual( MESSAGE, ((TestEventArgs)catcher.Events[0]).Exception.Message );
		}
	}
}


text:
<?php

namespace Doctrine\MongoDB\Tests\Event;

use Doctrine\MongoDB\Event\EventArgs;

class EventArgsTest extends \PHPUnit_Framework_TestCase
{
    public function testEventArgs()
    {
        $invoker = new \stdClass();
        $data = array('ok' => 1);
        $options = array('w' => 1);

        $eventArgs = new EventArgs($invoker, $data, $options);

        $this->assertSame($invoker, $eventArgs->getInvoker());
        $this->assertSame($data, $eventArgs->getData());
        $this->assertSame($options, $eventArgs->getOptions());
    }
}


text:
//
//  CBJ3DLabelViewController.m
//  Art font Demo
//
//  Created by 超八机 on 2017/9/2.
//  Copyright © 2017年 Hacky. All rights reserved.
//

#import "CBJ3DLabelViewController.h"
#import "CBJ3DLabel.h"

@interface CBJ3DLabelViewController ()

@property (weak, nonatomic) CBJ3DLabel *cbj3DLabel;
@property (weak, nonatomic) IBOutlet UISlider *drawDepthSlider;
@property (weak, nonatomic) IBOutlet UISlider *orientationSlider;

@end

@implementation CBJ3DLabelViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    CBJ3DLabel *cbj3DLabel = [[CBJ3DLabel alloc] initWithFrame:CGRectMake(0, 100, CGRectGetWidth(self.view.frame), 100)];
    cbj3DLabel.textAlignment = NSTextAlignmentCenter;
    cbj3DLabel.font = [UIFont systemFontOfSize:60.f];
    cbj3DLabel.text = @"3DTEXT";
    self.cbj3DLabel = cbj3DLabel;

    [self.view addSubview:self.cbj3DLabel];

    [self.colorView addSegmentControl:@[@"subjectColor",@"bottomBlurColor"]];

    [self commonInit];

}

- (void)commonInit
{
    [self.orientationSlider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
    [self.drawDepthSlider addTarget:self action:@selector(sliderValueChanged:) forControlEvents:UIControlEventValueChanged];
}

- (void)sliderValueChanged:(UISlider *)slider
{

    if (slider == self.orientationSlider) {

        self.cbj3DLabel.orientation = (NSUInteger)(self.orientationSlider.value + 0.5f);

    }else{

        self.cbj3DLabel.drawDepth = (NSUInteger)(self.drawDepthSlider.value + 0.5f);
    }
    [self updateInfo];
}

- (void)didSelectColor:(UIColor *)color forKey:(NSString *)key
{
    if ([key isEqualToString:@"subjectColor"]) {

        self.cbj3DLabel.subjectColor = color;

    }else{

        self.cbj3DLabel.bottomBlurColor = color;

    }
    [self updateInfo];
}

- (NSString *)getStyleString
{
    NSString *subjColorStr = [self hexStringFromColor:self.cbj3DLabel.subjectColor];
    NSString *bottomBlurColorStr = [self hexStringFromColor:self.cbj3DLabel.bottomBlurColor];

    NSString *style = [NSString stringWithFormat:@"3DLabel \n SubJectColor: %@ \n BottomBlurColor: %@ \n Orientation: %lu \n DrawDepth: %lu",subjColorStr, bottomBlurColorStr, (unsigned long)self.cbj3DLabel.orientation, (unsigned long)self.cbj3DLabel.drawDepth];
    return style;

}

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

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical">

    <com.google.android.material.tabs.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabTextColor="@android:color/white"
        app:tabIndicatorHeight="2dp"
        app:tabIndicatorColor="@android:color/white"
        app:tabMode="fixed"
        app:tabGravity="fill"/>

    <androidx.viewpager.widget.ViewPager
        android:id="@+id/pager"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1">
    </androidx.viewpager.widget.ViewPager>

</LinearLayout>


text:
namespace arc {
namespace input_overlay {

// Display mode for display overlay.
enum class DisplayMode {
  kNone,
  // Display overlay can receive events but action labels can't be focused.
  // It shows educational dialog.
  kEducation,
  // Display overlay can't receive any events. It shows input mappings as in
  // view mode and menu anchor.
  kView,
  // Display overlay can receive events and action labels can be focused. It
  // shows input mapping in edit mode.
  kEdit,
  // Display overlay can receive events. This is the mode before entering into
  // |kMenu|.
  kPreMenu,
  // Display overlay can receive events but action labels can't be focused.
  // It shows expanded menu and input mapping as in view mode.
  kMenu,

  // Below are related to edit for |ActionView|.
  // Edit mode when action is assigned a pending input binding.
  kEditedSuccess,
  // Edit mode when an action is removed the input binding.
  kEditedUnbound,
  // Edit mode when a wrong/unsupported input is trying to bind.
  kEditedError,
  // Restore mode when restoring the default input bindings.
  kRestore,
};

// Binding options for different ui display stages.
enum class BindingOption {
  // Current input binding in active.
  kCurrent,
  // Original default input binding provided by Google.
  kOriginal,
  // Pending input binding generated during the binding editing before it is
  // saved.
  kPending,
};

// Action types according to the touch events.
enum class ActionType {
  // |kTap| involves touch down and up.
  kTap,
  // |kMove| involves touch down, move and up.
  kMove,
};

// Message types for UI displaying different types of messages.
enum class MessageType {
  // |kInfo| is the type for info message.
  kInfo,
  // |kError| is the type for error message.
  kError,
  // |kInfoLabelFocus| is the type for info message when the |ActionLabel| is
  // focused.
  kInfoLabelFocus,
};

// Position type enum.
enum class PositionType {
  // Default position type.
  kDefault = 0,
  // Dependent position type which x or y value depend on the other one.
  kDependent = 1,
};

}  // namespace input_overlay
}  // namespace arc

#endif  // CHROME_BROWSER_ASH_ARC_INPUT_OVERLAY_CONSTANTS_H_


text:
const iifeExpression =
    new RegExp('^(var (\\S+) = )(\\(function \\(\\) \\{\\n(?:    ' +
        '(?:\\/\\*\\*| \\*|\\*\\/|\\/\\/)[^\\n]*\\n)*    function \\2\\([^\\)]*\\) \\{\\n)', 'mg');

/**
 * Adds `@__PURE__` annotation comments to IIFEs containing ES5-downleveled classes generated by
 * TypeScript so that Uglify can tree-shake classes that are not referenced.
 *
 * @param fileContent The content of the file for which `@__PURE__` will be added.
 * @returns The content of the file with `@__PURE__` annotations added.
 */
export function addPureAnnotations(fileContent: string) {
  return fileContent
      // Prefix downleveled classes w/ the @__PURE__ annotation.
      .replace(iifeExpression, '$1/*@__PURE__*/$3')
      // Prefix downleveled classes that extend another class w/ the @__PURE__ annotation
      .replace(
          /^(var (\S+) = )(\(function \(_super\) \{\n    __extends\(\2, _super\);\n)/mg,
          '$1/*@__PURE__*/$3'
      );
}


text:
"""Volteer configs."""

from __future__ import print_function

from chromite.lib import cros_logging as logging

BUILD_WORKON_PACKAGES = None

BUILD_PACKAGES = ('chromeos-bootimage',)

# TODO: Remove this line once VBoot is working on Volteer.
DEPLOY_SERVO_FORCE_FLASHROM = True

def get_commands(servo):
  """Get specific flash commands for Volteer

  Each board needs specific commands including the voltage for Vref, to turn
  on and turn off the SPI flash. The get_*_commands() functions provide a
  board-specific set of commands for these tasks. The voltage for this board
  needs to be set to 3.3 V.

  Args:
    servo (servo_lib.Servo): The servo connected to the target DUT.

  Returns:
    list: [dut_control_on, dut_control_off, flashrom_cmd, futility_cmd]
      dut_control*=2d arrays formmated like [["cmd1", "arg1", "arg2"],
                                             ["cmd2", "arg3", "arg4"]]
                     where cmd1 will be run before cmd2
      flashrom_cmd=command to flash via flashrom
      futility_cmd=command to flash via futility
  """
  dut_control_on = [['cpu_fw_spi:on']]
  dut_control_off = [['cpu_fw_spi:off']]
  if servo.is_v2:
    programmer = 'ft2232_spi:type=google-servo-v2,serial=%s' % servo.serial
  elif servo.is_micro:
    # TODO (jacobraz): remove warning once http://b/147679336 is resolved
    logging.warning('servo_micro has not been functioning properly consider '
                    'using a different servo if this fails')
    programmer = 'raiden_debug_spi:serial=%s' % servo.serial
  elif servo.is_ccd:
    # Note nothing listed for flashing with ccd_cr50 on go/volteer-care.
    # These commands were based off the commands for other boards.
    programmer = 'raiden_debug_spi:target=AP,serial=%s' % servo.serial
  else:
    raise Exception('%s not supported' % servo.version)

  futility_cmd = ['futility', 'update', '-p', programmer, '-i']
  flashrom_cmd = ['flashrom', '-p', programmer, '-w']

  return [dut_control_on, dut_control_off, flashrom_cmd, futility_cmd]