text:
* [ReadStream](../classes/_fs_extra_.readstream.md)
* [WriteStream](../classes/_fs_extra_.writestream.md)

### Interfaces
* [FSWatcher](../interfaces/_fs_extra_.fswatcher.md)
* [OpenOptions](../interfaces/_fs_extra_.openoptions.md)
* [ReadStreamOptions](../interfaces/_fs_extra_.readstreamoptions.md)
* [Stats](../interfaces/_fs_extra_.stats.md)
* [WriteStreamOptions](../interfaces/_fs_extra_.writestreamoptions.md)

### Functions
* [appendFile](_fs_extra_.md#appendfile)
* [appendFileSync](_fs_extra_.md#appendfilesync)
* [chmod](_fs_extra_.md#chmod)
* [chmodSync](_fs_extra_.md#chmodsync)
* [chown](_fs_extra_.md#chown)
* [chownSync](_fs_extra_.md#chownsync)
* [close](_fs_extra_.md#close)
* [closeSync](_fs_extra_.md#closesync)
* [copy](_fs_extra_.md#copy)
* [copySync](_fs_extra_.md#copysync)
* [createFile](_fs_extra_.md#createfile)
* [createFileSync](_fs_extra_.md#createfilesync)
* [createReadStream](_fs_extra_.md#createreadstream)
* [createWriteStream](_fs_extra_.md#createwritestream)
* [ensureDir](_fs_extra_.md#ensuredir)
* [exists](_fs_extra_.md#exists)
* [existsSync](_fs_extra_.md#existssync)
* [fchmod](_fs_extra_.md#fchmod)
* [fchmodSync](_fs_extra_.md#fchmodsync)
* [fchown](_fs_extra_.md#fchown)
* [fchownSync](_fs_extra_.md#fchownsync)
* [fstat](_fs_extra_.md#fstat)
* [fstatSync](_fs_extra_.md#fstatsync)
* [fsync](_fs_extra_.md#fsync)
* [fsyncSync](_fs_extra_.md#fsyncsync)
* [futimes](_fs_extra_.md#futimes)
* [futimesSync](_fs_extra_.md#futimessync)
* [lchmod](_fs_extra_.md#lchmod)
* [lchmodSync](_fs_extra_.md#lchmodsync)
* [lchown](_fs_extra_.md#lchown)
* [lchownSync](_fs_extra_.md#lchownsync)
* [link](_fs_extra_.md#link)
* [linkSync](_fs_extra_.md#linksync)
* [lstat](_fs_extra_.md#lstat)
* [lstatSync](_fs_extra_.md#lstatsync)
* [mkdir](_fs_extra_.md#mkdir)
* [mkdirSync](_fs_extra_.md#mkdirsync)
* [mkdirp](_fs_extra_.md#mkdirp)
* [mkdirpSync](_fs_extra_.md#mkdirpsync)
* [mkdirs](_fs_extra_.md#mkdirs)
* [mkdirsSync](_fs_extra_.md#mkdirssync)
* [open](_fs_extra_.md#open)
* [openSync](_fs_extra_.md#opensync)
* [outputFile](_fs_extra_.md#outputfile)
* [outputFileSync](_fs_extra_.md#outputfilesync)
* [outputJSON](_fs_extra_.md#outputjson)
* [outputJSONSync](_fs_extra_.md#outputjsonsync)
* [outputJson](_fs_extra_.md#outputjson-1)
* [outputJsonSync](_fs_extra_.md#outputjsonsync-1)
* [read](_fs_extra_.md#read)
* [readFile](_fs_extra_.md#readfile)
* [readFileSync](_fs_extra_.md#readfilesync)
* [readJSON](_fs_extra_.md#readjson)
* [readJSONSync](_fs_extra_.md#readjsonsync)
* [readJson](_fs_extra_.md#readjson-1)
* [readJsonSync](_fs_extra_.md#readjsonsync-1)
* [readSync](_fs_extra_.md#readsync)
* [readdir](_fs_extra_.md#readdir)
* [readdirSync](_fs_extra_.md#readdirsync)
* [readlink](_fs_extra_.md#readlink)
* [realpath](_fs_extra_.md#realpath)
* [realpathSync](_fs_extra_.md#realpathsync)
* [remove](_fs_extra_.md#remove)
* [removeSync](_fs_extra_.md#removesync)
* [rename](_fs_extra_.md#rename)
* [renameSync](_fs_extra_.md#renamesync)
* [rmdir](_fs_extra_.md#rmdir)
* [rmdirSync](_fs_extra_.md#rmdirsync)
* [stat](_fs_extra_.md#stat)
* [statSync](_fs_extra_.md#statsync)
* [symlink](_fs_extra_.md#symlink)
* [symlinkSync](_fs_extra_.md#symlinksync)
* [truncate](_fs_extra_.md#truncate)
* [truncateSync](_fs_extra_.md#truncatesync)
* [unlink](_fs_extra_.md#unlink)
* [unlinkSync](_fs_extra_.md#unlinksync)
* [unwatchFile](_fs_extra_.md#unwatchfile)
* [utimes](_fs_extra_.md#utimes)
* [utimesSync](_fs_extra_.md#utimessync)
* [watch](_fs_extra_.md#watch)
* [watchFile](_fs_extra_.md#watchfile)
* [write](_fs_extra_.md#write)
* [writeFile](_fs_extra_.md#writefile)
* [writeFileSync](_fs_extra_.md#writefilesync)
* [writeJSON](_fs_extra_.md#writejson)
* [writeJSONSync](_fs_extra_.md#writejsonsync)
* [writeJson](_fs_extra_.md#writejson-1)
* [writeJsonSync](_fs_extra_.md#writejsonsync-1)
* [writeSync](_fs_extra_.md#writesync)

## Functions

### appendFile(filename: string, data: any, encoding?: string, callback?: (err: Error)=> void): voidappendFile(filename: string, data: any, option?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md), callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:157](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L157)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| data | any|  |
| encoding? | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:158](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L158)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| data | any|  |
| option? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### appendFileSync(filename: string, data: any, encoding?: string): voidappendFileSync(filename: string, data: any, option?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md)): void

* Defined in [lib/fs-extra/fs-extra.d.ts:159](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L159)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| data | any|  |
| encoding? | string|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:160](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L160)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| data | any|  |
| option? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |

#### Returns: void

### chmod(path: string, mode: number, callback?: (err: Error)=> void): voidchmod(path: string, mode: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:97](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L97)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:98](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L98)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### chmodSync(path: string, mode: number): voidchmodSync(path: string, mode: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:99](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L99)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode | number|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:100](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L100)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode | string|  |

#### Returns: void

### chown(path: string, uid: number, gid: number, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:91](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L91)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| uid | number|  |
| gid | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### chownSync(path: string, uid: number, gid: number): void

* Defined in [lib/fs-extra/fs-extra.d.ts:92](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L92)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| uid | number|  |
| gid | number|  |

#### Returns: void

### close(fd: number, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:133](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L133)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### closeSync(fd: number): void

* Defined in [lib/fs-extra/fs-extra.d.ts:134](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L134)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |

#### Returns: void

### copy(src: string, dest: string, callback?: (err: Error)=> void): voidcopy(src: string, dest: string, filter: (src: string)=> boolean, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:44](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L44)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| src | string|  |
| dest | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:45](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L45)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| src | string|  |
| dest | string|  |
| filter | (src: string)=> boolean|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### copySync(src: string, dest: string): voidcopySync(src: string, dest: string, filter: (src: string)=> boolean): void

* Defined in [lib/fs-extra/fs-extra.d.ts:47](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L47)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| src | string|  |
| dest | string|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:48](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L48)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| src | string|  |
| dest | string|  |
| filter | (src: string)=> boolean|  |

#### Returns: void

### createFile(file: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:50](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L50)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### createFileSync(file: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:51](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L51)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |

#### Returns: void

### createReadStream(path: string, options?: [ReadStreamOptions](../interfaces/_fs_extra_.readstreamoptions.md)): [ReadStream](../classes/_fs_extra_.readstream.md)

* Defined in [lib/fs-extra/fs-extra.d.ts:186](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L186)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| options? | [ReadStreamOptions](../interfaces/_fs_extra_.readstreamoptions.md)|  |

#### Returns: [ReadStream](../classes/_fs_extra_.readstream.md)

### createWriteStream(path: string, options?: [WriteStreamOptions](../interfaces/_fs_extra_.writestreamoptions.md)): [WriteStream](../classes/_fs_extra_.writestream.md)

* Defined in [lib/fs-extra/fs-extra.d.ts:187](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L187)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| options? | [WriteStreamOptions](../interfaces/_fs_extra_.writestreamoptions.md)|  |

#### Returns: [WriteStream](../classes/_fs_extra_.writestream.md)

### ensureDir(path: string, cb: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:167](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L167)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| cb | (err: Error)=> void|  |

#### Returns: void

### exists(path: string, callback?: (exists: boolean)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:165](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L165)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| callback? | (exists: boolean)=> void|  |

#### Returns: void

### existsSync(path: string): boolean

* Defined in [lib/fs-extra/fs-extra.d.ts:166](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L166)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |

#### Returns: boolean

### fchmod(fd: number, mode: number, callback?: (err: Error)=> void): voidfchmod(fd: number, mode: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:101](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L101)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| mode | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:102](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L102)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| mode | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### fchmodSync(fd: number, mode: number): voidfchmodSync(fd: number, mode: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:103](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L103)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| mode | number|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:104](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L104)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| mode | string|  |

#### Returns: void

### fchown(fd: number, uid: number, gid: number, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:93](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L93)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| uid | number|  |
| gid | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### fchownSync(fd: number, uid: number, gid: number): void

* Defined in [lib/fs-extra/fs-extra.d.ts:94](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L94)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| uid | number|  |
| gid | number|  |

#### Returns: void

### fstat(fd: number, callback?: (err: Error, stats: [Stats](../interfaces/_fs_extra_.stats.md))=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:111](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L111)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| callback? | (err: Error, stats: [Stats](../interfaces/_fs_extra_.stats.md))=> void|  |

#### Returns: void

### fstatSync(fd: number): [Stats](../interfaces/_fs_extra_.stats.md)

* Defined in [lib/fs-extra/fs-extra.d.ts:114](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L114)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |

#### Returns: [Stats](../interfaces/_fs_extra_.stats.md)

### fsync(fd: number, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:141](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L141)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### fsyncSync(fd: number): void

* Defined in [lib/fs-extra/fs-extra.d.ts:142](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L142)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |

#### Returns: void

### futimes(fd: number, atime: number, mtime: number, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:139](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L139)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| atime | number|  |
| mtime | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### futimesSync(fd: number, atime: number, mtime: number): void

* Defined in [lib/fs-extra/fs-extra.d.ts:140](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L140)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| atime | number|  |
| mtime | number|  |

#### Returns: void

### lchmod(path: string, mode: string, callback?: (err: Error)=> void): voidlchmod(path: string, mode: number, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:105](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L105)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:106](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L106)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### lchmodSync(path: string, mode: number): voidlchmodSync(path: string, mode: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:107](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L107)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode | number|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:108](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L108)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode | string|  |

#### Returns: void

### lchown(path: string, uid: number, gid: number, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:95](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L95)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| uid | number|  |
| gid | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### lchownSync(path: string, uid: number, gid: number): void

* Defined in [lib/fs-extra/fs-extra.d.ts:96](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L96)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| uid | number|  |
| gid | number|  |

#### Returns: void

### link(srcpath: string, dstpath: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:115](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L115)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| srcpath | string|  |
| dstpath | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### linkSync(srcpath: string, dstpath: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:116](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L116)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| srcpath | string|  |
| dstpath | string|  |

#### Returns: void

### lstat(path: string, callback?: (err: Error, stats: [Stats](../interfaces/_fs_extra_.stats.md))=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:110](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L110)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| callback? | (err: Error, stats: [Stats](../interfaces/_fs_extra_.stats.md))=> void|  |

#### Returns: void

### lstatSync(path: string): [Stats](../interfaces/_fs_extra_.stats.md)

* Defined in [lib/fs-extra/fs-extra.d.ts:113](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L113)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |

#### Returns: [Stats](../interfaces/_fs_extra_.stats.md)

### mkdir(path: string, mode?: number, callback?: (err: Error)=> void): voidmkdir(path: string, mode?: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:127](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L127)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode? | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:128](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L128)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode? | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### mkdirSync(path: string, mode?: number): voidmkdirSync(path: string, mode?: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:129](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L129)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode? | number|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:130](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L130)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| mode? | string|  |

#### Returns: void

### mkdirp(dir: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:54](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L54)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| dir | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### mkdirpSync(dir: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:56](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L56)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| dir | string|  |

#### Returns: void

### mkdirs(dir: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:53](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L53)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| dir | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### mkdirsSync(dir: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:55](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L55)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| dir | string|  |

#### Returns: void

### open(path: string, flags: string, mode?: string, callback?: (err: Error, fs: number)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:135](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L135)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| flags | string|  |
| mode? | string|  |
| callback? | (err: Error, fs: number)=> void|  |

#### Returns: void

### openSync(path: string, flags: string, mode?: string): number

* Defined in [lib/fs-extra/fs-extra.d.ts:136](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L136)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| flags | string|  |
| mode? | string|  |

#### Returns: number

### outputFile(file: string, data: any, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:58](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L58)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| data | any|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### outputFileSync(file: string, data: any): void

* Defined in [lib/fs-extra/fs-extra.d.ts:59](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L59)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| data | any|  |

#### Returns: void

### outputJSON(file: string, data: any, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:62](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L62)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| data | any|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### outputJSONSync(file: string, data: any): void

* Defined in [lib/fs-extra/fs-extra.d.ts:64](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L64)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| data | any|  |

#### Returns: void

### outputJson(file: string, data: any, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:61](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L61)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| data | any|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### outputJsonSync(file: string, data: any): void

* Defined in [lib/fs-extra/fs-extra.d.ts:63](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L63)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| data | any|  |

#### Returns: void

### read(fd: number, buffer: [NodeBuffer](../interfaces/nodebuffer.md), offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: [NodeBuffer](../interfaces/nodebuffer.md))=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:145](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L145)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| buffer | [NodeBuffer](../interfaces/nodebuffer.md)|  |
| offset | number|  |
| length | number|  |
| position | number|  |
| callback? | (err: Error, bytesRead: number, buffer: [NodeBuffer](../interfaces/nodebuffer.md))=> void|  |

#### Returns: void

### readFile(filename: string, encoding: string, callback: (err: Error, data: string)=> void): voidreadFile(filename: string, options: [OpenOptions](../interfaces/_fs_extra_.openoptions.md), callback: (err: Error, data: string)=> void): voidreadFile(filename: string, callback: (err: Error, data: [NodeBuffer](../interfaces/nodebuffer.md))=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:147](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L147)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| encoding | string|  |
| callback | (err: Error, data: string)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:148](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L148)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| options | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |
| callback | (err: Error, data: string)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:149](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L149)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| callback | (err: Error, data: [NodeBuffer](../interfaces/nodebuffer.md))=> void|  |

#### Returns: void

### readFileSync(filename: string): [NodeBuffer](../interfaces/nodebuffer.md)readFileSync(filename: string, encoding: string): stringreadFileSync(filename: string, options: [OpenOptions](../interfaces/_fs_extra_.openoptions.md)): string

* Defined in [lib/fs-extra/fs-extra.d.ts:150](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L150)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |

#### Returns: [NodeBuffer](../interfaces/nodebuffer.md)

* Defined in [lib/fs-extra/fs-extra.d.ts:151](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L151)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| encoding | string|  |

#### Returns: string

* Defined in [lib/fs-extra/fs-extra.d.ts:152](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L152)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| options | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |

#### Returns: string

### readJSON(file: string, callback?: (err: Error)=> void): voidreadJSON(file: string, options?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md), callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:68](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L68)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:69](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L69)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| options? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### readJSONSync(file: string, options?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md)): void

* Defined in [lib/fs-extra/fs-extra.d.ts:72](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L72)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| options? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |

#### Returns: void

### readJson(file: string, callback?: (err: Error)=> void): voidreadJson(file: string, options?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md), callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:66](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L66)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:67](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L67)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| options? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### readJsonSync(file: string, options?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md)): void

* Defined in [lib/fs-extra/fs-extra.d.ts:71](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L71)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| options? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |

#### Returns: void

### readSync(fd: number, buffer: [NodeBuffer](../interfaces/nodebuffer.md), offset: number, length: number, position: number): number

* Defined in [lib/fs-extra/fs-extra.d.ts:146](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L146)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| buffer | [NodeBuffer](../interfaces/nodebuffer.md)|  |
| offset | number|  |
| length | number|  |
| position | number|  |

#### Returns: number

### readdir(path: string, callback?: (err: Error, files: string[])=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:131](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L131)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| callback? | (err: Error, files: string[])=> void|  |

#### Returns: void

### readdirSync(path: string): string[]

* Defined in [lib/fs-extra/fs-extra.d.ts:132](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L132)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |

#### Returns: string[]

### readlink(path: string, callback?: (err: Error, linkString: string)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:119](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L119)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| callback? | (err: Error, linkString: string)=> void|  |

#### Returns: void

### realpath(path: string, callback?: (err: Error, resolvedPath: string)=> void): voidrealpath(path: string, cache: string, callback: (err: Error, resolvedPath: string)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:120](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L120)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| callback? | (err: Error, resolvedPath: string)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:121](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L121)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| cache | string|  |
| callback | (err: Error, resolvedPath: string)=> void|  |

#### Returns: void

### realpathSync(path: string, cache?: boolean): string

* Defined in [lib/fs-extra/fs-extra.d.ts:122](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L122)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| cache? | boolean|  |

#### Returns: string

### remove(dir: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:74](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L74)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| dir | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### removeSync(dir: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:75](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L75)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| dir | string|  |

#### Returns: void

### rename(oldPath: string, newPath: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:87](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L87)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| oldPath | string|  |
| newPath | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### renameSync(oldPath: string, newPath: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:88](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L88)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| oldPath | string|  |
| newPath | string|  |

#### Returns: void

### rmdir(path: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:125](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L125)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### rmdirSync(path: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:126](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L126)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |

#### Returns: void

### stat(path: string, callback?: (err: Error, stats: [Stats](../interfaces/_fs_extra_.stats.md))=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:109](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L109)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| callback? | (err: Error, stats: [Stats](../interfaces/_fs_extra_.stats.md))=> void|  |

#### Returns: void

### statSync(path: string): [Stats](../interfaces/_fs_extra_.stats.md)

* Defined in [lib/fs-extra/fs-extra.d.ts:112](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L112)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |

#### Returns: [Stats](../interfaces/_fs_extra_.stats.md)

### symlink(srcpath: string, dstpath: string, type?: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:117](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L117)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| srcpath | string|  |
| dstpath | string|  |
| type? | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### symlinkSync(srcpath: string, dstpath: string, type?: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:118](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L118)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| srcpath | string|  |
| dstpath | string|  |
| type? | string|  |

#### Returns: void

### truncate(fd: number, len: number, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:89](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L89)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| len | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### truncateSync(fd: number, len: number): void

* Defined in [lib/fs-extra/fs-extra.d.ts:90](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L90)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| len | number|  |

#### Returns: void

### unlink(path: string, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:123](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L123)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### unlinkSync(path: string): void

* Defined in [lib/fs-extra/fs-extra.d.ts:124](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L124)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |

#### Returns: void

### unwatchFile(filename: string, listener?: [Stats](../interfaces/_fs_extra_.stats.md)): void

* Defined in [lib/fs-extra/fs-extra.d.ts:163](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L163)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| listener? | [Stats](../interfaces/_fs_extra_.stats.md)|  |

#### Returns: void

### utimes(path: string, atime: number, mtime: number, callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:137](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L137)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| atime | number|  |
| mtime | number|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### utimesSync(path: string, atime: number, mtime: number): void

* Defined in [lib/fs-extra/fs-extra.d.ts:138](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L138)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| path | string|  |
| atime | number|  |
| mtime | number|  |

#### Returns: void

### watch(filename: string, options?: \{Optional persistent?: boolean\}, listener?: (event: string, filename: string)=> any): [FSWatcher](../interfaces/_fs_extra_.fswatcher.md)

* Defined in [lib/fs-extra/fs-extra.d.ts:164](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L164)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| options? | \{Optional persistent?: boolean\}|  |
| listener? | (event: string, filename: string)=> any|  |

#### Returns: [FSWatcher](../interfaces/_fs_extra_.fswatcher.md)

### watchFile(filename: string, listener: \{curr: [Stats](../interfaces/_fs_extra_.stats.md), prev: [Stats](../interfaces/_fs_extra_.stats.md)\}): voidwatchFile(filename: string, options: \{Optional interval?: number, Optional persistent?: boolean\}, listener: \{curr: [Stats](../interfaces/_fs_extra_.stats.md), prev: [Stats](../interfaces/_fs_extra_.stats.md)\}): void

* Defined in [lib/fs-extra/fs-extra.d.ts:161](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L161)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| listener | \{curr: [Stats](../interfaces/_fs_extra_.stats.md), prev: [Stats](../interfaces/_fs_extra_.stats.md)\}|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:162](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L162)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| options | \{Optional interval?: number, Optional persistent?: boolean\}|  |
| listener | \{curr: [Stats](../interfaces/_fs_extra_.stats.md), prev: [Stats](../interfaces/_fs_extra_.stats.md)\}|  |

#### Returns: void

### write(fd: number, buffer: [NodeBuffer](../interfaces/nodebuffer.md), offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: [NodeBuffer](../interfaces/nodebuffer.md))=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:143](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L143)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| buffer | [NodeBuffer](../interfaces/nodebuffer.md)|  |
| offset | number|  |
| length | number|  |
| position | number|  |
| callback? | (err: Error, written: number, buffer: [NodeBuffer](../interfaces/nodebuffer.md))=> void|  |

#### Returns: void

### writeFile(filename: string, data: any, encoding?: string, callback?: (err: Error)=> void): voidwriteFile(filename: string, data: any, options?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md), callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:153](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L153)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| data | any|  |
| encoding? | string|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:154](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L154)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| data | any|  |
| options? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### writeFileSync(filename: string, data: any, encoding?: string): voidwriteFileSync(filename: string, data: any, option?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md)): void

* Defined in [lib/fs-extra/fs-extra.d.ts:155](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L155)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| data | any|  |
| encoding? | string|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:156](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L156)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| filename | string|  |
| data | any|  |
| option? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |

#### Returns: void

### writeJSON(file: string, object: any, callback?: (err: Error)=> void): voidwriteJSON(file: string, object: any, options?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md), callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:81](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L81)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| object | any|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:82](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L82)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| object | any|  |
| options? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### writeJSONSync(file: string, object: any, options?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md)): void

* Defined in [lib/fs-extra/fs-extra.d.ts:85](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L85)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| object | any|  |
| options? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |

#### Returns: void

### writeJson(file: string, object: any, callback?: (err: Error)=> void): voidwriteJson(file: string, object: any, options?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md), callback?: (err: Error)=> void): void

* Defined in [lib/fs-extra/fs-extra.d.ts:79](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L79)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| object | any|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

* Defined in [lib/fs-extra/fs-extra.d.ts:80](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L80)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| object | any|  |
| options? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |
| callback? | (err: Error)=> void|  |

#### Returns: void

### writeJsonSync(file: string, object: any, options?: [OpenOptions](../interfaces/_fs_extra_.openoptions.md)): void

* Defined in [lib/fs-extra/fs-extra.d.ts:84](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L84)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| file | string|  |
| object | any|  |
| options? | [OpenOptions](../interfaces/_fs_extra_.openoptions.md)|  |

#### Returns: void

### writeSync(fd: number, buffer: [NodeBuffer](../interfaces/nodebuffer.md), offset: number, length: number, position: number): number

* Defined in [lib/fs-extra/fs-extra.d.ts:144](https://github.com/kimamula/typedoc/blob/HEAD/src/lib/fs-extra/fs-extra.d.ts#L144)

#### Parameters

| Name | Type | Description |
| ---- | ---- | ---- |
| fd | number|  |
| buffer | [NodeBuffer](../interfaces/nodebuffer.md)|  |
| offset | number|  |
| length | number|  |
| position | number|  |

#### Returns: number

Generated using [TypeDoc](http://typedoc.io)


text:
class FontNotoSansSinhala < Cask
  version 'latest'
  sha256 :no_check

  url 'https://www.google.com/get/noto/pkgs/NotoSansSinhala-unhinted.zip'
  homepage 'http://www.google.com/get/noto'

  font 'NotoSansSinhala-Regular.ttf'
  font 'NotoSansSinhala-Bold.ttf'
end

redpajama_set_name: RedPajamaGithub


text:
[![Build Status](https://travis-ci.org/thoughtbot/flutie.svg?branch=master)](https://travis-ci.org/thoughtbot/flutie)

Flutie provides some utility view helpers for use with Rails applications.

There are helpers for setting a page title and for generating body classes.

## Installation & Upgrading

Flutie is a Railtie.
We support the versions of Ruby and Rails
listed in [.travis.yml](.travis.yml).

It should be run as a gem and included in your `Gemfile`:

    gem "flutie"

## Helpers

Flutie provides helper methods for use within Rails application layouts and views.

### Page Title

The `page_title` method can be used like:

    <title><%= page_title %></title>

By default, it will produce results like:

    <title>Appname : page title</title>

* "App name" comes from the module name of the rails application created by your app, i.e. `Appname::Application` will produce "Appname"
* "page" comes from trying `content_for(:page_title)` and assumes you are using `content_for` with `:page_title` symbol on your pages.
* The separator defaults to " : "

These can be overridden by passing an options hash including `:app_name`, `:page_title_symbol` and `:separator` hash keys, ie:

    content_for(:site_page_title, 'My title of my page')
    page_title(:app_name => 'My app name', :page_title_symbol => :site_page_title, :separator => " | ")
    => "My app name | My title of my page"

You can also reverse the position of the app name and the :site_page_title using the :reverse option, ie:

    content_for(:site_page_title, 'My title of my page')
    page_title(:app_name => 'My app name', :page_title_symbol => :site_page_title, :reverse => true)
    => "My title of my page : My app name"

#### body_class

The `body_class` method can be used like:

    <body class="<%= body_class %>">

This will produce a string including the controller name and controller-action name.  For example, The WidgetsController#show action would produce:

    <body class="widgets widgets-show">

Anything which has been added via `content_for(:extra_body_classes)` will be added to the end, for example:

    content_for(:extra_body_classes, 'special-page')
    <body class="<%= body_class %>">
    <body class="widgets widgets-show special-page">

## How to contribute

Please see the [CONTRIBUTING](CONTRIBUTING.md) file for details.

## Credits

![thoughtbot](http://thoughtbot.com/images/tm/logo.png)

Flutie is maintained and funded by [thoughtbot, inc](http://thoughtbot.com/community).

Thank you to all [the contributors](https://github.com/thoughtbot/flutie/contributors)!

The names and logos for thoughtbot are trademarks of thoughtbot, inc.

## License

Flutie is Copyright © 2010-2015 thoughtbot, inc.
It is free software,
and may be redistributed under
the terms specified in the [LICENSE](LICENSE) file.


text:
const lookup = {
  M: 1000,
  D: 500,
  C: 100,
  L: 50,
  X: 10,
  V: 5,
  I: 1,
};

const romanToInt = (str) => {
  const workingRoman = str.split('').reverse().join('');
  let ans = 0;
  for (let i = 0; i < workingRoman.length; i += 1) {
    const letter = workingRoman[i];
    const lookupValue = lookup[letter];

    // if current ans is 4 * greater than current lookup, is must be a subtractions
    // since we go thru this array backwards
    if (lookupValue * 4 < ans) {
      ans -= lookupValue;
      continue;
    }

    // otherwise, its an addition
    ans += lookupValue;
  }

  return ans;
};

console.log(romanToInt('MMII'));
console.log(romanToInt('MMIV'));


text:
HW2: RAILS INTRO - ADD FEATURES TO ROTTENPOTATOES
---------

In this homework you will add a feature to an existing simple Rails app and deploy the result publicly on the Heroku cloud hosting service. We will run live integration tests against your deployed version.

General advice:  This homework involves modifying RottenPotatoes in various ways. Git is your friend: commit frequently in case you inadvertently break something that was working before! That way you can always back up to an earlier revision, or just visually compare what changed in each file since your last "good" commit.

Remember, commit early and often!

Preparation: If you've never used Rails before please follow these screencasts to work through chapter 4 of the ESaaS textbook to create a rottenpotatoes rails app from scratch.  This assignment assumes that you have a working version of RottenPotatoes running locally and deployed on Heroku. Please follow these steps to make an initial deployment to Heroku:

Clone the assignment skeleton:

    git clone https://github.com/saasbook/rails-intro

Switch to the rails_intro directory

    cd rails-intro

Now you need to install various libraries with the bundle command

    bundle install --without production

Next you will need to run some commands to set up the database locally and add some data

    bundle exec rake db:migrate

    bundle exec rake db:seed

Now you can test the app locally by running the following and navigating to http://localhost:3000/movies in your browser

    rails s

In order to deploy to Heroku you will need to sign up for a free Heroku account at https://id.heroku.com/signup and follow the instructions to create your account. Assuming you have Heroku Toolbelt installed (it should be pre-installed on the VM) you now need to set up ssh keys to securely talk to Heroku.  The three basic commands you need are the following, but see the Heroku page for more details.

    ssh-keygen -t rsa

    heroku login

    heroku keys:add

Note that this is an area that a lot of people get seriously stuck, particularly if they have existing ssh keys.  If you are on a fresh VM you should be fine.  If you do get stuck here, please do ask in the forums.

Once you have your heroku keys set up correctly you can create a heroku instance from the rottenpotatoes directory

    heroku create

Now we can use git to deploy our code to the Heroku server in the cloud

    git push heroku master

Note, if you see a warning such as:

    The authenticity of host 'heroku.com (50.19.85.132)' can't be established.
    RSA key fingerprint is 8b:48:5e:67:0e:c9:16:47:32:f2:87:0c:1f:c8:60:ad.
    Are you sure you want to continue connecting (yes/no)?
    Please type 'yes' or 'no':

This is normal - go ahead and type yes then hit 'ENTER to add heroku to the list of known remote computers.

Next we need to tell the cloud instance to prepare the database:

    heroku run rake db:migrate

We need to tell the cloud instance to add some data to the database:

    heroku run rake db:seed

Now you can navigate to the heroku url that heroku create printed to the console and see your app running in the cloud.

    heroku open

You can find more details on git and Heroku in the appendices of the ESaaS textbook.


text:
namespace Moonfish.Guerilla.Tags
{
    using Moonfish.Tags;
    using Moonfish.Model;
    using System.IO;
    using System.Collections.Generic;
    using System.Linq;

    public partial class LoopingSoundDetailBlock : GuerillaBlock, IWriteQueueable
    {
        public Moonfish.Tags.StringIdent Name;
        [Moonfish.Tags.TagReferenceAttribute("snd!")]
        public Moonfish.Tags.TagReference Sound;
        public Moonfish.Model.Range RandomPeriodBounds;
        public float FieldReal;
        public Flags LoopingSoundDetailFlags;
        /// <summary>
        /// if the sound specified above is not stereo it will be randomly spatialized according to the following constraints. if both lower and upper bounds are zero for any of the following fields, the sound's position will be randomly selected from all possible directions or distances.
        /// </summary>
        public Moonfish.Model.Range YawBounds;
        public Moonfish.Model.Range PitchBounds;
        public Moonfish.Model.Range DistanceBounds;
        public override int SerializedSize
        {
            get
            {
                return 52;
            }
        }
        public override int Alignment
        {
            get
            {
                return 4;
            }
        }
        public override System.Collections.Generic.Queue<Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader)
        {
            System.Collections.Generic.Queue<Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue<Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader));
            this.Name = binaryReader.ReadStringID();
            this.Sound = binaryReader.ReadTagReference();
            this.RandomPeriodBounds = binaryReader.ReadRange();
            this.FieldReal = binaryReader.ReadSingle();
            this.LoopingSoundDetailFlags = ((Flags)(binaryReader.ReadInt32()));
            this.YawBounds = binaryReader.ReadRange();
            this.PitchBounds = binaryReader.ReadRange();
            this.DistanceBounds = binaryReader.ReadRange();
            return pointerQueue;
        }
        public override void ReadInstances(System.IO.BinaryReader binaryReader, System.Collections.Generic.Queue<Moonfish.Tags.BlamPointer> pointerQueue)
        {
            base.ReadInstances(binaryReader, pointerQueue);
        }
        public override void QueueWrites(Moonfish.Guerilla.QueueableBinaryWriter queueableBinaryWriter)
        {
            base.QueueWrites(queueableBinaryWriter);
        }
        public override void Write_(Moonfish.Guerilla.QueueableBinaryWriter queueableBinaryWriter)
        {
            base.Write_(queueableBinaryWriter);
            queueableBinaryWriter.Write(this.Name);
            queueableBinaryWriter.Write(this.Sound);
            queueableBinaryWriter.Write(this.RandomPeriodBounds);
            queueableBinaryWriter.Write(this.FieldReal);
            queueableBinaryWriter.Write(((int)(this.LoopingSoundDetailFlags)));
            queueableBinaryWriter.Write(this.YawBounds);
            queueableBinaryWriter.Write(this.PitchBounds);
            queueableBinaryWriter.Write(this.DistanceBounds);
        }
        [System.FlagsAttribute()]
        public enum Flags : int
        {
            None = 0,
            DontPlayWithAlternate = 1,
            DontPlayWithoutAlternate = 2,
            StartImmediatelyWithLoop = 4,
        }
    }
}


text:
<?php

namespace Wei;

/**
 * Check if the type of input is equals specified type name
 *
 * @author      Twin Huang <twinhuang@qq.com>
 */
class IsType extends BaseValidator
{
    protected $typeMessage = '%name% must be %typeName%';

    protected $negativeMessage = '%name% must not be %typeName%';

    /**
     * The expected type of input
     *
     * @var string
     */
    protected $type;

    /**
     * The translated type name for display
     *
     * @var string
     */
    protected $typeName;

    /**
     * {@inheritdoc}
     *
     * @param string $type The expected type of $input
     */
    public function __invoke($input, $type = null)
    {
        $type && $this->storeOption('type', $type);

        return $this->isValid($input);
    }

    /**
     * {@inheritdoc}
     */
    public function getMessages($name = null)
    {
        $this->loadTranslationMessages();
        $this->typeName = $this->t($this->type);
        return parent::getMessages($name);
    }

    /**
     * {@inheritdoc}
     */
    protected function doValidate($input)
    {
        if (function_exists($fn = 'is_' . $this->type)) {
            $result = $fn($input);
        } elseif (function_exists($fn = 'ctype_' . $this->type)) {
            $result = $fn($input);
        } else {
            $result = $input instanceof $this->type;
        }

        if (!$result) {
            $this->addError('type');
        }

        return $result;
    }
}


text:
NSString *const VERSION = @"0.0.8";

int const DEFAULT_FRAMES_PER_SECOND = 30;
float const DEFAULT_RECORDING_DELAY = 0.5;
NSString *const DEFAULT_ENCODING_PRESET = @"Medium";

// encoding preset options:
// High - Highest recording quality (varies per device)
// Medium - Suitable for WiFi sharing (actual values may change)
// Low - Suitable for 3G sharing (actual values may change)
// 640x480 - 640x480 VGA (check its supported before setting it)
// 1280x720 - 1280x720 720p HD (check its supported before setting it)

NSString *const DEFAULT_ENCODING_PRESETS   = @"High, Medium, Low, 640x480, 1280x720";


text:
<?xml version="1.0" encoding="utf-8"?>
<ruleset version="1.5.0">
	<fields>
		<field name="board_name" required="true" length="1:40" rule="alpha_number" />
		<field name="list_count" required="true" rule="number" />
	</fields>
</ruleset>


text:
<?php

namespace OpenCFP\Http\Controller\Admin;

use OpenCFP\Http\Controller\BaseController;
use Symfony\Component\HttpFoundation\Request;
use Pagerfanta\View\TwitterBootstrap3View;

class TalksController extends BaseController
{
    use AdminAccessTrait;

    public function indexAction(Request $req)
    {
        if (!$this->userHasAccess($this->app)) {
            return $this->redirectTo('login');
        }

        $sort = [ "created_at" => "DESC" ];
        if ($req->get('sort') !== null) {
            switch ($req->get('sort')) {
                case "title": $sort = [ "title" => "ASC" ]; break;
                case "category": $sort = [ "category" => "ASC", "title" => "ASC" ]; break;
                case "type": $sort = [ "type" => "ASC", "category" => "ASC", "title" => "ASC" ]; break;
            }
        }

        $admin_user_id = $this->app['sentry']->getUser()->getId();
        $mapper = $this->app['spot']->mapper('OpenCFP\Domain\Entity\Talk');
        $pager_formatted_talks = $mapper->getAllPagerFormatted($admin_user_id, $sort);

        // Set up our page stuff
        $adapter = new \Pagerfanta\Adapter\ArrayAdapter($pager_formatted_talks);
        $pagerfanta = new \Pagerfanta\Pagerfanta($adapter);
        $pagerfanta->setMaxPerPage(20);
        $pagerfanta->getNbResults();

        if ($req->get('page') !== null) {
            $pagerfanta->setCurrentPage($req->get('page'));
        }

        // Create our default view for the navigation options
        $routeGenerator = function ($page) use ($req) {
            $uri = '/admin/talks?page=' . $page;
            if ($req->get('sort') !== null) {
                $uri .= '&sort=' . $req->get('sort');
            }

            return $uri;
        };
        $view = new TwitterBootstrap3View();
        $pagination = $view->render(
            $pagerfanta,
            $routeGenerator,
            array('proximity' => 3)
        );

        $templateData = array(
            'pagination' => $pagination,
            'talks' => $pagerfanta,
            'page' => $pagerfanta->getCurrentPage(),
            'current_page' => $req->getRequestUri(),
            'totalRecords' => count($pager_formatted_talks)
        );

        return $this->render('admin/talks/index.twig', $templateData);
    }

    public function viewAction(Request $req)
    {
        if (!$this->userHasAccess($this->app)) {
            return $this->redirectTo('login');
        }

        $admin_user_id = $this->app['sentry']->getUser()->getId();

        // Get info about the talks
        $talk_mapper = $this->app['spot']->mapper('OpenCFP\Domain\Entity\Talk');
        $talk_id = $req->get('id');

        $talk = $talk_mapper->get($talk_id);
        if ($talk->favorites) {
            foreach ($talk->favorites as $favorite) {
                if ($favorite->admin_user_id == $admin_user_id) {
                    $talk->favorite = 1;
                }
            }
        }

        $all_talks = $talk_mapper->all()
            ->where(['user_id' => $talk->user_id])
            ->with(['favorites'])
            ->toArray();
        foreach ($all_talks as $idx => $other_talk) {
            if ($other_talk['favorites']) {
                foreach ($other_talk['favorites'] as $favorite) {
                    if ($favorite['admin_user_id'] == $admin_user_id) {
                        $all_talks[$idx]['favorite'] = 1;
                    }
                }
            }
        }

        // Get info about our speaker
        $user_mapper = $this->app['spot']->mapper('OpenCFP\Domain\Entity\User');
        $speaker = $user_mapper->get($talk->user_id)->toArray();

        $prev_talk = $talk_mapper
            ->where(['id <' => $talk_id])
            ->order(['id' => 'DESC'])
            ->limit(1)
            ->toArray();

        $next_talk = $talk_mapper
            ->where(['id >' => $talk_id])
            ->order(['id' => 'ASC'])
            ->limit(1)
            ->toArray();

        // Grab all the other talks and filter out the one we have
        $otherTalks = array_filter($all_talks, function ($talk) use ($talk_id) {
            if ((int) $talk['id'] == (int) $talk_id) {
                return false;
            }

            return true;
        });

        // Build and render the template
        $templateData = array(
            'talk' => $talk,
            'speaker' => $speaker,
            'otherTalks' => $otherTalks,
            'prevTalk' => (empty($prev_talk[0]) ? false : $prev_talk[0]),
            'nextTalk' => (empty($next_talk[0]) ? false : $next_talk[0]),
        );

        return $this->render('admin/talks/view.twig', $templateData);
    }

    /**
     * Set Favorited Talk [POST]
     *
     * @param  Request $req Request Object
     * @return bool
     */
    private function favoriteAction(Request $req)
    {
        if (!$this->userHasAccess($this->app)) {
            return false;
        }

        $admin_user_id = (int) $this->app['sentry']->getUser()->getId();
        $status = true;

        if ($req->get('delete') !== null) {
            $status = false;
        }

        $mapper = $this->app['spot']->mapper('OpenCFP\Domain\Entity\Favorite');

        if ($status == false) {
            // Delete the record that matches
            $favorite = $mapper->first([
                'admin_user_id' => $admin_user_id,
                'talk_id' => (int) $req->get('id')
            ]);

            return $mapper->delete($favorite);
        }

        $previous_favorite = $mapper->where([
            'admin_user_id' => $admin_user_id,
            'talk_id' => (int) $req->get('id')
        ]);

        if ($previous_favorite->count() == 0) {
            $favorite = $mapper->get();
            $favorite->admin_user_id = $admin_user_id;
            $favorite->talk_id = (int) $req->get('id');

            return $mapper->insert($favorite);
        }

        return true;
    }

    /**
     * Set Selected Talk [POST]
     *
     * @param  Request $req Request Object
     * @return bool
     */
    private function selectAction(Request $req)
    {
        if (!$this->userHasAccess($this->app)) {
            return false;
        }

        $status = true;

        if ($req->get('delete') !== null) {
            $status = false;
        }

        $mapper = $this->app['spot']->mapper('OpenCFP\Domain\Entity\Talk');
        $talk = $mapper->get($req->get('id'));
        $talk->selected = $status;
        $mapper->save($talk);

        return true;
    }
}


text:
package interfaces;

public class Square implements Shape{
	private double sides;

	public Square(double sides) {
		this.sides = sides;
	}
	public double area () {
		return sides*sides;
	}
	public double perimeter(){
		return 4 * sides;
	}

}


text:
<?php
use PayPal\Core\PPUtils;
/**
 * Test class for PPUtils.
 *
 */
class PPUtilsTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var PPUtils
     */
    protected $object;

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {
        $this->object = new PPUtils();
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {
    }

    /**
     * @test
     */
    public function testNvpToMap()
    {
       $arr = $this->object->nvpToMap('requestEnvelope.detailLevel=ReturnAll&requestEnvelope.errorLanguage=en_US&invoice.merchantEmail=jb-us-seller1@paypal.com&invoice.payerEmail=jbui-us-personal1@paypal.com&invoice.items[0].name=product1&invoice.items[0].quantity=10.0&invoice.items[0].unitPrice=1.2&invoice.currencyCode=USD&invoice.paymentTerms=DueOnReceipt');
       $this->assertArrayHasKey('requestEnvelope.detailLevel', $arr);
       $this->assertArrayHasKey('requestEnvelope.errorLanguage', $arr);
       $this->assertEquals(is_array($arr),true);
    }

    /**
     * @test
     */
    public function testArray_match_key()
    {
	$arr = array('key1' => 'somevalue', 'key2' => 'someothervalue');
	$this->assertEquals(true, PPUtils::array_match_key($arr, "key"));

		$arr = array('key1' => 'somevalue', 'key2' => 'someothervalue');
		$this->assertEquals(false, PPUtils::array_match_key($arr, "prefix"));

		$arr = unserialize('a:10:{s:26:"responseEnvelope.timestamp";s:35:"2011-04-19T04%3A32%3A29.469-07%3A00";s:20:"responseEnvelope.ack";s:7:"Failure";s:30:"responseEnvelope.correlationId";s:13:"c2514f258ddf1";s:22:"responseEnvelope.build";s:7:"1829457";s:16:"error(0).errorId";s:6:"580027";s:15:"error(0).domain";s:8:"PLATFORM";s:17:"error(0).severity";s:5:"Error";s:17:"error(0).category";s:11:"Application";s:16:"error(0).message";s:44:"Prohibited+request+parameter%3A+businessInfo";s:21:"error(0).parameter(0)";s:12:"businessInfo";}');
		$this->assertEquals(true, PPUtils::array_match_key($arr, "error(0)."));
    }

    /**
     * @test
     */
    public function testGetLocalIPAddress()
    {
        $ip = $this->object->getLocalIPAddress();
        $this->assertEquals($ip, filter_var($ip, FILTER_VALIDATE_IP));

        $_SERVER['SERVER_ADDR'] = '127.0.0.1';
        $ip = $this->object->getLocalIPAddress();
        $this->assertEquals($ip, filter_var($ip, FILTER_VALIDATE_IP));
    }

    /**
     * @test
     */
    public function testValidXmlToArray() {

    	$requestPayload = '<SetExpressCheckoutResponse xmlns="urn:ebay:api:PayPalAPI"><Timestamp xmlns="urn:ebay:apis:eBLBaseComponents">2013-07-23T05:51:03Z</Timestamp><Ack xmlns="urn:ebay:apis:eBLBaseComponents"><Nested>Success</Nested></Ack><CorrelationID xmlns="urn:ebay:apis:eBLBaseComponents">1cf4475882d05</CorrelationID><Version xmlns="urn:ebay:apis:eBLBaseComponents">94.0</Version><Build xmlns="urn:ebay:apis:eBLBaseComponents">6941909</Build><Token xsi:type="ebl:ExpressCheckoutTokenType" attrib="someValue">EC-6KT84265CE1992425</Token></SetExpressCheckoutResponse>';

    	$xml = '<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cc="urn:ebay:apis:CoreComponentTypes" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ed="urn:ebay:apis:EnhancedDataTypes" xmlns:ebl="urn:ebay:apis:eBLBaseComponents" xmlns:ns="urn:ebay:api:PayPalAPI">'
		. '<SOAP-ENV:Header><Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext" xsi:type="wsse:SecurityType"></Security><RequesterCredentials xmlns="urn:ebay:api:PayPalAPI" xsi:type="ebl:CustomSecurityHeaderType"><Credentials xmlns="urn:ebay:apis:eBLBaseComponents" xsi:type="ebl:UserIdPasswordType"><Username xsi:type="xs:string"></Username><Password xsi:type="xs:string"></Password><Signature xsi:type="xs:string"></Signature><Subject xsi:type="xs:string"></Subject></Credentials></RequesterCredentials></SOAP-ENV:Header>'
		. '<SOAP-ENV:Body id="_0">'
		. $requestPayload
		. '</SOAP-ENV:Body></SOAP-ENV:Envelope>';

    	$ret = PPUtils::xmlToArray($xml);

        $this->assertEquals("SetExpressCheckoutResponse", $ret[0]['name']);

        $ret = $ret[0]['children'];
    	$this->assertEquals(6, count($ret));

	// Token node
    	$this->assertFalse(array_key_exists('children', $ret[5]));
    	$this->assertEquals("Token", $ret[5]['name']);
    	$this->assertEquals("EC-6KT84265CE1992425", $ret[5]['text']);

    	$this->assertEquals(1, count($ret[5]['attributes']));
    	$k = key($ret[5]['attributes']);
    	$this->assertEquals("attrib", $k);
    	$this->assertEquals("someValue", $ret[5]['attributes'][$k]);

    	// Ack Node
    	$this->assertEquals("Ack", $ret[1]['name']);
    	$this->assertEquals(1, count($ret[1]['children']));
    	$this->assertEquals("Nested", $ret[1]['children'][0]['name']);
    	$this->assertEquals("Success", $ret[1]['children'][0]['text']);

    }

    /**
	 * @test
	 */
	 function testSoapFaultXml() {
		$xml = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header/><soapenv:Body> <soapenv:Fault xmlns:axis2ns237961="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>axis2ns237961:Server</faultcode><faultstring>Authentication failed. API credentials are incorrect.</faultstring><detail><ns3:FaultMessage xmlns:ns3="http://svcs.paypal.com/types/common" xmlns:ns2="http://svcs.paypal.com/types/ap"><responseEnvelope><timestamp>2013-09-03T04:36:14.931-07:00</timestamp><ack>Failure</ack><correlationId>ebeb480862a99</correlationId><build>6941298</build></responseEnvelope><error><errorId>520003</errorId><domain>PLATFORM</domain><subdomain>Application</subdomain><severity>Error</severity><category>Application</category><message>Authentication failed. API credentials are incorrect.</message></error></ns3:FaultMessage></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>';

		$ret = PPUtils::xmlToArray($xml);
		$this->assertEquals("soapenv:Fault", $ret[0]['name']);
	 }

    /**
     * @test
     */
    public function testGetProperties() {
    	$o = new MockReflectionTestType();
    	$ret = PPUtils::objectProperties($o);

    	//TODO: Check count
    	$this->assertEquals(6, count($ret), "Not all properties have been read");
    	$this->assertEquals('fieldWithSpecialChar', $ret['fieldwith-specialchar']);

    }

    /**
     * @test
     */
    public function testGetPropertyType() {

    	$this->assertEquals('string', PPUtils::propertyType('MockReflectionTestType', 'noAnnotations'));
    	$this->assertEquals('SomeType', PPUtils::propertyType('MockReflectionTestType', 'value'));

    	$this->assertEquals(true, PPUtils::isPropertyArray('MockReflectionTestType', 'arrayMember'));
    	$this->assertEquals(false, PPUtils::isPropertyArray('MockReflectionTestType', 'value'));
    }

    /**
     * @test
     */
    public function testGetAttributeType() {
    	$this->assertEquals(true, PPUtils::isAttributeProperty('MockReflectionTestType', 'currencyID'));
    	$this->assertEquals(false, PPUtils::isAttributeProperty('MockReflectionTestType', 'value'));
    	$this->assertEquals(false, PPUtils::isAttributeProperty('MockReflectionTestType', 'noAnnotations'));
    }
}

/**
 * @hasAttribute
 * On requests, you must set the currencyID attribute to one of
 * the three-character currency codes for any of the supported
 * PayPal currencies. Limitations: Must not exceed $10,000 USD
 * in any currency. No currency symbol. Decimal separator must
 * be a period (.), and the thousands separator must be a comma
 * (,).
 */
class MockReflectionTestType {

	/**
	 *
	 * @access public
	 * @namespace cc
	 * @attribute
	 * @var string
	 */
	public $currencyID;

	/**
	 *
	 * @access public
	 * @namespace cc
	 * @value
	 * @var SomeType
	 */
	public $value;

	/**
	 * @name fieldWith-SpecialChar
	 * @access public
	 * @var string
	 */
	public $fieldWithSpecialChar;

	/**
	 * @access public
	 * @array
	 * @var string
	 */
	public $arrayMember;

	/**
	 *
	 */
	public $noAnnotations;

}
?>


text:
<?php

/**
 * BaseDmGroup
 *
 * This class has been auto-generated by the Doctrine ORM Framework
 *
 * @property string $name
 * @property string $description
 * @property Doctrine_Collection $Users
 * @property Doctrine_Collection $Permissions
 * @property Doctrine_Collection $DmGroupPermission
 * @property Doctrine_Collection $DmUserGroup
 *
 * @method string              getName()              Returns the current record's "name" value
 * @method string              getDescription()       Returns the current record's "description" value
 * @method Doctrine_Collection getUsers()             Returns the current record's "Users" collection
 * @method Doctrine_Collection getPermissions()       Returns the current record's "Permissions" collection
 * @method Doctrine_Collection getDmGroupPermission() Returns the current record's "DmGroupPermission" collection
 * @method Doctrine_Collection getDmUserGroup()       Returns the current record's "DmUserGroup" collection
 * @method DmGroup             setName()              Sets the current record's "name" value
 * @method DmGroup             setDescription()       Sets the current record's "description" value
 * @method DmGroup             setUsers()             Sets the current record's "Users" collection
 * @method DmGroup             setPermissions()       Sets the current record's "Permissions" collection
 * @method DmGroup             setDmGroupPermission() Sets the current record's "DmGroupPermission" collection
 * @method DmGroup             setDmUserGroup()       Sets the current record's "DmUserGroup" collection
 *
 * @package    retest
 * @subpackage model
 * @author     Your name here
 * @version    SVN: $Id: Builder.php 7490 2010-03-29 19:53:27Z jwage $
 */
abstract class BaseDmGroup extends myDoctrineRecord
{
    public function setTableDefinition()
    {
        $this->setTableName('dm_group');
        $this->hasColumn('name', 'string', 255, array(
             'type' => 'string',
             'unique' => true,
             'length' => 255,
             ));
        $this->hasColumn('description', 'string', 1000, array(
             'type' => 'string',
             'length' => 1000,
             ));
    }

    public function setUp()
    {
        parent::setUp();
        $this->hasMany('DmUser as Users', array(
             'refClass' => 'DmUserGroup',
             'local' => 'dm_group_id',
             'foreign' => 'dm_user_id'));

        $this->hasMany('DmPermission as Permissions', array(
             'refClass' => 'DmGroupPermission',
             'local' => 'dm_group_id',
             'foreign' => 'dm_permission_id'));

        $this->hasMany('DmGroupPermission', array(
             'local' => 'id',
             'foreign' => 'dm_group_id'));

        $this->hasMany('DmUserGroup', array(
             'local' => 'id',
             'foreign' => 'dm_group_id'));

        $timestampable0 = new Doctrine_Template_Timestampable(array(
             ));
        $this->actAs($timestampable0);
    }
}


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">
        <link rel="shortcut icon" type="image/png" href="/img/favicon.png"/>
        <title>Talks | Des Moines Front-End</title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
        <link href="/css/style.css?v=2" rel="stylesheet">

        <meta name="description" content="A collection of talks from our past meetups.">
        <meta name="author" content="Kyle Brumm">

        <meta property="og:type" content="website">
        <meta property="og:title" content="Talks | Des Moines Front-End">
        <meta property="og:description" content="A collection of talks from our past meetups.">
        <meta property="og:url" content="/">
        <meta property="og:image" content="/img/dsmfe-logo.png"/>

        <meta name="twitter:card" content="summary_large_image">
        <meta name="twitter:title" content="Talks | Des Moines Front-End">
        <meta name="twitter:description" content="A collection of talks from our past meetups.">
        <meta name="twitter:url" content="/">
        <meta name="twitter:image" content="/img/dsmfe-logo.png"/>

                        Des Moines
                        Front-End
                        Talks

                    A collection of talks from our past meetups.

May 17, 2017

                        Joel Leibow: Scaling UI for Enterprise (Co-hosted with Experiencing UX)

                            Working with enterprise software poses a unique challenge: scale. Joel Leibow will speak on the role of component frameworks in developing software for enterprise. He will detail how UI Platform team (UIP) has scaled Web Skin — Workiva's living style guide — for enterprise use, and how the Dart language and React are used to build accessible UI components.

March 6, 2017

                        Shelly Berkoski: Print Designer's Guide to Building a Website

                            By day, Shelly Berkoski is an Art Director at Meyocks. But after hours, she is the creative mind behind Shell Yeah! – Shelly's own mini brand focused on making quirky, graphic apparel that promotes positivity, self-acceptance, and fun. From setting up an online storefront to overcoming your inner critic, Shelly will dig into both the technical and mental sides of building your own brand and online presence. She will share steps, resources, and tips that can help make web design possible for the print designer.

                        View Slides

February 6, 2017

                        Ryan Young: Getting Started with SVG

                            Scalable Vector Graphics (SVG) are a dream for web designers and developers alike. And now, thanks to the latest level of browser support, it's super easy to implement in many ways. So what exactly is SVG and how can you use it in projects today? Ryan Young will walk you through the basics in this month's presentation.

                        View Slides

January 4, 2017

                        Shawn Reisner: CSS Grid 101

                            CSS Grid is a two-dimensional grid-based layout system that aims to do nothing less than completely change the way we design grid-based user interfaces. Together we'll talk about the basics of building grid layouts using native CSS!

                        View Slides

                        We meet the first Monday of every month.

                        Browse our past talks.

                        Interested in giving a talk? Fill out this form and we will be in touch.


text:
local format = string.format
local execute = os.execute
local open = io.open
local popen = io.popen
local insert = table.insert

local cache = {}

-- add a function to get a list of keys
-- what about a protocol so that we can have caches with a backend other than the file system?
-- (then what about Lua FUSE?)

function cache.new(path, keytransform)
   assert(type(path) == 'string' and #path > 0, 'path must be a non-empty string')
   assert(type(keytransform) == 'nil' or type(keytransform) == 'function', 'keytransform must be a function')

   local c = { }

   _,_,rc = execute('test -d ' .. path)
   if rc == 1 then execute('mkdir -p ' .. path) end

   c.keytransform = keytransform or function(k) return k end
   c.key = function(k)
      local kprime = c.keytransform(k)
      if not kprime then return nil end
      return format('%s/%s', path, kprime)
   end

   c.get = function(k, generate)
      local data = nil
      local key = c.key(k)
      if not key then error('invalid key: ' .. tostring(k)) end

      local fd = open(key, "rb")
      if fd then data = fd:read("*all") ; fd:close() end
      if not data and type(generate) == "function" then
         data = generate(k)
         c.set(k, data)
      end
      return data
   end

   c.set = function(k, v)
      local key = c.key(k)
      if not key then error('invalid key: ' .. tostring(k)) end

      local fd = open(key, "wb")
      fd:write(v)
      fd:close()
   end

   c.remove = function(k)
      local key = c.key(k)
      _,_,rc = execute('/bin/rm -f ' .. key)
      return rc
   end

   c.keys = function()
      local results = {}
      local p = popen('ls -1 ' .. path, 'r')
      for f in p:lines() do
         insert(results, f)
      end
      p:close()
      return results
   end

   setmetatable(c, {
                   __tostring = function() return "cache[" .. path .. "]" end,
                   })
   return c
end

return cache


text:
package org.apache.cassandra.service;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import org.junit.Test;

import org.apache.cassandra.io.sstable.Descriptor;
import org.apache.cassandra.io.sstable.SequenceBasedSSTableId;
import org.apache.cassandra.io.sstable.format.SSTableFormat;
import org.apache.cassandra.io.sstable.format.VersionAndType;
import org.apache.cassandra.io.util.File;
import org.assertj.core.util.Files;
import org.quicktheories.core.Gen;
import org.quicktheories.generators.Generate;

import static org.junit.Assert.assertEquals;
import static org.quicktheories.QuickTheory.qt;
import static org.quicktheories.generators.SourceDSL.integers;
import static org.quicktheories.generators.SourceDSL.lists;
import static org.quicktheories.generators.SourceDSL.strings;

public class SSTablesGlobalTrackerTest
{
    private static final int MAX_VERSION_LIST_SIZE = 10;
    private static final int MAX_UPDATES_PER_GEN = 100;

    /**
     * Ensures that the tracker properly maintains the set of versions in use.
     *
     * <p>Using 'Quick Theories', we generate a number of random sstables notification and validate that after each
     * update the tracker computes the proper set of versions in use (using a simplisitic model that keeps the set
     * of all sstables in use and maps it to the set of its versions).
     */
    @Test
    public void testUpdates()
    {
        qt().forAll(lists().of(updates()).ofSizeBetween(0, MAX_UPDATES_PER_GEN),
                    sstableFormatTypes())
            .checkAssert((updates, formatType) -> {
                SSTablesGlobalTracker tracker = new SSTablesGlobalTracker(formatType);
                Set<Descriptor> all = new HashSet<>();
                Set<VersionAndType> previous = Collections.emptySet();
                for (Update update : updates)
                {
                    update.applyTo(all);
                    boolean triggerUpdate = tracker.handleSSTablesChange(update.removed, update.added);
                    Set<VersionAndType> expectedInUse = versionAndTypes(all);
                    assertEquals(expectedInUse, tracker.versionsInUse());
                    assertEquals(!expectedInUse.equals(previous), triggerUpdate);
                    previous = expectedInUse;
                }
            });
    }

    private Set<VersionAndType> versionAndTypes(Set<Descriptor> descriptors)
    {
        return descriptors.stream().map(SSTablesGlobalTracker::version).collect(Collectors.toSet());
    }

    private Gen<String> keyspaces()
    {
        return Generate.pick(Arrays.asList("k1", "k2"));
    }

    private Gen<String> tables()
    {
        return Generate.pick(Arrays.asList("t1", "t2", "t3"));
    }

    private Gen<Integer> generations()
    {
        return integers().between(1, 20);
    }

    private Gen<Descriptor> descriptors()
    {
        return sstableFormatTypes().zip(keyspaces(),
                                        tables(),
                                        generations(),
                                        sstableVersionString(),
                                        (f, k, t, g, v) -> new Descriptor(v, new File(Files.currentFolder()), k, t, new SequenceBasedSSTableId(g), f));
    }

    private Gen<List<Descriptor>> descriptorLists(int minSize)
    {
        return lists().of(descriptors()).ofSizeBetween(minSize, MAX_VERSION_LIST_SIZE);
    }

    private Gen<SSTableFormat.Type> sstableFormatTypes()
    {
        return Generate.enumValues(SSTableFormat.Type.class);
    }

    private Gen<String> sstableVersionString()
    {
        // We want to somewhat favor the current version, as that is technically more realistic so we generate it 50%
        // of the time, and generate something random 50% of the time.
        return Generate.constant(SSTableFormat.Type.current().info.getLatestVersion().getVersion())
                       .mix(strings().betweenCodePoints('a', 'z').ofLength(2));
    }

    private Gen<Update> updates()
    {
        // We want to avoid update that remove and add nothing, as those appear to be generated quite a bit are not
        // too useful. Yet, having one of removed/added be empty is actually something we want.
        Gen<Update> maybeEmptyRemoved = descriptorLists(0).zip(descriptorLists(1), Update::new);
        Gen<Update> maybeEmptyAdded = descriptorLists(1).zip(descriptorLists(0), Update::new);
        return maybeEmptyRemoved.mix(maybeEmptyAdded);
    }

    private static class Update
    {
        final List<Descriptor> removed;
        final List<Descriptor> added;

        Update(List<Descriptor> removed, List<Descriptor> added)
        {
            this.removed = removed;
            this.added = added;
        }

        void applyTo(Set<Descriptor> allSSTables)
        {
            allSSTables.removeAll(removed);
            allSSTables.addAll(added);
        }

        @Override
        public String toString()
        {
            return "Update{" +
                   "removed=" + removed +
                   ", added=" + added +
                   '}';
        }
    }
}


text:
package org.apache.hive.beeline.logs;

import org.apache.hadoop.hive.common.log.InPlaceUpdate;
import org.apache.hadoop.hive.common.log.ProgressMonitor;
import org.apache.hive.jdbc.logs.InPlaceUpdateStream;
import org.apache.hive.service.rpc.thrift.TJobExecutionStatus;
import org.apache.hive.service.rpc.thrift.TProgressUpdateResp;

import java.io.PrintStream;
import java.util.List;

public class BeelineInPlaceUpdateStream implements InPlaceUpdateStream {
  private InPlaceUpdate inPlaceUpdate;
  private EventNotifier notifier;

  public BeelineInPlaceUpdateStream(PrintStream out, InPlaceUpdateStream.EventNotifier notifier) {
    this.inPlaceUpdate = new InPlaceUpdate(out);
    this.notifier = notifier;
  }

  @Override
  public void update(TProgressUpdateResp response) {
    if (response == null || response.getStatus().equals(TJobExecutionStatus.NOT_AVAILABLE)) {
      /*
        we set it to completed if there is nothing the server has to report
        for example, DDL statements
      */
      notifier.progressBarCompleted();
    } else if (notifier.isOperationLogUpdatedAtLeastOnce()) {
      /*
        try to render in place update progress bar only if the operations logs is update at least once
        as this will hopefully allow printing the metadata information like query id, application id
        etc. have to remove these notifiers when the operation logs get merged into GetOperationStatus
      */
      inPlaceUpdate.render(new ProgressMonitorWrapper(response));
    }
  }

  @Override
  public EventNotifier getEventNotifier() {
    return notifier;
  }

  static class ProgressMonitorWrapper implements ProgressMonitor {
    private TProgressUpdateResp response;

    ProgressMonitorWrapper(TProgressUpdateResp response) {
      this.response = response;
    }

    @Override
    public List<String> headers() {
      return response.getHeaderNames();
    }

    @Override
    public List<List<String>> rows() {
      return response.getRows();
    }

    @Override
    public String footerSummary() {
      return response.getFooterSummary();
    }

    @Override
    public long startTime() {
      return response.getStartTime();
    }

    @Override
    public String executionStatus() {
      throw new UnsupportedOperationException(
          "This should never be used for anything. All the required data is available via other methods"
      );
    }

    @Override
    public double progressedPercentage() {
      return response.getProgressedPercentage();
    }
  }
}


text:
#include "nc4internal.h"
#include "nc4dispatch.h"

/**
 * @internal Get the format (i.e. NC_FORMAT_NETCDF4 pr
 * NC_FORMAT_NETCDF4_CLASSIC) of an open netCDF-4 file.
 *
 * @param ncid File ID (ignored).
 * @param formatp Pointer that gets the constant indicating format.

 * @return ::NC_NOERR No error.
 * @return ::NC_EBADID Bad ncid.
 * @author Ed Hartnett
 */
int
NC4_inq_format(int ncid, int *formatp)
{
    NC_FILE_INFO_T *nc4_info;
    int retval;

    LOG((2, "nc_inq_format: ncid 0x%x", ncid));

    if (!formatp)
        return NC_NOERR;

    /* Find the file metadata. */
    if ((retval = nc4_find_nc_grp_h5(ncid, NULL, NULL, &nc4_info)))
        return retval;

    /* Check if classic NC3 rules are in effect for this file. */
    if (nc4_info->cmode & NC_CLASSIC_MODEL)
        *formatp = NC_FORMAT_NETCDF4_CLASSIC;
    else
        *formatp = NC_FORMAT_NETCDF4;

    return NC_NOERR;
}

/**
 * @internal Return the extended format (i.e. the dispatch model),
 * plus the mode associated with an open file.
 *
 * @param ncid File ID (ignored).
 * @param formatp a pointer that gets the extended format. Note that
 * this is not the same as the format provided by nc_inq_format(). The
 * extended format indicates the dispatch layer model. NetCDF-4 files
 * will always get NC_FORMATX_NC4.
 * @param modep a pointer that gets the open/create mode associated with
 * this file. Ignored if NULL.

 * @return ::NC_NOERR No error.
 * @return ::NC_EBADID Bad ncid.
 * @author Dennis Heimbigner
 */
int
NC4_inq_format_extended(int ncid, int *formatp, int *modep)
{
    NC *nc;
    int retval;

    LOG((2, "%s: ncid 0x%x", __func__, ncid));

    if ((retval = nc4_find_nc_grp_h5(ncid, &nc, NULL, NULL)))
        return NC_EBADID;

    if(modep)
        *modep = nc->mode|NC_NETCDF4;

    if (formatp)
        *formatp = NC_FORMATX_NC_HDF5;

    return NC_NOERR;
}


text:
package auth_test

import (
	"github.com/control-center/serviced/auth"
	jwt "github.com/dgrijalva/jwt-go"
	. "gopkg.in/check.v1"
	"time"
)

func (s *TestAuthSuite) TestHostExpired(c *C) {
	reg := auth.NewHostExpirationRegistry()
	hostid := "fakehost"
	expires := jwt.TimeFunc().Add(time.Minute).Unix()
	reg.Set(hostid, expires)

	hasExpired, _ := reg.IsExpired(hostid)
	c.Assert(hasExpired, Equals, false)
}

func (s *TestAuthSuite) TestNonexistentHostExpired(c *C) {
	reg := auth.NewHostExpirationRegistry()
	hasExpired, err := reg.IsExpired("unicorn")
	c.Assert(err, Equals, auth.ErrMissingHost)
	c.Assert(hasExpired, Equals, true)
}

func (s *TestAuthSuite) TestHostRemove(c *C) {
	reg := auth.NewHostExpirationRegistry()
	hostid := "fakehost"
	expires := jwt.TimeFunc().Add(time.Minute).Unix()
	reg.Set(hostid, expires)

	hasExpired, _ := reg.IsExpired(hostid)
	c.Assert(hasExpired, Equals, false)

	reg.Remove(hostid)
	hasExpired, err := reg.IsExpired(hostid)

	c.Assert(err, Equals, auth.ErrMissingHost)
	c.Assert(hasExpired, Equals, true)
}

func (s *TestAuthSuite) TestHostExpiredExpires(c *C) {
	reg := auth.NewHostExpirationRegistry()
	hostid := "fakehost"
	expires := jwt.TimeFunc().Add(time.Second).Unix()
	reg.Set(hostid, expires)

	fakenow := jwt.TimeFunc().Add(time.Minute)
	auth.At(fakenow, func() {
		hasExpired, _ := reg.IsExpired(hostid)
		c.Assert(hasExpired, Equals, true)
	})
}


text:
package checkers

import (
	"go/ast"

	"github.com/go-lintpack/lintpack"
	"github.com/go-lintpack/lintpack/astwalk"
)

func init() {
	var info lintpack.CheckerInfo
	info.Name = "defaultCaseOrder"
	info.Tags = []string{"style"}
	info.Summary = "Detects when default case in switch isn't on 1st or last position"
	info.Before = `
switch {
case x > y:
	// ...
default: // <- not the best position
	// ...
case x == 10:
	// ...
}`
	info.After = `
switch {
case x > y:
	// ...
case x == 10:
	// ...
default: // <- last case (could also be the first one)
	// ...
}`

	collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker {
		return astwalk.WalkerForStmt(&defaultCaseOrderChecker{ctx: ctx})
	})
}

type defaultCaseOrderChecker struct {
	astwalk.WalkHandler
	ctx *lintpack.CheckerContext
}

func (c *defaultCaseOrderChecker) VisitStmt(stmt ast.Stmt) {
	swtch, ok := stmt.(*ast.SwitchStmt)
	if !ok {
		return
	}
	for i, stmt := range swtch.Body.List {
		caseStmt, ok := stmt.(*ast.CaseClause)
		if !ok {
			continue
		}
		// is `default` case
		if caseStmt.List == nil {
			if i != 0 && i != len(swtch.Body.List)-1 {
				c.warn(caseStmt)
			}
		}
	}
}

func (c *defaultCaseOrderChecker) warn(cause *ast.CaseClause) {
	c.ctx.Warn(cause, "consider to make `default` case as first or as last case")
}