text:
Client library for Wedpax

## Installation and Usage
```bash
npm install --save @datafire/wedpax
```
```js
let wedpax = require('@datafire/wedpax').create({
  bearerAuth: ""
});

.then(data => {
  console.log(data);
});
```

## Description

## Actions

### api.ServiceQuery.Get.get

```js
wedpax.api.ServiceQuery.Get.get({}, context)
```

#### Input
* input `object`
  * CurrentPage `integer`
  * PageSize `integer`
  * Sorting.PropertyName `string`
  * Sorting.OrderByDescending `boolean`

#### Output
* output [PagedResultDto[WeddingVendorDto]](#pagedresultdto[weddingvendordto])

### Search

```js
wedpax.Search({}, context)
```

#### Input
* input `object`
  * City `string`
  * CatgoryId `integer`
  * PageNumber `integer`

#### Output
* output `array`
  * items [ServiceListModel](#servicelistmodel)

### UserService

```js
wedpax.UserService({}, context)
```

#### Input
* input `object`
  * serviceId `integer`

#### Output
* output [UpdateWeddingVendorDto](#updateweddingvendordto)

### UserServices

```js
wedpax.UserServices({}, context)
```

#### Input
* input `object`
  * userId `integer`

#### Output
* output `array`
  * items [UserServicesDto](#userservicesdto)

### Authenticate

```js
wedpax.Authenticate({}, context)
```

#### Input
* input `object`
  * model [AuthenticateModel](#authenticatemodel)

#### Output
* output [AuthenticateResultModel](#authenticateresultmodel)

### ExternalAuthenticate

```js
wedpax.ExternalAuthenticate({}, context)
```

#### Input
* input `object`
  * model [ExternalAuthenticateModel](#externalauthenticatemodel)

#### Output
* output [ExternalAuthenticateResultModel](#externalauthenticateresultmodel)

### GetExternalAuthenticationProviders

```js
wedpax.GetExternalAuthenticationProviders(null, context)
```

#### Input
*This action has no parameters*

#### Output
* output `array`
  * items [ExternalLoginProviderInfoModel](#externalloginproviderinfomodel)

### Login

```js
wedpax.Login({}, context)
```

#### Input
* input `object`
  * model [LoginModel](#loginmodel)

#### Output
* output [AuthenticateResultModel](#authenticateresultmodel)

### RefreshToken

```js
wedpax.RefreshToken({}, context)
```

#### Input
* input `object`
  * userName `string`

#### Output
* output [AuthenticateResultModel](#authenticateresultmodel)

### IsTenantAvailable

```js
wedpax.IsTenantAvailable({}, context)
```

#### Input
* input `object`
  * input [IsTenantAvailableInput](#istenantavailableinput)

#### Output
* output [IsTenantAvailableOutput](#istenantavailableoutput)

### Register

```js
wedpax.Register({}, context)
```

#### Input
* input `object`
  * input [RegisterInput](#registerinput)

#### Output
* output [RegisterOutput](#registeroutput)

### api.services.app.AddressServices.Create.post

```js
wedpax.api.services.app.AddressServices.Create.post({}, context)
```

#### Input
* input `object`
  * input [GeoDetailsCreateDto](#geodetailscreatedto)

#### Output
* output [GeoDetailsDto](#geodetailsdto)

### api.services.app.AddressServices.Delete.delete

```js
wedpax.api.services.app.AddressServices.Delete.delete({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
*Output schema unknown*

### api.services.app.AddressServices.Get.get

```js
wedpax.api.services.app.AddressServices.Get.get({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
* output [GeoDetailsDto](#geodetailsdto)

### api.services.app.AddressServices.GetAll.get

```js
wedpax.api.services.app.AddressServices.GetAll.get({}, context)
```

#### Input
* input `object`
  * Sorting `string`
  * SkipCount `integer`
  * MaxResultCount `integer`

#### Output
* output [PagedResultDto[GeoDetailsDto]](#pagedresultdto[geodetailsdto])

### GetCities

```js
wedpax.GetCities({}, context)
```

#### Input
* input `object`
  * provinceId `integer`

#### Output
* output `array`
  * items [CityDto](#citydto)

### GetProvince

```js
wedpax.GetProvince(null, context)
```

#### Input
*This action has no parameters*

#### Output
* output `array`
  * items [ProvinceDto](#provincedto)

### api.services.app.AddressServices.Update.put

```js
wedpax.api.services.app.AddressServices.Update.put({}, context)
```

#### Input
* input `object`
  * input [GeoDetailsUpdateDto](#geodetailsupdatedto)

#### Output
* output [GeoDetailsDto](#geodetailsdto)

### api.services.app.CategoryService.Create.post

```js
wedpax.api.services.app.CategoryService.Create.post({}, context)
```

#### Input
* input `object`
  * categoryDto [ServiceCategroyCreateDto](#servicecategroycreatedto)

#### Output
* output [ServiceCategoryDto](#servicecategorydto)

### api.services.app.CategoryService.Delete.delete

```js
wedpax.api.services.app.CategoryService.Delete.delete({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
*Output schema unknown*

### api.services.app.CategoryService.Get.get

```js
wedpax.api.services.app.CategoryService.Get.get({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
* output [ServiceCategoryDto](#servicecategorydto)

### api.services.app.CategoryService.GetAll.get

```js
wedpax.api.services.app.CategoryService.GetAll.get({}, context)
```

#### Input
* input `object`
  * TotalCount `integer`
  * Items `array`

#### Output
* output [PagedResultDto[ServiceCategoryDto]](#pagedresultdto[servicecategorydto])

### GetById

```js
wedpax.GetById({}, context)
```

#### Input
* input `object`
  * id `integer`

#### Output
* output [ServiceCategory](#servicecategory)

### GetByName

```js
wedpax.GetByName({}, context)
```

#### Input
* input `object`
  * title `string`

#### Output
* output [ServiceCategoryDto](#servicecategorydto)

### GetCategories

```js
wedpax.GetCategories(null, context)
```

#### Input
*This action has no parameters*

#### Output
* output `array`
  * items [ServiceCategoryDto](#servicecategorydto)

### api.services.app.CategoryService.Update.put

```js
wedpax.api.services.app.CategoryService.Update.put({}, context)
```

#### Input
* input `object`
  * input [ServiceCategoryUpdateDto](#servicecategoryupdatedto)

#### Output
* output [ServiceCategoryDto](#servicecategorydto)

### ChangeUiTheme

```js
wedpax.ChangeUiTheme({}, context)
```

#### Input
* input `object`
  * input [ChangeUiThemeInput](#changeuithemeinput)

#### Output
*Output schema unknown*

### api.services.app.Role.Create.post

```js
wedpax.api.services.app.Role.Create.post({}, context)
```

#### Input
* input `object`
  * input [CreateRoleDto](#createroledto)

#### Output
* output [RoleDto](#roledto)

### api.services.app.Role.Delete.delete

```js
wedpax.api.services.app.Role.Delete.delete({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
*Output schema unknown*

### api.services.app.Role.Get.get

```js
wedpax.api.services.app.Role.Get.get({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
* output [RoleDto](#roledto)

### api.services.app.Role.GetAll.get

```js
wedpax.api.services.app.Role.GetAll.get({}, context)
```

#### Input
* input `object`
  * Keyword `string`
  * SkipCount `integer`
  * MaxResultCount `integer`

#### Output
* output [PagedResultDto[RoleDto]](#pagedresultdto[roledto])

### GetAllPermissions

```js
wedpax.GetAllPermissions(null, context)
```

#### Input
*This action has no parameters*

#### Output
* output [ListResultDto[PermissionDto]](#listresultdto[permissiondto])

### GetRoleForEdit

```js
wedpax.GetRoleForEdit({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
* output [GetRoleForEditOutput](#getroleforeditoutput)

### GetRolesAsync

```js
wedpax.GetRolesAsync({}, context)
```

#### Input
* input `object`
  * Permission `string`

#### Output
* output [ListResultDto[RoleListDto]](#listresultdto[rolelistdto])

### api.services.app.Role.Update.put

```js
wedpax.api.services.app.Role.Update.put({}, context)
```

#### Input
* input `object`
  * input [RoleDto](#roledto)

#### Output
* output [RoleDto](#roledto)

### api.services.app.ServiceFacilityService.Create.post

```js
wedpax.api.services.app.ServiceFacilityService.Create.post({}, context)
```

#### Input
* input `object`
  * input [ServiceFacilityCreateDto](#servicefacilitycreatedto)

#### Output
* output [ServiceFacilityDto](#servicefacilitydto)

### api.services.app.ServiceFacilityService.Delete.delete

```js
wedpax.api.services.app.ServiceFacilityService.Delete.delete({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
*Output schema unknown*

### api.services.app.ServiceFacilityService.Get.get

```js
wedpax.api.services.app.ServiceFacilityService.Get.get({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
* output [ServiceFacilityDto](#servicefacilitydto)

### api.services.app.ServiceFacilityService.GetAll.get

```js
wedpax.api.services.app.ServiceFacilityService.GetAll.get({}, context)
```

#### Input
* input `object`
  * input `array`

#### Output
* output [PagedResultDto[ServiceFacilityDto]](#pagedresultdto[servicefacilitydto])

### GetFacilities

```js
wedpax.GetFacilities(null, context)
```

#### Input
*This action has no parameters*

#### Output
* output `array`
  * items [ServiceFacilityDto](#servicefacilitydto)

### GetServiceFacility

```js
wedpax.GetServiceFacility({}, context)
```

#### Input
* input `object`
  * facilities `array`

#### Output
* output `array`
  * items [ServiceFacilityDto](#servicefacilitydto)

### api.services.app.ServiceFacilityService.Update.put

```js
wedpax.api.services.app.ServiceFacilityService.Update.put({}, context)
```

#### Input
* input `object`
  * input [ServiceFacilityUpdateDto](#servicefacilityupdatedto)

#### Output
* output [ServiceFacilityDto](#servicefacilitydto)

### GetCurrentLoginInformations

```js
wedpax.GetCurrentLoginInformations(null, context)
```

#### Input
*This action has no parameters*

#### Output
* output [GetCurrentLoginInformationsOutput](#getcurrentlogininformationsoutput)

### api.services.app.Tenant.Create.post

```js
wedpax.api.services.app.Tenant.Create.post({}, context)
```

#### Input
* input `object`
  * input [CreateTenantDto](#createtenantdto)

#### Output
* output [TenantDto](#tenantdto)

### api.services.app.Tenant.Delete.delete

```js
wedpax.api.services.app.Tenant.Delete.delete({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
*Output schema unknown*

### api.services.app.Tenant.Get.get

```js
wedpax.api.services.app.Tenant.Get.get({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
* output [TenantDto](#tenantdto)

### api.services.app.Tenant.GetAll.get

```js
wedpax.api.services.app.Tenant.GetAll.get({}, context)
```

#### Input
* input `object`
  * Keyword `string`
  * IsActive `boolean`
  * SkipCount `integer`
  * MaxResultCount `integer`

#### Output
* output [PagedResultDto[TenantDto]](#pagedresultdto[tenantdto])

### api.services.app.Tenant.Update.put

```js
wedpax.api.services.app.Tenant.Update.put({}, context)
```

#### Input
* input `object`
  * input [TenantDto](#tenantdto)

#### Output
* output [TenantDto](#tenantdto)

### AddManagerToUserRoles

```js
wedpax.AddManagerToUserRoles({}, context)
```

#### Input
* input `object`
  * user [User](#user)

#### Output
*Output schema unknown*

### ChangeLanguage

```js
wedpax.ChangeLanguage({}, context)
```

#### Input
* input `object`
  * input [ChangeUserLanguageDto](#changeuserlanguagedto)

#### Output
*Output schema unknown*

### ChangePassword

```js
wedpax.ChangePassword({}, context)
```

#### Input
* input `object`
  * input [ChangePasswordDto](#changepassworddto)

#### Output
* output `boolean`

### ConfrimCode

```js
wedpax.ConfrimCode({}, context)
```

#### Input
* input `object`
  * input [ConfirmCodeDto](#confirmcodedto)

#### Output
*Output schema unknown*

### api.services.app.User.Create.post

```js
wedpax.api.services.app.User.Create.post({}, context)
```

#### Input
* input `object`
  * input [CreateUserDto](#createuserdto)

#### Output
* output [UserDto](#userdto)

### api.services.app.User.Delete.delete

```js
wedpax.api.services.app.User.Delete.delete({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
*Output schema unknown*

### api.services.app.User.Get.get

```js
wedpax.api.services.app.User.Get.get({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
* output [UserDto](#userdto)

### api.services.app.User.GetAll.get

```js
wedpax.api.services.app.User.GetAll.get({}, context)
```

#### Input
* input `object`
  * Keyword `string`
  * IsActive `boolean`
  * SkipCount `integer`
  * MaxResultCount `integer`

#### Output
* output [PagedResultDto[UserDto]](#pagedresultdto[userdto])

### GetRoles

```js
wedpax.GetRoles(null, context)
```

#### Input
*This action has no parameters*

#### Output
* output [ListResultDto[RoleDto]](#listresultdto[roledto])

### GetToEntity

```js
wedpax.GetToEntity({}, context)
```

#### Input
* input `object`
  * userId `integer`

#### Output
* output [User](#user)

### ProhibitPermission

```js
wedpax.ProhibitPermission({}, context)
```

#### Input
* input `object`
  * input [ProhibitPermissionInput](#prohibitpermissioninput)

#### Output
*Output schema unknown*

### ResetPassword

```js
wedpax.ResetPassword({}, context)
```

#### Input
* input `object`
  * input [ResetPasswordDto](#resetpassworddto)

#### Output
* output `boolean`

### api.services.app.User.Update.put

```js
wedpax.api.services.app.User.Update.put({}, context)
```

#### Input
* input `object`
  * input [UserDto](#userdto)

#### Output
* output [UserDto](#userdto)

### api.services.app.WeddingVendorServices.Create.post

```js
wedpax.api.services.app.WeddingVendorServices.Create.post({}, context)
```

#### Input
* input `object`
  * model [CreateWeddingVendorDto](#createweddingvendordto)

#### Output
* output [WeddingVendorDto](#weddingvendordto)

### api.services.app.WeddingVendorServices.Delete.delete

```js
wedpax.api.services.app.WeddingVendorServices.Delete.delete({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
*Output schema unknown*

### api.services.app.WeddingVendorServices.Get.get

```js
wedpax.api.services.app.WeddingVendorServices.Get.get({}, context)
```

#### Input
* input `object`
  * Id `integer`

#### Output
* output [WeddingVendorDto](#weddingvendordto)

### api.services.app.WeddingVendorServices.GetAll.get

```js
wedpax.api.services.app.WeddingVendorServices.GetAll.get({}, context)
```

#### Input
* input `object`
  * Sorting `string`
  * SkipCount `integer`
  * MaxResultCount `integer`

#### Output
* output [PagedResultDto[WeddingVendorDto]](#pagedresultdto[weddingvendordto])

### api.services.app.WeddingVendorServices.Update.put

```js
wedpax.api.services.app.WeddingVendorServices.Update.put({}, context)
```

#### Input
* input `object`
  * model [UpdateWeddingVendorDto](#updateweddingvendordto)

#### Output
* output [WeddingVendorDto](#weddingvendordto)

## Definitions

### ApplicationInfoDto
* ApplicationInfoDto `object`
  * features `object`
  * releaseDate `string`
  * version `string`

### AuthenticateModel
* AuthenticateModel `object`
  * password **required** `string`
  * rememberClient `boolean`
  * userNameOrEmailAddress **required** `string`

### AuthenticateResultModel
* AuthenticateResultModel `object`
  * accessToken `string`
  * encryptedAccessToken `string`
  * expireInSeconds `integer`
  * roles `array`
    * items `string`
  * userId `integer`

### BaseServices
* BaseServices `object`
  * capacity `integer`
  * category **required** [ServiceCategory](#servicecategory)
  * categoryId **required** `integer`
  * creationTime `string`
  * description **required** `string`
  * geoDetails [GeoDetails](#geodetails)
  * id `integer`
  * images **required** `array`
    * items [ServiceImages](#serviceimages)
  * mainImage `string`
  * phone `string`
  * status `boolean`
  * title `string`
  * user **required** [User](#user)

### ChangePasswordDto
* ChangePasswordDto `object`
  * currentPassword **required** `string`
  * newPassword **required** `string`

### ChangeUiThemeInput
* ChangeUiThemeInput `object`
  * theme **required** `string`

### ChangeUserLanguageDto
* ChangeUserLanguageDto `object`
  * languageName **required** `string`

### CityDto
* CityDto `object`
  * id `integer`
  * title `string`

### ConfirmCodeDto
* ConfirmCodeDto `object`
  * code **required** `integer`
  * userName **required** `string`

### CreateRoleDto
* CreateRoleDto `object`
  * description `string`
  * displayName **required** `string`
  * grantedPermissions `array`
    * items `string`
  * name **required** `string`
  * normalizedName `string`

### CreateTenantDto
* CreateTenantDto `object`
  * adminEmailAddress **required** `string`
  * connectionString `string`
  * isActive `boolean`
  * name **required** `string`
  * tenancyName **required** `string`

### CreateUserDto
* CreateUserDto `object`
  * userName **required** `string`

### CreateWeddingVendorDto
* CreateWeddingVendorDto `object`
  * base64Images `array`
    * items [ImageData](#imagedata)
  * capacity `integer`
  * categoryId **required** `integer`
  * description **required** `string`
  * lat `number`
  * lng `number`
  * mainImage `string`
  * phone `string`
  * serviceFacilities `array`
    * items `integer`
  * title **required** `string`
  * userId `integer`

### ExternalAuthenticateModel
* ExternalAuthenticateModel `object`
  * authProvider **required** `string`
  * providerAccessCode **required** `string`
  * providerKey **required** `string`

### ExternalAuthenticateResultModel
* ExternalAuthenticateResultModel `object`
  * accessToken `string`
  * encryptedAccessToken `string`
  * expireInSeconds `integer`
  * waitingForActivation `boolean`

### ExternalLoginProviderInfoModel
* ExternalLoginProviderInfoModel `object`
  * clientId `string`
  * name `string`

### FlatPermissionDto
* FlatPermissionDto `object`
  * description `string`
  * displayName `string`
  * name `string`

### GeoDetails
* GeoDetails `object`
  * address `string`
  * baseServices [BaseServices](#baseservices)
  * city `string`
  * country `string`
  * creationTime `string`
  * district `string`
  * id `integer`
  * lat `number`
  * lng `number`
  * locality `string`
  * place `string`
  * province `string`
  * serviceId `integer`

### GeoDetailsCreateDto
* GeoDetailsCreateDto `object`
  * lat **required** `number`
  * lng **required** `number`
  * phone **required** `string`
  * serviceId **required** `integer`

### GeoDetailsDto
* GeoDetailsDto `object`
  * address `string`
  * area `string`
  * city `string`
  * country `string`
  * district `string`
  * id `integer`

### GeoDetailsUpdateDto
* GeoDetailsUpdateDto `object`
  * id `integer`
  * lat **required** `number`
  * lng **required** `number`
  * phone **required** `string`
  * serviceId **required** `integer`

### GetCurrentLoginInformationsOutput
* GetCurrentLoginInformationsOutput `object`
  * application [ApplicationInfoDto](#applicationinfodto)
  * tenant [TenantLoginInfoDto](#tenantlogininfodto)
  * user [UserLoginInfoDto](#userlogininfodto)

### GetRoleForEditOutput
* GetRoleForEditOutput `object`
  * grantedPermissionNames `array`
    * items `string`
  * permissions `array`
    * items [FlatPermissionDto](#flatpermissiondto)
  * role [RoleEditDto](#roleeditdto)

### ImageData
* ImageData `object`
  * content `string`
  * fileType `string`
  * id `string`
  * isMain `boolean`

### IsTenantAvailableInput
* IsTenantAvailableInput `object`
  * tenancyName **required** `string`

### IsTenantAvailableOutput
* IsTenantAvailableOutput `object`
  * state `integer` (values: 1, 2, 3)
  * tenantId `integer`

### ListResultDto[PermissionDto]
* ListResultDto[PermissionDto] `object`
  * items `array`
    * items [PermissionDto](#permissiondto)

### ListResultDto[RoleDto]
* ListResultDto[RoleDto] `object`
  * items `array`
    * items [RoleDto](#roledto)

### ListResultDto[RoleListDto]
* ListResultDto[RoleListDto] `object`
  * items `array`
    * items [RoleListDto](#rolelistdto)

### LoginModel
* LoginModel `object`
  * mobileNumber **required** `string`
  * password `string`

### PagedResultDto[GeoDetailsDto]
* PagedResultDto[GeoDetailsDto] `object`
  * items `array`
    * items [GeoDetailsDto](#geodetailsdto)
  * totalCount `integer`

### PagedResultDto[RoleDto]
* PagedResultDto[RoleDto] `object`
  * items `array`
    * items [RoleDto](#roledto)
  * totalCount `integer`

### PagedResultDto[ServiceCategoryDto]
* PagedResultDto[ServiceCategoryDto] `object`
  * items `array`
    * items [ServiceCategoryDto](#servicecategorydto)
  * totalCount `integer`

### PagedResultDto[ServiceFacilityDto]
* PagedResultDto[ServiceFacilityDto] `object`
  * items `array`
    * items [ServiceFacilityDto](#servicefacilitydto)
  * totalCount `integer`

### PagedResultDto[TenantDto]
* PagedResultDto[TenantDto] `object`
  * items `array`
    * items [TenantDto](#tenantdto)
  * totalCount `integer`

### PagedResultDto[UserDto]
* PagedResultDto[UserDto] `object`
  * items `array`
    * items [UserDto](#userdto)
  * totalCount `integer`

### PagedResultDto[WeddingVendorDto]
* PagedResultDto[WeddingVendorDto] `object`
  * items `array`
    * items [WeddingVendorDto](#weddingvendordto)
  * totalCount `integer`

### PermissionDto
* PermissionDto `object`
  * description `string`
  * displayName `string`
  * id `integer`
  * name `string`

### ProhibitPermissionInput
* ProhibitPermissionInput `object`
  * permissionName `string`
  * userId `integer`

### ProvinceDto
* ProvinceDto `object`
  * id `integer`
  * title `string`

### RegisterInput
* RegisterInput `object`
  * userName **required** `string`

### RegisterOutput
* RegisterOutput `object`
  * canLogin `boolean`

### ResetPasswordDto
* ResetPasswordDto `object`
  * adminPassword **required** `string`
  * newPassword **required** `string`
  * userId **required** `integer`

### RoleDto
* RoleDto `object`
  * description `string`
  * displayName **required** `string`
  * grantedPermissions `array`
    * items `string`
  * id `integer`
  * name **required** `string`
  * normalizedName `string`

### RoleEditDto
* RoleEditDto `object`
  * description `string`
  * displayName **required** `string`
  * id `integer`
  * isStatic `boolean`
  * name **required** `string`

### RoleListDto
* RoleListDto `object`
  * creationTime `string`
  * displayName `string`
  * id `integer`
  * isDefault `boolean`
  * isStatic `boolean`
  * name `string`

### ServiceCategory
* ServiceCategory `object`
  * baseServices `array`
    * items [BaseServices](#baseservices)
  * children `array`
    * items [ServiceCategory](#servicecategory)
  * creationTime `string`
  * icon `string`
  * id `integer`
  * parentId `integer`
  * title **required** `string`

### ServiceCategoryDto
* ServiceCategoryDto `object`
  * children `array`
    * items [ServiceCategoryDto](#servicecategorydto)
  * icon `string`
  * id `integer`
  * parentId `integer`
  * title **required** `string`

### ServiceCategoryUpdateDto
* ServiceCategoryUpdateDto `object`
  * children `array`
    * items [ServiceCategoryDto](#servicecategorydto)
  * icon `string`
  * id `integer`
  * parent [ServiceCategoryDto](#servicecategorydto)
  * parentId `integer`
  * title **required** `string`

### ServiceCategroyCreateDto
* ServiceCategroyCreateDto `object`
  * icon `string`
  * id `integer`
  * parent [ServiceCategoryDto](#servicecategorydto)
  * parentId `integer`
  * title **required** `string`

### ServiceFacilityCreateDto
* ServiceFacilityCreateDto `object`
  * icon `string`
  * title **required** `string`

### ServiceFacilityDto
* ServiceFacilityDto `object`
  * icon `string`
  * id `integer`
  * title `string`

### ServiceFacilityUpdateDto
* ServiceFacilityUpdateDto `object`
  * icon `string`
  * id `integer`
  * title `string`

### ServiceImages
* ServiceImages `object`
  * alt **required** `string`
  * baseServices [BaseServices](#baseservices)
  * creationTime `string`
  * id `integer`
  * isMain `boolean`
  * serviceId `integer`
  * state `boolean`
  * thumbUrl **required** `string`
  * title **required** `string`
  * url **required** `string`

### ServiceListModel
* ServiceListModel `object`
  * address `string`
  * capacity `integer`
  * facilityDtos `array`
    * items [ServiceFacilityDto](#servicefacilitydto)
  * id `integer`
  * images `array`
    * items `string`
  * priceType `integer` (values: 1, 2, 3, 4)
  * rate `integer`
  * title `string`

### Setting
* Setting `object`
  * creationTime `string`
  * creatorUserId `integer`
  * id `integer`
  * lastModificationTime `string`
  * lastModifierUserId `integer`
  * name **required** `string`
  * tenantId `integer`
  * userId `integer`
  * value `string`

### TenantDto
* TenantDto `object`
  * id `integer`
  * isActive `boolean`
  * name **required** `string`
  * tenancyName **required** `string`

### TenantLoginInfoDto
* TenantLoginInfoDto `object`
  * id `integer`
  * name `string`
  * tenancyName `string`

### UpdateWeddingVendorDto
* UpdateWeddingVendorDto `object`
  * base64Images `array`
    * items [ImageData](#imagedata)
  * capacity `integer`
  * categoryId **required** `integer`
  * description **required** `string`
  * facilityDtos `array`
    * items [ServiceFacilityDto](#servicefacilitydto)
  * id `integer`
  * lat `number`
  * lng `number`
  * mainImage `string`
  * phone `string`
  * title **required** `string`
  * userId `integer`

### User
* User `object`
  * accessFailedCount `integer`
  * authenticationSource `string`
  * claims `array`
    * items [UserClaim](#userclaim)
  * code `integer`
  * concurrencyStamp `string`
  * creationTime `string`
  * creatorUser [User](#user)
  * creatorUserId `integer`
  * deleterUser [User](#user)
  * deleterUserId `integer`
  * deletionTime `string`
  * emailAddress **required** `string`
  * emailConfirmationCode `string`
  * expireTime `string`
  * fullName `string`
  * id `integer`
  * isActive `boolean`
  * isDeleted `boolean`
  * isEmailConfirmed `boolean`
  * isLockoutEnabled `boolean`
  * isPhoneNumberConfirmed `boolean`
  * isTwoFactorEnabled `boolean`
  * lastModificationTime `string`
  * lastModifierUser [User](#user)
  * lastModifierUserId `integer`
  * lockoutEndDateUtc `string`
  * logins `array`
    * items [UserLogin](#userlogin)
  * name **required** `string`
  * normalizedEmailAddress **required** `string`
  * normalizedUserName **required** `string`
  * password **required** `string`
  * passwordResetCode `string`
  * permissions `array`
    * items [UserPermissionSetting](#userpermissionsetting)
  * phoneNumber `string`
  * roles `array`
    * items [UserRole](#userrole)
  * securityStamp `string`
  * settings `array`
    * items [Setting](#setting)
  * surname **required** `string`
  * tenantId `integer`
  * tokens `array`
    * items [UserToken](#usertoken)
  * userName **required** `string`

### UserClaim
* UserClaim `object`
  * claimType `string`
  * claimValue `string`
  * creationTime `string`
  * creatorUserId `integer`
  * id `integer`
  * tenantId `integer`
  * userId `integer`

### UserDto
* UserDto `object`
  * code `integer`
  * creationTime `string`
  * emailAddress **required** `string`
  * expireTime `string`
  * fullName `string`
  * id `integer`
  * isActive `boolean`
  * isExist `boolean`
  * lastLoginTime `string`
  * name **required** `string`
  * roleNames `array`
    * items `string`
  * surname **required** `string`
  * userName **required** `string`

### UserLogin
* UserLogin `object`
  * id `integer`
  * loginProvider **required** `string`
  * providerKey **required** `string`
  * tenantId `integer`
  * userId `integer`

### UserLoginInfoDto
* UserLoginInfoDto `object`
  * emailAddress `string`
  * id `integer`
  * name `string`
  * surname `string`
  * userName `string`

### UserPermissionSetting
* UserPermissionSetting `object`
  * creationTime `string`
  * creatorUserId `integer`
  * id `integer`
  * isGranted `boolean`
  * name **required** `string`
  * tenantId `integer`
  * userId `integer`

### UserRole
* UserRole `object`
  * creationTime `string`
  * creatorUserId `integer`
  * id `integer`
  * roleId `integer`
  * tenantId `integer`
  * userId `integer`

### UserServicesDto
* UserServicesDto `object`
  * mainImage `string`
  * serviceId `integer`
  * status `boolean`
  * title `string`

### UserToken
* UserToken `object`
  * expireDate `string`
  * id `integer`
  * loginProvider `string`
  * name `string`
  * tenantId `integer`
  * userId `integer`
  * value `string`

### WeddingVendorDto
* WeddingVendorDto `object`
  * categoryId `integer`
  * creationTime `string`
  * description `string`
  * id `integer`
  * mainImage `string`
  * title `string`
  * userDto [UserDto](#userdto)


text:
import io
import os
import zimencoder
import re

class OneNote:
    def __init__(self, api):
        self.api = api

    def fetch(self, url):
        res = self.api.get(url)
        res_json = res.json()
        if 'value' in res_json:
            return res_json["value"]
        else:
            print res.text
            return None

    def fetch_html(self, url):
        res = self.api.get(url)
        return res.text

    def fetch_binary(self, url):
        res = self.api.get(url)
        return res.content

    def mkdir(self, path):
        try:
            os.mkdir(path)
        except OSError:
            pass

    # creates a file and a dir with the name of the object
    def create(self, parent_path, name):
        clean_name = "_".join(re.findall("[a-zA-Z]+", name))
        path = os.path.join(parent_path, clean_name)
        self.mkdir(path)

        return (path, clean_name)

    def get_notebooks(self):
        home_path = os.path.abspath("Notebooks")
        self.mkdir(home_path)
        zimencoder.encode_notebook(home_path, "ImportedFromOneNote")

        notebooks = self.fetch('https://www.onenote.com/api/v1.0/me/notes/notebooks')
        for notebook in notebooks:
            print(notebook["name"], notebook["lastModifiedTime"])
            (notebook_path, notebook_name) = self.create(home_path, notebook["name"])
            zimencoder.encode_notebook(notebook_path, notebook_name)
            zimencoder.encode_page(notebook_path, notebook_name, notebook['createdTime'], u"")

            sections = self.fetch(notebook["sectionsUrl"])
            if sections is None:
                continue
            for section in sections:
                print(section["name"], section["lastModifiedTime"])

                (section_path, section_name) = self.create(notebook_path, section["name"])
                zimencoder.encode_page(section_path, section_name, section['createdTime'], u"")

                pages = self.fetch(section["pagesUrl"])
                for page in pages:
                    print(page["title"], page["id"], page["contentUrl"])

                    (page_path, page_name)  = self.create(section_path, page["title"])
                    content = self.fetch_html(page["contentUrl"])
                    with io.open(page_path + ".html", 'w', encoding='utf-8') as fpage:
                        fpage.write(unicode(content))

                    page_info = zimencoder.encode_page(page_path, page_name, page['createdTime'], content)
                    # if it has images, make a dir for the page
                    if len(page_info.images) > 0:
                        self.mkdir(page_path)
                    for image_name, image_url in page_info.images.iteritems():
                        print(image_name, image_url)
                        image_path = os.path.join(page_path, image_name)
                        image_content = self.fetch_binary(image_url)
                        with io.open(image_path, 'wb') as fimage:
                            fimage.write(image_content)

    def import_all(self):
        self.get_notebooks()

redpajama_set_name: RedPajamaGithub


text:
package com.gmail.blueboxware.libgdxplugin.settings;

import com.gmail.blueboxware.libgdxplugin.utils.LanguageSubstitutionUtilsKt;
import com.intellij.openapi.project.Project;
import com.intellij.uiDesigner.core.GridConstraints;
import com.intellij.uiDesigner.core.GridLayoutManager;
import com.intellij.uiDesigner.core.Spacer;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.awt.*;
import java.util.ResourceBundle;

public class LibGDXPluginSettingsPane {
    private JPanel root;
    private JCheckBox showPreviewsOfColorCheckBox;
    private JCheckBox neverAskAboutSkinFiles;
    private JCheckBox showPreviewsOfColorInSkinCheckBox;
    private JCheckBox neverAskAboutJsonFiles;
    private JButton resetSkin;
    private JButton resetJson;
    private JCheckBox showPreviewsOfColorsInJsonCheckbox;

    private LibGDXPluginSettings settings = new LibGDXPluginSettings();

    @SuppressWarnings("UnusedReturnValue")
    JComponent createPanel(@NotNull Project project, @NotNull LibGDXPluginSettings settings) {
        this.settings = settings;

        resetJson.addActionListener(e -> LanguageSubstitutionUtilsKt.resetJsonAssociations(project,root));

        resetSkin.addActionListener(e -> LanguageSubstitutionUtilsKt.resetSkinAssociations(project, root));

        return root;
    }

    void apply() {
        settings.setEnableColorAnnotations(showPreviewsOfColorCheckBox.isSelected());
        settings.setEnableColorAnnotationsInJson(showPreviewsOfColorsInJsonCheckbox.isSelected());
        settings.setEnableColorAnnotationsInSkin(showPreviewsOfColorInSkinCheckBox.isSelected());
        settings.setNeverAskAboutSkinFiles(neverAskAboutSkinFiles.isSelected());
        settings.setNeverAskAboutJsonFiles(neverAskAboutJsonFiles.isSelected());
    }

    void reset() {
        showPreviewsOfColorCheckBox.setSelected(settings.getEnableColorAnnotations());
        showPreviewsOfColorsInJsonCheckbox.setSelected(settings.getEnableColorAnnotationsInJson());
        showPreviewsOfColorInSkinCheckBox.setSelected(settings.getEnableColorAnnotationsInSkin());
        neverAskAboutSkinFiles.setSelected(settings.getNeverAskAboutSkinFiles());
        neverAskAboutJsonFiles.setSelected(settings.getNeverAskAboutJsonFiles());
    }

    @SuppressWarnings("UnusedReturnValue")
    boolean isModified() {
        return showPreviewsOfColorCheckBox.isSelected() != settings.getEnableColorAnnotations()
                || showPreviewsOfColorsInJsonCheckbox.isSelected() != settings.getEnableColorAnnotationsInJson()
                || showPreviewsOfColorInSkinCheckBox.isSelected() != settings.getEnableColorAnnotationsInSkin()
                || neverAskAboutSkinFiles.isSelected() != settings.getNeverAskAboutSkinFiles()
                || neverAskAboutJsonFiles.isSelected() != settings.getNeverAskAboutJsonFiles()
                ;
    }

    {
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        root = new JPanel();
        root.setLayout(new GridLayoutManager(9, 3, new Insets(0, 0, 0, 0), -1, -1));
        showPreviewsOfColorCheckBox = new JCheckBox();
        this.$$$loadButtonText$$$(showPreviewsOfColorCheckBox, ResourceBundle.getBundle("libgdxplugin").getString("settings.enable.color.previews"));
        root.add(showPreviewsOfColorCheckBox, new GridConstraints(0, 0, 1, 3, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
        final Spacer spacer1 = new Spacer();
        root.add(spacer1, new GridConstraints(8, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
        neverAskAboutSkinFiles = new JCheckBox();
        this.$$$loadButtonText$$$(neverAskAboutSkinFiles, ResourceBundle.getBundle("libgdxplugin").getString("settings.never.ask.about.skin.files"));
        root.add(neverAskAboutSkinFiles, new GridConstraints(4, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
        showPreviewsOfColorInSkinCheckBox = new JCheckBox();
        this.$$$loadButtonText$$$(showPreviewsOfColorInSkinCheckBox, ResourceBundle.getBundle("libgdxplugin").getString("settings.enable.color.previews.skin"));
        root.add(showPreviewsOfColorInSkinCheckBox, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
        neverAskAboutJsonFiles = new JCheckBox();
        this.$$$loadButtonText$$$(neverAskAboutJsonFiles, ResourceBundle.getBundle("libgdxplugin").getString("settings.never.ask.about.json.files"));
        root.add(neverAskAboutJsonFiles, new GridConstraints(6, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
        final Spacer spacer2 = new Spacer();
        root.add(spacer2, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_FIXED, new Dimension(-1, 20), null, null, 0, false));
        resetSkin = new JButton();
        resetSkin.setText("Reset Skin associations...");
        root.add(resetSkin, new GridConstraints(5, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, 1, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 2, false));
        resetJson = new JButton();
        resetJson.setText("Reset JSON associations...");
        root.add(resetJson, new GridConstraints(7, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, 1, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 2, false));
        showPreviewsOfColorsInJsonCheckbox = new JCheckBox();
        this.$$$loadButtonText$$$(showPreviewsOfColorsInJsonCheckbox, ResourceBundle.getBundle("libgdxplugin").getString("settings.enable.color.previews.json"));
        root.add(showPreviewsOfColorsInJsonCheckbox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    }

    /**
     * @noinspection ALL
     */
    private void $$$loadButtonText$$$(AbstractButton component, String text) {
        StringBuffer result = new StringBuffer();
        boolean haveMnemonic = false;
        char mnemonic = '\0';
        int mnemonicIndex = -1;
        for (int i = 0; i < text.length(); i++) {
            if (text.charAt(i) == '&') {
                i++;
                if (i == text.length()) break;
                if (!haveMnemonic && text.charAt(i) != '&') {
                    haveMnemonic = true;
                    mnemonic = text.charAt(i);
                    mnemonicIndex = result.length();
                }
            }
            result.append(text.charAt(i));
        }
        component.setText(result.toString());
        if (haveMnemonic) {
            component.setMnemonic(mnemonic);
            component.setDisplayedMnemonicIndex(mnemonicIndex);
        }
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() {
        return root;
    }

    @SuppressWarnings("EmptyMethod")
    private void createUIComponents() {

    }
}


text:
"""
rohmu - file transformation wrapper

Copyright (c) 2016 Ohmu Ltd
See LICENSE for details
"""

import io
import time

class FileWrap(io.BufferedIOBase):
    # pylint: disable=unused-argument

    def __init__(self, next_fp):
        super().__init__()
        self.next_fp = next_fp
        self.offset = 0
        self.state = "OPEN"

    def _check_not_closed(self):
        if self.state == "CLOSED":
            raise ValueError("I/O operation on closed file")

    def close(self):
        """Close stream"""
        if self.state == "CLOSED":
            return
        self.flush()
        # We close the stack of rohmu file wrappers, but leave the underlying real io object open to allow the
        # caller to do something useful with it if they like, for example reading the output out of a BytesIO
        # object or linking a temporary file to another name, etc.
        if isinstance(self.next_fp, FileWrap):
            self.next_fp.close()
        self.next_fp = None
        self.state = "CLOSED"

    @property
    def closed(self):
        """True if this stream is closed"""
        return self.state == "CLOSED"

    def fileno(self):
        self._check_not_closed()
        return self.next_fp.fileno()

    def flush(self):
        self._check_not_closed()

    def tell(self):
        self._check_not_closed()
        return self.offset

    def readable(self):
        """True if this stream supports reading"""
        self._check_not_closed()
        return False

    def read(self, size=-1):
        """Read up to size decrypted bytes"""
        self._check_not_closed()
        raise io.UnsupportedOperation("Read not supported")

    def seekable(self):
        """True if this stream supports random access"""
        self._check_not_closed()
        return False

    def seek(self, offset, whence=0):
        self._check_not_closed()
        raise io.UnsupportedOperation("Seek not supported")

    def truncate(self):
        self._check_not_closed()
        raise io.UnsupportedOperation("Truncate not supported")

    def writable(self):
        """True if this stream supports writing"""
        self._check_not_closed()
        return False

    def write(self, data):
        """Encrypt and write the given bytes"""
        self._check_not_closed()
        raise io.UnsupportedOperation("Write not supported")

class Sink:
    """Sink performs transformation for received input data and passes it forward to
    given target sink. Data is fed to this class via it's `write` method and that in
    turn calls `write` for the next sink.

    Unlike the FileWrap interface, which is useful for performing transformation when
    data is being pulled from a source, the Sink interface can be used when data is
    pushed through a pipeline of transformations. This provides better performance as
    any temporary files or buffers can be omitted."""

    def __init__(self, next_sink):
        self.next_sink = next_sink

    def _data_written(self, bytes_written, pending_bytes):
        pass

    def _write_to_next_sink(self, data):
        data = memoryview(data)
        offset = 0
        while offset < len(data):
            start_offset = offset
            offset += self.next_sink.write(data[offset:])
            self._data_written(offset - start_offset, len(data) - offset)

    def write(self, data):
        """Performs some transformation for given data and writes the transformed
        data to next sink."""
        self._write_to_next_sink(data)
        return len(data)

class ThrottleSink(Sink):
    """Provides simple throttling sink that can be used if the target sink is
    non-blocking device that can return short if all data cannot be immediately
    written. In such cases writing again immediately after a small write would
    result in unnecessary busy-looping."""

    def __init__(self, next_sink, wait_time, sleep_fn=time.sleep):
        super().__init__(next_sink)
        self.sleep_fn = sleep_fn
        self.wait_time = wait_time

    def _data_written(self, bytes_written, pending_bytes):
        if pending_bytes > 0 and bytes_written < 10 * 1024:
            self.sleep_fn(self.wait_time)


text:
Opinion_Explorer_API
====================


text:
#ifndef SV_RANGE_H__
# define SV_RANGE_H__

#include "version.h"

#define SV_RANGE_MAX_LEN (512)

void semver_range_ctor(semver_range_t *self);
char semver_range_read(semver_range_t *self, const char *str, size_t len, size_t *offset);

#endif /* SV_RANGE_H__ */


text:
package org.apache.pdfbox.examples.signature;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.net.URL;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.util.Calendar;
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.io.IOUtils;

import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.interactive.digitalsignature.ExternalSigningSupport;
import org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature;
import org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureInterface;
import org.apache.pdfbox.pdmodel.interactive.digitalsignature.SignatureOptions;
import org.apache.pdfbox.pdmodel.interactive.digitalsignature.visible.PDVisibleSigProperties;
import org.apache.pdfbox.pdmodel.interactive.digitalsignature.visible.PDVisibleSignDesigner;
import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;
import org.apache.pdfbox.pdmodel.interactive.form.PDSignatureField;
import org.apache.pdfbox.util.Hex;

/**
 * This is an example for visual signing a pdf.

 * @see CreateSignature
 * @author Vakhtang Koroghlishvili
 */
public class CreateVisibleSignature extends CreateSignatureBase
{
    private SignatureOptions signatureOptions;
    private PDVisibleSignDesigner visibleSignDesigner;
    private final PDVisibleSigProperties visibleSignatureProperties = new PDVisibleSigProperties();
    private boolean lateExternalSigning = false;

    public boolean isLateExternalSigning()
    {
        return lateExternalSigning;
    }

    /**
     * Set late external signing. Enable this if you want to activate the demo code where the
     * signature is kept and added in an extra step without using PDFBox methods. This is disabled
     * by default.
     *
     * @param lateExternalSigning
     */
    public void setLateExternalSigning(boolean lateExternalSigning)
    {
        this.lateExternalSigning = lateExternalSigning;
    }

    public void setVisibleSignDesigner(String filename, int x, int y, int zoomPercent,
            FileInputStream imageStream, int page)
            throws IOException
    {
        visibleSignDesigner = new PDVisibleSignDesigner(filename, imageStream, page);
        visibleSignDesigner.xAxis(x).yAxis(y).zoom(zoomPercent).adjustForRotation();
    }

    public void setVisibleSignatureProperties(String name, String location, String reason, int preferredSize,
            int page, boolean visualSignEnabled) throws IOException
    {
        visibleSignatureProperties.signerName(name).signerLocation(location).signatureReason(reason).
                preferredSize(preferredSize).page(page).visualSignEnabled(visualSignEnabled).
                setPdVisibleSignature(visibleSignDesigner);
    }

    /**
     * Initialize the signature creator with a keystore (pkcs12) and pin that
     * should be used for the signature.
     *
     * @param keystore is a pkcs12 keystore.
     * @param pin is the pin for the keystore / private key
     * @throws KeyStoreException if the keystore has not been initialized (loaded)
     * @throws NoSuchAlgorithmException if the algorithm for recovering the key cannot be found
     * @throws UnrecoverableKeyException if the given password is wrong
     * @throws CertificateException if the certificate is not valid as signing time
     * @throws IOException if no certificate could be found
     */
    public CreateVisibleSignature(KeyStore keystore, char[] pin)
            throws KeyStoreException, UnrecoverableKeyException, NoSuchAlgorithmException, IOException, CertificateException
    {
        super(keystore, pin);
    }

    /**
     * Sign pdf file and create new file that ends with "_signed.pdf".
     *
     * @param inputFile The source pdf document file.
     * @param signedFile The file to be signed.
     * @param tsaClient optional TSA client
     * @throws IOException
     */
    public void signPDF(File inputFile, File signedFile, TSAClient tsaClient) throws IOException
    {
        this.signPDF(inputFile, signedFile, tsaClient, null);
    }

    /**
     * Sign pdf file and create new file that ends with "_signed.pdf".
     *
     * @param inputFile The source pdf document file.
     * @param signedFile The file to be signed.
     * @param tsaClient optional TSA client
     * @param signatureFieldName optional name of an existing (unsigned) signature field
     * @throws IOException
     */
    public void signPDF(File inputFile, File signedFile, TSAClient tsaClient, String signatureFieldName) throws IOException
    {
        setTsaClient(tsaClient);

        if (inputFile == null || !inputFile.exists())
        {
            throw new IOException("Document for signing does not exist");
        }

        // creating output document and prepare the IO streams.
        FileOutputStream fos = new FileOutputStream(signedFile);

        // load document
        PDDocument doc = PDDocument.load(inputFile);

        int accessPermissions = getMDPPermission(doc);
        if (accessPermissions == 1)
        {
            throw new IllegalStateException("No changes to the document are permitted due to DocMDP transform parameters dictionary");
        }
        // Note that PDFBox has a bug that visual signing on certified files with permission 2
        // doesn't work properly, see PDFBOX-3699. As long as this issue is open, you may want to
        // be careful with such files.

        PDSignature signature;

        // sign a PDF with an existing empty signature, as created by the CreateEmptySignatureForm example.
        signature = findExistingSignature(doc, signatureFieldName);

        if (signature == null)
        {
            // create signature dictionary
            signature = new PDSignature();
        }

        // Optional: certify
        if (accessPermissions == 0)
        {
            setMDPPermission(doc, signature, 2);
        }

        // default filter
        signature.setFilter(PDSignature.FILTER_ADOBE_PPKLITE);

        // subfilter for basic and PAdES Part 2 signatures
        signature.setSubFilter(PDSignature.SUBFILTER_ADBE_PKCS7_DETACHED);

        if (visibleSignatureProperties != null)
        {
            // this builds the signature structures in a separate document
            visibleSignatureProperties.buildSignature();

            signature.setName(visibleSignatureProperties.getSignerName());
            signature.setLocation(visibleSignatureProperties.getSignerLocation());
            signature.setReason(visibleSignatureProperties.getSignatureReason());
        }

        // the signing date, needed for valid signature
        signature.setSignDate(Calendar.getInstance());

        // do not set SignatureInterface instance, if external signing used
        SignatureInterface signatureInterface = isExternalSigning() ? null : this;

        // register signature dictionary and sign interface
        if (visibleSignatureProperties != null && visibleSignatureProperties.isVisualSignEnabled())
        {
            signatureOptions = new SignatureOptions();
            signatureOptions.setVisualSignature(visibleSignatureProperties.getVisibleSignature());
            signatureOptions.setPage(visibleSignatureProperties.getPage() - 1);
            doc.addSignature(signature, signatureInterface, signatureOptions);
        }
        else
        {
            doc.addSignature(signature, signatureInterface);
        }

        if (isExternalSigning())
        {
            System.out.println("Signing externally " + signedFile.getName());
            ExternalSigningSupport externalSigning = doc.saveIncrementalForExternalSigning(fos);
            // invoke external signature service
            byte[] cmsSignature = sign(externalSigning.getContent());

            // Explanation of late external signing (off by default):
            // If you want to add the signature in a separate step, then set an empty byte array
            // and call signature.getByteRange() and remember the offset signature.getByteRange()[1]+1.
            // you can write the ascii hex signature at a later time even if you don't have this
            // PDDocument object anymore, with classic java file random access methods.
            // If you can't remember the offset value from ByteRange because your context has changed,
            // then open the file with PDFBox, find the field with findExistingSignature() or
            // PODDocument.getLastSignatureDictionary() and get the ByteRange from there.
            // Close the file and then write the signature as explained earlier in this comment.
            if (isLateExternalSigning())
            {
                // this saves the file with a 0 signature
                externalSigning.setSignature(new byte[0]);

                // remember the offset (add 1 because of "<")
                int offset = signature.getByteRange()[1] + 1;

                // now write the signature at the correct offset without any PDFBox methods
                RandomAccessFile raf = new RandomAccessFile(signedFile, "rw");
                raf.seek(offset);
                raf.write(Hex.getBytes(cmsSignature));
                raf.close();
            }
            else
            {
                // set signature bytes received from the service and save the file
                externalSigning.setSignature(cmsSignature);
            }
        }
        else
        {
            // write incremental (only for signing purpose)
            doc.saveIncremental(fos);
        }
        doc.close();

        // do not close options before saving, because some COSStream objects within options
        // are transferred to the signed document.
        IOUtils.closeQuietly(signatureOptions);
    }

    // Find an existing signature (assumed to be empty). You will usually not need this.
    private PDSignature findExistingSignature(PDDocument doc, String sigFieldName)
    {
        PDSignature signature = null;
        PDSignatureField signatureField;
        PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
        if (acroForm != null)
        {
            signatureField = (PDSignatureField) acroForm.getField(sigFieldName);
            if (signatureField != null)
            {
                // retrieve signature dictionary
                signature = signatureField.getSignature();
                if (signature == null)
                {
                    signature = new PDSignature();
                    // after solving PDFBOX-3524
                    // signatureField.setValue(signature)
                    // until then:
                    signatureField.getCOSObject().setItem(COSName.V, signature);
                }
                else
                {
                    throw new IllegalStateException("The signature field " + sigFieldName + " is already signed.");
                }
            }
        }
        return signature;
    }

    /**
     * Arguments are
     * [0] key store
     * [1] pin
     * [2] document that will be signed
     * [3] image of visible signature
     *
     * @param args
     * @throws java.security.KeyStoreException
     * @throws java.security.cert.CertificateException
     * @throws java.io.IOException
     * @throws java.security.NoSuchAlgorithmException
     * @throws java.security.UnrecoverableKeyException
     */
    public static void main(String[] args) throws KeyStoreException, CertificateException,
            IOException, NoSuchAlgorithmException, UnrecoverableKeyException
    {
        // generate with
        // keytool -storepass 123456 -storetype PKCS12 -keystore file.p12 -genkey -alias client -keyalg RSA
        if (args.length < 4)
        {
            usage();
            System.exit(1);
        }

        String tsaUrl = null;
        // External signing is needed if you are using an external signing service, e.g. to sign
        // several files at once.
        boolean externalSig = false;
        for (int i = 0; i < args.length; i++)
        {
            if (args[i].equals("-tsa"))
            {
                i++;
                if (i >= args.length)
                {
                    usage();
                    System.exit(1);
                }
                tsaUrl = args[i];
            }
            if (args[i].equals("-e"))
            {
                externalSig = true;
            }
        }

        File ksFile = new File(args[0]);
        KeyStore keystore = KeyStore.getInstance("PKCS12");
        char[] pin = args[1].toCharArray();
        keystore.load(new FileInputStream(ksFile), pin);

        // TSA client
        TSAClient tsaClient = null;
        if (tsaUrl != null)
        {
            MessageDigest digest = MessageDigest.getInstance("SHA-256");
            tsaClient = new TSAClient(new URL(tsaUrl), null, null, digest);
        }

        File documentFile = new File(args[2]);

        CreateVisibleSignature signing = new CreateVisibleSignature(keystore, pin.clone());

        FileInputStream imageStream = new FileInputStream(args[3]);

        String name = documentFile.getName();
        String substring = name.substring(0, name.lastIndexOf('.'));
        File signedDocumentFile = new File(documentFile.getParent(), substring + "_signed.pdf");

        // page is 1-based here
        int page = 1;
        signing.setVisibleSignDesigner(args[2], 0, 0, -50, imageStream, page);
        imageStream.close();
        signing.setVisibleSignatureProperties("name", "location", "Security", 0, page, true);
        signing.setExternalSigning(externalSig);
        signing.signPDF(documentFile, signedDocumentFile, tsaClient);
    }

    /**
     * This will print the usage for this program.
     */
    private static void usage()
    {
        System.err.println("Usage: java " + CreateVisibleSignature.class.getName()
                + " <pkcs12-keystore-file> <pin> <input-pdf> <sign-image>\n" + "" +
                           "options:\n" +
                           "  -tsa <url>    sign timestamp using the given TSA server\n"+
                           "  -e            sign using external signature creation scenario");
    }

}


text:
<?php
require_once('./vendor/autoload.php');
require_once('Activity.php');
require_once('pusher-config.php');

date_default_timezone_set('UTC');

$chat_info = $_POST['chat_info'];

$channel_name = null;

if( !isset($_POST['chat_info']) ){
  header("HTTP/1.0 400 Bad Request");
  echo('chat_info must be provided');
}

if( !isset($_SERVER['HTTP_REFERER']) ) {
  header("HTTP/1.0 400 Bad Request");
  echo('channel name could not be determined from HTTP_REFERER');
}

$channel_name = get_channel_name($_SERVER['HTTP_REFERER']);
$options = sanitise_input($chat_info);

$activity = new Activity('chat-message', $options['text'], $options);

$pusher = new Pusher(APP_KEY, APP_SECRET, APP_ID);
$data = $activity->getMessage();
$response = $pusher->trigger($channel_name, 'chat_message', $data, null, true);

header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/json');

$result = array('activity' => $data, 'pusherResponse' => $response);
echo(json_encode($result));

function get_channel_name($http_referer) {
  // not allowed :, / % #
  $pattern = "/(\W)+/";
  $channel_name = preg_replace($pattern, '-', $http_referer);
  return $channel_name;
}

function sanitise_input($chat_info) {
  $email = isset($chat_info['email'])?$chat_info['email']:'';

  $options = array();
  $options['displayName'] = substr(htmlspecialchars($chat_info['nickname']), 0, 30);
  $options['text'] = substr(htmlspecialchars($chat_info['text']), 0, 300);
  $options['email'] = substr(htmlspecialchars($email), 0, 100);
  $options['get_gravatar'] = true;
  return $options;
}
?>


text:
@implementation AnimatedGifFrame

@synthesize data, delay, disposalMethod, area, header;

- (void) dealloc
{
	//[data release];
	//[header release];
	//[super dealloc];
}

@end

@implementation SCGIFImageView
@synthesize GIF_frames;

+ (BOOL)isGifImage:(NSData*)imageData {
	const char* buf = (const char*)[imageData bytes];
	if (buf[0] == 0x47 && buf[1] == 0x49 && buf[2] == 0x46 && buf[3] == 0x38) {
		return YES;
	}
	return NO;
}

+ (NSMutableArray*)getGifFrames:(NSData*)gifImageData {
	SCGIFImageView* gifImageView = [[SCGIFImageView alloc] initWithGIFData:gifImageData];
	if (!gifImageView) {
		return nil;
	}

	NSMutableArray* gifFrames = gifImageView.GIF_frames;
	//[[gifFrames retain] autorelease];
	//[gifImageView release];
	return gifFrames;
}

- (id)initWithGIFFile:(NSString*)gifFilePath {
	NSData* imageData = [NSData dataWithContentsOfFile:gifFilePath];
	return [self initWithGIFData:imageData];
}

- (id)initWithGIFData:(NSData*)gifImageData {
	if (gifImageData.length < 4) {
		return nil;
	}

	if (![SCGIFImageView isGifImage:gifImageData]) {
		UIImage* image = [UIImage imageWithData:gifImageData];
		return [super initWithImage:image];
	}

	[self decodeGIF:gifImageData];

	if (GIF_frames.count <= 0) {
		UIImage* image = [UIImage imageWithData:gifImageData];
		return [super initWithImage:image];
	}

	self = [super init];
	if (self) {
		[self loadImageData];
	}

	return self;
}

- (void)setGIF_frames:(NSMutableArray *)gifFrames {
	//[gifFrames retain];

	if (GIF_frames) {
	//	[GIF_frames release];
	}
	GIF_frames = gifFrames;

	[self loadImageData];
}

- (void)loadImageData {
	// Add all subframes to the animation
	NSMutableArray *array = [[NSMutableArray alloc] init];
	for (NSUInteger i = 0; i < [GIF_frames count]; i++)
	{
		[array addObject: [self getFrameAsImageAtIndex:i]];
	}

	NSMutableArray *overlayArray = [[NSMutableArray alloc] init];
	UIImage *firstImage = [array objectAtIndex:0];
	CGSize size = firstImage.size;
	CGRect rect = CGRectZero;
	rect.size = size;

	UIGraphicsBeginImageContext(size);
	CGContextRef ctx = UIGraphicsGetCurrentContext();

	int i = 0;
	AnimatedGifFrame *lastFrame = nil;
	for (UIImage *image in array)
	{
		// Get Frame
		AnimatedGifFrame *frame = [GIF_frames objectAtIndex:i];

		// Initialize Flag
		UIImage *previousCanvas = nil;

		// Save Context
		CGContextSaveGState(ctx);
		// Change CTM
		CGContextScaleCTM(ctx, 1.0, -1.0);
		CGContextTranslateCTM(ctx, 0.0, -size.height);

		// Check if lastFrame exists
		CGRect clipRect;

		// Disposal Method (Operations before draw frame)
		switch (frame.disposalMethod)
		{
			case 1: // Do not dispose (draw over context)
                    // Create Rect (y inverted) to clipping
				clipRect = CGRectMake(frame.area.origin.x, size.height - frame.area.size.height - frame.area.origin.y, frame.area.size.width, frame.area.size.height);
				// Clip Context
				CGContextClipToRect(ctx, clipRect);
				break;
			case 2: // Restore to background the rect when the actual frame will go to be drawed
                    // Create Rect (y inverted) to clipping
				clipRect = CGRectMake(frame.area.origin.x, size.height - frame.area.size.height - frame.area.origin.y, frame.area.size.width, frame.area.size.height);
				// Clip Context
				CGContextClipToRect(ctx, clipRect);
				break;
			case 3: // Restore to Previous
                    // Get Canvas
				previousCanvas = UIGraphicsGetImageFromCurrentImageContext();

				// Create Rect (y inverted) to clipping
				clipRect = CGRectMake(frame.area.origin.x, size.height - frame.area.size.height - frame.area.origin.y, frame.area.size.width, frame.area.size.height);
				// Clip Context
				CGContextClipToRect(ctx, clipRect);
				break;
		}

		// Draw Actual Frame
		CGContextDrawImage(ctx, rect, image.CGImage);
		// Restore State
		CGContextRestoreGState(ctx);

		//delay must larger than 0, the minimum delay in firefox is 10.
		if (frame.delay <= 0) {
			frame.delay = 10;
		}
        if ((GIF_frames.count-1)==i) {
            frame.delay = 600;
        }
		[overlayArray addObject:UIGraphicsGetImageFromCurrentImageContext()];

		// Set Last Frame
		lastFrame = frame;

		// Disposal Method (Operations afte draw frame)
		switch (frame.disposalMethod)
		{
			case 2: // Restore to background color the zone of the actual frame
                    // Save Context
				CGContextSaveGState(ctx);
				// Change CTM
				CGContextScaleCTM(ctx, 1.0, -1.0);
				CGContextTranslateCTM(ctx, 0.0, -size.height);
				// Clear Context
				CGContextClearRect(ctx, clipRect);
				// Restore Context
				CGContextRestoreGState(ctx);
				break;
			case 3: // Restore to Previous Canvas
                    // Save Context
				CGContextSaveGState(ctx);
				// Change CTM
				CGContextScaleCTM(ctx, 1.0, -1.0);
				CGContextTranslateCTM(ctx, 0.0, -size.height);
				// Clear Context
				CGContextClearRect(ctx, lastFrame.area);
				// Draw previous frame
				CGContextDrawImage(ctx, rect, previousCanvas.CGImage);
				// Restore State
				CGContextRestoreGState(ctx);
				break;
		}

		// Increment counter
		i++;
	}
	UIGraphicsEndImageContext();

	[self setImage:[overlayArray objectAtIndex:0]];
	[self setAnimationImages:overlayArray];

	//[overlayArray release];
	//[array release];

	// Count up the total delay, since Cocoa doesn't do per frame delays.
	double total = 0;
	for (AnimatedGifFrame *frame in GIF_frames) {
		total += frame.delay;
	}

	// GIFs store the delays as 1/100th of a second,
	// UIImageViews want it in seconds.
	[self setAnimationDuration:(total/100)+3];

	// Repeat infinite
	[self setAnimationRepeatCount:0];

	[self startAnimating];
}

- (void) decodeGIF:(NSData *)GIFData {
	GIF_pointer = GIFData;

    if (GIF_buffer != nil)
    {
      //  [GIF_buffer release];
    }

    if (GIF_global != nil)
    {
     //   [GIF_global release];
    }

    if (GIF_screen != nil)
    {
       // [GIF_screen release];
    }

	//[GIF_frames release];

    GIF_buffer = [[NSMutableData alloc] init];
	GIF_global = [[NSMutableData alloc] init];
	GIF_screen = [[NSMutableData alloc] init];
	GIF_frames = [[NSMutableArray alloc] init];

    // Reset file counters to 0
	dataPointer = 0;

	[self GIFSkipBytes: 6]; // GIF89a, throw away
	[self GIFGetBytes: 7]; // Logical Screen Descriptor

    // Deep copy
	[GIF_screen setData: GIF_buffer];

    // Copy the read bytes into a local buffer on the stack
    // For easy byte access in the following lines.
    int length = [GIF_buffer length];
	unsigned char aBuffer[length];
	[GIF_buffer getBytes:aBuffer length:length];

	if (aBuffer[4] & 0x80) GIF_colorF = 1; else GIF_colorF = 0;
	if (aBuffer[4] & 0x08) GIF_sorted = 1; else GIF_sorted = 0;
	GIF_colorC = (aBuffer[4] & 0x07);
	GIF_colorS = 2 << GIF_colorC;

	if (GIF_colorF == 1)
    {
		[self GIFGetBytes: (3 * GIF_colorS)];

        // Deep copy
		[GIF_global setData:GIF_buffer];
	}

	unsigned char bBuffer[1];
	while ([self GIFGetBytes:1] == YES)
    {
        [GIF_buffer getBytes:bBuffer length:1];

        if (bBuffer[0] == 0x3B)
        { // This is the end
            break;
        }

        switch (bBuffer[0])
        {
            case 0x21:
                // Graphic Control Extension (#n of n)
                [self GIFReadExtensions];
                break;
            case 0x2C:
                // Image Descriptor (#n of n)
                [self GIFReadDescriptor];
                break;
        }
	}

	// clean up stuff
	//[GIF_buffer release];
    GIF_buffer = nil;

	//[GIF_screen release];
    GIF_screen = nil;

	//[GIF_global release];
    GIF_global = nil;
}

- (void) GIFReadExtensions {
	// 21! But we still could have an Application Extension,
	// so we want to check for the full signature.
	unsigned char cur[1], prev[1];
    [self GIFGetBytes:1];
    [GIF_buffer getBytes:cur length:1];

	while (cur[0] != 0x00)
    {

		// TODO: Known bug, the sequence F9 04 could occur in the Application Extension, we
		//       should check whether this combo follows directly after the 21.
		if (cur[0] == 0x04 && prev[0] == 0xF9)
		{
			[self GIFGetBytes:5];

			AnimatedGifFrame *frame = [[AnimatedGifFrame alloc] init];

			unsigned char buffer[5];
			[GIF_buffer getBytes:buffer length:5];
			frame.disposalMethod = (buffer[0] & 0x1c) >> 2;
			//NSLog(@"flags=%x, dm=%x", (int)(buffer[0]), frame.disposalMethod);

			// We save the delays for easy access.
			frame.delay = (buffer[1] | buffer[2] << 8);

			unsigned char board[8];
			board[0] = 0x21;
			board[1] = 0xF9;
			board[2] = 0x04;

			for(int i = 3, a = 0; a < 5; i++, a++)
			{
				board[i] = buffer[a];
			}

			frame.header = [NSData dataWithBytes:board length:8];

			[GIF_frames addObject:frame];
			//[frame release];
			break;
		}

		prev[0] = cur[0];
        [self GIFGetBytes:1];
		[GIF_buffer getBytes:cur length:1];
	}
}

- (void) GIFReadDescriptor {
	[self GIFGetBytes:9];

    // Deep copy
	NSMutableData *GIF_screenTmp = [NSMutableData dataWithData:GIF_buffer];

	unsigned char aBuffer[9];
	[GIF_buffer getBytes:aBuffer length:9];

	CGRect rect;
	rect.origin.x = ((int)aBuffer[1] << 8) | aBuffer[0];
	rect.origin.y = ((int)aBuffer[3] << 8) | aBuffer[2];
	rect.size.width = ((int)aBuffer[5] << 8) | aBuffer[4];
	rect.size.height = ((int)aBuffer[7] << 8) | aBuffer[6];

	AnimatedGifFrame *frame = [GIF_frames lastObject];
	frame.area = rect;

	if (aBuffer[8] & 0x80) GIF_colorF = 1; else GIF_colorF = 0;

	unsigned char GIF_code = GIF_colorC, GIF_sort = GIF_sorted;

	if (GIF_colorF == 1)
    {
		GIF_code = (aBuffer[8] & 0x07);

		if (aBuffer[8] & 0x20)
        {
            GIF_sort = 1;
        }
        else
        {
        	GIF_sort = 0;
        }
	}

	int GIF_size = (2 << GIF_code);

	size_t blength = [GIF_screen length];
	unsigned char bBuffer[blength];
	[GIF_screen getBytes:bBuffer length:blength];

	bBuffer[4] = (bBuffer[4] & 0x70);
	bBuffer[4] = (bBuffer[4] | 0x80);
	bBuffer[4] = (bBuffer[4] | GIF_code);

	if (GIF_sort)
    {
		bBuffer[4] |= 0x08;
	}

    NSMutableData *GIF_string = [NSMutableData dataWithData:[[NSString stringWithString:@"GIF89a"] dataUsingEncoding: NSUTF8StringEncoding]];
	[GIF_screen setData:[NSData dataWithBytes:bBuffer length:blength]];
    [GIF_string appendData: GIF_screen];

	if (GIF_colorF == 1)
    {
		[self GIFGetBytes:(3 * GIF_size)];
		[GIF_string appendData:GIF_buffer];
	}
    else
    {
		[GIF_string appendData:GIF_global];
	}

	// Add Graphic Control Extension Frame (for transparancy)
	[GIF_string appendData:frame.header];

	char endC = 0x2c;
	[GIF_string appendBytes:&endC length:sizeof(endC)];

	size_t clength = [GIF_screenTmp length];
	unsigned char cBuffer[clength];
	[GIF_screenTmp getBytes:cBuffer length:clength];

	cBuffer[8] &= 0x40;

	[GIF_screenTmp setData:[NSData dataWithBytes:cBuffer length:clength]];

	[GIF_string appendData: GIF_screenTmp];
	[self GIFGetBytes:1];
	[GIF_string appendData: GIF_buffer];

	while (true)
    {
		[self GIFGetBytes:1];
		[GIF_string appendData: GIF_buffer];

		unsigned char dBuffer[1];
		[GIF_buffer getBytes:dBuffer length:1];

		long u = (long) dBuffer[0];

		if (u != 0x00)
        {
			[self GIFGetBytes:u];
			[GIF_string appendData: GIF_buffer];
        }
        else
        {
            break;
        }

	}

	endC = 0x3b;
	[GIF_string appendBytes:&endC length:sizeof(endC)];

	// save the frame into the array of frames
	frame.data = GIF_string;
}

- (bool) GIFGetBytes:(int)length {
    if (GIF_buffer != nil)
    {
        //[GIF_buffer release]; // Release old buffer
        GIF_buffer = nil;
    }

	if ((NSInteger)[GIF_pointer length] >= dataPointer + length) // Don't read across the edge of the file..
    {
		GIF_buffer = [GIF_pointer subdataWithRange:NSMakeRange(dataPointer, length)] ;
        dataPointer += length;
		return YES;
	}
    else
    {
        return NO;
	}
}

- (bool) GIFSkipBytes: (int) length {
    if ((NSInteger)[GIF_pointer length] >= dataPointer + length)
    {
        dataPointer += length;
        return YES;
    }
    else
    {
    	return NO;
    }
}

- (NSData*) getFrameAsDataAtIndex:(int)index {
	if (index < (NSInteger)[GIF_frames count])
	{
		return ((AnimatedGifFrame *)[GIF_frames objectAtIndex:index]).data;
	}
	else
	{
		return nil;
	}
}

- (UIImage*) getFrameAsImageAtIndex:(int)index {
    NSData *frameData = [self getFrameAsDataAtIndex: index];
    UIImage *image = nil;

    if (frameData != nil)
    {
		image = [UIImage imageWithData:frameData];
    }

    return image;
}

@end


text:
package rpc

import (
	"context"
	"time"

	"github.com/zrepl/zrepl/rpc/transportmux"
	"github.com/zrepl/zrepl/transport"
	"github.com/zrepl/zrepl/util/envconst"
)

type demuxedListener struct {
	control, data transport.AuthenticatedListener
}

const (
	transportmuxLabelControl string = "zrepl_control"
	transportmuxLabelData    string = "zrepl_data"
)

func demux(serveCtx context.Context, listener transport.AuthenticatedListener) demuxedListener {
	listeners, err := transportmux.Demux(
		serveCtx, listener,
		[]string{transportmuxLabelControl, transportmuxLabelData},
		envconst.Duration("ZREPL_TRANSPORT_DEMUX_TIMEOUT", 10*time.Second),
	)
	if err != nil {
		// transportmux API guarantees that the returned error can only be due
		// to invalid API usage (i.e. labels too long)
		panic(err)
	}
	return demuxedListener{
		control: listeners[transportmuxLabelControl],
		data:    listeners[transportmuxLabelData],
	}
}

type muxedConnecter struct {
	control, data transport.Connecter
}

func mux(rawConnecter transport.Connecter) muxedConnecter {
	muxedConnecters, err := transportmux.MuxConnecter(
		rawConnecter,
		[]string{transportmuxLabelControl, transportmuxLabelData},
		envconst.Duration("ZREPL_TRANSPORT_MUX_TIMEOUT", 10*time.Second),
	)
	if err != nil {
		// transportmux API guarantees that the returned error can only be due
		// to invalid API usage (i.e. labels too long)
		panic(err)
	}
	return muxedConnecter{
		control: muxedConnecters[transportmuxLabelControl],
		data:    muxedConnecters[transportmuxLabelData],
	}
}


text:
using System;
using System.Security.Principal;
using System.Web;
using Microsoft.Practices.Unity;
using NakedObjects.Architecture.Configuration;
using NakedObjects.Facade;
using NakedObjects.Facade.Impl;
using NakedObjects.Persistor.Entity.Configuration;
using NakedObjects.Facade.Impl.Implementation;
using NakedObjects.Facade.Impl.Utility;
using NakedObjects.Facade.Translation;
using NakedObjects.Unity;
using Common.Logging;
using NakedObjects.Facade.Interface;

namespace NakedObjects.Template
{
    /// <summary>
    /// Specifies the Unity configuration for the main container.
    /// </summary>
    public class UnityConfig
    {
        private static readonly ILog Logger = LogManager.GetLogger<UnityConfig>();

        #region Unity Container

        private static readonly Lazy<IUnityContainer> container = new Lazy<IUnityContainer>(() =>
        {
            var container = new UnityContainer();
            RegisterTypes(container);
            return container;
        });

        /// <summary>
        /// Gets the configured Unity container.
        /// </summary>
        public static IUnityContainer GetConfiguredContainer()
        {
            try
            {
                return container.Value;
            }
            catch (Exception e)
            {
                Logger.Error($"Error on Unity GetConfiguredContainer : {e.Message}");
                throw;
            }
        }

        #endregion
        /// <summary>Registers the type mappings with the Unity container.</summary>
        /// <param name="container">The unity container to configure.</param>
        /// <remarks>There is no need to register concrete types such as controllers or API controllers (unless you want to
        /// change the defaults), as Unity allows resolving a concrete type even if it was not previously registered.</remarks>
        public static void RegisterTypes(IUnityContainer container)
        {
            // NOTE: To load from web.config uncomment the line below. Make sure to add a Microsoft.Practices.Unity.Configuration to the using statements.
            // container.LoadConfiguration();
            //Standard configuration
            try
            {
                StandardUnityConfig.RegisterStandardFacetFactories(container);
                StandardUnityConfig.RegisterCoreContainerControlledTypes(container);
                StandardUnityConfig.RegisterCorePerTransactionTypes<PerResolveLifetimeManager>(container);

                // config
                container.RegisterInstance<IReflectorConfiguration>(NakedObjectsRunSettings.ReflectorConfig(), (new ContainerControlledLifetimeManager()));
                container.RegisterInstance<IEntityObjectStoreConfiguration>(NakedObjectsRunSettings.EntityObjectStoreConfig(), new ContainerControlledLifetimeManager());

                // frameworkFacade
                container.RegisterType<IOidTranslator, OidTranslatorSlashSeparatedTypeAndIds>(new PerResolveLifetimeManager());

                container.RegisterType<IOidStrategy, EntityOidStrategy>(new PerResolveLifetimeManager());
                container.RegisterType<IStringHasher, SimpleStringHasher>(new PerResolveLifetimeManager());
                container.RegisterType<IFrameworkFacade, FrameworkFacade>(new PerResolveLifetimeManager());

                //Externals
                container.RegisterType<IPrincipal>(new InjectionFactory(c => HttpContext.Current.User));
            }
            catch (Exception e)
            {
                Logger.Error($"Error on Unity RegisterTypes : {e.Message}");
                throw;
            }
        }
    }
}


text:
@echo off
setlocal enabledelayedexpansion

where dotnet >nul 2>nul

if NOT "%ERRORLEVEL%"=="0" (
    echo dotnet needs to be installed. https://dotnet.microsoft.com/download/dotnet-core
    exit /b -1
)

dotnet script -v >nul 2>nul

if NOT "%ERRORLEVEL%"=="0" (
    echo dotnet script needs to be installed. Run 'dotnet tool install -g dotnet-script'.
    echo More Information: https://github.com/filipw/dotnet-script#net-core-global-tool
    exit /b -1
)

dotnet script %~dp0\Setup.csx %*
exit /b %ERRORLEVEL%


text:
using JoinRpg.DataModel;
using JoinRpg.Services.Interfaces;

namespace JoinRpg.Web.Models.Exporters;

public class FinanceOperationExporter : CustomExporter<FinOperationListItemViewModel>
{
    public FinanceOperationExporter(Project project, IUriService uriService) : base(
        uriService) => Project = project;

    private Project Project { get; }

    public override IEnumerable<ITableColumn> ParseColumns()
    {
        yield return IntColumn(x => x.FinanceOperationId);
        yield return IntColumn(x => x.Money);
        yield return IntColumn(x => x.FeeChange);
        yield return ShortUserColumn(x => x.PaymentMaster);
        yield return StringColumn(x => x.PaymentTypeName);
        yield return ShortUserColumn(x => x.MarkingMaster);
        yield return DateTimeColumn(x => x.OperationDate);
        yield return StringColumn(x => x.Claim);
        yield return UriColumn(x => x);
        foreach (var c in UserColumn(x => x.Player))
        {
            yield return c;
        }
    }
}


text:
<?php

if (!defined('MEDIAWIKI')) {
        die(-1);
}

$wgExtensionCredits['other'][] = array(
        'name'         => 'SICEKIT: CSS',
        'version'      => '0.0',
        'author'       => 'SICEKIT Development Team <team@sicekit.org>',
        'url'          => 'http://sicekit.org',
        'description'  => 'Adds SICEKIT CSS to HTML output'
);

$wgHooks['SkinTemplateSetupPageCss'][] = 'SICEKIT_CSS_HookSkinTemplateSetupPageCss';

function SICEKIT_CSS_GetCssImport($css_page_name, $media = '') {
        global $wgSquidMaxage;
	$query = wfArrayToCGI( array(
		'usemsgcache' => 'yes',
		'ctype' => 'text/css',
		'action' => 'raw',
		'smaxage' => $wgSquidMaxage,
		'maxage' => $wgSquidMaxage,
	));

	$title = Title::makeTitleSafe( NS_MEDIAWIKI, $css_page_name );
	if (!is_object($title))
		return "";
	$url = $title->getLocalURL( $query );
	$import = "@import url(\"$url\") $media;\n";
	return $import;
}

function SICEKIT_CSS_HookSkinTemplateSetupPageCss( &$out ) {
	$out .= "/* Generated by SICEKIT_CSS_HookSkinTemplateSetupPageCss */\n";
	$out .= SICEKIT_CSS_GetCssImport('SICEKIT.css');
	$out .= SICEKIT_CSS_GetCssImport('SICEKIT-print.css', 'print');
	$out .= "/* end */\n";
	return true;
}


text:
package mx.iteso.desi.cloud.keyvalue;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

public class MemStorage extends BasicKeyValueStore {

    Map<String, List<String>> storage = new HashMap<>();

    @Override
    public Set<String> get(String search) {
        Set<String> theSet = new HashSet<String>();
        if (storage.containsKey(search)) {
            theSet.addAll(storage.get(search));
        }

        return theSet;
    }

    @Override
    public boolean exists(String search) {
        return storage.containsKey(search);
    }

    @Override
    public Set<String> getPrefix(String search) {
        Set<String> results = new HashSet<String>();

        for (String k : storage.keySet()) {
            if (k.startsWith(search)) {
                results.addAll(storage.get(k));
            }
        }
        return results;
    }

    @Override
    public void addToSet(String keyword, String value) {
        if (!storage.containsKey(keyword)) {
            storage.put(keyword, new ArrayList<String>());
        }

        storage.get(keyword).add(value);
    }

    @Override
    public void put(String keyword, String value) {
        addToSet(keyword, value);
    }

    @Override
    public void close() {
        // TODO Auto-generated method stub

    }

    @Override
    public void sync() {
        // TODO Auto-generated method stub

    }

    @Override
    public boolean isCompressible() {
        // TODO Auto-generated method stub
        return false;
    }

    @Override
    public boolean supportsMoreThan256Attributes() {
        return true;
    }

    public boolean supportsPrefixes() {
        return true;
    }

}

// EOF


text:
file=$1
unfs_version=$2
test_dir="$(dirname $(readlink -f $BASH_SOURCE))"
tests_dir="${test_dir}/tests"
hookit_dir="$(dirname ${test_dir})/hookit"

# Ensure an argument was provided
if [[ $# -lt 1 ]]; then
  echo "Fatal: Must provide a test file as an argument"
  exit 1
fi

# Ensure the argument provided is a path to a file
if [[ ! -f ${tests_dir}/${file} ]]; then
  echo "Fatal: Test provided does not exist in tests (${file})"
  exit 1
fi

# Ensure the test is a .bats test file
filename=$(basename "${file}")
extension="${filename##*.}"

if [[ ! "$extension" = "bats" ]]; then
  echo "Fatal: Test provided is not a bats file (${file})"
  exit 1
fi

# Ensure a version was provided
if [[ -z "$unfs_version" ]]; then
  echo "Fatal: UNFS version must be specified as the second argument"
  exit 1
fi

echo "+> Running test ${file}:"

cd $test_dir

VERSION=$unfs_version \
${test_dir}/util/bats/bin/bats \
  ${tests_dir}/${file} \
    2>&1 \
      | (grep '\S' || echo "") \
        | sed -e 's/\r//g;s/^/   /'

# test the exit code
if [[ "${PIPESTATUS[0]}" != "0" ]]; then
  echo "   [!] FAILED"
  exit 1
else
  echo "   [√] SUCCESS"
fi


text:
@interface PodsDummy_XProgressRing : NSObject
@end
@implementation PodsDummy_XProgressRing
@end


text:
#include "curlcheck.h"

#include "speedcheck.h"
#include "urldata.h"

static CURLcode unit_setup(void)
{
  return CURLE_OK;
}

static void unit_stop(void)
{

}

static int runawhile(struct Curl_easy *easy,
                     long time_limit,
                     long speed_limit,
                     curl_off_t speed,
                     int dec)
{
  int counter = 1;
  struct timeval now = {1, 0};
  CURLcode result;
  int finaltime;

  curl_easy_setopt(easy, CURLOPT_LOW_SPEED_LIMIT, speed_limit);
  curl_easy_setopt(easy, CURLOPT_LOW_SPEED_TIME, time_limit);
  Curl_speedinit(easy);

  do {
    /* fake the current transfer speed */
    easy->progress.current_speed = speed;
    result = Curl_speedcheck(easy, now);
    if(result)
      break;
    /* step the time */
    now.tv_sec = ++counter;
    speed -= dec;
  } while(counter < 100);

  finaltime = (int)(now.tv_sec - 1);

  return finaltime;
}

UNITTEST_START
{
  struct Curl_easy *easy = curl_easy_init();
  abort_unless(easy, "out of memory");

  fail_unless(runawhile(easy, 41, 41, 40, 0) == 41,
              "wrong low speed timeout");
  fail_unless(runawhile(easy, 21, 21, 20, 0) == 21,
              "wrong low speed timeout");
  fail_unless(runawhile(easy, 60, 60, 40, 0) == 60,
              "wrong log speed timeout");
  fail_unless(runawhile(easy, 50, 50, 40, 0) == 50,
              "wrong log speed timeout");
  fail_unless(runawhile(easy, 40, 40, 40, 0) == 99,
              "should not time out");
  fail_unless(runawhile(easy, 10, 50, 100, 2) == 36,
              "bad timeout");

  curl_easy_cleanup(easy);

  return 0;
}
UNITTEST_STOP


text:
define([
    './defaultValue',
    './defined',
    './defineProperties',
    './DeveloperError'
], function(
    defaultValue,
    defined,
    defineProperties,
    DeveloperError) {
    'use strict';

    var nextCreditId = 0;
    var creditToId = {};

    function getElement(credit) {
        var element = document.createElement('span');
        var text = credit.text;
        var link = credit.link;
        var a;
        if (credit._hasImage) {
            var content = document.createElement('img');
            content.src = credit.imageUrl;
            if (defined(text)) {
                content.alt = text;
                content.title = text;
            }
            if (credit._hasLink) {
                a = document.createElement('a');
                a.appendChild(content);
                a.href = link;
                a.target = '_blank';
                element.appendChild(a);
            } else {
                element.appendChild(content);
            }
            element.className = 'cesium-credit-image';
        } else {
            if (credit._hasLink) {
                a = document.createElement('a');
                a.textContent = text;
                a.href = link;
                a.target = '_blank';
                element.appendChild(a);
            } else {
                element.textContent = text;
            }
            element.className = 'cesium-credit-text';
        }
        return element;
    }

    /**
     * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
     * @param {Object} [options] An object with the following properties
     * @param {String} [options.text] The text to be displayed on the screen if no imageUrl is specified.
     * @param {String} [options.imageUrl] The source location for an image
     * @param {String} [options.link] A URL location for which the credit will be hyperlinked
     * @param {Boolean} [options.showOnScreen=false] If true, the credit will be visible in the main credit container.  Otherwise, it will appear in a popover
     *
     * @alias Credit
     * @constructor
     *
     * @exception {DeveloperError} options.text, options.imageUrl, or options.link is required.
     *
     * @example
     * //Create a credit with a tooltip, image and link
     * var credit = new Cesium.Credit({
     *     text : 'Cesium',
     *     imageUrl : '/images/cesium_logo.png',
     *     link : 'https://cesiumjs.org/'
     * });
     */
    function Credit(options) {
        options = defaultValue(options, defaultValue.EMPTY_OBJECT);

        var text = options.text;
        var imageUrl = options.imageUrl;
        var link = options.link;
        var showOnScreen = defaultValue(options.showOnScreen, false);

        var hasLink = (defined(link));
        var hasImage = (defined(imageUrl));
        var hasText = (defined(text));

        //>>includeStart('debug', pragmas.debug);
        if (!hasText && !hasImage && !hasLink) {
            throw new DeveloperError('options.text, options.imageUrl, or options.link is required.');
        }
        //>>includeEnd('debug');

        if (!hasText && !hasImage) {
            text = link;
        }

        this._text = text;
        this._imageUrl = imageUrl;
        this._link = link;
        this._hasLink = hasLink;
        this._hasImage = hasImage;
        this._showOnScreen = showOnScreen;

        // Credits are immutable so generate an id to use to optimize equal()
        var id;
        var key = JSON.stringify([text, imageUrl, link]);

        if (defined(creditToId[key])) {
            id = creditToId[key];
        } else {
            id = nextCreditId++;
            creditToId[key] = id;
        }

        this._id = id;

        this._element = undefined;
    }

    defineProperties(Credit.prototype, {
        /**
         * The credit text
         * @memberof Credit.prototype
         * @type {String}
         * @readonly
         */
        text : {
            get : function() {
                return this._text;
            }
        },

        /**
         * The source location for the image.
         * @memberof Credit.prototype
         * @type {String}
         * @readonly
         */
        imageUrl : {
            get : function() {
                return this._imageUrl;
            }
        },

        /**
         * A URL location for the credit hyperlink
         * @memberof Credit.prototype
         * @type {String}
         * @readonly
         */
        link : {
            get : function() {
                return this._link;
            }
        },

        /**
         * @memberof Credit.prototype
         * @type {Number}
         * @readonly
         *
         * @private
         */
        id : {
            get : function() {
                return this._id;
            }
        },

        /**
         * Whether the credit should be displayed on screen or in a lightbox
         * @memberof Credit.prototype
         * @type {Boolean}
         * @readonly
         */
        showOnScreen : {
            get : function() {
                return this._showOnScreen;
            }
        },

        /**
         * Gets the credit element
         * @memberof Credit.prototype
         * @type {HTMLElement}
         * @readonly
         */
        element: {
            get: function() {
                if (!defined(this._element)) {
                    this._element = getElement(this);
                }
                return this._element;
            }
        }
    });

    /**
     * Returns true if the credit has an imageUrl
     *
     * @returns {Boolean}
     */
    Credit.prototype.hasImage = function() {
        return this._hasImage;
    };

    /**
     * Returns true if the credit has a link
     *
     * @returns {Boolean}
     */
    Credit.prototype.hasLink = function() {
        return this._hasLink;
    };

    /**
     * Returns true if the credits are equal
     *
     * @param {Credit} left The first credit
     * @param {Credit} right The second credit
     * @returns {Boolean} true if left and right are equal, false otherwise.
     */
    Credit.equals = function(left, right) {
        return (left === right) ||
               ((defined(left)) &&
                (defined(right)) &&
                (left._id === right._id));
    };

    /**
     * Returns true if the credits are equal
     *
     * @param {Credit} credit The credit to compare to.
     * @returns {Boolean} true if left and right are equal, false otherwise.
     */
    Credit.prototype.equals = function(credit) {
        return Credit.equals(this, credit);
    };

    return Credit;
});


text:
package test.silhouettedetector;

import org.opencv.core.Mat;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;

public class SilhouetteDetector {

	private Mat image;

	public SilhouetteDetector(Mat image, int sensibility, int repaintTone) {
		this.image = image;
		Imgproc.threshold(image, image, sensibility, repaintTone, 1);
	}

	public SilhouetteDetector(String imagePath, int sensibility, int repaintTone) {
		image = Imgcodecs.imread(imagePath, Imgcodecs.IMREAD_GRAYSCALE);
		Imgproc.threshold(image, image, sensibility, repaintTone, 1);
	}

	public Mat getProcessedImage() {
		return image;
	}

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.blazebit</groupId>
        <artifactId>blaze-weblink-modules-dispatcher</artifactId>
        <version>0.2.2-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>blaze-weblink-modules-dispatcher-redirect</artifactId>
    <packaging>jar</packaging>

    <name>Blazebit weblink Modules Dispatcher Redirect</name>

    <dependencies>
		<dependency>
			<groupId>javax</groupId>
			<artifactId>javaee-api</artifactId>
            <scope>provided</scope>
		</dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>blaze-weblink-core-api</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>blaze-weblink-modules-dispatcher-base</artifactId>
        </dependency>
	</dependencies>

</project>