text:
#ifndef BASS_H
#define BASS_H

#include <wtypes.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef BASSDEF
#define BASSDEF(f) WINAPI f
#endif

typedef unsigned __int64 QWORD;	// 64-bit

typedef DWORD HMUSIC;		// MOD music handle
typedef DWORD HSAMPLE;		// sample handle
typedef DWORD HCHANNEL;		// playing sample's channel handle
typedef DWORD HSTREAM;		// sample stream handle
typedef DWORD HRECORD;		// recording handle
typedef DWORD HSYNC;		// synchronizer handle
typedef DWORD HDSP;			// DSP handle
typedef DWORD HFX;			// DX8 effect handle

// Error codes returned by BASS_GetErrorCode
#define BASS_OK				0	// all is OK
#define BASS_ERROR_MEM		1	// memory error
#define BASS_ERROR_FILEOPEN	2	// can't open the file
#define BASS_ERROR_DRIVER	3	// can't find a free/valid driver
#define BASS_ERROR_BUFLOST	4	// the sample buffer was lost
#define BASS_ERROR_HANDLE	5	// invalid handle
#define BASS_ERROR_FORMAT	6	// unsupported sample format
#define BASS_ERROR_POSITION	7	// invalid playback position
#define BASS_ERROR_INIT		8	// BASS_Init has not been successfully called
#define BASS_ERROR_START	9	// BASS_Start has not been successfully called
#define BASS_ERROR_ALREADY	14	// already initialized
#define BASS_ERROR_NOPAUSE	16	// not paused
#define BASS_ERROR_NOCHAN	18	// can't get a free channel
#define BASS_ERROR_ILLTYPE	19	// an illegal type was specified
#define BASS_ERROR_ILLPARAM	20	// an illegal parameter was specified
#define BASS_ERROR_NO3D		21	// no 3D support
#define BASS_ERROR_NOEAX	22	// no EAX support
#define BASS_ERROR_DEVICE	23	// illegal device number
#define BASS_ERROR_NOPLAY	24	// not playing
#define BASS_ERROR_FREQ		25	// illegal sample rate
#define BASS_ERROR_NOTFILE	27	// the stream is not a file stream
#define BASS_ERROR_NOHW		29	// no hardware voices available
#define BASS_ERROR_EMPTY	31	// the MOD music has no sequence data
#define BASS_ERROR_NONET	32	// no internet connection could be opened
#define BASS_ERROR_CREATE	33	// couldn't create the file
#define BASS_ERROR_NOFX		34	// effects are not available
#define BASS_ERROR_PLAYING	35	// the channel is playing
#define BASS_ERROR_NOTAVAIL	37	// requested data is not available
#define BASS_ERROR_DECODE	38	// the channel is a "decoding channel"
#define BASS_ERROR_DX		39	// a sufficient DirectX version is not installed
#define BASS_ERROR_TIMEOUT	40	// connection timedout
#define BASS_ERROR_FILEFORM	41	// unsupported file format
#define BASS_ERROR_SPEAKER	42	// unavailable speaker
#define BASS_ERROR_UNKNOWN	-1	// some other mystery error

// Initialization flags
#define BASS_DEVICE_8BITS	1	// use 8 bit resolution, else 16 bit
#define BASS_DEVICE_MONO	2	// use mono, else stereo
#define BASS_DEVICE_3D		4	// enable 3D functionality
/* If the BASS_DEVICE_3D flag is not specified when initilizing BASS,
then the 3D flags (BASS_SAMPLE_3D and BASS_MUSIC_3D) are ignored when
loading/creating a sample/stream/music. */
#define BASS_DEVICE_LATENCY	256	// calculate device latency (BASS_INFO struct)
#define BASS_DEVICE_SPEAKERS 2048	// force enabling of speaker assignment

// DirectSound interfaces (for use with BASS_GetDSoundObject)
#define BASS_OBJECT_DS		1	// IDirectSound
#define BASS_OBJECT_DS3DL	2	// IDirectSound3DListener

typedef struct {
	DWORD size;		// size of this struct (set this before calling the function)
	DWORD flags;	// device capabilities (DSCAPS_xxx flags)
	DWORD hwsize;	// size of total device hardware memory
	DWORD hwfree;	// size of free device hardware memory
	DWORD freesam;	// number of free sample slots in the hardware
	DWORD free3d;	// number of free 3D sample slots in the hardware
	DWORD minrate;	// min sample rate supported by the hardware
	DWORD maxrate;	// max sample rate supported by the hardware
	BOOL eax;		// device supports EAX? (always FALSE if BASS_DEVICE_3D was not used)
	DWORD minbuf;	// recommended minimum buffer length in ms (requires BASS_DEVICE_LATENCY)
	DWORD dsver;	// DirectSound version
	DWORD latency;	// delay (in ms) before start of playback (requires BASS_DEVICE_LATENCY)
	DWORD initflags;// "flags" parameter of BASS_Init call
	DWORD speakers; // number of speakers available
	char *driver;	// driver
} BASS_INFO;

// BASS_INFO flags (from DSOUND.H)
#define DSCAPS_CONTINUOUSRATE	0x00000010
/* supports all sample rates between min/maxrate */
#define DSCAPS_EMULDRIVER		0x00000020
/* device does NOT have hardware DirectSound support */
#define DSCAPS_CERTIFIED		0x00000040
/* device driver has been certified by Microsoft */
/* The following flags tell what type of samples are supported by HARDWARE
mixing, all these formats are supported by SOFTWARE mixing */
#define DSCAPS_SECONDARYMONO	0x00000100	// mono
#define DSCAPS_SECONDARYSTEREO	0x00000200	// stereo
#define DSCAPS_SECONDARY8BIT	0x00000400	// 8 bit
#define DSCAPS_SECONDARY16BIT	0x00000800	// 16 bit

typedef struct {
	DWORD size;		// size of this struct (set this before calling the function)
	DWORD flags;	// device capabilities (DSCCAPS_xxx flags)
	DWORD formats;	// supported standard formats (WAVE_FORMAT_xxx flags)
	DWORD inputs;	// number of inputs
	BOOL singlein;	// TRUE = only 1 input can be set at a time
	char *driver;	// driver
} BASS_RECORDINFO;

// BASS_RECORDINFO flags (from DSOUND.H)
#define DSCCAPS_EMULDRIVER	DSCAPS_EMULDRIVER
/* device does NOT have hardware DirectSound recording support */
#define DSCCAPS_CERTIFIED	DSCAPS_CERTIFIED
/* device driver has been certified by Microsoft */

// defines for formats field of BASS_RECORDINFO (from MMSYSTEM.H)
#ifndef WAVE_FORMAT_1M08
#define WAVE_FORMAT_1M08       0x00000001       /* 11.025 kHz, Mono,   8-bit  */
#define WAVE_FORMAT_1S08       0x00000002       /* 11.025 kHz, Stereo, 8-bit  */
#define WAVE_FORMAT_1M16       0x00000004       /* 11.025 kHz, Mono,   16-bit */
#define WAVE_FORMAT_1S16       0x00000008       /* 11.025 kHz, Stereo, 16-bit */
#define WAVE_FORMAT_2M08       0x00000010       /* 22.05  kHz, Mono,   8-bit  */
#define WAVE_FORMAT_2S08       0x00000020       /* 22.05  kHz, Stereo, 8-bit  */
#define WAVE_FORMAT_2M16       0x00000040       /* 22.05  kHz, Mono,   16-bit */
#define WAVE_FORMAT_2S16       0x00000080       /* 22.05  kHz, Stereo, 16-bit */
#define WAVE_FORMAT_4M08       0x00000100       /* 44.1   kHz, Mono,   8-bit  */
#define WAVE_FORMAT_4S08       0x00000200       /* 44.1   kHz, Stereo, 8-bit  */
#define WAVE_FORMAT_4M16       0x00000400       /* 44.1   kHz, Mono,   16-bit */
#define WAVE_FORMAT_4S16       0x00000800       /* 44.1   kHz, Stereo, 16-bit */
#endif

// Sample info structure & flags
typedef struct {
	DWORD freq;		// default playback rate
	DWORD volume;	// default volume (0-100)
	int pan;		// default pan (-100=left, 0=middle, 100=right)
	DWORD flags;	// BASS_SAMPLE_xxx flags
	DWORD length;	// length (in samples, not bytes)
	DWORD max;		// maximum simultaneous playbacks
/* The following are the sample's default 3D attributes (if the sample
is 3D, BASS_SAMPLE_3D is in flags) see BASS_ChannelSet3DAttributes */
	DWORD mode3d;	// BASS_3DMODE_xxx mode
	float mindist;	// minimum distance
	float maxdist;	// maximum distance
	DWORD iangle;	// angle of inside projection cone
	DWORD oangle;	// angle of outside projection cone
	DWORD outvol;	// delta-volume outside the projection cone
/* The following are the defaults used if the sample uses the DirectX 7
voice allocation/management features. */
	DWORD vam;		// voice allocation/management flags (BASS_VAM_xxx)
	DWORD priority;	// priority (0=lowest, 0xffffffff=highest)
} BASS_SAMPLE;

#define BASS_SAMPLE_8BITS		1	// 8 bit
#define BASS_SAMPLE_FLOAT		256	// 32-bit floating-point
#define BASS_SAMPLE_MONO		2	// mono, else stereo
#define BASS_SAMPLE_LOOP		4	// looped
#define BASS_SAMPLE_3D			8	// 3D functionality enabled
#define BASS_SAMPLE_SOFTWARE	16	// it's NOT using hardware mixing
#define BASS_SAMPLE_MUTEMAX		32	// muted at max distance (3D only)
#define BASS_SAMPLE_VAM			64	// uses the DX7 voice allocation & management
#define BASS_SAMPLE_FX			128	// old implementation of DX8 effects are enabled
#define BASS_SAMPLE_OVER_VOL	0x10000	// override lowest volume
#define BASS_SAMPLE_OVER_POS	0x20000	// override longest playing
#define BASS_SAMPLE_OVER_DIST	0x30000 // override furthest from listener (3D only)

#define BASS_MP3_SETPOS			0x20000 // enable pin-point seeking on the MP3/MP2/MP1

#define BASS_STREAM_AUTOFREE	0x40000	// automatically free the stream when it stop/ends
#define BASS_STREAM_RESTRATE	0x80000	// restrict the download rate of internet file streams
#define BASS_STREAM_BLOCK		0x100000// download/play internet file stream (MPx/OGG) in small blocks
#define BASS_STREAM_DECODE		0x200000// don't play the stream, only decode (BASS_ChannelGetData)
#define BASS_STREAM_META		0x400000// request metadata from a Shoutcast stream

#define BASS_MUSIC_FLOAT		BASS_SAMPLE_FLOAT // 32-bit floating-point
#define BASS_MUSIC_MONO			BASS_SAMPLE_MONO // force mono mixing (less CPU usage)
#define BASS_MUSIC_LOOP			BASS_SAMPLE_LOOP // loop music
#define BASS_MUSIC_3D			BASS_SAMPLE_3D // enable 3D functionality
#define BASS_MUSIC_FX			BASS_SAMPLE_FX // enable old implementation of DX8 effects
#define BASS_MUSIC_AUTOFREE		BASS_STREAM_AUTOFREE // automatically free the music when it stop/ends
#define BASS_MUSIC_DECODE		BASS_STREAM_DECODE // don't play the music, only decode (BASS_ChannelGetData)
#define BASS_MUSIC_RAMP			0x200	// normal ramping
#define BASS_MUSIC_RAMPS		0x400	// sensitive ramping
#define BASS_MUSIC_SURROUND		0x800	// surround sound
#define BASS_MUSIC_SURROUND2	0x1000	// surround sound (mode 2)
#define BASS_MUSIC_FT2MOD		0x2000	// play .MOD as FastTracker 2 does
#define BASS_MUSIC_PT1MOD		0x4000	// play .MOD as ProTracker 1 does
#define BASS_MUSIC_CALCLEN		0x8000	// calculate playback length
#define BASS_MUSIC_NONINTER		0x10000	// non-interpolated mixing
#define BASS_MUSIC_POSRESET		0x20000	// stop all notes when moving position
#define BASS_MUSIC_STOPBACK		0x80000	// stop the music on a backwards jump effect
#define BASS_MUSIC_NOSAMPLE		0x100000// don't load the samples

// Speaker assignment flags
#define BASS_SPEAKER_FRONT	0x1000000	// front speakers
#define BASS_SPEAKER_REAR	0x2000000	// rear/side speakers
#define BASS_SPEAKER_CENLFE	0x3000000	// center & LFE speakers (5.1)
#define BASS_SPEAKER_REAR2	0x4000000	// rear center speakers (7.1)
#define BASS_SPEAKER_LEFT	0x10000000	// modifier: left
#define BASS_SPEAKER_RIGHT	0x20000000	// modifier: right
#define BASS_SPEAKER_FRONTLEFT	BASS_SPEAKER_FRONT|BASS_SPEAKER_LEFT
#define BASS_SPEAKER_FRONTRIGHT	BASS_SPEAKER_FRONT|BASS_SPEAKER_RIGHT
#define BASS_SPEAKER_REARLEFT	BASS_SPEAKER_REAR|BASS_SPEAKER_LEFT
#define BASS_SPEAKER_REARRIGHT	BASS_SPEAKER_REAR|BASS_SPEAKER_RIGHT
#define BASS_SPEAKER_CENTER		BASS_SPEAKER_CENLFE|BASS_SPEAKER_LEFT
#define BASS_SPEAKER_LFE		BASS_SPEAKER_CENLFE|BASS_SPEAKER_RIGHT
#define BASS_SPEAKER_REAR2LEFT	BASS_SPEAKER_REAR2|BASS_SPEAKER_LEFT
#define BASS_SPEAKER_REAR2RIGHT	BASS_SPEAKER_REAR2|BASS_SPEAKER_RIGHT

#define BASS_UNICODE			0x80000000

#define BASS_RECORD_PAUSE		0x8000	// start recording paused

// DX7 voice allocation flags
#define BASS_VAM_HARDWARE		1
/* Play the sample in hardware. If no hardware voices are available then
the "play" call will fail */
#define BASS_VAM_SOFTWARE		2
/* Play the sample in software (ie. non-accelerated). No other VAM flags
may be used together with this flag. */

// DX7 voice management flags
/* These flags enable hardware resource stealing... if the hardware has no
available voices, a currently playing buffer will be stopped to make room for
the new buffer. NOTE: only samples loaded/created with the BASS_SAMPLE_VAM
flag are considered for termination by the DX7 voice management. */
#define BASS_VAM_TERM_TIME		4
/* If there are no free hardware voices, the buffer to be terminated will be
the one with the least time left to play. */
#define BASS_VAM_TERM_DIST		8
/* If there are no free hardware voices, the buffer to be terminated will be
one that was loaded/created with the BASS_SAMPLE_MUTEMAX flag and is beyond
it's max distance. If there are no buffers that match this criteria, then the
"play" call will fail. */
#define BASS_VAM_TERM_PRIO		16
/* If there are no free hardware voices, the buffer to be terminated will be
the one with the lowest priority. */

typedef struct {
	DWORD freq;		// default playback rate
	DWORD chans;	// channels
	DWORD flags;	// BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags
	DWORD ctype;	// type of channel
} BASS_CHANNELINFO;

// BASS_CHANNELINFO types
#define BASS_CTYPE_SAMPLE		1
#define BASS_CTYPE_RECORD		2
#define BASS_CTYPE_STREAM		0x10000
#define BASS_CTYPE_STREAM_WAV	0x10001
#define BASS_CTYPE_STREAM_OGG	0x10002
#define BASS_CTYPE_STREAM_MP1	0x10003
#define BASS_CTYPE_STREAM_MP2	0x10004
#define BASS_CTYPE_STREAM_MP3	0x10005
#define BASS_CTYPE_MUSIC_MOD	0x20000
#define BASS_CTYPE_MUSIC_MTM	0x20001
#define BASS_CTYPE_MUSIC_S3M	0x20002
#define BASS_CTYPE_MUSIC_XM		0x20003
#define BASS_CTYPE_MUSIC_IT		0x20004
#define BASS_CTYPE_MUSIC_MO3	0x00100 // mo3 flag

// 3D vector (for 3D positions/velocities/orientations)
typedef struct BASS_3DVECTOR {
#ifdef __cplusplus
	BASS_3DVECTOR() {};
	BASS_3DVECTOR(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {};
#endif
	float x;	// +=right, -=left
	float y;	// +=up, -=down
	float z;	// +=front, -=behind
} BASS_3DVECTOR;

// 3D channel modes
#define BASS_3DMODE_NORMAL		0
/* normal 3D processing */
#define BASS_3DMODE_RELATIVE	1
/* The channel's 3D position (position/velocity/orientation) are relative to
the listener. When the listener's position/velocity/orientation is changed
with BASS_Set3DPosition, the channel's position relative to the listener does
not change. */
#define BASS_3DMODE_OFF			2
/* Turn off 3D processing on the channel, the sound will be played
in the center. */

// EAX environments, use with BASS_SetEAXParameters
enum
{
    EAX_ENVIRONMENT_GENERIC,
    EAX_ENVIRONMENT_PADDEDCELL,
    EAX_ENVIRONMENT_ROOM,
    EAX_ENVIRONMENT_BATHROOM,
    EAX_ENVIRONMENT_LIVINGROOM,
    EAX_ENVIRONMENT_STONEROOM,
    EAX_ENVIRONMENT_AUDITORIUM,
    EAX_ENVIRONMENT_CONCERTHALL,
    EAX_ENVIRONMENT_CAVE,
    EAX_ENVIRONMENT_ARENA,
    EAX_ENVIRONMENT_HANGAR,
    EAX_ENVIRONMENT_CARPETEDHALLWAY,
    EAX_ENVIRONMENT_HALLWAY,
    EAX_ENVIRONMENT_STONECORRIDOR,
    EAX_ENVIRONMENT_ALLEY,
    EAX_ENVIRONMENT_FOREST,
    EAX_ENVIRONMENT_CITY,
    EAX_ENVIRONMENT_MOUNTAINS,
    EAX_ENVIRONMENT_QUARRY,
    EAX_ENVIRONMENT_PLAIN,
    EAX_ENVIRONMENT_PARKINGLOT,
    EAX_ENVIRONMENT_SEWERPIPE,
    EAX_ENVIRONMENT_UNDERWATER,
    EAX_ENVIRONMENT_DRUGGED,
    EAX_ENVIRONMENT_DIZZY,
    EAX_ENVIRONMENT_PSYCHOTIC,

    EAX_ENVIRONMENT_COUNT			// total number of environments
};

// EAX presets, usage: BASS_SetEAXParameters(EAX_PRESET_xxx)
#define EAX_PRESET_GENERIC         EAX_ENVIRONMENT_GENERIC,0.5F,1.493F,0.5F
#define EAX_PRESET_PADDEDCELL      EAX_ENVIRONMENT_PADDEDCELL,0.25F,0.1F,0.0F
#define EAX_PRESET_ROOM            EAX_ENVIRONMENT_ROOM,0.417F,0.4F,0.666F
#define EAX_PRESET_BATHROOM        EAX_ENVIRONMENT_BATHROOM,0.653F,1.499F,0.166F
#define EAX_PRESET_LIVINGROOM      EAX_ENVIRONMENT_LIVINGROOM,0.208F,0.478F,0.0F
#define EAX_PRESET_STONEROOM       EAX_ENVIRONMENT_STONEROOM,0.5F,2.309F,0.888F
#define EAX_PRESET_AUDITORIUM      EAX_ENVIRONMENT_AUDITORIUM,0.403F,4.279F,0.5F
#define EAX_PRESET_CONCERTHALL     EAX_ENVIRONMENT_CONCERTHALL,0.5F,3.961F,0.5F
#define EAX_PRESET_CAVE            EAX_ENVIRONMENT_CAVE,0.5F,2.886F,1.304F
#define EAX_PRESET_ARENA           EAX_ENVIRONMENT_ARENA,0.361F,7.284F,0.332F
#define EAX_PRESET_HANGAR          EAX_ENVIRONMENT_HANGAR,0.5F,10.0F,0.3F
#define EAX_PRESET_CARPETEDHALLWAY EAX_ENVIRONMENT_CARPETEDHALLWAY,0.153F,0.259F,2.0F
#define EAX_PRESET_HALLWAY         EAX_ENVIRONMENT_HALLWAY,0.361F,1.493F,0.0F
#define EAX_PRESET_STONECORRIDOR   EAX_ENVIRONMENT_STONECORRIDOR,0.444F,2.697F,0.638F
#define EAX_PRESET_ALLEY           EAX_ENVIRONMENT_ALLEY,0.25F,1.752F,0.776F
#define EAX_PRESET_FOREST          EAX_ENVIRONMENT_FOREST,0.111F,3.145F,0.472F
#define EAX_PRESET_CITY            EAX_ENVIRONMENT_CITY,0.111F,2.767F,0.224F
#define EAX_PRESET_MOUNTAINS       EAX_ENVIRONMENT_MOUNTAINS,0.194F,7.841F,0.472F
#define EAX_PRESET_QUARRY          EAX_ENVIRONMENT_QUARRY,1.0F,1.499F,0.5F
#define EAX_PRESET_PLAIN           EAX_ENVIRONMENT_PLAIN,0.097F,2.767F,0.224F
#define EAX_PRESET_PARKINGLOT      EAX_ENVIRONMENT_PARKINGLOT,0.208F,1.652F,1.5F
#define EAX_PRESET_SEWERPIPE       EAX_ENVIRONMENT_SEWERPIPE,0.652F,2.886F,0.25F
#define EAX_PRESET_UNDERWATER      EAX_ENVIRONMENT_UNDERWATER,1.0F,1.499F,0.0F
#define EAX_PRESET_DRUGGED         EAX_ENVIRONMENT_DRUGGED,0.875F,8.392F,1.388F
#define EAX_PRESET_DIZZY           EAX_ENVIRONMENT_DIZZY,0.139F,17.234F,0.666F
#define EAX_PRESET_PSYCHOTIC       EAX_ENVIRONMENT_PSYCHOTIC,0.486F,7.563F,0.806F

// software 3D mixing algorithm modes (used with BASS_Set3DAlgorithm)
#define BASS_3DALG_DEFAULT	0
/* default algorithm (currently translates to BASS_3DALG_OFF) */
#define BASS_3DALG_OFF		1
/* Uses normal left and right panning. The vertical axis is ignored except for
scaling of volume due to distance. Doppler shift and volume scaling are still
applied, but the 3D filtering is not performed. This is the most CPU efficient
software implementation, but provides no virtual 3D audio effect. Head Related
Transfer Function processing will not be done. Since only normal stereo panning
is used, a channel using this algorithm may be accelerated by a 2D hardware
voice if no free 3D hardware voices are available. */
#define BASS_3DALG_FULL		2
/* This algorithm gives the highest quality 3D audio effect, but uses more CPU.
Requires Windows 98 2nd Edition or Windows 2000 that uses WDM drivers, if this
mode is not available then BASS_3DALG_OFF will be used instead. */
#define BASS_3DALG_LIGHT	3
/* This algorithm gives a good 3D audio effect, and uses less CPU than the FULL
mode. Requires Windows 98 2nd Edition or Windows 2000 that uses WDM drivers, if
this mode is not available then BASS_3DALG_OFF will be used instead. */

typedef DWORD (CALLBACK STREAMPROC)(HSTREAM handle, void *buffer, DWORD length, DWORD user);
/* User stream callback function. NOTE: A stream function should obviously be as quick
as possible, other streams (and MOD musics) can't be mixed until it's finished.
handle : The stream that needs writing
buffer : Buffer to write the samples in
length : Number of bytes to write
user   : The 'user' parameter value given when calling BASS_StreamCreate
RETURN : Number of bytes written. Set the BASS_STREAMPROC_END flag to end
         the stream. */

#define BASS_STREAMPROC_END		0x80000000	// end of user stream flag

// BASS_StreamGetFilePosition modes
#define BASS_FILEPOS_DECODE		0
#define BASS_FILEPOS_DOWNLOAD	1
#define BASS_FILEPOS_END		2

// STREAMFILEPROC actions
#define BASS_FILE_CLOSE		0
#define BASS_FILE_READ		1
#define BASS_FILE_QUERY		2
#define BASS_FILE_LEN		3
#define BASS_FILE_SEEK		4

typedef DWORD (CALLBACK STREAMFILEPROC)(DWORD action,DWORD param1,DWORD param2,DWORD user);
/* User file stream callback function.
action : The action to perform, one of BASS_FILE_xxx values.
param1 : Depends on "action"
param2 : Depends on "action"
user   : The 'user' parameter value given when calling BASS_StreamCreate
RETURN : Depends on "action" */

typedef void (CALLBACK DOWNLOADPROC)(void *buffer, DWORD length, DWORD user);
/* Internet stream download callback function.
buffer : Buffer containing the downloaded data... NULL=end of download
length : Number of bytes in the buffer
user   : The 'user' parameter value given when calling BASS_StreamCreateURL */

/* Sync types (with BASS_ChannelSetSync "param" and SYNCPROC "data"
definitions) & flags. */
#define BASS_SYNC_MUSICPOS	0
#define BASS_SYNC_POS		0
/* Sync when a music or stream reaches a position.
if HMUSIC...
param: LOWORD=order (0=first, -1=all) HIWORD=row (0=first, -1=all)
data : LOWORD=order HIWORD=row
if HSTREAM...
param: position in bytes
data : not used */
#define BASS_SYNC_MUSICINST	1
/* Sync when an instrument (sample for the non-instrument based formats)
is played in a music (not including retrigs).
param: LOWORD=instrument (1=first) HIWORD=note (0=c0...119=b9, -1=all)
data : LOWORD=note HIWORD=volume (0-64) */
#define BASS_SYNC_END		2
/* Sync when a music or file stream reaches the end.
param: not used
data : 1 = the sync is triggered by a backward jump in a MOD music, otherwise not used */
#define BASS_SYNC_MUSICFX	3
/* Sync when the "sync" effect (XM/MTM/MOD: E8x/Wxx, IT/S3M: S2x) is used.
param: 0:data=pos, 1:data="x" value
data : param=0: LOWORD=order HIWORD=row, param=1: "x" value */
#define BASS_SYNC_META		4
/* Sync when metadata is received in a Shoutcast stream.
param: not used
data : pointer to the metadata */
#define BASS_SYNC_SLIDE		5
/* Sync when an attribute slide is completed.
param: not used
data : the type of slide completed (one of the BASS_SLIDE_xxx values) */
#define BASS_SYNC_STALL		6
/* Sync when playback has stalled.
param: not used
data : 0=stalled, 1=resumed */
#define BASS_SYNC_DOWNLOAD	7
/* Sync when downloading of an internet (or "buffered" user file) stream has ended.
param: not used
data : not used */
#define BASS_SYNC_MESSAGE	0x20000000	// FLAG: post a Windows message (instead of callback)
/* When using a window message "callback", the message to post is given in the "proc"
parameter of BASS_ChannelSetSync, and is posted to the window specified in the BASS_Init
call. The message parameters are: WPARAM = data, LPARAM = user. */
#define BASS_SYNC_MIXTIME	0x40000000	// FLAG: sync at mixtime, else at playtime
#define BASS_SYNC_ONETIME	0x80000000	// FLAG: sync only once, else continuously

typedef void (CALLBACK SYNCPROC)(HSYNC handle, DWORD channel, DWORD data, DWORD user);
/* Sync callback function. NOTE: a sync callback function should be very
quick as other syncs can't be processed until it has finished. If the sync
is a "mixtime" sync, then other streams and MOD musics can't be mixed until
it's finished either.
handle : The sync that has occured
channel: Channel that the sync occured in
data   : Additional data associated with the sync's occurance
user   : The 'user' parameter given when calling BASS_ChannelSetSync */

typedef void (CALLBACK DSPPROC)(HDSP handle, DWORD channel, void *buffer, DWORD length, DWORD user);
/* DSP callback function. NOTE: A DSP function should obviously be as quick as
possible... other DSP functions, streams and MOD musics can not be processed
until it's finished.
handle : The DSP handle
channel: Channel that the DSP is being applied to
buffer : Buffer to apply the DSP to
length : Number of bytes in the buffer
user   : The 'user' parameter given when calling BASS_ChannelSetDSP */

typedef BOOL (CALLBACK RECORDPROC)(HRECORD handle, void *buffer, DWORD length, DWORD user);
/* Recording callback function.
handle : The recording handle
buffer : Buffer containing the recorded sample data
length : Number of bytes
user   : The 'user' parameter value given when calling BASS_RecordStart
RETURN : TRUE = continue recording, FALSE = stop */

// BASS_ChannelGetData flags
#define BASS_DATA_AVAILABLE	0			// query how much data is buffered
#define BASS_DATA_FFT512	0x80000000	// 512 sample FFT
#define BASS_DATA_FFT1024	0x80000001	// 1024 FFT
#define BASS_DATA_FFT2048	0x80000002	// 2048 FFT
#define BASS_DATA_FFT4096	0x80000003	// 4096 FFT
#define BASS_DATA_FFT_INDIVIDUAL 0x10	// FFT flag: FFT for each channel, else all combined
#define BASS_DATA_FFT_NOWINDOW	0x20	// FFT flag: no Hanning window

// BASS_StreamGetTags types : what's returned
#define BASS_TAG_ID3		0	// ID3v1 tags : 128 byte block
#define BASS_TAG_ID3V2		1	// ID3v2 tags : variable length block
#define BASS_TAG_OGG		2	// OGG comments : array of null-terminated strings
#define BASS_TAG_HTTP		3	// HTTP headers : array of null-terminated strings
#define BASS_TAG_ICY		4	// ICY headers : array of null-terminated strings
#define BASS_TAG_META		5	// ICY metadata : null-terminated string

// DX8 effect types, use with BASS_ChannelSetFX
enum
{
	BASS_FX_CHORUS,			// GUID_DSFX_STANDARD_CHORUS
	BASS_FX_COMPRESSOR,		// GUID_DSFX_STANDARD_COMPRESSOR
	BASS_FX_DISTORTION,		// GUID_DSFX_STANDARD_DISTORTION
	BASS_FX_ECHO,			// GUID_DSFX_STANDARD_ECHO
	BASS_FX_FLANGER,		// GUID_DSFX_STANDARD_FLANGER
	BASS_FX_GARGLE,			// GUID_DSFX_STANDARD_GARGLE
	BASS_FX_I3DL2REVERB,	// GUID_DSFX_STANDARD_I3DL2REVERB
	BASS_FX_PARAMEQ,		// GUID_DSFX_STANDARD_PARAMEQ
	BASS_FX_REVERB			// GUID_DSFX_WAVES_REVERB
};

typedef struct {
    float       fWetDryMix;
    float       fDepth;
    float       fFeedback;
    float       fFrequency;
    DWORD       lWaveform;	// 0=triangle, 1=sine
    float       fDelay;
    DWORD       lPhase;		// BASS_FX_PHASE_xxx
} BASS_FXCHORUS;		// DSFXChorus

typedef struct {
    float   fGain;
    float   fAttack;
    float   fRelease;
    float   fThreshold;
    float   fRatio;
    float   fPredelay;
} BASS_FXCOMPRESSOR;	// DSFXCompressor

typedef struct {
    float   fGain;
    float   fEdge;
    float   fPostEQCenterFrequency;
    float   fPostEQBandwidth;
    float   fPreLowpassCutoff;
} BASS_FXDISTORTION;	// DSFXDistortion

typedef struct {
    float   fWetDryMix;
    float   fFeedback;
    float   fLeftDelay;
    float   fRightDelay;
    BOOL    lPanDelay;
} BASS_FXECHO;			// DSFXEcho

typedef struct {
    float       fWetDryMix;
    float       fDepth;
    float       fFeedback;
    float       fFrequency;
    DWORD       lWaveform;	// 0=triangle, 1=sine
    float       fDelay;
    DWORD       lPhase;		// BASS_FX_PHASE_xxx
} BASS_FXFLANGER;		// DSFXFlanger

typedef struct {
    DWORD       dwRateHz;               // Rate of modulation in hz
    DWORD       dwWaveShape;            // 0=triangle, 1=square
} BASS_FXGARGLE;		// DSFXGargle

typedef struct {
    int     lRoom;                  // [-10000, 0]      default: -1000 mB
    int     lRoomHF;                // [-10000, 0]      default: 0 mB
    float   flRoomRolloffFactor;    // [0.0, 10.0]      default: 0.0
    float   flDecayTime;            // [0.1, 20.0]      default: 1.49s
    float   flDecayHFRatio;         // [0.1, 2.0]       default: 0.83
    int     lReflections;           // [-10000, 1000]   default: -2602 mB
    float   flReflectionsDelay;     // [0.0, 0.3]       default: 0.007 s
    int     lReverb;                // [-10000, 2000]   default: 200 mB
    float   flReverbDelay;          // [0.0, 0.1]       default: 0.011 s
    float   flDiffusion;            // [0.0, 100.0]     default: 100.0 %
    float   flDensity;              // [0.0, 100.0]     default: 100.0 %
    float   flHFReference;          // [20.0, 20000.0]  default: 5000.0 Hz
} BASS_FXI3DL2REVERB;	// DSFXI3DL2Reverb

typedef struct {
    float   fCenter;
    float   fBandwidth;
    float   fGain;
} BASS_FXPARAMEQ;		// DSFXParamEq

typedef struct {
    float   fInGain;                // [-96.0,0.0]            default: 0.0 dB
    float   fReverbMix;             // [-96.0,0.0]            default: 0.0 db
    float   fReverbTime;            // [0.001,3000.0]         default: 1000.0 ms
    float   fHighFreqRTRatio;       // [0.001,0.999]          default: 0.001
} BASS_FXREVERB;		// DSFXWavesReverb

#define BASS_FX_PHASE_NEG_180        0
#define BASS_FX_PHASE_NEG_90         1
#define BASS_FX_PHASE_ZERO           2
#define BASS_FX_PHASE_90             3
#define BASS_FX_PHASE_180            4

// BASS_ChannelIsActive return values
#define BASS_ACTIVE_STOPPED	0
#define BASS_ACTIVE_PLAYING	1
#define BASS_ACTIVE_STALLED	2
#define BASS_ACTIVE_PAUSED	3

// BASS_ChannelIsSliding return flags
#define BASS_SLIDE_FREQ	1
#define BASS_SLIDE_VOL	2
#define BASS_SLIDE_PAN	4

// BASS_RecordSetInput flags
#define BASS_INPUT_OFF		0x10000
#define BASS_INPUT_ON		0x20000
#define BASS_INPUT_LEVEL	0x40000

#define BASS_INPUT_TYPE_MASK		0xff000000
#define BASS_INPUT_TYPE_UNDEF		0x00000000
#define BASS_INPUT_TYPE_DIGITAL		0x01000000
#define BASS_INPUT_TYPE_LINE		0x02000000
#define BASS_INPUT_TYPE_MIC			0x03000000
#define BASS_INPUT_TYPE_SYNTH		0x04000000
#define BASS_INPUT_TYPE_CD			0x05000000
#define BASS_INPUT_TYPE_PHONE		0x06000000
#define BASS_INPUT_TYPE_SPEAKER		0x07000000
#define BASS_INPUT_TYPE_WAVE		0x08000000
#define BASS_INPUT_TYPE_AUX			0x09000000
#define BASS_INPUT_TYPE_ANALOG		0x0a000000

// BASS_Set/GetConfig options
#define BASS_CONFIG_BUFFER			0
#define BASS_CONFIG_UPDATEPERIOD	1
#define BASS_CONFIG_MAXVOL			3
#define BASS_CONFIG_GVOL_SAMPLE		4
#define BASS_CONFIG_GVOL_STREAM		5
#define BASS_CONFIG_GVOL_MUSIC		6
#define BASS_CONFIG_CURVE_VOL		7
#define BASS_CONFIG_CURVE_PAN		8
#define BASS_CONFIG_FLOATDSP		9
#define BASS_CONFIG_3DALGORITHM		10
#define BASS_CONFIG_NET_TIMEOUT		11
#define BASS_CONFIG_NET_BUFFER		12
#define BASS_CONFIG_PAUSE_STOPOUT	13
#define BASS_CONFIG_NET_NOPROXY		14

DWORD BASSDEF(BASS_SetConfig)(DWORD option, DWORD value);
DWORD BASSDEF(BASS_GetConfig)(DWORD option);
DWORD BASSDEF(BASS_GetVersion)();
char *BASSDEF(BASS_GetDeviceDescription)(DWORD device);
DWORD BASSDEF(BASS_ErrorGetCode)();
BOOL BASSDEF(BASS_Init)(DWORD device, DWORD freq, DWORD flags, HWND win, const GUID *dsguid);
BOOL BASSDEF(BASS_SetDevice)(DWORD device);
DWORD BASSDEF(BASS_GetDevice)();
BOOL BASSDEF(BASS_Free)();
void *BASSDEF(BASS_GetDSoundObject)(DWORD object);
BOOL BASSDEF(BASS_GetInfo)(BASS_INFO *info);
BOOL BASSDEF(BASS_Update)();
float BASSDEF(BASS_GetCPU)();
BOOL BASSDEF(BASS_Start)();
BOOL BASSDEF(BASS_Stop)();
BOOL BASSDEF(BASS_Pause)();
BOOL BASSDEF(BASS_SetVolume)(DWORD volume);
int BASSDEF(BASS_GetVolume)();

BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf);
BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf);
BOOL BASSDEF(BASS_Set3DPosition)(const BASS_3DVECTOR *pos, const BASS_3DVECTOR *vel, const BASS_3DVECTOR *front, const BASS_3DVECTOR *top);
BOOL BASSDEF(BASS_Get3DPosition)(BASS_3DVECTOR *pos, BASS_3DVECTOR *vel, BASS_3DVECTOR *front, BASS_3DVECTOR *top);
void BASSDEF(BASS_Apply3D)();
BOOL BASSDEF(BASS_SetEAXParameters)(int env, float vol, float decay, float damp);
BOOL BASSDEF(BASS_GetEAXParameters)(DWORD *env, float *vol, float *decay, float *damp);

HMUSIC BASSDEF(BASS_MusicLoad)(BOOL mem, const void *file, DWORD offset, DWORD length, DWORD flags, DWORD freq);
void BASSDEF(BASS_MusicFree)(HMUSIC handle);
char *BASSDEF(BASS_MusicGetName)(HMUSIC handle);
DWORD BASSDEF(BASS_MusicGetLength)(HMUSIC handle, BOOL playlen);
BOOL BASSDEF(BASS_MusicPreBuf)(HMUSIC handle);
BOOL BASSDEF(BASS_MusicPlay)(HMUSIC handle);
BOOL BASSDEF(BASS_MusicPlayEx)(HMUSIC handle, DWORD pos, int flags, BOOL reset);
BOOL BASSDEF(BASS_MusicSetAmplify)(HMUSIC handle, DWORD amp);
BOOL BASSDEF(BASS_MusicSetPanSep)(HMUSIC handle, DWORD pan);
BOOL BASSDEF(BASS_MusicSetPositionScaler)(HMUSIC handle, DWORD scale);
BOOL BASSDEF(BASS_MusicSetVolume)(HMUSIC handle, DWORD chanins, DWORD volume);
DWORD BASSDEF(BASS_MusicGetVolume)(HMUSIC handle, DWORD chanins);

HSAMPLE BASSDEF(BASS_SampleLoad)(BOOL mem, const void *file, DWORD offset, DWORD length, DWORD max, DWORD flags);
void* BASSDEF(BASS_SampleCreate)(DWORD length, DWORD freq, DWORD max, DWORD flags);
HSAMPLE BASSDEF(BASS_SampleCreateDone)();
void BASSDEF(BASS_SampleFree)(HSAMPLE handle);
BOOL BASSDEF(BASS_SampleGetInfo)(HSAMPLE handle, BASS_SAMPLE *info);
BOOL BASSDEF(BASS_SampleSetInfo)(HSAMPLE handle, const BASS_SAMPLE *info);
HCHANNEL BASSDEF(BASS_SamplePlay)(HSAMPLE handle);
HCHANNEL BASSDEF(BASS_SamplePlayEx)(HSAMPLE handle, DWORD start, int freq, int volume, int pan, BOOL loop);
HCHANNEL BASSDEF(BASS_SamplePlay3D)(HSAMPLE handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel);
HCHANNEL BASSDEF(BASS_SamplePlay3DEx)(HSAMPLE handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel, DWORD start, int freq, int volume, BOOL loop);
BOOL BASSDEF(BASS_SampleStop)(HSAMPLE handle);

HSTREAM BASSDEF(BASS_StreamCreate)(DWORD freq, DWORD chans, DWORD flags, STREAMPROC *proc, DWORD user);
HSTREAM BASSDEF(BASS_StreamCreateFile)(BOOL mem, const void *file, DWORD offset, DWORD length, DWORD flags);
HSTREAM BASSDEF(BASS_StreamCreateURL)(const char *url, DWORD offset, DWORD flags, DOWNLOADPROC *proc, DWORD user);
HSTREAM BASSDEF(BASS_StreamCreateFileUser)(BOOL buffered, DWORD flags, void *proc, DWORD user);
void BASSDEF(BASS_StreamFree)(HSTREAM handle);
QWORD BASSDEF(BASS_StreamGetLength)(HSTREAM handle);
char *BASSDEF(BASS_StreamGetTags)(HSTREAM handle, DWORD tags);
BOOL BASSDEF(BASS_StreamPreBuf)(HSTREAM handle);
BOOL BASSDEF(BASS_StreamPlay)(HSTREAM handle, BOOL flush, DWORD flags);
DWORD BASSDEF(BASS_StreamGetFilePosition)(HSTREAM handle, DWORD mode);

char *BASSDEF(BASS_RecordGetDeviceDescription)(DWORD device);
BOOL BASSDEF(BASS_RecordInit)(DWORD device);
BOOL BASSDEF(BASS_RecordSetDevice)(DWORD device);
DWORD BASSDEF(BASS_RecordGetDevice)();
BOOL BASSDEF(BASS_RecordFree)();
BOOL BASSDEF(BASS_RecordGetInfo)(BASS_RECORDINFO *info);
char *BASSDEF(BASS_RecordGetInputName)(DWORD input);
BOOL BASSDEF(BASS_RecordSetInput)(DWORD input, DWORD setting);
DWORD BASSDEF(BASS_RecordGetInput)(DWORD input);
HRECORD BASSDEF(BASS_RecordStart)(DWORD freq, DWORD flags, RECORDPROC *proc, DWORD user);

float BASSDEF(BASS_ChannelBytes2Seconds)(DWORD handle, QWORD pos);
QWORD BASSDEF(BASS_ChannelSeconds2Bytes)(DWORD handle, float pos);
DWORD BASSDEF(BASS_ChannelGetDevice)(DWORD handle);
DWORD BASSDEF(BASS_ChannelIsActive)(DWORD handle);
BOOL BASSDEF(BASS_ChannelGetInfo)(DWORD handle, BASS_CHANNELINFO *info);
BOOL BASSDEF(BASS_ChannelStop)(DWORD handle);
BOOL BASSDEF(BASS_ChannelPause)(DWORD handle);
BOOL BASSDEF(BASS_ChannelResume)(DWORD handle);
BOOL BASSDEF(BASS_ChannelSetAttributes)(DWORD handle, int freq, int volume, int pan);
BOOL BASSDEF(BASS_ChannelGetAttributes)(DWORD handle, DWORD *freq, DWORD *volume, int *pan);
BOOL BASSDEF(BASS_ChannelSlideAttributes)(DWORD handle, int freq, int volume, int pan, DWORD time);
DWORD BASSDEF(BASS_ChannelIsSliding)(DWORD handle);
BOOL BASSDEF(BASS_ChannelSet3DAttributes)(DWORD handle, int mode, float min, float max, int iangle, int oangle, int outvol);
BOOL BASSDEF(BASS_ChannelGet3DAttributes)(DWORD handle, DWORD *mode, float *min, float *max, DWORD *iangle, DWORD *oangle, DWORD *outvol);
BOOL BASSDEF(BASS_ChannelSet3DPosition)(DWORD handle, const BASS_3DVECTOR *pos, const BASS_3DVECTOR *orient, const BASS_3DVECTOR *vel);
BOOL BASSDEF(BASS_ChannelGet3DPosition)(DWORD handle, BASS_3DVECTOR *pos, BASS_3DVECTOR *orient, BASS_3DVECTOR *vel);
BOOL BASSDEF(BASS_ChannelSetPosition)(DWORD handle, QWORD pos);
QWORD BASSDEF(BASS_ChannelGetPosition)(DWORD handle);
DWORD BASSDEF(BASS_ChannelGetLevel)(DWORD handle);
DWORD BASSDEF(BASS_ChannelGetData)(DWORD handle, void *buffer, DWORD length);
HSYNC BASSDEF(BASS_ChannelSetSync)(DWORD handle, DWORD type, QWORD param, SYNCPROC *proc, DWORD user);
BOOL BASSDEF(BASS_ChannelRemoveSync)(DWORD handle, HSYNC sync);
HDSP BASSDEF(BASS_ChannelSetDSP)(DWORD handle, DSPPROC *proc, DWORD user, int priority);
BOOL BASSDEF(BASS_ChannelRemoveDSP)(DWORD handle, HDSP dsp);
HFX BASSDEF(BASS_ChannelSetFX)(DWORD handle, DWORD type);
BOOL BASSDEF(BASS_ChannelRemoveFX)(DWORD handle, HFX fx);
BOOL BASSDEF(BASS_ChannelSetEAXMix)(DWORD handle, float mix);
BOOL BASSDEF(BASS_ChannelGetEAXMix)(DWORD handle, float *mix);
BOOL BASSDEF(BASS_ChannelSetLink)(DWORD handle, DWORD chan);
BOOL BASSDEF(BASS_ChannelRemoveLink)(DWORD handle, DWORD chan);

BOOL BASSDEF(BASS_FXSetParameters)(HFX handle, const void *par);
BOOL BASSDEF(BASS_FXGetParameters)(HFX handle, void *par);

#ifdef __cplusplus
}
#endif

#endif


text:
package com.linkedin.pinot.common.config;

/**
 * Interface for configuration nodes that require pre or post configuration.
 */
public interface ConfigNodeLifecycleAware {
  /**
   * Invoked before the config system injects configuration.
   */
  void preInject();

  /**
   * Invoked after the config system injects configuration.
   */
  void postInject();
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef CONTEXTSWITCH_H
#define CONTEXTSWITCH_H

#include "pandabase.h"
#include "selectThreadImpl.h"

/* This file defines the code to perform fundamental context switches
   between different threads of execution within user space code.  It
   does this by saving and restoring the register state, including
   transferring to a new stack. */

/* The code in this file is all written in C code, rather than C++, to
   reduce possible conflicts from longjmp implementations that attempt
   to be smart with respect to C++ destructors and exception
   handling. */

#ifdef THREAD_SIMPLE_IMPL

struct ThreadContext;

#ifdef __cplusplus
extern "C" {
#endif

typedef void ContextFunction(struct ThreadContext *from_context, void *);
typedef void ThreadFunction(void *);

extern const int needs_stack_prealloc;
extern const int is_os_threads;

/* Call this to fill in the appropriate values in context.  If
   needs_stack_prealloc (above) is true, the stack must already have
   been allocated; if needs_stack_prealloc is false, the stack pointer
   is not used and may be NULL.  The context will be initialized so
   that when switch_to_thread_context() is called, it will begin
   executing thread_func(data), which should not return.  This
   function will return normally. */
void init_thread_context(struct ThreadContext *context,
                         unsigned char *stack, size_t stack_size,
                         ThreadFunction *thread_func, void *data);

/* Call this to save the current thread context.  This function does
   not return until switch_to_thread_context() is called.  Instead it
   immediately calls next_context(data), which should not return. */
void save_thread_context(struct ThreadContext *context,
                         ContextFunction *next_context, void *data);

/* Call this to resume executing a previously saved context.
   from_context must be the currently-executing context, and
   to_context is the context to resume.  When called, it will return
   from save_thread_context() in the saved stack (or begin executing
   thread_func()). */
void switch_to_thread_context(struct ThreadContext *from_context,
                              struct ThreadContext *to_context);

/* Use this pair of functions to transparently allocate and destroy an
   opaque ThreadContext object of the appropriate size.  These
   functions allocate memory, and initialize the context as
   appropriate for the main thread.  See init_main_context() to finish
   the initialization for a new thread. */
struct ThreadContext *alloc_thread_context();
void free_thread_context(struct ThreadContext *context);

#ifdef __cplusplus
}
#endif

#endif  /* THREAD_SIMPLE_IMPL */

#endif  /* CONTEXTSWITCH_H */


text:
#import <Foundation/Foundation.h>

@interface CMISConstants : NSObject

// Version
extern NSString * const kCMISLibraryVersion;

// Properties
extern NSString * const kCMISPropertyObjectId;
extern NSString * const kCMISPropertyName;
extern NSString * const kCMISPropertyPath;
extern NSString * const kCMISPropertyCreatedBy;
extern NSString * const kCMISPropertyCreationDate;
extern NSString * const kCMISPropertyModifiedBy;
extern NSString * const kCMISPropertyModificationDate;
extern NSString * const kCMISPropertyContentStreamId;
extern NSString * const kCMISPropertyContentStreamFileName;
extern NSString * const kCMISPropertyContentStreamLength;
extern NSString * const kCMISPropertyContentStreamMediaType;
extern NSString * const kCMISPropertyObjectTypeId;
extern NSString * const kCMISPropertyVersionSeriesId;
extern NSString * const kCMISPropertyVersionLabel;
extern NSString * const kCMISPropertyIsLatestVersion;
extern NSString * const kCMISPropertyIsMajorVersion;
extern NSString * const kCMISPropertyIsLatestMajorVersion;
extern NSString * const kCMISPropertyChangeToken;
extern NSString * const kCMISPropertyBaseTypeId;
extern NSString * const kCMISPropertyCheckinComment;
extern NSString * const kCMISPropertySecondaryObjectTypeIds;
extern NSString * const kCMISPropertyDescription;

// Property values
extern NSString * const kCMISPropertyObjectTypeIdValueDocument;
extern NSString * const kCMISPropertyObjectTypeIdValueFolder;
extern NSString * const kCMISPropertyObjectTypeIdValueRelationship;
extern NSString * const kCMISPropertyObjectTypeIdValuePolicy;
extern NSString * const kCMISPropertyObjectTypeIdValueItem;
extern NSString * const kCMISPropertyObjectTypeIdValueSecondary;

// Session cache keys
extern NSString * const kCMISSessionKeyWorkspaces;

// Repository capability keys
extern NSString * const kCMISRepositoryCapabilityACL;
extern NSString * const kCMISRepositoryAllVersionsSearchable;
extern NSString * const kCMISRepositoryCapabilityChanges;
extern NSString * const kCMISRepositoryCapabilityContentStreamUpdatability;
extern NSString * const kCMISRepositoryCapabilityJoin;
extern NSString * const kCMISRepositoryCapabilityQuery;
extern NSString * const kCMISRepositoryCapabilityRenditions;
extern NSString * const kCMISRepositoryCapabilityPWCSearchable;
extern NSString * const kCMISRepositoryCapabilityPWCUpdatable;
extern NSString * const kCMISRepositoryCapabilityGetDescendants;
extern NSString * const kCMISRepositoryCapabilityGetFolderTree;
extern NSString * const kCMISRepositoryCapabilityOrderBy;
extern NSString * const kCMISRepositoryCapabilityMultifiling;
extern NSString * const kCMISRepositoryCapabilityUnfiling;
extern NSString * const kCMISRepositoryCapabilityVersionSpecificFiling;
extern NSString * const kCMISRepositoryCapabilityPropertyTypes;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributes;

// Repository capability new type settable attributes keys
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesId;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesLocalName;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesLocalNamespace;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesDisplayName;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesQueryName;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesDescription;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesCreateable;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesFileable;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesQueryable;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesFullTextIndexed;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesIncludedInSuperTypeQuery;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesControllablePolicy;
extern NSString * const kCMISRepositoryCapabilityNewTypeSettableAttributesControllableAcl;

// Repository capability createable property types key
extern NSString * const kCMISRepositoryCapabilityCreateablePropertyTypesCanCreate;

// URL parameters
extern NSString * const kCMISParameterChangeToken;
extern NSString * const kCMISParameterOverwriteFlag;
extern NSString * const kCMISParameterIncludeAllowableActions;
extern NSString * const kCMISParameterFilter;
extern NSString * const kCMISParameterMaxItems;
extern NSString * const kCMISParameterObjectId;
extern NSString * const kCMISParameterOrderBy;
extern NSString * const kCMISParameterIncludePathSegment;
extern NSString * const kCMISParameterIncludeRelationships;
extern NSString * const kCMISParameterIncludePolicyIds;
extern NSString * const kCMISParameterIncludeAcl;
extern NSString * const kCMISParameterRenditionFilter;
extern NSString * const kCMISParameterSkipCount;
extern NSString * const kCMISParameterStreamId;
extern NSString * const kCMISParameterAllVersions;
extern NSString * const kCMISParameterContinueOnFailure;
extern NSString * const kCMISParameterUnfileObjects;
extern NSString * const kCMISParameterVersioningState;
extern NSString * const kCMISParameterRelativePathSegment;
extern NSString * const kCMISParameterMajor;
extern NSString * const kCMISParameterCheckin;
extern NSString * const kCMISParameterCheckinComment;
extern NSString * const kCMISParameterSourceFolderId;
extern NSString * const kCMISParameterTargetFolderId;
extern NSString * const kCMISParameterReturnVersion;
extern NSString * const kCMISParameterTypeId;
extern NSString * const kCMISParameterStatement;
extern NSString * const kCMISParameterSearchAllVersions;

// Parameter Values
extern NSString * const kCMISParameterValueTrue;
extern NSString * const kCMISParameterValueFalse;
extern NSString * const kCMISParameterValueReturnValueThis;
extern NSString * const kCMISParameterValueReturnValueLatest;
extern NSString * const kCMISParameterValueReturnValueLatestMajor;

// Common Media Types
extern NSString * const kCMISMediaTypeOctetStream;

//ContentStreamAllowed enum values
extern NSString * const kCMISContentStreamAllowedValueRequired;
extern NSString * const kCMISContentStreamAllowedValueAllowed;
extern NSString * const kCMISContentStreamAllowedValueNotAllowed;

+ (NSSet *)repositoryCapabilityKeys;
+ (NSSet *)repositoryCapabilityNewTypeSettableAttributesKeys;
+ (NSSet *)repositoryCapabilityCreateablePropertyTypesKeys;

@end


text:
using Google.Api.Ads.AdManager.Lib;
using Google.Api.Ads.AdManager.v202208;

using System;

using Google.Api.Ads.AdManager.Util.v202208;

namespace Google.Api.Ads.AdManager.Examples.CSharp.v202208
{
    /// <summary>
    /// This code example updates custom field descriptions. To determine which
    /// custom fields exist, run GetAllCustomFields.cs.
    /// </summary>
    public class UpdateCustomFields : SampleBase
    {
        /// <summary>
        /// Returns a description about the code example.
        /// </summary>
        public override string Description
        {
            get
            {
                return "This code example updates custom field descriptions. To determine which " +
                    "custom fields exist, run GetAllCustomFields.cs.";
            }
        }

        /// <summary>
        /// Main method, to run this code example as a standalone application.
        /// </summary>
        public static void Main()
        {
            UpdateCustomFields codeExample = new UpdateCustomFields();
            Console.WriteLine(codeExample.Description);
            codeExample.Run(new AdManagerUser());
        }

        /// <summary>
        /// Run the code example.
        /// </summary>
        public void Run(AdManagerUser user)
        {
            using (CustomFieldService customFieldService = user.GetService<CustomFieldService>())
            {
                // Set the ID of the custom field to update.
                long customFieldId = long.Parse(_T("INSERT_CUSTOM_FIELD_ID_HERE"));

                try
                {
                    // Get the custom field.
                    StatementBuilder statementBuilder = new StatementBuilder()
                        .Where("id = :id")
                        .OrderBy("id ASC")
                        .Limit(1)
                        .AddValue("id", customFieldId);

                    CustomFieldPage page =
                        customFieldService.getCustomFieldsByStatement(
                            statementBuilder.ToStatement());
                    CustomField customField = page.results[0];

                    customField.description = (customField.description == null
                        ? ""
                        : customField.description + " Updated");

                    // Update the custom field on the server.
                    CustomField[] customFields = customFieldService.updateCustomFields(
                        new CustomField[]
                        {
                            customField
                        });

                    // Display results
                    foreach (CustomField updatedCustomField in customFields)
                    {
                        Console.WriteLine(
                            "Custom field with ID \"{0}\", name \"{1}\", and description " +
                            "\"{2}\" was updated.", updatedCustomField.id, updatedCustomField.name,
                            updatedCustomField.description);
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("Failed to update custom fields. Exception says \"{0}\"",
                        e.Message);
                }
            }
        }
    }
}


text:
import {AngleUnits} from "../enums"
import {isObject} from "./types"
import {assert} from "./assert"

const {PI, abs, sign} = Math

export function angle_norm(angle: number): number {
  if (angle == 0) {
    return 0
  }
  while (angle <= 0) {
    angle += 2*PI
  }
  while (angle > 2*PI) {
    angle -= 2*PI
  }
  return angle
}

export function angle_dist(lhs: number, rhs: number): number {
  return angle_norm(lhs-rhs)
}

export function angle_between(mid: number, lhs: number, rhs: number, anticlock: boolean = false): boolean {
  const d = angle_dist(lhs, rhs)
  if (d == 0)
    return false
  if (d == 2*PI)
    return true
  const norm_mid = angle_norm(mid)
  const cond = angle_dist(lhs, norm_mid) <= d && angle_dist(norm_mid, rhs) <= d
  return !anticlock ? cond : !cond
}

export function randomIn(min: number, max?: number): number {
  if (max == null) {
    max = min
    min = 0
  }

  return min + Math.floor(Math.random()*(max - min + 1))
}

export function atan2(start: [number, number], end: [number, number]): number {
  /*
   * Calculate the angle between a line containing start and end points (composed
   * of [x, y] arrays) and the positive x-axis.
   */
  return Math.atan2(end[1] - start[1], end[0] - start[0])
}

export function radians(degrees: number): number {
  return degrees*(PI/180)
}

export function degrees(radians: number): number {
  return radians/(PI/180)
}

export function resolve_angle(angle: number, units: AngleUnits): number {
  /** Convert CCW angle with units to CW radians (canvas). */
  return -to_radians_coeff(units)*angle
}

export function to_radians_coeff(units: AngleUnits): number {
  switch (units) {
    case "deg":  return PI/180
    case "rad":  return 1
    case "grad": return PI/200
    case "turn": return 2*PI
  }
}

export function clamp(val: number, min: number, max: number): number {
  return val < min ? min : (val > max ? max : val)
}

export function log(x: number, base: number = Math.E): number {
  return Math.log(x)/Math.log(base)
}

export function gcd(a: number, b: number): number {
  a = Math.abs(a)
  b = Math.abs(b)

  while (b != 0) {
    [a, b] = [b, a % b]
  }

  return a
}

export function lcm(a: number, ...rest: number[]): number {
  for (const b of rest) {
    a = Math.floor((a*b) / gcd(a, b))
  }

  return a
}

export const float = Symbol("float")

export interface Floating {
  [float](): number
}

export function is_Floating<T>(obj: T): obj is T & Floating {
  return isObject(obj) && float in obj
}

export class Fraction implements Floating {
  readonly numer: number
  readonly denom: number

  constructor(numer: number, denom: number) {
    assert(denom != 0, "Zero divisor")
    const div = gcd(numer, denom)
    const sgn = sign(numer)*sign(denom)
    this.numer = sgn*abs(numer)/div
    this.denom = abs(denom)/div
  }

  [float](): number {
    return this.numer/this.denom
  }

  toString(): string {
    return `${this.numer}/${this.denom}`
  }
}

export const float32_epsilon = 1.1920928955078125e-7  // IEEE-754

export function factorial(x: number): number {
  let y = 1
  for (let i = 2; i <= x; i++) {
    y *= i
  }
  return y
}

type Poly = number[]

export function hermite(n: number): Poly {
  const poly = new Array(n + 1)
  poly.fill(0)
  const fn = factorial(n)
  for (let k = 0; k <= Math.floor(n/2); k++) {
    const c = (-1)**k*fn / (factorial(k)*factorial(n - 2*k)) * 2**(n - 2*k)
    poly[2*k] = c
  }
  return poly
}

export function eval_poly(poly: Poly, x: number): number {
  const n = poly.length - 1
  let y = 0
  let x_n = 1
  for (let i = n; i >= 0; i--) {
    y += x_n*poly[i]
    x_n *= x
  }
  return y
}


text:
class GroupByQuantity < ActiveRecord::Migration
  def up
  	carts = Cart.all
  	carts.each do |c|
  		sums = c.cart_items.group(:product_id).sum(:quantity)
  		sums.each do |product_id, quantity|
  			if quantity > 1
  				c.cart_items.where(product_id: product_id).delete_all

  				c.cart_items.create(product_id: product_id, quantity: quantity)
  			end
  		end
  	end
  end
end


text:
package com.be.android.library.worker.handlers;

import android.annotation.TargetApi;
import android.os.Build;

import com.be.android.library.worker.base.JobEvent;
import com.be.android.library.worker.interfaces.JobEventListener;

import java.util.Iterator;
import java.util.LinkedList;

/**
 * Job event listener used to retain job events for short period of time
 */
public abstract class CachedJobEventListener implements JobEventListener {

    private static final int MAX_SIZE_THRESHOLD = 10;

    private final LinkedList<JobEvent> mLastJobEvents;

    public CachedJobEventListener() {
        mLastJobEvents = new LinkedList<JobEvent>();
    }

    @Override
    public final void onJobEvent(JobEvent event) {
        if (mLastJobEvents.size() >= MAX_SIZE_THRESHOLD) {
            mLastJobEvents.removeFirst();
        }

        if (!onJobEventImpl(event)) {
            mLastJobEvents.addLast(event);
        }
    }

    public JobEvent getLastJobEvent(int jobId) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
            return getLastJobEventApi9(jobId);
        }

        // API 8
        final int sz = mLastJobEvents.size();
        for (int i = sz - 1; i >= 0; i--) {
            JobEvent event = mLastJobEvents.get(i);

            if (event.getJobId() == jobId) {
                return event;
            }
        }

        return null;
    }

    @TargetApi(Build.VERSION_CODES.GINGERBREAD)
    private JobEvent getLastJobEventApi9(int jobId) {
        final Iterator<JobEvent> iter = mLastJobEvents.descendingIterator();

        while (iter.hasNext()) {
            JobEvent event = iter.next();
            if (event.getJobId() == jobId) {
                return event;
            }
        }

        return null;
    }

    /**
     * Remove all events from cache
     */
    public void clearCachedEvents() {
        mLastJobEvents.clear();
    }

    /**
     * Remove event from cache
     *
     * @param event event to remove
     */
    public void consumeEvent(JobEvent event) {
        mLastJobEvents.remove(event);
    }

    /**
     * Implementation of handler
     *
     * @param event event to remove
     * @return true if the event should be removed from cache
     */
    public abstract boolean onJobEventImpl(JobEvent event);
}


text:
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="20dp"
    android:height="20dp"
    android:viewportWidth="20"
    android:viewportHeight="20"
    android:tint="?attr/colorControlNormal">
  <path
      android:fillColor="@android:color/white"
      android:pathData="M2.708,17.583 L17.292,3V17.583ZM10.208,16.5H16.208V5.625L10.208,11.625Z"/>
</vector>


text:
/*
 * Resource allocation maps.
 *
 * Associated routines manage sub-allocation of an address space using
 * an array of segment descriptors.  The first element of this array
 * is a map structure, describing the arrays extent and the name
 * of the controlled object.  Each additional structure represents
 * a free segment of the address space.
 *
 * A call to rminit initializes a resource map and may also be used
 * to free some address space for the map.  Subsequent calls to rmalloc
 * and rmfree allocate and free space in the resource map.  If the resource
 * map becomes too fragmented to be described in the available space,
 * then some of the resource is discarded.  This may lead to critical
 * shortages, but is better than not checking (as the previous versions
 * of these routines did) or giving up and calling panic().  The routines
 * could use linked lists and call a memory allocator when they run
 * out of space, but that would not solve the out of space problem when
 * called at interrupt time.
 *
 * N.B.: The address 0 in the resource address space is not available
 * as it is used internally by the resource map routines.
 */
struct map {
	struct	mapent *m_limit;	/* address of last slot in map */
	char	*m_name;		/* name of resource, for messages */
};

struct mapent {
	long	m_size;			/* size of this segment of the map */
	long	m_addr;			/* start of segment */
};

#ifdef KERNEL
#define	ARGMAPSIZE	16
struct	map *kmemmap, *mbmap, *swapmap;
int	nswapmap;

long	rmalloc __P((struct map *, long));
void	rmfree __P((struct map *, long, long));
void	rminit __P((struct map *, long, long, char *, int));
#endif


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using Microsoft.Protocols.TestTools;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Microsoft.Protocols.TestTools.Test.Utilities;

namespace Microsoft.Protocols.TestTools.Test.TestAdapter
{
    /// <summary>
    /// Interface definition of a powershell adapter
    /// </summary>
    public interface IPowershellAdapter : IAdapter
    {
        [MethodHelp("Powershell script will throw an exception.")]
        void ThrowException(string exceptionMessage);

        [MethodHelp("Powershell script will return an integer.")]
        int ReturnInt(int number);

        [MethodHelp("Powershell script will return a string.")]
        string ReturnString(string str);

        [MethodHelp("Powershell script will return a boolean.")]
        bool ReturnBool(bool value);

        [MethodHelp("The relevant Powershell script does not exist")]
        void ScriptNotExisted();
    }

    /// <summary>
    /// Test cases to test PTF adapter: Powershell adapter
    /// </summary>
    [TestClass]
    public class TestPowershellAdapter : TestClassBase
    {
        IPowershellAdapter powershellAdapter;

        [ClassInitialize]
        public static void ClassInitialize(TestContext testContext)
        {
            TestClassBase.Initialize(testContext, "TestAdapter");
        }

        [ClassCleanup]
        public static void ClassCleanup()
        {
            TestClassBase.Cleanup();
        }

        protected override void TestInitialize()
        {
            powershellAdapter = BaseTestSite.GetAdapter<IPowershellAdapter>();
        }

        protected override void TestCleanup()
        {
            powershellAdapter.Reset();
        }

        #region Test cases
        [TestMethod]
        [TestCategory("TestAdapter")]
        [PTFExpectedException(typeof(InvalidOperationException))]
        public void PowershellAdapterThrowException()
        {
            powershellAdapter.ThrowException("exception");
        }

        [TestMethod]
        [TestCategory("TestAdapter")]
        public void PowershellAdapterReturnInt()
        {
            BaseTestSite.Assert.AreEqual(
                0,
                powershellAdapter.ReturnInt(0),
                "Powershell adapter should return 0");
        }

        [TestMethod]
        [TestCategory("TestAdapter")]
        public void PowershellAdpaterReturnString()
        {
            BaseTestSite.Assert.AreEqual(
                "PTF",
                powershellAdapter.ReturnString("PTF"),
                "Powershell adapter should return PTF");
        }

        [TestMethod]
        [TestCategory("TestAdapter")]
        public void PowershellAdapterReturnBool()
        {
            BaseTestSite.Assert.IsTrue(
                powershellAdapter.ReturnBool(true),
                "Powershell adapter should return true");
        }

        [TestMethod]
        [TestCategory("TestAdapter")]
        [PTFExpectedException(typeof(AssertInconclusiveException), "Assume.Fail failed. PowerShell script file (ScriptNotExisted.ps1) can not be found.")]
        public void PowershellAdapterScriptNotExisted()
        {
            powershellAdapter.ScriptNotExisted();
        }
        #endregion
    }
}


text:
require 'spec_helper'

RSpec.describe Gitlab::Ci::Pipeline::Expression::Lexeme::NotEquals do
  let(:left) { double('left') }
  let(:right) { double('right') }

  describe '.build' do
    context 'with non-evaluable operands' do
      it 'creates a new instance of the token' do
        expect { described_class.build('!=', left, right) }
          .to raise_error Gitlab::Ci::Pipeline::Expression::Lexeme::Operator::OperatorError
      end
    end

    context 'with evaluable operands' do
      it 'creates a new instance of the token' do
        allow(left).to receive(:evaluate).and_return('my-string')
        allow(right).to receive(:evaluate).and_return('my-string')

        expect(described_class.build('!=', left, right))
          .to be_a(described_class)
      end
    end
  end

  describe '.type' do
    it 'is an operator' do
      expect(described_class.type).to eq :logical_operator
    end
  end

  describe '.precedence' do
    it 'has a precedence' do
      expect(described_class.precedence).to be_an Integer
    end
  end

  describe '#evaluate' do
    let(:operator) { described_class.new(left, right) }

    subject { operator.evaluate }

    before do
      allow(left).to receive(:evaluate).and_return(left_value)
      allow(right).to receive(:evaluate).and_return(right_value)
    end

    context 'when left and right are equal' do
      using RSpec::Parameterized::TableSyntax

      where(:left_value, :right_value) do
        'string' | 'string'
        1        | 1
        ''       | ''
        nil      | nil
      end

      with_them do
        it { is_expected.to eq(false) }
      end
    end

    context 'when left and right are not equal' do
      where(:left_value, :right_value) do
        ['one string', 'two string', 1, 2, '', nil, false, true].permutation(2).to_a
      end

      with_them do
        it { is_expected.to eq(true) }
      end
    end
  end
end


text:
// *************************************************************************************
// SCICHART® Copyright SciChart Ltd. 2011-2018. All rights reserved.
//
// Web: http://www.scichart.com
//   Support: support@scichart.com
//   Sales:   sales@scichart.com
//
// CustomAnnotationCreationModifier.cs is part of SCICHART®, High Performance Scientific Charts
// For full terms and conditions of the license, see http://www.scichart.com/scichart-eula/
//
// This source code is protected by international copyright law. Unauthorized
// reproduction, reverse-engineering, or distribution of all or any portion of
// this source code is strictly prohibited.
//
// This source code contains confidential and proprietary trade secrets of
// SciChart Ltd., and should at no time be copied, transferred, sold,
// distributed or made available without express written permission.
// *************************************************************************************
using System;
using System.Linq;
using System.Windows;
using System.Windows.Input;
using SciChart.Charting.ChartModifiers;
using SciChart.Charting.Common.Helpers;
using SciChart.Charting.Visuals.Annotations;

namespace SciChart.Examples.ExternalDependencies.Controls.SciChartInteractionToolbar.CustomModifiers
{
    public class CustomAnnotationCreationModifier : AnnotationCreationModifier
    {
        public ICommand AddAnnotation
        {
            get
            {
                return new ActionCommand(() =>
                {
                    IsEnabled = true;
                    if (AnnotationType == null)
                    {
                        AnnotationType = typeof(LineAnnotation);
                    }

                    var resourceAnnotatinStyles = new ResourceDictionary();
                    resourceAnnotatinStyles.Source =
                        new Uri(
                            "/SciChart.Examples.ExternalDependencies;component/Resources/Styles/AnnotationStylesResourceDictionary.xaml",
                            UriKind.RelativeOrAbsolute);

                    var resourceName = string.Format("{0}Style", AnnotationType.Name);
                    var annotationStyle = (Style)resourceAnnotatinStyles[resourceName];

                    if (annotationStyle != null)
                        AnnotationStyle = annotationStyle;
                });
            }
        }

        public ICommand DeleteAnnotation
        {
            get
            {
                return new ActionCommand(() =>
                {
                    if (ParentSurface != null)
                    {
                        var selectedAnnotations =
                            ParentSurface.Annotations.Where(annotation => annotation.IsSelected).ToList();
                        foreach (var selectedAnnotation in selectedAnnotations)
                        {
                            ParentSurface.Annotations.Remove(selectedAnnotation);
                        }
                    }
                });
            }
        }
    }
}


text:
Here you will find the entire site which we built in the article in Linux Voice, Issue 29. The site is live at http://amitsaha.github.io/linux_voice_4. Below, I list some resources where you can learn more about Hugo:

# Hugo concepts

- [Archetypes](https://gohugo.io/content/archetypes/)
- [Sections](https://gohugo.io/content/sections/)
- [Configuration](https://gohugo.io/overview/configuration/)
- [Shortcodes](https://gohugo.io/extras/shortcodes/)
- [Syntax Highlighting](https://gohugo.io/extras/highlighting)
- [Templates](https://gohugo.io/templates/homepage/)
- [hyde-x theme](https://github.com/zyro/hyde-x)
- [Data files](https://gohugo.io/extras/datafiles#the-datafolder)

# Others

- [GitHub pages](https://pages.github.com/)
- [Hugo showcase](https://gohugo.io/showcase)
- [Static sites with docker](http://ilkka.io/blog/static-siteswith-docker)
- [Automated site deployments](https://gohugo.io/tutorials/automated-deployments)
- [Hugo tools](https://gohugo.io/tools)


text:
> reads and writes tcp or udp data

- listen on a specified port

`nc  -l {{port}}`

- connect to a certain port (you can then write to this port)

`nc {{ip_address}} {{port}}`

- set a timeout

`nc -w {{timeout_in_seconds}} {{ipaddress}} {{port}}`

- serve a file

`cat somefile.txt | nc -l {{port}}`

- receive a file

`nc {{ip_address}} {{port}} > somefile.txt`


text:
namespace Vurdalakov.UsbDevicesDotNet
{
    using System;

    public class UsbDeviceInterface
    {
        public String InterfaceId { get; internal set; }

        internal UsbDeviceInterface(String interfaceId)
        {
            this.InterfaceId = interfaceId;
        }
    }
}


text:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>log1p</title>
<link rel="stylesheet" href="../../math.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Math Toolkit 3.1.0">
<link rel="up" href="../powers.html" title="Basic Functions">
<link rel="prev" href="cos_pi.html" title="cos_pi">
<link rel="next" href="expm1.html" title="expm1">

Home
Libraries
People
FAQ
More

log1p

#include <boost/math/special_functions/log1p.hpp>

namespace boost{ namespace math{

template <class T>
calculated-result-type log1p(T x);

template <class T, class Policy>
calculated-result-type log1p(T x, const Policy&);

}} // namespaces

        Returns the natural logarithm of x+1.

        The return type of this function is computed using the result
        type calculation rules: the return is double
        when x is an integer type and T otherwise.

        The final Policy argument is optional and can
        be used to control the behaviour of the function: how it handles errors,
        what level of precision to use etc. Refer to the policy
        documentation for more details.

        There are many situations where it is desirable to compute log(x+1).
        However, for small x then x+1 suffers
        from catastrophic cancellation errors so that x+1 == 1
        and log(x+1) == 0, when in fact for very small x, the
        best approximation to log(x+1) would be x.
        log1p calculates the best
        approximation to log(1+x) using a Taylor series expansion for accuracy
        (less than 2ɛ). Alternatively note that there are faster methods available,
        for example using the equivalence:

          log(1+x) == (log(1+x) * x) / ((1+x) - 1)

        However, experience has shown that these methods tend to fail quite spectacularly
        once the compiler's optimizations are turned on, consequently they are used
        only when known not to break with a particular compiler. In contrast, the
        series expansion method seems to be reasonably immune to optimizer-induced
        errors.

        Finally when macro BOOST_HAS_LOG1P is defined then the float/double/long double
        specializations of this template simply forward to the platform's native
        (POSIX) implementation of this function.

        The following graph illustrates the behaviour of log1p:

        Accuracy

        For built in floating point types log1p
        should have approximately 1 machine
        epsilon accuracy.

Table 8.81. Error rates for log1p

<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>

                  GNU C++ version 7.1.0
 linux
 long double

                  GNU C++ version 7.1.0
 linux
 double

                  Sun compiler version 0x5150
 Sun Solaris
 long double

                  Microsoft Visual C++ version 14.1
 Win32
 double

                  Random test data

                  Max = 0.818ε (Mean = 0.227ε)

                  (<cmath>: Max = 0.818ε (Mean = 0.227ε))

                  (<math.h>: Max = 0.818ε (Mean = 0.227ε))

                  Max = 0.846ε (Mean = 0.153ε)

                  (Rmath 3.2.3: Max = 0.846ε (Mean = 0.153ε))

                  Max = 2.3ε (Mean = 0.66ε)

                  (<math.h>: Max = 0.818ε (Mean = 0.249ε))

                  Max = 0.509ε (Mean = 0.057ε)

                  (<math.h>: Max = 0.509ε (Mean = 0.057ε))

        Testing

        A mixture of spot test sanity checks, and random high precision test values
        calculated using NTL::RR at 1000-bit precision.

Copyright © 2006-2021 Nikhar Agrawal, Anton Bikineev, Matthew Borland,
      Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert Holin, Bruno
      Lalande, John Maddock, Evan Miller, Jeremy Murphy, Matthew Pulver, Johan Råde,
      Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg, Daryle
      Walker and Xiaogang Zhang

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <title>espree: Benchmarks</title>
  <meta name="viewport" content="width=device-width" />
  <link rel="stylesheet" href="../assets/style.css">
  <link rel="stylesheet" href="../assets/foundation/foundation.min.css">
</style>

espree

              Demo

Static Analysis

Online Parsing

Syntax Validator

Operator Precedence

Regex Collector

Dynamic Tracing

Function Instrumentation

Code Transformation

Source Rewrite

Minifiy & Obfuscate

Editing Tools

Identifier Highlight

Rename Refactoring

Autocomplete

              Project

Git Repository

Continuous Integration

Mailing List

Issue Tracker

QA

Unit Tests

Benchmarks Suite

Compatibility Tests

Speed Comparison

Module Loading

Coverage Analysis

Documentation

Benchmarks show the true speed

<input id="runquick" class="medium radius button secondary" type="submit" value="Run quick benchmarks" disabled/>
<input id="runfull" class="medium radius button" type="submit" value="Run full benchmarks" disabled/>

Please wait...

Note: On a modern machine and up-to-date web browsers,
the full benchmarks suite takes ~1 minute.
For the quick benchmarks, the running time is only ~15 seconds.

Version being tested: .

Time measurement is carried out using Benchmark.js.

espree is created and mantained by Ariya Hidayat.

@espree

GitHub


text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="SampleJob6.cs" company="Nima Shahri">
// Copyright (c) Nima Shahri. All rights reserved.
// </copyright>
// <summary>
//   Defines the SampleJob6 type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace AtomicClock.WinService.Jobs
{
    using System;

    /// <summary>
    /// The sample job 6.
    /// </summary>
    public class SampleJob6
    {
        /// <summary>
        /// The do job.
        /// </summary>
        /// <param name="data">
        /// The data.
        /// </param>
        public static void DoJob(dynamic data)
        {
            Console.WriteLine("Started: {0} - {1}", data, DateTime.Now);
            Console.WriteLine("Done:    {0} - {1}", data, DateTime.Now);
            throw new NotImplementedException("Exception in job");
        }
    }
}


text:
define(['jquery', 'app/controller/editor'], function($) {
    "use strict";

    var container = $('#find-container');
    var findButton = $('#find-button', container);
    var closeButton = $('#close-find', container);
    var findInput = $('#find-input', container);
    var findForm = $('#find-form', container);

    function show(editor) {
        container.show();
        findInput.select();
    }

    function close() {
        container.hide();
    }

    function keydown(event) {
        var ESC = 27;

        if (event.which == ESC) {
            close();
        }
    }

    function find() {
        var editor = require('app/controller/editor').instance.editor;
        editor.find(findInput.val());
    }

    function submit(e) {
        find();
        e.preventDefault();
    }

    // Bind listeners
    $(function() {
        closeButton.click(close);
        findButton.click(find);
        findInput.keydown(keydown);
        findForm.submit(submit);
    });

    return Object.freeze({
        show: show
    });
});


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/css/style.css">

<meta property="fb:pages" content="267523766781017" />
<title>How American Rapper Dave East Embraced Islam</title>
<link rel="canonical" href="https://www.allamericanmuslim.com/rapper-dave-east/">
<meta property="og:locale" content="en-us">
<meta property="og:title" content="How American Rapper Dave East Embraced Islam">
<meta property="og:site_name" content="All American Muslim">
<meta property="og:description" content="Islam really brought a discipline to my life that I didn't really have before">
<meta property="og:url" content="https://www.allamericanmuslim.com/rapper-dave-east/">

    <meta property="og:image" content="https://3.bp.blogspot.com/-1sfXVwlBXPs/WQEqEfJ3J1I/AAAAAAAAChg/WiJMC-ZWtecd-47VD4183yfinIMqHqvUwCLcB/s1600/dave-east.jpg">

<meta property="og:type" content="article">

<meta property="fb:app_id" content="347123062352978">
<meta http-equiv="cleartype" content="on">
<meta name="description" content="Islam really brought a discipline to my life that I didn't really have before">

All American Muslim

Home

DMCA

How American Rapper Dave East Embraced Islam

   Share on Facebook

Rap star Dave East from Harlem New York converted from Christianity to Islam after a sinful life that brought him to prison. It’s there in prison that he was exposed to Islam by a Muslim who shared his cell.

In an interview with XXLMag, he said “I was incarcerated for a little while in Baltimore, and my celly was Muslim. I was watching him pray every day, and his outlook on getting out of that situation was a lot more positive than the other dudes that were Muslim in the jail.”

Impressed by the mindset and attitude of his cellmate, he started learning about Islam. It didn’t take him long before taking the shahada and become Muslim.

"Islam really brought a discipline to my life that I didn't really have before. My old mindset was if they ain't helping me, I ain't helping them, but you can't live life that way. It's about what you can do, not how people are with you."

About the wave of Islamophobia throughout the US and the world he said “Islam has a negative outlook on it around the world based on what the media tries to show. They are not showing the peace. Deep down in my heart and what I’ve seen and what I’ve been around, there is nothing better than Islam.”

Source: XXL Magazine

   Share on Facebook


text:
Json-RPC API
============

User and application API
------------------------

There are two types of API access:

### Application API

- Access to the API with the user "jsonrpc" and the token available on the settings page
- Access to all procedures
- No permission checked
- There is no user session on the server
- No access to procedures that starts with "My..." (example: "getMe" or "getMyProjects")
- Example of possible clients: tools to migrate/import data, create tasks from another system, etc...

### User API

- Access to the API with the user credentials (username and password)
- You can also generate a personal access token instead of your password
- Application role and project permissions are checked for each procedure
- A user session is created on the server
- Example of possible clients: native mobile/desktop application, command line utility, etc...

Security
--------

- Always use HTTPS with a valid certificate (avoid clear text communication)
- If you make a mobile application, it's your responsability to store securely the user credentials on the device
- After 3 authentication failure on the user api, the end-user have to unlock his account by using the login form
- Two factor authentication is not yet available through the API

Protocol
--------

Kanboard use the protocol Json-RPC to interact with external programs.

JSON-RPC is a remote procedure call protocol encoded in JSON.
Almost the same thing as XML-RPC but with the JSON format.

We use the [version 2 of the protocol](http://www.jsonrpc.org/specification).
You must call the API with a `POST` HTTP request.

Kanboard support batch requests, so you can make multiple API calls in a single HTTP request. It's particularly useful for mobile clients with higher network latency.

Usage
-----

- [Authentication](api-authentication.markdown)
- [Examples](api-examples.markdown)
- [Application](api-application-procedures.markdown)
- [Projects](api-project-procedures.markdown)
- [Project Permissions](api-project-permission-procedures.markdown)
- [Boards](api-board-procedures.markdown)
- [Columns](api-column-procedures.markdown)
- [Swimlanes](api-swimlane-procedures.markdown)
- [Categories](api-category-procedures.markdown)
- [Automatic Actions](api-action-procedures.markdown)
- [Tasks](api-task-procedures.markdown)
- [Subtasks](api-subtask-procedures.markdown)
- [Subtask Time Tracking](api-subtask-time-tracking-procedures.markdown)
- [Task Files](api-task-file-procedures.markdown)
- [Project Files](api-project-file-procedures.markdown)
- [Links](api-link-procedures.markdown)
- [Internal Task Links](api-internal-task-link-procedures.markdown)
- [External Task Links](api-external-task-link-procedures.markdown)
- [Comments](api-comment-procedures.markdown)
- [Users](api-user-procedures.markdown)
- [Groups](api-group-procedures.markdown)
- [Group Members](api-group-member-procedures.markdown)
- [Me](api-me-procedures.markdown)


text:
<?xml version="1.0" encoding="utf-8"?>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/button"
    android:layout_width="match_parent"
    android:layout_height="48dp"
    android:layout_marginLeft="12dp"
    android:layout_marginRight="12dp"
    android:layout_marginTop="4dp"
    android:layout_marginBottom="4dp"
    android:focusable="true"
    android:foreground="?attr/selectableItemBackground"
    android:orientation="horizontal"
    android:background="?attr/detailContentBackground"
    app:cardBackgroundColor="?attr/detailContentBackground">

    <ImageView
        android:id="@+id/image"
        android:layout_width="90dp"
        android:layout_height="match_parent"
        android:alpha="1"
        android:scaleType="centerCrop" />

    <TextView
        android:id="@+id/tv2"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:ellipsize="none"
        android:padding="12dp"
        android:fadingEdgeLength="30dp"
        android:requiresFadingEdge="horizontal"
        android:shadowColor="@android:color/black"
        android:singleLine="true"
        android:alpha="0.3"
        android:textColor="?attr/textColorTitle2" />

    <TextView
        android:id="@+id/tv"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_vertical"
        android:layout_marginLeft="90dp"
        android:ellipsize="none"
        android:padding="12dp"
        android:fadingEdgeLength="30dp"
        android:requiresFadingEdge="horizontal"
        android:shadowColor="@android:color/black"
        android:singleLine="true"
        android:textColor="?attr/textColorTitle2" />

    <com.sqrtf.common.view.ProgressCoverView
        android:id="@+id/progress"
        android:layout_width="match_parent"
        android:layout_height="3dp"
        android:layout_gravity="bottom"
        app:color="#a0d43b3e" />

</FrameLayout>


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="We are committed to building the next generation of VR & AR content creators!">
    <meta name="author" content="ARVR Academy">

    <title>ARVR Academy</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/agency.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Oxygen:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                ARVR Academy

                        Our Mission

                        FAQ

                        Classes

                        About

                        Get Involved

Get Involved

                        As a non-profit organization, there are many ways you can help us with our mission, including, but not limited to:

Start a class  series in your country/city. Ideally, we need two people to run a new location
                                - at least one of whom has some Unity or VR experience. If you're interested, please  e-mail us                                 and we will help get you up and running.

                                Volunteer with us!  You can volunteer your time to help in other ways. We run a lot
                                of events and do a lot of community outreach, and are always in need of people who are enthusiastic
                                and hardworking. As a bonus, you get priority access to events and an amazing network of
                                people who will support you in your career.

                                 Give.  The more money we have, the bigger our impact. Cash donations are great, but
                                we are also interested in donations of things like Unity-ready Laptops (we loan these out
                                to students who don't have access to a laptop for classes), HMDs of all kinds - we're building
                                a library of headsets for loan to students and other local developers, or locations, food
                                or drink donations for events. We are also interested in conference ticket sponsorships,
                                or scholarships for low-income students. The lower we can make the cost of our classes, the
                                better.

 We need visibility to increase our impact on the industry. Reach to us if you have
                        an event that has no diverse speakers, if you want to get involved, or if you are interested in attending
                        our events!

                    Copyright © ARVR Academy

Privacy Policy

 Code of Conduct


text:
var _markerNameSuffix = "A";

/**
 * Main view of the application.
 */
window.BodyView = Backbone.View.extend({
    el: $('body'),

    events: {
        "click": "onBodyClick"
    },

    /**
     * Constructor of the BodyView class. Initializes all visible elements of the page.
     */
    initialize: function () {
        var that = this;
        this.topbar = new TopbarView().render();
        this.main = new MainView().render();
    },

    /**
     * Hide the dropdown menu if anything other than the menu is clicked.
     */
    onBodyClick: function () {
        this.topbar.hideDropdown();
    }
});

/**
 * Displays the sidebar, map and dataview.
 */
window.MainView = Backbone.View.extend({

    id: 'main',
    attributes: {
        role: 'main'
    },

    /**
     * Initialize and render the contained views.
     *
     * @return The instance of the class
     */
    render: function () {
        $('#container').append(this.el);

        this.sidebar = new SidebarView().render();
        this.algview = new AlgView().render();
        this.map = new MapView({
            sidebar: this.sidebar
        }).render();
        this.data = new DataView().render();

        return this;
    }
});

/**
 * Display a message to the user in a modal dialog.
 */
window.MessageView = Backbone.View.extend({

    id: 'message',
    className: 'modal',

    events: {
        "hidden": "remove",
        "click .modal-footer a.cancel" : "remove"
    },

    /**
     * Constructor of the MessageView class. Initializes the contents of the dialog.
     *
     * @params args.title The displayed title of the dialog
     * @param args.message The displayed message of the dialog
     */
    initialize: function (args) {
        args = args || {};
        this.title = args.title || "";
        this.message = args.message || "";
    },

    /**
     * Render the dialog from the template.
     *
     * @return The instance of the class
     */
    render: function () {
        this.$el.html(templates.messageView({title: this.title, message: this.message}));

        this.$el.modal({
            show: true,
            backdrop: 'static',
            keyboard: false
        });
        return this;
    },

    /**
     * Hide the dialog and remove the element.
     */
    remove: function () {
        this.$el.modal('hide');

        this.$el.remove();
    }
});

/**
 * Display a loading indicator and corresponding message in a modal dialog.
 */
window.LoadingView = Backbone.View.extend({

    id: 'loading',
    className: 'modal',

    events: {
        "click #loading.modal .modal-header .close": "close"
    },

    /**
     * Constructor of the LoadingView class. Initializes the contents of the dialog.
     *
     * @param message The displayed message of the dialog
     */
    initialize: function (message) {
        this.message = message;
    },

    /**
     * Render the dialog from the template.
     *
     * @return The instance of the class
     */
    render: function () {
        this.$el.html(templates.loadingView({message: this.message}));

        this.$el.modal({
            show: true,
            backdrop: 'static',
            keyboard: false
        });
        return this;
    },

    /**
     * Hide the dialog and remove the element.
     */
    remove: function () {
        this.$el.modal('hide');
        this.$el.remove();
    },

    /**
     * Hide the dialog manually and kill ajax request.
     */
    close: function (){
        window.api.abort();
        this.remove();
    }
});


text:
package com.qx.inf.shiro.utils;

import java.io.IOException;
import java.text.SimpleDateFormat;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;

/**
 * @author 刘飞 E-mail:liufei_it@126.com
 *
 * @version 1.0.0
 * @since 2015年8月25日 下午4:47:57
 */
public final class SerializeUtils {

    private static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
    private static final ObjectMapper objectMapper = new ObjectMapper();

    static {
        objectMapper.disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
        objectMapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
        objectMapper.setDateFormat(new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS));
    }

    public static String serialize(Object obj) {
        try {
            return objectMapper.writeValueAsString(obj);
        } catch (JsonProcessingException e) {
            throw new IllegalStateException("Failed to convert object to json", e);
        }
    }

    public static <T> T deserialize(String json, Class<T> targetType) {
        try {
            return objectMapper.readValue(json, targetType);
        } catch (IOException e) {
            throw new IllegalStateException("Failed to convert json to object", e);
        }
    }

    public static <T> T deserialize(String json, JavaType targetType) {
        try {
            return objectMapper.readValue(json, targetType);
        } catch (IOException e) {
            throw new IllegalStateException("Failed to convert json to object", e);
        }
    }

    @SuppressWarnings("deprecation")
    public static JavaType getType(Class<?> parametrized, Class<?>... parameterClasses) {
        return objectMapper.getTypeFactory().constructParametricType(parametrized, parameterClasses);
    }
}


text:
namespace views {
class StyledLabel;
class View;
}  // namespace views

enum class SharingDialogType;

class SharingDialogView : public SharingDialog,
                          public LocationBarBubbleDelegateView {
 public:
  // Bubble will be anchored to |anchor_view|.
  SharingDialogView(views::View* anchor_view,
                    content::WebContents* web_contents,
                    SharingDialogData data);

  SharingDialogView(const SharingDialogView&) = delete;
  SharingDialogView& operator=(const SharingDialogView&) = delete;

  ~SharingDialogView() override;

  // SharingDialog:
  void Hide() override;

  // LocationBarBubbleDelegateView:
  bool ShouldShowCloseButton() const override;
  std::u16string GetWindowTitle() const override;
  void WindowClosing() override;
  void WebContentsDestroyed() override;
  void AddedToWidget() override;

  static views::BubbleDialogDelegateView* GetAsBubble(SharingDialog* dialog);
  static views::BubbleDialogDelegateView* GetAsBubbleForClickToCall(
      SharingDialog* dialog);

  SharingDialogType GetDialogType() const;

  const View* button_list_for_testing() const { return button_list_; }

 private:
  friend class SharingDialogViewTest;

  // LocationBarBubbleDelegateView:
  void Init() override;

  // Populates the dialog view containing valid devices and apps.
  void InitListView();
  // Populates the dialog view containing error help text.
  void InitErrorView();

  std::unique_ptr<views::StyledLabel> CreateHelpText();

  void DeviceButtonPressed(size_t index);
  void AppButtonPressed(size_t index);

  SharingDialogData data_;

  // References to device and app buttons views.
  raw_ptr<View> button_list_ = nullptr;
};

#endif  // CHROME_BROWSER_UI_VIEWS_SHARING_SHARING_DIALOG_VIEW_H_


text:
classdef Mutex < handle

% Copyright (C) 2014, Georgia Tech Research Corporation
% see the LICENSE file included with this software

    properties (Access = private)
        handle
    end

    methods

        function obj = Mutex()
            obj.handle = figure('Visible', 'off', 'UserData', []);
        end

        function acquire(obj, owner)
            if (get(obj.handle, 'UserData') == owner)
                fprintf('You have already acquired this mutex.\n');
            else
                waitfor(obj.handle, 'UserData', []);
                set(obj.handle, 'UserData', owner);
            end
        end

        function release(obj, owner)
            if (get(obj.handle, 'UserData') == owner)
                set(obj.handle, 'UserData', []);
            else
                fprintf('You do not own this mutex, so you cannot release it.\n');
            end
        end
    end

end