text:
// Copyright (c) 2013 Tony Wilson. All rights reserved.
// See LICENCE file for permissions and restrictions.

/*
Register all entry-points in kernel32.dll.

DLL entry-points are registered for use by the
API access functions of github.com/tHinqa/outside.

Note that all dll exported named entry-points are listed,
including those that are undocumented by the vendor.
*/
package kernel32

import "github.com/tHinqa/outside"

func init() {
	outside.AddEPs("kernel32.dll", false, EntryPoints)
	outside.AddEPs("kernel32.dll", true, UnicodeEntryPoints)
}

//TODO(t): Check Ws with no A counterparts and vv

var EntryPoints = outside.EPs{
	"ActivateActCtx",
	"AddAtomA",
	"AddConsoleAliasA",
	"AddLocalAlternateComputerNameA",
	"AddRefActCtx",
	"AddVectoredExceptionHandler",
	"AllocConsole",
	"AllocateUserPhysicalPages",
	"AreFileApisANSI",
	"AssignProcessToJobObject",
	"AttachConsole",
	"BackupRead",
	"BackupSeek",
	"BackupWrite",
	"BaseCheckAppcompatCache",
	"BaseCleanupAppcompatCache",
	"BaseCleanupAppcompatCacheSupport",
	"BaseDumpAppcompatCache",
	"BaseFlushAppcompatCache",
	"BaseInitAppcompatCache",
	"BaseInitAppcompatCacheSupport",
	"BaseProcessInitPostImport",
	"BaseQueryModuleData",
	"BaseUpdateAppcompatCache",
	"BasepCheckWinSaferRestrictions",
	"Beep",
	"BeginUpdateResourceA",
	"BindIoCompletionCallback",
	"BuildCommDCBA",
	"BuildCommDCBAndTimeoutsA",
	"CallNamedPipeA",
	"CancelDeviceWakeupRequest",
	"CancelIo",
	"CancelTimerQueueTimer",
	"CancelWaitableTimer",
	"ChangeTimerQueueTimer",
	"CheckNameLegalDOS8Dot3A",
	"CheckRemoteDebuggerPresent",
	"ClearCommBreak",
	"ClearCommError",
	"CloseConsoleHandle",
	"CloseHandle",
	"CloseProfileUserMapping",
	"CmdBatNotification",
	"CommConfigDialogA",
	"CompareFileTime",
	"CompareStringA",
	"ConnectNamedPipe",
	"ConsoleMenuControl",
	"ContinueDebugEvent",
	"ConvertDefaultLocale",
	"ConvertFiberToThread",
	"ConvertThreadToFiber",
	"CopyFileA",
	"CopyFileExA",
	"CopyLZFile",
	"CreateActCtxA",
	"CreateConsoleScreenBuffer",
	"CreateDirectoryA",
	"CreateDirectoryExA",
	"CreateEventA",
	"CreateFiber",
	"CreateFiberEx",
	"CreateFileA",
	"CreateFileMappingA",
	"CreateHardLinkA",
	"CreateIoCompletionPort",
	"CreateJobObjectA",
	"CreateJobSet",
	"CreateMailslotA",
	"CreateMemoryResourceNotification",
	"CreateMutexA",
	"CreateNamedPipeA",
	"CreateNlsSecurityDescriptor",
	"CreatePipe",
	"CreateProcessA",
	"CreateProcessInternalA",
	"CreateRemoteThread",
	"CreateSemaphoreA",
	"CreateSocketHandle",
	"CreateTapePartition",
	"CreateThread",
	"CreateTimerQueue",
	"CreateTimerQueueTimer",
	"CreateToolhelp32Snapshot",
	"CreateVirtualBuffer",
	"CreateWaitableTimerA",
	"DeactivateActCtx",
	"DebugActiveProcess",
	"DebugActiveProcessStop",
	"DebugBreak",
	"DebugBreakProcess",
	"DebugSetProcessKillOnExit",
	"DecodePointer",
	"DecodeSystemPointer",
	"DefineDosDeviceA",
	"DelayLoadFailureHook",
	"DeleteAtom",
	"DeleteCriticalSection",
	"DeleteFiber",
	"DeleteFileA",
	"DeleteTimerQueue",
	"DeleteTimerQueueEx",
	"DeleteTimerQueueTimer",
	"DeleteVolumeMountPointA",
	"DeviceIoControl",
	"DisableThreadLibraryCalls",
	"DisconnectNamedPipe",
	"DnsHostnameToComputerNameA",
	"DosDateTimeToFileTime",
	"DosPathToSessionPathA",
	"DuplicateConsoleHandle",
	"DuplicateHandle",
	"EncodePointer",
	"EncodeSystemPointer",
	"EndUpdateResourceA",
	"EnterCriticalSection",
	"EnumCalendarInfoA",
	"EnumCalendarInfoExA",
	"EnumDateFormatsA",
	"EnumDateFormatsExA",
	"EnumLanguageGroupLocalesA",
	"EnumResourceLanguagesA",
	"EnumResourceNamesA",
	"EnumResourceTypesA",
	"EnumSystemCodePagesA",
	"EnumSystemGeoID",
	"EnumSystemLanguageGroupsA",
	"EnumSystemLocalesA",
	"EnumTimeFormatsA",
	"EnumUILanguagesA",
	"EnumerateLocalComputerNamesA",
	"EraseTape",
	"EscapeCommFunction",
	"ExitProcess",
	"ExitThread",
	"ExitVDM",
	"ExpandEnvironmentStringsA",
	"ExpungeConsoleCommandHistoryA",
	"ExtendVirtualBuffer",
	"FatalAppExitA",
	"FatalExit",
	"FileTimeToDosDateTime",
	"FileTimeToLocalFileTime",
	"FileTimeToSystemTime",
	"FillConsoleOutputAttribute",
	"FillConsoleOutputCharacterA",
	"FindActCtxSectionGuid",
	"FindActCtxSectionStringA",
	"FindAtomA",
	"FindClose",
	"FindCloseChangeNotification",
	"FindFirstChangeNotificationA",
	"FindFirstFileA",
	"FindFirstFileExA",
	"FindFirstVolumeA",
	"FindFirstVolumeMountPointA",
	"FindNextChangeNotification",
	"FindNextFileA",
	"FindNextVolumeA",
	"FindNextVolumeMountPointA",
	"FindResourceA",
	"FindResourceExA",
	"FindVolumeClose",
	"FindVolumeMountPointClose",
	"FlushConsoleInputBuffer",
	"FlushFileBuffers",
	"FlushInstructionCache",
	"FlushViewOfFile",
	"FoldStringA",
	"FormatMessageA",
	"FreeConsole",
	"FreeEnvironmentStringsA",
	"FreeLibrary",
	"FreeLibraryAndExitThread",
	"FreeResource",
	"FreeUserPhysicalPages",
	"FreeVirtualBuffer",
	"GenerateConsoleCtrlEvent",
	"GetACP",
	"GetAtomNameA",
	"GetBinaryType",
	"GetBinaryTypeA",
	"GetCPFileNameFromRegistry",
	"GetCPInfo",
	"GetCPInfoExA",
	"GetCalendarInfoA",
	"GetComPlusPackageInstallStatus",
	"GetCommConfig",
	"GetCommMask",
	"GetCommModemStatus",
	"GetCommProperties",
	"GetCommState",
	"GetCommTimeouts",
	"GetCommandLineA",
	"GetCompressedFileSizeA",
	"GetComputerNameA",
	"GetComputerNameExA",
	"GetConsoleAliasA",
	"GetConsoleAliasExesA",
	"GetConsoleAliasExesLengthA",
	"GetConsoleAliasesA",
	"GetConsoleAliasesLengthA",
	"GetConsoleCP",
	"GetConsoleCharType",
	"GetConsoleCommandHistoryA",
	"GetConsoleCommandHistoryLengthA",
	"GetConsoleCursorInfo",
	"GetConsoleCursorMode",
	"GetConsoleDisplayMode",
	"GetConsoleFontInfo",
	"GetConsoleFontSize",
	"GetConsoleHardwareState",
	"GetConsoleInputExeNameA",
	"GetConsoleInputWaitHandle",
	"GetConsoleKeyboardLayoutNameA",
	"GetConsoleMode",
	"GetConsoleNlsMode",
	"GetConsoleOutputCP",
	"GetConsoleProcessList",
	"GetConsoleScreenBufferInfo",
	"GetConsoleSelectionInfo",
	"GetConsoleTitleA",
	"GetConsoleWindow",
	"GetCurrencyFormatA",
	"GetCurrentActCtx",
	"GetCurrentConsoleFont",
	"GetCurrentDirectoryA",
	"GetCurrentProcess",
	"GetCurrentProcessId",
	"GetCurrentThread",
	"GetCurrentThreadId",
	"GetDateFormatA",
	"GetDefaultCommConfigA",
	"GetDefaultSortkeySize",
	"GetDevicePowerState",
	"GetDiskFreeSpaceA",
	"GetDiskFreeSpaceExA",
	"GetDllDirectoryA",
	"GetDriveTypeA",
	"GetEnvironmentStrings",
	"GetEnvironmentStringsA",
	"GetEnvironmentVariableA",
	"GetExitCodeProcess",
	"GetExitCodeThread",
	"GetExpandedNameA",
	"GetFileAttributesA",
	"GetFileAttributesExA",
	"GetFileInformationByHandle",
	"GetFileSize",
	"GetFileSizeEx",
	"GetFileTime",
	"GetFileType",
	"GetFirmwareEnvironmentVariableA",
	"GetFullPathNameA",
	"GetGeoInfoA",
	"GetHandleContext",
	"GetHandleInformation",
	"GetLargestConsoleWindowSize",
	"GetLastError",
	"GetLinguistLangSize",
	"GetLocalTime",
	"GetLocaleInfoA",
	"GetLogicalDriveStringsA",
	"GetLogicalDrives",
	"GetLogicalProcessorInformation",
	"GetLongPathNameA",
	"GetMailslotInfo",
	"GetModuleFileNameA",
	"GetModuleHandleA",
	"GetModuleHandleExA",
	"GetNamedPipeHandleStateA",
	"GetNamedPipeInfo",
	"GetNativeSystemInfo",
	"GetNextVDMCommand",
	"GetNlsSectionName",
	"GetNumaAvailableMemory",
	"GetNumaAvailableMemoryNode",
	"GetNumaHighestNodeNumber",
	"GetNumaNodeProcessorMask",
	"GetNumaProcessorMap",
	"GetNumaProcessorNode",
	"GetNumberFormatA",
	"GetNumberOfConsoleFonts",
	"GetNumberOfConsoleInputEvents",
	"GetNumberOfConsoleMouseButtons",
	"GetOEMCP",
	"GetOverlappedResult",
	"GetPriorityClass",
	"GetPrivateProfileIntA",
	"GetPrivateProfileSectionA",
	"GetPrivateProfileSectionNamesA",
	"GetPrivateProfileStringA",
	"GetPrivateProfileStructA",
	"GetProcAddress",
	"GetProcessAffinityMask",
	"GetProcessDEPPolicy",
	"GetProcessHandleCount",
	"GetProcessHeap",
	"GetProcessHeaps",
	"GetProcessId",
	"GetProcessIoCounters",
	"GetProcessPriorityBoost",
	"GetProcessShutdownParameters",
	"GetProcessTimes",
	"GetProcessVersion",
	"GetProcessWorkingSetSize",
	"GetProfileIntA",
	"GetProfileSectionA",
	"GetProfileStringA",
	"GetQueuedCompletionStatus",
	"GetShortPathNameA",
	"GetStartupInfoA",
	"GetStdHandle",
	"GetStringTypeA",
	"GetStringTypeExA",
	"GetSystemDEPPolicy",
	"GetSystemDefaultLCID",
	"GetSystemDefaultLangID",
	"GetSystemDefaultUILanguage",
	"GetSystemDirectoryA",
	"GetSystemInfo",
	"GetSystemPowerStatus",
	"GetSystemRegistryQuota",
	"GetSystemTime",
	"GetSystemTimeAdjustment",
	"GetSystemTimeAsFileTime",
	"GetSystemTimes",
	"GetSystemWindowsDirectoryA",
	"GetSystemWow64DirectoryA",
	"GetTapeParameters",
	"GetTapePosition",
	"GetTapeStatus",
	"GetTempFileNameA",
	"GetTempPathA",
	"GetThreadContext",
	"GetThreadIOPendingFlag",
	"GetThreadLocale",
	"GetThreadPriority",
	"GetThreadPriorityBoost",
	"GetThreadSelectorEntry",
	"GetThreadTimes",
	"GetTickCount",
	"GetTimeFormatA",
	"GetTimeZoneInformation",
	"GetUserDefaultLCID",
	"GetUserDefaultLangID",
	"GetUserDefaultUILanguage",
	"GetUserGeoID",
	"GetVDMCurrentDirectories",
	"GetVersion",
	"GetVersionExA",
	"GetVolumeInformationA",
	"GetVolumeNameForVolumeMountPointA",
	"GetVolumePathNameA",
	"GetVolumePathNamesForVolumeNameA",
	"GetWindowsDirectoryA",
	"GetWriteWatch",
	"GlobalAddAtomA",
	"GlobalAlloc",
	"GlobalCompact",
	"GlobalDeleteAtom",
	"GlobalFindAtomA",
	"GlobalFix",
	"GlobalFlags",
	"GlobalFree",
	"GlobalGetAtomNameA",
	"GlobalHandle",
	"GlobalLock",
	"GlobalMemoryStatus",
	"GlobalMemoryStatusEx",
	"GlobalReAlloc",
	"GlobalSize",
	"GlobalUnWire",
	"GlobalUnfix",
	"GlobalUnlock",
	"GlobalWire",
	"Heap32First",
	"Heap32ListFirst",
	"Heap32ListNext",
	"Heap32Next",
	"HeapAlloc",
	"HeapCompact",
	"HeapCreate",
	"HeapDestroy",
	"HeapExtend",
	"HeapFree",
	"HeapLock",
	"HeapQueryInformation",
	"HeapReAlloc",
	"HeapSetInformation",
	"HeapSize",
	"HeapSummary",
	"HeapUnlock",
	"HeapUsage",
	"HeapValidate",
	"HeapWalk",
	"InitAtomTable",
	"InitializeCriticalSection",
	"InitializeCriticalSectionAndSpinCount",
	"InitializeSListHead",
	"InterlockedCompareExchange",
	"InterlockedDecrement",
	"InterlockedExchange",
	"InterlockedExchangeAdd",
	"InterlockedFlushSList",
	"InterlockedIncrement",
	"InterlockedPopEntrySList",
	"InterlockedPushEntrySList",
	"InvalidateConsoleDIBits",
	"IsBadCodePtr",
	"IsBadHugeReadPtr",
	"IsBadHugeWritePtr",
	"IsBadReadPtr",
	"IsBadStringPtrA",
	"IsBadWritePtr",
	"IsDBCSLeadByte",
	"IsDBCSLeadByteEx",
	"IsDebuggerPresent",
	"IsProcessInJob",
	"IsProcessorFeaturePresent",
	"IsSystemResumeAutomatic",
	"IsValidCodePage",
	"IsValidLanguageGroup",
	"IsValidLocale",
	"IsValidUILanguage",
	"IsWow64Process",
	"LCMapStringA",
	"LZClose",
	"LZCloseFile",
	"LZCopy",
	"LZDone",
	"LZInit",
	"LZOpenFileA",
	"LZRead",
	"LZSeek",
	"LZStart",
	"LeaveCriticalSection",
	"LoadLibraryA",
	"LoadLibraryExA",
	"LoadModule",
	"LoadResource",
	"LocalAlloc",
	"LocalCompact",
	"LocalFileTimeToFileTime",
	"LocalFlags",
	"LocalFree",
	"LocalHandle",
	"LocalLock",
	"LocalReAlloc",
	"LocalShrink",
	"LocalSize",
	"LocalUnlock",
	"LockFile",
	"LockFileEx",
	"LockResource",
	"MapUserPhysicalPages",
	"MapUserPhysicalPagesScatter",
	"MapViewOfFile",
	"MapViewOfFileEx",
	"Module32First",
	"Module32Next",
	"MoveFileA",
	"MoveFileExA",
	"MoveFileWithProgressA",
	"MulDiv",
	"MultiByteToWideChar",
	"NlsConvertIntegerToString",
	"NlsGetCacheUpdateCount",
	"NlsResetProcessLocale",
	"NumaVirtualQueryNode",
	"OpenDataFile",
	"OpenEventA",
	"OpenFile",
	"OpenFileMappingA",
	"OpenJobObjectA",
	"OpenMutexA",
	"OpenProcess",
	"OpenProfileUserMapping",
	"OpenSemaphoreA",
	"OpenThread",
	"OpenWaitableTimerA",
	"OutputDebugStringA",
	"PeekConsoleInputA",
	"PeekNamedPipe",
	"PostQueuedCompletionStatus",
	"PrepareTape",
	"Process32First",
	"Process32Next",
	"ProcessIdToSessionId",
	"PulseEvent",
	"PurgeComm",
	"QueryDepthSList",
	"QueryDosDeviceA",
	"QueryInformationJobObject",
	"QueryMemoryResourceNotification",
	"QueryPerformanceCounter",
	"QueryPerformanceFrequency",
	"QueryWin31IniFilesMappedToRegistry",
	"QueueUserAPC",
	"QueueUserWorkItem",
	"RaiseException",
	"ReadConsoleA",
	"ReadConsoleInputA",
	"ReadConsoleInputExA",
	"ReadConsoleOutputA",
	"ReadConsoleOutputAttribute",
	"ReadConsoleOutputCharacterA",
	"ReadFile",
	"ReadFileEx",
	"ReadFileScatter",
	"ReadProcessMemory",
	"RegisterConsoleIME",
	"RegisterConsoleOS2",
	"RegisterConsoleVDM",
	"RegisterWaitForInputIdle",
	"RegisterWaitForSingleObject",
	"RegisterWaitForSingleObjectEx",
	"RegisterWowBaseHandlers",
	"RegisterWowExec",
	"ReleaseActCtx",
	"ReleaseMutex",
	"ReleaseSemaphore",
	"RemoveDirectoryA",
	"RemoveLocalAlternateComputerNameA",
	"RemoveVectoredExceptionHandler",
	"ReplaceFile",
	"ReplaceFileA",
	"RequestDeviceWakeup",
	"RequestWakeupLatency",
	"ResetEvent",
	"ResetWriteWatch",
	"RestoreLastError",
	"ResumeThread",
	"RtlCaptureContext",
	"RtlCaptureStackBackTrace",
	"RtlFillMemory",
	"RtlMoveMemory",
	"RtlUnwind",
	"RtlZeroMemory",
	"ScrollConsoleScreenBufferA",
	"SearchPathA",
	"SetCPGlobal",
	"SetCalendarInfoA",
	"SetClientTimeZoneInformation",
	"SetComPlusPackageInstallStatus",
	"SetCommBreak",
	"SetCommConfig",
	"SetCommMask",
	"SetCommState",
	"SetCommTimeouts",
	"SetComputerNameA",
	"SetComputerNameExA",
	"SetConsoleActiveScreenBuffer",
	"SetConsoleCP",
	"SetConsoleCommandHistoryMode",
	"SetConsoleCtrlHandler",
	"SetConsoleCursor",
	"SetConsoleCursorInfo",
	"SetConsoleCursorMode",
	"SetConsoleCursorPosition",
	"SetConsoleDisplayMode",
	"SetConsoleFont",
	"SetConsoleHardwareState",
	"SetConsoleIcon",
	"SetConsoleInputExeNameA",
	"SetConsoleKeyShortcuts",
	"SetConsoleLocalEUDC",
	"SetConsoleMaximumWindowSize",
	"SetConsoleMenuClose",
	"SetConsoleMode",
	"SetConsoleNlsMode",
	"SetConsoleNumberOfCommandsA",
	"SetConsoleOS2OemFormat",
	"SetConsoleOutputCP",
	"SetConsolePalette",
	"SetConsoleScreenBufferSize",
	"SetConsoleTextAttribute",
	"SetConsoleTitleA",
	"SetConsoleWindowInfo",
	"SetCriticalSectionSpinCount",
	"SetCurrentDirectoryA",
	"SetDefaultCommConfigA",
	"SetDllDirectoryA",
	"SetEndOfFile",
	"SetEnvironmentVariableA",
	"SetErrorMode",
	"SetEvent",
	"SetFileApisToANSI",
	"SetFileApisToOEM",
	"SetFileAttributesA",
	"SetFilePointer",
	"SetFilePointerEx",
	"SetFileShortNameA",
	"SetFileTime",
	"SetFileValidData",
	"SetFirmwareEnvironmentVariableA",
	"SetHandleContext",
	"SetHandleCount",
	"SetHandleInformation",
	"SetInformationJobObject",
	"SetLastConsoleEventActive",
	"SetLastError",
	"SetLocalPrimaryComputerNameA",
	"SetLocalTime",
	"SetLocaleInfoA",
	"SetMailslotInfo",
	"SetMessageWaitingIndicator",
	"SetNamedPipeHandleState",
	"SetPriorityClass",
	"SetProcessAffinityMask",
	"SetProcessDEPPolicy",
	"SetProcessPriorityBoost",
	"SetProcessShutdownParameters",
	"SetProcessWorkingSetSize",
	"SetStdHandle",
	"SetSystemPowerState",
	"SetSystemTime",
	"SetSystemTimeAdjustment",
	"SetTapeParameters",
	"SetTapePosition",
	"SetTermsrvAppInstallMode",
	"SetThreadAffinityMask",
	"SetThreadContext",
	"SetThreadExecutionState",
	"SetThreadIdealProcessor",
	"SetThreadLocale",
	"SetThreadPriority",
	"SetThreadPriorityBoost",
	"SetThreadUILanguage",
	"SetTimeZoneInformation",
	"SetTimerQueueTimer",
	"SetUnhandledExceptionFilter",
	"SetUserGeoID",
	"SetVDMCurrentDirectories",
	"SetVolumeLabelA",
	"SetVolumeMountPointA",
	"SetWaitableTimer",
	"SetupComm",
	"ShowConsoleCursor",
	"SignalObjectAndWait",
	"SizeofResource",
	"Sleep",
	"SleepEx",
	"SuspendThread",
	"SwitchToFiber",
	"SwitchToThread",
	"SystemTimeToFileTime",
	"SystemTimeToTzSpecificLocalTime",
	"TerminateJobObject",
	"TerminateProcess",
	"TerminateThread",
	"TermsrvAppInstallMode",
	"Thread32First",
	"Thread32Next",
	"TlsAlloc",
	"TlsFree",
	"TlsGetValue",
	"TlsSetValue",
	"Toolhelp32ReadProcessMemory",
	"TransactNamedPipe",
	"TransmitCommChar",
	"TrimVirtualBuffer",
	"TryEnterCriticalSection",
	"TzSpecificLocalTimeToSystemTime",
	"UTRegister",
	"UTUnRegister",
	"UnhandledExceptionFilter",
	"UnlockFile",
	"UnlockFileEx",
	"UnmapViewOfFile",
	"UnregisterConsoleIME",
	"UnregisterWait",
	"UnregisterWaitEx",
	"UpdateResourceA",
	"VDMConsoleOperation",
	"VDMOperationStarted",
	"ValidateLCType",
	"ValidateLocale",
	"VerLanguageNameA",
	"VerSetConditionMask",
	"VerifyConsoleIoHandle",
	"VerifyVersionInfoA",
	"VirtualAlloc",
	"VirtualAllocEx",
	"VirtualBufferExceptionHandler",
	"VirtualFree",
	"VirtualFreeEx",
	"VirtualLock",
	"VirtualProtect",
	"VirtualProtectEx",
	"VirtualQuery",
	"VirtualQueryEx",
	"VirtualUnlock",
	"WTSGetActiveConsoleSessionId",
	"WaitCommEvent",
	"WaitForDebugEvent",
	"WaitForMultipleObjects",
	"WaitForMultipleObjectsEx",
	"WaitForSingleObject",
	"WaitForSingleObjectEx",
	"WaitNamedPipeA",
	"WideCharToMultiByte",
	"WinExec",
	"WriteConsoleA",
	"WriteConsoleInputA",
	"WriteConsoleInputVDMA",
	"WriteConsoleOutputA",
	"WriteConsoleOutputAttribute",
	"WriteConsoleOutputCharacterA",
	"WriteFile",
	"WriteFileEx",
	"WriteFileGather",
	"WritePrivateProfileSectionA",
	"WritePrivateProfileStringA",
	"WritePrivateProfileStructA",
	"WriteProcessMemory",
	"WriteProfileSectionA",
	"WriteProfileStringA",
	"WriteTapemark",
	"ZombifyActCtx",
	"_hread",
	"_hwrite",
	"_lclose",
	"_lcreat",
	"_llseek",
	"_lopen",
	"_lread",
	"_lwrite",
	"lstrcat",
	"lstrcatA",
	"lstrcmp",
	"lstrcmpA",
	"lstrcmpi",
	"lstrcmpiA",
	"lstrcpy",
	"lstrcpyA",
	"lstrcpyn",
	"lstrcpynA",
	"lstrlen",
	"lstrlenA",
}

var UnicodeEntryPoints = outside.EPs{
	"AddAtomW",
	"AddConsoleAliasW",
	"AddLocalAlternateComputerNameW",
	"BeginUpdateResourceW",
	"BuildCommDCBAndTimeoutsW",
	"BuildCommDCBW",
	"CallNamedPipeW",
	"CheckNameLegalDOS8Dot3W",
	"CommConfigDialogW",
	"CompareStringW",
	"CopyFileExW",
	"CopyFileW",
	"CreateActCtxW",
	"CreateDirectoryExW",
	"CreateDirectoryW",
	"CreateEventW",
	"CreateFileMappingW",
	"CreateFileW",
	"CreateHardLinkW",
	"CreateJobObjectW",
	"CreateMailslotW",
	"CreateMutexW",
	"CreateNamedPipeW",
	"CreateProcessInternalW",
	"CreateProcessInternalWSecure",
	"CreateProcessW",
	"CreateSemaphoreW",
	"CreateWaitableTimerW",
	"DefineDosDeviceW",
	"DeleteFileW",
	"DeleteVolumeMountPointW",
	"DnsHostnameToComputerNameW",
	"DosPathToSessionPathW",
	"EndUpdateResourceW",
	"EnumCalendarInfoExW",
	"EnumCalendarInfoW",
	"EnumDateFormatsExW",
	"EnumDateFormatsW",
	"EnumLanguageGroupLocalesW",
	"EnumResourceLanguagesW",
	"EnumResourceNamesW",
	"EnumResourceTypesW",
	"EnumSystemCodePagesW",
	"EnumSystemLanguageGroupsW",
	"EnumSystemLocalesW",
	"EnumTimeFormatsW",
	"EnumUILanguagesW",
	"EnumerateLocalComputerNamesW",
	"ExpandEnvironmentStringsW",
	"ExpungeConsoleCommandHistoryW",
	"FatalAppExitW",
	"FillConsoleOutputCharacterW",
	"FindActCtxSectionStringW",
	"FindAtomW",
	"FindFirstChangeNotificationW",
	"FindFirstFileExW",
	"FindFirstFileW",
	"FindFirstVolumeMountPointW",
	"FindFirstVolumeW",
	"FindNextFileW",
	"FindNextVolumeMountPointW",
	"FindNextVolumeW",
	"FindResourceExW",
	"FindResourceW",
	"FoldStringW",
	"FormatMessageW",
	"FreeEnvironmentStringsW",
	"GetAtomNameW",
	"GetBinaryTypeW",
	"GetCPInfoExW",
	"GetCalendarInfoW",
	"GetCommandLineW",
	"GetCompressedFileSizeW",
	"GetComputerNameExW",
	"GetComputerNameW",
	"GetConsoleAliasExesLengthW",
	"GetConsoleAliasExesW",
	"GetConsoleAliasW",
	"GetConsoleAliasesLengthW",
	"GetConsoleAliasesW",
	"GetConsoleCommandHistoryLengthW",
	"GetConsoleCommandHistoryW",
	"GetConsoleInputExeNameW",
	"GetConsoleKeyboardLayoutNameW",
	"GetConsoleTitleW",
	"GetCurrencyFormatW",
	"GetCurrentDirectoryW",
	"GetDateFormatW",
	"GetDefaultCommConfigW",
	"GetDiskFreeSpaceExW",
	"GetDiskFreeSpaceW",
	"GetDllDirectoryW",
	"GetDriveTypeW",
	"GetEnvironmentStringsW",
	"GetEnvironmentVariableW",
	"GetExpandedNameW",
	"GetFileAttributesExW",
	"GetFileAttributesW",
	"GetFirmwareEnvironmentVariableW",
	"GetFullPathNameW",
	"GetGeoInfoW",
	"GetLocaleInfoW",
	"GetLogicalDriveStringsW",
	"GetLongPathNameW",
	"GetModuleFileNameW",
	"GetModuleHandleExW",
	"GetModuleHandleW",
	"GetNamedPipeHandleStateW",
	"GetNumberFormatW",
	"GetPrivateProfileIntW",
	"GetPrivateProfileSectionNamesW",
	"GetPrivateProfileSectionW",
	"GetPrivateProfileStringW",
	"GetPrivateProfileStructW",
	"GetProfileIntW",
	"GetProfileSectionW",
	"GetProfileStringW",
	"GetShortPathNameW",
	"GetStartupInfoW",
	"GetStringTypeExW",
	"GetStringTypeW",
	"GetSystemDirectoryW",
	"GetSystemWindowsDirectoryW",
	"GetSystemWow64DirectoryW",
	"GetTempFileNameW",
	"GetTempPathW",
	"GetTimeFormatW",
	"GetVersionExW",
	"GetVolumeInformationW",
	"GetVolumeNameForVolumeMountPointW",
	"GetVolumePathNameW",
	"GetVolumePathNamesForVolumeNameW",
	"GetWindowsDirectoryW",
	"GlobalAddAtomW",
	"GlobalFindAtomW",
	"GlobalGetAtomNameW",
	"HeapCreateTagsW",
	"HeapQueryTagW",
	"IsBadStringPtrW",
	"LCMapStringW",
	"LZCreateFileW",
	"LZOpenFileW",
	"LoadLibraryExW",
	"LoadLibraryW",
	"Module32FirstW",
	"Module32NextW",
	"MoveFileExW",
	"MoveFileW",
	"MoveFileWithProgressW",
	"OpenConsoleW",
	"OpenEventW",
	"OpenFileMappingW",
	"OpenJobObjectW",
	"OpenMutexW",
	"OpenSemaphoreW",
	"OpenWaitableTimerW",
	"OutputDebugStringW",
	"PeekConsoleInputW",
	"PrivCopyFileExW",
	"PrivMoveFileIdentityW",
	"Process32FirstW",
	"Process32NextW",
	"QueryActCtxW",
	"QueryDosDeviceW",
	"ReadConsoleInputExW",
	"ReadConsoleInputW",
	"ReadConsoleOutputCharacterW",
	"ReadConsoleOutputW",
	"ReadConsoleW",
	"ReadDirectoryChangesW",
	"RemoveDirectoryW",
	"RemoveLocalAlternateComputerNameW",
	"ReplaceFileW",
	"ScrollConsoleScreenBufferW",
	"SearchPathW",
	"SetCalendarInfoW",
	"SetComputerNameExW",
	"SetComputerNameW",
	"SetConsoleInputExeNameW",
	"SetConsoleNumberOfCommandsW",
	"SetConsoleTitleW",
	"SetCurrentDirectoryW",
	"SetDefaultCommConfigW",
	"SetDllDirectoryW",
	"SetEnvironmentVariableW",
	"SetFileAttributesW",
	"SetFileShortNameW",
	"SetFirmwareEnvironmentVariableW",
	"SetLocalPrimaryComputerNameW",
	"SetLocaleInfoW",
	"SetVolumeLabelW",
	"SetVolumeMountPointW",
	"UpdateResourceW",
	"VerLanguageNameW",
	"VerifyVersionInfoW",
	"WaitNamedPipeW",
	"WriteConsoleInputVDMW",
	"WriteConsoleInputW",
	"WriteConsoleOutputCharacterW",
	"WriteConsoleOutputW",
	"WriteConsoleW",
	"WritePrivateProfileSectionW",
	"WritePrivateProfileStringW",
	"WritePrivateProfileStructW",
	"WriteProfileSectionW",
	"WriteProfileStringW",
	"lstrcatW",
	"lstrcmpW",
	"lstrcmpiW",
	"lstrcpyW",
	"lstrcpynW",
	"lstrlenW",
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: Concurrent::FixedThreadPool

    — Concurrent

</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />

    Index (F) »
    Concurrent
     »
    FixedThreadPool

(no frames)

      Class List

      Method List

      File List

Class: Concurrent::FixedThreadPool

Inherits:

      ThreadPoolExecutor

Object

ThreadPoolExecutor

Concurrent::FixedThreadPool

        show all

Defined in:

lib/concurrent/executor/fixed_thread_pool.rb

Overview

    Note:

Failure to properly shutdown a thread pool can lead to unpredictable results.
Please read Shutting Down Thread Pools for more information.

A thread pool that reuses a fixed number of threads operating off an unbounded queue.
At any point, at most num_threads will be active processing tasks. When all threads are busy new
tasks #post to the thread pool are enqueued until a thread becomes available.
Should a thread crash for any reason the thread will immediately be removed
from the pool and replaced.

The API and behavior of this class are based on Java's FixedThreadPool

Thread Pool Options

Thread pools support several configuration options:

idletime: The number of seconds that a thread may be idle before being reclaimed.

max_queue: The maximum number of tasks that may be waiting in the work queue at
any one time. When the queue size reaches max_queue and no new threads can be created,
subsequent tasks will be rejected in accordance with the configured fallback_policy.

auto_terminate: When true (default) an at_exit handler will be registered which
will stop the thread pool when the application exits. See below for more information
on shutting down thread pools.

fallback_policy: The policy defining how rejected tasks are handled.

Three fallback policies are supported:

:abort: Raise a RejectedExecutionError exception and discard the task.

:discard: Discard the task and return false.

:caller_runs: Execute the task on the calling thread.

Shutting Down Thread Pools

Killing a thread pool while tasks are still being processed, either by calling
the #kill method or at application exit, will have unpredictable results. There
is no way for the thread pool to know what resources are being used by the
in-progress tasks. When those tasks are killed the impact on those resources
cannot be predicted. The best practice is to explicitly shutdown all thread
pools using the provided methods:

Call #shutdown to initiate an orderly termination of all in-progress tasks

Call #wait_for_termination with an appropriate timeout interval an allow
the orderly shutdown to complete

Call #kill only when the thread pool fails to shutdown in the allotted time

On some runtime platforms (most notably the JVM) the application will not
exit until all thread pools have been shutdown. To prevent applications from
"hanging" on exit all thread pools include an at_exit handler that will
stop the thread pool when the application exits. This handler uses a brute
force method to stop the pool and makes no guarantees regarding resources being
used by any tasks still running. Registration of this at_exit handler can be
prevented by setting the thread pool's constructor :auto_terminate option to
false when the thread pool is created. All thread pools support this option.

pool1 = Concurrent::FixedThreadPool.new(5) # an `at_exit` handler will be registered
pool2 = Concurrent::FixedThreadPool.new(5, auto_terminate: false) # prevent `at_exit` handler registration

See Also:

Java Tutorials: Thread Pools

Java Executors class

Java ExecutorService interface

Kernel#at_exit

Instance Attribute Summary (collapse)

      - (Integer) completed_task_count

      inherited
      from ThreadPoolExecutor

      readonly

The number of tasks that have been completed by the pool since construction.

      - (Symbol) fallback_policy

      inherited
      from ThreadPoolExecutor

      readonly

The fallback policy in effect.

      - (Integer) idletime

      inherited
      from ThreadPoolExecutor

      readonly

The number of seconds that a thread may be idle before being reclaimed.

      - (Integer) largest_length

      inherited
      from ThreadPoolExecutor

      readonly

The largest number of threads that have been created in the pool since construction.

      - (Integer) length

      inherited
      from ThreadPoolExecutor

      readonly

The number of threads currently in the pool.

      - (Integer) max_length

      inherited
      from ThreadPoolExecutor

      readonly

The maximum number of threads that may be created in the pool.

      - (Integer) max_queue

      inherited
      from ThreadPoolExecutor

      readonly

The maximum number of tasks that may be waiting in the work queue at any one time.

      - (Integer) min_length

      inherited
      from ThreadPoolExecutor

      readonly

The minimum number of threads that may be retained in the pool.

      - (Integer) queue_length

      inherited
      from ThreadPoolExecutor

      readonly

The number of tasks in the queue awaiting execution.

      - (Integer) remaining_capacity

      inherited
      from ThreadPoolExecutor

      readonly

Number of tasks that may be enqueued before reaching max_queue and rejecting new tasks.

      - (Integer) scheduled_task_count

      inherited
      from ThreadPoolExecutor

      readonly

The number of tasks that have been scheduled for execution on the pool since construction.

      Instance Method Summary
      (collapse)

      - (FixedThreadPool) initialize(num_threads, opts = {})

    constructor

Create a new thread pool.

Constructor Details

    - (<tt>FixedThreadPool</tt>) initialize(num_threads, opts = {})

Create a new thread pool.

Parameters:

        num_threads

        (<tt>Integer</tt>)

        —

the number of threads to allocate

        opts

        (<tt>Hash</tt>)

        (defaults to: <tt>{}</tt>)

        —

the options defining pool behavior.

Options Hash (<tt>opts</tt>):

          :fallback_policy
          (<tt>Symbol</tt>)

              — default:
              <tt>`:abort`</tt>

            —

the fallback policy

Raises:

        (<tt>ArgumentError</tt>)

        —

if num_threads is less than or equal to zero

        (<tt>ArgumentError</tt>)

        —

if fallback_policy is not a known policy

See Also:

http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool-int-

197
198
199
200
201
202
203
204

# File 'lib/concurrent/executor/fixed_thread_pool.rb', line 197

def initialize(num_threads, opts = {})
  raise ArgumentError.new('number of threads must be greater than zero') if num_threads.to_i < 1
  defaults  = { max_queue:   DEFAULT_MAX_QUEUE_SIZE,
                idletime:    DEFAULT_THREAD_IDLETIMEOUT }
  overrides = { min_threads: num_threads,
                max_threads: num_threads }
  super(defaults.merge(opts).merge(overrides))
end

Instance Attribute Details

    - (<tt>Integer</tt>) completed_task_count  (readonly)

      Originally defined in class
        ThreadPoolExecutor

The number of tasks that have been completed by the pool since construction.

Returns:

        (<tt>Integer</tt>)

        —

The number of tasks that have been completed by the pool since construction.

    - (<tt>Symbol</tt>) fallback_policy  (readonly)

      Originally defined in class
        ThreadPoolExecutor

Returns The fallback policy in effect. Either :abort, :discard, or :caller_runs.

Returns:

        (<tt>Symbol</tt>)

        —

The fallback policy in effect. Either :abort, :discard, or :caller_runs.

    - (<tt>Integer</tt>) idletime  (readonly)

      Originally defined in class
        ThreadPoolExecutor

The number of seconds that a thread may be idle before being reclaimed.

Returns:

        (<tt>Integer</tt>)

        —

The number of seconds that a thread may be idle before being reclaimed.

    - (<tt>Integer</tt>) largest_length  (readonly)

      Originally defined in class
        ThreadPoolExecutor

The largest number of threads that have been created in the pool since construction.

Returns:

        (<tt>Integer</tt>)

        —

The largest number of threads that have been created in the pool since construction.

    - (<tt>Integer</tt>) length  (readonly)

      Originally defined in class
        ThreadPoolExecutor

The number of threads currently in the pool.

Returns:

        (<tt>Integer</tt>)

        —

The number of threads currently in the pool.

    - (<tt>Integer</tt>) max_length  (readonly)

      Originally defined in class
        ThreadPoolExecutor

The maximum number of threads that may be created in the pool.

Returns:

        (<tt>Integer</tt>)

        —

The maximum number of threads that may be created in the pool.

    - (<tt>Integer</tt>) max_queue  (readonly)

      Originally defined in class
        ThreadPoolExecutor

The maximum number of tasks that may be waiting in the work queue at any one time.
When the queue size reaches max_queue subsequent tasks will be rejected in
accordance with the configured fallback_policy.

Returns:

        (<tt>Integer</tt>)

        —

The maximum number of tasks that may be waiting in the work queue at any one time.
When the queue size reaches max_queue subsequent tasks will be rejected in
accordance with the configured fallback_policy.

    - (<tt>Integer</tt>) min_length  (readonly)

      Originally defined in class
        ThreadPoolExecutor

The minimum number of threads that may be retained in the pool.

Returns:

        (<tt>Integer</tt>)

        —

The minimum number of threads that may be retained in the pool.

    - (<tt>Integer</tt>) queue_length  (readonly)

      Originally defined in class
        ThreadPoolExecutor

The number of tasks in the queue awaiting execution.

Returns:

        (<tt>Integer</tt>)

        —

The number of tasks in the queue awaiting execution.

    - (<tt>Integer</tt>) remaining_capacity  (readonly)

      Originally defined in class
        ThreadPoolExecutor

Number of tasks that may be enqueued before reaching max_queue and rejecting
new tasks. A value of -1 indicates that the queue may grow without bound.

Returns:

        (<tt>Integer</tt>)

        —

Number of tasks that may be enqueued before reaching max_queue and rejecting
new tasks. A value of -1 indicates that the queue may grow without bound.

    - (<tt>Integer</tt>) scheduled_task_count  (readonly)

      Originally defined in class
        ThreadPoolExecutor

The number of tasks that have been scheduled for execution on the pool since construction.

Returns:

        (<tt>Integer</tt>)

        —

The number of tasks that have been scheduled for execution on the pool since construction.

  Generated on Wed Aug 15 13:38:47 2018 by
  yard
  0.8.7.6 (ruby-2.4.3).

redpajama_set_name: RedPajamaGithub


text:
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_DOCUMENT_STYLE_SHEET_COLLECTION_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_DOCUMENT_STYLE_SHEET_COLLECTION_H_

#include "third_party/blink/renderer/core/css/tree_scope_style_sheet_collection.h"

namespace blink {

class DocumentStyleSheetCollector;
class StyleEngine;
class TreeScope;

class DocumentStyleSheetCollection final
    : public TreeScopeStyleSheetCollection {
 public:
  explicit DocumentStyleSheetCollection(TreeScope&);
  DocumentStyleSheetCollection(const DocumentStyleSheetCollection&) = delete;
  DocumentStyleSheetCollection& operator=(const DocumentStyleSheetCollection&) =
      delete;

  void UpdateActiveStyleSheets(StyleEngine&);
  void CollectStyleSheets(StyleEngine&, DocumentStyleSheetCollector&);

  void Trace(Visitor* visitor) const override {
    TreeScopeStyleSheetCollection::Trace(visitor);
  }

 private:
  void CollectStyleSheetsFromCandidates(StyleEngine&,
                                        DocumentStyleSheetCollector&);
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_CSS_DOCUMENT_STYLE_SHEET_COLLECTION_H_


text:
package be.peopleware.persistence_II.ramstorage;

import java.util.List;
import java.util.Set;

import be.peopleware.exception_I.TechnicalException;
import be.peopleware.persistence_II.dao.FilterDao;

/**
 * A {@link FilterDao} for ram storage.
 *
 * @author nsmeets
 * @author ashoudou
 * @author Peopleware n.v.
 */
public final class RamStorageFilterDao extends RamStorageAsyncCrudDao implements FilterDao {

  /*
*/
  //------------------------------------------------------------------
  /** {@value} */
  public static final String CVS_REVISION = "$Revision$"; //$NON-NLS-1$
  /** {@value} */
  public static final String CVS_DATE = "$Date$"; //$NON-NLS-1$
  /** {@value} */
  public static final String CVS_STATE = "$State$"; //$NON-NLS-1$
  /** {@value} */
  public static final String CVS_TAG = "$Name$"; //$NON-NLS-1$
  /*
*/

//  private static final Log LOG = LogFactory.getLog(RamStorageFilterDao.class);

  /* <construction> */
  //------------------------------------------------------------------

  /**
   *
   */
  public RamStorageFilterDao() {
    // NOP
  }

  /* </construction> */

  /**
   * @see    FilterDao
   * @mudo
   */
  public Set retrievePersistentBeans(final Class type, final List criteriaList)
      throws TechnicalException {
    assert false : "not implemented yet";
    return null;
  }
}


text:
Here you will find fun IoE tutorials that explore functions of the **Modern IoE Platform** by [DGLogik](http://www.dglogik.com).

# Prerequisites

Install DSA
-
Watch one of the videos below that corresponds with your target installation platform:

 - Linux / OS X - https://youtu.be/iJ-vUrD7gYo
 - Windows - https://youtu.be/Vi3J82jFNNo

----------

Explore your Installation - https://youtu.be/x3JMquRp6BA

# Tutorials

1. Mobile Phone Accelerometer Visualization
-
Learn how to visually publish and subscribe to telemetry data from your mobile device.

----------
2. Directions to office
-
Use your mobile device's geolocation ability to guide your visitors directly to your office or residence.

----------
3. Lightsaber
-
In the theme of the Star Wars franchise, learn how to control a virtual lightsaber with your phone.

----------
4. Command-Center
-
Control your command-center screens with a mobile companion application.

----------
5. Crowdsourced voting
-
Share a link with an audience and watch a realtime taly of votes.

----------
6. IoT Todo Display
-
Manage your todo list with your phone's calendar application and display notifications on a dedicated IoT display.


text:
require_relative '../../../spec_helper'

describe 'OrderRequest' do

  it 'has normal priority' do
    Rev::OrderRequest::PRIORITY[:normal].must_equal 'Normal'
  end

  it 'has time insensitivie priority' do
    Rev::OrderRequest::PRIORITY[:time_insensitivie].must_equal 'TimeInsensitivie'
  end

  it 'defaults to normal priority' do
    order = Rev::OrderRequest.new({})
    order.priority.must_equal Rev::OrderRequest::PRIORITY[:normal]
  end

  it 'accepts priority during init' do
    priority = Rev::OrderRequest::PRIORITY[:time_insensitivie]
    order = Rev::OrderRequest.new({ 'priority' => priority })
    order.priority.must_equal priority
  end

  it 'has caption options' do
    order = Rev::OrderRequest.new({})
    order.must_respond_to :caption_options
  end

  describe 'InputOptions' do
    it 'is ApiSerializable' do
      options = Rev::InputOptions.new([{}], {})
      options.must_be_kind_of Rev::ApiSerializable
    end

    it 'requires non-empty inputs' do
      proc { Rev::InputOptions.new([]) }.must_raise ArgumentError
    end

    it 'requires non-nil inputs' do
      proc { Rev::InputOptions.new(nil) }.must_raise ArgumentError
    end

    it 'sets inputs from init' do
      inputs = ['foo']
      options = Rev::InputOptions.new(inputs)
      options.inputs.must_equal inputs
    end
  end

  describe 'TranscriptionOptions' do
    it 'is InputOptions' do
      options = Rev::TranscriptionOptions.new([{}], {})
      options.must_be_kind_of Rev::InputOptions
    end
  end

  describe 'TranslationOptions' do
    it 'is InputOptions' do
      options = Rev::TranslationOptions.new([{}], {})
      options.must_be_kind_of Rev::InputOptions
    end
  end

  describe 'CaptionOptions' do
    it 'is InputOptions' do
      options = Rev::CaptionOptions.new([{}], {})
      options.must_be_kind_of Rev::InputOptions
    end

    it 'has output file formats attribute' do
      options = Rev::CaptionOptions.new([{}], {})
      options.must_respond_to :output_file_formats
    end

    it 'has output file formats hash' do
      Rev::CaptionOptions::OUTPUT_FILE_FORMATS[:subrip].must_equal 'SubRip'
      Rev::CaptionOptions::OUTPUT_FILE_FORMATS[:scc].must_equal 'Scc'
      Rev::CaptionOptions::OUTPUT_FILE_FORMATS[:ttml].must_equal 'Ttml'
      Rev::CaptionOptions::OUTPUT_FILE_FORMATS[:qttext].must_equal 'QTtext'
    end

    it 'rejects unknowns file formats' do
      proc { Rev::CaptionOptions.new([{}], { :output_file_formats => ['invalid'] }) }.must_raise ArgumentError
    end

    it 'accepts valid file formats' do
      order = Rev::CaptionOptions.new([{}], { :output_file_formats => [Rev::CaptionOptions::OUTPUT_FILE_FORMATS[:scc]] })
      order.output_file_formats.length.must_equal 1
      order.output_file_formats[0].must_equal Rev::CaptionOptions::OUTPUT_FILE_FORMATS[:scc];
    end
  end # CaptionOptions
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DigitalPlatform.Forms
{
    public static class TextBoxExtension
    {
        [DllImport("User32.dll", CharSet = CharSet.Auto)]
        private static extern IntPtr SendMessage(IntPtr hWnd,
            int msg,
            int wParam,
            int[] lParam);

        public static void SetTabStops(
            this TextBox edit,
            int[] tabstops)
        {
            SendMessage(edit.Handle,
                API.EM_SETTABSTOPS,
                tabstops.Length,
                tabstops);
        }

        public static bool GetModify(this TextBox edit)
        {
            if ((int)API.SendMessage(edit.Handle,
                API.EM_GETMODIFY, 0, 0) == 0)
                return false;
            return true;
        }

        public static void SetModify(this TextBox edit,
            bool bModified)
        {
            API.SendMessage(edit.Handle,
                API.EM_SETMODIFY, Convert.ToInt32(bModified), 0);
        }

        public static int GetFirstVisibleLine(this TextBox edit)
        {
            return (int)API.SendMessage(edit.Handle,
                API.EM_GETFIRSTVISIBLELINE, 0, 0);
        }

        // 得到edit中行总数
        public static int GetLines(this TextBox edit)
        {
            /*
            // save the handle reference for the ExtToolBox
            // HandleRef hr = new HandleRef(this, edit.Handle );

            // Send the EM_LINEFROMCHAR message with the value of
            // -1 in wParam.
            // The return value is the zero-based line number
            // of the line containing the caret.

            int nWholeLength = (int)SendMessage(edit.Handle,
                WM_GETTEXTLENGTH, 0, 0);

            return (int)SendMessage(edit.Handle,EM_LINEFROMCHAR, nWholeLength, 0) + 1;
            */

            return (int)API.SendMessage(edit.Handle,
                API.EM_GETLINECOUNT,
                UIntPtr.Zero, IntPtr.Zero);
        }

        public static void SetCurrentCaretPos(
            this TextBox edit,
            int x,
            int y,
            bool bScrollIntoView)
        {
            int nStart = (int)API.SendMessage(edit.Handle,
                API.EM_LINEINDEX,
                new UIntPtr((uint)y),
                IntPtr.Zero);

            API.SendMessage(edit.Handle,
                API.EM_SETSEL,
                nStart + x,
                nStart + x);

            if (bScrollIntoView == true)
            {
                API.SendMessage(edit.Handle,
                    API.EM_SCROLLCARET,
                    0,
                    0);
            }
        }

        // 得到edit caret当前行列位置
        public static void GetCurrentCaretPos(
            this TextBox edit,
            out int x,
            out int y)
        {
            // save the handle reference for the ExtToolBox
            // HandleRef hr = new HandleRef(this, edit.Handle );

            // Send the EM_LINEFROMCHAR message with the value of
            // -1 in wParam.
            // The return value is the zero-based line number
            // of the line containing the caret.

            int l = (int)API.SendMessage(edit.Handle, API.EM_LINEFROMCHAR, new UIntPtr(0xffffffff), IntPtr.Zero);
            // Send the EM_GETSEL message to the ToolBox control.
            // The low-order word of the return value is the
            // character position of the caret relative to the
            // first character in the ToolBox control,
            // i.e. the absolute character index.
            int sel = (int)API.SendMessage(edit.Handle, API.EM_GETSEL, UIntPtr.Zero, IntPtr.Zero);
            // get the low-order word from sel
            int ai = sel & 0xffff;
            // Send the EM_LINEINDEX message with the value of -1
            // in wParam.
            // The return value is the number of characters that
            // precede the first character in the line containing
            // the caret.
            int li = (int)API.SendMessage(edit.Handle, API.EM_LINEINDEX, new UIntPtr(0xffffffff), IntPtr.Zero);
            // Subtract the li (line index) from the ai
            // (absolute character index),
            // The result is the column number of the caret position
            // in the line containing the caret.
            int c = ai - li;

            x = c;
            y = l;
            // cpt = new CharPoint(l+1,c+1);
        }

    }

}


text:
package ca.etsmtl.applets.seemobile.model;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

/**
 * Created by gnut3ll4 on 21/12/15.
 */
@DatabaseTable(tableName = "postulation")
public class Postulation {

    @DatabaseField(id = true)
    private String guidPoste;

    @DatabaseField
    private String typePlacement;

    @DatabaseField
    private String numeroPoste;

    @DatabaseField
    private String nomPoste;

    @DatabaseField
    private String nomEmployeur;

    @DatabaseField
    private String statut;

    @DatabaseField
    private boolean active;

    public Postulation() {
    }

    public Postulation(String guidPoste, String typePlacement, String numeroPoste, String nomPoste, String nomEmployeur, String statut, boolean active) {
        this.guidPoste = guidPoste;
        this.typePlacement = typePlacement;
        this.numeroPoste = numeroPoste;
        this.nomPoste = nomPoste;
        this.nomEmployeur = nomEmployeur;
        this.statut = statut;
        this.active = active;
    }

    public String getGuidPoste() {
        return guidPoste;
    }

    public void setGuidPoste(String guidPoste) {
        this.guidPoste = guidPoste;
    }

    public String getTypePlacement() {
        return typePlacement;
    }

    public void setTypePlacement(String typePlacement) {
        this.typePlacement = typePlacement;
    }

    public String getNumeroPoste() {
        return numeroPoste;
    }

    public void setNumeroPoste(String numeroPoste) {
        this.numeroPoste = numeroPoste;
    }

    public String getNomPoste() {
        return nomPoste;
    }

    public void setNomPoste(String nomPoste) {
        this.nomPoste = nomPoste;
    }

    public String getNomEmployeur() {
        return nomEmployeur;
    }

    public void setNomEmployeur(String nomEmployeur) {
        this.nomEmployeur = nomEmployeur;
    }

    public String getStatut() {
        return statut;
    }

    public void setStatut(String statut) {
        this.statut = statut;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    @Override
    public boolean equals(Object o) {
        if (o != null && o instanceof Postulation) {
            return ((Postulation) o).getGuidPoste().equals(this.getGuidPoste());
        }
        return false;
    }
}


text:
var ss = require('socket.io-stream')
  , path = require('path')
  , fs = require('fs')
  , brain = require('./brain.js');

var start = function (config) {
  var io = require('socket.io').listen(config.port);

  io.sockets.on('connection', function (socket) {

    ss(socket).on('addController', function(stream, data) {
      var filename = path.basename(data.name);

      stream.on('end', function (){
        brain.addController(config.folderPath + '/' + filename);
      });

      stream.pipe(fs.createWriteStream(config.folderPath + '/' + filename), function (err, result) {
        if (err) {console.log(err);}
      });

    });

    socket.on('execute', function(options) {
      brain.execute(options.controllerID, options.command);
    });

    socket.on('disconnect', function(){
      console.log('Socket disconnect');
    });
  });

};

module.exports = {
  start: start,
};


text:
package org.elasticsearch.index.snapshots.blobstore;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.store.*;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.IOUtils;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.cluster.metadata.SnapshotId;
import org.elasticsearch.common.blobstore.*;
import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.io.stream.BytesStreamInput;
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.lucene.store.InputStreamIndexInput;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.common.xcontent.*;
import org.elasticsearch.index.deletionpolicy.SnapshotIndexCommit;
import org.elasticsearch.index.service.IndexService;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.index.snapshots.*;
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot.FileInfo;
import org.elasticsearch.index.store.Store;
import org.elasticsearch.index.store.StoreFileMetaData;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.indices.recovery.RecoveryState;
import org.elasticsearch.repositories.RepositoryName;

import java.io.ByteArrayOutputStream;
import java.io.FilterInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicInteger;

import static com.google.common.collect.Lists.newArrayList;

/**
 * Blob store based implementation of IndexShardRepository
 */
public class BlobStoreIndexShardRepository extends AbstractComponent implements IndexShardRepository {

    private BlobStore blobStore;

    private BlobPath basePath;

    private final String repositoryName;

    private ByteSizeValue chunkSize;

    private final IndicesService indicesService;

    private RateLimiter snapshotRateLimiter;

    private RateLimiter restoreRateLimiter;

    private RateLimiterListener rateLimiterListener;

    private RateLimitingInputStream.Listener snapshotThrottleListener;

    private static final String SNAPSHOT_PREFIX = "snapshot-";

    @Inject
    BlobStoreIndexShardRepository(Settings settings, RepositoryName repositoryName, IndicesService indicesService) {
        super(settings);
        this.repositoryName = repositoryName.name();
        this.indicesService = indicesService;
    }

    /**
     * Called by {@link org.elasticsearch.repositories.blobstore.BlobStoreRepository} on repository startup
     *
     * @param blobStore blob store
     * @param basePath  base path to blob store
     * @param chunkSize chunk size
     */
    public void initialize(BlobStore blobStore, BlobPath basePath, ByteSizeValue chunkSize,
                           RateLimiter snapshotRateLimiter, RateLimiter restoreRateLimiter,
                           final RateLimiterListener rateLimiterListener) {
        this.blobStore = blobStore;
        this.basePath = basePath;
        this.chunkSize = chunkSize;
        this.snapshotRateLimiter = snapshotRateLimiter;
        this.restoreRateLimiter = restoreRateLimiter;
        this.rateLimiterListener = rateLimiterListener;
        this.snapshotThrottleListener = new RateLimitingInputStream.Listener() {
            @Override
            public void onPause(long nanos) {
                rateLimiterListener.onSnapshotPause(nanos);
            }
        };
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void snapshot(SnapshotId snapshotId, ShardId shardId, SnapshotIndexCommit snapshotIndexCommit, IndexShardSnapshotStatus snapshotStatus) {
        SnapshotContext snapshotContext = new SnapshotContext(snapshotId, shardId, snapshotStatus);
        snapshotStatus.startTime(System.currentTimeMillis());

        try {
            snapshotContext.snapshot(snapshotIndexCommit);
            snapshotStatus.time(System.currentTimeMillis() - snapshotStatus.startTime());
            snapshotStatus.updateStage(IndexShardSnapshotStatus.Stage.DONE);
        } catch (Throwable e) {
            snapshotStatus.time(System.currentTimeMillis() - snapshotStatus.startTime());
            snapshotStatus.updateStage(IndexShardSnapshotStatus.Stage.FAILURE);
            snapshotStatus.failure(ExceptionsHelper.detailedMessage(e));
            if (e instanceof IndexShardSnapshotFailedException) {
                throw (IndexShardSnapshotFailedException) e;
            } else {
                throw new IndexShardSnapshotFailedException(shardId, e.getMessage(), e);
            }
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void restore(SnapshotId snapshotId, ShardId shardId, ShardId snapshotShardId, RecoveryState recoveryState) {
        RestoreContext snapshotContext = new RestoreContext(snapshotId, shardId, snapshotShardId, recoveryState);

        try {
            recoveryState.getIndex().startTime(System.currentTimeMillis());
            snapshotContext.restore();
            recoveryState.getIndex().time(System.currentTimeMillis() - recoveryState.getIndex().startTime());
        } catch (Throwable e) {
            throw new IndexShardRestoreFailedException(shardId, "failed to restore snapshot [" + snapshotId.getSnapshot() + "]", e);
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public IndexShardSnapshotStatus snapshotStatus(SnapshotId snapshotId, ShardId shardId) {
        Context context = new Context(snapshotId, shardId);
        BlobStoreIndexShardSnapshot snapshot = context.loadSnapshot();
        IndexShardSnapshotStatus status = new IndexShardSnapshotStatus();
        status.updateStage(IndexShardSnapshotStatus.Stage.DONE);
        status.startTime(snapshot.startTime());
        status.files(snapshot.numberOfFiles(), snapshot.totalSize());
        // The snapshot is done which means the number of processed files is the same as total
        status.processedFiles(snapshot.numberOfFiles(), snapshot.totalSize());
        status.time(snapshot.time());
        return status;
    }

    /**
     * Delete shard snapshot
     *
     * @param snapshotId snapshot id
     * @param shardId    shard id
     */
    public void delete(SnapshotId snapshotId, ShardId shardId) {
        Context context = new Context(snapshotId, shardId, shardId);
        context.delete();
    }

    @Override
    public String toString() {
        return "BlobStoreIndexShardRepository[" +
                "[" + repositoryName +
                "], [" + blobStore + ']' +
                ']';
    }

    /**
     * Returns shard snapshot metadata file name
     *
     * @param snapshotId snapshot id
     * @return shard snapshot metadata file name
     */
    private String snapshotBlobName(SnapshotId snapshotId) {
        return SNAPSHOT_PREFIX + snapshotId.getSnapshot();
    }

    /**
     * Serializes snapshot to JSON
     *
     * @param snapshot snapshot
     * @return JSON representation of the snapshot
     * @throws IOException
     */
    public static byte[] writeSnapshot(BlobStoreIndexShardSnapshot snapshot) throws IOException {
        XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON).prettyPrint();
        BlobStoreIndexShardSnapshot.toXContent(snapshot, builder, ToXContent.EMPTY_PARAMS);
        return builder.bytes().toBytes();
    }

    /**
     * Parses JSON representation of a snapshot
     *
     * @param data JSON
     * @return snapshot
     * @throws IOException
     */
    public static BlobStoreIndexShardSnapshot readSnapshot(byte[] data) throws IOException {
        try (XContentParser parser = XContentFactory.xContent(XContentType.JSON).createParser(data)) {
            parser.nextToken();
            return BlobStoreIndexShardSnapshot.fromXContent(parser);
        }
    }

    /**
     * Context for snapshot/restore operations
     */
    private class Context {

        protected final SnapshotId snapshotId;

        protected final ShardId shardId;

        protected final ImmutableBlobContainer blobContainer;

        public Context(SnapshotId snapshotId, ShardId shardId) {
            this(snapshotId, shardId, shardId);
        }

        public Context(SnapshotId snapshotId, ShardId shardId, ShardId snapshotShardId) {
            this.snapshotId = snapshotId;
            this.shardId = shardId;
            blobContainer = blobStore.immutableBlobContainer(basePath.add("indices").add(snapshotShardId.getIndex()).add(Integer.toString(snapshotShardId.getId())));
        }

        /**
         * Delete shard snapshot
         */
        public void delete() {
            final ImmutableMap<String, BlobMetaData> blobs;
            try {
                blobs = blobContainer.listBlobs();
            } catch (IOException e) {
                throw new IndexShardSnapshotException(shardId, "Failed to list content of gateway", e);
            }

            BlobStoreIndexShardSnapshots snapshots = buildBlobStoreIndexShardSnapshots(blobs);

            String commitPointName = snapshotBlobName(snapshotId);

            try {
                blobContainer.deleteBlob(commitPointName);
            } catch (IOException e) {
                logger.debug("[{}] [{}] failed to delete shard snapshot file", shardId, snapshotId);
            }

            // delete all files that are not referenced by any commit point
            // build a new BlobStoreIndexShardSnapshot, that includes this one and all the saved ones
            List<BlobStoreIndexShardSnapshot> newSnapshotsList = Lists.newArrayList();
            for (BlobStoreIndexShardSnapshot point : snapshots) {
                if (!point.snapshot().equals(snapshotId.getSnapshot())) {
                    newSnapshotsList.add(point);
                }
            }
            cleanup(newSnapshotsList, blobs);
        }

        /**
         * Loads information about shard snapshot
         */
        public BlobStoreIndexShardSnapshot loadSnapshot() {
            BlobStoreIndexShardSnapshot snapshot;
            try {
                snapshot = readSnapshot(blobContainer.readBlobFully(snapshotBlobName(snapshotId)));
            } catch (IOException ex) {
                throw new IndexShardRestoreFailedException(shardId, "failed to read shard snapshot file", ex);
            }
            return snapshot;
        }

        /**
         * Removes all unreferenced files from the repository
         *
         * @param snapshots list of active snapshots in the container
         * @param blobs     list of blobs in the container
         */
        protected void cleanup(List<BlobStoreIndexShardSnapshot> snapshots, ImmutableMap<String, BlobMetaData> blobs) {
            BlobStoreIndexShardSnapshots newSnapshots = new BlobStoreIndexShardSnapshots(snapshots);
            // now go over all the blobs, and if they don't exists in a snapshot, delete them
            for (String blobName : blobs.keySet()) {
                if (!blobName.startsWith("__")) {
                    continue;
                }
                if (newSnapshots.findNameFile(FileInfo.canonicalName(blobName)) == null) {
                    try {
                        blobContainer.deleteBlob(blobName);
                    } catch (IOException e) {
                        logger.debug("[{}] [{}] error deleting blob [{}] during cleanup", e, snapshotId, shardId, blobName);
                    }
                }
            }
        }

        /**
         * Generates blob name
         *
         * @param generation the blob number
         * @return the blob name
         */
        protected String fileNameFromGeneration(long generation) {
            return "__" + Long.toString(generation, Character.MAX_RADIX);
        }

        /**
         * Finds the next available blob number
         *
         * @param blobs list of blobs in the repository
         * @return next available blob number
         */
        protected long findLatestFileNameGeneration(ImmutableMap<String, BlobMetaData> blobs) {
            long generation = -1;
            for (String name : blobs.keySet()) {
                if (!name.startsWith("__")) {
                    continue;
                }
                name = FileInfo.canonicalName(name);
                try {
                    long currentGen = Long.parseLong(name.substring(2) /*__*/, Character.MAX_RADIX);
                    if (currentGen > generation) {
                        generation = currentGen;
                    }
                } catch (NumberFormatException e) {
                    logger.warn("file [{}] does not conform to the '__' schema");
                }
            }
            return generation;
        }

        /**
         * Loads all available snapshots in the repository
         *
         * @param blobs list of blobs in repository
         * @return BlobStoreIndexShardSnapshots
         */
        protected BlobStoreIndexShardSnapshots buildBlobStoreIndexShardSnapshots(ImmutableMap<String, BlobMetaData> blobs) {
            List<BlobStoreIndexShardSnapshot> snapshots = Lists.newArrayList();
            for (String name : blobs.keySet()) {
                if (name.startsWith(SNAPSHOT_PREFIX)) {
                    try {
                        snapshots.add(readSnapshot(blobContainer.readBlobFully(name)));
                    } catch (IOException e) {
                        logger.warn("failed to read commit point [{}]", e, name);
                    }
                }
            }
            return new BlobStoreIndexShardSnapshots(snapshots);
        }

    }

    /**
     * Context for snapshot operations
     */
    private class SnapshotContext extends Context {

        private final Store store;

        private final IndexShardSnapshotStatus snapshotStatus;

        /**
         * Constructs new context
         *
         * @param snapshotId     snapshot id
         * @param shardId        shard to be snapshotted
         * @param snapshotStatus snapshot status to report progress
         */
        public SnapshotContext(SnapshotId snapshotId, ShardId shardId, IndexShardSnapshotStatus snapshotStatus) {
            super(snapshotId, shardId);
            IndexService indexService = indicesService.indexServiceSafe(shardId.getIndex());
            store = indexService.shardInjectorSafe(shardId.id()).getInstance(Store.class);
            this.snapshotStatus = snapshotStatus;

        }

        /**
         * Create snapshot from index commit point
         *
         * @param snapshotIndexCommit snapshot commit point
         */
        public void snapshot(SnapshotIndexCommit snapshotIndexCommit) {
            logger.debug("[{}] [{}] snapshot to [{}] ...", shardId, snapshotId, repositoryName);
            store.incRef();
            try {
                final ImmutableMap<String, BlobMetaData> blobs;
                try {
                    blobs = blobContainer.listBlobs();
                } catch (IOException e) {
                    throw new IndexShardSnapshotFailedException(shardId, "failed to list blobs", e);
                }

                long generation = findLatestFileNameGeneration(blobs);
                BlobStoreIndexShardSnapshots snapshots = buildBlobStoreIndexShardSnapshots(blobs);

                final CopyOnWriteArrayList<Throwable> failures = new CopyOnWriteArrayList<>();
                final List<BlobStoreIndexShardSnapshot.FileInfo> indexCommitPointFiles = newArrayList();

                int indexNumberOfFiles = 0;
                long indexTotalFilesSize = 0;
                ArrayList<FileInfo> filesToSnapshot = newArrayList();
                final Store.MetadataSnapshot metadata;
                // TODO apparently we don't use the MetadataSnapshot#.recoveryDiff(...) here but we should
                try {
                    metadata = store.getMetadata(snapshotIndexCommit);
                } catch (IOException e) {
                    throw new IndexShardSnapshotFailedException(shardId, "Failed to get store file metadata", e);
                }
                for (String fileName : snapshotIndexCommit.getFiles()) {
                    if (snapshotStatus.aborted()) {
                        logger.debug("[{}] [{}] Aborted on the file [{}], exiting", shardId, snapshotId, fileName);
                        throw new IndexShardSnapshotFailedException(shardId, "Aborted");
                    }
                    logger.trace("[{}] [{}] Processing [{}]", shardId, snapshotId, fileName);
                    final StoreFileMetaData md = metadata.get(fileName);
                    boolean snapshotRequired = false;
                    BlobStoreIndexShardSnapshot.FileInfo fileInfo = snapshots.findPhysicalIndexFile(fileName);
                    try {
                        // in 1.4.0 we added additional hashes for .si / segments_N files
                        // to ensure we don't double the space in the repo since old snapshots
                        // don't have this hash we try to read that hash from the blob store
                        // in a bwc compatible way.
                        maybeRecalculateMetadataHash(blobContainer, fileInfo, metadata);
                    }  catch (Throwable e) {
                        logger.warn("{} Can't calculate hash from blob for file [{}] [{}]", e, shardId, fileInfo.physicalName(), fileInfo.metadata());
                    }
                    if (fileInfo == null || !fileInfo.isSame(md) || !snapshotFileExistsInBlobs(fileInfo, blobs)) {
                        // commit point file does not exists in any commit point, or has different length, or does not fully exists in the listed blobs
                        snapshotRequired = true;
                    }

                    if (snapshotRequired) {
                        indexNumberOfFiles++;
                        indexTotalFilesSize += md.length();
                        // create a new FileInfo
                        BlobStoreIndexShardSnapshot.FileInfo snapshotFileInfo = new BlobStoreIndexShardSnapshot.FileInfo(fileNameFromGeneration(++generation), md, chunkSize);
                        indexCommitPointFiles.add(snapshotFileInfo);
                        filesToSnapshot.add(snapshotFileInfo);
                    } else {
                        indexCommitPointFiles.add(fileInfo);
                    }
                }

                snapshotStatus.files(indexNumberOfFiles, indexTotalFilesSize);

                snapshotStatus.updateStage(IndexShardSnapshotStatus.Stage.STARTED);

                final CountDownLatch indexLatch = new CountDownLatch(filesToSnapshot.size());

                for (FileInfo snapshotFileInfo : filesToSnapshot) {
                    try {
                        snapshotFile(snapshotFileInfo, indexLatch, failures);
                    } catch (IOException e) {
                        failures.add(e);
                    }
                }

                snapshotStatus.indexVersion(snapshotIndexCommit.getGeneration());

                try {
                    indexLatch.await();
                } catch (InterruptedException e) {
                    failures.add(e);
                    Thread.currentThread().interrupt();
                }
                if (!failures.isEmpty()) {
                    throw new IndexShardSnapshotFailedException(shardId, "Failed to perform snapshot (index files)", failures.get(0));
                }

                // now create and write the commit point
                snapshotStatus.updateStage(IndexShardSnapshotStatus.Stage.FINALIZE);

                String commitPointName = snapshotBlobName(snapshotId);
                BlobStoreIndexShardSnapshot snapshot = new BlobStoreIndexShardSnapshot(snapshotId.getSnapshot(),
                        snapshotIndexCommit.getGeneration(), indexCommitPointFiles, snapshotStatus.startTime(),
                        // snapshotStatus.startTime() is assigned on the same machine, so it's safe to use with VLong
                        System.currentTimeMillis() - snapshotStatus.startTime(), indexNumberOfFiles, indexTotalFilesSize);
                //TODO: The time stored in snapshot doesn't include cleanup time.
                try {
                    byte[] snapshotData = writeSnapshot(snapshot);
                    logger.trace("[{}] [{}] writing shard snapshot file", shardId, snapshotId);
                    blobContainer.writeBlob(commitPointName, new BytesStreamInput(snapshotData, false), snapshotData.length);
                } catch (IOException e) {
                    throw new IndexShardSnapshotFailedException(shardId, "Failed to write commit point", e);
                }

                // delete all files that are not referenced by any commit point
                // build a new BlobStoreIndexShardSnapshot, that includes this one and all the saved ones
                List<BlobStoreIndexShardSnapshot> newSnapshotsList = Lists.newArrayList();
                newSnapshotsList.add(snapshot);
                for (BlobStoreIndexShardSnapshot point : snapshots) {
                    newSnapshotsList.add(point);
                }
                cleanup(newSnapshotsList, blobs);
                snapshotStatus.updateStage(IndexShardSnapshotStatus.Stage.DONE);
            } finally {
                store.decRef();
            }
        }

        /**
         * Snapshot individual file
         * <p/>
         * This is asynchronous method. Upon completion of the operation latch is getting counted down and any failures are
         * added to the {@code failures} list
         *
         * @param fileInfo file to be snapshotted
         * @param latch    latch that should be counted down once file is snapshoted
         * @param failures thread-safe list of failures
         * @throws IOException
         */
        private void snapshotFile(final BlobStoreIndexShardSnapshot.FileInfo fileInfo, final CountDownLatch latch, final List<Throwable> failures) throws IOException {
            final String file = fileInfo.physicalName();
            IndexInput indexInput = store.openVerifyingInput(file, IOContext.READONCE, fileInfo.metadata());
            writeBlob(indexInput, fileInfo, 0, latch, failures);
        }

        private class BlobPartWriter implements ImmutableBlobContainer.WriterListener {

            private final int part;

            private final FileInfo fileInfo;

            private final List<Throwable> failures;

            private final CountDownLatch latch;

            private final IndexInput indexInput;

            private final InputStream inputStream;

            private final InputStreamIndexInput inputStreamIndexInput;

            private BlobPartWriter(IndexInput indexInput, FileInfo fileInfo, int part, CountDownLatch latch, List<Throwable> failures) throws IOException {
                this.indexInput = indexInput;
                this.part = part;
                this.fileInfo = fileInfo;
                this.failures = failures;
                this.latch = latch;
                inputStreamIndexInput = new InputStreamIndexInput(indexInput, fileInfo.partBytes());
                InputStream inputStream = inputStreamIndexInput;
                if (snapshotRateLimiter != null) {
                    inputStream = new RateLimitingInputStream(inputStream, snapshotRateLimiter, snapshotThrottleListener);
                }
                inputStream = new AbortableInputStream(inputStream, fileInfo.physicalName());
                this.inputStream = inputStream;
            }

            @Override
            public void onCompleted() {
                int nextPart = part + 1;
                if (nextPart < fileInfo.numberOfParts()) {
                    try {
                        // We have more parts to go
                        writeBlob(indexInput, fileInfo, nextPart, latch, failures);
                    } catch (Throwable t) {
                        onFailure(t);
                    }
                } else {
                    // Last part - verify checksum
                    try {
                        Store.verify(indexInput);
                        indexInput.close();
                        snapshotStatus.addProcessedFile(fileInfo.length());
                    } catch (Throwable t) {
                        onFailure(t);
                        return;
                    }
                    latch.countDown();
                }
            }

            @Override
            public void onFailure(Throwable t) {
                cleanupFailedSnapshot(t, indexInput, latch, failures);
            }

            public void writeBlobPart() throws IOException {
                blobContainer.writeBlob(fileInfo.partName(part), inputStream, inputStreamIndexInput.actualSizeToRead(), this);
            }

        }

        private void writeBlob(IndexInput indexInput, FileInfo fileInfo, int part, CountDownLatch latch, List<Throwable> failures) {
            try {
                new BlobPartWriter(indexInput, fileInfo, part, latch, failures).writeBlobPart();
            } catch (Throwable t) {
                cleanupFailedSnapshot(t, indexInput, latch, failures);
            }
        }

        private void cleanupFailedSnapshot(Throwable t, IndexInput indexInput, CountDownLatch latch, List<Throwable> failures) {
            IOUtils.closeWhileHandlingException(indexInput);
            failStoreIfCorrupted(t);
            snapshotStatus.addProcessedFile(0);
            failures.add(t);
            latch.countDown();
        }

        private void failStoreIfCorrupted(Throwable t) {
            if (t instanceof CorruptIndexException) {
                try {
                    store.markStoreCorrupted((CorruptIndexException) t);
                } catch (IOException e) {
                    logger.warn("store cannot be marked as corrupted", e);
                }
            }
        }

        /**
         * Checks if snapshot file already exists in the list of blobs
         *
         * @param fileInfo file to check
         * @param blobs    list of blobs
         * @return true if file exists in the list of blobs
         */
        private boolean snapshotFileExistsInBlobs(BlobStoreIndexShardSnapshot.FileInfo fileInfo, ImmutableMap<String, BlobMetaData> blobs) {
            BlobMetaData blobMetaData = blobs.get(fileInfo.name());
            if (blobMetaData != null) {
                return blobMetaData.length() == fileInfo.length();
            } else if (blobs.containsKey(fileInfo.partName(0))) {
                // multi part file sum up the size and check
                int part = 0;
                long totalSize = 0;
                while (true) {
                    blobMetaData = blobs.get(fileInfo.partName(part++));
                    if (blobMetaData == null) {
                        break;
                    }
                    totalSize += blobMetaData.length();
                }
                return totalSize == fileInfo.length();
            }
            // no file, not exact and not multipart
            return false;
        }

        private class AbortableInputStream extends FilterInputStream {
            private final String fileName;

            public AbortableInputStream(InputStream delegate, String fileName) {
                super(delegate);
                this.fileName = fileName;
            }

            @Override
            public int read() throws IOException {
                checkAborted();
                return in.read();
            }

            @Override
            public int read(byte[] b, int off, int len) throws IOException {
                checkAborted();
                return in.read(b, off, len);
            }

            private void checkAborted() {
                if (snapshotStatus.aborted()) {
                    logger.debug("[{}] [{}] Aborted on the file [{}], exiting", shardId, snapshotId, fileName);
                    throw new IndexShardSnapshotFailedException(shardId, "Aborted");
                }
            }
        }
    }

    /**
     * This is a BWC layer to ensure we update the snapshots metdata with the corresponding hashes before we compare them.
     * The new logic for StoreFileMetaData reads the entire <tt>.si</tt> and <tt>segments.n</tt> files to strengthen the
     * comparison of the files on a per-segment / per-commit level.
     */
    private static final void maybeRecalculateMetadataHash(final ImmutableBlobContainer blobContainer, final FileInfo fileInfo, Store.MetadataSnapshot snapshot) throws Throwable {
        final StoreFileMetaData metadata;
        if (fileInfo != null && (metadata = snapshot.get(fileInfo.physicalName())) != null) {
            if (metadata.hash().length > 0 && fileInfo.metadata().hash().length == 0) {
                // we have a hash - check if our repo has a hash too otherwise we have
                // to calculate it.
                final ByteArrayOutputStream out = new ByteArrayOutputStream();
                final CountDownLatch latch = new CountDownLatch(1);
                final CopyOnWriteArrayList<Throwable> failures = new CopyOnWriteArrayList<>();
                // we might have multiple parts even though the file is small... make sure we read all of it.
                // TODO this API should really support a stream!
                blobContainer.readBlob(fileInfo.partName(0), new BlobContainer.ReadBlobListener() {
                    final AtomicInteger partIndex = new AtomicInteger();
                    @Override
                    public synchronized void onPartial(byte[] data, int offset, int size) throws IOException {
                        out.write(data, offset, size);
                    }

                    @Override
                    public synchronized void onCompleted() {
                        boolean countDown = true;
                        try {
                            final int part = partIndex.incrementAndGet();
                            if (part < fileInfo.numberOfParts()) {
                                final String partName = fileInfo.partName(part);
                                // continue with the new part
                                blobContainer.readBlob(partName, this);
                                countDown = false;
                                return;
                            }
                        } finally {
                            if (countDown) {
                                latch.countDown();
                            }
                        }
                    }

                    @Override
                    public void onFailure(Throwable t) {
                        try {
                            failures.add(t);
                        } finally {
                            latch.countDown();
                        }
                    }
                });

                try {
                    latch.await();
                } catch (InterruptedException e) {
                    Thread.interrupted();
                }

                if (!failures.isEmpty()) {
                    ExceptionsHelper.rethrowAndSuppress(failures);
                }

                final byte[] bytes = out.toByteArray();
                assert bytes != null;
                assert bytes.length == fileInfo.length() : bytes.length + " != " + fileInfo.length();
                final BytesRef spare = new BytesRef(bytes);
                Store.MetadataSnapshot.hashFile(fileInfo.metadata().hash(), spare);
            }
        }
    }

    /**
     * Context for restore operations
     */
    private class RestoreContext extends Context {

        private final Store store;

        private final RecoveryState recoveryState;

        /**
         * Constructs new restore context
         *
         * @param snapshotId      snapshot id
         * @param shardId         shard to be restored
         * @param snapshotShardId shard in the snapshot that data should be restored from
         * @param recoveryState   recovery state to report progress
         */
        public RestoreContext(SnapshotId snapshotId, ShardId shardId, ShardId snapshotShardId, RecoveryState recoveryState) {
            super(snapshotId, shardId, snapshotShardId);
            store = indicesService.indexServiceSafe(shardId.getIndex()).shardInjectorSafe(shardId.id()).getInstance(Store.class);
            this.recoveryState = recoveryState;
        }

        /**
         * Performs restore operation
         */
        public void restore() {
            store.incRef();
            try {
                logger.debug("[{}] [{}] restoring to [{}] ...", snapshotId, repositoryName, shardId);
                BlobStoreIndexShardSnapshot snapshot = loadSnapshot();

                recoveryState.setStage(RecoveryState.Stage.INDEX);
                int numberOfFiles = 0;
                long totalSize = 0;
                int numberOfReusedFiles = 0;
                long reusedTotalSize = 0;
                Store.MetadataSnapshot recoveryTargetMetadata = Store.MetadataSnapshot.EMPTY;
                try {
                    recoveryTargetMetadata = store.getMetadata();
                } catch (CorruptIndexException e) {
                    logger.warn("{} Can't read metadata from store", e, shardId);
                    throw new IndexShardRestoreFailedException(shardId, "Can't restore corrupted shard", e);
                } catch (Throwable e) {
                    // if the index is broken we might not be able to read it
                    logger.warn("{} Can't read metadata from store", e, shardId);
                }

                final List<FileInfo> filesToRecover = Lists.newArrayList();
                final Map<String, StoreFileMetaData> snapshotMetaData = new HashMap<>();
                final Map<String, FileInfo> fileInfos = new HashMap<>();
                for (final FileInfo fileInfo : snapshot.indexFiles()) {
                    try {
                        // in 1.4.0 we added additional hashes for .si / segments_N files
                        // to ensure we don't double the space in the repo since old snapshots
                        // don't have this hash we try to read that hash from the blob store
                        // in a bwc compatible way.
                        maybeRecalculateMetadataHash(blobContainer, fileInfo, recoveryTargetMetadata);
                    }  catch (Throwable e) {
                        // if the index is broken we might not be able to read it
                        logger.warn("{} Can't calculate hash from blog for file [{}] [{}]", e, shardId, fileInfo.physicalName(), fileInfo.metadata());
                    }
                    snapshotMetaData.put(fileInfo.metadata().name(), fileInfo.metadata());
                    fileInfos.put(fileInfo.metadata().name(), fileInfo);
                }
                final Store.MetadataSnapshot sourceMetaData = new Store.MetadataSnapshot(snapshotMetaData);
                final Store.RecoveryDiff diff = sourceMetaData.recoveryDiff(recoveryTargetMetadata);
                for (StoreFileMetaData md : diff.identical) {
                    FileInfo fileInfo = fileInfos.get(md.name());
                    numberOfFiles++;
                    totalSize += md.length();
                    numberOfReusedFiles++;
                    reusedTotalSize += md.length();
                    recoveryState.getIndex().addReusedFileDetail(fileInfo.name(), fileInfo.length());
                    if (logger.isTraceEnabled()) {
                        logger.trace("[{}] [{}] not_recovering [{}] from [{}], exists in local store and is same", shardId, snapshotId, fileInfo.physicalName(), fileInfo.name());
                    }
                }

                for (StoreFileMetaData md : Iterables.concat(diff.different, diff.missing)) {
                    FileInfo fileInfo = fileInfos.get(md.name());
                    numberOfFiles++;
                    totalSize += fileInfo.length();
                    filesToRecover.add(fileInfo);
                    recoveryState.getIndex().addFileDetail(fileInfo.name(), fileInfo.length());
                    if (logger.isTraceEnabled()) {
                        if (md == null) {
                            logger.trace("[{}] [{}] recovering [{}] from [{}], does not exists in local store", shardId, snapshotId, fileInfo.physicalName(), fileInfo.name());
                        } else {
                            logger.trace("[{}] [{}] recovering [{}] from [{}], exists in local store but is different", shardId, snapshotId, fileInfo.physicalName(), fileInfo.name());
                        }
                    }
                }
                final RecoveryState.Index index = recoveryState.getIndex();
                index.totalFileCount(numberOfFiles);
                index.totalByteCount(totalSize);
                index.reusedFileCount(numberOfReusedFiles);
                index.reusedByteCount(reusedTotalSize);
                if (filesToRecover.isEmpty()) {
                    logger.trace("no files to recover, all exists within the local store");
                }

                if (logger.isTraceEnabled()) {
                    logger.trace("[{}] [{}] recovering_files [{}] with total_size [{}], reusing_files [{}] with reused_size [{}]", shardId, snapshotId, numberOfFiles, new ByteSizeValue(totalSize), numberOfReusedFiles, new ByteSizeValue(reusedTotalSize));
                }

                final CountDownLatch latch = new CountDownLatch(filesToRecover.size());
                final CopyOnWriteArrayList<Throwable> failures = new CopyOnWriteArrayList<>();

                for (final FileInfo fileToRecover : filesToRecover) {
                    logger.trace("[{}] [{}] restoring file [{}]", shardId, snapshotId, fileToRecover.name());
                    restoreFile(fileToRecover, latch, failures);
                }

                try {
                    latch.await();
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                }

                if (!failures.isEmpty()) {
                    throw new IndexShardRestoreFailedException(shardId, "Failed to recover index", failures.get(0));
                }

                // read the snapshot data persisted
                long version = -1;
                try {
                    if (Lucene.indexExists(store.directory())) {
                        version = Lucene.readSegmentInfos(store.directory()).getVersion();
                    }
                } catch (IOException e) {
                    throw new IndexShardRestoreFailedException(shardId, "Failed to fetch index version after copying it over", e);
                }
                recoveryState.getIndex().updateVersion(version);

                /// now, go over and clean files that are in the store, but were not in the snapshot
                try {
                    for (String storeFile : store.directory().listAll()) {
                        if (!snapshot.containPhysicalIndexFile(storeFile)) {
                            try {
                                store.directory().deleteFile(storeFile);
                            } catch (IOException e) {
                                // ignore
                            }
                        }
                    }
                } catch (IOException e) {
                    // ignore
                }
            } finally {
                store.decRef();
            }
        }

        /**
         * Restores a file
         * This is asynchronous method. Upon completion of the operation latch is getting counted down and any failures are
         * added to the {@code failures} list
         *
         * @param fileInfo file to be restored
         * @param latch    latch that should be counted down once file is snapshoted
         * @param failures thread-safe list of failures
         */
        private void restoreFile(final FileInfo fileInfo, final CountDownLatch latch, final List<Throwable> failures) {
            final IndexOutput indexOutput;
            try {
                // we create an output with no checksum, this is because the pure binary data of the file is not
                // the checksum (because of seek). We will create the checksum file once copying is done
                indexOutput = store.createVerifyingOutput(fileInfo.physicalName(), IOContext.DEFAULT, fileInfo.metadata());
            } catch (IOException e) {
                try {
                    failures.add(e);
                } finally {
                    latch.countDown();
                }
                return;
            }

            String firstFileToRecover = fileInfo.partName(0);
            final AtomicInteger partIndex = new AtomicInteger();
            boolean success = false;
            try {
                blobContainer.readBlob(firstFileToRecover, new BlobContainer.ReadBlobListener() {
                    @Override
                    public synchronized void onPartial(byte[] data, int offset, int size) throws IOException {
                        recoveryState.getIndex().addRecoveredByteCount(size);
                        RecoveryState.File file = recoveryState.getIndex().file(fileInfo.name());
                        if (file != null) {
                            file.updateRecovered(size);
                        }
                        indexOutput.writeBytes(data, offset, size);
                        if (restoreRateLimiter != null) {
                            rateLimiterListener.onRestorePause(restoreRateLimiter.pause(size));
                        }
                    }

                    @Override
                    public synchronized void onCompleted() {
                        int part = partIndex.incrementAndGet();
                        if (part < fileInfo.numberOfParts()) {
                            String partName = fileInfo.partName(part);
                            // continue with the new part
                            blobContainer.readBlob(partName, this);
                            return;
                        } else {
                            // we are done...
                            try {
                                Store.verify(indexOutput);
                                indexOutput.close();
                                // write the checksum
                                if (fileInfo.metadata().hasLegacyChecksum()) {
                                    Store.LegacyChecksums legacyChecksums = new Store.LegacyChecksums();
                                    legacyChecksums.add(fileInfo.metadata());
                                    legacyChecksums.write(store);

                                }
                                store.directory().sync(Collections.singleton(fileInfo.physicalName()));
                                recoveryState.getIndex().addRecoveredFileCount(1);
                            } catch (IOException e) {
                                onFailure(e);
                                return;
                            }
                        }
                        latch.countDown();
                    }

                    @Override
                    public void onFailure(Throwable t) {
                        try {
                            failures.add(t);
                            IOUtils.closeWhileHandlingException(indexOutput);
                            if (t instanceof CorruptIndexException) {
                                try {
                                    store.markStoreCorrupted((CorruptIndexException) t);
                                } catch (IOException e) {
                                    logger.warn("store cannot be marked as corrupted", e);
                                }
                            }
                            store.deleteQuiet(fileInfo.physicalName());
                        } finally {
                            latch.countDown();
                        }
                    }
                });
                success = true;
            } finally {
                if (!success) {
                    try {
                        IOUtils.closeWhileHandlingException(indexOutput);
                        store.deleteQuiet(fileInfo.physicalName());
                    } finally {
                        latch.countDown();
                    }

                }
            }

        }

    }

    public interface RateLimiterListener {
        void onRestorePause(long nanos);

        void onSnapshotPause(long nanos);
    }

}


text:
{% if not standalone %}{% extends 'admin/master.html' %}{% endif %}

{% macro group_by_period(period='day') %}

	        Messages - From {{ first_time|datetimeformat(format='long') }} To {{ last_time|datetimeformat(format='long') }}

                            Date
                            Total
                            Incoming
                            Outgoing
                            Spam
                            Size (avg)
                            Size (total)

                        {% for d in data %}

                                {{ d.date }}	{#|dateformat(format='short')#}
                                {{ d.mail_count|numberformat }}
                                {{ d.mail_in|numberformat }}
                                {{ d.mail_out|numberformat }}
                                {{ d.spam|numberformat }}
                                {{ d.size_avg|filesizeformat }}
                                {{ d.size_sum|filesizeformat }}

                        {% endfor %}

{% endmacro %}

{% block body %}
{{ group_by_period('day') }}
{% endblock body %}


text:
@interface RBBaseTableViewCell : UITableViewCell

- (void)updateWithObject:(id)object;

+ (NSString*)cellIdentifier;

@end


text:
.theme-color-c7ccea a,
.theme-color-c7ccea blockquote:before,
.theme-color-c7ccea .contact-map .contact-info a:hover,
.theme-color-c7ccea .interests-list i,
.theme-color-c7ccea .input-field.used label,
.theme-color-c7ccea .logo span,
.theme-color-c7ccea #map .map-icon,
.theme-color-c7ccea .nav-wrap .btn-mobile-nav,
.theme-color-c7ccea .page-404 h2 span,
.theme-color-c7ccea .post-box .post-title a:hover,
.theme-color-c7ccea .post-single .post-title a:hover,
.theme-color-c7ccea .post-comments .section-title,
.theme-color-c7ccea .ref-box .person-speech:before,
.theme-color-c7ccea .timeline-box .date,
.theme-color-c7ccea .widget-title,
.theme-color-c7ccea .widget_meta ul li a:hover,
.theme-color-c7ccea .widget_archive ul li a:hover,
.theme-color-c7ccea .widget_nav_menu ul li a:hover,
.theme-color-c7ccea .widget_categories ul li a:hover,
.theme-color-c7ccea .widget_recent_entries ul li a:hover,
.theme-color-c7ccea .widget_recent_comments ul li a:hover,
.theme-color-c7ccea .widget_search .search-form:before,
.theme-color-c7ccea .widget-popuplar-posts .post-title a:hover,
.theme-color-c7ccea .widget-recent-posts .post-title a:hover {
  color: #c7ccea; }
.theme-color-c7ccea ins,
.theme-color-c7ccea mark,
.theme-color-c7ccea .btn-primary,
.theme-color-c7ccea .btn-primary-outer,
.theme-color-c7ccea .btn-sidebar-close,
.theme-color-c7ccea .calendar-busy .calendar-body td .current-day,
.theme-color-c7ccea .calendar-busy .calendar-today .date,
.theme-color-c7ccea .filter .active:after,
.theme-color-c7ccea .filter-bar .filter-bar-line,
.theme-color-c7ccea .input-field .line:before,
.theme-color-c7ccea .input-field .line:after,
.theme-color-c7ccea .mobile-nav,
.theme-color-c7ccea .nav > ul > li > a > span,
.theme-color-c7ccea .post-datetime,
.theme-color-c7ccea .profile-social,
.theme-color-c7ccea .profile-preword span,
.theme-color-c7ccea .progress-bar .bar-fill,
.theme-color-c7ccea .progress-bar .bar-line:after,
.theme-color-c7ccea .price-box.box-primary .btn,
.theme-color-c7ccea .price-box.box-primary .price-box-top,
.theme-color-c7ccea .profile-list .button,
.theme-color-c7ccea .pagination .page-numbers.current,
.theme-color-c7ccea .pagination .page-numbers.current:hover,
.theme-color-c7ccea .pagination .page-numbers:active,
.theme-color-c7ccea .pagination .page-numbers.next:active,
.theme-color-c7ccea .pagination .page-numbers.prev:active,
.theme-color-c7ccea .timeline-bar,
.theme-color-c7ccea .timeline-box .dot,
.theme-color-c7ccea .timeline-box-compact .date span,
.theme-color-c7ccea .widget_tag_cloud a:hover {
  background-color: #c7ccea; }
.theme-color-c7ccea .mejs-container .mejs-controls .mejs-time-rail .mejs-time-current,
.theme-color-c7ccea .mejs-container .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
  background: #c7ccea; }
.theme-color-c7ccea .timeline-box-inner,
.theme-color-c7ccea .price-box.box-primary .btn,
.theme-color-c7ccea .widget_search .search-form,
.theme-color-c7ccea .widget_tag_cloud a:hover {
  border-color: #c7ccea; }
.theme-color-c7ccea .page-404 h2 span:before,
.theme-color-c7ccea .profile-preword span:before,
.theme-color-c7ccea .timeline-box-compact .date span:before {
  border-left-color: #c7ccea; }
.theme-color-c7ccea .price-box.box-primary .price-box-top:before {
  border-top-color: #c7ccea; }


text:
package kg.apc.charting.elements;

import kg.apc.charting.AbstractGraphPanelChartElement;

/**
 * {@inheritDoc}
 */
public class GraphPanelChartExactElement
        extends AbstractGraphPanelChartElement {
    private long x = 0;
    private double y = 0;

    public GraphPanelChartExactElement(long xVal, double yVal) {
        x = xVal;
        y = yVal;
    }

    /**
     * {@inheritDoc}
     */
    public double getValue() {
        return y;
    }

    public long getX() {
        return x;
    }

    public void add(double val) {
        y = val;
    }
}


text:
package alluxio.network.protocol.databuffer;

import com.google.common.base.Preconditions;
import io.netty.channel.DefaultFileRegion;

import java.io.File;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

/**
 * A DataBuffer with the underlying data being a {@link FileChannel}.
 */
public final class DataFileChannel implements DataBuffer {
  private final File mFile;
  private final long mOffset;
  private final long mLength;

  /**
   *
   * @param file The file
   * @param offset The offset into the FileChannel
   * @param length The length of the data to read
   */
  public DataFileChannel(File file, long offset, long length) {
    mFile = Preconditions.checkNotNull(file);
    mOffset = offset;
    mLength = length;
  }

  @Override
  public Object getNettyOutput() {
    return new DefaultFileRegion(mFile, mOffset, mLength);
  }

  @Override
  public long getLength() {
    return mLength;
  }

  @Override
  public ByteBuffer getReadOnlyByteBuffer() {
    throw new UnsupportedOperationException(
        "DataFileChannel#getReadOnlyByteBuffer is not implemented.");
  }

  @Override
  public void readBytes(byte[] dst, int dstIndex, int length) {
    throw new UnsupportedOperationException("DataFileChannel#readBytes is not implemented.");
  }

  @Override
  public int readableBytes() {
    throw new UnsupportedOperationException("DataFileChannel#readableBytes is not implemented.");
  }

  @Override
  public void release() {
    // Nothing we need to release explicitly, let GC take care of all objects.
  }
}