text:
package client

import (
	"github.com/rancher/norman/types"
)

const (
	ProjectRoleTemplateBindingType                  = "projectRoleTemplateBinding"
	ProjectRoleTemplateBindingFieldAnnotations      = "annotations"
	ProjectRoleTemplateBindingFieldCreated          = "created"
	ProjectRoleTemplateBindingFieldCreatorID        = "creatorId"
	ProjectRoleTemplateBindingFieldGroupId          = "groupId"
	ProjectRoleTemplateBindingFieldGroupPrincipalId = "groupPrincipalId"
	ProjectRoleTemplateBindingFieldLabels           = "labels"
	ProjectRoleTemplateBindingFieldName             = "name"
	ProjectRoleTemplateBindingFieldNamespaceId      = "namespaceId"
	ProjectRoleTemplateBindingFieldOwnerReferences  = "ownerReferences"
	ProjectRoleTemplateBindingFieldProjectId        = "projectId"
	ProjectRoleTemplateBindingFieldRemoved          = "removed"
	ProjectRoleTemplateBindingFieldRoleTemplateId   = "roleTemplateId"
	ProjectRoleTemplateBindingFieldUserId           = "userId"
	ProjectRoleTemplateBindingFieldUserPrincipalId  = "userPrincipalId"
	ProjectRoleTemplateBindingFieldUuid             = "uuid"
)

type ProjectRoleTemplateBinding struct {
	types.Resource
	Annotations      map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	Created          string            `json:"created,omitempty" yaml:"created,omitempty"`
	CreatorID        string            `json:"creatorId,omitempty" yaml:"creatorId,omitempty"`
	GroupId          string            `json:"groupId,omitempty" yaml:"groupId,omitempty"`
	GroupPrincipalId string            `json:"groupPrincipalId,omitempty" yaml:"groupPrincipalId,omitempty"`
	Labels           map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Name             string            `json:"name,omitempty" yaml:"name,omitempty"`
	NamespaceId      string            `json:"namespaceId,omitempty" yaml:"namespaceId,omitempty"`
	OwnerReferences  []OwnerReference  `json:"ownerReferences,omitempty" yaml:"ownerReferences,omitempty"`
	ProjectId        string            `json:"projectId,omitempty" yaml:"projectId,omitempty"`
	Removed          string            `json:"removed,omitempty" yaml:"removed,omitempty"`
	RoleTemplateId   string            `json:"roleTemplateId,omitempty" yaml:"roleTemplateId,omitempty"`
	UserId           string            `json:"userId,omitempty" yaml:"userId,omitempty"`
	UserPrincipalId  string            `json:"userPrincipalId,omitempty" yaml:"userPrincipalId,omitempty"`
	Uuid             string            `json:"uuid,omitempty" yaml:"uuid,omitempty"`
}
type ProjectRoleTemplateBindingCollection struct {
	types.Collection
	Data   []ProjectRoleTemplateBinding `json:"data,omitempty"`
	client *ProjectRoleTemplateBindingClient
}

type ProjectRoleTemplateBindingClient struct {
	apiClient *Client
}

type ProjectRoleTemplateBindingOperations interface {
	List(opts *types.ListOpts) (*ProjectRoleTemplateBindingCollection, error)
	Create(opts *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error)
	Update(existing *ProjectRoleTemplateBinding, updates interface{}) (*ProjectRoleTemplateBinding, error)
	ByID(id string) (*ProjectRoleTemplateBinding, error)
	Delete(container *ProjectRoleTemplateBinding) error
}

func newProjectRoleTemplateBindingClient(apiClient *Client) *ProjectRoleTemplateBindingClient {
	return &ProjectRoleTemplateBindingClient{
		apiClient: apiClient,
	}
}

func (c *ProjectRoleTemplateBindingClient) Create(container *ProjectRoleTemplateBinding) (*ProjectRoleTemplateBinding, error) {
	resp := &ProjectRoleTemplateBinding{}
	err := c.apiClient.Ops.DoCreate(ProjectRoleTemplateBindingType, container, resp)
	return resp, err
}

func (c *ProjectRoleTemplateBindingClient) Update(existing *ProjectRoleTemplateBinding, updates interface{}) (*ProjectRoleTemplateBinding, error) {
	resp := &ProjectRoleTemplateBinding{}
	err := c.apiClient.Ops.DoUpdate(ProjectRoleTemplateBindingType, &existing.Resource, updates, resp)
	return resp, err
}

func (c *ProjectRoleTemplateBindingClient) List(opts *types.ListOpts) (*ProjectRoleTemplateBindingCollection, error) {
	resp := &ProjectRoleTemplateBindingCollection{}
	err := c.apiClient.Ops.DoList(ProjectRoleTemplateBindingType, opts, resp)
	resp.client = c
	return resp, err
}

func (cc *ProjectRoleTemplateBindingCollection) Next() (*ProjectRoleTemplateBindingCollection, error) {
	if cc != nil && cc.Pagination != nil && cc.Pagination.Next != "" {
		resp := &ProjectRoleTemplateBindingCollection{}
		err := cc.client.apiClient.Ops.DoNext(cc.Pagination.Next, resp)
		resp.client = cc.client
		return resp, err
	}
	return nil, nil
}

func (c *ProjectRoleTemplateBindingClient) ByID(id string) (*ProjectRoleTemplateBinding, error) {
	resp := &ProjectRoleTemplateBinding{}
	err := c.apiClient.Ops.DoByID(ProjectRoleTemplateBindingType, id, resp)
	return resp, err
}

func (c *ProjectRoleTemplateBindingClient) Delete(container *ProjectRoleTemplateBinding) error {
	return c.apiClient.Ops.DoResourceDelete(ProjectRoleTemplateBindingType, &container.Resource)
}


text:
/*globals jQuery, ajaxurl, wpml_st_disable_notices_strings */

function wpml_st_hide_strings_scan_notices(element, callback) {
	"use strict";

		var buttonNo = wpml_st_disable_notices_strings.no;
		var buttonYes = wpml_st_disable_notices_strings.yes;

		var dialog = jQuery('

' + wpml_st_disable_notices_strings.message + '

');
		dialog.css('display', 'none');
		dialog.dialog({
										resizable: false,
										height:    "auto",
										width:     "auto",
										modal:     true,
										buttons:   {
											buttonNo:  {
												text:  buttonNo,
												click: function () {
													if (typeof callback === 'function') {
														callback();
													}
													dialog.dialog("close");
												}
											},
											buttonYes: {
												text:  buttonYes,
												class: 'button-primary',
												click: function () {
													jQuery.ajax({
																				url:      ajaxurl,
																				type:     'POST',
																				data:     {
																					action: 'hide_strings_scan_notices'
																				},
																				dataType: 'json',
																				complete: function () {
																					if (typeof callback === 'function') {
																						callback();
																					}
																					dialog.dialog("close");
																				}
																			});

												}
											}
										}
									});
}

redpajama_set_name: RedPajamaGithub


text:
var path = require('path')

module.exports = {
    build: {
        env: {NODE_ENV: '"production"'},
        index: path.resolve(__dirname, '../weixin/index.html'),
        assetsRoot: path.resolve(__dirname, '../weixin'),
        assetsSubDirectory: 'static',
        assetsPublicPath: '/',
        productionSourceMap: true,
        // Gzip off by default as many popular static hosts such as
        // Surge or Netlify already gzip all static assets for you.
        // Before setting to `true`, make sure to:
        // npm install --save-dev compression-webpack-plugin
        productionGzip: false,
        productionGzipExtensions: ['js', 'css']
    },
    dev: {
        env: {NODE_ENV: '"development"'},
        port: 8882,
        assetsSubDirectory: 'static',
        assetsPublicPath: '/',
        context: [ //代理路径
            // '/shopping',
            // '/v1',
            // '/v2',
            // '/v3',
            // '/v4',
        ],
       // proxypath: 'https://mainsite-restapi.ele.me',//代理路径
        // CSS Sourcemaps off by default because relative paths are "buggy"
        // with this option, according to the CSS-Loader README
        // (https://github.com/webpack/css-loader#sourcemaps)
        // In our experience, they generally work as expected,
        // just be aware of this issue when enabling this option.
        cssSourceMap: false
    }
}


text:
package org.openspaces.core.executor.support;

/**
 * An exception indicating there are no results to reduce.
 *
 * @author kimchy
 */
public class NoResultsException extends Exception {

    private static final long serialVersionUID = 2192604921668646280L;

    public NoResultsException(String message) {
        super(message);
    }
}


text:
<?php
namespace App\Model\Table;

use Cake\ORM\Query;
use Cake\ORM\RulesChecker;
use Cake\ORM\Table;
use Cake\ORM\TableRegistry;
use Cake\Validation\Validator;

/**
 * Postulations Model
 *
 * @property \Cake\ORM\Association\BelongsTo $Positions
 *
 * @method \App\Model\Entity\Postulation get($primaryKey, $options = [])
 * @method \App\Model\Entity\Postulation newEntity($data = null, array $options = [])
 * @method \App\Model\Entity\Postulation[] newEntities(array $data, array $options = [])
 * @method \App\Model\Entity\Postulation|bool save(\Cake\Datasource\EntityInterface $entity, $options = [])
 * @method \App\Model\Entity\Postulation patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
 * @method \App\Model\Entity\Postulation[] patchEntities($entities, array $data, array $options = [])
 * @method \App\Model\Entity\Postulation findOrCreate($search, callable $callback = null, $options = [])
 *
 * @mixin \Cake\ORM\Behavior\TimestampBehavior
 */
class PostulationsTable extends Table
{

    /**
     * Initialize method
     *
     * @param array $config The configuration for the Table.
     * @return void
     */
    public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setTable('postulations');
        $this->setDisplayField('name');
        $this->setPrimaryKey('id');

        $this->addBehavior('Timestamp');

        $this->belongsTo('Positions', [
            'foreignKey' => 'position_id',
            'joinType' => 'INNER'
        ]);
    }

    public function getTotals()
    {
        return $this->getSummary()->count();
    }

    public function getSummary()
    {
        $postulations = TableRegistry::get('Postulations');
        $query = $postulations->find();

        $query->select(['position' => 'Positions.title'])
            ->select($postulations)
            ->contain('Positions')
            ->order(['Postulations.id' => 'DESC']);

        return $query;
    }

    public function export($fields)
    {
        $postulations = TableRegistry::get('Postulations');
        $query = $postulations->find();

        $query->select($fields)
            ->select(['titlePosition' => 'Positions.title'])
            ->contain('Positions')
            ->order(['Postulations.id' => 'DESC']);

        return $query;
    }

    public function getRecord($id)
    {
        $postulations = TableRegistry::get('postulations');
        $query = $postulations->find();

        $query->select(['titlePosition' => 'Positions.title'])
            ->select($postulations)
            ->contain('Positions')
            ->where([
                'Postulations.id = :id'
            ])
            ->bind(':id', $id, 'integer')
            ->order(['Postulations.id' => 'DESC']);

        return $query;
    }

    /**
     * Default validation rules.
     *
     * @param \Cake\Validation\Validator $validator Validator instance.
     * @return \Cake\Validation\Validator
     */
    public function validationDefault(Validator $validator)
    {
        $validator
            ->integer('id')
            ->allowEmpty('id', 'create');

        $validator
            ->requirePresence('name', 'create')
            ->notEmpty('name');

        $validator
            ->email('email')
            ->requirePresence('email', 'create')
            ->notEmpty('email');

        $validator
            ->requirePresence('file', 'create')
            ->notEmpty('file')
            ->add('file', [
                'Invalid-Extension' => [
                    'rule' => ['extension',['doc', 'docx', 'pdf']],
                    'message' => __('Only these files extension are allowed: .doc, .pdf')
                ]
            ]);

        $validator
            ->allowEmpty('file', 'update')
            ->add('file', [
                'Invalid-Extension' => [
                    'rule' => ['extension',['doc', 'docx', 'pdf']],
                    'message' => __('Only these files extension are allowed: .doc, .pdf')
                ]
            ]);

        $validator
            ->requirePresence('linkedin', 'create')
            ->notEmpty('linkedin');

        return $validator;
    }

    /**
     * Returns a rules checker object that will be used for validating
     * application integrity.
     *
     * @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
     * @return \Cake\ORM\RulesChecker
     */
    public function buildRules(RulesChecker $rules)
    {
        $rules->add($rules->isUnique(['email']));
        $rules->add($rules->existsIn(['position_id'], 'Positions'));

        return $rules;
    }
}


text:
#ifndef __CCB_SEQUENCE_PROPERTY_H__
#define __CCB_SEQUENCE_PROPERTY_H__

#include "base/CCRef.h"
#include "base/CCVector.h"
#include "editor-support/cocosbuilder/CCBKeyframe.h"

namespace cocosbuilder {

class CC_DLL CCBSequenceProperty : public cocos2d::Ref
{
public:
    /**
     * @js ctor
     */
    CCBSequenceProperty();
    /**
     * @js NA
     * @lua NA
     */
    ~CCBSequenceProperty();

    virtual bool init();

    const char* getName();
    void setName(const char* pName);

    int getType();
    void setType(int type);

    cocos2d::Vector<CCBKeyframe*>& getKeyframes();

private:
    std::string _name;
    int _type;
    cocos2d::Vector<CCBKeyframe*> _keyframes;
};

}

#endif // __CCB_SEQUENCE_PROPERTY_H__


text:
Enables you to quickly install authentication pages and authorization.

## Install

Before installing, make sure your database and mail settings are correct.

To install this package, follow the steps below:

1. add ``"piek-j/b302-authentication": "~1.0"`` to your composer.json;
2. run the command ``composer update`` to install the package;
3. add the service provider ``PiekJ\B302Authentication\B302AuthenticationServiceProvider`` to your app.php config;
4. change the model in your auth.php config to ``PiekJ\B302Authentication\User``;
5. run the command ``php artisan config:publish zizaco/entrust``;
6. change the role in the ``config/package/zizaco/entrust/config.php`` to ``PiekJ\B302Authentication\Role``;
7. change the permission in the ``config/package/zizaco/entrust/config.php`` to ``PiekJ\B302Authentication\Permission``;
8. run the following commands ``php artisan b302-auth:migration`` (type for every confirm ``Y``), ``php artisan migrate`` and ``php artisan b302-auth:create-user``.

Go visit http://yoururl/users/login to login with the newly created user (email: admin@admin.nl, password: admin).

## Guide

### Urls

| Url | Description |
| --- | --- |
| /users/login | Shows up the login form |
| /users/create | Shows up the signup form |
| /users/forgot_password | The form to request a password reset mail |
| /users/reset_password/{{token}} | Fill in your new password to reset |
| /users/confirm/{{token}} | Here the users confirm his account |

For more detailed urls view [routes.php](src/routes.php) and the [B302AuthUserController.php](src/controllers/B302AuthUsersController.php).

### Updating templates

You can use the command ``php artisan view:publish piek-j\b302-authentication`` to copy the files to ``app/views/packages/piek-j/b302-authentication`` where you can edit them.

To edit the views of the forms and emails use the following command ``php artisan view:publish zizaco/confide`` to copy the files to ``ap/views/packages/zizaco/confide`` where you can edit them.

### More information

Authentication, take a look at [Zizaco/Confide](https://github.com/Zizaco/confide).

Role and permissions, take a look at [Zizaco/Entrust](https://github.com/Zizaco/entrust/tree/1.0).


text:
layout: page
title: Restore Productions Trade Fair
date: 2016-05-24
author: Jacqueline Buchanan
tags: weekly links, java
status: published
summary: Donec lobortis diam in risus vulputate, at.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 05/11/2016
  endDate: 05/13/2016
  ctyhocn: CAENWHX
  groupCode: RPTF
published: true
---
In scelerisque vehicula turpis a volutpat. Aliquam ut mi ut erat eleifend finibus luctus nec neque. Vivamus sed dui non nulla blandit tristique ac eu elit. Vivamus quis mi vel lacus consectetur egestas commodo eu tortor. Cras fringilla laoreet metus, id hendrerit nunc vehicula sit amet. Duis viverra eu dolor eu suscipit. Duis et nulla maximus tellus condimentum egestas vitae quis orci. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ultrices pharetra eros nec efficitur.

* Duis ut eros eget nunc eleifend dapibus sit amet quis urna
* Sed ac ipsum quis massa placerat aliquet eget et mi
* Vestibulum vitae nisi ac metus efficitur suscipit at ut eros.

Vestibulum accumsan ac risus eleifend facilisis. Nulla tincidunt augue molestie felis varius mollis. Sed ultricies, ex in molestie sollicitudin, dolor augue commodo nulla, vel fringilla est nibh et libero. Duis tempus, magna at efficitur molestie, dui mauris porta lorem, nec viverra urna sapien id enim. Donec tellus dolor, euismod et dignissim in, scelerisque nec elit. Donec laoreet posuere lectus, vel eleifend nibh commodo sed. Pellentesque et pretium nunc. Integer sit amet diam non nisl egestas ultrices. Donec placerat imperdiet consectetur. Integer nunc ante, viverra ornare tincidunt a, gravida sed nisi. Vivamus a nisl turpis. Aenean ac felis blandit ipsum cursus blandit. Etiam id justo nec est varius feugiat.


text:
This operation retrieves the users associated with a team within CAVE. The response contains the user information and their roles, in JSON format.

The operation can be executed only by users that are administrators or members of the team.

### Resource URL

`https://api.cavellc.io/organizations/{name}/teams/{team}/users`

### Resource Information

The request must be authenticated with a valid user token, as obtained from a login operation. See [POST /users/login](../users/login.md) for details. The token can be passed as the username (with an empty password) following the Basic Authentication scheme of the HTTP protocol. Alternatively, the same token can be accepted as a Bearer Token, similar to the OAuth2 specification.

### Example Request

    curl -i -u 8b896055-c295-4a30-a29c-5a97d15f1818: https://api.cavellc.io/organizations/acme/team/runners/users

### Example Response

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    Content-Length: 104
    Connection: keep-alive

    [
      {
        "user": {
          "first_name": "Joe",
          "last_name": "Appleseed",
          "email": "joe.appleseed@gmail.com"
        },
        "role": "admin"
      }
    ]

### See Also

* [Retrieve teams for organization](get-teams.md)
* [Create team](create-team.md)
* [Retrieve team info](get-team.md)
* [Delete team](delete-team.md)
* [Add user to team](add-team-user.md)
* [Modify role for user in team](modify-team-user.md)
* [Remove user from team](remove-team-user.md)

[Back to Teams](README.md)

[Back to API Main Page](../api.md)


text:
package ee.telekom.workflow.core.workitem;

import java.io.Serializable;
import java.util.Date;

import ee.telekom.workflow.facade.WorkflowEngineFacade;
import ee.telekom.workflow.graph.GraphWorkItem;
import ee.telekom.workflow.graph.WorkItemStatus;

/**
 * A work item is handle/reference to an uncompleted graph node execution in order
 * to complete it at some future point in time.
 *

 * A {@link WorkItem} is the persisted correspondent of a {@link GraphWorkItem}.
 *

 * This class is intended for internal usage within this module and should not
 * be passed to external clients via the {@link WorkflowEngineFacade}.
 *
 * @author Christian Klock
 */
public class WorkItem implements Serializable{

    private static final long serialVersionUID = 1L;
    private Long refNum;
    private Long woinRefNum;

    private int tokenId;
    private WorkItemStatus status;

    private String signal;
    private Date dueDate;

    private String bean;
    private String method;

    private String role;
    private String userName;

    private String arguments;
    private String result;

    public Long getRefNum(){
        return refNum;
    }

    public void setRefNum( Long refNum ){
        this.refNum = refNum;
    }

    public Long getWoinRefNum(){
        return woinRefNum;
    }

    public void setWoinRefNum( Long woinRefNum ){
        this.woinRefNum = woinRefNum;
    }

    public int getTokenId(){
        return tokenId;
    }

    public void setTokenId( int tokenId ){
        this.tokenId = tokenId;
    }

    public WorkItemStatus getStatus(){
        return status;
    }

    public void setStatus( WorkItemStatus status ){
        this.status = status;
    }

    public String getSignal(){
        return signal;
    }

    public void setSignal( String signal ){
        this.signal = signal;
    }

    public Date getDueDate(){
        return dueDate;
    }

    public void setDueDate( Date dueDate ){
        this.dueDate = dueDate;
    }

    public String getBean(){
        return bean;
    }

    public void setBean( String bean ){
        this.bean = bean;
    }

    public String getMethod(){
        return method;
    }

    public void setMethod( String method ){
        this.method = method;
    }

    public String getRole(){
        return role;
    }

    public void setRole( String role ){
        this.role = role;
    }

    public String getUserName(){
        return userName;
    }

    public void setUserName( String userName ){
        this.userName = userName;
    }

    public String getArguments(){
        return arguments;
    }

    public void setArguments( String arguments ){
        this.arguments = arguments;
    }

    public String getResult(){
        return result;
    }

    public void setResult( String result ){
        this.result = result;
    }

    public WorkItemType getType(){
        if( signal != null ){
            return WorkItemType.SIGNAL;
        }
        else if( dueDate != null ){
            return WorkItemType.TIMER;
        }
        else if( bean != null && method != null ){
            return WorkItemType.TASK;
        }
        else if( role != null || userName != null ){
            return WorkItemType.HUMAN_TASK;
        }
        else{
            throw new IllegalStateException( "Unknown work item type" );
        }
    }
}


text:
/** DASHBOARD **/
.kalamu-dashboard{
    position: relative;
}
.kalamu-dashboard .visible-editing{
    display: none;
}
.kalamu-dashboard.editing .visible-editing{
    display: block;
}

.kalamu-dashboard .ui-state-highlight{
    height: 150px;
    background: #aaa;
    border: 1px solid #555;
}

.kalamu-dashboard .kalamu-dashboard-viewport-switch .btn-group{
    margin-left: 15px;
}
.kalamu-dashboard .kalamu-dashboard-viewport-switch .btn{
    background-color: #f4f4f4 !important;
    color: #444 !important;
    border-color: #ddd !important;
}
.kalamu-dashboard .kalamu-dashboard-viewport-switch .btn.active{
   outline-offset: 0 !important;
   background-color: #31b0d5 !important;
   color: #fff !important;
   border-color: #269abc !important;
}

.row-config .btn {
    padding: 4px 2px 4px 3px;
}
.col-config .btn {
    padding: 0px 10px 0px 10px;
}

/** ROW **/
.kalamu-dashboard.editing .kalamu-dashboard-row{
    background: #f5f5f5;
    border: 1px solid #E9E9E9;
    margin-bottom: 1px;
    flex-wrap: nowrap;
    width: 100%;
}
.kalamu-dashboard.editing .kalamu-dashboard-row .row-config{
    width: 25px;
    vertical-align: top;
}
.kalamu-dashboard.editing .kalamu-dashboard-row .row-cols{
    display: flex;
    vertical-align: top;
}
.kalamu-dashboard.editing .kalamu-dashboard-row .btn-add-row{
    width: 25px;
}

.btn-add-row{
    padding: 4px 0px 4px 0px;

}

.visible-editing-widget .btn, .btn-add-widget{
    padding: 0px 10px 0px 10px;
    margin-bottom: 5px;
}

.kalamu-dashboard.editing .kalamu-dashboard-row:hover{
    background: #e5e5e5;
}

.visible-editing-row{
    padding: 0;
    width: 25px;
}

.visible-editing-row>a{
    display: block;
}

.visible-editing-row .link-label,
.kalamu-dashboard-col>.visible-editing .link-label,
.kalamu-dashboard.editing .visible-editing  .link-label{
    display: none;
}

.kalamu-dashboard.editing .kalamu-dashboard-generic-row{
    margin: 5px 0 0;
    padding: 5px;
    min-height: 0;
    border: none;
}
.kalamu-dashboard.editing .kalamu-dashboard-generic-row:hover{
    background: #f5f5f5;
}
.kalamu-dashboard-row .btn,
.kalamu-dashboard-section .btn{
    border-radius: 0 !important;
}

/** COL **/
.kalamu-dashboard-col{
    padding-left: 0;
    padding-right: 0;
}

.kalamu-dashboard.editing .kalamu-dashboard-col{
    padding: 0;
    border-width: 0 1px 0 0;
    border-style: dashed;
    border-color: #DDD;
}
.kalamu-dashboard.editing .col-config{
    box-shadow: 0px 0px 4px #555 inset;
}

.kalamu-dashboard.editing .kalamu-dashboard-col:last-child{
    border-width: 0;
}

.kalamu-dashboard-col .resizer-col{
    width: 5px;
    height: 23px;
    float: right;
    position: absolute;
    right: -3px;
    background: #999;
    border: 1px solid #ddd;
    border-width: 0 1px;
    cursor: col-resize;
    z-index: 10;
}

.kalamu-dashboard-col .col-config .collapse, .kalamu-dashboard-col .col-config .collapsing{
    position: absolute !important;
    right: 50px;
    top: 0;
    z-index: 10;
}

.kalamu-dashboard-col .col-widgets{
    min-height: 50px;
}
.kalamu-dashboard-col .btn-add-widget{
    margin-top: 10px;
    width: 50px;
}

/** WIDGET **/
.kalamu-dashboard.editing .kalamu-dashboard-widget{
    margin: 5px 0;
    border-radius: 5px;
    box-shadow: 0px 0px 3px #BBB;
    padding-bottom: 15px;
}

.kalamu-dashboard.editing .kalamu-dashboard-widget:hover{
    background: #d9d9d9 !important;
}

.kalamu-dashboard-widget.ui-sortable-handle{
    cursor: move;
}

.kalamu-dashboard.editing .kalamu-dashboard-widget .visible-editing-widget{
    visibility: hidden;
}
.kalamu-dashboard.editing .kalamu-dashboard-widget:hover .visible-editing-widget{
    visibility: visible;
}

.kalamu-dashboard-widget {
    padding-top: 10px;
}

/** SECTION **/
.section-config{
    margin: 10px 0;
}

.kalamu-dashboard-section>.panel>.panel-heading{
    padding: 0;
}
.kalamu-dashboard-section>.panel>.panel-heading a{
    padding: 10px 15px;
    display: block;
}

.kalamu-dashboard-section .visible-editing-row{
    left: 30px;
}
.kalamu-dashboard-section .panel-config{
    background: #ccc;
}

.visible-editing-section>a{
    display: block;
}

.visible-editing-section .link-label{
    display: none;
}

.kalamu-dashboard.editing a.visible-editing{
    display: inline-block;
}
.kalamu-dashboard-viewport-switch{
    margin-bottom: 10px;
}


text:
package org.apache.drill.exec.physical.resultSet.model.hyper;

import java.util.ArrayList;
import java.util.List;

import org.apache.drill.common.types.TypeProtos.DataMode;
import org.apache.drill.common.types.TypeProtos.MinorType;
import org.apache.drill.exec.exception.SchemaChangeException;
import org.apache.drill.exec.physical.impl.protocol.BatchAccessor;
import org.apache.drill.exec.physical.resultSet.model.ReaderBuilder;
import org.apache.drill.exec.physical.rowSet.HyperRowIndex;
import org.apache.drill.exec.physical.rowSet.RowSetReaderImpl;
import org.apache.drill.exec.record.VectorContainer;
import org.apache.drill.exec.record.VectorWrapper;
import org.apache.drill.exec.record.metadata.ColumnMetadata;
import org.apache.drill.exec.record.metadata.TupleMetadata;
import org.apache.drill.exec.record.metadata.VariantMetadata;
import org.apache.drill.exec.record.selection.SelectionVector4;
import org.apache.drill.exec.vector.ValueVector;
import org.apache.drill.exec.vector.accessor.ColumnReaderIndex;
import org.apache.drill.exec.vector.accessor.reader.AbstractObjectReader;
import org.apache.drill.exec.vector.accessor.reader.ArrayReaderImpl;
import org.apache.drill.exec.vector.accessor.reader.MapReader;
import org.apache.drill.exec.vector.accessor.reader.UnionReaderImpl;
import org.apache.drill.exec.vector.accessor.reader.VectorAccessor;
import org.apache.drill.exec.vector.accessor.reader.VectorAccessors;
import org.apache.drill.exec.vector.accessor.reader.VectorAccessors.BaseHyperVectorAccessor;

/**
 * Base reader builder for a hyper-batch. The semantics of hyper-batches are
 * a bit rough. When a single batch, we can walk the vector tree to get the
 * information we need. But, hyper vector wrappers don't provide that same
 * information, so we can't just walk them. Further, the code that builds
 * hyper-batches appears perfectly happy to accept batches with differing
 * schemas, something that will cause the readers to blow up because they
 * must commit to a particular kind of reader for each vector.
 *

 * The solution is to build the readers in two passes. The first builds a
 * metadata model for each batch and merges those models. (This version
 * requires strict identity in schemas; a fancier solution could handle,
 * say, the addition of map members in one batch vs. another or the addition
 * of union/list members across batches.)
 *

 * The metadata (by design) has the information we need, so in the second pass
 * we walk the metadata hierarchy and build up readers from that, creating
 * vector accessors as we go to provide a runtime path from the root vectors
 * (selected by the SV4) to the inner vectors (which are not represented as
 * hypervectors.)
 *

 * The hypervector wrapper mechanism provides a crude way to handle inner
 * vectors, but it is awkward, and does not lend itself to the kind of caching
 * we'd like for performance, so we use our own accessors for inner vectors.
 * The outermost hyper vector accessors wrap a hyper vector wrapper. Inner
 * accessors directly navigate at the vector level (from a vector provided by
 * the outer vector accessor.)
 */

public class HyperReaderBuilder extends ReaderBuilder {

  private static final HyperReaderBuilder INSTANCE = new HyperReaderBuilder();

  private HyperReaderBuilder() { }

  public static RowSetReaderImpl build(VectorContainer container, TupleMetadata schema, SelectionVector4 sv4) {
    HyperRowIndex rowIndex = new HyperRowIndex(sv4);
    return new RowSetReaderImpl(schema, rowIndex,
        INSTANCE.buildContainerChildren(container, schema));
  }

  /**
   * Build a hyper-batch reader given a batch accessor.
   *
   * @param batch wrapper which provides the container and SV4
   * @return a row set reader for the hyper-batch
   * @throws SchemaChangeException if the individual batches have
   * inconsistent schemas (say, a column in batch 1 is an INT, but in
   * batch 2 it is a VARCHAR)
   */

  public static RowSetReaderImpl build(BatchAccessor batch) throws SchemaChangeException {
    VectorContainer container = batch.container();
    return build(container,
        new HyperSchemaInference().infer(container),
        batch.selectionVector4());
  }

  /**
   * Vector accessor used by the column accessors to obtain the vector for
   * each column value. That is, position 0 might be batch 4, index 3,
   * while position 1 might be batch 1, index 7, and so on.
   *

   * Must be here: the reader layer is in the <tt>vector</tt> package
   * and does not have visibility to <tt>java-exec</tt> classes.
   */

  public static class HyperVectorAccessor extends BaseHyperVectorAccessor {

    private final ValueVector[] vectors;
    private ColumnReaderIndex rowIndex;

    public HyperVectorAccessor(VectorWrapper<?> vw) {
      super(vw.getField().getType());
      vectors = vw.getValueVectors();
    }

    @Override
    public void bind(ColumnReaderIndex index) {
      rowIndex = index;
    }

    @SuppressWarnings("unchecked")
    @Override
    public <T extends ValueVector> T vector() {
      return (T) vectors[rowIndex.hyperVectorIndex()];
    }
  }

  protected List<AbstractObjectReader> buildContainerChildren(
      VectorContainer container) throws SchemaChangeException {
    TupleMetadata schema = new HyperSchemaInference().infer(container);
    return buildContainerChildren(container, schema);
  }

  protected List<AbstractObjectReader> buildContainerChildren(
      VectorContainer container, TupleMetadata schema) {
    List<AbstractObjectReader> readers = new ArrayList<>();
    for (int i = 0; i < container.getNumberOfColumns(); i++) {
      VectorWrapper<?> vw = container.getValueVector(i);
      VectorAccessor va = new HyperVectorAccessor(vw);
      readers.add(buildVectorReader(va, schema.metadata(i)));
    }
    return readers;
  }

  protected AbstractObjectReader buildVectorReader(VectorAccessor va, ColumnMetadata metadata) {
    switch(metadata.type()) {
    case MAP:
      return buildMap(va, metadata.mode(), metadata);
    case UNION:
      return buildUnion(va, metadata);
    case LIST:
      return buildList(va, metadata);
    default:
      return buildScalarReader(va, metadata);
    }
  }

  private AbstractObjectReader buildMap(VectorAccessor va, DataMode mode, ColumnMetadata metadata) {

    boolean isArray = mode == DataMode.REPEATED;

    // Map type

    AbstractObjectReader mapReader = MapReader.build(
        metadata,
        isArray ? null : va,
        buildMapMembers(va, metadata.mapSchema()));

    // Single map

    if (! isArray) {
      return mapReader;
    }

    // Repeated map

    return ArrayReaderImpl.buildTuple(metadata, va, mapReader);
  }

  protected List<AbstractObjectReader> buildMapMembers(VectorAccessor va, TupleMetadata mapSchema) {
    List<AbstractObjectReader> readers = new ArrayList<>();
    for (int i = 0; i < mapSchema.size(); i++) {
      ColumnMetadata member = mapSchema.metadata(i);
      // Does not use the hyper-vector mechanism.

      readers.add(buildVectorReader(
          new VectorAccessors.MapMemberHyperVectorAccessor(va, i, member.majorType()),
          member));
    }
    return readers;
  }

  private AbstractObjectReader buildUnion(VectorAccessor unionAccessor, ColumnMetadata metadata) {
    VariantMetadata unionSchema = metadata.variantSchema();
    final AbstractObjectReader variants[] = new AbstractObjectReader[MinorType.values().length];
    for (ColumnMetadata member : unionSchema.members()) {

      // The following builds a synthetic field since we have no good way to
      // access the real field at this point.

      variants[member.type().ordinal()] = buildVectorReader(
          new VectorAccessors.UnionMemberHyperVectorAccessor(unionAccessor, member.majorType()),
          member);
    }
    return UnionReaderImpl.build(
        metadata,
        unionAccessor,
        variants);
  }

  // Note: Does not yet handle 2D lists. See the "single" base reader builder
  // for the needed code.

  private AbstractObjectReader buildList(VectorAccessor listAccessor,
      ColumnMetadata metadata) {
    VariantMetadata listSchema = metadata.variantSchema();
    ColumnMetadata dataMetadata = listSchema.listSubtype();
    return ArrayReaderImpl.buildList(metadata,
        listAccessor,
        buildVectorReader(
            new VectorAccessors.ListMemberHyperVectorAccessor(
                listAccessor, dataMetadata.majorType()),
            dataMetadata));
  }
}


text:
import { TodosFormModel } from '~/models/todosForm'

export class TodosFormViewModel extends TodosFormModel({}) {}


text:
class Entity;
class EntityManager;
class PhysicsComponent;

class PhysicsComponentMeta : public Component {
protected:
  using superclass = PhysicsComponentMeta;

public:
  DEFINE_COMPONENT_BASE();

  // AUTOGEN:: accessors
  inline float get_mass() const { return _mass; }
  inline void set_mass(float val) { _mass = val; }

  inline bool get_is_static() const { return _is_static; }
  inline void set_is_static(bool val) { _is_static = val; }

  // AUTOGEN:: serialization

#ifndef INTERROGATE
  virtual void serialize(p3d_ecs::proto::Components* dest) const override;
  void deserialize(const p3d_ecs::proto::PhysicsComponent& message);
  virtual bool data_equals(const Component& other) const override;
  virtual void fillin_ptrs() override;
#endif

protected:
  // AUTOGEN:: constructor
  inline PhysicsComponentMeta(Entity* entity) : Component(entity)
    , _mass(10.0)
    , _is_static(false)
    { ECS_ON_CREATE("PhysicsComponentMeta"); };

  ~PhysicsComponentMeta() { ECS_ON_DELETE("PhysicsComponentMeta"); };
  // AUTOGEN:: internal members
  float _mass;

  bool _is_static;

};
#endif


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        wx/osx/toolbar.h
// Purpose:     wxToolBar class
// Author:      Stefan Csomor
// Modified by:
// Created:     1998-01-01
// Copyright:   (c) Stefan Csomor
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _WX_TOOLBAR_H_
#define _WX_TOOLBAR_H_

#if wxUSE_TOOLBAR

#include "wx/tbarbase.h"
#include "wx/dynarray.h"

class WXDLLIMPEXP_CORE wxToolBar: public wxToolBarBase
{
    wxDECLARE_DYNAMIC_CLASS(wxToolBar);
public:
  /*
   * Public interface
   */

   wxToolBar() { Init(); }

  wxToolBar(wxWindow *parent, wxWindowID id,
                   const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
                   long style = wxTB_DEFAULT_STYLE,
                   const wxString& name = wxASCII_STR(wxToolBarNameStr))
  {
    Init();
    Create(parent, id, pos, size, style, name);
  }
  virtual ~wxToolBar();

  bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
            long style = wxTB_DEFAULT_STYLE,
            const wxString& name = wxASCII_STR(wxToolBarNameStr));

    virtual void SetWindowStyleFlag(long style) wxOVERRIDE;

    virtual bool Destroy() wxOVERRIDE;

    // override/implement base class virtuals
    virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE;

#ifndef __WXOSX_IPHONE__
    virtual bool Show(bool show = true) wxOVERRIDE;
    virtual bool IsShown() const wxOVERRIDE;
#endif
    virtual bool Realize() wxOVERRIDE;

    virtual void SetToolBitmapSize(const wxSize& size) wxOVERRIDE;
    virtual wxSize GetToolSize() const wxOVERRIDE;

    virtual void SetRows(int nRows) wxOVERRIDE;

    virtual void SetToolNormalBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE;
    virtual void SetToolDisabledBitmap(int id, const wxBitmap& bitmap) wxOVERRIDE;

#ifndef __WXOSX_IPHONE__
    // Add all the buttons

    virtual wxString MacGetToolTipString( wxPoint &where ) wxOVERRIDE;
    void OnPaint(wxPaintEvent& event) ;
    void OnMouse(wxMouseEvent& event) ;
    virtual void MacSuperChangedPosition() wxOVERRIDE;
#endif

#if wxOSX_USE_NATIVE_TOOLBAR
    // make all tools selectable
    void OSXSetSelectableTools(bool set);
    void OSXSelectTool(int toolId);

    bool MacInstallNativeToolbar(bool usesNative);
    void MacUninstallNativeToolbar();
    bool MacWantsNativeToolbar();
    bool MacTopLevelHasNativeToolbar(bool *ownToolbarInstalled) const;
#endif

    virtual wxToolBarToolBase *CreateTool(int id,
                                          const wxString& label,
                                          const wxBitmap& bmpNormal,
                                          const wxBitmap& bmpDisabled = wxNullBitmap,
                                          wxItemKind kind = wxITEM_NORMAL,
                                          wxObject *clientData = NULL,
                                          const wxString& shortHelp = wxEmptyString,
                                          const wxString& longHelp = wxEmptyString) wxOVERRIDE;
    virtual wxToolBarToolBase *CreateTool(wxControl *control,
                                          const wxString& label) wxOVERRIDE;

protected:
    // common part of all ctors
    void Init();

    void DoLayout();

    void DoSetSize(int x, int y, int width, int height, int sizeFlags) wxOVERRIDE;

#ifndef __WXOSX_IPHONE__
    virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
    virtual wxSize DoGetBestSize() const wxOVERRIDE;
#endif
#ifdef __WXOSX_COCOA__
    virtual void DoGetPosition(int*x, int *y) const wxOVERRIDE;
#endif
    virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
    virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;

    virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable) wxOVERRIDE;
    virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
    virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;

    wxDECLARE_EVENT_TABLE();
#if wxOSX_USE_NATIVE_TOOLBAR
    bool m_macUsesNativeToolbar ;
    void* m_macToolbar ;
#endif
#ifdef __WXOSX_IPHONE__
    WX_UIView m_macToolbar;
#endif
};

#endif // wxUSE_TOOLBAR

#endif
    // _WX_TOOLBAR_H_


text:
=======
autoapi
=======

Automatic Python API reference documentation generator for Sphinx, inspired by
Doxygen.

AutoAPI is a Sphinx extension that allows to automatically generate API
reference documentation for Python packages, recursively, without any
intervention from the developer. It will discover all the package modules and
their public objects and document them.

Documentation
=============

    https://autoapi.readthedocs.io/

License
=======

.. code-block:: text

   Copyright (C) 2015-2020 KuraLabs S.R.L

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.


text:
//
//  Project2: ftclient.c
//
//
//  Created by Pavin Disatapundhu on 03/07/15.
//
//
/* This program takes is the client side program that waits for a client to connect and does one of the following options.
 if the client inputs -l option the server will list all the files in the current directory.
 if the client inputs -g option followed by the file name the server will validate and send the file. */

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <signal.h>

#define MAX 500
#define NAMEMAX 10
#define FILESIZE 1024

int count(char *buffer);
void sendChat(int SSocket, char* chat);
int connectToSocket(int SSocket, char *port, char *serverhost);
int connectSocket(int SSocket, int port);
int clientTranfer(int SSocket, int BSocket, char* filename, int port, int port2, char * hserver);
int clientList(int SSocket, int BSocket, int port, char * hserver);

struct command{
    char *serverhost;
    int serverport;
    char *cserverport;
    char *option;
    int dataport;
    char *cdataport;
    char *filename;
};

/* ============================================================================================================
 The main function takes up to 5 arguments the first argument is the takes the server name, the second thats the connection port, the third is the option -l or -g, the forth and fifth being the textname is "-g" is selected and the last argument is the dataport"
============================================================================================================ */
int main(int argc, char * argv[]){
//    char *chat; //sting that is send to server
    struct command cmd;
    struct sockaddr_in cli_addr;

    int DSocket, CSocket, datasocket;
    int flag = 0;
    unsigned int clientin;
    char *buffer;
    char url[40];
    char *orst = ".engr.oregonstate.edu";
    buffer = malloc(MAX * sizeof(char));
        //check arg
    if(argc < 5) {
        printf("Missing arguments\n");
        exit(1);
    }
    //assign serverport
    if ((cmd.serverport = atoi(argv[2])) <= 0)
    {
        printf("Please enter a valid serverport");
        //usagef();
        exit(0);
    }
    //assign host and option
    cmd.serverhost = argv[1];
    strcpy(url, argv[1]);
    strcat(url, orst);

    cmd.option = argv[3];
    cmd.cserverport = argv[2];

    if (!strcmp(cmd.option, "-l")){
        if(argc != 5){
            printf("Usage: ./ftclient [name] [connection port] -l [dataport]");
            exit(0);
        }
        flag = 1;
        cmd.cdataport =argv[4];
        cmd.dataport = atoi(argv[4]);
    }
    else if(!strcmp(cmd.option,"-g")){
        if(argc != 6){
            printf("Usage: ./ftclient [name] [connection port] -g [filename] [dataport]");
            exit(0);
        }
        flag = 2;
        cmd.filename = argv[4];
        cmd.cdataport = argv[5];
        cmd.dataport = atoi(argv[5]);
    }
    else {
        printf("Please enter a option");
        exit(0);
    }
    if (cmd.dataport <= 0)
    {
        printf("Please enter a valid serverport");
        exit(0);
    }

    //function for list
    if(!(CSocket = connectToSocket(CSocket, cmd.cserverport, url))) {
        printf("socket issue\n");
        exit(0);
    }

    sendChat(CSocket,cmd.option);
    if (recv(CSocket, cmd.option, sizeof(cmd.option), 0) == -1) {
        perror("Error retriving data from server\n");
        return -1;
    }

    sendChat(CSocket ,cmd.cdataport);
    if (recv(CSocket, cmd.cdataport, sizeof(cmd.cdataport), 0) == -1) {
        perror("Error retriving data from server\n");
        return -1;
    }

    if(!(DSocket = connectSocket(DSocket, cmd.dataport))) {
        printf("socket issue\n");
        exit(0);
    }
    clientin = sizeof(cli_addr);

    while (1){
        if((datasocket = accept(DSocket,(struct sockaddr*) &cli_addr, &clientin)) == -1) {
            perror("Error on accept\n");
            exit(0);
        } //http://www.linuxhowtos.org/C_C++/socket.htm
        close(DSocket);

        if(flag == 1){
            clientList(CSocket, datasocket, cmd.dataport, cmd.serverhost);
        }
        else if(flag == 2){
            sendChat(CSocket,cmd.filename);
            clientTranfer(CSocket,datasocket,cmd.filename,cmd.dataport, cmd.serverport, cmd.serverhost);
        }
        close(CSocket);
        close(datasocket);
    return 0;
    }
}

/* ============================================================================================================
this function is used for sending chat message to the server
============================================================================================================ */
void sendChat(int SSocket,char* chat) {
    int len = strlen(chat);
    if(send(SSocket, chat, len , 0) == -1 ) {
        perror("Send");
        exit(0);
    }
}

/* ============================================================================================================
This will establish the initial connection to the sockets
============================================================================================================ */
int connectToSocket(int SSocket, char *port, char *serverhost){
    struct addrinfo serv_addr;
    struct addrinfo *serverinfo, *p;

    memset(&serv_addr, 0, sizeof(serv_addr));
    serv_addr.ai_family = AF_UNSPEC;//TCP
    serv_addr.ai_socktype = SOCK_STREAM;

    if(getaddrinfo(serverhost, port, &serv_addr, &serverinfo) != 0){
        perror("Address not found");
        return 0;
    }
    //http://www.cas.mcmaster.ca/~qiao/courses/cs3mh3/tutorials/socket.html

    for(p = serverinfo; p != NULL; p = p->ai_next) {
        SSocket = socket(p->ai_family, p->ai_socktype, p->ai_protocol);
        if(SSocket == -1) {
            perror("Socket");
            return 0;
        }

        if(connect(SSocket, p->ai_addr, p->ai_addrlen) == -1 ) {
            perror("connect");
            return 0;
        }
        break;
    }
    if (p == NULL) {
        fprintf(stderr, "failed to connect\n");
        exit(2);
    }
    //http://www.beej.us/guide/bgnet/output/html/multipage/getaddrinfoman.html

    return SSocket;
}
/* ============================================================================================================
 //Create the data connection socket
 ============================================================================================================ */
int connectSocket(int SSocket, int port) {
    struct sockaddr_in data_addr;

    SSocket = socket(PF_INET, SOCK_STREAM, 0);
    if(SSocket == -1) {
        perror("Socket");
        return 0;
    }
    //http://www.beej.us/guide/bgnet/output/html/multipage/perrorman.html

    memset(&data_addr, 0, sizeof(data_addr));
    data_addr.sin_family = AF_INET;//TCP
    data_addr.sin_port = htons(port);//Port
    data_addr.sin_addr.s_addr = htonl(INADDR_ANY);//Fill local
    //http://www.cas.mcmaster.ca/~qiao/courses/cs3mh3/tutorials/socket.html

    //bind
    if(bind(SSocket, (struct sockaddr*)&data_addr, sizeof(data_addr)) == -1) {
        perror("Cannot bind the socket.\n");
        return 0;
    }

    if(listen(SSocket, 1) == -1) {
        perror("Cannot listen to port.\n");
        return 0;
    }
    return SSocket;
}
/* ============================================================================================================
 //transferfile to client this function is called if -g option is choosens
 ============================================================================================================ */
int clientTranfer(int SSocket, int BSocket, char* filename, int port, int port2, char * hserver)
{
    char fname[FILESIZE];
    char validate[4];
    int bytesRecieve;

     printf("Receiving '%s' from %s:%d\n",filename,hserver,port);
    //validates the file
    if (recv(SSocket, validate, sizeof(validate), 0) == -1) {
        perror("Error retriving data from server\n");
        return -1;
    }
    printf("dataSock:%s\n", validate);
    if(!strcmp(validate, "pass")){
        FILE* fd = fopen(filename, "w");
        printf("Receiving '%s' from :%d\n",filename,port);
        while ((bytesRecieve = recv(BSocket, fname, FILESIZE, 0)) > 0) {
            fwrite(fname, 1, bytesRecieve, fd);
        }

        if (bytesRecieve < 0){
            return -1;
        }
        printf("File transfer complete.\n");
        fclose(fd);
    }
    else {
        printf("%s:%d says FILE NOT FOUND.\n",hserver,port2);
        return -1;
    }

    return 0;
}
//http://stackoverflow.com/questions/10806754/send-and-receive-int-c
//http://stackoverflow.com/questions/20332622/file-transfer-using-thread
/* ============================================================================================================
 //list folders
 ============================================================================================================ */
int clientList(int SSocket, int BSocket, int port, char * hserver)
{
    char fname[FILESIZE];
    char sname[FILESIZE];
    int byteRecieve;

    // Wait for server
    if (recv(SSocket, sname, FILESIZE, 0) == -1) {
        perror("Error retriving data from server\n");
        return -1;
    }
    printf("Receiving directory structure from %s:%d\n",hserver,port);

    memset(fname, 0, sizeof(fname));

    //recieve the list
    while ((byteRecieve = recv(BSocket, fname, FILESIZE, 0)) > 0) {
        printf("%s", fname);
        memset(fname, 0, sizeof(fname));
    }
    if (byteRecieve < 0){
        perror("error");
    }
    return 0;
}


text:
<?php

require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Util/Filter.php';
require_once 'PHPUnit/Util/Type.php';

PHPUnit_Util_Filter::addFileToFilter(__FILE__, 'PHPUNIT');

/**
 * Constraint that checks if one value is equal to another.
 *
 * Equality is checked with PHP's == operator, the operator is explained in
 * detail at {@url http://www.php.net/manual/en/types.comparisons.php}.
 * Two values are equal if they have the same value disregarding type.
 *
 * The expected value is passed in the constructor.
 *
 * @category   Testing
 * @package    PHPUnit
 * @author     Kore Nordmann <kn@ez.no>
 * @author     Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @copyright  2002-2010 Sebastian Bergmann <sb@sebastian-bergmann.de>
 * @license    http://www.opensource.org/licenses/bsd-license.php  BSD License
 * @version    Release: @package_version@
 * @link       http://www.phpunit.de/
 * @since      Class available since Release 3.0.0
 */
class PHPUnit_Framework_Constraint_IsEqual extends PHPUnit_Framework_Constraint
{
    /**
     * @var mixed
     */
    protected $value;

    /**
     * @var float
     */
    protected $delta = 0;

    /**
     * @var integer
     */
    protected $maxDepth = 10;

    /**
     * @var boolean
     */
    protected $canonicalizeEol = FALSE;

    /**
     * @var boolean
     */
    protected $ignoreCase = FALSE;

    /**
     * @param mixed   $value
     * @param float   $delta
     * @param integer $maxDepth
     * @param boolean $canonicalizeEol
     * @param boolean $ignoreCase
     */
    public function __construct($value, $delta = 0, $maxDepth = 10, $canonicalizeEol = FALSE, $ignoreCase = FALSE)
    {
        if (!is_numeric($delta)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(2, 'numeric');
        }

        if (!is_int($maxDepth)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(3, 'integer');
        }

        if (!is_bool($canonicalizeEol)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(4, 'boolean');
        }

        if (!is_bool($ignoreCase)) {
            throw PHPUnit_Util_InvalidArgumentHelper::factory(5, 'boolean');
        }

        $this->value           = $value;
        $this->delta           = $delta;
        $this->maxDepth        = $maxDepth;
        $this->canonicalizeEol = $canonicalizeEol;
        $this->ignoreCase      = $ignoreCase;
    }

    /**
     * Evaluates the constraint for parameter $other. Returns TRUE if the
     * constraint is met, FALSE otherwise.
     *
     * @param mixed $other Value or object to evaluate.
     * @return bool
     */
    public function evaluate($other)
    {
        return $this->recursiveComparison($this->value, $other);
    }

    /**
     * @param   mixed   $other The value passed to evaluate() which failed the
     *                         constraint check.
     * @param   string  $description A string with extra description of what was
     *                               going on while the evaluation failed.
     * @param   boolean $not Flag to indicate negation.
     * @throws  PHPUnit_Framework_ExpectationFailedException
     */
    public function fail($other, $description, $not = FALSE)
    {
        $failureDescription = $this->failureDescription(
          $other,
          $description,
          $not
        );

        if (!$not) {
            if ($this->value instanceof DOMDocument) {
                $value = $this->domToText($this->value);
            } else {
                $value = $this->value;
            }

            if ($other instanceof DOMDocument) {
                $other = $this->domToText($other);
            }

            throw new PHPUnit_Framework_ExpectationFailedException(
              $failureDescription,
              PHPUnit_Framework_ComparisonFailure::diffEqual($value, $other),
              $description
            );
        } else {
            throw new PHPUnit_Framework_ExpectationFailedException(
              $failureDescription,
              NULL
            );
        }
    }

    /**
     * Returns a string representation of the constraint.
     *
     * @return string
     */
    public function toString()
    {
        $delta = '';

        if (is_string($this->value)) {
            if (strpos($this->value, "\n") !== FALSE) {
                return 'is equal to <text>';
            } else {
                return sprintf(
                  'is equal to <string:%s>',

                  $this->value
                );
            }
        } else {
            if ($this->delta != 0) {
                $delta = sprintf(
                  ' with delta <%F>',

                  $this->delta
                );
            }

            return sprintf(
              'is equal to %s%s',

              PHPUnit_Util_Type::toString($this->value),
              $delta
            );
        }
    }

    /**
     * Perform the actual recursive comparision of two values
     *
     * @param mixed $a First value
     * @param mixed $b Second value
     * @param int $depth Depth
     * @return bool
     */
    protected function recursiveComparison($a, $b, $depth = 0)
    {
        if ($a === $b) {
            return TRUE;
        }

        if ($depth >= $this->maxDepth) {
            return TRUE;
        }

        if (is_numeric($a) XOR is_numeric($b)) {
            return FALSE;
        }

        if (is_array($a) XOR is_array($b)) {
            return FALSE;
        }

        if (is_object($a) XOR is_object($b)) {
            return FALSE;
        }

        if ($a instanceof SplObjectStorage XOR $b instanceof SplObjectStorage) {
            return FALSE;
        }

        if ($a instanceof SplObjectStorage) {
            foreach ($a as $object) {
                if (!$b->contains($object)) {
                    return FALSE;
                }
            }

            foreach ($b as $object) {
                if (!$a->contains($object)) {
                    return FALSE;
                }
            }

            return TRUE;
        }

        if ($a instanceof DOMDocument || $b instanceof DOMDocument) {
            if (!$a instanceof DOMDocument) {
                $_a = new DOMDocument;
                $_a->preserveWhiteSpace = FALSE;
                $_a->loadXML($a);
                $a = $_a;
                unset($_a);
            }

            if (!$b instanceof DOMDocument) {
                $_b = new DOMDocument;
                $_b->preserveWhiteSpace = FALSE;
                $_b->loadXML($b);
                $b = $_b;
                unset($_b);
            }

            if (version_compare(PHP_VERSION, '5.2.0RC1', '>=')) {
                return ($a->C14N() == $b->C14N());
            } else {
                return ($a->saveXML() == $b->saveXML());
            }
        }

        if (is_object($a) && is_object($b) &&
           (get_class($a) !== get_class($b))) {
            return FALSE;
        }

        // Normal comparision for scalar values.
        if ((!is_array($a) && !is_object($a)) ||
            (!is_array($b) && !is_object($b))) {
            if (is_numeric($a) && is_numeric($b)) {
                // Optionally apply delta on numeric values.
                return $this->numericComparison($a, $b);
            }

            if (is_string($a) && is_string($b)) {
                if ($this->canonicalizeEol && PHP_EOL != "\n") {
                    $a = str_replace(PHP_EOL, "\n", $a);
                    $b = str_replace(PHP_EOL, "\n", $b);
                }

                if ($this->ignoreCase) {
                    $a = strtolower($a);
                    $b = strtolower($b);
                }
            }

            return ($a == $b);
        }

        if (is_object($a)) {
            $isMock = $a instanceof PHPUnit_Framework_MockObject_MockObject;
            $a      = (array)$a;
            $b      = (array)$b;

            if ($isMock) {
                unset($a["\0*\0invocationMocker"]);

                if (isset($b["\0*\0invocationMocker"])) {
                    unset($b["\0*\0invocationMocker"]);
                }
            }
        }

        $keysInB = array_flip(array_keys($b));

        foreach ($a as $key => $v) {
            if (!isset($keysInB[$key])) {
                // Abort on missing key in $b.
                return FALSE;
            }

            if (!$this->recursiveComparison($a[$key], $b[$key], $depth + 1)) {
                // FALSE, if child comparision fails.
                return FALSE;
            }

            // Unset key to check whether all keys of b are compared.
            unset($b[$key]);
        }

        if (count($b)) {
            // There is something in $b, that is missing in $a.
            return FALSE;
        }

        return TRUE;
    }

    /**
     * Compares two numeric values - use delta if applicable.
     *
     * @param mixed $a
     * @param mixed $b
     * @return bool
     */
    protected function numericComparison($a, $b)
    {
        if ($this->delta === FALSE) {
            return ($a == $b);
        } else {
            return (abs($a - $b) <= $this->delta);
        }
    }

    /**
     * Returns the normalized, whitespace-cleaned, and indented textual
     * representation of a DOMDocument.
     *
     * @param DOMDocument $document
     * @return string
     */
    protected function domToText(DOMDocument $document)
    {
        $document->formatOutput = TRUE;
        $document->normalizeDocument();

        return $document->saveXML();
    }
}
?>


text:
package cacheutil

import (
	"sync"
	"time"
)

// TTLCache is a ttl-based cache with reference counters.
// Each elements is deleted as soon as expiering the configured ttl.
type TTLCache struct {
	m   map[string]*refCounterWithTimer
	mu  sync.Mutex
	ttl time.Duration

	// OnEvicted optionally specifies a callback function to be
	// executed when an entry is purged from the cache.
	OnEvicted func(key string, value interface{})
}

// NewTTLCache creates a new ttl-based cache.
func NewTTLCache(ttl time.Duration) *TTLCache {
	return &TTLCache{
		m:   make(map[string]*refCounterWithTimer),
		ttl: ttl,
	}
}

// Get retrieves the specified object from the cache and increments the reference counter of the
// target content. Client must call `done` callback to decrease the reference count when the value
// will no longer be used.
func (c *TTLCache) Get(key string) (value interface{}, done func(), ok bool) {
	c.mu.Lock()
	defer c.mu.Unlock()
	rc, ok := c.m[key]
	if !ok {
		return nil, nil, false
	}
	rc.inc()
	return rc.v, c.decreaseOnceFunc(rc), true
}

// Add adds object to the cache and returns the cached contents with incrementing the reference count.
// If the specified content already exists in the cache, this sets `added` to false and returns
// "already cached" content (i.e. doesn't replace the content with the new one). Client must call
// `done` callback to decrease the counter when the value will no longer be used.
func (c *TTLCache) Add(key string, value interface{}) (cachedValue interface{}, done func(), added bool) {
	c.mu.Lock()
	defer c.mu.Unlock()
	if rc, ok := c.m[key]; ok {
		rc.inc()
		return rc.v, c.decreaseOnceFunc(rc), false
	}
	rc := &refCounterWithTimer{
		refCounter: &refCounter{
			key:       key,
			v:         value,
			onEvicted: c.OnEvicted,
		},
	}
	rc.initialize() // Keep this object having at least 1 ref count (will be decreased in OnEviction)
	rc.inc()        // The client references this object (will be decreased on "done")
	rc.t = time.AfterFunc(c.ttl, func() {
		c.mu.Lock()
		defer c.mu.Unlock()
		c.evictLocked(key)
	})
	c.m[key] = rc
	return rc.v, c.decreaseOnceFunc(rc), true
}

// Remove removes the specified contents from the cache. OnEvicted callback will be called when
// nobody refers to the removed content.
func (c *TTLCache) Remove(key string) {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.evictLocked(key)
}

func (c *TTLCache) evictLocked(key string) {
	if rc, ok := c.m[key]; ok {
		delete(c.m, key)
		rc.t.Stop() // stop timer to prevent GC to this content anymore
		rc.finalize()
	}
}

func (c *TTLCache) decreaseOnceFunc(rc *refCounterWithTimer) func() {
	var once sync.Once
	return func() {
		c.mu.Lock()
		defer c.mu.Unlock()
		once.Do(func() { rc.dec() })
	}
}

type refCounterWithTimer struct {
	*refCounter
	t *time.Timer
}


text:
import sys
import matplotlib
matplotlib.use('agg')

from matplotlib.pyplot import style
style.use('classic')

import pynsqd
status = pynsqd.test(*sys.argv[1:])
sys.exit(status)


text:
require 'dynamic_registrar/version'
require 'dynamic_registrar/registrar'

# Provides namespaced and versioned dynamic binding by name for callbacks within an application.
module DynamicRegistrar
end


text:
package com.rhomobile.rhodes;

public class RhodesAppOptions {

	public static native String getOptionsUrl();
	public static native String getStartUrl();
	public static native String getCurrentUrl();
	public static native String getAppBackUrl();
	public static native String getBlobPath();

}


text:
#include "tgbot/TgTypeParser.h"

using namespace std;
using namespace boost::property_tree;

namespace TgBot {

TgTypeParser& TgTypeParser::getInstance() {
	static TgTypeParser result;
	return result;
}

Chat::Ptr TgTypeParser::parseJsonAndGetChat(const ptree& data) const {
	Chat::Ptr result(new Chat);
	result->id = data.get<int64_t>("id");
	string type = data.get<string>("type");
	if (type == "private") {
		result->type = Chat::Type::Private;
	} else if (type == "group") {
		result->type = Chat::Type::Group;
	} else if (type == "supergroup") {
		result->type = Chat::Type::Supergroup;
	} else if (type == "channel") {
		result->type = Chat::Type::Channel;
	}
	result->title = data.get("title", "");
	result->username = data.get("username", "");
	result->firstName = data.get<string>("first_name", "");
	result->lastName = data.get("last_name", "");

	return result;
}

string TgTypeParser::parseChat(const Chat::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "id", object->id);
	if (object->type == Chat::Type::Private) {
		appendToJson(result, "type", "private");
	} else if (object->type == Chat::Type::Group) {
		appendToJson(result, "type", "group");
	} else if (object->type == Chat::Type::Supergroup) {
		appendToJson(result, "type", "supergroup");
	} else if (object->type == Chat::Type::Channel) {
		appendToJson(result, "type", "channel");
	}
	appendToJson(result, "title", object->title);
	appendToJson(result, "username", object->username);
	appendToJson(result, "first_name", object->firstName);
	appendToJson(result, "last_name", object->lastName);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

User::Ptr TgTypeParser::parseJsonAndGetUser(const ptree& data) const {
	User::Ptr result(new User);
	result->id = data.get<int32_t>("id");
	result->firstName = data.get<string>("first_name");
	result->lastName = data.get("last_name", "");
	result->username = data.get("username", "");
	return result;
}

string TgTypeParser::parseUser(const User::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "id", object->id);
	appendToJson(result, "first_name", object->firstName);
	appendToJson(result, "last_name", object->lastName);
	appendToJson(result, "username", object->username);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

Message::Ptr TgTypeParser::parseJsonAndGetMessage(const ptree& data) const {
	Message::Ptr result(new Message);
	result->messageId = data.get<int32_t>("message_id");
	result->from = tryParseJson<User>(&TgTypeParser::parseJsonAndGetUser, data, "from");
	result->date = data.get<int32_t>("date");
	result->chat = parseJsonAndGetChat(data.find("chat")->second);
	result->forwardFrom = tryParseJson<User>(&TgTypeParser::parseJsonAndGetUser, data, "forward_from");
	result->forwardDate = data.get("forward_date", 0);
	result->replyToMessage = tryParseJson<Message>(&TgTypeParser::parseJsonAndGetMessage, data, "reply_to_message");
	result->text = data.get("text", "");
	result->audio = tryParseJson<Audio>(&TgTypeParser::parseJsonAndGetAudio, data, "audio");
	result->document = tryParseJson<Document>(&TgTypeParser::parseJsonAndGetDocument, data, "document");
	result->photo = parseJsonAndGetArray<PhotoSize>(&TgTypeParser::parseJsonAndGetPhotoSize, data, "photo");
	result->sticker = tryParseJson<Sticker>(&TgTypeParser::parseJsonAndGetSticker, data, "sticker");
	result->video = tryParseJson<Video>(&TgTypeParser::parseJsonAndGetVideo, data, "video");
	result->contact = tryParseJson<Contact>(&TgTypeParser::parseJsonAndGetContact, data, "contact");
	result->location = tryParseJson<Location>(&TgTypeParser::parseJsonAndGetLocation, data, "location");
	result->newChatMember = tryParseJson<User>(&TgTypeParser::parseJsonAndGetUser, data, "new_chat_participant");
	result->leftChatMember = tryParseJson<User>(&TgTypeParser::parseJsonAndGetUser, data, "left_chat_participant");
	result->newChatTitle = data.get("new_chat_title", "");
	result->newChatPhoto = parseJsonAndGetArray<PhotoSize>(&TgTypeParser::parseJsonAndGetPhotoSize, data, "new_chat_photo");
	result->deleteChatPhoto = data.get("delete_chat_photo", false);
	result->groupChatCreated = data.get("group_chat_created", false);
	result->caption = data.get("caption", false);
	result->supergroupChatCreated = data.get("supergroup_chat_created", false);
	result->channelChatCreated = data.get("channel_chat_created", false);
	result->migrateToChatId = data.get<int64_t>("migrate_to_chat_id", 0);
	result->migrateFromChatId = data.get<int64_t>("migrate_from_chat_id", 0);
	return result;
}

string TgTypeParser::parseMessage(const Message::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "message_id", object->messageId);
	appendToJson(result, "from", parseUser(object->from));
	appendToJson(result, "date", object->date);
	appendToJson(result, "chat", parseChat(object->chat));
	appendToJson(result, "forward_from", parseUser(object->forwardFrom));
	appendToJson(result, "forward_date", object->forwardDate);
	appendToJson(result, "reply_to_message", parseMessage(object->replyToMessage));
	appendToJson(result, "text", object->text);
	appendToJson(result, "audio", parseAudio(object->audio));
	appendToJson(result, "document", parseDocument(object->document));
	appendToJson(result, "photo", parseArray(&TgTypeParser::parsePhotoSize, object->photo));
	appendToJson(result, "sticker", parseSticker(object->sticker));
	appendToJson(result, "video", parseVideo(object->video));
	appendToJson(result, "contact", parseContact(object->contact));
	appendToJson(result, "location", parseLocation(object->location));
	appendToJson(result, "new_chat_member", parseUser(object->newChatMember));
	appendToJson(result, "left_chat_member", parseUser(object->leftChatMember));
	appendToJson(result, "new_chat_title", object->newChatTitle);
	appendToJson(result, "new_chat_photo", parseArray(&TgTypeParser::parsePhotoSize, object->newChatPhoto));
	appendToJson(result, "delete_chat_photo", object->deleteChatPhoto);
	appendToJson(result, "group_chat_created", object->groupChatCreated);
	appendToJson(result, "caption", object->caption);
	appendToJson(result, "supergroup_chat_created", object->supergroupChatCreated);
	appendToJson(result, "channel_chat_created", object->channelChatCreated);
	appendToJson(result, "migrate_to_chat_id", object->migrateToChatId);
	appendToJson(result, "migrate_from_chat_id", object->migrateFromChatId);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

PhotoSize::Ptr TgTypeParser::parseJsonAndGetPhotoSize(const ptree& data) const {
	PhotoSize::Ptr result(new PhotoSize);
	result->fileId = data.get<string>("file_id");
	result->width = data.get<int32_t>("width");
	result->height = data.get<int32_t>("height");
	result->fileSize = data.get("file_size", 0);
	return result;
}

string TgTypeParser::parsePhotoSize(const PhotoSize::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "file_id", object->fileId);
	appendToJson(result, "width", object->width);
	appendToJson(result, "height", object->height);
	appendToJson(result, "file_size", object->fileSize);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

Audio::Ptr TgTypeParser::parseJsonAndGetAudio(const ptree& data) const {
	Audio::Ptr result(new Audio);
	result->fileId = data.get<string>("file_id");
	result->duration = data.get<int32_t>("duration");
	result->mimeType = data.get("mime_type", "");
	result->fileSize = data.get("file_size", 0);
	return result;
}

string TgTypeParser::parseAudio(const Audio::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "file_id", object->fileId);
	appendToJson(result, "duration", object->duration);
	appendToJson(result, "mime_type", object->mimeType);
	appendToJson(result, "file_size", object->fileSize);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

Document::Ptr TgTypeParser::parseJsonAndGetDocument(const ptree& data) const {
	Document::Ptr result(new Document);
	result->fileId = data.get<string>("file_id");
	result->thumb = tryParseJson<PhotoSize>(&TgTypeParser::parseJsonAndGetPhotoSize, data, "thumb");
	result->fileName = data.get("file_name", "");
	result->mimeType = data.get("mime_type", "");
	result->fileSize = data.get("file_size", 0);
	return result;
}

string TgTypeParser::parseDocument(const Document::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "file_id", object->fileId);
	appendToJson(result, "thumb", parsePhotoSize(object->thumb));
	appendToJson(result, "file_name", object->fileName);
	appendToJson(result, "mime_type", object->mimeType);
	appendToJson(result, "file_size", object->fileSize);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

Sticker::Ptr TgTypeParser::parseJsonAndGetSticker(const ptree& data) const {
	Sticker::Ptr result(new Sticker);
	result->fileId = data.get<string>("file_id");
	result->width = data.get<int32_t>("width");
	result->height = data.get<int32_t>("height");
	result->thumb = tryParseJson<PhotoSize>(&TgTypeParser::parseJsonAndGetPhotoSize, data, "thumb");
	result->fileSize = data.get("file_size", 0);
	return result;
}

string TgTypeParser::parseSticker(const Sticker::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "file_id", object->fileId);
	appendToJson(result, "width", object->width);
	appendToJson(result, "height", object->height);
	appendToJson(result, "thumb", parsePhotoSize(object->thumb));
	appendToJson(result, "file_size", object->fileSize);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

Video::Ptr TgTypeParser::parseJsonAndGetVideo(const ptree& data) const {
	Video::Ptr result(new Video);
	result->fileId = data.get<string>("file_id");
	result->width = data.get<int32_t>("width");
	result->height = data.get<int32_t>("height");
	result->duration = data.get<int32_t>("duration");
	result->thumb = tryParseJson<PhotoSize>(&TgTypeParser::parseJsonAndGetPhotoSize, data, "thumb");
	result->mimeType = data.get("mime_type", "");
	result->fileSize = data.get("file_size", 0);
	return result;
}

string TgTypeParser::parseVideo(const Video::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "file_id", object->fileId);
	appendToJson(result, "width", object->width);
	appendToJson(result, "height", object->height);
	appendToJson(result, "duration", object->duration);
	appendToJson(result, "thumb", parsePhotoSize(object->thumb));
	appendToJson(result, "mime_type", object->mimeType);
	appendToJson(result, "file_size", object->fileSize);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

Contact::Ptr TgTypeParser::parseJsonAndGetContact(const ptree& data) const {
	Contact::Ptr result(new Contact);
	result->phoneNumber = data.get<string>("phone_number");
	result->firstName = data.get<string>("first_name");
	result->lastName = data.get("last_name", "");
	result->userId = data.get("user_id", "");
	return result;
}

string TgTypeParser::parseContact(const Contact::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "phone_number", object->phoneNumber);
	appendToJson(result, "first_name", object->firstName);
	appendToJson(result, "last_name", object->lastName);
	appendToJson(result, "user_id", object->userId);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

Location::Ptr TgTypeParser::parseJsonAndGetLocation(const ptree& data) const {
	Location::Ptr result(new Location);
	result->longitude = data.get<float>("longitude");
	result->latitude = data.get<float>("latitude");
	return result;
}

string TgTypeParser::parseLocation(const Location::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "longitude", object->longitude);
	appendToJson(result, "latitude", object->latitude);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

Update::Ptr TgTypeParser::parseJsonAndGetUpdate(const ptree& data) const {
	Update::Ptr result(new Update);
	result->updateId = data.get<int32_t>("update_id");
	result->message = tryParseJson<Message>(&TgTypeParser::parseJsonAndGetMessage, data, "message");
	result->inlineQuery = tryParseJson<InlineQuery>(&TgTypeParser::parseJsonAndGetInlineQuery, data, "inline_query");
	result->chosenInlineResult = tryParseJson<ChosenInlineResult>(&TgTypeParser::parseJsonAndGetChosenInlineResult, data, "chosen_inline_result");
	result->callbackQuery = tryParseJson<CallbackQuery>(&TgTypeParser::parseJsonAndGetCallbackQuery, data, "callback_query");
	return result;
}

string TgTypeParser::parseUpdate(const Update::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "update_id", object->updateId);
	appendToJson(result, "message", parseMessage(object->message));
	appendToJson(result, "inline_query", parseInlineQuery(object->inlineQuery));
	appendToJson(result, "chosen_inline_result", parseChosenInlineResult(object->chosenInlineResult));
	appendToJson(result, "callback_query", parseCallbackQuery(object->callbackQuery));
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

UserProfilePhotos::Ptr TgTypeParser::parseJsonAndGetUserProfilePhotos(const ptree& data) const {
	UserProfilePhotos::Ptr result(new UserProfilePhotos);
	result->totalCount = data.get<int32_t>("total_count");
	result->photos = parseJsonAndGet2DArray<PhotoSize>(&TgTypeParser::parseJsonAndGetPhotoSize, data, "photos");
	return result;
}

string TgTypeParser::parseUserProfilePhotos(const UserProfilePhotos::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "total_count", object->totalCount);
	appendToJson(result, "photos", parse2DArray(&TgTypeParser::parsePhotoSize, object->photos));
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

ReplyKeyboardMarkup::Ptr TgTypeParser::parseJsonAndGetReplyKeyboardMarkup(const boost::property_tree::ptree& data) const {
	ReplyKeyboardMarkup::Ptr result(new ReplyKeyboardMarkup);
	for (const pair<const string, ptree>& item : data.find("keyboard")->second) {
		vector<string> array;
		for (const pair<const string, ptree>& innerItem : item.second) {
			array.push_back(innerItem.second.data());
		}
		result->keyboard.push_back(array);
	}
	result->resizeKeyboard = data.get<bool>("resize_keyboard");
	result->oneTimeKeyboard = data.get<bool>("one_time_keyboard");
	result->selective = data.get<bool>("selective");
	return result;
}

std::string TgTypeParser::parseReplyKeyboardMarkup(const ReplyKeyboardMarkup::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	result += "\"keyboard\":[";
	for (vector<string>& item : object->keyboard) {
		result += '[';
		for (string& innerItem : item) {
			result += '"';
			result += innerItem;
			result += "\",";
		}
		result.erase(result.length() - 1);
		result += "],";
	}
	result.erase(result.length() - 1);
	result += "],";
	appendToJson(result, "resize_keyboard", object->resizeKeyboard);
	appendToJson(result, "one_time_keyboard", object->oneTimeKeyboard);
	appendToJson(result, "selective", object->selective);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

ReplyKeyboardHide::Ptr TgTypeParser::parseJsonAndGetReplyKeyboardHide(const boost::property_tree::ptree& data) const {
	ReplyKeyboardHide::Ptr result(new ReplyKeyboardHide);
	result->selective = data.get<bool>("selective");
	return result;
}

std::string TgTypeParser::parseReplyKeyboardHide(const ReplyKeyboardHide::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "hide_keyboard", object->hideKeyboard);
	appendToJson(result, "selective", object->selective);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

ForceReply::Ptr TgTypeParser::parseJsonAndGetForceReply(const boost::property_tree::ptree& data) const {
	ForceReply::Ptr result(new ForceReply);
	result->selective = data.get<bool>("selective");
	return result;
}

std::string TgTypeParser::parseForceReply(const ForceReply::Ptr& object) const {
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "force_reply", object->forceReply);
	appendToJson(result, "selective", object->selective);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

GenericReply::Ptr TgTypeParser::parseJsonAndGetGenericReply(const boost::property_tree::ptree& data) const {
	if (data.find("force_reply") != data.not_found()) {
		return static_pointer_cast<GenericReply>(parseJsonAndGetForceReply(data));
	} else if (data.find("hide_keyboard") != data.not_found()) {
		return static_pointer_cast<GenericReply>(parseJsonAndGetReplyKeyboardHide(data));
	} else if (data.find("keyboard") != data.not_found()) {
		return static_pointer_cast<GenericReply>(parseJsonAndGetReplyKeyboardMarkup(data));
	} else if (data.find("inline_keyboard") != data.not_found()) {
		return static_pointer_cast<GenericReply>(parseJsonAndGetInlineKeyboardMarkup(data));
	}
}

std::string TgTypeParser::parseGenericReply(const GenericReply::Ptr& object) const {
	if (!object) {
		return "";
	}
	if (dynamic_pointer_cast<ForceReply>(object) != nullptr) {
		return parseForceReply(static_pointer_cast<ForceReply>(object));
	} else if (dynamic_pointer_cast<ReplyKeyboardHide>(object) != nullptr) {
		return parseReplyKeyboardHide(static_pointer_cast<ReplyKeyboardHide>(object));
	} else if (dynamic_pointer_cast<ReplyKeyboardMarkup>(object) != nullptr){
		return parseReplyKeyboardMarkup(static_pointer_cast<ReplyKeyboardMarkup>(object));
	} else if (dynamic_pointer_cast<InlineKeyboardMarkup>(object) != nullptr){
		return parseInlineKeyboardMarkup(static_pointer_cast<InlineKeyboardMarkup>(object));
	}
}

InlineQuery::Ptr TgTypeParser::parseJsonAndGetInlineQuery(const boost::property_tree::ptree& data) const {
	InlineQuery::Ptr result(new InlineQuery);
	result->id = data.get<string>("id");
	result->from = tryParseJson<User>(&TgTypeParser::parseJsonAndGetUser, data, "from");
	result->query = data.get<string>("query");
	result->offset = data.get<string>("offset");

	return result;
}

std::string TgTypeParser::parseInlineQuery(const InlineQuery::Ptr& object) const{
	if (!object) {
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "id", object->id);
	appendToJson(result, "from", parseUser(object->from));
	appendToJson(result, "query", object->query);
	appendToJson(result, "offset", object->offset);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

InlineQueryResult::Ptr TgTypeParser::parseJsonAndGetInlineQueryResult(const boost::property_tree::ptree& data) const {
	string type = data.get<string>("type");
	InlineQueryResult::Ptr result;

	if (type == InlineQueryResultArticle::TYPE) {
		result = static_pointer_cast<InlineQueryResult>(parseJsonAndGetInlineQueryResultArticle(data));
	} else if (type == InlineQueryResultPhoto::TYPE) {
		result = static_pointer_cast<InlineQueryResult>(parseJsonAndGetInlineQueryResultPhoto(data));
	} else if (type == InlineQueryResultGif::TYPE) {
		result = static_pointer_cast<InlineQueryResult>(parseJsonAndGetInlineQueryResultGif(data));
	} else if (type == InlineQueryResultMpeg4Gif::TYPE) {
		result = static_pointer_cast<InlineQueryResult>(parseJsonAndGetInlineQueryResultMpeg4Gif(data));
	} else if (type == InlineQueryResultVideo::TYPE) {
		result = static_pointer_cast<InlineQueryResult>(parseJsonAndGetInlineQueryResultVideo(data));
	} else {
		result = make_shared<InlineQueryResult>();
	}

	result->id = data.get<string>("id");
	result->title = data.get<string>("title", "");
	result->messageText = data.get<string>("message_text", "");
	result->parseMode = data.get<string>("parse_mode", "");
	result->disableWebPagePreview = data.get("disable_web_page_preview", false);
	result->thumbUrl = data.get<string>("thumb_url", "");

	return result;
}

std::string TgTypeParser::parseInlineQueryResult(const InlineQueryResult::Ptr& object) const {
	if (!object){
		return "";
	}

	string result;
	result += '{';
	appendToJson(result, "id", object->id);
	appendToJson(result, "type", object->type);
	appendToJson(result, "title", object->title);
	appendToJson(result, "message_text", object->messageText);
	appendToJson(result, "parse_mode", object->parseMode);
	appendToJson(result, "disable_web_page_preview", object->disableWebPagePreview);
	appendToJson(result, "thumb_url", object->thumbUrl);

	if (object->type == InlineQueryResultArticle::TYPE){
		result += parseInlineQueryResultArticle(static_pointer_cast<InlineQueryResultArticle>(object));
	} else if (object->type == InlineQueryResultPhoto::TYPE){
		result += parseInlineQueryResultPhoto(static_pointer_cast<InlineQueryResultPhoto>(object));
	} else if (object->type == InlineQueryResultGif::TYPE){
		result += parseInlineQueryResultGif(static_pointer_cast<InlineQueryResultGif>(object));
	} else if (object->type == InlineQueryResultMpeg4Gif::TYPE){
		result += parseInlineQueryResultMpeg4Gif(static_pointer_cast<InlineQueryResultMpeg4Gif>(object));
	} else if (object->type == InlineQueryResultVideo::TYPE){
		result += parseInlineQueryResultVideo(static_pointer_cast<InlineQueryResultVideo>(object));
	}

	result.erase(result.length() - 1);
	result += '}';
	return result;
}

InlineQueryResultArticle::Ptr TgTypeParser::parseJsonAndGetInlineQueryResultArticle(const boost::property_tree::ptree& data) const {
	// NOTE: This function will be called by parseJsonAndGgetInlineQueryResult().
	InlineQueryResultArticle::Ptr result(new InlineQueryResultArticle);
	result->url = data.get<string>("url", "");
	result->hideUrl = data.get("hide_url", false);
	result->description = data.get<string>("description", "");
	result->thumbWidth = data.get("thumb_width", 0);
	result->thumbHeight = data.get("thumb_height", 0);
	return result;
}

std::string TgTypeParser::parseInlineQueryResultArticle(const InlineQueryResultArticle::Ptr& object) const {
	if (!object){
		return " ";
	}
	// This function will be called by parseInlineQueryResult(), so I don't add
	// curly brackets to the result string.
	string result;
	appendToJson(result, "url", object->url);
	appendToJson(result, "hide_url", object->hideUrl);
	appendToJson(result, "description", object->description);
	appendToJson(result, "thumb_width", object->thumbWidth);
	appendToJson(result, "thumb_height", object->thumbHeight);
	// The last comma will be erased by parseInlineQueryResult().
	return result;
}

InlineQueryResultPhoto::Ptr TgTypeParser::parseJsonAndGetInlineQueryResultPhoto(const boost::property_tree::ptree& data) const {
	// NOTE: This function will be called by parseJsonAndGgetInlineQueryResult().
	InlineQueryResultPhoto::Ptr result(new InlineQueryResultPhoto);
	result->photoUrl = data.get<string>("photo_url", "");
	result->photoWidth = data.get("photo_width", 0);
	result->photoHeight = data.get("photo_height", 0);
	result->description = data.get<string>("description", "");
	result->caption = data.get<string>("caption", "");
	return result;
}

std::string TgTypeParser::parseInlineQueryResultPhoto(const InlineQueryResultPhoto::Ptr& object) const{
	if (!object){
		return " ";
	}
	// This function will be called by parseInlineQueryResult(), so I don't add
	// curly brackets to the result string.
	string result;
	appendToJson(result, "photo_url", object->photoUrl);
	appendToJson(result, "photo_width", object->photoWidth);
	appendToJson(result, "photo_height", object->photoHeight);
	appendToJson(result, "description", object->description);
	appendToJson(result, "caption", object->caption);
	// The last comma will be erased by parseInlineQueryResult().
	return result;
}

InlineQueryResultGif::Ptr TgTypeParser::parseJsonAndGetInlineQueryResultGif(const boost::property_tree::ptree& data) const {
	// NOTE: This function will be called by parseJsonAndGgetInlineQueryResult().
	InlineQueryResultGif::Ptr result(new InlineQueryResultGif);
	result->gifUrl = data.get<string>("gif_url", "");
	result->gifWidth = data.get("gif_width", 0);
	result->gifHeight = data.get("gif_height", 0);
	result->caption = data.get<string>("caption", "");
	return result;
}
std::string TgTypeParser::parseInlineQueryResultGif(const InlineQueryResultGif::Ptr& object) const {
	if (!object){
		return " ";
	}
	// This function will be called by parseInlineQueryResult(), so I don't add
	// curly brackets to the result string.
	string result;
	appendToJson(result, "gif_url", object->gifUrl);
	appendToJson(result, "gif_width", object->gifWidth);
	appendToJson(result, "gif_height", object->gifHeight);
	appendToJson(result, "caption", object->caption);
	// The last comma will be erased by parseInlineQueryResult().
	return result;
}

InlineQueryResultMpeg4Gif::Ptr TgTypeParser::parseJsonAndGetInlineQueryResultMpeg4Gif(const boost::property_tree::ptree& data) const {
	// NOTE: This function will be called by parseJsonAndGgetInlineQueryResult().
	InlineQueryResultMpeg4Gif::Ptr result(new InlineQueryResultMpeg4Gif);
	result->mpeg4Url = data.get<string>("mpeg4_url");
	result->mpeg4Width = data.get("mpeg4_width", 0);
	result->mpeg4Height = data.get("mpeg4_height", 0);
	result->caption = data.get("caption", "");
	return result;
}

std::string TgTypeParser::parseInlineQueryResultMpeg4Gif(const InlineQueryResultMpeg4Gif::Ptr& object) const {
	if (!object){
		return " ";
	}
	// This function will be called by parseInlineQueryResult(), so I don't add
	// curly brackets to the result string.
	string result;
	appendToJson(result, "mpeg4_url", object->mpeg4Url);
	appendToJson(result, "mpeg4_width", object->mpeg4Width);
	appendToJson(result, "mpeg4_height", object->mpeg4Height);
	appendToJson(result, "caption", object->caption);
	// The last comma will be erased by parseInlineQueryResult().
	return result;
}

InlineQueryResultVideo::Ptr TgTypeParser::parseJsonAndGetInlineQueryResultVideo(const boost::property_tree::ptree& data) const {
	// NOTE: This function will be called by parseJsonAndGgetInlineQueryResult().
	InlineQueryResultVideo::Ptr result(new InlineQueryResultVideo);
	result->videoUrl = data.get<string>("video_url");
	result->mimeType = data.get<string>("mime_type");
	result->videoWidth = data.get("video_height", 0);
	result->videoHeight = data.get("video_height", 0);
	result->videoDuration = data.get("video_duration", 0);
	result->description = data.get<string>("description", "");
	return result;
}

std::string TgTypeParser::parseInlineQueryResultVideo(const InlineQueryResultVideo::Ptr& object) const {
	if (!object){
		return " ";
	}
	// This function will be called by parseInlineQueryResult(), so I don't add
	// curly brackets to the result string.
	string result;
	appendToJson(result, "video_url", object->videoUrl);
	appendToJson(result, "mime_type", object->mimeType);
	appendToJson(result, "video_width", object->videoWidth);
	appendToJson(result, "video_height", object->videoHeight);
	appendToJson(result, "video_duration", object->videoDuration);
	appendToJson(result, "description", object->description);
	// The last comma will be erased by parseInlineQueryResult().
	return result;
}

ChosenInlineResult::Ptr TgTypeParser::parseJsonAndGetChosenInlineResult(const boost::property_tree::ptree& data) const {
	ChosenInlineResult::Ptr result(new ChosenInlineResult);
	result->resultId = data.get<string>("result_id");
	result->from = tryParseJson<User>(&TgTypeParser::parseJsonAndGetUser, data, "from");
	result->query = data.get<string>("query");
	return result;
}

std::string TgTypeParser::parseChosenInlineResult(const ChosenInlineResult::Ptr& object) const {
	if (!object){
		return "";
	}

	string result;
	result += '{';
	appendToJson(result, "result_id", object->resultId);
	appendToJson(result, "from", parseUser(object->from));
	appendToJson(result, "query", object->query);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

CallbackQuery::Ptr TgTypeParser::parseJsonAndGetCallbackQuery(const boost::property_tree::ptree& data) const {
	CallbackQuery::Ptr result(new CallbackQuery);
	result->id = data.get<string>("id");
	result->from = tryParseJson<User>(&TgTypeParser::parseJsonAndGetUser, data, "from");
	result->message = tryParseJson<Message>(&TgTypeParser::parseJsonAndGetMessage, data, "message");
	result->inlineMessageId = data.get<string>("inline_message_id", "");
	result->data = data.get<string>("data", "");
	return result;
}

std::string TgTypeParser::parseCallbackQuery(const CallbackQuery::Ptr& object) const {
	if (!object){
		return "";
	}

	string result;
	result += '{';
	appendToJson(result, "id", object->id);
	appendToJson(result, "from", parseUser(object->from));
	appendToJson(result, "message", parseMessage(object->message));
	appendToJson(result, "inline_message_id", object->inlineMessageId);
	appendToJson(result, "data", object->data);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

InlineKeyboardMarkup::Ptr TgTypeParser::parseJsonAndGetInlineKeyboardMarkup(const boost::property_tree::ptree& data) const {
	InlineKeyboardMarkup::Ptr result(new InlineKeyboardMarkup);
	for (const boost::property_tree::ptree::value_type& item : data.find("inline_keyboard")->second){
		result->inlineKeyboard.push_back(parseJsonAndGetArray<InlineKeyboardButton>(&TgTypeParser::parseJsonAndGetInlineKeyboardButton, item.second));
	}
	return result;
}

std::string TgTypeParser::parseInlineKeyboardMarkup(const InlineKeyboardMarkup::Ptr& object) const {
	if (!object){
		return "";
	}
	string result;
	result += '{';
	result += "\"inline_keyboard\":[";
	for (vector<InlineKeyboardButton::Ptr>& item : object->inlineKeyboard){
		result += '[';
		for (InlineKeyboardButton::Ptr& innerItem : item){
			result += parseInlineKeyboardButton(innerItem);
			result += ',';
		}
		result.erase(result.length() - 1);
		result += "],";
	}
	result.erase(result.length() - 1);
	result += "]}";
	return result;
}

InlineKeyboardButton::Ptr TgTypeParser::parseJsonAndGetInlineKeyboardButton(const boost::property_tree::ptree& data) const {
	InlineKeyboardButton::Ptr result(new InlineKeyboardButton);
	result->text = data.get<string>("text");
	result->url = data.get<string>("url", "");
	result->callbackData = data.get<string>("callback_data", "");
	result->switchInlineQuery = data.get<string>("switch_inline_query", "");
	return result;
}
std::string TgTypeParser::parseInlineKeyboardButton(const InlineKeyboardButton::Ptr& object) const {
	if (!object){
		return "";
	}
	string result;
	result += '{';
	appendToJson(result, "text", object->text);
	appendToJson(result, "url", object->url);
	appendToJson(result, "callback_data", object->callbackData);
	appendToJson(result, "switch_inline_query", object->switchInlineQuery);
	result.erase(result.length() - 1);
	result += '}';
	return result;
}

void TgTypeParser::appendToJson(string& json, const string& varName, const string& value) const {
	if (value.empty()) {
		return;
	}
	json += '"';
	json += varName;
	json += "\":";
	if (value.front() != '{') {
		json += '"';
	}
	json += value;
	if (value.back() != '}') {
		json += '"';
	}
	json += ',';
}

}


text: java -cp bin com.example.tests.GroupDataGenerator