text:
package com.rodionov.cityoffice.controllers;

import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.rodionov.cityoffice.controllers.exceptions.NotFoundException;
import com.rodionov.cityoffice.dto.EmployeeDTO;
import com.rodionov.cityoffice.dto.EmployeeProjectDTO;
import com.rodionov.cityoffice.dto.EmployeeVacationDTO;
import com.rodionov.cityoffice.model.User;
import com.rodionov.cityoffice.model.UserProject;
import com.rodionov.cityoffice.model.UserVacation;
import com.rodionov.cityoffice.services.ProjectService;
import com.rodionov.cityoffice.services.UserService;

@RestController
@RequestMapping("/employee")
public class EmployeeController {

	private static final Logger logger = Logger.getLogger(EmployeeController.class);

	private static final Integer DEFAULT_PERIOD = 180;

	@Autowired
	private UserService userService;

	@Autowired
	private ProjectService projectService;

	/**
	 * Get information about employees:
	 *  their projects in the specified period
	 *  their vacancies
	 * @param periodInDays Period in days from today to the future (example: 180 - half a year)
	 * @return
	 */
	@RequestMapping(method = RequestMethod.GET)
	public List<EmployeeDTO> getEmployeesList(
			@RequestParam(required=false) Integer periodInDays,
			@RequestParam(required=false) String userId,
			@RequestParam(required=false) Boolean onlyProjects,
			@RequestParam(required=false) Boolean onlyVacations,
			@RequestParam(required=false) String projectId) {

		logger.info("getEmployeePeriodInfo invoked. (periodInDays = " + periodInDays + ")");

		if (periodInDays == null) {
			periodInDays = DEFAULT_PERIOD;
		}

		Pageable pageable = new PageRequest(0, Integer.MAX_VALUE);
		LocalDate finishAfter = LocalDate.now();
		LocalDate startBefore = finishAfter.plusDays(periodInDays);
		List<String> projectIds = projectId == null ? null : Arrays.asList(projectId);

		List<EmployeeDTO> employees = new ArrayList<EmployeeDTO>();

		if (onlyVacations == null || !onlyVacations) {

			List<UserProject> userProjects = userService.getUserProjects(projectIds, userId, startBefore, finishAfter, pageable).getContent();
			mergeDTOs(employees, getEmployeesWithProjects(userProjects));
		}

		if (onlyProjects == null || !onlyProjects) {
			List<UserVacation> userVacations = userService.getUserVacations(userId, startBefore, finishAfter, pageable).getContent();
			mergeDTOs(employees, getEmployeesWithVacations(userVacations));
		}

		limitDates(employees, finishAfter, startBefore);
		sort(employees);

		return employees;
	}

	/**
	 * Get user by id
	 * @param id
	 * @param periodInDays
	 * @return
	 */
	@RequestMapping(value = "/{id}", method = RequestMethod.GET)
	public EmployeeDTO getEmployee(
			@PathVariable String id,
			@RequestParam(required = false) Integer periodInDays) {

		User user = userService.getUser(id);

		if (user == null)
			throw new NotFoundException();

		if (periodInDays == null)
			periodInDays = DEFAULT_PERIOD;

		Pageable pageable = new PageRequest(0, Integer.MAX_VALUE);
		LocalDate finishAfter = LocalDate.now();
		LocalDate startBefore = finishAfter.plusDays(periodInDays);

		List<UserProject> projects = userService.getUserProjects(null, id, startBefore, finishAfter, pageable).getContent();
		List<UserVacation> vacations = userService.getUserVacations(id, startBefore, finishAfter, pageable).getContent();

		return convertToEmployeeDto(id, projects, vacations);
	}

	private void sort(List<EmployeeDTO> employees) {
		Collections.sort(employees, (p1, p2) -> p1.getName().compareTo(p2.getName()));
	}

	private void limitDates(List<EmployeeDTO> employees, LocalDate startDate, LocalDate finishDate) {
		for (EmployeeDTO employee : employees) {
			if (employee.getProjects() != null) {
				for (EmployeeProjectDTO ep : employee.getProjects()) {
					ep.setStartDate(cutDate(ep.getStartDate(), startDate, finishDate));
					ep.setFinishDate(cutDate(ep.getFinishDate(), startDate, finishDate));
				}
			}

			if (employee.getVacations() != null) {
				for (EmployeeVacationDTO ev : employee.getVacations()) {
					ev.setStartDate(cutDate(ev.getStartDate(), startDate, finishDate));
					ev.setFinishDate(cutDate(ev.getFinishDate(), startDate, finishDate));
				}
			}
		}
	}

	private void mergeDTOs(List<EmployeeDTO> dest, List<EmployeeDTO> source) {

		for (EmployeeDTO cur : source) {
			EmployeeDTO existing = dest.stream().filter(e -> e.getId().equals(cur.getId())).findAny().orElse(null);
			if (existing != null) {
				existing.getProjects().addAll(cur.getProjects());
				existing.getVacations().addAll(cur.getVacations());
			}
			else {
				dest.add(cur);
			}
		}
	}

	private List<EmployeeDTO> getEmployeesWithVacations(List<UserVacation> userVacations) {

		return userVacations.stream()
				.collect(Collectors.groupingBy(UserVacation::getUserId))
				.entrySet()
				.stream()
				.map(entry -> convertToEmployeeDto(entry.getKey(), null, entry.getValue()))
				.collect(Collectors.toList());
	}

	private List<EmployeeDTO> getEmployeesWithProjects(List<UserProject> userProjects) {

		return userProjects.stream()
					.collect(Collectors.groupingBy(UserProject::getUserId))
					.entrySet()
					.stream()
					.map(entry -> convertToEmployeeDto(entry.getKey(), entry.getValue(), null))
					.collect(Collectors.toList());
	}

	private EmployeeDTO convertToEmployeeDto(
			String userId,
			List<UserProject> projects,
			List<UserVacation> vacations) {

		User dbUser = userService.getUser(userId);
		EmployeeDTO dto = new EmployeeDTO();
		dto.setId(userId);
		dto.setName(dbUser.getUsername());
		if (dbUser.getManagerId() != null)
			dto.setManagerUsername(userService.getUser(dbUser.getManagerId()).getUsername());
		dto.setHours(dbUser.getHours());
		dto.setEmail(dbUser.getEmail());
		dto.setPhone(dbUser.getPhone());

		if (projects != null) {
			dto.setProjects(projects.stream().map(this::convertToProjectDTO).collect(Collectors.toList()));
		}
		else
			dto.setProjects(new ArrayList<EmployeeProjectDTO>());

		if (vacations != null) {
			dto.setVacations(vacations.stream().map(this::convertToVacationDTO).collect(Collectors.toList()));
		}
		else
			dto.setVacations(new ArrayList<EmployeeVacationDTO>());

		return dto;
	}

	private EmployeeVacationDTO convertToVacationDTO(UserVacation userVacation) {
		EmployeeVacationDTO dto = new EmployeeVacationDTO();
		dto.setId(userVacation.getId());
		dto.setStartDate(userVacation.getStartDate());
		dto.setFinishDate(userVacation.getFinishDate());
		dto.setInWeeks(LocalDate.now().until(userVacation.getStartDate(), ChronoUnit.WEEKS));

		return dto;
	}

	private EmployeeProjectDTO convertToProjectDTO(UserProject userProject) {
		EmployeeProjectDTO dto = new EmployeeProjectDTO();
		dto.setId(userProject.getProjectId());
		dto.setProjectName(projectService.getProject(userProject.getProjectId()).getName());
		dto.setStartDate(userProject.getStartDate());
		dto.setFinishDate(userProject.getFinishDate());
		dto.setWorkload((int)(userProject.getLoad() * 100));

		return dto;
	}

	private LocalDate cutDate(LocalDate value, LocalDate min, LocalDate max) {
		if (min != null && value.isBefore(min))
			return min;
		if (max != null && value.isAfter(max))
			return max;

		return value;
	}
}


text:
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root@localhost:3306/microblog'
SQLALCHEMY_TRACK_MODIFICATIONS = False
REDIS_HOST = 'localhost'
REDIS_PORT = 6379
DEBUG = False

redpajama_set_name: RedPajamaGithub


text:
package com.sksamuel.scapegoat.inspections.names

import com.sksamuel.scapegoat.PluginRunner
import com.sksamuel.scapegoat.inspections.naming.ClassNames
import org.scalatest.{ FreeSpec, Matchers, OneInstancePerTest }

/** @author Stephen Samuel */
class ClassNamesTest
    extends FreeSpec
    with Matchers
    with PluginRunner
    with OneInstancePerTest {

  override val inspections = Seq(new ClassNames)

  "ClassNames" - {
    "should report warning" - {
      "for classes beginning with lowercase" in {
        val code =
          """class aClass
            |case class bClass()
          """.stripMargin
        compileCodeSnippet(code)
        compiler.scapegoat.feedback.warnings.size shouldBe 2
      }
      "for classes containing underscore" in {
        val code =
          """class My_class
            |case class Your_class()
          """.stripMargin
        compileCodeSnippet(code)
        compiler.scapegoat.feedback.warnings.size shouldBe 2
      }
    }
    "should not report warning" - {
      "for anon classes" in {
        val code =
          """
            |class Test {
            |    import java.util.{Observer, Observable}
            |    val observable = new Observable {}
            |    observable.addObserver(new Observer {
            |      override def update(o: Observable, arg: scala.Any): Unit = ()
            |    })
            |}
          """.stripMargin
        compileCodeSnippet(code)
        compiler.scapegoat.feedback.warnings.size shouldBe 0
      }
      "for implicit classes" in {
        val code =
          """
            |class Test {
            |  implicit class ClintEaswood(name:String) {
            |    def magnum = "boom"
            |  }
            |  "sammy".magnum
            |}
          """.stripMargin
        compileCodeSnippet(code)
        compiler.scapegoat.feedback.warnings.size shouldBe 0
      }
    }
  }
}


text:
"""
Shows backlog count of ScheduledEmail
"""
from datetime import timedelta
from typing import Any

from django.core.management.base import BaseCommand
from django.utils.timezone import now as timezone_now

from zerver.models import ScheduledEmail

class Command(BaseCommand):
    help = """Shows backlog count of ScheduledEmail
(The number of currently overdue (by at least a minute) email jobs)

This is run as part of the nagios health check for the deliver_scheduled_emails command.

Usage: ./manage.py print_email_delivery_backlog
"""

    def handle(self, *args: Any, **options: Any) -> None:
        print(
            ScheduledEmail.objects.filter(
                scheduled_timestamp__lte=timezone_now() - timedelta(minutes=1)
            ).count()
        )


text:
'use strict';

const emailAdminForGenericCV    = require('../utils/app.js').emailAdminForGenericCV;

const submitCandidateSchema     = require('../utils/joiSchema.js').submitCandidateSchema;
const frontendInput             = require('../utils/joiSchema.js').frontendInput;
const cleanPayload              = require('../utils/app.js').cleanPayload;
const calculateFee              = require('../utils/app.js').calculateFee;
const phoneNumber               = require('../utils/joiSchema.js').phoneNumber;
const url                       = require('../utils/joiSchema.js').url;

const emailAdminHarnessTalentCv   = require('../utils/mailgun.js').emailAdminHarnessTalentCv;
const emailCandidateHarnessTalent = require('../utils/mailgun.js').emailCandidateHarnessTalent;

const mailgun                   = require('../utils/mailgun.js');
const moment                    = require('moment');
const uuid                      = require('uuid');

const addCvToHarnessTalent   = require('../../db/redis/addcvtoharnesstalent.js');
const getHashKeyValue        = require('../../db/redis/gethashkeyvalue.js');
const checkCandidateExists   = require('../../db/redis/checkCandidateExists.js');
const client                 = require('../../db/client.js')

const layout = { layout: 'agency' };

exports.register = (server, options, next) => {

    server.route([{
        method: 'GET',
        path: '/agency/submitcandidate',
        config: {
            auth: {
                strategy: 'hrns-cookie',
                scope: 'agency'
            },
            handler: (request, reply) => {
                let opts = {
                    title: 'Submit Candidate',
                    frontendInput: frontendInput,
                    phoneNumber: phoneNumber,
                    url: url
                };
                reply.view('submitcandidate', opts, layout);
            }
        }
    }, {
        method: 'POST',
        path: '/agency/submitcandidate',
        config: {
            auth: {
                strategy: 'hrns-cookie',
                scope: 'agency'
            },
            validate: {
                payload: submitCandidateSchema
            },
            handler: (request, reply) => { /// this doesn't add candidate to database.
                let id = request.auth.credentials.profile.id;
                let opts = {};
                let payload = cleanPayload(request.payload);
                let candidateEmail = payload.email;

                let cvid =  uuid.v1()+'cvid'; //payload.file_url.split(process.env.BUCKET_URL)[1];
                payload.cvid = cvid;
                payload.stage = 'waiting-approval';
                payload.agencyId = id;
                payload.fee =  calculateFee(payload.salary);
                payload.interviewsRequested = 0;
                let candidateName = payload.candidateName;

                checkCandidateExists('HarnessTalent',candidateName , (result) => {

                      if(result === false){
                      client.hgetallAsync(id)
                        .then((agencyDetails)=>{
                          payload.agencyName = agencyDetails.companyName;
                          payload.agencyEmail = agencyDetails.email;
                          payload.dateSubmitted = moment().format('llll').slice(0,-8);
                        })
                        .then(()=>{
                           mailgun.messages().send(emailAdminHarnessTalentCv);
                        })
                        .then(()=>{
                          let context = Object.assign({},emailCandidateHarnessTalent);
                          context.html = context.html
                          .replace(/-agencyName-/g, payload.agencyName)
                          .replace('-candidateName-', candidateName);
                          context.subject = context.subject
                          .replace('-agencyName-',payload.agencyName);
                          context.to = candidateEmail;
                          mailgun.messages().send(context);
                        })
                        .then((res) => {
                          addCvToHarnessTalent(cvid, payload )
                        })
                        .then(() => {
                          opts.title = 'Success!';
                          opts.message = 'Thanks for submitting your candidate, admin will now check over your candidate!';
                          reply.view('message', opts, layout);
                        })
                        .catch(()=>{
                            let failMessage = 'Sorry, something went wrong... please try again'
                            opts.title = 'Submission failed...';
                            opts.message = failMessage;
                            reply.view('message', opts, layout);
                        });

                      } else if(candidateName === result.candidateName && result.agencyId !== id ){
                            opts.title = 'Candidate already exists...';
                            opts.message = 'Unlucky another agency has uploaded this candidate already';
                            reply.view('message', opts, layout);
                      } else {
                            opts.title = 'Do you wish to resubmit?';
                            opts.message = 'Would you like to resubmit to Harness Talent ? click here';
                            reply.view('message', opts, layout);
                      }

                  });
              }
        }
    },
    {
        method: 'GET',
        path: '/agency/resubmitcandidate/{cvid*}',
        config: {
            auth: {
                strategy: 'hrns-cookie',
                scope: 'agency'
            },
            handler: (request, reply) => {
                let opts = {};
                let cvid = request.params.cvid;

                client.hgetallAsync(cvid)
                  .then((candidate) => {
                      candidate.dateSubmitted = moment().format('llll').slice(0,-8);
                      client.smove('HarnessTalent', 'HarnessTalentAdminShortList', cvid);
                  })
                  .then(() => {
                      opts.title = 'Candidate Re-submitted';
                      opts.message = 'We have re-submitted the candidate for approval from admin';
                      reply.view('message', opts, layout);
                  })
                  .catch(()=>{
                        let failMessage = 'Sorry, something went wrong... please try again'
                        opts.title = 'Submission failed...';
                        opts.message = failMessage;
                        reply.view('message', opts, layout);

                  })
            }
        }
    }]);
    return next();
};

exports.register.attributes = {
    name: 'SubmitCandidate'
};


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.eventgrid.generated;

import com.azure.core.util.Context;

/** Samples for PartnerConfigurations Delete. */
public final class PartnerConfigurationsDeleteSamples {
    /*
     * x-ms-original-file: specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2022-06-15/examples/PartnerConfigurations_Delete.json
     */
    /**
     * Sample code: PartnerConfigurations_Delete.
     *
     * @param manager Entry point to EventGridManager.
     */
    public static void partnerConfigurationsDelete(com.azure.resourcemanager.eventgrid.EventGridManager manager) {
        manager.partnerConfigurations().delete("examplerg", Context.NONE);
    }
}


text:
dcheck imwheel || return

imwheel -b 4567


text:
package com.github.fppt.jedismock.operations.hashes;

import com.github.fppt.jedismock.datastructures.Slice;
import com.github.fppt.jedismock.operations.AbstractRedisOperation;
import com.github.fppt.jedismock.operations.RedisCommand;
import com.github.fppt.jedismock.server.Response;
import com.github.fppt.jedismock.storage.RedisBase;

import java.util.List;

@RedisCommand("hstrlen")
public class HStrlen extends AbstractRedisOperation {
    public HStrlen(RedisBase base, List<Slice> params) {
        super(base, params);
    }

    @Override
    protected Slice response() {
        Slice key = params().get(0);
        Slice field = params().get(1);
        Slice result = base().getFieldsAndValues(key).get(field);
        return Response.integer(result == null ? 0 : result.toString().length());
    }
}


text:
package xyz.yhsj.mvprodemo.common;

import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * A helper of retrofit2 for creating restful service easier.
 * <p/>
 * Created by LOVE on 2016/3/24.
 */
public class RetrofitClient {

    private static String HOST_NAME = "https://weatherapi.market.xiaomi.com/wtr-v3/";

    private static final RetrofitClient instance = new RetrofitClient();

    public static RetrofitClient getInstance() {
        return instance;
    }

    private Retrofit retrofit;

    public RetrofitClient() {
        createRetrofit();
    }

    private void createRetrofit() {
        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);

        OkHttpClient okHttpClient = new OkHttpClient.Builder()
                .addInterceptor(interceptor)
                .build();

        retrofit = new Retrofit.Builder()
                .baseUrl(HOST_NAME)
                .client(okHttpClient)
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .build();
    }

    public <T> T create(Class<?> clazz) {
        return (T) retrofit.create(clazz);
    }

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace BusterWood.Mapper
{
    class Grouping<TKey, TElement> : IGrouping<TKey, TElement>, IList<TElement>, IReadOnlyCollection<TElement>
    {
        internal TKey _key;
        internal int _hashCode;
        internal TElement[] _elements;
        internal int _count;
        internal Grouping<TKey, TElement> _hashNext;
        internal Grouping<TKey, TElement> _next;

        internal void Add(TElement element)
        {
            if (_elements.Length == _count)
            {
                Array.Resize(ref _elements, checked(_count * 2));
            }
            _elements[_count] = element;
            _count++;
        }

        public IEnumerator<TElement> GetEnumerator()
        {
            for (int i = 0; i < _count; i++)
            {
                yield return _elements[i];
            }
        }

        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();

        /// <summary>Gets the key of the <see cref="T:System.Linq.IGrouping`2"/>.</summary>
        /// <returns>The key of the <see cref="T:System.Linq.IGrouping`2"/>.</returns>
        public TKey Key => _key;

        public int Count => _count;

        bool ICollection<TElement>.IsReadOnly => true;

        public bool Contains(TElement item) => Array.IndexOf(_elements, item, 0, _count) >= 0;

        public void CopyTo(TElement[] array, int arrayIndex)
        {
            Array.Copy(_elements, 0, array, arrayIndex, _count);
        }

        public int IndexOf(TElement item) => Array.IndexOf(_elements, item, 0, _count);

        public TElement this[int index]
        {
            get
            {
                if (index < 0 || index >= _count) throw new ArgumentOutOfRangeException(nameof(index));
                return _elements[index];
            }
            set { throw new NotSupportedException(); }
        }

        void ICollection<TElement>.Add(TElement item)
        {
            throw new NotSupportedException();
        }

        void ICollection<TElement>.Clear()
        {
            throw new NotSupportedException();
        }

        bool ICollection<TElement>.Remove(TElement item)
        {
            throw new NotSupportedException();
        }

        void IList<TElement>.Insert(int index, TElement item)
        {
            throw new NotSupportedException();
        }

        void IList<TElement>.RemoveAt(int index)
        {
            throw new NotSupportedException();
        }
    }

}


text:
package ru.r2cloud.jradio.lrpt;

public class Packet {

	private byte version = -1;
	private int apid;
	private boolean secondaryHeader;
	private byte sequence;
	private int sequenceCount;
	private int length;
	private int numberOfDays = -1;
	private long millisecondOfDay;
	private int microsecondOfMillisecond;
	private byte[] userData;

	public byte[] getUserData() {
		return userData;
	}

	public void setUserData(byte[] userData) {
		this.userData = userData;
	}

	public int getNumberOfDays() {
		return numberOfDays;
	}

	public void setNumberOfDays(int numberOfDays) {
		this.numberOfDays = numberOfDays;
	}

	public long getMillisecondOfDay() {
		return millisecondOfDay;
	}

	public void setMillisecondOfDay(long millisecondOfDay) {
		this.millisecondOfDay = millisecondOfDay;
	}

	public int getMicrosecondOfMillisecond() {
		return microsecondOfMillisecond;
	}

	public void setMicrosecondOfMillisecond(int microsecondOfMillisecond) {
		this.microsecondOfMillisecond = microsecondOfMillisecond;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

	public int getSequenceCount() {
		return sequenceCount;
	}

	public void setSequenceCount(int sequenceCount) {
		this.sequenceCount = sequenceCount;
	}

	public byte getSequence() {
		return sequence;
	}

	public void setSequence(byte sequence) {
		this.sequence = sequence;
	}

	public boolean isSecondaryHeader() {
		return secondaryHeader;
	}

	public void setSecondaryHeader(boolean secondaryHeader) {
		this.secondaryHeader = secondaryHeader;
	}

	public int getApid() {
		return apid;
	}

	public void setApid(int apid) {
		this.apid = apid;
	}

	public byte getVersion() {
		return version;
	}

	public void setVersion(byte version) {
		this.version = version;
	}

}


text:
namespace net {

class NET_EXPORT_PRIVATE TcpReceiver : public ReceiveAlgorithmInterface {
 public:
  TcpReceiver();

  // Size of the (currently fixed) receive window.
  static const QuicByteCount kReceiveWindowTCP;

  // Start implementation of SendAlgorithmInterface.
  virtual bool GenerateCongestionFeedback(
      QuicCongestionFeedbackFrame* feedback) OVERRIDE;

  virtual void RecordIncomingPacket(QuicByteCount bytes,
                                    QuicPacketSequenceNumber sequence_number,
                                    QuicTime timestamp) OVERRIDE;

 private:
  QuicByteCount receive_window_;

  DISALLOW_COPY_AND_ASSIGN(TcpReceiver);
};

}  // namespace net
#endif  // NET_QUIC_CONGESTION_CONTROL_TCP_RECEIVER_H_


text:
XMLVM_FORWARD_DECL(java_lang_Double)
#endif
#ifndef XMLVM_FORWARD_DECL_java_lang_Float
#define XMLVM_FORWARD_DECL_java_lang_Float
XMLVM_FORWARD_DECL(java_lang_Float)
#endif
#ifndef XMLVM_FORWARD_DECL_java_lang_Integer
#define XMLVM_FORWARD_DECL_java_lang_Integer
XMLVM_FORWARD_DECL(java_lang_Integer)
#endif
#ifndef XMLVM_FORWARD_DECL_java_lang_Long
#define XMLVM_FORWARD_DECL_java_lang_Long
XMLVM_FORWARD_DECL(java_lang_Long)
#endif
// Class declarations for java.lang.Math
XMLVM_DEFINE_CLASS(java_lang_Math, 6, XMLVM_ITABLE_SIZE_java_lang_Math)

extern JAVA_OBJECT __CLASS_java_lang_Math;
extern JAVA_OBJECT __CLASS_java_lang_Math_1ARRAY;
extern JAVA_OBJECT __CLASS_java_lang_Math_2ARRAY;
extern JAVA_OBJECT __CLASS_java_lang_Math_3ARRAY;
//XMLVM_BEGIN_DECLARATIONS
#define __ADDITIONAL_INSTANCE_FIELDS_java_lang_Math
//XMLVM_END_DECLARATIONS

#define __INSTANCE_FIELDS_java_lang_Math \
    __INSTANCE_FIELDS_java_lang_Object; \
    struct { \
        __ADDITIONAL_INSTANCE_FIELDS_java_lang_Math \
    } java_lang_Math

struct java_lang_Math {
    __TIB_DEFINITION_java_lang_Math* tib;
    struct {
        __INSTANCE_FIELDS_java_lang_Math;
    } fields;
};
#ifndef XMLVM_FORWARD_DECL_java_lang_Math
#define XMLVM_FORWARD_DECL_java_lang_Math
typedef struct java_lang_Math java_lang_Math;
#endif

#define XMLVM_VTABLE_SIZE_java_lang_Math 6

void __INIT_java_lang_Math();
void __INIT_IMPL_java_lang_Math();
void __DELETE_java_lang_Math(void* me, void* client_data);
void __INIT_INSTANCE_MEMBERS_java_lang_Math(JAVA_OBJECT me, int derivedClassWillRegisterFinalizer);
JAVA_OBJECT __NEW_java_lang_Math();
JAVA_OBJECT __NEW_INSTANCE_java_lang_Math();
JAVA_INT java_lang_Math_GET_FLOAT_EXPONENT_BIAS();
void java_lang_Math_PUT_FLOAT_EXPONENT_BIAS(JAVA_INT v);
JAVA_INT java_lang_Math_GET_FLOAT_EXPONENT_MASK();
void java_lang_Math_PUT_FLOAT_EXPONENT_MASK(JAVA_INT v);
JAVA_INT java_lang_Math_GET_DOUBLE_NON_MANTISSA_BITS();
void java_lang_Math_PUT_DOUBLE_NON_MANTISSA_BITS(JAVA_INT v);
JAVA_INT java_lang_Math_GET_DOUBLE_MANTISSA_BITS();
void java_lang_Math_PUT_DOUBLE_MANTISSA_BITS(JAVA_INT v);
JAVA_INT java_lang_Math_GET_FLOAT_NON_MANTISSA_BITS();
void java_lang_Math_PUT_FLOAT_NON_MANTISSA_BITS(JAVA_INT v);
JAVA_INT java_lang_Math_GET_FLOAT_MANTISSA_BITS();
void java_lang_Math_PUT_FLOAT_MANTISSA_BITS(JAVA_INT v);
JAVA_INT java_lang_Math_GET_DOUBLE_EXPONENT_BIAS();
void java_lang_Math_PUT_DOUBLE_EXPONENT_BIAS(JAVA_INT v);
JAVA_LONG java_lang_Math_GET_DOUBLE_EXPONENT_MASK();
void java_lang_Math_PUT_DOUBLE_EXPONENT_MASK(JAVA_LONG v);
JAVA_INT java_lang_Math_GET_FLOAT_MANTISSA_MASK();
void java_lang_Math_PUT_FLOAT_MANTISSA_MASK(JAVA_INT v);
JAVA_INT java_lang_Math_GET_FLOAT_SIGN_MASK();
void java_lang_Math_PUT_FLOAT_SIGN_MASK(JAVA_INT v);
JAVA_LONG java_lang_Math_GET_DOUBLE_MANTISSA_MASK();
void java_lang_Math_PUT_DOUBLE_MANTISSA_MASK(JAVA_LONG v);
JAVA_LONG java_lang_Math_GET_DOUBLE_SIGN_MASK();
void java_lang_Math_PUT_DOUBLE_SIGN_MASK(JAVA_LONG v);
JAVA_DOUBLE java_lang_Math_GET_E();
void java_lang_Math_PUT_E(JAVA_DOUBLE v);
JAVA_DOUBLE java_lang_Math_GET_PI();
void java_lang_Math_PUT_PI(JAVA_DOUBLE v);
JAVA_OBJECT java_lang_Math_GET_random();
void java_lang_Math_PUT_random(JAVA_OBJECT v);
void java_lang_Math___INIT___(JAVA_OBJECT me);
JAVA_DOUBLE java_lang_Math_abs___double(JAVA_DOUBLE n1);
JAVA_FLOAT java_lang_Math_abs___float(JAVA_FLOAT n1);
JAVA_INT java_lang_Math_abs___int(JAVA_INT n1);
JAVA_LONG java_lang_Math_abs___long(JAVA_LONG n1);
JAVA_DOUBLE java_lang_Math_acos___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_asin___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_atan___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_atan2___double_double(JAVA_DOUBLE n1, JAVA_DOUBLE n2);
JAVA_DOUBLE java_lang_Math_cbrt___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_ceil___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_cos___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_cosh___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_exp___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_expm1___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_floor___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_hypot___double_double(JAVA_DOUBLE n1, JAVA_DOUBLE n2);
JAVA_DOUBLE java_lang_Math_IEEEremainder___double_double(JAVA_DOUBLE n1, JAVA_DOUBLE n2);
JAVA_DOUBLE java_lang_Math_log___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_log10___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_log1p___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_max___double_double(JAVA_DOUBLE n1, JAVA_DOUBLE n2);
JAVA_FLOAT java_lang_Math_max___float_float(JAVA_FLOAT n1, JAVA_FLOAT n2);
JAVA_INT java_lang_Math_max___int_int(JAVA_INT n1, JAVA_INT n2);
JAVA_LONG java_lang_Math_max___long_long(JAVA_LONG n1, JAVA_LONG n2);
JAVA_DOUBLE java_lang_Math_min___double_double(JAVA_DOUBLE n1, JAVA_DOUBLE n2);
JAVA_FLOAT java_lang_Math_min___float_float(JAVA_FLOAT n1, JAVA_FLOAT n2);
JAVA_INT java_lang_Math_min___int_int(JAVA_INT n1, JAVA_INT n2);
JAVA_LONG java_lang_Math_min___long_long(JAVA_LONG n1, JAVA_LONG n2);
JAVA_DOUBLE java_lang_Math_pow___double_double(JAVA_DOUBLE n1, JAVA_DOUBLE n2);
JAVA_DOUBLE java_lang_Math_rint___double(JAVA_DOUBLE n1);
JAVA_LONG java_lang_Math_round___double(JAVA_DOUBLE n1);
JAVA_INT java_lang_Math_round___float(JAVA_FLOAT n1);
JAVA_DOUBLE java_lang_Math_signum___double(JAVA_DOUBLE n1);
JAVA_FLOAT java_lang_Math_signum___float(JAVA_FLOAT n1);
JAVA_DOUBLE java_lang_Math_sin___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_sinh___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_sqrt___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_tan___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_tanh___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_random__();
JAVA_DOUBLE java_lang_Math_toRadians___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_toDegrees___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_ulp___double(JAVA_DOUBLE n1);
JAVA_FLOAT java_lang_Math_ulp___float(JAVA_FLOAT n1);
JAVA_DOUBLE java_lang_Math_nextafter___double_double(JAVA_DOUBLE n1, JAVA_DOUBLE n2);
JAVA_FLOAT java_lang_Math_nextafterf___float_float(JAVA_FLOAT n1, JAVA_FLOAT n2);
JAVA_DOUBLE java_lang_Math_copySign___double_double(JAVA_DOUBLE n1, JAVA_DOUBLE n2);
JAVA_FLOAT java_lang_Math_copySign___float_float(JAVA_FLOAT n1, JAVA_FLOAT n2);
JAVA_INT java_lang_Math_getExponent___float(JAVA_FLOAT n1);
JAVA_INT java_lang_Math_getExponent___double(JAVA_DOUBLE n1);
JAVA_DOUBLE java_lang_Math_nextAfter___double_double(JAVA_DOUBLE n1, JAVA_DOUBLE n2);
JAVA_FLOAT java_lang_Math_nextAfter___float_double(JAVA_FLOAT n1, JAVA_DOUBLE n2);
JAVA_DOUBLE java_lang_Math_nextUp___double(JAVA_DOUBLE n1);
JAVA_FLOAT java_lang_Math_nextUp___float(JAVA_FLOAT n1);
JAVA_DOUBLE java_lang_Math_scalb___double_int(JAVA_DOUBLE n1, JAVA_INT n2);
JAVA_FLOAT java_lang_Math_scalb___float_int(JAVA_FLOAT n1, JAVA_INT n2);
JAVA_INT java_lang_Math_shiftIntBits___int_int(JAVA_INT n1, JAVA_INT n2);
JAVA_LONG java_lang_Math_shiftLongBits___long_long(JAVA_LONG n1, JAVA_LONG n2);

#endif


text:
<?php

namespace Lug\Bundle\GridBundle\Form\Type\Filter;

use Lug\Bundle\GridBundle\Form\EventSubscriber\Filter\NumberFilterSubscriber;
use Lug\Component\Grid\Filter\Type\NumberType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;

/**
 * @author GeLo <geloen.eric@gmail.com>
 */
class NumberFilterType extends AbstractFilterType
{
    /**
     * @var NumberFilterSubscriber
     */
    private $numberFilterSubscriber;

    /***
     * @param NumberFilterSubscriber $numberFilterSubscriber
     */
    public function __construct(NumberFilterSubscriber $numberFilterSubscriber)
    {
        $this->numberFilterSubscriber = $numberFilterSubscriber;
    }

    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add($builder->create('type', ChoiceType::class, [
                'choices' => array_combine(
                    array_map(function ($choice) use ($options) {
                        return $options['label_prefix'].'.type.'.$choice;
                    }, $choices = NumberType::getTypes()),
                    $choices
                ),
                'choices_as_values'        => true,
                'xml_http_request_trigger' => true,
            ])
            ->addEventSubscriber($this->numberFilterSubscriber));
    }
}


text:
module.exports = function () {
    return {
        'abbr-count': require('./lib/abbr-count.js'),
        'calendar': require('./lib/calendar.js'),
        'capitalize': require('./lib/capitalize.js'),
        'chr-gt': require('./lib/chr-gt.js'),
        'chr-lt': require('./lib/chr-lt.js'),
        'each-key': require('./lib/each-key.js'),
        'each-limit': require('./lib/each-limit.js'),
        'each-reverse': require('./lib/each-reverse.js'),
        'either': require('./lib/either.js'),
        'encodeURIComponent': require('./lib/encodeURIComponent.js'),
        'eq': require('./lib/eq.js'),
        'firstof': require('./lib/firstof.js'),
        'if-gt': require('./lib/if-gt.js'),
        'if-lt': require('./lib/if-lt.js'),
        'indefinite-article': require('./lib/indefinite-article.js'),
        'input-select': require('./lib/input-select.js'),
        'iter': require('./lib/iter.js'),
        'join': require('./lib/join.js'),
        'neither': require('./lib/neither.js'),
        'not-eq': require('./lib/not-eq.js'),
        'number': require('./lib/number.js'),
        'pack-it': require('./lib/pack-it.js'),
        'paragraphify': require('./lib/paragraphify.js'),
        'possessive': require('./lib/possessive.js'),
        'repeat': require('./lib/repeat.js'),
        'subtract': require('./lib/subtract.js'),
        'title-case': require('./lib/title-case.js'),
        'urlify': require('./lib/urlify.js')
    }
};


text:
Pattern: Use of space after method name

Issue: -

## Description

Checks that there is no whitespace after the method name when a method call contains parenthesis or that there is at most one space after the method name if the call does not contain parenthesis.

## Examples

```java
aMethod ("arg") //violation

aMethod  "arg" //violation

throw new Exception () //violation
```

## Further Reading

* [CodeNarc - SpaceAfterMethodCallName](https://codenarc.org/codenarc-rules-formatting.html#spaceaftermethodcallname-rule)


text:
  Saulnay est
       un village
       situé dans le département de l'Indre en Centre. On dénombrait 181 habitants en 2008.

La ville offre quelques  aménagements, elle dispose, entre autres, de un centre d'équitation, un terrain de sport et une boucle de randonnée.

Le parc de logements, à Saulnay, était réparti en 2011 en trois appartements et 142 maisons soit
 un marché relativement équilibré.

Si vous pensez demenager à Saulnay, vous pourrez aisément trouver une maison à acheter.

À proximité de Saulnay sont situées les villes de
La Celle-Guenand localisée à 9 km, 371 habitants,
Azay-le-Ferron située à 8 km, 949 habitants,
Obterre à 2 km, 239 habitants,
Charnizay localisée à 1 km, 489 habitants,
Le Petit-Pressigny située à 6 km, 326 habitants,
Cléré-du-Bois localisée à 7 km, 293 habitants,
 entre autres. De plus, Saulnay est située à seulement 24 km de Loches.


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        wx/propgrid/props.h
// Purpose:     wxPropertyGrid Property Classes
// Author:      Jaakko Salli
// Modified by:
// Created:     2007-03-28
// Copyright:   (c) Jaakko Salli
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _WX_PROPGRID_PROPS_H_
#define _WX_PROPGRID_PROPS_H_

#include "wx/defs.h"

#if wxUSE_PROPGRID

// -----------------------------------------------------------------------

class wxPGArrayEditorDialog;

#include "wx/propgrid/editors.h"

#include "wx/filename.h"
#include "wx/dialog.h"
#include "wx/textctrl.h"
#include "wx/button.h"
#include "wx/listbox.h"
#include "wx/valtext.h"

// -----------------------------------------------------------------------

//
// Property class implementation helper macros.
//

#define wxPG_IMPLEMENT_PROPERTY_CLASS(NAME, UPCLASS, EDITOR) \
wxIMPLEMENT_DYNAMIC_CLASS(NAME, UPCLASS); \
wxPG_IMPLEMENT_PROPERTY_CLASS_PLAIN(NAME, EDITOR)

#if WXWIN_COMPATIBILITY_3_0
// This macro is deprecated. Use wxPG_IMPLEMENT_PROPERTY_CLASS instead.
#define WX_PG_IMPLEMENT_PROPERTY_CLASS(NAME, UPCLASS, T, T_AS_ARG, EDITOR) \
wxIMPLEMENT_DYNAMIC_CLASS(NAME, UPCLASS); \
WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(NAME, T, EDITOR)
#endif // WXWIN_COMPATIBILITY_3_0

// -----------------------------------------------------------------------

//
// These macros help creating DoGetValidator
#define WX_PG_DOGETVALIDATOR_ENTRY() \
    static wxValidator* s_ptr = NULL; \
    if ( s_ptr ) return s_ptr;

// Common function exit
#define WX_PG_DOGETVALIDATOR_EXIT(VALIDATOR) \
    s_ptr = VALIDATOR; \
    wxPGGlobalVars->m_arrValidators.push_back( VALIDATOR ); \
    return VALIDATOR;

// -----------------------------------------------------------------------

/** @class wxPGInDialogValidator
    @ingroup classes
    Creates and manages a temporary wxTextCtrl for validation purposes.
    Uses wxPropertyGrid's current editor, if available.
*/
class WXDLLIMPEXP_PROPGRID wxPGInDialogValidator
{
public:
    wxPGInDialogValidator()
    {
        m_textCtrl = NULL;
    }

    ~wxPGInDialogValidator()
    {
        if ( m_textCtrl )
            m_textCtrl->Destroy();
    }

    bool DoValidate( wxPropertyGrid* propGrid,
                     wxValidator* validator,
                     const wxString& value );

private:
    wxTextCtrl*         m_textCtrl;
};

// -----------------------------------------------------------------------
// Property classes
// -----------------------------------------------------------------------

#define wxPG_PROP_PASSWORD  wxPG_PROP_CLASS_SPECIFIC_2

/** @class wxStringProperty
    @ingroup classes
    Basic property with string value.

    Supported special attributes:
    - "Password": set to 1 in order to enable wxTE_PASSWORD on the editor.

    @remarks
    - If value "<composed>" is set, then actual value is formed (or composed)
      from values of child properties.
*/
class WXDLLIMPEXP_PROPGRID wxStringProperty : public wxPGProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxStringProperty)
public:
    wxStringProperty( const wxString& label = wxPG_LABEL,
                      const wxString& name = wxPG_LABEL,
                      const wxString& value = wxEmptyString );
    virtual ~wxStringProperty();

    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0 ) const wxOVERRIDE;

    virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE;

    /** This is updated so "<composed>" special value can be handled.
    */
    virtual void OnSetValue() wxOVERRIDE;

protected:
};

// -----------------------------------------------------------------------

/** Constants used with NumericValidation<>().
*/
enum wxPGNumericValidationConstants
{
    /** Instead of modifying the value, show an error message.
    */
    wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE      = 0,

    /** Modify value, but stick with the limitations.
    */
    wxPG_PROPERTY_VALIDATION_SATURATE           = 1,

    /** Modify value, wrap around on overflow.
    */
    wxPG_PROPERTY_VALIDATION_WRAP               = 2
};

// -----------------------------------------------------------------------

#if wxUSE_VALIDATORS

/**
    A more comprehensive numeric validator class.
*/
class WXDLLIMPEXP_PROPGRID wxNumericPropertyValidator : public wxTextValidator
{
public:
    enum NumericType
    {
        Signed = 0,
        Unsigned,
        Float
    };

    wxNumericPropertyValidator( NumericType numericType, int base = 10 );
    virtual ~wxNumericPropertyValidator() { }
    virtual bool Validate(wxWindow* parent) wxOVERRIDE;
};

#endif // wxUSE_VALIDATORS

/** @class wxIntProperty
    @ingroup classes
    Basic property with integer value.

    Seamlessly supports 64-bit integer (wxLongLong) on overflow.

    Example how to use seamless 64-bit integer support

      Getting value:

      @code
          wxLongLong_t value = pg->GetPropertyValueAsLongLong();
      @endcode

         or

      @code
          wxLongLong value;
          wxVariant variant = property->GetValue();
          if ( variant.IsType("longlong") )
              value = variant.GetLongLong();
          else
              value = variant.GetLong();
      @endcode

      Setting value:

       @code
          pg->SetPropertyValue(longLongVal);
      @endcode

         or

      @code
          property->SetValue(WXVARIANT(longLongVal));
      @endcode

    Supported special attributes:
    - "Min", "Max": Specify acceptable value range.
*/
class WXDLLIMPEXP_PROPGRID wxIntProperty : public wxPGProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxIntProperty)
public:
    wxIntProperty( const wxString& label = wxPG_LABEL,
                   const wxString& name = wxPG_LABEL,
                   long value = 0 );
    virtual ~wxIntProperty();

#if wxUSE_LONGLONG
    wxIntProperty( const wxString& label,
                   const wxString& name,
                   const wxLongLong& value );
#endif
    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0 ) const wxOVERRIDE;
    virtual bool ValidateValue( wxVariant& value,
                                wxPGValidationInfo& validationInfo ) const wxOVERRIDE;
    virtual bool IntToValue( wxVariant& variant,
                             int number,
                             int argFlags = 0 ) const wxOVERRIDE;
    static wxValidator* GetClassValidator();
    virtual wxValidator* DoGetValidator() const wxOVERRIDE;

    /** Validation helpers.
    */
#if defined(wxLongLong_t) && wxUSE_LONGLONG
    static bool DoValidation( const wxPGProperty* property,
                              wxLongLong_t& value,
                              wxPGValidationInfo* pValidationInfo,
                              int mode =
                                wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE );
#endif
    static bool DoValidation(const wxPGProperty* property,
                             long& value,
                             wxPGValidationInfo* pValidationInfo,
                             int mode =
                                wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE);

protected:
};

// -----------------------------------------------------------------------

/** @class wxUIntProperty
    @ingroup classes
    Basic property with unsigned integer value.
    Seamlessly supports 64-bit integer (wxULongLong) on overflow.

    Supported special attributes:
    - "Min", "Max": Specify acceptable value range.
    - "Base": Define base. Valid constants are wxPG_BASE_OCT, wxPG_BASE_DEC,
    wxPG_BASE_HEX and wxPG_BASE_HEXL (lowercase characters). Arbitrary bases
    are not supported.
    - "Prefix": Possible values are wxPG_PREFIX_NONE, wxPG_PREFIX_0x, and
    wxPG_PREFIX_DOLLAR_SIGN. Only wxPG_PREFIX_NONE works with Decimal and Octal
    numbers.

    @remarks
    - For example how to use seamless 64-bit integer support, see wxIntProperty
    documentation (just use wxULongLong instead of wxLongLong).
*/
class WXDLLIMPEXP_PROPGRID wxUIntProperty : public wxPGProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxUIntProperty)
public:
    wxUIntProperty( const wxString& label = wxPG_LABEL,
                    const wxString& name = wxPG_LABEL,
                    unsigned long value = 0 );
    virtual ~wxUIntProperty();
#if wxUSE_LONGLONG
    wxUIntProperty( const wxString& label,
                    const wxString& name,
                    const wxULongLong& value );
#endif
    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0 ) const wxOVERRIDE;
    virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE;
    virtual bool ValidateValue( wxVariant& value,
                                wxPGValidationInfo& validationInfo ) const wxOVERRIDE;
    virtual wxValidator* DoGetValidator () const wxOVERRIDE;
    virtual bool IntToValue( wxVariant& variant,
                             int number,
                             int argFlags = 0 ) const wxOVERRIDE;

protected:
    wxByte      m_base;
    wxByte      m_realBase; // translated to 8,16,etc.
    wxByte      m_prefix;
private:
    void Init();

    // Validation helpers.
#if defined(wxULongLong_t) && wxUSE_LONGLONG
    static bool DoValidation(const wxPGProperty* property,
                             wxULongLong_t& value,
                             wxPGValidationInfo* pValidationInfo,
                             int mode =wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE);
#endif
    static bool DoValidation(const wxPGProperty* property,
                             long& value,
                             wxPGValidationInfo* pValidationInfo,
                             int mode = wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE);
};

// -----------------------------------------------------------------------

/** @class wxFloatProperty
    @ingroup classes
    Basic property with double-precision floating point value.

    Supported special attributes:
    - "Precision": Sets the (max) precision used when floating point value is
    rendered as text. The default -1 means infinite precision.
*/
class WXDLLIMPEXP_PROPGRID wxFloatProperty : public wxPGProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxFloatProperty)
public:
    wxFloatProperty( const wxString& label = wxPG_LABEL,
                     const wxString& name = wxPG_LABEL,
                     double value = 0.0 );
    virtual ~wxFloatProperty();

    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0 ) const wxOVERRIDE;
    virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE;
    virtual wxVariant DoGetAttribute( const wxString& name ) const wxOVERRIDE;

    virtual bool ValidateValue( wxVariant& value,
                                wxPGValidationInfo& validationInfo ) const wxOVERRIDE;

    /** Validation helper.
    */
    static bool DoValidation( const wxPGProperty* property,
                              double& value,
                              wxPGValidationInfo* pValidationInfo,
                              int mode =
                                 wxPG_PROPERTY_VALIDATION_ERROR_MESSAGE );
    static wxValidator* GetClassValidator();
    virtual wxValidator* DoGetValidator () const wxOVERRIDE;

protected:
    int m_precision;
};

// -----------------------------------------------------------------------

/** @class wxBoolProperty
    @ingroup classes
    Basic property with boolean value.

    Supported special attributes:
    - "UseCheckbox": Set to 1 to use check box editor instead of combo box.
    - "UseDClickCycling": Set to 1 to cycle combo box instead showing the list.
*/
class WXDLLIMPEXP_PROPGRID wxBoolProperty : public wxPGProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxBoolProperty)
public:
    wxBoolProperty( const wxString& label = wxPG_LABEL,
                    const wxString& name = wxPG_LABEL,
                    bool value = false );
    virtual ~wxBoolProperty();

    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0 ) const wxOVERRIDE;
    virtual bool IntToValue( wxVariant& variant,
                             int number, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE;
    virtual wxVariant DoGetAttribute( const wxString& name ) const wxOVERRIDE;
};

// -----------------------------------------------------------------------

// If set, then selection of choices is static and should not be
// changed (i.e. returns NULL in GetPropertyChoices).
#define wxPG_PROP_STATIC_CHOICES    wxPG_PROP_CLASS_SPECIFIC_1

/** @class wxEnumProperty
    @ingroup classes
    You can derive custom properties with choices from this class. See
    wxBaseEnumProperty for remarks.

    @remarks
    - Updating private index is important. You can do this either by calling
    SetIndex() in IntToValue, and then letting wxBaseEnumProperty::OnSetValue
    be called (by not implementing it, or by calling super class function in
    it) -OR- you can just call SetIndex in OnSetValue.
*/
class WXDLLIMPEXP_PROPGRID wxEnumProperty : public wxPGProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxEnumProperty)
public:

#ifndef SWIG
    wxEnumProperty( const wxString& label = wxPG_LABEL,
                    const wxString& name = wxPG_LABEL,
                    const wxChar* const* labels = NULL,
                    const long* values = NULL,
                    int value = 0 );
    wxEnumProperty( const wxString& label,
                    const wxString& name,
                    wxPGChoices& choices,
                    int value = 0 );

    // Special constructor for caching choices (used by derived class)
    wxEnumProperty( const wxString& label,
                    const wxString& name,
                    const char* const* untranslatedLabels,
                    const long* values,
                    wxPGChoices* choicesCache,
                    int value = 0 );

    wxEnumProperty( const wxString& label,
                    const wxString& name,
                    const wxArrayString& labels,
                    const wxArrayInt& values = wxArrayInt(),
                    int value = 0 );
#else
    wxEnumProperty( const wxString& label = wxPG_LABEL,
                    const wxString& name = wxPG_LABEL,
                    const wxArrayString& labels = wxArrayString(),
                    const wxArrayInt& values = wxArrayInt(),
                    int value = 0 );
#endif

    virtual ~wxEnumProperty();

    size_t GetItemCount() const { return m_choices.GetCount(); }

    virtual void OnSetValue() wxOVERRIDE;
    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0 ) const wxOVERRIDE;
    virtual bool ValidateValue( wxVariant& value,
                                wxPGValidationInfo& validationInfo ) const wxOVERRIDE;

    // If wxPG_FULL_VALUE is not set in flags, then the value is interpreted
    // as index to choices list. Otherwise, it is actual value.
    virtual bool IntToValue( wxVariant& variant,
                             int number,
                             int argFlags = 0 ) const wxOVERRIDE;

    //
    // Additional virtuals

    // This must be overridden to have non-index based value
    virtual int GetIndexForValue( int value ) const;

    // GetChoiceSelection needs to overridden since m_index is
    // the true index, and various property classes derived from
    // this take advantage of it.
    virtual int GetChoiceSelection() const wxOVERRIDE { return m_index; }

    virtual void OnValidationFailure( wxVariant& pendingValue ) wxOVERRIDE;

protected:

    int GetIndex() const;
    void SetIndex( int index );

#if WXWIN_COMPATIBILITY_3_0
    wxDEPRECATED_MSG("use ValueFromString_(wxVariant&, int*, const wxString&, int) function instead")
    bool ValueFromString_( wxVariant& value,
                           const wxString& text,
                           int argFlags ) const
    {
        return ValueFromString_(value, NULL, text, argFlags);
    }
    wxDEPRECATED_MSG("use ValueFromInt_(wxVariant&, int*, int, int) function instead")
    bool ValueFromInt_( wxVariant& value, int intVal, int argFlags ) const
    {
        return ValueFromInt_(value, NULL, intVal, argFlags);
    }
    wxDEPRECATED_MSG("don't use ResetNextIndex() function")
    static void ResetNextIndex() { }
#endif
    // Converts text to value and returns corresponding index in the collection
    bool ValueFromString_(wxVariant& value,
                          int* pIndex,
                          const wxString& text,
                          int argFlags) const;
    // Converts number to value and returns corresponding index in the collection
    bool ValueFromInt_(wxVariant& value, int* pIndex, int intVal, int argFlags) const;

private:
    // This is private so that classes are guaranteed to use GetIndex
    // for up-to-date index value.
    int                     m_index;
};

// -----------------------------------------------------------------------

/** @class wxEditEnumProperty
    @ingroup classes
    wxEnumProperty with wxString value and writable combo box editor.

    @remarks
    Uses int value, similar to wxEnumProperty, unless text entered by user is
    is not in choices (in which case string value is used).
*/
class WXDLLIMPEXP_PROPGRID wxEditEnumProperty : public wxEnumProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxEditEnumProperty)
public:

    wxEditEnumProperty( const wxString& label,
                        const wxString& name,
                        const wxChar* const* labels,
                        const long* values,
                        const wxString& value );
    wxEditEnumProperty( const wxString& label = wxPG_LABEL,
                        const wxString& name = wxPG_LABEL,
                        const wxArrayString& labels = wxArrayString(),
                        const wxArrayInt& values = wxArrayInt(),
                        const wxString& value = wxEmptyString );
    wxEditEnumProperty( const wxString& label,
                        const wxString& name,
                        wxPGChoices& choices,
                        const wxString& value = wxEmptyString );

    // Special constructor for caching choices (used by derived class)
    wxEditEnumProperty( const wxString& label,
                        const wxString& name,
                        const char* const* untranslatedLabels,
                        const long* values,
                        wxPGChoices* choicesCache,
                        const wxString& value );

    virtual ~wxEditEnumProperty();

    void OnSetValue() wxOVERRIDE;
    bool StringToValue(wxVariant& variant,
                       const wxString& text,
                       int argFlags = 0) const wxOVERRIDE;
    bool ValidateValue(wxVariant& value,
                       wxPGValidationInfo& validationInfo) const wxOVERRIDE;

protected:
};

// -----------------------------------------------------------------------

/** @class wxFlagsProperty
    @ingroup classes
    Represents a bit set that fits in a long integer. wxBoolProperty
    sub-properties are created for editing individual bits. Textctrl is created
    to manually edit the flags as a text; a continuous sequence of spaces,
    commas and semicolons is considered as a flag id separator.
    Note: When changing "choices" (ie. flag labels) of wxFlagsProperty,
    you will need to use SetPropertyChoices - otherwise they will not get
    updated properly.
*/
class WXDLLIMPEXP_PROPGRID wxFlagsProperty : public wxPGProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxFlagsProperty)
public:

#ifndef SWIG
    wxFlagsProperty( const wxString& label,
                     const wxString& name,
                     const wxChar* const* labels,
                     const long* values = NULL,
                     long value = 0 );
    wxFlagsProperty( const wxString& label,
                     const wxString& name,
                     wxPGChoices& choices,
                     long value = 0 );
#endif
    wxFlagsProperty( const wxString& label = wxPG_LABEL,
                     const wxString& name = wxPG_LABEL,
                     const wxArrayString& labels = wxArrayString(),
                     const wxArrayInt& values = wxArrayInt(),
                     int value = 0 );
    virtual ~wxFlagsProperty ();

    virtual void OnSetValue() wxOVERRIDE;
    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int flags ) const wxOVERRIDE;
    virtual wxVariant ChildChanged( wxVariant& thisValue,
                                    int childIndex,
                                    wxVariant& childValue ) const wxOVERRIDE;
    virtual void RefreshChildren() wxOVERRIDE;
    virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE;

    // GetChoiceSelection needs to overridden since m_choices is
    // used and value is integer, but it is not index.
    virtual int GetChoiceSelection() const wxOVERRIDE { return wxNOT_FOUND; }

    // helpers
    size_t GetItemCount() const { return m_choices.GetCount(); }
    const wxString& GetLabel( size_t ind ) const
        { return m_choices.GetLabel(static_cast<unsigned int>(ind)); }

protected:
    // Used to detect if choices have been changed
    wxPGChoicesData*        m_oldChoicesData;

    // Needed to properly mark changed sub-properties
    long                    m_oldValue;

    // Converts string id to a relevant bit.
    long IdToBit( const wxString& id ) const;

    // Creates children and sets value.
    void Init();
};

// -----------------------------------------------------------------------

/** @class wxPGFileDialogAdapter
    @ingroup classes
*/
class WXDLLIMPEXP_PROPGRID
    wxPGFileDialogAdapter : public wxPGEditorDialogAdapter
{
public:
    virtual bool DoShowDialog( wxPropertyGrid* propGrid,
                               wxPGProperty* property ) wxOVERRIDE;
};

// -----------------------------------------------------------------------

// Indicates first bit useable by derived properties.
#define wxPG_PROP_SHOW_FULL_FILENAME  wxPG_PROP_CLASS_SPECIFIC_1

/** @class wxFileProperty
    @ingroup classes
    Like wxLongStringProperty, but the button triggers file selector instead.

    Supported special attributes:
    - "Wildcard": Sets wildcard (see wxFileDialog for format details), "All
    files..." is default.
    - "ShowFullPath": Default 1. When 0, only the file name is shown (i.e. drive
      and directory are hidden).
    - "ShowRelativePath": If set, then the filename is shown relative to the
    given path string.
    - "InitialPath": Sets the initial path of where to look for files.
    - "DialogTitle": Sets a specific title for the dir dialog.
*/
class WXDLLIMPEXP_PROPGRID wxFileProperty : public wxPGProperty
{
    friend class wxPGFileDialogAdapter;
    WX_PG_DECLARE_PROPERTY_CLASS(wxFileProperty)
public:

    wxFileProperty( const wxString& label = wxPG_LABEL,
                    const wxString& name = wxPG_LABEL,
                    const wxString& value = wxEmptyString );
    virtual ~wxFileProperty ();

    virtual void OnSetValue() wxOVERRIDE;
    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0 ) const wxOVERRIDE;
    virtual wxPGEditorDialogAdapter* GetEditorDialog() const wxOVERRIDE;
    virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE;

    static wxValidator* GetClassValidator();
    virtual wxValidator* DoGetValidator() const wxOVERRIDE;

    /**
        Returns filename to file represented by current value.
    */
    wxFileName GetFileName() const;

protected:
    wxString    m_wildcard;
    wxString    m_basePath; // If set, then show path relative to it
    wxString    m_initialPath; // If set, start the file dialog here
    wxString    m_dlgTitle; // If set, used as title for file dialog
    int         m_indFilter; // index to the selected filter
};

// -----------------------------------------------------------------------

#define wxPG_PROP_NO_ESCAPE     wxPG_PROP_CLASS_SPECIFIC_1
// Flag used in wxLongStringProperty to mark that edit button
// should be enabled even in the read-only mode.
#define wxPG_PROP_ACTIVE_BTN    wxPG_PROP_CLASS_SPECIFIC_3

/** @class wxPGLongStringDialogAdapter
    @ingroup classes
*/
class WXDLLIMPEXP_PROPGRID
    wxPGLongStringDialogAdapter : public wxPGEditorDialogAdapter
{
public:
    virtual bool DoShowDialog( wxPropertyGrid* propGrid,
                               wxPGProperty* property ) wxOVERRIDE;
};

/** @class wxLongStringProperty
    @ingroup classes
    Like wxStringProperty, but has a button that triggers a small text
    editor dialog.
*/
class WXDLLIMPEXP_PROPGRID wxLongStringProperty : public wxPGProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxLongStringProperty)
public:

    wxLongStringProperty( const wxString& label = wxPG_LABEL,
                          const wxString& name = wxPG_LABEL,
                          const wxString& value = wxEmptyString );
    virtual ~wxLongStringProperty();

    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0 ) const wxOVERRIDE;
    virtual bool OnEvent( wxPropertyGrid* propgrid,
                          wxWindow* primary, wxEvent& event ) wxOVERRIDE;

    // Shows string editor dialog. Value to be edited should be read from
    // value, and if dialog is not cancelled, it should be stored back and true
    // should be returned if that was the case.
    virtual bool OnButtonClick( wxPropertyGrid* propgrid, wxString& value );

    static bool DisplayEditorDialog( wxPGProperty* prop,
                                     wxPropertyGrid* propGrid,
                                     wxString& value );

protected:
};

// -----------------------------------------------------------------------

/** @class wxDirProperty
    @ingroup classes
    Like wxLongStringProperty, but the button triggers dir selector instead.

    Supported special attributes:
    - "DialogMessage": Sets specific message in the dir selector.
*/
class WXDLLIMPEXP_PROPGRID wxDirProperty : public wxLongStringProperty
{
    wxDECLARE_DYNAMIC_CLASS(wxDirProperty);
public:
    wxDirProperty( const wxString& name = wxPG_LABEL,
                   const wxString& label = wxPG_LABEL,
                   const wxString& value = wxEmptyString );
    virtual ~wxDirProperty();

    virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE;
    virtual wxValidator* DoGetValidator() const wxOVERRIDE;

    virtual bool OnButtonClick ( wxPropertyGrid* propGrid, wxString& value ) wxOVERRIDE;

protected:
    wxString    m_dlgMessage;
};

// -----------------------------------------------------------------------

// wxBoolProperty specific flags
#define wxPG_PROP_USE_CHECKBOX      wxPG_PROP_CLASS_SPECIFIC_1
// DCC = Double Click Cycles
#define wxPG_PROP_USE_DCC           wxPG_PROP_CLASS_SPECIFIC_2

// -----------------------------------------------------------------------

/** @class wxArrayStringProperty
    @ingroup classes
    Property that manages a list of strings.
*/
class WXDLLIMPEXP_PROPGRID wxArrayStringProperty : public wxPGProperty
{
    WX_PG_DECLARE_PROPERTY_CLASS(wxArrayStringProperty)
public:
    wxArrayStringProperty( const wxString& label = wxPG_LABEL,
                           const wxString& name = wxPG_LABEL,
                           const wxArrayString& value = wxArrayString() );
    virtual ~wxArrayStringProperty();

    virtual void OnSetValue() wxOVERRIDE;
    virtual wxString ValueToString( wxVariant& value, int argFlags = 0 ) const wxOVERRIDE;
    virtual bool StringToValue( wxVariant& variant,
                                const wxString& text,
                                int argFlags = 0 ) const wxOVERRIDE;
    virtual bool OnEvent( wxPropertyGrid* propgrid,
                          wxWindow* primary, wxEvent& event ) wxOVERRIDE;
    virtual bool DoSetAttribute( const wxString& name, wxVariant& value ) wxOVERRIDE;

    // Implement in derived class for custom array-to-string conversion.
    virtual void ConvertArrayToString(const wxArrayString& arr,
                                      wxString* pString,
                                      const wxUniChar& delimiter) const;

    // Shows string editor dialog. Value to be edited should be read from
    // value, and if dialog is not cancelled, it should be stored back and true
    // should be returned if that was the case.
    virtual bool OnCustomStringEdit( wxWindow* parent, wxString& value );

    // Helper.
    virtual bool OnButtonClick( wxPropertyGrid* propgrid,
                                wxWindow* primary,
                                const wxChar* cbt );

    // Creates wxPGArrayEditorDialog for string editing. Called in OnButtonClick.
    virtual wxPGArrayEditorDialog* CreateEditorDialog();

    enum ConversionFlags
    {
        Escape          = 0x01,
        QuoteStrings    = 0x02
    };

    /**
        Generates contents for string dst based on the contents of
        wxArrayString src.
    */
    static void ArrayStringToString( wxString& dst, const wxArrayString& src,
                                     wxUniChar delimiter, int flags );

protected:
    // Previously this was to be implemented in derived class for array-to-
    // string conversion. Now you should implement ConvertValueToString()
    // instead.
    virtual void GenerateValueAsString();

    wxString        m_display; // Cache for displayed text.
    wxUniChar       m_delimiter;
};

// -----------------------------------------------------------------------

#define WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR_WITH_DECL(PROPNAME, \
                                                                    DECL) \
DECL PROPNAME : public wxArrayStringProperty \
{ \
    WX_PG_DECLARE_PROPERTY_CLASS(PROPNAME) \
public: \
    PROPNAME( const wxString& label = wxPG_LABEL, \
              const wxString& name = wxPG_LABEL, \
              const wxArrayString& value = wxArrayString() ); \
    ~PROPNAME(); \
    virtual bool OnEvent( wxPropertyGrid* propgrid, \
                          wxWindow* primary, wxEvent& event ); \
    virtual bool OnCustomStringEdit( wxWindow* parent, wxString& value ); \
    virtual wxValidator* DoGetValidator() const; \
};

#define WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAM) \
WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAM, class)

#define WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAME, \
                                                            DELIMCHAR, \
                                                            CUSTBUTTXT) \
wxPG_IMPLEMENT_PROPERTY_CLASS(PROPNAME, wxArrayStringProperty, \
                               TextCtrlAndButton) \
PROPNAME::PROPNAME( const wxString& label, \
                    const wxString& name, \
                    const wxArrayString& value ) \
    : wxArrayStringProperty(label,name,value) \
{ \
    PROPNAME::GenerateValueAsString(); \
    m_delimiter = DELIMCHAR; \
} \
PROPNAME::~PROPNAME() { } \
bool PROPNAME::OnEvent( wxPropertyGrid* propgrid, \
                        wxWindow* primary, wxEvent& event ) \
{ \
    if ( event.GetEventType() == wxEVT_BUTTON ) \
        return OnButtonClick(propgrid,primary,(const wxChar*) CUSTBUTTXT); \
    return false; \
}

#define WX_PG_DECLARE_ARRAYSTRING_PROPERTY(PROPNAME) \
WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAME)

#define WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_DECL(PROPNAME, DECL) \
WX_PG_DECLARE_ARRAYSTRING_PROPERTY_WITH_VALIDATOR_WITH_DECL(PROPNAME, DECL)

#define WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY(PROPNAME,DELIMCHAR,CUSTBUTTXT) \
WX_PG_IMPLEMENT_ARRAYSTRING_PROPERTY_WITH_VALIDATOR(PROPNAME, \
                                                    DELIMCHAR, \
                                                    CUSTBUTTXT) \
wxValidator* PROPNAME::DoGetValidator () const \
{ return NULL; }

// -----------------------------------------------------------------------
// wxPGArrayEditorDialog
// -----------------------------------------------------------------------

#if wxUSE_EDITABLELISTBOX

class WXDLLIMPEXP_FWD_ADV wxEditableListBox;
class WXDLLIMPEXP_FWD_CORE wxListEvent;

#define wxAEDIALOG_STYLE \
    (wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxOK | wxCANCEL | wxCENTRE)

class WXDLLIMPEXP_PROPGRID wxPGArrayEditorDialog : public wxDialog
{
public:
    wxPGArrayEditorDialog();
    virtual ~wxPGArrayEditorDialog() { }

    void Init();

    wxPGArrayEditorDialog( wxWindow *parent,
                         const wxString& message,
                         const wxString& caption,
                         long style = wxAEDIALOG_STYLE,
                         const wxPoint& pos = wxDefaultPosition,
                         const wxSize& sz = wxDefaultSize );

    bool Create( wxWindow *parent,
                 const wxString& message,
                 const wxString& caption,
                 long style = wxAEDIALOG_STYLE,
                 const wxPoint& pos = wxDefaultPosition,
                 const wxSize& sz = wxDefaultSize );

    void EnableCustomNewAction()
    {
        m_hasCustomNewAction = true;
    }

    /** Set value modified by dialog.
    */
    virtual void SetDialogValue( const wxVariant& WXUNUSED(value) )
    {
        wxFAIL_MSG(wxS("re-implement this member function in derived class"));
    }

    /** Return value modified by dialog.
    */
    virtual wxVariant GetDialogValue() const
    {
        wxFAIL_MSG(wxS("re-implement this member function in derived class"));
        return wxVariant();
    }

    /** Override to return wxValidator to be used with the wxTextCtrl
        in dialog. Note that the validator is used in the standard
        wx way, i.e. it immediately prevents user from entering invalid
        input.

        @remarks
        Dialog frees the validator.
    */
    virtual wxValidator* GetTextCtrlValidator() const
    {
        return NULL;
    }

    // Returns true if array was actually modified
    bool IsModified() const { return m_modified; }

    // wxEditableListBox utilities
    int GetSelection() const;

    // implementation from now on
    void OnAddClick(wxCommandEvent& event);
    void OnDeleteClick(wxCommandEvent& event);
    void OnUpClick(wxCommandEvent& event);
    void OnDownClick(wxCommandEvent& event);
    void OnEndLabelEdit(wxListEvent& event);
    void OnBeginLabelEdit(wxListEvent& evt);
    void OnIdle(wxIdleEvent& event);

protected:
    wxEditableListBox*  m_elb;

    // These are used for focus repair
    wxWindow*           m_elbSubPanel;
    wxWindow*           m_lastFocused;

    // A new item, edited by user, is pending at this index.
    // It will be committed once list ctrl item editing is done.
    int             m_itemPendingAtIndex;

    bool            m_modified;
    bool            m_hasCustomNewAction;

    // These must be overridden - must return true on success.
    virtual wxString ArrayGet( size_t index ) = 0;
    virtual size_t ArrayGetCount() = 0;
    virtual bool ArrayInsert( const wxString& str, int index ) = 0;
    virtual bool ArraySet( size_t index, const wxString& str ) = 0;
    virtual void ArrayRemoveAt( int index ) = 0;
    virtual void ArraySwap( size_t first, size_t second ) = 0;
    virtual bool OnCustomNewAction(wxString* WXUNUSED(resString))
    {
        return false;
    }

private:
    wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPGArrayEditorDialog);
    wxDECLARE_EVENT_TABLE();
};

#endif // wxUSE_EDITABLELISTBOX

// -----------------------------------------------------------------------
// wxPGArrayStringEditorDialog
// -----------------------------------------------------------------------

class WXDLLIMPEXP_PROPGRID
    wxPGArrayStringEditorDialog : public wxPGArrayEditorDialog
{
public:
    wxPGArrayStringEditorDialog();
    virtual ~wxPGArrayStringEditorDialog() { }

    void Init();

    virtual void SetDialogValue( const wxVariant& value ) wxOVERRIDE
    {
        m_array = value.GetArrayString();
    }

    virtual wxVariant GetDialogValue() const wxOVERRIDE
    {
        return m_array;
    }

    void SetCustomButton( const wxString& custBtText,
                          wxArrayStringProperty* pcc )
    {
        if ( !custBtText.empty() )
        {
            EnableCustomNewAction();
            m_pCallingClass = pcc;
        }
    }

    virtual bool OnCustomNewAction(wxString* resString) wxOVERRIDE;

protected:
    wxArrayString   m_array;

    wxArrayStringProperty*     m_pCallingClass;

    virtual wxString ArrayGet( size_t index ) wxOVERRIDE;
    virtual size_t ArrayGetCount() wxOVERRIDE;
    virtual bool ArrayInsert( const wxString& str, int index ) wxOVERRIDE;
    virtual bool ArraySet( size_t index, const wxString& str ) wxOVERRIDE;
    virtual void ArrayRemoveAt( int index ) wxOVERRIDE;
    virtual void ArraySwap( size_t first, size_t second ) wxOVERRIDE;

private:
    wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxPGArrayStringEditorDialog);
    wxDECLARE_EVENT_TABLE();
};

// -----------------------------------------------------------------------

#endif // wxUSE_PROPGRID

#endif // _WX_PROPGRID_PROPS_H_


text:
import React from 'react';
import { Bar } from 'react-chartjs';
import { getRandomInt } from './util';
import Modal from 'react-modal';
import AddWidgetDialog from '../AddWidgetDialog';

class BtnControlWidget extends React.Component {
    constructor() {
        super();
        this.state = {
            isModalAddOpen: false,
            isModalOpen: false
        }

        this.addWidgetOpenModal = this.addWidgetOpenModal.bind(this)
        this.addWidget = this.addWidget.bind(this)
        this.openModal = this.openModal.bind(this)
        this.closeModal = this.closeModal.bind(this)
    }

    moveDown = function(index) {
        let rows = this.props.layout.rows;
        let from = index;
        let to = index + 1;

        rows.splice(to, 0, rows.splice(from, 1)[0]);
        this.props.setLayout(this.props.layout);
    }

    moveUp = function(index) {
        let rows = this.props.layout.rows;
        let from = index;
        let to = index - 1;

        rows.splice(to, 0, rows.splice(from, 1)[0]);
        this.props.setLayout(this.props.layout);
    }

    removeCol = function () {
        let rows = this.props.layout.rows;
        rows.splice(this.props.index, 1);

        this.props.setLayout(this.props.layout);
    }

    openModal = function(e){
        e.stopPropagation();
        e.preventDefault();
        e.nativeEvent.stopImmediatePropagation();
        this.setState({
            isModalOpen: true
        })
    }

    closeModal = function (){
        this.setState({
            isModalOpen: false
        })
    }

    addWidgetOpenModal = function() {
        this.setState({
            isModalAddOpen: true
        });
    }

    addWidget = function(widgetName) {
        this.props.addWidget(widgetName, this.props.index);
        this.onRequestClose();
    }

    onRequestClose = () => {
        this.setState({
            isModalAddOpen: false,
        });
    }

    setCol = function (size, index, align) {

        let sizeClass = "col-xs-12";

        //set size class
        if (size == 1) {
            sizeClass = "col-lg-12 col-md-12 col-sm-12 col-xs-12";
        } else if (size == 2) {
            sizeClass = "col-lg-6 col-md-6 col-sm-6 col-xs-6";
        } else if (size == 3) {
            sizeClass = "col-lg-4 col-md-4 col-sm-4 col-xs-4";
        } else if (size == 4) {
            sizeClass = "col-lg-3 col-md-3 col-sm-3 col-xs-3";
        }

        //add or remove columns on row
        let max = size;
        if (max < this.props.layout.rows[index].columns.length) {
            max = this.props.layout.rows[index].columns.length;
        }

        let control = this.props.layout.rows[index].columns.pop();
        for(let i=0; i < max; i++) {

            //set column 30/70
            if (size == 2 && align == 1 && i == 0) {
                sizeClass = "col-lg-4 col-md-4 col-sm-4 col-xs-4";
            }
            if (size == 2 && align == 1 && i == 1) {
                sizeClass = "col-lg-8 col-md-8 col-sm-8 col-xs-8";
            }

            //set column 70/30
            if (size == 2 && align == 2 && i == 1) {
                sizeClass = "col-lg-4 col-md-4 col-sm-4 col-xs-4";
            }
            if (size == 2 && align == 2 && i == 0) {
                sizeClass = "col-lg-8 col-md-8 col-sm-8 col-xs-8";
            }

            if (i <= size) {
                //crea colonna
                if (!this.props.layout.rows[index].columns[i]) {
                    this.props.layout.rows[index].columns[i] = {
                        className: sizeClass,
                        widgets: []
                    }
                } else {
                //update size col
                    this.props.layout.rows[index].columns[i].className=sizeClass;
                }
            }

            //rimuovi colonna
            if (i >= size && this.props.layout.rows[index].columns[i]) {
                this.props.layout.rows[index].columns.splice(i);
            }
        }

        this.props.layout.rows[index].columns.push(control);

        this.props.setLayout(this.props.layout);
        this.closeModal();
    }

    render() {
        return (

                <button type="button" className="btn btn-sm btn-default" aria-label="Add Widget"
                    onClick={this.addWidgetOpenModal}>

                </button>

                { this.props.index != 0 &&
                    <button type="button" className="btn btn-sm btn-default" aria-label="Move Up"
                        onClick={() => this.moveUp(this.props.index)}>

                    </button>
                }
                { this.props.index != this.props.layout.rows.length - 1 &&
                    <button type="button" className="btn btn-sm btn-default" aria-label="Move Down"
                        onClick={() => this.moveDown(this.props.index)}>

                    </button>
                }
                <button type="button" className="btn btn-sm btn-default" aria-label="Remove"
                    onClick={() => this.removeCol()}>

                </button>

                <button type="button" className="btn btn-sm btn-default" aria-label="Change witdh"
                    onClick={this.openModal}>

                </button>

                <AddWidgetDialog
                    widgets={this.props.widgets}
                    isModalOpen={this.state.isModalAddOpen}
                    onWidgetSelect={this.addWidget}
                    onRequestClose={this.onRequestClose}
                    >
                </AddWidgetDialog>

                <Modal
                    contentLabel="Set width columns"
                    className="Modal__Bootstrap modal-dialog"
                    isOpen={this.state.isModalOpen}>

                            <button type="button" className="close" onClick={this.closeModal}>
                            ×
                            Close
                            </button>

Scegli il layout

 this.setCol(1, this.props.index)}>

                                            100%

 this.setCol(3, this.props.index)}>

                                            33%

                                            33%

                                            33%

 this.setCol(4, this.props.index)}>

                                            25%

                                            25%

                                            25%

                                            25%

 this.setCol(2, this.props.index, 1)}>

                                            30%

                                            70%

 this.setCol(2, this.props.index)}>

                                            50%

                                            50%

 this.setCol(2, this.props.index, 2)}>

                                            70%

                                            30%

                            <button onClick={this.closeModal} type="button" className="btn btn-default" >Chiudi</button>

                </Modal>

        );
  }
}

export default BtnControlWidget;


text:
#pragma once

#include <stdint.h>
#include "il2cpp-metadata.h"
#include "metadata/Il2CppTypeVector.h"

struct Il2CppGenericClass;
struct Il2CppGenericContext;
struct Il2CppGenericInst;
struct Il2CppGenericMethod;
union Il2CppRGCTXData;
struct Il2CppRGCTXDefinition;
struct Il2CppType;
struct MethodInfo;
struct ParameterInfo;
struct Il2CppClass;

namespace il2cpp
{
namespace metadata
{

class GenericMetadata
{
public:
	static ParameterInfo* InflateParameters (const ParameterInfo* parameters, uint8_t parameterCount, const Il2CppGenericContext* context, bool inflateMethodVars);
	static Il2CppGenericClass* GetGenericClass (Il2CppClass* elementClass, const Il2CppGenericInst* inst);
	static Il2CppGenericClass* GetGenericClass (TypeDefinitionIndex elementClassIndex, const Il2CppGenericInst* inst);

	static const MethodInfo* Inflate (const MethodInfo* methodDefinition, Il2CppClass* declaringClass, const Il2CppGenericContext* context);
	static const Il2CppGenericMethod* Inflate (const Il2CppGenericMethod* genericMethod, const Il2CppGenericContext* context);

	static Il2CppRGCTXData* InflateRGCTX (RGCTXIndex rgctxEntryIndex, int16_t rgctxEntryCount, const Il2CppGenericContext* context);

	// temporary while we generate generics
	static void RegisterGenericClass (Il2CppGenericClass *gclass);

	static const Il2CppType* InflateIfNeeded (const Il2CppType* type, const Il2CppGenericContext* context, bool inflateMethodVars);

	typedef void(*GenericClassWalkCallback)(Il2CppClass* type, void* context);
	static void WalkAllGenericClasses(GenericClassWalkCallback callback, void* context);
};

} /* namespace vm */
} /* namespace il2cpp */


text:
#pragma once

#include <libcellml>

class MathTreeImpl;

class MathTree
{
public:
    MathTree();
    ~MathTree();

    /**
     * @brief Add the math from the given component to this math tree.
     *
     * Parse the math from the given @c component and add it to this math tree.
     *
     * @param component The CellML component from whence to grab some math.
     *
     * @return @c true if math successfully added, @c false otherwise.
     */
    bool addComponentMathML(libcellml::ComponentPtr component);

private:
    MathTreeImpl* pImpl;
};


text:
using System;
using System.Collections.Concurrent;

namespace Deputy.Communication
{
    public class MailboxHost : IMailboxHost
    {
        private readonly ConcurrentDictionary<Type, IMailbox> _mailboxes = new ConcurrentDictionary<Type, IMailbox>();
        private readonly ConcurrentDictionary<string, ConcurrentDictionary<Type, IMailbox>> _namedMailboxes = new ConcurrentDictionary<string, ConcurrentDictionary<Type, IMailbox>>();
        private readonly IMailboxCreator _mailboxCreator;

        public MailboxHost(IMailboxCreator mailboxCreator)
        {
            if (mailboxCreator == null)
                throw new ArgumentNullException(nameof(mailboxCreator));

            _mailboxCreator = mailboxCreator;
        }

        public void Deliver<TMessage>(TMessage message)
        {
            if (message == null)
                throw new ArgumentNullException(nameof(message));

            FindMailbox<TMessage>().Deliver(message);
        }
        public void Deliver<TMessage>(TMessage message, string name)
        {
            if (message == null)
                throw new ArgumentNullException(nameof(message));

            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentNullException(nameof(name));

            FindMailbox<TMessage>(name).Deliver(message);
        }

        public IDisposable Subscribe<TMessage>(IObserver<TMessage> observer)
        {
            if (observer == null)
                throw new ArgumentNullException(nameof(observer));

            return FindMailbox<TMessage>().Subscribe(observer);
        }
        public IDisposable Subscribe<TMessage>(IObserver<TMessage> observer, string name)
        {
            if (observer == null)
                throw new ArgumentNullException(nameof(observer));

            if (string.IsNullOrWhiteSpace(name))
                throw new ArgumentNullException(nameof(name));

            return FindMailbox<TMessage>(name).Subscribe(observer);
        }

        private IMailbox<TMessage> FindMailbox<TMessage>() => (IMailbox<TMessage>)_mailboxes.GetOrAdd(typeof(TMessage), messageType => _mailboxCreator.Create<TMessage>());
        private IMailbox<TMessage> FindMailbox<TMessage>(string name)
        {
            var namedMailbox = _namedMailboxes.GetOrAdd(name, key => new ConcurrentDictionary<Type, IMailbox>());

            return (IMailbox<TMessage>)_mailboxes.GetOrAdd(typeof(TMessage), messageType => _mailboxCreator.Create<TMessage>());
        }
    }
}


text:
using System.Collections.Generic;
using DbLocalizationProvider.Abstractions;
using DbLocalizationProvider.Queries;
using DbLocalizationProvider.Refactoring;
using DbLocalizationProvider.Sync;
using Xunit;

namespace DbLocalizationProvider.Tests.RecursiveModelsTests
{
    public class Tests
    {
        private readonly TypeDiscoveryHelper _sut;

        public Tests()
        {
            var state = new ScanState();
            var keyBuilder = new ResourceKeyBuilder(state);
            var oldKeyBuilder = new OldResourceKeyBuilder(keyBuilder);
            var ctx = new ConfigurationContext();
            ctx.TypeFactory.ForQuery<DetermineDefaultCulture.Query>().SetHandler<DetermineDefaultCulture.Handler>();

            var queryExecutor = new QueryExecutor(ctx.TypeFactory);
            var translationBuilder = new DiscoveredTranslationBuilder(queryExecutor);

            _sut = new TypeDiscoveryHelper(new List<IResourceTypeScanner>
            {
                new LocalizedModelTypeScanner(keyBuilder, oldKeyBuilder, state, ctx, translationBuilder),
                new LocalizedResourceTypeScanner(keyBuilder, oldKeyBuilder, state, ctx, translationBuilder),
                new LocalizedEnumTypeScanner(keyBuilder, translationBuilder),
                new LocalizedForeignResourceTypeScanner(keyBuilder, oldKeyBuilder, state, ctx, translationBuilder)
            }, ctx);
        }

        [Fact]
        public void Test1()
        {
            _sut.ScanResources(typeof(ResourceClassWithRecursiveProperty));

            Assert.True(TypeDiscoveryHelper.DiscoveredResourceCache.ContainsKey("DbLocalizationProvider.Tests.RecursiveModelsTests.ResourceClassWithRecursiveProperty"));
        }
    }

    [LocalizedResource]
    public class ResourceClassWithRecursiveProperty
    {
        public ResourceClassWithRecursiveProperty NestedClass { get; set; }
    }

}


text:
package com.canoo.platform.client.security;

import com.canoo.platform.core.PlatformConfiguration;
import org.apiguardian.api.API;

import java.util.concurrent.Future;

@API(since = "0.19.0", status = API.Status.EXPERIMENTAL)
public interface Security {

    Future<Void> login(String user, String password);

    Future<Void> login(String user, String password, final PlatformConfiguration securityConfig);

    Future<Void> logout();

    boolean isAuthorized();
}


text:
<?php

namespace Kraken\Network\Http\Component\Router;

use Kraken\Network\NetworkComponentInterface;

interface HttpRouterInterface extends NetworkComponentInterface
{
    /**
     * Add an origin to the whitelist that will be allowed to connect to your application.
     *
     * @param string $address
     * @return HttpRouterInterface
     */
    public function allowOrigin($address);

    /**
     * Remove an origin so it will not be able access your routes.
     *
     * @param string $address
     * @return HttpRouterInterface
     */
    public function disallowOrigin($address);

    /**
     * Check if given $address is allowed or not.
     *
     * @param string $address
     * @return bool
     */
    public function isOriginAllowed($address);

    /**
     * Get an array of all the addresses allowed.
     *
     * @return string[]
     */
    public function getAllowedOrigins();

    /**
     * Check if there exists any endpoint/application to the server on given route.
     *
     * @param string $path
     * @return bool
     */
    public function existsRoute($path);

    /**
     * Add an endpoint/application to the server.
     *
     * @param string $path
     * @param NetworkComponentInterface $component
     * @return HttpRouterInterface
     */
    public function addRoute($path, NetworkComponentInterface $component);

    /**
     * Remote endpoint/application from the server.
     *
     * @param string $path
     * @return HttpRouterInterface
     */
    public function removeRoute($path);
}