text:
<application>
  <component name="TemplateSettings">
    <option name="deletedKeys">
      <list>
        <TemplateKey>
          <option name="groupName" value="Angular" />
          <option name="key" value="a-component" />
        </TemplateKey>
      </list>
    </option>
  </component>
</application>

redpajama_set_name: RedPajamaGithub


text:
package com.github.rvesse.airline.args.overrides;

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

import com.github.rvesse.airline.annotations.Arguments;
import com.github.rvesse.airline.annotations.Command;

@Command(name = "ArgsMergeAddition")
public class ArgsMergeAddition extends ArgsMergeParent {

    @Arguments
    public List<String> args = new ArrayList<>();
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.examstack.portal.persistence.TrainingMapper">

	<select id="getTrainingList" resultType="com.examstack.common.domain.training.Training">
		select a.training_id trainingId,a.training_name trainingName,a.training_desc trainingDesc,
		a.create_time createTime,a.creator creatorId,b.user_name creatorName,a.status,a.state_time stateTime,a.exp_time expTime,a.is_private privatee
		from et_training a,et_user b
		where a.creator=b.user_id
		and exists(select 1 from et_training_section c where c.training_id=a.training_id)
		order by a.create_time desc,a.state_time desc
	</select>

	<select id="getTrainingSectionByTrainingId" resultType="com.examstack.common.domain.training.TrainingSection">
		select section_id sectionId,section_name sectionName,section_desc sectionDesc,training_id trainingId,
		user_id userId,file_name fileName,file_path filePath,file_md5 fileMd5,file_type fileType from et_training_section
		where training_id=#{trainingId}
	</select>
	<select id="getTrainingSectionById" resultType="com.examstack.common.domain.training.TrainingSection">
		select a.section_id sectionId,a.section_name sectionName,a.section_desc sectionDesc,a.training_id trainingId,
		a.user_id userId,a.file_name fileName,a.file_path filePath,a.file_md5 fileMd5,a.file_type fileType,b.training_name trainingName from et_training_section a,et_training b
		where section_id=#{sectionId} and a.training_id=b.training_id
	</select>
	<select id="getTrainingHistBySectionId" resultType="com.examstack.common.domain.training.UserTrainingHistory">
		select training_id trainingId,section_id sectionId,user_id userId,duration,process,start_time startTime,last_state_time lastStateTime,
		user_training_detail userTrainingDetail from et_user_training_history where section_id=#{sectionId} and user_id=#{userId}
	</select>
	<insert id="setUserTrainingHistory" parameterType="com.examstack.common.domain.training.UserTrainingHistory">
		replace into et_user_training_history(training_id ,section_id ,user_id ,duration ,process ,start_time,last_state_time ,
		user_training_detail )values
		(#{trainingId},#{sectionId},#{userId},#{duration},#{process},#{startTime},#{lastStateTime},#{userTrainingDetail})
	</insert>

	<select id="getTrainingSectionProcessListByUserId" resultType="com.examstack.common.domain.training.TrainingSectionProcess">
		select b.training_name trainingName,a.section_id sectionId,a.section_name sectionName,a.section_desc sectionDesc,b.training_id trainingId,
		a.user_id userId,a.file_name fileName,a.file_path filePath,a.file_md5 fileMd5,a.file_type fileType,(select c.process from et_user_training_history c
		where c.user_id=#{userId} and c.section_id=a.section_id) process from et_training_section a,et_training b
		where a.training_id=b.training_id
	</select>
</mapper>


text:
To make sure the security between the interfaces of services, users can enable `RSA Authorizaiton` by simple configuration as below.

## Consumer Service

* Add dependence in pom.xml file:

  ```xml
  <dependency>
        <groupId>org.apache.servicecomb</groupId>
        <artifactId>handler-publickey-auth</artifactId>
   </dependency>
  ```

* Add handler chain in microservice.yaml:

  ```yaml
  cse:
    # other configurations omitted
    handler:
      chain:
        Consumer:
          default: auth-consumer
  ```

## Provider Service

* Add dependence in pom.xml file:

  ```xml
  <dependency>
        <groupId>org.apache.servicecomb</groupId>
        <artifactId>handler-publickey-auth</artifactId>
   </dependency>
  ```

* Add handler chain in microservice.yaml:

  ```yaml
  cse:
    # other configurations omitted
    handler:
      chain:
        Consumer:
          default: auth-provider
  ```

## Sample Quick Start

Auth sample use `RestTemplate` to present RSA communication between provider and consumer.

1. Start the ServiceComb/Service Center

   - [how to start the service center](http://servicecomb.incubator.apache.org/users/setup-environment/#)
   - make sure service center address is configured correctly in `microservice.yaml` file

   ```yaml
   cse:
     service:
       registry:
         address: http://127.0.0.1:30100		#service center address
   ```

2. Start the auth-provider service

   - Start provider service by maven

     Compile the source code at root directory of ServiceComb Java Chassis, which is `incubator-servicecomb-java-chassis/`, and use `mvn exec` to execute the main class `AuthProviderMain`.

     ```bash
     cd incubator-servicecomb-java-chassis/
     mvn clean install -Psamples -DskipTests			#only need to install at first time.
     cd samples/auth-sample/auth-provider/
     mvn exec:java -Dexec.mainClass="org.apache.servicecomb.samples.auth.provider.AuthProviderMain"
     ```

   - Start provider service by IDE

     Import the project by InteliJ IDEA or Eclipse, add sample module to pom.xml file in root module `incubator-servicecomb-java-chassis/pom.xml`, and add `<module>samples</module>` to `<modules></modules>` block, Then find `main` function `AuthProviderMain` of provider service and `RUN` it like any other Java program.

3. Start the auth-consumer service

   Just like how to start auth-provider service. But the main class of auth-consumer service is `AuthConsumerMain`.

   ```bash
   cd samples/auth-sample/auth-consumer/
   mvn exec:java -Dexec.mainClass="org.apache.servicecomb.samples.auth.consumer.AuthConsumerMain"
   ```

4. How to verify
   On the producer side, the output should contain the following stuffs if the producer starts up successfully:
   1. *'swagger: 2.0 info: version: 1.0.0 ...'* means the producer generated swagger contracts
   2. *'rest listen success. address=0.0.0.0:8080'* means the rest endpoint is listening on port 8080
   3. *'highway listen success. address=0.0.0.0:7070'* means the highway endpoint is listening on port 7070
   4. *'Register microservice instance success'* means the producer has registered successfully to service center

   On the consumer side, you can see the following outputs if the consumer can invoke the producer:
   1. *'Hello Authenticate'* means the consumer calls sayhi with name=Authenticate successfully
   2. *'Hello person ServiceComb/Authenticate'* means the consumer calls sayhello successfully


text:
//
//  RetypePayPasswordontroller.m
//  HuLaQuan
//
//  Created by li xun on 16/6/14.
//  Copyright © 2016年 yuwubao. All rights reserved.
//

#import "RetypePayPasswordontroller.h"
#import "FirstSetPayPasswordEngine.h"
#import "UserSecurityViewController.h"

@interface RetypePayPasswordontroller ()
@property (nonatomic,strong) FirstSetPayPasswordEngine *setPayPasswordEngine;

@end

@implementation RetypePayPasswordontroller
-(FirstSetPayPasswordEngine *)setPayPasswordEngine
{
    if (!_setPayPasswordEngine) {
        _setPayPasswordEngine = [[FirstSetPayPasswordEngine alloc] init];
    }
    return _setPayPasswordEngine;
}
-(NSString *)finish:(NSString *)pwd{
    ZLLog(@"retype %@",self.passwordAndInfos);
    if ([pwd isEqualToString:self.passwordAndInfos[@"password"]]) {

        [YuNetworkStatusUtilities showProgressMessage:NETWORK_LOADING];
        [self.setPayPasswordEngine setPayPassword:pwd];
    }else{

        [self clearPwd];
        [MBProgressHUD zl_showError:kPasswordRetypeNotEqual];
    }

    return pwd;
}

-(void)goBackAction{

    [self.navigationController popToViewController:self.navigationController.viewControllers[1] animated:YES];

}

-(NSString *)finish:(NSString *)pwd confirm:(BOOL)isConfirm
{
    return pwd;
}
#pragma mark - Call Back
- (void)SetPayPasswordFinish:(NSNotification*) notification
{

    [YuNetworkStatusUtilities dismissHUD];

    NSDictionary *messageDic = [notification object];//获取到传递的对象
    if ([messageDic[@"isSuccess"] boolValue]) {

        if ([self.navigationController.viewControllers[1] isKindOfClass:[UserSecurityViewController class]])
        {
            [self.navigationController popToViewController:self.navigationController.viewControllers[1] animated:YES];
        }

        [MBProgressHUD zl_showSuccess:@"修改成功"];
    }else{
        [self showNetWorkError:messageDic[@"message"]];

    }
}
#pragma mark - Life Cycle
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];

    // [self.navigationController setNavigationBarHidden:YES animated:YES];

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(SetPayPasswordFinish:) name:@"SetPayPasswordFinish" object:nil];

}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:YES];
    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"SetPayPasswordFinish" object:nil];

}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
using CoreBlog.Data.Context;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace WilderBlog.Data
{
    // to resolve migrations in class library
    public class Startup
    {
        private IConfigurationRoot config { get; }

        public Startup(IHostingEnvironment env)
        {
            var builder = new ConfigurationBuilder()
              .SetBasePath(env.ContentRootPath)
              .AddJsonFile("config.json", false, true)
              .AddEnvironmentVariables();

            config = builder.Build();

        }

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddSingleton(config);

            services.AddEntityFrameworkSqlServer()
              .AddDbContext<BlogContext>();
        }

        public void Configure(IApplicationBuilder app)
        {
            app.UseIdentity();
        }
    }
}


text:
#define REDISMODULE_EXPERIMENTAL_API
#define _XOPEN_SOURCE 700
#include "redismodule.h"
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <time.h>

#define UNUSED(x) (void)(x)

/* Reply callback for blocking command BLOCK.DEBUG */
int HelloBlock_Reply(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    UNUSED(argv);
    UNUSED(argc);
    int *myint = RedisModule_GetBlockedClientPrivateData(ctx);
    return RedisModule_ReplyWithLongLong(ctx,*myint);
}

/* Timeout callback for blocking command BLOCK.DEBUG */
int HelloBlock_Timeout(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    UNUSED(argv);
    UNUSED(argc);
    RedisModuleBlockedClient *bc = RedisModule_GetBlockedClientHandle(ctx);
    RedisModule_BlockedClientMeasureTimeEnd(bc);
    return RedisModule_ReplyWithSimpleString(ctx,"Request timedout");
}

/* Private data freeing callback for BLOCK.DEBUG command. */
void HelloBlock_FreeData(RedisModuleCtx *ctx, void *privdata) {
    UNUSED(ctx);
    RedisModule_Free(privdata);
}

/* The thread entry point that actually executes the blocking part
 * of the command BLOCK.DEBUG. */
void *BlockDebug_ThreadMain(void *arg) {
    void **targ = arg;
    RedisModuleBlockedClient *bc = targ[0];
    long long delay = (unsigned long)targ[1];
    long long enable_time_track = (unsigned long)targ[2];
    if (enable_time_track)
        RedisModule_BlockedClientMeasureTimeStart(bc);
    RedisModule_Free(targ);

    struct timespec ts;
    ts.tv_sec = delay / 1000;
    ts.tv_nsec = (delay % 1000) * 1000000;
    nanosleep(&ts, NULL);
    int *r = RedisModule_Alloc(sizeof(int));
    *r = rand();
    if (enable_time_track)
        RedisModule_BlockedClientMeasureTimeEnd(bc);
    RedisModule_UnblockClient(bc,r);
    return NULL;
}

/* The thread entry point that actually executes the blocking part
 * of the command BLOCK.DOUBLE_DEBUG. */
void *DoubleBlock_ThreadMain(void *arg) {
    void **targ = arg;
    RedisModuleBlockedClient *bc = targ[0];
    long long delay = (unsigned long)targ[1];
    RedisModule_BlockedClientMeasureTimeStart(bc);
    RedisModule_Free(targ);
    struct timespec ts;
    ts.tv_sec = delay / 1000;
    ts.tv_nsec = (delay % 1000) * 1000000;
    nanosleep(&ts, NULL);
    int *r = RedisModule_Alloc(sizeof(int));
    *r = rand();
    RedisModule_BlockedClientMeasureTimeEnd(bc);
    /* call again RedisModule_BlockedClientMeasureTimeStart() and
     * RedisModule_BlockedClientMeasureTimeEnd and ensure that the
     * total execution time is 2x the delay. */
    RedisModule_BlockedClientMeasureTimeStart(bc);
    nanosleep(&ts, NULL);
    RedisModule_BlockedClientMeasureTimeEnd(bc);

    RedisModule_UnblockClient(bc,r);
    return NULL;
}

void HelloBlock_Disconnected(RedisModuleCtx *ctx, RedisModuleBlockedClient *bc) {
    RedisModule_Log(ctx,"warning","Blocked client %p disconnected!",
        (void*)bc);
}

/* BLOCK.DEBUG <delay_ms> <timeout_ms> -- Block for <count> milliseconds, then reply with
 * a random number. Timeout is the command timeout, so that you can test
 * what happens when the delay is greater than the timeout. */
int HelloBlock_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    if (argc != 3) return RedisModule_WrongArity(ctx);
    long long delay;
    long long timeout;

    if (RedisModule_StringToLongLong(argv[1],&delay) != REDISMODULE_OK) {
        return RedisModule_ReplyWithError(ctx,"ERR invalid count");
    }

    if (RedisModule_StringToLongLong(argv[2],&timeout) != REDISMODULE_OK) {
        return RedisModule_ReplyWithError(ctx,"ERR invalid count");
    }

    pthread_t tid;
    RedisModuleBlockedClient *bc = RedisModule_BlockClient(ctx,HelloBlock_Reply,HelloBlock_Timeout,HelloBlock_FreeData,timeout);

    /* Here we set a disconnection handler, however since this module will
     * block in sleep() in a thread, there is not much we can do in the
     * callback, so this is just to show you the API. */
    RedisModule_SetDisconnectCallback(bc,HelloBlock_Disconnected);

    /* Now that we setup a blocking client, we need to pass the control
     * to the thread. However we need to pass arguments to the thread:
     * the delay and a reference to the blocked client handle. */
    void **targ = RedisModule_Alloc(sizeof(void*)*3);
    targ[0] = bc;
    targ[1] = (void*)(unsigned long) delay;
    // pass 1 as flag to enable time tracking
    targ[2] = (void*)(unsigned long) 1;

    if (pthread_create(&tid,NULL,BlockDebug_ThreadMain,targ) != 0) {
        RedisModule_AbortBlock(bc);
        return RedisModule_ReplyWithError(ctx,"-ERR Can't start thread");
    }
    return REDISMODULE_OK;
}

/* BLOCK.DEBUG_NOTRACKING <delay_ms> <timeout_ms> -- Block for <count> milliseconds, then reply with
 * a random number. Timeout is the command timeout, so that you can test
 * what happens when the delay is greater than the timeout.
 * this command does not track background time so the background time should no appear in stats*/
int HelloBlockNoTracking_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    if (argc != 3) return RedisModule_WrongArity(ctx);
    long long delay;
    long long timeout;

    if (RedisModule_StringToLongLong(argv[1],&delay) != REDISMODULE_OK) {
        return RedisModule_ReplyWithError(ctx,"ERR invalid count");
    }

    if (RedisModule_StringToLongLong(argv[2],&timeout) != REDISMODULE_OK) {
        return RedisModule_ReplyWithError(ctx,"ERR invalid count");
    }

    pthread_t tid;
    RedisModuleBlockedClient *bc = RedisModule_BlockClient(ctx,HelloBlock_Reply,HelloBlock_Timeout,HelloBlock_FreeData,timeout);

    /* Here we set a disconnection handler, however since this module will
     * block in sleep() in a thread, there is not much we can do in the
     * callback, so this is just to show you the API. */
    RedisModule_SetDisconnectCallback(bc,HelloBlock_Disconnected);

    /* Now that we setup a blocking client, we need to pass the control
     * to the thread. However we need to pass arguments to the thread:
     * the delay and a reference to the blocked client handle. */
    void **targ = RedisModule_Alloc(sizeof(void*)*3);
    targ[0] = bc;
    targ[1] = (void*)(unsigned long) delay;
    // pass 0 as flag to enable time tracking
    targ[2] = (void*)(unsigned long) 0;

    if (pthread_create(&tid,NULL,BlockDebug_ThreadMain,targ) != 0) {
        RedisModule_AbortBlock(bc);
        return RedisModule_ReplyWithError(ctx,"-ERR Can't start thread");
    }
    return REDISMODULE_OK;
}

/* BLOCK.DOUBLE_DEBUG <delay_ms> -- Block for 2 x <count> milliseconds,
 * then reply with a random number.
 * This command is used to test multiple calls to RedisModule_BlockedClientMeasureTimeStart()
 * and RedisModule_BlockedClientMeasureTimeEnd() within the same execution. */
int HelloDoubleBlock_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    if (argc != 2) return RedisModule_WrongArity(ctx);
    long long delay;

    if (RedisModule_StringToLongLong(argv[1],&delay) != REDISMODULE_OK) {
        return RedisModule_ReplyWithError(ctx,"ERR invalid count");
    }

    pthread_t tid;
    RedisModuleBlockedClient *bc = RedisModule_BlockClient(ctx,HelloBlock_Reply,HelloBlock_Timeout,HelloBlock_FreeData,0);

    /* Now that we setup a blocking client, we need to pass the control
     * to the thread. However we need to pass arguments to the thread:
     * the delay and a reference to the blocked client handle. */
    void **targ = RedisModule_Alloc(sizeof(void*)*2);
    targ[0] = bc;
    targ[1] = (void*)(unsigned long) delay;

    if (pthread_create(&tid,NULL,DoubleBlock_ThreadMain,targ) != 0) {
        RedisModule_AbortBlock(bc);
        return RedisModule_ReplyWithError(ctx,"-ERR Can't start thread");
    }
    return REDISMODULE_OK;
}

RedisModuleBlockedClient *blocked_client = NULL;

/* BLOCK.BLOCK [TIMEOUT] -- Blocks the current client until released
 * or TIMEOUT seconds. If TIMEOUT is zero, no timeout function is
 * registered.
 */
int Block_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    if (RedisModule_IsBlockedReplyRequest(ctx)) {
        RedisModuleString *r = RedisModule_GetBlockedClientPrivateData(ctx);
        return RedisModule_ReplyWithString(ctx, r);
    } else if (RedisModule_IsBlockedTimeoutRequest(ctx)) {
        RedisModule_UnblockClient(blocked_client, NULL); /* Must be called to avoid leaks. */
        blocked_client = NULL;
        return RedisModule_ReplyWithSimpleString(ctx, "Timed out");
    }

    if (argc != 2) return RedisModule_WrongArity(ctx);
    long long timeout;

    if (RedisModule_StringToLongLong(argv[1], &timeout) != REDISMODULE_OK) {
        return RedisModule_ReplyWithError(ctx, "ERR invalid timeout");
    }
    if (blocked_client) {
        return RedisModule_ReplyWithError(ctx, "ERR another client already blocked");
    }

    /* Block client. We use this function as both a reply and optional timeout
     * callback and differentiate the different code flows above.
     */
    blocked_client = RedisModule_BlockClient(ctx, Block_RedisCommand,
            timeout > 0 ? Block_RedisCommand : NULL, NULL, timeout);
    return REDISMODULE_OK;
}

/* BLOCK.IS_BLOCKED -- Returns 1 if we have a blocked client, or 0 otherwise.
 */
int IsBlocked_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    UNUSED(argv);
    UNUSED(argc);
    RedisModule_ReplyWithLongLong(ctx, blocked_client ? 1 : 0);
    return REDISMODULE_OK;
}

/* BLOCK.RELEASE [reply] -- Releases the blocked client and produce the specified reply.
 */
int Release_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    if (argc != 2) return RedisModule_WrongArity(ctx);
    if (!blocked_client) {
        return RedisModule_ReplyWithError(ctx, "ERR No blocked client");
    }

    RedisModuleString *replystr = argv[1];
    RedisModule_RetainString(ctx, replystr);
    RedisModule_UnblockClient(blocked_client, replystr);
    blocked_client = NULL;

    RedisModule_ReplyWithSimpleString(ctx, "OK");

    return REDISMODULE_OK;
}

int RedisModule_OnLoad(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    UNUSED(argv);
    UNUSED(argc);

    if (RedisModule_Init(ctx,"block",1,REDISMODULE_APIVER_1)
        == REDISMODULE_ERR) return REDISMODULE_ERR;

    if (RedisModule_CreateCommand(ctx,"block.debug",
        HelloBlock_RedisCommand,"",0,0,0) == REDISMODULE_ERR)
        return REDISMODULE_ERR;

    if (RedisModule_CreateCommand(ctx,"block.double_debug",
        HelloDoubleBlock_RedisCommand,"",0,0,0) == REDISMODULE_ERR)
        return REDISMODULE_ERR;

    if (RedisModule_CreateCommand(ctx,"block.debug_no_track",
        HelloBlockNoTracking_RedisCommand,"",0,0,0) == REDISMODULE_ERR)
        return REDISMODULE_ERR;

    if (RedisModule_CreateCommand(ctx, "block.block",
        Block_RedisCommand, "", 0, 0, 0) == REDISMODULE_ERR)
        return REDISMODULE_ERR;

    if (RedisModule_CreateCommand(ctx,"block.is_blocked",
        IsBlocked_RedisCommand,"",0,0,0) == REDISMODULE_ERR)
        return REDISMODULE_ERR;

    if (RedisModule_CreateCommand(ctx,"block.release",
        Release_RedisCommand,"",0,0,0) == REDISMODULE_ERR)
        return REDISMODULE_ERR;

    return REDISMODULE_OK;
}


text:
int main(int argc, const char* argv[]) {
  base::EnableTerminationOnHeapCorruption();
  if (argc <= 1) {
    fprintf(stderr, "flushes disk cache for files\n");
    fprintf(stderr, "usage: %s <filenames>\n", argv[0]);
    return 1;
  }

  for (int i = 1; i < argc; ++i) {
    std::wstring filename = base::SysNativeMBToWide(argv[i]);
    FilePath path = FilePath::FromWStringHack(filename);
    if (!file_util::EvictFileFromSystemCache(path)) {
      fprintf(stderr, "Failed to evict %s from cache -- is it a directory?\n",
              argv[i]);
    }
  }

  return 0;
}


text:
/**
 * Изображение маркера.
 *
 * @author dew1983@mail.ru <Suvorov Andrey M.>
 */

Ext.define(
	'FBEditor.view.panel.main.props.body.editor.div.marker.img.Img',
	{
		extend: 'FBEditor.view.panel.main.props.body.editor.img.Editor',
		requires: [
			'FBEditor.view.panel.main.props.body.editor.div.marker.img.ImgController'
		],

		xtype: 'panel-props-body-editor-marker-img',
		controller: 'panel.props.body.editor.marker.img',

		defaults: {
			xtype: 'textfield',
			labelAlign: 'top',
			checkChangeBuffer: 200,
			listeners: {
				change: function ()
				{
					this.up('panel-props-body-editor-div').fireEvent('change');
				}
			}
		},

		prefixName: 'marker-',

		updateData: function (data, isLoad)
		{
			var me = this,
				prefix = me.prefixName,
				prefixData = {},
				picture;

			//console.log('updateData', data, isLoad);

			data.src = data.src ? data.src : data.name;
			data.url = data.url ? data.url : data.src;
			data.name = data.name ? data.name : me.translateText.emptyImg;

			// проставляем префиксы
			Ext.Object.each(
				data,
				function (key, val)
				{
					prefixData[prefix + key] = val;
				}
			);

			me.getForm().setValues(prefixData);

			if (picture = me.getPicture())
			{
				picture.updateView({url: data.url});
			}
		}
	}
);


text:
load("test/mjsunit/wasm/wasm-constants.js");
load("test/mjsunit/wasm/wasm-module-builder.js");

(function() {
  "use asm";
  var builder = new WasmModuleBuilder();
  builder.addMemory(0, 5, true);
  builder.addFunction("regression_710844", kSig_v_v)
    .addBody([
        kExprI32Const, 0x03,
        kExprNop,
        kExprGrowMemory, 0x00,
        kExprI32Const, 0x13,
        kExprNop,
        kExprI32StoreMem8, 0x00, 0x10
        ]).exportFunc();
 let instance = builder.instantiate();
 instance.exports.regression_710844();
})();


text:
static const uint8 kMaxFingerprintSize = 16;
// The maximum percentage in difference allowed per bucket when comparing two
// fingerprints.
static const uint8 kMaxFingerprintBucketDiff = 5;
// The maximum percentage of different size words across all buckets.
static const uint8 kMaxFingerprintTotalDiff = 3;
// The maximum allowed of times a bucket comparison fail is accepted.
static const uint8 kMaxFingerprintBucketFails = 3;

namespace plusfish {

// A fuzzy HTML fingerprinter that bases equalness on word size distribution.
// The more words from a document are fed; the more accurate the comparison will
// be.
//
// The goal of this fingerprinter is to determine if documents look similar
// while allowing differences to exist. It is intentially simplistic for low
// memory consumption and high performance.
//
// Based on the skipfish fingerprint implementation.

class HtmlFingerprint {
 public:
  HtmlFingerprint();
  ~HtmlFingerprint() {}

  // Returns the array containing the counters per word size.
  const uint32_t* GetWordSizeCnt() const { return word_size_cnt_; }

  // Compare against the given fingerprint and returns true if they are similar
  // enough.
  bool Equals(const HtmlFingerprint& fp);
  // Add a word to the fingerprint.
  void AddWord(const std::string& word);
  // Output the bucket values into the string "output".
  void ToString(std::string* output) const;

 private:
  uint32_t word_size_cnt_[kMaxFingerprintSize];

  DISALLOW_COPY_AND_ASSIGN(HtmlFingerprint);
};

}  // namespace plusfish

#endif  // THIRD_PARTY_PLUSFISH_UTIL_HTML_FINGERPRINT_H_


text:
namespace dotnetlint.Rules
{
    public enum RuleDispostion
    {
        Unknown,
        Warning,
        Error
    }
}


text:
"""Helpers to construct an inner enviromment from a config."""

from dm_construction.environments import connecting
from dm_construction.environments import covering
from dm_construction.environments import marble_run
from dm_construction.environments import silhouette
from dm_construction.unity import docker
from dm_construction.unity import environment
from dm_construction.wrappers import continuous_absolute
from dm_construction.wrappers import discrete_relative

_TASK_CLASSES = {
    "connecting": connecting.ConstructionConnecting,
    "covering_hard": covering.ConstructionCoveringHard,
    "covering": covering.ConstructionCovering,
    "marble_run": marble_run.ConstructionMarbleRun,
    "silhouette": silhouette.ConstructionSilhouette
}
ALL_TASKS = sorted(_TASK_CLASSES.keys())

_WRAPPER_CLASSES = {
    "continuous_absolute": continuous_absolute.ContinuousAbsoluteImageWrapper,
    "discrete_relative": discrete_relative.DiscreteRelativeGraphWrapper
}
ALL_WRAPPERS = sorted(_WRAPPER_CLASSES.keys())

_LOADERS = {
    "docker": docker.loader,
}
_DEFAULT_LOADER = "docker"

def get_unity_environment(backend=_DEFAULT_LOADER, **config):
  return environment.UnityConstructionEnv(loader=_LOADERS[backend], **config)

def get_task_environment(unity_environment, problem_type, **env_kwargs):
  """Returns a configured instance of a task environment."""
  env_cls = _TASK_CLASSES[problem_type]
  task_env = env_cls(unity_environment=unity_environment, **env_kwargs)
  return task_env

def get_wrapped_environment(task_environment, wrapper_type):
  """Wraps the environment with appropriate observations and actions."""
  wrapper_cls = _WRAPPER_CLASSES[wrapper_type]
  wrapped_environment = wrapper_cls(task_environment)
  return wrapped_environment

def get_environment(
    problem_type, unity_environment=None, wrapper_type="discrete_relative",
    unity_backend=_DEFAULT_LOADER, **env_kwargs):
  """Returns fully configured and wrapped environments."""
  if not unity_environment:
    unity_environment = get_unity_environment(backend=unity_backend)
  task_environment = get_task_environment(
      unity_environment, problem_type, **env_kwargs)
  agent_environment = get_wrapped_environment(task_environment, wrapper_type)
  return agent_environment


text:
<?php
namespace Cassandra\Response;
use Cassandra\Protocol\Frame;

class Response implements Frame{
	/**
	 * @var array
	 */
	protected $_header;

	/**
	 * @var
	 */
	protected $_stream;

	/**
	 *
	 * @param array $header
	 * @param $stream
	 */
	public function __construct($header, $stream){
		$this->_header = $header;

		$this->_stream = $stream;
	}

	public function getVersion(){
		return $this->_header['version'];
	}

	public function getFlags(){
		return $this->_header['flags'];
	}

	public function getStream(){
		return $this->_header['stream'];
	}

	public function getOpcode(){
		return $this->_header['opcode'];
	}

	public function getBody(){
		return $this->_stream;
	}
}


text:
/*!
 @file    AgentPropertyManipulator.h
 @brief    Classes for manipulating agent properties in an "undoable" manner (albeit, to a limited
          degree).
 */

#ifndef __AGENT_PROPERTY_MANIPULATOR_H__
#define __AGENT_PROPERTY_MANIPULATOR_H__

#include "MengeCore/BFSM/FSMEnumeration.h"
#include "MengeCore/PluginEngine/Element.h"
#include "MengeCore/Runtime/SimpleLock.h"
#include "MengeCore/mengeCommon.h"

#include <map>

namespace Menge {
// Forward declarations
namespace Agents {
class BaseAgent;
}

/*!
 @brief    Helper function for parsing property actions

 It converts the xml string indicating the property to an enumerated value

 @param     opName    The name of the operand as specified in the xml specification.
 @returns   The corresponding enumeration.  If there is no corresponding enumeration, NO_PROPERTY is
            returned.
 */
MENGE_API BFSM::PropertyOperand parsePropertyName(const std::string& opName);

/////////////////////////////////////////////////////////////////////

/*!
 @brief    Base class for manipulating agent properties in an undoable manner.

 The undo is limited, it only maintains knowledge of one manipulation. If multiple manipulations
 are applied, only the last can be undone.
 */
class MENGE_API AgentPropertyManipulator : public Element {
 public:
  /*!
   @brief    Constructor.
   */
  AgentPropertyManipulator();

 protected:
  /*!
   @brief    Virtual destructor.
   */
  virtual ~AgentPropertyManipulator();

 public:
  /*!
   @brief   Applies the manipulation to the given agent, storing the previous state for
            restoration.

   @param    agent    The agent to manipulate.
   */
  void manipulate(Agents::BaseAgent* agent);

  /*!
   @brief    Restores the agent's previous value.

   If there is no previous value for the provided agent, nothing happens.

   @param    agent    The agent whose property value should be restored.
   */
  void restore(Agents::BaseAgent* agent);

  /*!
   @brief    Sets the generator for the manipulator.

   @param    gen    The generator to assign to this manipulator. Any previous generator will be
                    destroyed and it is assumed that the generator is *not* shared with any other
                    entity.
   */
  void setGenerator(Math::FloatGenerator* gen);

  /*!
   @brief    Sets the property operand.

   @param    prop    The property to operate on.
   */
  void setProperty(BFSM::PropertyOperand prop) { _property = prop; }

 protected:
  /*!
   @brief    Computes the new property value given the original property value.

   @param    value      The original value of the property.
   @param    agentID    The identifier for the agent.
   @returns  The new value.
   */
  virtual float newValue(float value, size_t agentID) = 0;

  /*!
   @brief    The generator for determining the operand value.
   */
  Math::FloatGenerator* _operandGen;

  /*!
   @brief    The property to operate on.
   */
  BFSM::PropertyOperand _property;

  /*!
   @brief    A mapping from agent id to the agent's property value before the action was applied.
   */
  std::map<size_t, float> _originalMap;

  /*!
   @brief    Lock for guaranteeing thread-safety.
   */
  SimpleLock _lock;
};

/////////////////////////////////////////////////////////////////////

/*!
 @brief    Modifies a particular agent property based by explicitly setting the property value from
          a distribution.
 */
class MENGE_API SetPropertyManipulator : public AgentPropertyManipulator {
 protected:
  /*!
   @brief    Computes the new property value given the original property value.

   @param    value      The original value of the property.
   @param    agentID    The identifier for the agent.
   @returns  The new value.
   */
  virtual float newValue(float value, size_t agentID);
};

/////////////////////////////////////////////////////////////////////

/*!
 @brief    Modifies a particular agent property based by adding the value from a distribution to the
          original agent parameter value.
 */
class MENGE_API OffsetPropertyManipulator : public AgentPropertyManipulator {
 protected:
  /*!
   @brief    Computes the new property value given the original property value.

   @param    value      The original value of the property.
   @param    agentID    The identifier for the agent.
   @returns  The new value.
   */
  virtual float newValue(float value, size_t agentID);
};

/////////////////////////////////////////////////////////////////////

/*!
 @brief    Modifies a particular agent property based by multiplying the value from a distribution
          to the original agent parameter value.
 */
class MENGE_API ScalePropertyManipulator : public AgentPropertyManipulator {
 protected:
  /*!
   @brief    Computes the new property value given the original property value.

   @param    value      The original value of the property.
   @param    agentID    The identifier for the agent.
   @returns  The new value.
   */
  virtual float newValue(float value, size_t agentID);
};

}  // namespace Menge
#endif  // __AGENT_PROPERTY_MANIPULATOR_H__


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('Blog', '0002_post_permalink'),
    ]

    operations = [
        migrations.AlterField(
            model_name='post',
            name='publication_date',
            field=models.DateTimeField(),
            preserve_default=True,
        ),
    ]


text:
#ifndef ICON_PANEL_H
#define ICON_PANEL_H

#include <String.h>
#include <SupportDefs.h>
#include <View.h>

// Taken from /src/kits/tracker/InfoWindow.cpp (line 192)
const float kBorderMargin = 15.0f;
const float kBorderWidth = 32.0f;

const float kIconHorizOffset = 18.0f;
const float kIconVertOffset = 6.0f;

const rgb_color kDarkBorderColor = { 184, 184, 184, 255 };

class IconPanel : public BView {
public:
	IconPanel(BString const &icon);

	void Draw(BRect updateRect);
private:
	BString fIconName;
	BBitmap *fIcon;
};

#endif // ICON_PANEL_H


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

#include "mscorlib_System_Collections_Generic_EqualityCompar3940363287.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.Collections.Generic.GenericEqualityComparer`1<System.Boolean>
struct  GenericEqualityComparer_1_t3436968950  : public EqualityComparer_1_t3940363287
{
public:

public:
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
package com.ruesga.rview.gerrit.model;

public enum IgnoreWhitespaceType {
    NONE, TRAILING, CHANGED, ALL
}


text:
#ifndef LD_LEVELDOWN_H
#define LD_LEVELDOWN_H

#include <node.h>
#include <node_buffer.h>
#include <leveldb/slice.h>

#include "nan.h"

static inline size_t StringOrBufferLength(v8::Local<v8::Value> obj) {
  return node::Buffer::HasInstance(obj->ToObject())
    ? node::Buffer::Length(obj->ToObject())
    : obj->ToString()->Utf8Length();
}

// NOTE: this MUST be called on objects created by
// LD_STRING_OR_BUFFER_TO_SLICE
static inline void DisposeStringOrBufferFromSlice(
        v8::Persistent<v8::Object> &handle
      , leveldb::Slice slice) {

  if (!node::Buffer::HasInstance(NanPersistentToLocal(handle)->Get(NanSymbol("obj"))))
    delete[] slice.data();
  NanDispose(handle);
}

static inline void DisposeStringOrBufferFromSlice(
        v8::Local<v8::Object> handle
      , leveldb::Slice slice) {

  if (!node::Buffer::HasInstance(handle))
    delete[] slice.data();
}

#define LD_CB_ERR_IF_NULL_OR_UNDEFINED(thing, name)                            \
  if (thing->IsNull() || thing->IsUndefined()) {                               \
    LD_RETURN_CALLBACK_OR_ERROR(callback, #name " cannot be `null` or `undefined`") \
  }

// NOTE: must call DisposeStringOrBufferFromSlice() on objects created here
#define LD_STRING_OR_BUFFER_TO_SLICE(to, from, name)                           \
  size_t to ## Sz_;                                                            \
  char* to ## Ch_;                                                             \
  if (node::Buffer::HasInstance(from->ToObject())) {                           \
    to ## Sz_ = node::Buffer::Length(from->ToObject());                        \
    if (to ## Sz_ == 0) {                                                      \
      LD_RETURN_CALLBACK_OR_ERROR(callback, #name " cannot be an empty Buffer") \
    }                                                                          \
    to ## Ch_ = node::Buffer::Data(from->ToObject());                          \
  } else {                                                                     \
    v8::Local<v8::String> to ## Str = from->ToString();                        \
    to ## Sz_ = to ## Str->Utf8Length();                                       \
    if (to ## Sz_ == 0) {                                                      \
      LD_RETURN_CALLBACK_OR_ERROR(callback, #name " cannot be an empty String") \
    }                                                                          \
    to ## Ch_ = new char[to ## Sz_];                                           \
    to ## Str->WriteUtf8(                                                      \
        to ## Ch_                                                              \
      , -1                                                                     \
      , NULL, v8::String::NO_NULL_TERMINATION                                  \
    );                                                                         \
  }                                                                            \
  leveldb::Slice to(to ## Ch_, to ## Sz_);

#define LD_RETURN_CALLBACK_OR_ERROR(callback, msg)                             \
  if (!callback.IsEmpty() && callback->IsFunction()) {                         \
    v8::Local<v8::Value> argv[] = {                                            \
      v8::Local<v8::Value>::New(v8::Exception::Error(                          \
        v8::String::New(msg))                                                  \
      )                                                                        \
    };                                                                         \
    LD_RUN_CALLBACK(callback, argv, 1)                                         \
    NanReturnUndefined();                                                      \
  }                                                                            \
  return NanThrowError(msg);

#define LD_RUN_CALLBACK(callback, argv, length)                                \
  v8::TryCatch try_catch;                                                      \
  callback->Call(v8::Context::GetCurrent()->Global(), length, argv);           \
  if (try_catch.HasCaught()) {                                                 \
    node::FatalException(try_catch);                                           \
  }

/* LD_METHOD_SETUP_COMMON setup the following objects:
 *  - Database* database
 *  - v8::Local<v8::Object> optionsObj (may be empty)
 *  - v8::Persistent<v8::Function> callback (won't be empty)
 * Will throw/return if there isn't a callback in arg 0 or 1
 */
#define LD_METHOD_SETUP_COMMON(name, optionPos, callbackPos)                   \
  if (args.Length() == 0)                                                      \
    return NanThrowError(#name "() requires a callback argument");             \
  leveldown::Database* database =                                              \
    node::ObjectWrap::Unwrap<leveldown::Database>(args.This());                \
  v8::Local<v8::Object> optionsObj;                                            \
  v8::Local<v8::Function> callback;                                            \
  if (optionPos == -1 && args[callbackPos]->IsFunction()) {                    \
    callback = args[callbackPos].As<v8::Function>();                           \
  } else if (optionPos != -1 && args[callbackPos - 1]->IsFunction()) {         \
    callback = args[callbackPos - 1].As<v8::Function>();                       \
  } else if (optionPos != -1                                                   \
        && args[optionPos]->IsObject()                                         \
        && args[callbackPos]->IsFunction()) {                                  \
    optionsObj = args[optionPos].As<v8::Object>();                             \
    callback = args[callbackPos].As<v8::Function>();                           \
  } else {                                                                     \
    return NanThrowError(#name "() requires a callback argument");             \
  }

#define LD_METHOD_SETUP_COMMON_ONEARG(name) LD_METHOD_SETUP_COMMON(name, -1, 0)

#endif


text:
import resources from '../configs/resources';

test('resources has the required properties', () => {
  //   expect(resources).toHaveProperty('webmap');
  expect(resources).toHaveProperty('title');
  expect(resources).toHaveProperty('language');

  expect(resources).not.toHaveProperty('Lucas');

  //   if (resources.useAlternativeLanguage) {
  //     expect(resources).toHaveProperty('alternativeLanguage');
  //     expect(resources.alternativeLanguage).toBeDefined();
  //     expect(resources.alternativeLanguage).toBeTruthy();
  //   }

  //   if (resources.initialExtent) {
  //     const { initialExtent } = resources;
  //     expect(typeof resources.initialExtent).toBe('object');
  //     expect(resources.initialExtent).toHaveProperty('x');
  //     expect(resources.initialExtent).toHaveProperty('y');
  //     expect(resources.initialExtent).toHaveProperty('z');

  //     if (initialExtent.x && initialExtent.y && initialExtent.z) {
  //       expect(typeof resources.initialExtent.x).toBe('number');
  //       expect(typeof resources.initialExtent.y).toBe('number');
  //       expect(typeof resources.initialExtent.z).toBe('number');

  //       expect(resources.initialExtent.x).toBeGreaterThanOrEqual(-180);
  //       expect(resources.initialExtent.x).toBeLessThan(180);

  //       expect(resources.initialExtent.y).toBeGreaterThanOrEqual(-90);
  //       expect(resources.initialExtent.y).toBeLessThan(90);

  //       expect(resources.initialExtent.z).toBeGreaterThanOrEqual(1);
  //       expect(resources.initialExtent.z).toBeLessThan(21);
  //     }

  //   }

  //   if (resources.includeCartoTemplateLayers) {
  //     expect(resources).toHaveProperty('cartoTemplateId');
  //     expect(resources).toHaveProperty('cartoApiKey');
  //     expect(resources).toHaveProperty('cartoGroupLabel');
  //     expect(resources.cartoGroupLabel).toHaveProperty(resources.language);
  //   }

  //   expect(resources).toHaveProperty('layerPanel');
  //   expect(resources).toHaveProperty('layerPanel.GROUP_WEBMAP');
  //   expect(resources).toHaveProperty('layerPanel.GROUP_WEBMAP.label');
  //   expect(resources).toHaveProperty('layerPanel.GROUP_WEBMAP.layers');
  //   expect(resources.layerPanel.GROUP_WEBMAP.layers).toBeInstanceOf(Array);
  //   expect(resources.layerPanel.GROUP_WEBMAP.layers).toHaveLength(0);

  //   expect(resources).toHaveProperty('layerPanel.GROUP_BASEMAP'); //same thing
  //   expect(resources).toHaveProperty('layerPanel.GROUP_BASEMAP.layers');
  //   expect(resources.layerPanel.GROUP_BASEMAP.layers).toBeInstanceOf(Array);

  //   expect(resources).toHaveProperty('layerPanel.extraLayers');
  //   expect(resources.layerPanel.extraLayers).toBeInstanceOf(Array); //gets concat'ed somewhere!
});

describe('resources layer spec', () => {
  const layerPanelKeys = Object.keys(resources.layerPanel).filter(
    g => g !== 'GROUP_BASEMAP' && g !== 'GROUP_WEBMAP' && g !== 'extraLayers'
  );
  const allLayers = layerPanelKeys
    .map(k => resources.layerPanel[k].layers)
    .reduce((acc, current) => [...acc, ...current], []);

  allLayers.forEach(layer => {
    if (layer.type === 'wms') {
      it('has a layerName property if it is a WMSLayer', () => {
        expect(layer).toHaveProperty('layerName');
        expect(typeof layer.layerName).toBe('string');
      });
    }
    if (layer.type !== 'remoteDataLayer') {
      it(`layer ${layer.id} has the required properties`, () => {
        if (layer.type !== 'imagery' && !layer.versions) {
          expect(layer).toHaveProperty('url');
        }
        expect(layer).toHaveProperty('id');
        expect(layer).toHaveProperty('type');
        expect(layer).toHaveProperty('label');
        expect(layer.label).toHaveProperty(resources.language);
        if (layer.filterField) {
          expect(
            layer.type === 'feature' || layer.type === 'dynamic'
          ).toBeTruthy();
          expect(layer).toHaveProperty('url');
          expect(typeof layer.filterField).toBe('object');
          expect(layer).toHaveProperty('filterLabel');
          expect(typeof layer.filterLabel).toBe('object');
        }
      });
    } else {
      if (layer.versions) {
        expect(typeof layer.versions).toBe('array');
        layer.versions.forEach(version => {
          expect(version).toHaveProperty('url');
          expect(version).toHaveProperty('label');
        });
      }
      expect(layer).toHaveProperty('order');
      expect(layer).toHaveProperty('type');
      expect(layer).toHaveProperty('uuid');
    }
  });

  resources.layerPanel.GROUP_BASEMAP.layers.forEach(layer => {
    it(`the ${layer.id} basemap layer has the properties we need`, () => {
      expect(layer).toHaveProperty('id');
      expect(layer).toHaveProperty('thumbnailUrl');
    });
  });
});


text:
package geometricconvexhull;

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

import org.apache.spark.SparkConf;
import org.apache.spark.api.java.JavaRDD;
import org.apache.spark.api.java.JavaSparkContext;
import org.apache.spark.api.java.function.Function;
import common.Point;
import common.Settings;
import common.Utils;

public class ConvexHull {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		String inp = "convexhull_inpl"; //in HDFS
		String outp = "closest_out_" + Utils.getEpochTick();
		buildHull(inp, outp);

	}

	public static boolean buildHull(String rectanglesFilePath, String ouputFilePath) {

		SparkConf conf = new SparkConf().setAppName("Closest Pair Module");
		JavaSparkContext sc = new JavaSparkContext(conf);
		boolean result = quickHullHelper(rectanglesFilePath, ouputFilePath, sc);

		sc.close();
		return result;
	}

	private static boolean quickHullHelper(String pointsFilePath, String ouputFilePath, JavaSparkContext sc)
		{
		try {
			JavaRDD<String> pointStrings = sc.textFile(pointsFilePath);
			if (Settings.D)
				Utils.Log("Fetched Points");

			// Typecast Points
			JavaRDD<Point> pointsRDD = pointStrings.map(new Function<String, Point>() {
				/**
				 *
				 */
				private static final long serialVersionUID = 1L;

				public Point call(String s) {
					Float[] nums = Utils.splitStringToFloat(s, ",");
					return new Point(nums[0], nums[1]);
				}
			}).cache();
			if (Settings.D)
				Utils.Log("Created Point Objects");
			if (Settings.D)
				Utils.Log("First Point: " + pointsRDD.first());

			JavaRDD<List<Point>> listRDD = pointsRDD.glom();

			JavaRDD<List<Point>> pairs = listRDD.map(new Function<List<Point>,List<Point>>() {

				/**
				 *
				 */
				private static final long serialVersionUID = 1L;

				public List<Point> call(List<Point> points) throws Exception {
					// TODO Auto-generated method stub
					ArrayList<Point> convexHull = new ArrayList<Point>();
					if(points.size() < 3)
						return points;
					int minPoint = -1,maxPoint = -1;
					float minX = Integer.MAX_VALUE , maxX = Integer.MIN_VALUE;

					for (int i = 0; i< points.size();i++) {
						Point pxy = points.get(i);
						if(pxy.getXcoordinate() < minX)
						{
							minX = pxy.getXcoordinate();
							minPoint = i;
						}
						if(pxy.getXcoordinate() > maxX){
							maxX = pxy.getXcoordinate();
							maxPoint = i;
						}
					}

					Point A = new Point(points.get(minPoint).getXcoordinate(),points.get(minPoint).getYcoordinate());
					Point B = new Point(points.get(maxPoint).getXcoordinate(),points.get(maxPoint).getYcoordinate());

					convexHull.add(A);
					convexHull.add(B);
					points.remove(A);
					points.remove(B);

					ArrayList<Point> leftSet = new ArrayList<Point>();
					ArrayList<Point> rightSet = new ArrayList<Point>();

					for(int i = 0;i< points.size();i++){
						Point p = points.get(i);
						if( p.getDistance(A, B, p) == -1)
							leftSet.add(p);
						else
							rightSet.add(p);
					}

					hullSet(A,B,rightSet,convexHull);
					hullSet(A,B,leftSet,convexHull);

					return convexHull;
				}});
			if (Settings.D)
			Utils.Log("Convex Hull First" + pairs.first());

			pairs.map(new Function<List<Point>, String>() {

				/**
				 *
				 */
				private static final long serialVersionUID = 1L;

				public String call(List<Point> t) throws Exception {
					// TODO Auto-generated method stub
					return t.toString();
				}
			}).saveAsTextFile(ouputFilePath);

			Utils.Log("Done!");

			return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}

	public static void hullSet(Point A,Point B,ArrayList<Point> set,ArrayList<Point> hull){
		int insertPosition = hull.indexOf(B);

		if(set.size() == 0)
			return;

		if(set.size() == 1)
		{
			Point p = set.get(0);
			set.remove(p);
			hull.add(insertPosition, p);
			return;
		}

		float dist = Integer.MIN_VALUE;
		int furthestPoint = -1;

		for(int i =0;i<set.size();i++){
			Point p = set.get(i);
			float distance = p.getDist(A, B, p);
			if(distance> dist)
			{	dist = distance;
				furthestPoint = i;
			}
		}

		Point P = set.get(furthestPoint);
		set.remove(furthestPoint);
		hull.add(insertPosition,P);

		ArrayList<Point> leftSetAP = new ArrayList<Point>();
		for(int i = 0; i < set.size() ; i++){
			Point M = set.get(i);
			if( A.getDistance(A, B, M) == 1){
				leftSetAP.add(M);
			}

		}

		ArrayList<Point> leftSetPB = new ArrayList<Point>();
		for(int i = 0; i< set.size();i++){
			Point M = set.get(i);
			if(M.getDistance(A, B, M) == 1)
				leftSetPB.add(M);
		}

		hullSet(A,P,leftSetAP,hull);
		hullSet(P,B,leftSetPB,hull);
	}
}


text:
from django.contrib.admin import widgets as admin_widgets
from django.db import models
from django.forms.fields import CharField
from django.utils.safestring import mark_safe

from .html import clean_html
from .widgets import TextEditorWidget

class HTMLFormField(CharField):

    widget = TextEditorWidget

    def __init__(self, *args, **kwargs):
        conf = kwargs.pop('configuration', None)

        if conf:
            widget = TextEditorWidget(configuration=conf)
        else:
            widget = None
        kwargs.setdefault('widget', widget)
        super(HTMLFormField, self).__init__(*args, **kwargs)

    def clean(self, value):
        value = super(HTMLFormField, self).clean(value)
        clean_value = clean_html(value, full=False)

        # We `mark_safe` here (as well as in the correct places) because Django
        # Parler cache's the value directly from the in-memory object as it
        # also stores the value in the database. So the cached version is never
        # processed by `from_db_value()`.
        clean_value = mark_safe(clean_value)

        return clean_value

class HTMLField(models.TextField):

    def __init__(self, *args, **kwargs):
        # This allows widget configuration customization
        # from the model definition
        self.configuration = kwargs.pop('configuration', None)
        super(HTMLField, self).__init__(*args, **kwargs)

    def from_db_value(self, value, expression, connection, context=None):
        if value is None:
            return value
        return mark_safe(value)

    def to_python(self, value):
        # On Django >= 1.8 a new method
        # was introduced (from_db_value) which is called
        # whenever the value is loaded from the db.
        # And to_python is called for serialization and cleaning.
        # This means we don't need to add mark_safe on Django >= 1.8
        # because it's handled by (from_db_value)
        if value is None:
            return value
        return value

    def formfield(self, **kwargs):
        if self.configuration:
            widget = TextEditorWidget(configuration=self.configuration)
        else:
            widget = TextEditorWidget

        defaults = {
            'form_class': HTMLFormField,
            'widget': widget,
        }
        defaults.update(kwargs)

        # override the admin widget
        if defaults['widget'] == admin_widgets.AdminTextareaWidget:
            defaults['widget'] = widget
        return super(HTMLField, self).formfield(**defaults)

    def clean(self, value, model_instance):
        # This needs to be marked safe as well because the form field's
        # clean method is not called on model.full_clean()
        value = super(HTMLField, self).clean(value, model_instance)
        return mark_safe(clean_html(value, full=False))


text:
RSpec.describe Magick::Pixel, '#blue' do
  it 'works' do
    pixel = described_class.from_color('brown')

    expect { pixel.blue = 123 }.not_to raise_error
    expect(pixel.blue).to eq(123)
    expect { pixel.blue = 255.25 }.not_to raise_error
    expect(pixel.blue).to eq(255)
    expect { pixel.blue = 'x' }.to raise_error(TypeError)
  end
end