text:
import {Injectable} from "@angular/core";
import {Stage} from "../data/Model";
import {GMATPractice} from "../../models/gmat-practice";
import {Http} from "@angular/http";
import {PracticeData} from "../data/practice-sets";
import {PracticeMode} from "../../models/constants.enum";
import {Subscription} from "rxjs/Subscription";
import {Question} from "../../models/question";
import {Observable} from "rxjs/Observable";
import {PracticeResult} from "../../models/test-result";
import {WebService} from "../../services/web-service";
import {UserQuestionReport} from "../../models/firebase.model";
import {ActivatedRoute, Router} from "@angular/router";
import {Location} from "@angular/common";

@Injectable()
export class PracticeService{
  currentPractice: GMATPractice;

  constructor(private location: Location, private router: Router, private route:ActivatedRoute, private http:Http, private webService: WebService){}

  //========================================Render Control ===================================================
  stage: Stage = Stage.SELECT;
  cache : boolean = true;
  isLoading: boolean = false;

  public selectPracticeSet(practiceSet: GMATPractice){
    const url = this.router.url.split('?')[0];
    if(url.indexOf(practiceSet.practiceName) < 0) {
      const newUrl = url + '/' + practiceSet.practiceName;
      console.log(newUrl);
      this.location.go(newUrl);
    }

    this.currentPractice = practiceSet;

    // Try to load from Session Storage
    if(sessionStorage.getItem(this.currentPractice.practiceName) && this.cache){
      PracticeData.processQuestionFile(this.currentPractice, sessionStorage.getItem(this.currentPractice.practiceName));
      this.loadSavedData();
    }
    else {
      this.isLoading = true;
      // Load Questions from Server
      this.http.get(this.currentPractice.fileLocation).subscribe(response => {
        if (response.ok) {
          PracticeData.processQuestionFile(this.currentPractice, response.text());
          this.loadSavedData();
          // Save to Session Storage for next time use
          sessionStorage.setItem(this.currentPractice.practiceName, response.text());
          this.isLoading = false;
        }
      });
    }
    //===========================
    this.stage = Stage.SUMMARY;
  }

  public backToSummary(){
    this.stage = Stage.SUMMARY;
  }

  public startPractice(){
    this.stage = Stage.PRACTICE;
  }

  public backToSelection(){
    this.stage = Stage.SELECT;

    const url = this.router.url.split('?')[0];
    this.location.go(url);
  }

  //========================================End Render Control ===============================================

  //===================================== Practice Control ===================================================
  // -------------Control variables----------------
  practiceMode: PracticeMode = PracticeMode.PRACTICE;
  questions: Question[];

  isStarted : boolean;
  isPaused : boolean;
  elapsedTime: number;

  currentQuestionIndex : number;
  currentQuestionTime : number = 0;

  subscription : Subscription;
  // -------------End Control variables------------

  // -------------Control Functions----------------
  start(){
    this.startAt(0);
    this.practiceMode = PracticeMode.TEST;
  }

  startAt(index: number){

    if(this.isLoading) {
      let self = this;
      setTimeout(function () {
        self.startAt(index);
      }, 200);
      return;
    }

    this.startPractice();

    this.isStarted = true;
    this.isPaused = false;
    this.currentQuestionTime = 0;
    this.currentQuestionIndex = index;
    this.elapsedTime = 0;
    this.practiceMode = this.currentPractice.isTest() ? PracticeMode.TEST : PracticeMode.PRACTICE;
    this.questions = this.currentPractice.questions;
    this.clearSelectedAnswer();
    this.subscribe();
  }

  resume(index: number){
    if(this.practiceMode == PracticeMode.TEST){
      let totalTimeOfPreviousQuestions = this.sumTotalTimeOfPreviousQuestions(index);
      this.startAt(index);
      this.elapsedTime = totalTimeOfPreviousQuestions;
    }else{
      this.startAt(index);
    }
  }

  sumTotalTimeOfPreviousQuestions(index: number) : number{
    let count = 0;
    let sum = 0;
    for(let question of this.currentPractice.questions){
      if(count++ < index){
        sum += question.question_time;
      }else{
        break;
      }
    }
    return sum;
  }

  pauseOrResume(){
    this.isPaused = !this.isPaused;
    if(this.isPaused){
      this.unSubscribe();
    }else{
      this.subscribe();
    }
  }

  end(){
    if(this.practiceMode == PracticeMode.PRACTICE || this.practiceMode == PracticeMode.TEST){
      this.endPractice();
    }else{
      this.endReview();
    }
  }

  endPractice(){
    // Save Question Time
    if(this.getCurrentQuestion().selected_answer) {
      this.getCurrentQuestion().question_time = this.currentQuestionTime;
    }
    // UnSubscribe
    this.unSubscribe();
    // Save practice
    this.savePracticeData();
    // Back to summary
    this.backToSummary();
  }

  review(){
    this.reviewAt(0);
  }

  reviewAt(index: number){

    if(this.isLoading) {
      let self = this;
      setTimeout(function () {
        self.reviewAt(index);
      }, 200);
      return;
    }

    this.practiceMode = PracticeMode.REVIEW;
    this.currentQuestionIndex = index;
    this.questions = this.currentPractice.questions;
    this.currentQuestionTime = this.getCurrentQuestion().question_time;

    if(this.currentPractice.hasExplanation){
      if(sessionStorage.getItem(this.currentPractice.getExplanationName()) && this.cache){
        PracticeData.processExplanationFile(this.currentPractice, sessionStorage.getItem(this.currentPractice.getExplanationName()));
        PracticeData.safeGuardExplanationForPremiumUser(this.currentPractice, this.webService);
        console.log('Cache');
        this.startPractice();
      }
      else {
        // Load Questions from Server
        this.http.get(this.currentPractice.getExplanationLocation()).subscribe(response => {
          if (response.ok) {
            PracticeData.processExplanationFile(this.currentPractice, response.text());
            PracticeData.safeGuardExplanationForPremiumUser(this.currentPractice, this.webService);
            sessionStorage.setItem(this.currentPractice.getExplanationName(), response.text());
          }
          this.startPractice();
        });
      }
    }
    else{
      this.startPractice();
    }
  }

  endReview(){
    this.savePracticeData();
    this.backToSummary();
  }

  updateEachSecond(){
    if(this.practiceMode != PracticeMode.REVIEW) {
      this.currentQuestionTime++;
      this.elapsedTime++;
    }
  }

  // ------------- Navigation -------------------------
  next(){
    if(!this.isLastQuestion()){
      // Save Question Time
      this.getCurrentQuestion().question_time = this.currentQuestionTime;
      // Move to the next question
      this.currentQuestionIndex++;
      this.currentQuestionTime = this.getCurrentQuestion().question_time;
    }
  }

  prev(){
    if(!this.isFirstQuestion()){
      // Save Question Time
      this.getCurrentQuestion().question_time = this.currentQuestionTime;
      // Move back to previous question
      this.currentQuestionIndex--;
      this.currentQuestionTime = this.getCurrentQuestion().question_time;
    }
  }

  getCurrentQuestion():Question{
    return this.questions[this.currentQuestionIndex];
  }

  // ------------- Subscription -----------------------
  subscribe(){
    this.subscription = Observable.interval(1000).subscribe(res => {
      this.updateEachSecond();
    });
  }

  unSubscribe(){
    if(this.subscription){
      this.subscription.unsubscribe();
      this.subscription = null;
    }
  }

  // -------------End Control Functions------------

  // ------------- Report ----------------

  public reportQuestion(report: UserQuestionReport){
    this.webService.reportQuestion(report);
  }

  // ==================================== End Practice Control ===============================================

  // =============================Save data to Local Storage & Server==========================
  savePracticeData(){
    let practiceResult;

    if(localStorage.getItem(this.currentPractice.practiceName)){
      let savedResult = JSON.parse(localStorage.getItem(this.currentPractice.practiceName)) as PracticeResult;
      PracticeResult.mergeResult(savedResult, this.currentPractice);
      PracticeResult.mergeResultToPractice(this.currentPractice, savedResult);
      localStorage.setItem(this.currentPractice.practiceName, JSON.stringify(savedResult));
      practiceResult = savedResult;
    }else{
      practiceResult = new PracticeResult(this.currentPractice);
      localStorage.setItem(this.currentPractice.practiceName, JSON.stringify(practiceResult));
    }

    this.webService.processSavePerformanceToServer(this.currentPractice.practiceName, practiceResult.lastSavedTime, practiceResult.questions);
  }

  loadSavedData(){
    let savedResult: PracticeResult;
    if(localStorage.getItem(this.currentPractice.practiceName)){
      console.log("Load Saved Data");
      savedResult = JSON.parse(localStorage.getItem(this.currentPractice.practiceName)) as PracticeResult;

      if(savedResult.numberOfQuestions <= this.currentPractice.numberOfQuestions){
        PracticeResult.mergeArrayResultToPractice(this.currentPractice, savedResult.questions);
      }
    }

    // Will override local result if the server version is newer
    this.webService.processRetrievePerformanceFromServer(this.currentPractice.practiceName, savedResult ? savedResult.lastSavedTime : 0, (questionResults) => {
      console.log("Newer version from Server detected. Getting data from server and saving to local");
      PracticeResult.mergeArrayResultToPractice(this.currentPractice, questionResults);
      localStorage.setItem(this.currentPractice.practiceName, JSON.stringify(new PracticeResult(this.currentPractice)));
    });
  }

  // ============================End Save Data =========================================

  // ==================================== Util Functions =====================================================
  clearSelectedAnswer(){
    this.questions.forEach(e => {
      e.selected_answer = null;
      e.question_time = 0;
    });
  }

  isFirstQuestion():boolean{
    return this.currentQuestionIndex == 0;
  }

  isLastQuestion():boolean{
    return this.currentQuestionIndex == this.questions.length - 1;
  }
}


text:
<?php
$lang['create_menu_title_key_label'] = 'Tiêu đề';
$lang['create_menu_action_router_label'] = 'Đường dẫn';
$lang['create_menu_icon_label'] = 'Chọn tập tin icon';
$lang['create_menu_description_label'] = 'Mô tả';
$lang['create_menu_submit_btn'] = 'Tạo menu';
$lang['create_menu_controller_list'] = 'Chọn controller';
$lang['Choose_language_title'] = 'Chọn tiêu đề';

redpajama_set_name: RedPajamaGithub


text:
package alluxio.table.common.udb;

import alluxio.conf.ServerConfiguration;
import alluxio.util.ConfigurationUtils;

import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;

/**
 * Utilities to convert to and from ufs paths and alluxio paths.
 */
public class PathTranslator {
  private static final Logger LOG = LoggerFactory.getLogger(PathTranslator.class);

  private BiMap<String, String> mPathMap;

  /**
   * Construct a path translator.
   */
  public PathTranslator() {
    mPathMap = HashBiMap.create();
  }

  /**
   * Add a mapping to the path translator.
   *
   * @param alluxioPath the alluxio path
   * @param ufsPath the corresponding ufs path
   *
   * @return PathTranslator object
   */
  public PathTranslator addMapping(String alluxioPath, String ufsPath) {
    while (alluxioPath.endsWith("/")) {
      // strip trailing slashes
      alluxioPath = alluxioPath.substring(0, alluxioPath.length() - 1);
    }

    while (ufsPath.endsWith("/")) {
      // strip trailing slashes
      ufsPath = ufsPath.substring(0, ufsPath.length() - 1);
    }
    mPathMap.put(alluxioPath, ufsPath);
    return this;
  }

  /**
   * Returns the corresponding alluxio path, for the specified ufs path.
   *
   * @param ufsPath the ufs path to translate
   * @return the corresponding alluxio path
   * @throws IOException if the ufs path is not mounted
   */
  public String toAlluxioPath(String ufsPath) throws IOException {
    for (BiMap.Entry<String, String> entry : mPathMap.entrySet()) {
      if (ufsPath.startsWith(entry.getValue())) {
        String alluxioPath = entry.getKey() + ufsPath.substring(entry.getValue().length());
        if (alluxioPath.startsWith("/")) {
          // scheme/authority are missing, so prefix with the scheme and authority
          alluxioPath =
              ConfigurationUtils.getSchemeAuthority(ServerConfiguration.global()) + alluxioPath;
        }
        return alluxioPath;
      }
    }
    // TODO(yuzhu): instead of throwing an exception, mount the path?
    throw new IOException(String
        .format("Failed to translate ufs path (%s). Mapping missing from translator", ufsPath));
  }
}


text:
Please check the release notes at [GitHub](https://github.com/oroinc/platform-application/releases) for the list of new features and changes to the existing features of OroPlatform application.

The CHANGELOG.md files of the individual packages comprising this application describe significant changes in the code that may affect the upgrade of your customizations.

You can use the following command to find all CHANGELOG.md files in Oro packages:
```bash
find -L vendor/oro -maxdepth 2 -type f -name CHANGELOG.md
```


text:
.. include:: references.txt

.. _util:

*****************************
Misc. Utilities (`gala.util`)
*****************************

Introduction
============

This subpackage contains miscellaneous utilities.

.. _util-api:

API
===

.. automodapi:: gala.util
    :no-inheritance-diagram:


text:
web-tools
====================

A set of tools for web devs.


text:
import assert = require("assert");
import http = require("http");
import should = require("should");
import async = require("async");

import testApi = require("../test_api");

var vows = require('vows');

vows.describe("UserController").addBatch({
	"Server": {
		topic: testApi.startServerTopic(),
		"User get data": {
			topic: testApi.httpGetTopic("/user"),

			"is returned correctly": function (err: any, response: http.ClientResponse, textBody: string) {
				var result = testApi.verifyJsonResponse(err, response, textBody);

				result.name.should.be.exactly("Tester Unit");
				result.login.should.be.exactly("utester");
				result.avatar_url.should.be.exactly("http://void.com/image.gif");
			}

		}
	}
}).export(module);


text:
#ifndef MITKCONNECTOMICSHISTOGRAMCACHE_H
#define MITKCONNECTOMICSHISTOGRAMCACHE_H

#include "mitkSimpleHistogram.h"
#include "mitkConnectomicsNetwork.h"

#include <mitkConnectomicsDegreeHistogram.h>
#include <mitkConnectomicsBetweennessHistogram.h>
#include <mitkConnectomicsShortestPathHistogram.h>

#include "ConnectomicsExports.h"

namespace mitk {

  /**
    * @brief Provides a method to cache network histograms
    */

  class ConnectomicsHistogramsContainer
  {
  public:

    void ComputeFromBaseData(BaseData* baseData)
    {
      m_BetweennessHistogram.ComputeFromBaseData(baseData);
      m_DegreeHistogram.ComputeFromBaseData(baseData);
      m_ShortestPathHistogram.ComputeFromBaseData(baseData);
    }

    ConnectomicsBetweennessHistogram* GetBetweennessHistogram( )
    {
      return &m_BetweennessHistogram;
    }

    ConnectomicsDegreeHistogram* GetDegreeHistogram( )
    {
      return &m_DegreeHistogram;
    }

    ConnectomicsShortestPathHistogram* GetShortestPathHistogram( )
    {
      return &m_ShortestPathHistogram;
    }

    ConnectomicsBetweennessHistogram  m_BetweennessHistogram;
    ConnectomicsDegreeHistogram       m_DegreeHistogram;
    ConnectomicsShortestPathHistogram m_ShortestPathHistogram;
  };

  class Connectomics_EXPORT ConnectomicsHistogramCache : public SimpleHistogramCache
  {
  public:

    ConnectomicsHistogramCache();
    ~ConnectomicsHistogramCache();

    ConnectomicsHistogramsContainer *operator[]( ConnectomicsNetwork::Pointer sp_NetworkData);

  protected:

    // purposely not implemented
    SimpleHistogram *operator[](BaseData::Pointer sp_BaseData);

  };

  class ConnectomicsHistogramsCacheElement : public ConnectomicsHistogramCache::Element
  {
  public:

    void ComputeFromBaseData(BaseData* baseData)
    {
      m_Container.ComputeFromBaseData(baseData);
    }

    ConnectomicsHistogramsContainer* GetHistograms()
    {
      return &m_Container;
    }

    ConnectomicsHistogramsContainer m_Container;

  private:
    ConnectomicsHistogramBase* GetHistogram()
    {
      return NULL;
    }
  };

}

#endif // MITKCONNECTOMICSHISTOGRAMCACHE_H


text:
// Copyright 2020 Sound Metrics Corp. All Rights Reserved.

namespace SoundMetrics.Data.Filters
{
    public interface IBufferedFilter<T>
    {
        bool AddValue(T value, out T filteredValue);
    }
}


text:
<!DOCTYPE html>

    <link href="css/style.css" rel="stylesheet">
    <link rel="shortcut icon" href="img/favicon.ico" type="image/x-icon">
    <link rel="icon" href="img/favicon.ico" type="image/x-icon">
    <title>IOTA Paper Wallet</title>

            <canvas width="1600px" height="540px" id="imageCanvas"></canvas>
            <canvas hidden id="seedCanvas"></canvas>
            <canvas hidden id="addressCanvas"></canvas>

        _

            <input id="seed" type="text" placeholder="ENTER SEED" maxlength="81">

                <input id="generate" class="button" type="button" value="CREATE">
                <input id="print" class="button" type="button" value="PRINT">

This website generates a paper wallet, ready for printing and storage.

Use the option buttons on the top left to control the output of the paper wallet generator

Only use the advanced options if you are an advanced user!

All content on this site is locally hosted, and relies on only two dependencies

Qrious for QR code generation

iota js lib

This website can (and preferably should be) run offline from the internet.

Whilst every effort has been made for the accuracy of this tool, I am in no way responsible for any damages or loss of funds should any errors exist.

                Buy me a beer! OLADVFKDCTEEPBBXYBXYICNJEHWGOXDXXKINNUWPQUGNWZNXFACNRBSZRDDZWZPTANFAYITUJEAJFKS9WDCYCBI9VW

Options

            Styles

            <input id="default" class="button sml button-active" type="button" onclick="setMode('default')" value="Default">

            <input id="address" class="button sml" type="button" onclick="setMode('address')" value="Address Only">

            <input id="noQR" class="button sml" type="button" onclick="setMode('noQR')" value="No QR codes">

            <input id="discreet" class="button sml" type="button" onclick="setMode('discreet')" value="Discreet">

Advanced!

                Enter Index

                <input id="index-num" type="text" value="0" onkeyup="this.value=this.value.replace(/[^\d]/,'')">

                Enter Security

                <input id="security-level" type="text" value="2" onkeyup="this.value=this.value.replace(/[^\d]/,'')">

    How to generate a secure seed
    Download an offline version of this tool
    This tool is covered under an MIT license
    v1.5.1


text:
module.exports = {
    logLevel: function (success, fail, args) {
        console.log(args.join(":"));
        return true;
    }
};


text:
#ifndef FIRMWARE_BLE_H
#define FIRMWARE_BLE_H

#include "cube_hal.h"
#include "hal_types.h"
#include "bluenrg_gatt_server.h"
#include "bluenrg_gap.h"
#include "string.h"
#include "bluenrg_gap_aci.h"
#include "bluenrg_gatt_aci.h"
#include "hci_const.h"
#include "gp_timer.h"
#include "bluenrg_hal_aci.h"
#include "bluenrg_aci_const.h"
#include "hci.h"
#include "hci_le.h"
#include "hal.h"
#include "sm.h"
//#include "uart_support.h"
#include "stm32_bluenrg_ble.h"
#include "ble_clock.h"
#include "ble_status.h"
#ifdef DEBUG
#include "stm32f4xx_nucleo_add_led.h"
#endif
#include <list.h>

#ifndef BLE_APP_CONFIG
#include  <blefw_conf.h>
#endif

#ifndef COPY_VAR
#define COPY_VAR(dest,source) memcpy(dest,(void*)source,sizeof((source)))
#endif

#ifndef DEVICE_ADDRS_LENGTH
#define DEVICE_ADDRS_LENGTH     (6)
#endif

//#define MAX_SERVER_ATT_SIZE             0x03

/************************************************APP_BLE DEFINITIONS***************************************/
typedef enum /*<! Used for return the result of an operation commanded by the application firmware >*/
{
  APP_SUCCESS = 0x00,            /*!< command success applied */
  APP_ERROR =  0x01,             /*!< and error occour during the command execution*/
  APP_NOT_CONFIG= 0x02           /*!< not configuration is present before to applied a command*/
} APP_Status;

typedef enum device_type{/*!< used to specify a valid device role  >*/
  DEVICE_PERISPHERAL,           /*!< device as a perispheral >*/
  DEVICE_CENTRAL,               /*!< device as a central >*/
  DEVICE_BROADCASTER,           /*!< device as a broadcaster >*/
  DEVICE_OBSERVER               /*!< device as observer >*/
}dv_type_t;

/*device status*/
typedef enum device_state{/*!< Used for indicate what is the current status of the device >*/
DEVICE_UNITIALIZED,				     /*!< device_initialized >*/
DEVICE_DISCOVERY_MODE,		     /*!< device set as discovery mode >*/
DEVICE_ADVERTISEMENT_MODE,		 /*!< device set as adverticement mode >*/
DEVICE_SCAN_MODE,		           /*!< device set as scan mode >*/
DEVICE_READY_TO_INTERCHANGE,   /*!< device is ready to  discover services and characterstics  >*/
DEVICE_READY_TO_CONNECT,       /*!< device is ready set up a connection   >*/
DEVICE_READY,				           /*!< device set as ready after connection established >*/
DEVICE_NOT_CONNECTED			     /*!< device set as not connected after many connetion set up tries >*/
}dv_state_t;

typedef struct{/*Used to control the service discovery */
  uint8_t services_to_find;           /*!< How many services have to be scanned >*/
  uint8_t services_success_scanned;   /*!< Flag fire to indicate that all of the services fot this profile had been scanned >*/
  uint8_t attr_success_scanned;       /*!< Flag fire once all the characterstics for this profile have been scanned >*/
  uint8_t notify_success_enable;     /*!< Flag fire once all the notifies for this profile have been enable >*/
}sv_ctrl_flags;

typedef struct{
uint8_t char_to_scan;							/*!< Amount of characteristics to be scanned >*/
uint8_t char_scanned;							/*!< Amount of characteristics scanned >*/
uint8_t char_discovery_success;   /*!< Flag fire once all the characterstics for this service have been scanned >*/
uint8_t char_notify_enabled_success;   /*!< Flag fire once all the characterstics for this service have been scanned >*/
}char_flags;

struct _app_attr_t{/*This is a general attribute definition*/
  uint8_t CharUUID[16];            /*!< Control characteristic UUID.*/
  uint8_t charUuidType;            /*!< Control characteristic UUID_TYPE. 16 or 128 bits*/
  uint8_t charValueLen;            /*!< Current length of the characteristic description*/
  uint8_t charProperties;          /*!< Characteristic properties.*/
  uint8_t secPermissions;         /*!< Permissions*/
  uint8_t gattEvtMask;            /*!< Type of event generated by GATT server*/
  uint8_t encryKeySize;           /*!< minimum encription key size requirement for this attr: 7 to 16*/
  uint8_t isVariable;             /*!< 0x00:fixed attr length 0x01:var attr length*/
  uint16_t CharHandle;             /*!< characteristic handle.*/
  uint16_t Associate_CharHandler;   /*!< peer characteristic handle associate to this connection.*/
  uint8_t n_val;                  /*!< control counter of the number of values associate to this characteristic */
  struct _app_attr_t * next_attr;
};

typedef struct _app_attr_t app_attr_t; /*<! This is the service type definition >*/

struct _app_service_t{/*<!This is a general service definition >*/
  char_flags chrflags;                  /*!< Characteristics control flags for a service. >*/
  uint8_t ServiceUUID[16];              /*!< Control service UUID. >*/
  uint16_t ServiceHandle;               /*!< Service handle. >*/
  uint8_t service_uuid_type;            /*!< Control service UUID_TYPE. 16 or 128 bits >*/
  uint8_t service_type;                 /*!< Type of service (primary or secondary) >*/
  uint8_t max_attr_records;             /*!< Maximum number of att-records that can be add to this service >*/
  uint8_t n_attr;                       /*!< Control counter of the number of attributes add to this service >*/
  struct _app_service_t * next_service;
  app_attr_t * attrs;
};

typedef struct _app_service_t app_service_t; /*<! This is the service type definition >*/

typedef struct{/*This is the application profile definition */
  uint8_t n_service;                  /*!< Control counter of the number of services associate to this application >*/
  sv_ctrl_flags svflags;              /*!< Control flags for the services associated to a profile >*/
  app_service_t * services;           /*!< Services associated to this profile  >*/
}app_profile_t;

typedef struct{/*structure for general && selective discovery configuration*/
  uint8_t scan_type;                 /*!<  set the device in active 0x01 or pasive 0x00 scanning>*/
  uint16_t sinterval;               /*!<  Time interval between two LE scans:0x0004-0x4000(period) >*/
  uint16_t swindows;                /*!<  Amoung of time for the duration of the LE scan:0x0004-0x4000(length) >*/
  uint8_t ownaddrtype;              /*!<  0x00:public address, 0x01: random device address >*/
  uint8_t fduplicates;              /*!<  0x00 do not  filter duplicates 0x01: filter duplicates >*/
  uint8_t Num_whiteList_Entries;    /*!<  number of devices that have to be addded to the whitelist >*/
  uint8_t *addr_array;              /*!<  address array will contain the Num_White_list_entries address_type and addresses >*/
}app_discovery_t;

typedef struct{/**structure for advertisement configuration*/
uint8_t adveventtype;           /*!<  0x00: connectable undirected adverticement
                                      0x02: scanable undirect adverticement
                                      0x03 non connectable undirect adverticement >*/
uint16_t advintervalmin;        /*!<  minimum advertisement interval for non direct advertisement: 0x0020-0x4000
                                      default N=0x0800: Time=N*0.625ms >*/
uint16_t advintervalmax;        /*!<  minimum advertisement interval for non direct advertisement: 0x0020-0x4000
                                      default N=0x0800: Time=N*0.625ms >*/
uint8_t advaddrstype;           /*!<  0x00:public address, 0x01: random device address >*/
uint8_t advfilterpoli;          /*!<  0x00:(default)allows scan request and connect request for any device,
                                      0x01:allows scan request for whitelist only but allows connect req for any device
                                      0x02: scan request for any connect request for white list only
                                      0x03: scan request and connect request for whitelist only >*/
//uint8_t localnamelength;/*firmware parameter*/
//uint8_t localname[];/*firmware parameter*/
//uint8_t serviceuuidlength;/*user parameter*/
//uint8_t serviceuuidlist[];/*user parameter*/
uint16_t slconnintervalmin;   /*!<  slave connection interval min value
                                    connection interval min = slconnintervalmin * 1.25ms: 0x006-0x0C80;
                                    0xFFFF:not specific min>*/
uint16_t slconnintervalmax;   /*!<  slave connection interval min value
                                    connection interval max = slconnintervalmax * 1.25ms: 0x006-0x0C80;
                                    shall be slconnintervalmax >= slconnintervalmin
                                    0xFFFF:not specific max >*/
}app_advertise_t;

/********************************************SERVICES HANDLER DEFINITIONS*****************************/

typedef enum{
	SERV_SUCCESS=0x00,
	SERV_ERROR=0x01,
        SERV_NOT_APPL=0x02
}SERV_Status;

typedef enum service_State{
  ST_SERVICE_DISCOVERY,							/*!< Device looking for services >*/
  ST_CHAR_DISCOVERY,					      /*!< Device looking for characteristics >*/
  ST_DISC_COMPLETED
}sv_state_t;

typedef struct{/*to delete*/
volatile uint8_t service_discovery;               /*!< this flag is fire when a new service has been discovered >*/
volatile uint8_t char_discovery;                  /*!< this flag is fire when a new char has been discovered >*/
}sv_hdler_flags;

typedef struct{/*used to configure the device as a server or a client*/
  uint8_t serv_disc_mode;						/*!< this flag is setup for enable/disable the services scanning >*/
  uint8_t char_disc_mode;						/*!< this flag is setup for enable/disable the characteristic discovery >*/
}servhandler_conf;

typedef struct{/*to delete*/
sv_hdler_flags flags;							/*!< service handler event flags*/
servhandler_conf config;						/*service handler module configuration*/
}service_hdl_t;

/******************************************CONNECTION HANDLER DEFINITIONS**************************************/

typedef enum /*used for return the result of and operation by the connection handler*/
{
  CHADLE_SUCCESS = 0x00,            /*!< command success applied >*/
  CHADLE_ERROR = 0x01,              /*!< and error occour during the command execution >*/
} CHADLE_Status;

/*connection_status*/
typedef enum connection_State {/*This represent the status of the connection.*/
ST_UNESTABLISHED,					/*!< connection unestablished >*/
ST_STABLISHED,						/*!< connection stablished after discover services and characteristics >*/
ST_OBSERVER,						  /*!<   handler the communication as observer node >*/
ST_BROADCAST, 						/*!< handler the communication as broadcast node >*/
ST_CONNECTED_WAIT_DISC,		/*!< connection wait for interchange services and characterstics >*/
ST_CREATE_CONNECTION,     /*!< connection wait for connection set up >*/
ST_TIME_OUT,            /*!< the connection exceed the time for stablishement >*/
ST_CONNECTION_LOST        /*!< connection lost or impossible to set up >*/
}cn_state_t;

typedef struct{/*structure for connection configuration*/
uint16_t sinterval;               /*!<  Time interval between two LE scans:0x0004-0x4000(period)*/
uint16_t swindows;                /*!<  Amoung of time for the duration of the LE scan:0x0004-0x4000(length)*/
//uint8_t peer_addrtype; /*user parameter*/
//uint8_t peer_addrs [6];/*user parameter*/
uint8_t ownaddrtype;             /*!<  0x00:public address, 0x01: random device address >*/
uint16_t cintervalmin;           /*!<  minimum value for connection event interval shall be less or equal to  cintervalmax: 0x0006-0x0C80 >*/
uint16_t cintervalmax;           /*!<  maximum value for connection event interval shall be greater or equal to  cintervalmin: 0x0006-0x0C80>*/
uint16_t clatency;               /*!<  salve latency for connection in number of connection events:0x0000-0x01F4>*/
uint16_t stimeout;               /*!<  supervisor time out for LE link: 0x000A-0x0C80>*/
uint16_t clengthmin;             /*!<  minimum length of connection event needed for LE: 0x0000-0xFFFF time N*0.625ms>*/
uint16_t clengthmax;             /*!<  maximum length of connection event needed for LE: 0x0000-0xFFFF time N*0.625ms>*/
}config_connection_t;

/***************************************NETWORK MODULE DEFINITIONS******************************************/

typedef enum{/*<! Used for return the result of an operation by the connection handler module >*/
	NET_SUCCESS=0x00,			/*!< command success applied >*/
	NET_ERROR=0x01 				/*!< and error occour during the command execution >*/
}NET_Status;

typedef enum{/*define if the network will be operated as a connected or broadcast */
	NET_BROADCAST,			/*!< Network module configured as a broadcast >*/
	NET_CONNECTED				/*!< Network module configured as a master-slave >*/
}net_type_t;

typedef struct{ /*single connection structure*/
uint16_t Connection_Handle;           /*!< define one and only one connection handler x slave  */
app_profile_t * Node_profile;         /*!< could be one profile x slave (most convenient)*/
uint8_t device_type_addrs;            /*!< slave device addrs type*/
uint8_t device_address[6];            /*!< device address val*/
config_connection_t * cconfig;        /*!< device has a special connection configuration(optional) >*/
servhandler_conf  sconfig;            /*!< device has a special services configuration(optional) >*/
cn_state_t connection_status;         /*!< this is the connection status.*/
sv_state_t service_status;

}connection_t;

/*network module control flags*/
typedef struct{/*<! Used for return the result of an operation by the network  module >*/
volatile uint8_t wait_end_procedure;         /*!< This flag is fire when a procedure is not ended >*/
uint8_t connection_stablishment_complete;    /*!< This flag is fire when a procedure is not ended >*/
uint8_t services_discovery_complete;
}net_flags;

/*network high module structure*/
typedef struct
{/*This is the network structure used for handler the connections and profiles associated by an application*/
  net_flags flags;                    /*<! Network control flags>*/
  uint8_t num_device_found;           /*<! This indicates the number of perispheral(s) discovered by the network >*/
  uint8_t num_device_connected;       /*<! This indicates the number of perispheral(s) success connected to the network >*/
  uint8_t num_device_serv_discovery;  /*<! This indicates the number of peer device(s) that had been scanned successfully their services and characteristic>*/
  dv_state_t device_cstatus;          /*<! Status of the device in this network >*/
  struct timer time_alive;            /*!< Time remaining before to consider the connection  or device(s)  lost >*/
  #ifdef MULTINODE
  //uint32_t anchor_period;             /*!< store information about the anchor period in multiples of 0.625msec.>*/
  //uint32_t max_free_slot;             /*!< store information about the maximum_available size in multiples of 0.625msec.>*/
  connection_t mMSConnection[EXPECTED_NODES]; /*<! Here one connection per peer-node management by the application >*/
  #else
  connection_t mMSConnection;         /*<! Not multinode then only a single connection is possible. >*/
  #endif
}network_t;

/*****************************EVENT HANDLER STRUCTURES**********************************************/
typedef struct { /*this is the structured used by the event handler for specified an event*/
  tClockTime ISR_timestamp;
  uint16_t event_type;
  void * evt_data;
}event_t;
/***************************************************************************************************/

#endif /* NET_BLE_H*/


text:
class FlightStats::Api::Track::Flight < FlightStats::Api::Track
  ALLOWED_PARAMS = {
    :all => {
      includeFlightPlan:      [true, false],
      maxPositions:           'Fixnum',
      maxPositionsAgeMinutes: 'Fixnum',
      extendedOptions:       ['useInlinedReferences', 'useHttpErrors', 'includeDeltas']
    },
    [:by_departing_on_date, :by_arriving_on_date] => {
      hourOfDay: [*0..23],
      utc:       [true, false],
      numHours:  [*0..24],
      airport:   'String',
      codeType:  ['IATA', 'ICAO', 'FS']
    }
  }

  class << self
    include FlightStats::Api::FlightStatusAndTrack

    # Because FlightStats API is foolish and for just the by_id url uses flight/track rather than flight/tracks...
    # Does make semantic sense as tracking singular flight but annoying to code around
    def flight(query, params = {})
      resource_tracks = 'flight/track' if /by_id/.match caller.first
      get(build_url(body: "#{resource_tracks || resource_method_type}/#{query}", params: params))
    end
  end

  set_config resource_type: 'flight', allowed_param_options: ALLOWED_PARAMS
end


text:
package org.summerb.minicms.impl.cache;

import java.util.Locale;

import org.summerb.minicms.api.dto.Article;

public class ArticleCacheKey {
	private String articleKey;
	private String lang;

	public ArticleCacheKey(String articleKey, Locale locale) {
		this.articleKey = articleKey;
		this.lang = locale.getLanguage();
	}

	public ArticleCacheKey(Article article) {
		this.articleKey = article.getArticleKey();
		this.lang = article.getLang();
	}

	public String getArticleKey() {
		return articleKey;
	}

	public void setArticleKey(String articleKey) {
		this.articleKey = articleKey;
	}

	public String getLang() {
		return lang;
	}

	public void setLang(String lang) {
		this.lang = lang;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((articleKey == null) ? 0 : articleKey.hashCode());
		result = prime * result + ((lang == null) ? 0 : lang.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ArticleCacheKey other = (ArticleCacheKey) obj;
		if (articleKey == null) {
			if (other.articleKey != null)
				return false;
		} else if (!articleKey.equals(other.articleKey))
			return false;
		if (lang == null) {
			if (other.lang != null)
				return false;
		} else if (!lang.equals(other.lang))
			return false;
		return true;
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/ic_access_time_grey_500_18dp_vector" />
</selector>


text:
######################################################
GeoGig GeoTools Extension
######################################################

This extension to GeoGig is meant to provide a means for importing and exporting
geospatial data to and from GeoGig into a variety of data stores.

GeoGig Details
=======

Project Lead: `Gabriel Roldan <https://github.com/groldan>`_

Source files use the following header::

As indicated above the code is distributed under an `Eclipse Distribution License <LICENSE.txt>`_ license (which is a BSD 3 Clause License). The contributors section is optional, and is often used to thank those submitting pull requests.

Build
=====

The GeoGig GeoTools extension is built using Maven::

  cd src
  mvn clean install

Functional Tests
----------------

Functional tests require a PostGIS database that can be used for testing, and are run with the online profile::

  mvn -Ponline

The PostGIS database must be populated with the test tables from the .sql file::

  'src/test/resources/org/geogig/geotools/cli/test/functional/geogig_pg_test.sql'

When the functional tests are run for the first time, a database configuration file will be created at the
user root directory called '.geogig-pg-tests.properties'.  Open this file and enter the connection information
for the test database.

Additional Profiles
-------------------

Any additional build profiles are documented in the root `pom.xml`:pom.xml .

If you would like to work in Eclipse use of the `m2eclipse plugin <http://www.sonatype.org/m2eclipse>`_ recommended.

Please carefully apply the code formatting options in the buld/eclipse/formatter.xml file. These are the standard
Java formatting options with 100 character line length for both code and comments, and 4 spaces for indentation.
It is also recommended to use the code templates from build/eclipse/codetemlates.xml.

Participation
=============

The project is hosted on github:

* https://github.com/opengeo/GeoGig

Participation is encouraged using the github *fork* and *pull request* workflow::

* file headers are described above
* include test case demonstrating functionality
* contributions are expected to pass test and not break the build

Project resources:

* `Full on-line project documentation <http://opengeo.github.com/GeoGig>`_
* `GeoGig Discussion Group <https://groups.google.com/a/opengeo.org/group/geogig/>`_
* The build is `actively monitored using hudson <http://hudson.opengeo.org/hudson/view/geogig/>`_
* https://github.com/opengeo/GeoGig/issues

Additional resources:

* `guava-libraries <http://code.google.com/p/guava-libraries/>`_


text:
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.5
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package rhcad.touchvg.core;

public class MgJsonStorage {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected MgJsonStorage(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(MgJsonStorage obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        touchvgJNI.delete_MgJsonStorage(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public MgJsonStorage() {
    this(touchvgJNI.new_MgJsonStorage(), true);
  }

  public MgStorage storageForRead(String content) {
    long cPtr = touchvgJNI.MgJsonStorage_storageForRead__SWIG_0(swigCPtr, this, content);
    return (cPtr == 0) ? null : new MgStorage(cPtr, false);
  }

  public MgStorage storageForWrite() {
    long cPtr = touchvgJNI.MgJsonStorage_storageForWrite(swigCPtr, this);
    return (cPtr == 0) ? null : new MgStorage(cPtr, false);
  }

  public MgStorage storageForRead(MgJsonFile file) {
    long cPtr = touchvgJNI.MgJsonStorage_storageForRead__SWIG_1(swigCPtr, this, MgJsonFile.getCPtr(file), file);
    return (cPtr == 0) ? null : new MgStorage(cPtr, false);
  }

  public boolean save(MgJsonFile file, boolean pretty) {
    return touchvgJNI.MgJsonStorage_save__SWIG_0(swigCPtr, this, MgJsonFile.getCPtr(file), file, pretty);
  }

  public boolean save(MgJsonFile file) {
    return touchvgJNI.MgJsonStorage_save__SWIG_1(swigCPtr, this, MgJsonFile.getCPtr(file), file);
  }

  public String stringify(boolean pretty) {
    return touchvgJNI.MgJsonStorage_stringify__SWIG_0(swigCPtr, this, pretty);
  }

  public String stringify() {
    return touchvgJNI.MgJsonStorage_stringify__SWIG_1(swigCPtr, this);
  }

  public void clear() {
    touchvgJNI.MgJsonStorage_clear(swigCPtr, this);
  }

  public String getParseError() {
    return touchvgJNI.MgJsonStorage_getParseError(swigCPtr, this);
  }

  public void setArrayMode(boolean arr) {
    touchvgJNI.MgJsonStorage_setArrayMode(swigCPtr, this, arr);
  }

  public void saveNumberAsString(boolean str) {
    touchvgJNI.MgJsonStorage_saveNumberAsString(swigCPtr, this, str);
  }

  public static boolean toUTF8(String infile, String outfile) {
    return touchvgJNI.MgJsonStorage_toUTF8(infile, outfile);
  }

  public static boolean toUTF16(String infile, String outfile) {
    return touchvgJNI.MgJsonStorage_toUTF16(infile, outfile);
  }

}


text:
#include "lapacke_utils.h"

lapack_int LAPACKE_cheev_2stage( int matrix_layout, char jobz, char uplo, lapack_int n,
                          lapack_complex_float* a, lapack_int lda, float* w )
{
    lapack_int info = 0;
    lapack_int lwork = -1;
    float* rwork = NULL;
    lapack_complex_float* work = NULL;
    lapack_complex_float work_query;
    if( matrix_layout != LAPACK_COL_MAJOR && matrix_layout != LAPACK_ROW_MAJOR ) {
        LAPACKE_xerbla( "LAPACKE_cheev_2stage", -1 );
        return -1;
    }
#ifndef LAPACK_DISABLE_NAN_CHECK
    /* Optionally check input matrices for NaNs */
    if( LAPACKE_che_nancheck( matrix_layout, uplo, n, a, lda ) ) {
        return -5;
    }
#endif
    /* Allocate memory for working array(s) */
    rwork = (float*)LAPACKE_malloc( sizeof(float) * MAX(1,3*n-2) );
    if( rwork == NULL ) {
        info = LAPACK_WORK_MEMORY_ERROR;
        goto exit_level_0;
    }
    /* Query optimal working array(s) size */
    info = LAPACKE_cheev_2stage_work( matrix_layout, jobz, uplo, n, a, lda, w,
                               &work_query, lwork, rwork );
    if( info != 0 ) {
        goto exit_level_1;
    }
    lwork = LAPACK_C2INT( work_query );
    /* Allocate memory for work arrays */
    work = (lapack_complex_float*)
        LAPACKE_malloc( sizeof(lapack_complex_float) * lwork );
    if( work == NULL ) {
        info = LAPACK_WORK_MEMORY_ERROR;
        goto exit_level_1;
    }
    /* Call middle-level interface */
    info = LAPACKE_cheev_2stage_work( matrix_layout, jobz, uplo, n, a, lda, w, work,
                               lwork, rwork );
    /* Release memory and exit */
    LAPACKE_free( work );
exit_level_1:
    LAPACKE_free( rwork );
exit_level_0:
    if( info == LAPACK_WORK_MEMORY_ERROR ) {
        LAPACKE_xerbla( "LAPACKE_cheev_2stage", info );
    }
    return info;
}


text:
namespace glm
{
	/// @addtogroup ext_vector_int2_sized
	/// @{

	/// 8 bit signed integer vector of 2 components type.
	///
	/// @see ext_vector_int2_sized
	typedef vec<2, int8, defaultp>		i8vec2;

	/// 16 bit signed integer vector of 2 components type.
	///
	/// @see ext_vector_int2_sized
	typedef vec<2, int16, defaultp>		i16vec2;

	/// 32 bit signed integer vector of 2 components type.
	///
	/// @see ext_vector_int2_sized
	typedef vec<2, int32, defaultp>		i32vec2;

	/// 64 bit signed integer vector of 2 components type.
	///
	/// @see ext_vector_int2_sized
	typedef vec<2, int64, defaultp>		i64vec2;

	/// @}
}//namespace glm


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="@dimen/default_detector_height"
    android:id="@+id/swipe_detector"
    android:orientation="horizontal"
    android:background="@color/detector_color"
    android:clickable="true"
    android:layout_width="match_parent"
    android:longClickable="true" />


text:
package com.hankcs.test.corpus;

import com.hankcs.hanlp.corpus.synonym.Synonym;
import com.hankcs.hanlp.dictionary.common.CommonSynonymDictionary;
import com.hankcs.hanlp.dictionary.common.CommonSynonymDictionaryEx;
import com.hankcs.hanlp.dictionary.CoreSynonymDictionary;
import junit.framework.TestCase;

import java.io.FileInputStream;
import java.util.List;

/**
 * 对同义词的测试
 * @author hankcs
 */
public class TestSynonym extends TestCase
{
    public void testCreate() throws Exception
    {
        String[] testCaseArray = new String[]
                {
                        "Bh06A32= 番茄 西红柿",
                        "Ad02B05# 白人 白种人 黑人",
                        "Bo21A05@ 摩托车"
                };
        for (String tc : testCaseArray)
        {
            runCase(tc);
        }
    }

    public void testSingle() throws Exception
    {
        runCase("Aa01A01= 人 士 人物 人士 人氏 人选");
    }

    public void testDictionary() throws Exception
    {
        String apple = "苹果";
        String banana = "香蕉";
        String bike = "自行车";
        CommonSynonymDictionary.SynonymItem synonymApple = CoreSynonymDictionary.get(apple);
        CommonSynonymDictionary.SynonymItem synonymBanana = CoreSynonymDictionary.get(banana);
        CommonSynonymDictionary.SynonymItem synonymBike = CoreSynonymDictionary.get(bike);
        System.out.println(apple + " " + banana + "之间的距离是" + synonymApple.distance(synonymBanana));
        System.out.println(apple + " " + bike + "之间的距离是" + synonymApple.distance(synonymBike));
    }

    void runCase(String param)
    {
        List<Synonym> synonymList = Synonym.create(param);
        System.out.println(synonymList);
    }

    public void testDictionaryEx() throws Exception
    {
        CommonSynonymDictionaryEx dictionaryEx = CommonSynonymDictionaryEx.create(new FileInputStream("data/dictionary/synonym/CoreSynonym.txt"));
        String[] array = new String[]
                {
                        "香蕉",
                        "苹果",
                        "白菜",
                        "水果",
                        "蔬菜",
                        "自行车",
                        "公交车",
                        "飞机",
                        "买",
                        "卖",
                        "购入",
                        "新年",
                        "春节",
                        "丢失",
                        "补办",
                        "办理",
                        "太阳",
                        "送给",
                        "寻找",
                        "放飞",
                        "孩",
                        "孩子",
                        "教室",
                        "教师",
                        "会计",
                };
        runCase(array, dictionaryEx);
    }

    public void runCase(String[] stringArray, CommonSynonymDictionaryEx dictionaryEx)
    {
        for (String a : stringArray)
        {
            for (String b : stringArray)
            {
                System.out.println(a + "\t" + b + "\t之间的距离是\t" + dictionaryEx.distance(a, b));
            }
        }
    }
}


text:
package com.facebook.imagepipeline.memory;

import com.facebook.common.internal.ImmutableMap;
import com.facebook.common.references.CloseableReference;
import com.facebook.imagepipeline.testing.FakeBufferMemoryChunkPool;
import com.facebook.imagepipeline.testing.FakeNativeMemoryChunkPool;
import java.util.Arrays;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;

/** Tests for {@link MemoryPooledByteBufferOutputStream} */
@RunWith(RobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public class MemoryPooledByteBufferOutputStreamTest extends TestUsingNativeMemoryChunk {
  private NativeMemoryChunkPool mNativePool;
  private BufferMemoryChunkPool mBufferPool;

  private byte[] mData;
  private PoolStats<byte[]> mNativeStats;
  private PoolStats<byte[]> mBufferStats;

  @Before
  public void setup() {
    mNativePool = new FakeNativeMemoryChunkPool();
    mNativeStats = new PoolStats(mNativePool);

    mBufferPool = new FakeBufferMemoryChunkPool();
    mBufferStats = new PoolStats(mBufferPool);

    mData = new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};
  }

  @Test
  public void testBasic_1() throws Exception {
    testBasic_1(mNativePool, mNativeStats);
    testBasic_1(mBufferPool, mBufferStats);
  }

  @Test
  public void testBasic_2() throws Exception {
    testBasic_2(mNativePool, mNativeStats);
    testBasic_2(mBufferPool, mBufferStats);
  }

  @Test
  public void testBasic_3() throws Exception {
    testBasic_3(mNativePool, mNativeStats);
    testBasic_3(mBufferPool, mBufferStats);
  }

  @Test
  public void testBasic_4() throws Exception {
    testBasic_4(mNativePool, mNativeStats);
    testBasic_4(mBufferPool, mBufferStats);
  }

  @Test
  public void testClose() {
    testClose(mNativePool, mNativeStats);
    testClose(mBufferPool, mBufferStats);
  }

  @Test(expected = MemoryPooledByteBufferOutputStream.InvalidStreamException.class)
  public void testToByteBufExceptionUsingNativePool() {
    testToByteBufException(mNativePool);
  }

  @Test(expected = MemoryPooledByteBufferOutputStream.InvalidStreamException.class)
  public void testToByteBufExceptionUsingBufferPool() {
    testToByteBufException(mBufferPool);
  }

  @Test
  public void testWriteAfterToByteBuf() throws Exception {
    testWriteAfterToByteBuf(mNativePool);
    testWriteAfterToByteBuf(mBufferPool);
  }

  private void testBasic_1(final MemoryChunkPool mPool, final PoolStats<byte[]> mStats)
      throws Exception {
    MemoryPooledByteBufferOutputStream os1 = new MemoryPooledByteBufferOutputStream(mPool);
    MemoryPooledByteBuffer sb1 = doWrite(os1, mData);
    Assert.assertEquals(16, sb1.mBufRef.get().getSize());
    assertArrayEquals(mData, getBytes(sb1), mData.length);
    mStats.refresh();
    Assert.assertEquals(
        ImmutableMap.of(
            32, new IntPair(0, 0),
            16, new IntPair(1, 0),
            8, new IntPair(0, 1),
            4, new IntPair(0, 1)),
        mStats.mBucketStats);
  }

  private void testBasic_2(final MemoryChunkPool mPool, final PoolStats<byte[]> mStats)
      throws Exception {
    MemoryPooledByteBufferOutputStream os2 = new MemoryPooledByteBufferOutputStream(mPool, 8);
    MemoryPooledByteBuffer sb2 = doWrite(os2, mData);
    Assert.assertEquals(16, sb2.mBufRef.get().getSize());
    assertArrayEquals(mData, getBytes(sb2), mData.length);
    mStats.refresh();
    Assert.assertEquals(
        ImmutableMap.of(
            32, new IntPair(0, 0),
            16, new IntPair(1, 0),
            8, new IntPair(0, 1),
            4, new IntPair(0, 0)),
        mStats.mBucketStats);
  }

  private void testBasic_3(final MemoryChunkPool mPool, final PoolStats<byte[]> mStats)
      throws Exception {
    MemoryPooledByteBufferOutputStream os3 = new MemoryPooledByteBufferOutputStream(mPool, 16);
    MemoryPooledByteBuffer sb3 = doWrite(os3, mData);
    Assert.assertEquals(16, sb3.mBufRef.get().getSize());
    assertArrayEquals(mData, getBytes(sb3), mData.length);
    mStats.refresh();
    Assert.assertEquals(
        ImmutableMap.of(
            32, new IntPair(0, 0),
            16, new IntPair(1, 0),
            8, new IntPair(0, 0),
            4, new IntPair(0, 0)),
        mStats.mBucketStats);
  }

  private void testBasic_4(final MemoryChunkPool mPool, final PoolStats<byte[]> mStats)
      throws Exception {
    MemoryPooledByteBufferOutputStream os4 = new MemoryPooledByteBufferOutputStream(mPool, 32);
    MemoryPooledByteBuffer sb4 = doWrite(os4, mData);
    Assert.assertEquals(32, sb4.mBufRef.get().getSize());
    assertArrayEquals(mData, getBytes(sb4), mData.length);
    mStats.refresh();
    Assert.assertEquals(
        ImmutableMap.of(
            32, new IntPair(1, 0),
            16, new IntPair(0, 0),
            8, new IntPair(0, 0),
            4, new IntPair(0, 0)),
        mStats.mBucketStats);
  }

  private static void testClose(final MemoryChunkPool mPool, final PoolStats<byte[]> mStats) {
    MemoryPooledByteBufferOutputStream os = new MemoryPooledByteBufferOutputStream(mPool);
    os.close();
    mStats.refresh();
    Assert.assertEquals(
        ImmutableMap.of(
            32, new IntPair(0, 0),
            16, new IntPair(0, 0),
            8, new IntPair(0, 0),
            4, new IntPair(0, 1)),
        mStats.mBucketStats);
  }

  private static void testToByteBufException(final MemoryChunkPool mPool) {
    MemoryPooledByteBufferOutputStream os1 = new MemoryPooledByteBufferOutputStream(mPool);
    os1.close();
    os1.toByteBuffer();
    Assert.fail();
  }

  private void testWriteAfterToByteBuf(final MemoryChunkPool mPool) throws Exception {
    MemoryPooledByteBufferOutputStream os1 = new MemoryPooledByteBufferOutputStream(mPool);
    MemoryPooledByteBuffer buf1 = doWrite(os1, Arrays.copyOf(mData, 9));
    MemoryPooledByteBuffer buf2 = doWrite(os1, Arrays.copyOf(mData, 3));
    Assert.assertEquals(12, buf2.size());

    final CloseableReference<MemoryChunk> chunk = buf1.mBufRef;
    Assert.assertEquals(3, chunk.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
    os1.close();
    buf1.close();
    buf2.close();
    Assert.assertEquals(0, chunk.getUnderlyingReferenceTestOnly().getRefCountTestOnly());
  }

  // write out the contents of data into the output stream
  private static MemoryPooledByteBuffer doWrite(MemoryPooledByteBufferOutputStream os, byte[] data)
      throws Exception {
    for (int i = 0; i < data.length; i++) {
      os.write(data, i, 1);
    }
    return os.toByteBuffer();
  }

  // assert that the first 'length' bytes of expected are the same as those in 'actual'
  private static void assertArrayEquals(byte[] expected, byte[] actual, int length) {
    Assert.assertTrue(expected.length >= length);
    Assert.assertTrue(actual.length >= length);
    for (int i = 0; i < length; i++) {
      Assert.assertEquals(expected[i], actual[i]);
    }
  }

  private static byte[] getBytes(MemoryPooledByteBuffer bb) {
    byte[] bytes = new byte[bb.size()];
    bb.mBufRef.get().read(0, bytes, 0, bytes.length);
    return bytes;
  }
}


text:
package org.terasology.logic.characters;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.entitySystem.entity.EntityManager;
import org.terasology.entitySystem.entity.EntityRef;
import org.terasology.entitySystem.event.ReceiveEvent;
import org.terasology.entitySystem.prefab.Prefab;
import org.terasology.entitySystem.systems.BaseComponentSystem;
import org.terasology.entitySystem.systems.RegisterMode;
import org.terasology.entitySystem.systems.RegisterSystem;
import org.terasology.entitySystem.systems.UpdateSubscriberSystem;
import org.terasology.logic.characters.events.ActivationRequest;
import org.terasology.logic.characters.events.ActivationRequestDenied;
import org.terasology.logic.characters.events.AttackRequest;
import org.terasology.logic.characters.events.DeathEvent;
import org.terasology.logic.characters.events.DropItemRequest;
import org.terasology.logic.characters.interactions.InteractionUtil;
import org.terasology.logic.common.ActivateEvent;
import org.terasology.logic.common.DisplayNameComponent;
import org.terasology.logic.health.DestroyEvent;
import org.terasology.logic.health.DoDamageEvent;
import org.terasology.logic.health.EngineDamageTypes;
import org.terasology.logic.inventory.InventoryManager;
import org.terasology.logic.inventory.ItemComponent;
import org.terasology.logic.inventory.PickupBuilder;
import org.terasology.logic.location.LocationComponent;
import org.terasology.math.geom.Vector3f;
import org.terasology.network.ClientComponent;
import org.terasology.network.NetworkSystem;
import org.terasology.physics.CollisionGroup;
import org.terasology.physics.HitResult;
import org.terasology.physics.Physics;
import org.terasology.physics.StandardCollisionGroup;
import org.terasology.physics.events.ImpulseEvent;
import org.terasology.registry.In;

/**
 * @author Immortius
 */
@RegisterSystem
public class CharacterSystem extends BaseComponentSystem implements UpdateSubscriberSystem {
    private static final Logger logger = LoggerFactory.getLogger(CharacterSystem.class);

    @In
    private Physics physics;

    @In
    private NetworkSystem networkSystem;

    @In
    private EntityManager entityManager;

    @In
    private InventoryManager inventoryManager;

    private PickupBuilder pickupBuilder;

    private CollisionGroup[] filter = {StandardCollisionGroup.DEFAULT, StandardCollisionGroup.WORLD,
            StandardCollisionGroup.CHARACTER};

    @Override
    public void initialise() {
        pickupBuilder = new PickupBuilder(entityManager, inventoryManager);
    }

    @ReceiveEvent(components = {CharacterComponent.class})
    public void onDeath(DestroyEvent event, EntityRef entity) {
        CharacterComponent character = entity.getComponent(CharacterComponent.class);
        character.controller.send(new DeathEvent());
        // TODO: Don't just destroy, ragdoll or create particle effect or something (possible allow another system to handle)
        //entity.removeComponent(CharacterComponent.class);
        //entity.removeComponent(CharacterMovementComponent.class);
        entity.destroy();
    }

    @ReceiveEvent(components = {CharacterComponent.class, LocationComponent.class})
    public void onAttackRequest(AttackRequest event, EntityRef character) {
        if (event.getItem().exists()) {
            if (!character.equals(event.getItem().getOwner())) {
                return;
            }
        }

        LocationComponent location = character.getComponent(LocationComponent.class);
        CharacterComponent characterComponent = character.getComponent(CharacterComponent.class);
        Vector3f direction = characterComponent.getLookDirection();
        Vector3f originPos = location.getWorldPosition();
        originPos.y += characterComponent.eyeOffset;

        HitResult result = physics.rayTrace(originPos, direction, characterComponent.interactionRange, filter);

        if (result.isHit()) {
            int damage = 1;
            Prefab damageType = EngineDamageTypes.PHYSICAL.get();
            // Calculate damage from item
            ItemComponent item = event.getItem().getComponent(ItemComponent.class);
            if (item != null) {
                damage = item.baseDamage;
                if (item.damageType != null) {
                    damageType = item.damageType;
                }
            }

            result.getEntity().send(new DoDamageEvent(damage, damageType, character, event.getItem()));
        }
    }

    @ReceiveEvent(components = {CharacterComponent.class, LocationComponent.class}, netFilter = RegisterMode.AUTHORITY)
    public void onActivationRequest(ActivationRequest event, EntityRef character) {
        if (isPredictionOfEventCorrect(character, event)) {
            if (event.getUsedOwnedEntity().exists()) {
                event.getUsedOwnedEntity().send(new ActivateEvent(event));
            } else {
                event.getTarget().send(new ActivateEvent(event));
            }
        } else {
            character.send(new ActivationRequestDenied(event.getActivationId()));
        }
    }

    private boolean vectorsAreAboutEqual(Vector3f v1, Vector3f v2) {
        Vector3f delta = new Vector3f();
        delta.add(v1);
        delta.sub(v2);
        float epsilon = 0.0001f;
        float deltaSquared = delta.lengthSquared();
        return deltaSquared < epsilon;
    }

    private String getPlayerNameFromCharacter(EntityRef character) {
        CharacterComponent characterComponent = character.getComponent(CharacterComponent.class);
        if (characterComponent == null) {
            return "?";
        }
        EntityRef controller = characterComponent.controller;

        ClientComponent clientComponent = controller.getComponent(ClientComponent.class);
        EntityRef clientInfo = clientComponent.clientInfo;

        DisplayNameComponent displayNameComponent = clientInfo.getComponent(DisplayNameComponent.class);
        if (displayNameComponent == null) {
            return "?";
        }

        return displayNameComponent.name;
    }

    private boolean isPredictionOfEventCorrect(EntityRef character, ActivationRequest event) {
        LocationComponent location = character.getComponent(LocationComponent.class);
        CharacterComponent characterComponent = character.getComponent(CharacterComponent.class);
        Vector3f direction = characterComponent.getLookDirection();
        if (!(vectorsAreAboutEqual(event.getDirection(), direction))) {
            logger.error("Direction at client {} was different than direction at server {}", event.getDirection(), direction);
        }
        // Assume the exact same value in case there are rounding mistakes:
        direction = event.getDirection();

        Vector3f originPos = location.getWorldPosition();
        originPos.y += characterComponent.eyeOffset;
        if (!(vectorsAreAboutEqual(event.getOrigin(), originPos))) {
            String msg = "Player {} seems to have cheated: It stated that it performed an action from {} but the predicted position is {}";
            logger.info(msg, getPlayerNameFromCharacter(character), event.getOrigin(), originPos);
            return false;
        }

        if (event.isOwnedEntityUsage()) {
            if (!event.getUsedOwnedEntity().exists()) {
                String msg = "Denied activation attempt by {} since the used entity does not exist on the authority";
                logger.info(msg, getPlayerNameFromCharacter(character));
                return false;
            }
            if (!networkSystem.getOwnerEntity(event.getUsedOwnedEntity()).equals(networkSystem.getOwnerEntity(character))) {
                String msg = "Denied activation attempt by {} since it does not own the entity at the authority";
                logger.info(msg, getPlayerNameFromCharacter(character));
                return false;
            }
        } else {
            // check for cheats so that data can later be trusted:
            if (event.getUsedOwnedEntity().exists()) {
                String msg = "Denied activation attempt by {} since it is not properly marked as owned entity usage";
                logger.info(msg, getPlayerNameFromCharacter(character));
                return false;
            }
        }

        if (event.isEventWithTarget()) {
            if (!event.getTarget().exists()) {
                String msg = "Denied activation attempt by {} since the target does not exist on the authority";
                logger.info(msg, getPlayerNameFromCharacter(character));
                return false; // can happen if target existed on client
            }

            HitResult result = physics.rayTrace(originPos, direction, characterComponent.interactionRange, filter);
            if (!result.isHit()) {
                String msg = "Denied activation attempt by {} since at the authority there was nothing to activate at that place";
                logger.info(msg, getPlayerNameFromCharacter(character));
                return false;
            }
            EntityRef hitEntity = result.getEntity();
            if (!hitEntity.equals(event.getTarget())) {
                /**
                 * Tip for debugging this issue: Obtain the network id of hit entity and search it in both client and
                 * server entity dump. When certain fields don't get replicated, then wrong entity might get hin in the
                 * hit test.
                 */
                String msg = "Denied activation attempt by {} since at the authority another entity would have been activated";
                logger.info(msg, getPlayerNameFromCharacter(character));
                return false;
            }

            if (!(vectorsAreAboutEqual(event.getHitPosition(), result.getHitPoint()))) {
                String msg = "Denied activation attempt by {} since at the authority the object got hit at a differnt position";
                logger.info(msg, getPlayerNameFromCharacter(character));
                return false;
            }
        } else {
            // In order to trust the data later we need to verify it even if it should be correct if no one cheats:
            if (event.getTarget().exists()) {
                String msg = "Denied activation attempt by {} since the event was not properly labeled as having a target";
                logger.info(msg, getPlayerNameFromCharacter(character));
                return false;
            }
            if (!(vectorsAreAboutEqual(event.getHitPosition(), originPos))) {
                String msg = "Denied activation attempt by {} since the event was not properly labeled as having a hit postion";
                logger.info(msg, getPlayerNameFromCharacter(character));
                return false;
            }
        }
        return true;
    }

    @ReceiveEvent(components = {CharacterComponent.class, LocationComponent.class}, netFilter = RegisterMode.AUTHORITY)
    public void onDropItemRequest(DropItemRequest event, EntityRef character) {
        //make sure we own the item and it exists
        if (!event.getItem().exists() || !networkSystem.getOwnerEntity(event.getItem()).equals(networkSystem.getOwnerEntity(character))) {
            return;
        }

        EntityRef pickup = pickupBuilder.createPickupFor(event.getItem(), event.getNewPosition(), 200);
        pickup.send(new ImpulseEvent(event.getImpulse()));
    }

    @Override
    public void update(float delta) {
        Iterable<EntityRef> characterEntities = entityManager.getEntitiesWith(CharacterComponent.class, LocationComponent.class);
        for (EntityRef characterEntity: characterEntities) {
            CharacterComponent characterComponent = characterEntity.getComponent(CharacterComponent.class);
            if (characterComponent == null) {
                continue; // could have changed during events below
            }
            LocationComponent characterLocation = characterEntity.getComponent(LocationComponent.class);
            if (characterLocation == null) {
                continue; // could have changed during events below
            }
            EntityRef target = characterComponent.authorizedInteractionTarget;
            if (target.isActive()) {

                LocationComponent targetLocation = target.getComponent(LocationComponent.class);
                if (targetLocation == null) {
                    continue; // could have changed during events below
                }
                float maxInteractionRange = characterComponent.interactionRange;
                if (isDistanceToLarge(characterLocation, targetLocation, maxInteractionRange)) {
                    InteractionUtil.cancelInteractionAsServer(characterEntity);
                }
            }
        }
    }

    private boolean isDistanceToLarge(LocationComponent characterLocation, LocationComponent targetLocation, float maxInteractionRange) {
        float maxInteractionRangeSquared = maxInteractionRange * maxInteractionRange;
        Vector3f positionDelta = new Vector3f();
        positionDelta.add(characterLocation.getWorldPosition());
        positionDelta.sub(targetLocation.getWorldPosition());
        float interactionRangeSquared = positionDelta.lengthSquared();
        // add a small epsilon to have rounding mistakes be in favor of the player:
        float epsilon = 0.00001f;
        return interactionRangeSquared > maxInteractionRangeSquared + epsilon;
    }

}


text:
namespace views {

ResizeArea::ResizeArea(ResizeAreaDelegate* delegate)
    : delegate_(delegate), initial_position_(0) {}

ResizeArea::~ResizeArea() = default;

gfx::NativeCursor ResizeArea::GetCursor(const ui::MouseEvent& event) {
  return GetEnabled() ? GetNativeEastWestResizeCursor() : gfx::kNullCursor;
}

void ResizeArea::OnGestureEvent(ui::GestureEvent* event) {
  if (event->type() == ui::ET_GESTURE_TAP_DOWN) {
    SetInitialPosition(event->x());
    event->SetHandled();
  } else if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
             event->type() == ui::ET_GESTURE_SCROLL_UPDATE) {
    ReportResizeAmount(event->x(), false);
    event->SetHandled();
  } else if (event->type() == ui::ET_GESTURE_END) {
    ReportResizeAmount(event->x(), true);
    event->SetHandled();
  }
}

bool ResizeArea::OnMousePressed(const ui::MouseEvent& event) {
  if (!event.IsOnlyLeftMouseButton())
    return false;

  SetInitialPosition(event.x());
  return true;
}

bool ResizeArea::OnMouseDragged(const ui::MouseEvent& event) {
  if (!event.IsLeftMouseButton())
    return false;

  ReportResizeAmount(event.x(), false);
  return true;
}

void ResizeArea::OnMouseReleased(const ui::MouseEvent& event) {
  ReportResizeAmount(event.x(), true);
}

void ResizeArea::OnMouseCaptureLost() {
  ReportResizeAmount(initial_position_, true);
}

void ResizeArea::GetAccessibleNodeData(ui::AXNodeData* node_data) {
  node_data->role = ax::mojom::Role::kSplitter;
}

void ResizeArea::ReportResizeAmount(int resize_amount, bool last_update) {
  gfx::Point point(resize_amount, 0);
  View::ConvertPointToScreen(this, &point);
  resize_amount = point.x() - initial_position_;
  delegate_->OnResize(base::i18n::IsRTL() ? -resize_amount : resize_amount,
                      last_update);
}

void ResizeArea::SetInitialPosition(int event_x) {
  gfx::Point point(event_x, 0);
  View::ConvertPointToScreen(this, &point);
  initial_position_ = point.x();
}

BEGIN_METADATA(ResizeArea)
METADATA_PARENT_CLASS(View)
END_METADATA()

}  // namespace views


text:
namespace TaskManager_GUI
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.tasksTreeView = new BrightIdeasSoftware.TreeListView();
            this.taskNameColumn = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.taskPercentageColumn = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.taskDeadlineColumn = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.taskDurationColumn = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.taskCategoryColumn = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.taskDescriptionColumn = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.toolStrip1 = new System.Windows.Forms.ToolStrip();
            this.addCategoryButton = new System.Windows.Forms.ToolStripButton();
            this.addTaskButton = new System.Windows.Forms.ToolStripButton();
            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
            this.splitContainer2 = new System.Windows.Forms.SplitContainer();
            this.CategoriesList = new BrightIdeasSoftware.ObjectListView();
            this.CategoryColumn = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
            this.contextMenuItem = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.optionComplete = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
            this.optionEdit = new System.Windows.Forms.ToolStripMenuItem();
            this.optionAdd = new System.Windows.Forms.ToolStripMenuItem();
            this.optionEditSubtasks = new System.Windows.Forms.ToolStripMenuItem();
            this.optionRemove = new System.Windows.Forms.ToolStripMenuItem();
            this.contextMenuCategories = new System.Windows.Forms.ContextMenuStrip(this.components);
            this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.saveFileDialog = new System.Windows.Forms.SaveFileDialog();
            ((System.ComponentModel.ISupportInitialize)(this.tasksTreeView)).BeginInit();
            this.toolStrip1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
            this.splitContainer1.Panel1.SuspendLayout();
            this.splitContainer1.Panel2.SuspendLayout();
            this.splitContainer1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
            this.splitContainer2.Panel1.SuspendLayout();
            this.splitContainer2.Panel2.SuspendLayout();
            this.splitContainer2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.CategoriesList)).BeginInit();
            this.contextMenuItem.SuspendLayout();
            this.contextMenuCategories.SuspendLayout();
            this.SuspendLayout();
            //
            // tasksTreeView
            //
            this.tasksTreeView.AllColumns.Add(this.taskNameColumn);
            this.tasksTreeView.AllColumns.Add(this.taskPercentageColumn);
            this.tasksTreeView.AllColumns.Add(this.taskDeadlineColumn);
            this.tasksTreeView.AllColumns.Add(this.taskDurationColumn);
            this.tasksTreeView.AllColumns.Add(this.taskCategoryColumn);
            this.tasksTreeView.AllColumns.Add(this.taskDescriptionColumn);
            this.tasksTreeView.CellEditActivation = BrightIdeasSoftware.ObjectListView.CellEditActivateMode.DoubleClick;
            this.tasksTreeView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.taskNameColumn,
            this.taskPercentageColumn,
            this.taskDeadlineColumn,
            this.taskDurationColumn,
            this.taskCategoryColumn,
            this.taskDescriptionColumn});
            this.tasksTreeView.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tasksTreeView.Font = new System.Drawing.Font("Calibri", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.tasksTreeView.Location = new System.Drawing.Point(0, 0);
            this.tasksTreeView.Name = "tasksTreeView";
            this.tasksTreeView.OwnerDraw = true;
            this.tasksTreeView.ShowGroups = false;
            this.tasksTreeView.Size = new System.Drawing.Size(800, 453);
            this.tasksTreeView.TabIndex = 0;
            this.tasksTreeView.UseCellFormatEvents = true;
            this.tasksTreeView.UseCompatibleStateImageBehavior = false;
            this.tasksTreeView.View = System.Windows.Forms.View.Details;
            this.tasksTreeView.VirtualMode = true;
            this.tasksTreeView.CellRightClick += new System.EventHandler<BrightIdeasSoftware.CellRightClickEventArgs>(this.tasksTreeView_CellRightClick);
            this.tasksTreeView.FormatCell += new System.EventHandler<BrightIdeasSoftware.FormatCellEventArgs>(this.tasksTreeView_FormatCell);
            this.tasksTreeView.FormatRow += new System.EventHandler<BrightIdeasSoftware.FormatRowEventArgs>(this.tasksTreeView_FormatRow);
            this.tasksTreeView.ItemActivate += new System.EventHandler(this.tasksTreeView_ItemActivate);
            //
            // taskNameColumn
            //
            this.taskNameColumn.AspectName = "Name";
            this.taskNameColumn.Text = "Name";
            this.taskNameColumn.Width = 151;
            //
            // taskPercentageColumn
            //
            this.taskPercentageColumn.AspectName = "Percentage";
            this.taskPercentageColumn.AspectToStringFormat = "{0}%";
            this.taskPercentageColumn.Text = "Percentage";
            this.taskPercentageColumn.Width = 82;
            //
            // taskDeadlineColumn
            //
            this.taskDeadlineColumn.AspectName = "Deadline";
            this.taskDeadlineColumn.AspectToStringFormat = "{0:d}";
            this.taskDeadlineColumn.Text = "Deadline";
            this.taskDeadlineColumn.Width = 77;
            //
            // taskDurationColumn
            //
            this.taskDurationColumn.AspectName = "Duration";
            this.taskDurationColumn.AspectToStringFormat = "";
            this.taskDurationColumn.IsEditable = false;
            this.taskDurationColumn.Text = "Duration";
            //
            // taskCategoryColumn
            //
            this.taskCategoryColumn.AspectName = "Category.Name";
            this.taskCategoryColumn.IsEditable = false;
            this.taskCategoryColumn.Text = "Category";
            this.taskCategoryColumn.Width = 77;
            //
            // taskDescriptionColumn
            //
            this.taskDescriptionColumn.AspectName = "Description";
            this.taskDescriptionColumn.FillsFreeSpace = true;
            this.taskDescriptionColumn.Text = "Description";
            this.taskDescriptionColumn.Width = 71;
            //
            // toolStrip1
            //
            this.toolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.addCategoryButton,
            this.addTaskButton});
            this.toolStrip1.Location = new System.Drawing.Point(0, 0);
            this.toolStrip1.Name = "toolStrip1";
            this.toolStrip1.Size = new System.Drawing.Size(964, 25);
            this.toolStrip1.TabIndex = 1;
            this.toolStrip1.Text = "toolStrip1";
            //
            // addCategoryButton
            //
            this.addCategoryButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
            this.addCategoryButton.Image = ((System.Drawing.Image)(resources.GetObject("addCategoryButton.Image")));
            this.addCategoryButton.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.addCategoryButton.Name = "addCategoryButton";
            this.addCategoryButton.Size = new System.Drawing.Size(98, 22);
            this.addCategoryButton.Text = "Add category";
            this.addCategoryButton.Click += new System.EventHandler(this.addCategoryButton_Click);
            //
            // addTaskButton
            //
            this.addTaskButton.Image = ((System.Drawing.Image)(resources.GetObject("addTaskButton.Image")));
            this.addTaskButton.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.addTaskButton.Name = "addTaskButton";
            this.addTaskButton.Size = new System.Drawing.Size(73, 22);
            this.addTaskButton.Text = "Add task";
            this.addTaskButton.Click += new System.EventHandler(this.addTaskButton_Click);
            //
            // splitContainer1
            //
            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
            this.splitContainer1.IsSplitterFixed = true;
            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
            this.splitContainer1.Name = "splitContainer1";
            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
            //
            // splitContainer1.Panel1
            //
            this.splitContainer1.Panel1.Controls.Add(this.toolStrip1);
            //
            // splitContainer1.Panel2
            //
            this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
            this.splitContainer1.Size = new System.Drawing.Size(964, 482);
            this.splitContainer1.SplitterDistance = 25;
            this.splitContainer1.TabIndex = 2;
            //
            // splitContainer2
            //
            this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
            this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
            this.splitContainer2.Location = new System.Drawing.Point(0, 0);
            this.splitContainer2.Name = "splitContainer2";
            //
            // splitContainer2.Panel1
            //
            this.splitContainer2.Panel1.Controls.Add(this.tasksTreeView);
            //
            // splitContainer2.Panel2
            //
            this.splitContainer2.Panel2.Controls.Add(this.CategoriesList);
            this.splitContainer2.Size = new System.Drawing.Size(964, 453);
            this.splitContainer2.SplitterDistance = 800;
            this.splitContainer2.TabIndex = 1;
            //
            // CategoriesList
            //
            this.CategoriesList.AllColumns.Add(this.CategoryColumn);
            this.CategoriesList.CellEditActivation = BrightIdeasSoftware.ObjectListView.CellEditActivateMode.DoubleClick;
            this.CategoriesList.CheckBoxes = true;
            this.CategoriesList.CheckedAspectName = "Visible";
            this.CategoriesList.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.CategoryColumn});
            this.CategoriesList.Dock = System.Windows.Forms.DockStyle.Fill;
            this.CategoriesList.HasCollapsibleGroups = false;
            this.CategoriesList.Location = new System.Drawing.Point(0, 0);
            this.CategoriesList.Name = "CategoriesList";
            this.CategoriesList.ShowGroups = false;
            this.CategoriesList.Size = new System.Drawing.Size(160, 453);
            this.CategoriesList.TabIndex = 0;
            this.CategoriesList.UseCompatibleStateImageBehavior = false;
            this.CategoriesList.View = System.Windows.Forms.View.Details;
            this.CategoriesList.CellRightClick += new System.EventHandler<BrightIdeasSoftware.CellRightClickEventArgs>(this.CategoriesList_CellRightClick);
            this.CategoriesList.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.CategoriesList_ItemChecked);
            //
            // CategoryColumn
            //
            this.CategoryColumn.AspectName = "Name";
            this.CategoryColumn.FillsFreeSpace = true;
            this.CategoryColumn.Groupable = false;
            this.CategoryColumn.Text = "Category";
            this.CategoryColumn.Width = 149;
            //
            // contextMenuItem
            //
            this.contextMenuItem.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.optionComplete,
            this.toolStripSeparator1,
            this.optionEdit,
            this.optionAdd,
            this.optionEditSubtasks,
            this.optionRemove});
            this.contextMenuItem.Name = "contextMenuStrip1";
            this.contextMenuItem.ShowImageMargin = false;
            this.contextMenuItem.Size = new System.Drawing.Size(126, 120);
            this.contextMenuItem.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuItem_Opening);
            //
            // optionComplete
            //
            this.optionComplete.Name = "optionComplete";
            this.optionComplete.Size = new System.Drawing.Size(125, 22);
            this.optionComplete.Text = "Complete task";
            this.optionComplete.Click += new System.EventHandler(this.optionComplete_Click);
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(122, 6);
            //
            // optionEdit
            //
            this.optionEdit.Name = "optionEdit";
            this.optionEdit.Size = new System.Drawing.Size(125, 22);
            this.optionEdit.Text = "Edit task";
            this.optionEdit.Click += new System.EventHandler(this.optionEdit_Click);
            //
            // optionAdd
            //
            this.optionAdd.Name = "optionAdd";
            this.optionAdd.Size = new System.Drawing.Size(125, 22);
            this.optionAdd.Text = "Add subtasks";
            this.optionAdd.Click += new System.EventHandler(this.optionAdd_Click);
            //
            // optionEditSubtasks
            //
            this.optionEditSubtasks.Name = "optionEditSubtasks";
            this.optionEditSubtasks.Size = new System.Drawing.Size(125, 22);
            this.optionEditSubtasks.Text = "Edit subtasks";
            this.optionEditSubtasks.Click += new System.EventHandler(this.optionEditSubtasks_Click);
            //
            // optionRemove
            //
            this.optionRemove.Name = "optionRemove";
            this.optionRemove.Size = new System.Drawing.Size(125, 22);
            this.optionRemove.Text = "Remove Task";
            this.optionRemove.Click += new System.EventHandler(this.optionRemove_Click);
            //
            // contextMenuCategories
            //
            this.contextMenuCategories.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.deleteToolStripMenuItem});
            this.contextMenuCategories.Name = "contextMenuCategories";
            this.contextMenuCategories.Size = new System.Drawing.Size(153, 48);
            //
            // deleteToolStripMenuItem
            //
            this.deleteToolStripMenuItem.Name = "deleteToolStripMenuItem";
            this.deleteToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
            this.deleteToolStripMenuItem.Text = "Delete";
            this.deleteToolStripMenuItem.Click += new System.EventHandler(this.deleteToolStripMenuItem_Click);
            //
            // Form1
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(964, 482);
            this.Controls.Add(this.splitContainer1);
            this.Name = "Form1";
            this.Text = "Simple Task Manager";
            ((System.ComponentModel.ISupportInitialize)(this.tasksTreeView)).EndInit();
            this.toolStrip1.ResumeLayout(false);
            this.toolStrip1.PerformLayout();
            this.splitContainer1.Panel1.ResumeLayout(false);
            this.splitContainer1.Panel1.PerformLayout();
            this.splitContainer1.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
            this.splitContainer1.ResumeLayout(false);
            this.splitContainer2.Panel1.ResumeLayout(false);
            this.splitContainer2.Panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
            this.splitContainer2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.CategoriesList)).EndInit();
            this.contextMenuItem.ResumeLayout(false);
            this.contextMenuCategories.ResumeLayout(false);
            this.ResumeLayout(false);

        }

        #endregion

        private BrightIdeasSoftware.TreeListView tasksTreeView;
        private BrightIdeasSoftware.OLVColumn taskNameColumn;
        private BrightIdeasSoftware.OLVColumn taskDescriptionColumn;
        private BrightIdeasSoftware.OLVColumn taskDeadlineColumn;
        private BrightIdeasSoftware.OLVColumn taskDurationColumn;
        private BrightIdeasSoftware.OLVColumn taskPercentageColumn;
        private System.Windows.Forms.ToolStrip toolStrip1;
        private System.Windows.Forms.SplitContainer splitContainer1;
        private System.Windows.Forms.ToolStripButton addTaskButton;
        private System.Windows.Forms.ContextMenuStrip contextMenuItem;
        private System.Windows.Forms.ToolStripMenuItem optionComplete;
        private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
        private System.Windows.Forms.ToolStripMenuItem optionEdit;
        private System.Windows.Forms.ToolStripMenuItem optionAdd;
        private System.Windows.Forms.ToolStripMenuItem optionEditSubtasks;
        private System.Windows.Forms.ToolStripMenuItem optionRemove;
        private System.Windows.Forms.SplitContainer splitContainer2;
        private BrightIdeasSoftware.ObjectListView CategoriesList;
        private BrightIdeasSoftware.OLVColumn CategoryColumn;
        private BrightIdeasSoftware.OLVColumn taskCategoryColumn;
        private System.Windows.Forms.ToolStripButton addCategoryButton;
        private System.Windows.Forms.ContextMenuStrip contextMenuCategories;
        private System.Windows.Forms.ToolStripMenuItem deleteToolStripMenuItem;
        private System.Windows.Forms.SaveFileDialog saveFileDialog;

    }
}


text:
import Snabbdom from '../../../src/index'

export default () => {
  return
Hello World

}


text:
using System.Collections.Generic;
using System.Web.Http;

namespace Apress.Recipes.WebApi
{
    [Authorize]
    public class TestController : ApiController
    {
        [Route("test")]
        public IEnumerable<string> Get()
        {
            return new[] { "value1", "value2" };
        }
    }
}


text:
package com.evolveum.midpoint.provisioning.ucf.api;

import java.beans.PropertyDescriptor;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.schema.PrismSchema;
import com.evolveum.midpoint.prism.schema.PrismSchemaImpl;
import com.evolveum.midpoint.schema.util.ConnectorTypeUtil;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.util.DOMUtil;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.XmlSchemaType;
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;

/**
 * @author semancik
 *
 */
public class UcfUtil {

	public static void addConnectorNames(ConnectorType connectorType, String frameworkPrefix, String bundle, String type, String version, ConnectorHostType hostType) {
		StringBuilder connectorName = new StringBuilder();
		connectorName.append(frameworkPrefix).append(" ");
		connectorName.append(type);
		connectorName.append(" v");
		connectorName.append(version);
		StringBuilder displayName = new StringBuilder(StringUtils.substringAfterLast(type, "."));
		if (hostType != null) {
			connectorName.append(" @");
			connectorName.append(hostType.getName());
			displayName.append(" @");
			displayName.append(hostType.getName());
		}
		connectorType.setName(new PolyStringType(connectorName.toString()));
		connectorType.setDisplayName(new PolyStringType(displayName.toString()));
	}

	public static PrismSchema getConnectorSchema(ConnectorType connectorType, PrismContext prismContext) throws SchemaException {
		XmlSchemaType xmlSchema = connectorType.getSchema();
		if (xmlSchema == null) {
			return null;
		}
		Element xsdElement = ObjectTypeUtil.findXsdElement(xmlSchema);
		if (xsdElement == null) {
			return null;
		}
		PrismSchema connectorSchema = PrismSchemaImpl.parse(xsdElement, true, connectorType.toString(), prismContext);
		return connectorSchema;
	}

	public static void setConnectorSchema(ConnectorType connectorType, PrismSchema connectorSchema) throws SchemaException {
		Document xsdDoc = connectorSchema.serializeToXsd();
		Element xsdElement = DOMUtil.getFirstChildElement(xsdDoc);
		ConnectorTypeUtil.setConnectorXsdSchema(connectorType, xsdElement);
	}

	public static PropertyDescriptor findAnnotatedProperty(Class<?> connectorClass, Class<? extends Annotation> annotationClass) {
		BeanWrapper connectorBean = new BeanWrapperImpl(connectorClass);
		return findAnnotatedProperty(connectorBean, annotationClass);
	}

	public static PropertyDescriptor findAnnotatedProperty(BeanWrapper connectorBean, Class<? extends Annotation> annotationClass) {
		for (PropertyDescriptor prop: connectorBean.getPropertyDescriptors()) {
			if (hasAnnotation(prop, annotationClass)) {
				return prop;
			}
		}
		return null;
	}

	public static boolean hasAnnotation(PropertyDescriptor prop, Class<? extends Annotation> annotationClass) {
		Method readMethod = prop.getReadMethod();
		if (readMethod != null && readMethod.getAnnotation(annotationClass) != null) {
			return true;
		}
		Method writeMethod = prop.getWriteMethod();
		if (writeMethod != null && writeMethod.getAnnotation(annotationClass) != null) {
			return true;
		}
		Class<?> propertyType = prop.getPropertyType();
		if (propertyType.isAnnotationPresent(annotationClass)) {
			return true;
		}
		return false;
	}

}


text:
package org.apache.apex.examples.parser.regexparser;

import com.datatorrent.api.DefaultOutputPort;
import com.datatorrent.api.InputOperator;
import com.datatorrent.common.util.BaseOperator;

/**
 * @since 3.8.0
 */
public class ServerLogGenerator extends BaseOperator implements InputOperator
{
  public transient DefaultOutputPort<byte[]> outputPort = new DefaultOutputPort<byte[]>();
  private int tupleRate = 10;
  private transient int tuplesEmmitedinWindow = 0;

  public int getTupleRate()
  {
    return tupleRate;
  }

  public void setTupleRate(int tupleRate)
  {
    this.tupleRate = tupleRate;
  }

  @Override
  public void emitTuples()
  {
    while (tuplesEmmitedinWindow < tupleRate) {
      String line = "2015-10-01T03:14:49.000-07:00 lvn-d1-dev DevServer[9876]: INFO: [EVENT][SEQ=248717]" +
          " 2015:10:01:03:14:49 101 sign-in_id=11111@psop.com ip_address=1.1.1.1  service_id=IP1234-NPB12345_00 " +
          "result=RESULT_SUCCESconsole_id=0000000138e91b4e58236bf32besdafasdfasdfasdfsadf  account_id=11111  platform=pik";
      outputPort.emit(line.getBytes());
      tuplesEmmitedinWindow++;
    }
    if (tuplesEmmitedinWindow == tupleRate) {
      String errorLine = "This is error line that will be emitted on the output port";
      outputPort.emit(errorLine.getBytes());
      tuplesEmmitedinWindow++;
    }
  }

  @Override
  public void endWindow()
  {
    tuplesEmmitedinWindow = 0;
    super.endWindow();
  }
}