text:
'use strict';

angular.module('datafestApp')
  .factory('polygons', function () {

    var paintPolyLine = function(p_path) {

            var flightPlanCoordinates = [];

            for (i = 0; i < p_path.length; i++) {
                flightPlanCoordinates.push(new google.maps.LatLng(p_path[i][1], p_path[i][0]));
            }

            if (polyline) {
                polyline.setMap(null);
            }

            polyline = new google.maps.Polyline({
                path: flightPlanCoordinates,
                geodesic: true,
                strokeColor: '#FF0000',
                strokeOpacity: 1.0,
                strokeWeight: 2
            });

            polyline.setMap($rootScope.map);

            zoomToObject(polyline);

            function zoomToObject(obj) {
                debugger;
                var bounds = new google.maps.LatLngBounds();
                var points = obj.getPath().getArray();
                for (var n = 0; n < points.length; n++) {
                    bounds.extend(points[n]);
                }
                $rootScope.map.fitBounds(bounds);
            }

        }

     var _paintPolygons = function(p_polygons) {

            angular.forEach(p_polygons.features, function(value, key) {

                var triangleCoords = [];

                for (var j = 0; j < value.geometry.rings[0].length; j++) {
                    triangleCoords.push(new google.maps.LatLng(value.geometry.rings[0][j][1], value.geometry.rings[0][j][0]));
                }

                // Construct the polygon.
                var bermudaTriangle = new google.maps.Polygon({
                    paths: triangleCoords,
                    strokeColor: '#FF0000',
                    strokeOpacity: 0.8,
                    strokeWeight: 2,
                    fillColor: '#FF0000',
                    fillOpacity: 0.35
                });

                bermudaTriangle.setMap($rootScope.map);

            });

            // Define the LatLng coordinates for the polygon's path.

        }

  });

redpajama_set_name: RedPajamaGithub


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

#if SystemReactive
using System.Reactive.Concurrency;
namespace System.Reactive.Linq
#else
using UniRx.Operators;

namespace UniRx
#endif
{
    // Timer, Interval, etc...
    public static partial class Observable
    {
        public static IObservable<long> Interval(TimeSpan period)
        {
            return new TimerObservable(period, period, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<long> Interval(TimeSpan period, IScheduler scheduler)
        {
            return new TimerObservable(period, period, scheduler);
        }

        public static IObservable<long> Timer(TimeSpan dueTime)
        {
            return new TimerObservable(dueTime, null, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<long> Timer(DateTimeOffset dueTime)
        {
            return new TimerObservable(dueTime, null, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<long> Timer(TimeSpan dueTime, TimeSpan period)
        {
            return new TimerObservable(dueTime, period, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<long> Timer(DateTimeOffset dueTime, TimeSpan period)
        {
            return new TimerObservable(dueTime, period, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<long> Timer(TimeSpan dueTime, IScheduler scheduler)
        {
            return new TimerObservable(dueTime, null, scheduler);
        }

        public static IObservable<long> Timer(DateTimeOffset dueTime, IScheduler scheduler)
        {
            return new TimerObservable(dueTime, null, scheduler);
        }

        public static IObservable<long> Timer(TimeSpan dueTime, TimeSpan period, IScheduler scheduler)
        {
            return new TimerObservable(dueTime, period, scheduler);
        }

        public static IObservable<long> Timer(DateTimeOffset dueTime, TimeSpan period, IScheduler scheduler)
        {
            return new TimerObservable(dueTime, period, scheduler);
        }

        public static IObservable<Timestamped<TSource>> Timestamp<TSource>(this IObservable<TSource> source)
        {
            return Timestamp<TSource>(source, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<Timestamped<TSource>> Timestamp<TSource>(this IObservable<TSource> source, IScheduler scheduler)
        {
            return new TimestampObservable<TSource>(source, scheduler);
        }

        public static IObservable<TimeInterval<TSource>> TimeInterval<TSource>(this IObservable<TSource> source)
        {
            return TimeInterval(source, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<TimeInterval<TSource>> TimeInterval<TSource>(this IObservable<TSource> source, IScheduler scheduler)
        {
            return new TimeIntervalObservable<TSource>(source, scheduler);
        }

        public static IObservable<T> Delay<T>(this IObservable<T> source, TimeSpan dueTime)
        {
            return source.Delay(dueTime, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<TSource> Delay<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
        {
            return new DelayObservable<TSource>(source, dueTime, scheduler);
        }

        public static IObservable<T> Sample<T>(this IObservable<T> source, TimeSpan interval)
        {
            return source.Sample(interval, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<T> Sample<T>(this IObservable<T> source, TimeSpan interval, IScheduler scheduler)
        {
            return new SampleObservable<T>(source, interval, scheduler);
        }

        public static IObservable<TSource> Throttle<TSource>(this IObservable<TSource> source, TimeSpan dueTime)
        {
            return source.Throttle(dueTime, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<TSource> Throttle<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
        {
            return new ThrottleObservable<TSource>(source, dueTime, scheduler);
        }

        public static IObservable<TSource> ThrottleFirst<TSource>(this IObservable<TSource> source, TimeSpan dueTime)
        {
            return source.ThrottleFirst(dueTime, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<TSource> ThrottleFirst<TSource>(this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
        {
            return new ThrottleFirstObservable<TSource>(source, dueTime, scheduler);
        }

        public static IObservable<T> Timeout<T>(this IObservable<T> source, TimeSpan dueTime)
        {
            return source.Timeout(dueTime, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<T> Timeout<T>(this IObservable<T> source, TimeSpan dueTime, IScheduler scheduler)
        {
            return new TimeoutObservable<T>(source, dueTime, scheduler);
        }

        public static IObservable<T> Timeout<T>(this IObservable<T> source, DateTimeOffset dueTime)
        {
            return source.Timeout(dueTime, Scheduler.DefaultSchedulers.TimeBasedOperations);
        }

        public static IObservable<T> Timeout<T>(this IObservable<T> source, DateTimeOffset dueTime, IScheduler scheduler)
        {
            return new TimeoutObservable<T>(source, dueTime, scheduler);
        }
    }
}


text:
import React from 'react';
import Layout from 'components/Layout';
import Signup from 'components/Signup';

export default {

  path: '/signup',

  async action() {
    const termsContent = await import(/* webpackChunkName: "terms" */ 'content/terms.md');

    return {
      title: 'Signup',
      component: <Layout><Signup termsContent={termsContent} /></Layout>,
    };
  },

};


text:
import java.io.File;
import java.net.InetAddress;
import java.net.Socket;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

public class GranuleServer {

	private static GranuleServer gs;
	// private static Map<String, ActiveIndividual> active;
	private Document serverDoc;
	private Document similarDoc;
	private static HashMap<String, String> granuleHash = new HashMap<String, String>();
	private static HashMap<String, String> mMapHash = new HashMap<String, String>();
	private static HashMap<String, String> raceHash = new HashMap<String, String>();
	// 个体缓存,用于相似粒查找
	// private static HashMap<String, List<String>> similarGranuleCache = new
	// HashMap<String, List<String>>();
	// 个体缓存,用于相似粒查找
	private static GopHashMap<String, List<String>> similarGranuleCache = GopHashMap.getInstance();
	// 个体缓存时间戳
	private static HashMap<String, Date> cacheExpired = new HashMap<String, Date>();
	// 相似粒Hash,用于相似粒查找
	private static HashMap<String, List<String>> similarGranuleHash = new HashMap<String, List<String>>();
	// 用于控制批量写个体到文件
	private static List<Node> waitRegisList = new ArrayList<Node>();

	public static GranuleServer getInstance() {
		if (gs == null) {
			gs = new GranuleServer();
		}
		return gs;
	}

	private GranuleServer() {

	}

	public void init() {
		// active = new HashMap<String, ActiveIndividual>();
		String serverDir = Utility.getServerDir();
		File fileDir = new File(serverDir);
		if (!fileDir.exists()) {
			fileDir.mkdir();
		}
		loadServerConfig(serverDir);
		loadSimilarGranule(serverDir);
		// 多线程处理异常的注册请求
		// handRegisRedoProcess();
	}

	public void registerToServer(List<Node> regisList, String ip) {
		int waitRegisListSize = regisList.size();
		if (waitRegisListSize >= 1) {
			Node regisNode = null;
			Node regisNodePath = null;
			NamedNodeMap nodeAttr = null;
			String md5 = "";
			String raceId = "";
			String file = "";
			//String mmap = "";
			String individual = null;
			// List<Node> unRegisList = new ArrayList<Node>();
			for (int i = 0; i < waitRegisListSize; i = i + 2) {
				regisNode = regisList.get(i);
				regisNodePath = regisList.get(i + 1);
				nodeAttr = regisNode.getAttributes();
				raceId = nodeAttr.getNamedItem("raceId").getNodeValue();
				md5 = nodeAttr.getNamedItem("md5").getNodeValue();
				file = nodeAttr.getNamedItem("file").getNodeValue();
				//mmap = nodeAttr.getNamedItem("mmap").getNodeValue();
				individual = granuleHash.get("md5");
				if (individual == null) {
					waitRegisList.add(regisNode);
					waitRegisList.add(regisNodePath);
					// 更新种群hash
					modifyRaceHash(md5, raceId);
					// 放入到个体hash
					String indPath = Utility.getServerDir() + ip + File.separator + md5 + File.separator + file;
					//String mmapPath = Utility.getServerDir() + ip + File.separator + md5 + File.separator + mmap;
					modifyGranuleHash(md5, indPath);
					// for testGranuleDoc
					modifyToHashAndCache(md5, regisNodePath);
					// 更新mmaphash
					//modifyMMapHash(md5, mmapPath);
				}
			}
			// 延迟注册到服务器
			if (waitRegisList != null && waitRegisList.size() == ConstantVariable.REG_BATCH_SIZE) {
				mutiThreadRegisToServer(waitRegisList, ip);
				waitRegisList = new ArrayList<Node>();
			}
		}
	}

	public void getSimilarGranule(String md5Code, String similarPath, Socket socket, String clientIp, String retryInfo, int position, String projectPath) {
		// make sure the two belong to the same race but not the same individual
		findSimilarGranule(md5Code, similarPath, socket, clientIp, retryInfo, position, projectPath);
	}

	public void loadServerConfig(String serverDir) {
		String filePath = serverDir + "server.xml";
		if (!new File(filePath).exists()) {
			try {
				Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
				Element root = doc.createElement("global");
				root.setAttribute("name", InetAddress.getLocalHost().getHostAddress());
				doc.appendChild(root);
				Utility.writeToXML(doc, filePath);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		serverDoc = Utility.loadFromXML(filePath);
		loadServerDocToHash();
	}

	public void loadSimilarGranule(String serverDir) {
		String filePath = serverDir + "path_granuleList.xml";
		if (!new File(filePath).exists()) {
			try {
				Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
				Element root = doc.createElement("g-hash");
				doc.appendChild(root);
				Utility.writeToXML(doc, filePath);
			} catch (ParserConfigurationException e) {
				e.printStackTrace();
			}
		}
		similarDoc = Utility.loadFromXML(filePath);
		loadSimilarDocToHash();
	}

	public void loadServerDocToHash() {
		NodeList raceList = serverDoc.getElementsByTagName("race");
		int raceListLength = raceList.getLength();
		// for race
		Element raceNode = null;
		NamedNodeMap raceAttr = null;
		String id = "";
		// for individual
		NodeList nodeList = null;
		Node node = null;
		NamedNodeMap nodeAttr = null;
		String file = "";
		String location = "";
		String md5 = "";
		//String mmap = "";
		int nodeListLength = 0;
		for (int i = 0; i < raceListLength; i++) {
			raceNode = (Element) raceList.item(i);
			raceAttr = raceNode.getAttributes();
			id = raceAttr.getNamedItem("id").getNodeValue();
			nodeList = raceNode.getElementsByTagName("gvm");
			nodeListLength = nodeList.getLength();
			for (int j = 0; j < nodeListLength; j++) {
				node = nodeList.item(j);
				nodeAttr = node.getAttributes();
				md5 = nodeAttr.getNamedItem("md5").getNodeValue();
				location = nodeAttr.getNamedItem("loc_server").getNodeValue();
				file = nodeAttr.getNamedItem("file").getNodeValue();
				//mmap = nodeAttr.getNamedItem("mmap").getNodeValue();
				granuleHash.put(md5, location + file);
				//mMapHash.put(md5, location + mmap);
				raceHash.put(md5, id);
			}

		}
	}

	public void loadSimilarDocToHash() {
		NodeList nodeList = similarDoc.getElementsByTagName("hash");
		Node node = null;
		NamedNodeMap nodeAttr = null;
		String path = "";
		String value = "";
		List<String> md5List = new ArrayList<String>();
		int nodeListLength = nodeList.getLength();
		for (int i = 0; i < nodeListLength; i++) {
			node = nodeList.item(i);
			nodeAttr = node.getAttributes();
			path = nodeAttr.getNamedItem("path").getNodeValue();
			value = nodeAttr.getNamedItem("md5_list").getNodeValue();
			md5List = Utility.stringArrayToList(value.split(","));
			similarGranuleHash.put(path, md5List);
		}
	}

	public void mutiThreadRegisToServer(List<Node> regisList, String ip) {
		// 更新文件内容到server.xml
		ServerRegisToServerThread srst = new ServerRegisToServerThread(regisList, ip);
		new Thread(srst).start();

		// 更新文件内容到granuleHash.xml
		ServerUpPathGranuleThread sugt = new ServerUpPathGranuleThread(similarGranuleHash);
		new Thread(sugt).start();

		// 更新文件字节码到服务器
		List<Node> nodeList = Utility.fiterPathNodeFromNodeList(regisList);
		ServerGetUpFileByClientThread sgfct = new ServerGetUpFileByClientThread(nodeList, ip);
		new Thread(sgfct).start();
	}

	public void findSimilarGranule(String md5Code, String similarPath, Socket socket, String clientIp, String retryInfo, int position, String projectPath) {
		String indPath = null;
		//String mMapPath = null;
		boolean flag = false;
		boolean rflag = false;
		// find from cache
		List<String> md5Array = similarGranuleCache.get(similarPath);
		String md5 = "";
		List<String> md5CacheList = new ArrayList<String>();
		String feedback = "";
		Node similarGranule = null;
		int md5ArrLength = 0;
		if (md5Array != null) {
			md5ArrLength = md5Array.size();
		}
		if (ConstantVariable.RETRY_NULL.equals(retryInfo) || ConstantVariable.RETRY_LOCAL_CACHE.equals(retryInfo) || ConstantVariable.RETRY_LOCAL_STORE.equals(retryInfo)) {
			if (md5Array != null && md5ArrLength > 0) {
				for (int i = 0; i < md5ArrLength; i++) {
					md5 = md5Array.get(i);
					indPath = granuleHash.get(md5);
					//mMapPath = mMapHash.get(md5);
					if (!md5.equals(md5Code) && indPath != null && raceHash.get(md5).equals(raceHash.get(md5Code))) {
						// 更新缓存被使用信息,
						modifyCacheExpired(similarPath);
						// 更新二次查询信息
						retryInfo = ConstantVariable.RETRY_REMOTE_CACHE;
						position = i + 1;
						// modifySimilarGranuleCache(similarPath, md5);
						flag = true;
						feedback = projectPath + "server_back.xml" + ";" + similarPath + ";" + retryInfo + ";" + position;
						break;
					}
				}
			}
			// else find from individual store
			if (!flag) {
				md5Array = similarGranuleHash.get(similarPath);
				md5ArrLength = 0;
				if (md5Array != null) {
					md5ArrLength = md5Array.size();
				}

				if (md5Array != null && md5ArrLength > 0) {
					for (int i = 0; i < md5ArrLength; i++) {
						md5 = md5Array.get(i);
						indPath = granuleHash.get(md5);
						//mMapPath = mMapHash.get(md5);
						if (!md5.equals(md5Code) && indPath != null && raceHash.get(md5).equals(raceHash.get(md5Code))) {
							// 更新二次查询信息
							md5CacheList = getCacheList(md5Code, md5, i, md5Array);
							retryInfo = ConstantVariable.RETRY_REMOTE_STORE;
							position = i + 1;
							// modifySimilarGranuleCache(similarPath, md5);
							flag = true;
							feedback = projectPath + "server_back.xml" + ";" + similarPath + ";" + retryInfo + ";" + position;
							break;
						}
					}
				}
			}
		} else {
			// 解决二次查找问题
			rflag = true;
			researchSimilarGranule(md5Code, similarPath, socket, clientIp, retryInfo, position, projectPath);
		}
		if (flag) {
			Utility.handleFeedback(socket, feedback);
			similarGranule = Utility.guidToGranuleNode(indPath, similarPath);
			//Utility.sentXmlFileToClient(mMapPath, clientIp, projectPath, false);
			Utility.sentXmlFileToClient(indPath, clientIp, projectPath, true);
			Utility.sentGranuleFileToClient(indPath, similarGranule, clientIp, projectPath);
			// 放入相似粒缓存,
			// modifySimilarGranuleCache(similarPath, md5);
			updateCache(similarPath, md5CacheList);
			// if (similarGranuleCache.size() ==
			// similarGranuleCache.getMaxSize()) {
			// String removeItem = Utility.getOldestItem(cacheExpired);
			// similarGranuleCache.remove(removeItem, true);
			// cacheExpired.remove(removeItem);
			// }
			// similarGranuleCache.put(similarPath, md5);
			// modifyCacheExpired(similarPath);

		} else if (!rflag) {
			feedback = ConstantVariable.GRANULE_SEARCH_FAIL;
			Utility.handleFeedback(socket, feedback);
		}
	}

	public void researchSimilarGranule(String md5Code, String similarPath, Socket socket, String clientIp, String retryInfo, int position, String projectPath) {
		String indPath = null;
		//String mMapPath = null;
		boolean flag = false;
		List<String> md5List = new ArrayList<String>();
		List<String> md5CacheList = new ArrayList<String>();
		String md5 = "";
		int md5ArrLength = 0;
		String feedback = "";
		Node similarGranule = null;
		if (ConstantVariable.RETRY_REMOTE_CACHE.equals(retryInfo)) {
			md5List = similarGranuleCache.get(similarPath);
			if (md5List != null) {
				md5ArrLength = md5List.size();
			}
			for (int i = position; i < md5ArrLength; i++) {
				md5 = md5List.get(i);
				indPath = granuleHash.get(md5);
				//mMapPath = mMapHash.get(md5);
				if (!md5.equals(md5Code) && indPath != null && raceHash.get(md5).equals(raceHash.get(md5Code))) {
					// 更新缓存被使用信息,
					modifyCacheExpired(similarPath);
					// 更新二次查询信息
					retryInfo = ConstantVariable.RETRY_REMOTE_CACHE;
					position = i + 1;
					// modifySimilarGranuleCache(similarPath, md5);
					flag = true;
					// 远程返回目标个体的配置文件hardcode为server_back.xml
					feedback = projectPath + "server_back.xml" + ";" + similarPath + ";" + retryInfo + ";" + position;
					break;
				}
			}
			if (!flag) {
				md5List = similarGranuleHash.get(similarPath);
				md5ArrLength = 0;
				if (md5List != null) {
					md5ArrLength = md5List.size();
				}

				if (md5List != null && md5ArrLength > 0) {
					for (int i = 0; i < md5ArrLength; i++) {
						md5 = md5List.get(i);
						indPath = granuleHash.get(md5);
						//mMapPath = mMapHash.get(md5);
						if (!md5.equals(md5Code) && indPath != null && raceHash.get(md5).equals(raceHash.get(md5Code))) {
							md5CacheList = getCacheList(md5Code, md5, i, md5List);
							// 更新二次查询信息
							retryInfo = ConstantVariable.RETRY_REMOTE_STORE;
							position = i + 1;
							// modifySimilarGranuleCache(similarPath, md5);
							flag = true;
							feedback = projectPath + "server_back.xml" + ";" + similarPath + ";" + retryInfo + ";" + position;
							break;
						}
					}
				}
			}
		} else {
			md5List = similarGranuleHash.get(similarPath);
			if (md5List != null) {
				md5ArrLength = md5List.size();
			}
			for (int i = position; i < md5ArrLength; i++) {
				md5 = md5List.get(i);
				indPath = granuleHash.get(md5);
				//mMapPath = mMapHash.get(md5);
				if (!md5.equals(md5Code) && indPath != null && raceHash.get(md5).equals(raceHash.get(md5Code))) {
					md5CacheList = getCacheList(md5Code, md5, i, md5List);
					// 更新二次查询信息
					retryInfo = ConstantVariable.RETRY_REMOTE_STORE;
					position = i + 1;
					// modifySimilarGranuleCache(similarPath, md5);
					flag = true;
					feedback = projectPath + "server_back.xml" + ";" + similarPath + ";" + retryInfo + ";" + position;
					break;
				}
			}
		}
		if (flag) {
			Utility.handleFeedback(socket, feedback);
			similarGranule = Utility.guidToGranuleNode(indPath, similarPath);
			//Utility.sentXmlFileToClient(mMapPath, clientIp, projectPath, false);
			Utility.sentXmlFileToClient(indPath, clientIp, projectPath, true);
			Utility.sentGranuleFileToClient(indPath, similarGranule, clientIp, projectPath);
			// 放入相似粒缓存,
			// modifySimilarGranuleCache(similarPath, md5);
			updateCache(similarPath, md5CacheList);
			// if (similarGranuleCache.size() ==
			// similarGranuleCache.getMaxSize()) {
			// String removeItem = Utility.getOldestItem(cacheExpired);
			// similarGranuleCache.remove(removeItem, true);
			// cacheExpired.remove(removeItem);
			// }
			// similarGranuleCache.put(similarPath, md5);
			// modifyCacheExpired(similarPath);
		} else {
			feedback = ConstantVariable.GRANULE_SEARCH_FAIL;
			Utility.handleFeedback(socket, feedback);
		}
	}

	public void modifyToHashAndCache(String md5, Node regisNodePath) {

		String path = "";
		Node nodePath = null;
		for (nodePath = regisNodePath.getFirstChild(); nodePath != null; nodePath = nodePath.getNextSibling()) {
			if (nodePath.getNodeType() == Node.ELEMENT_NODE) {
				path = nodePath.getAttributes().getNamedItem("value").getNodeValue();
				// 放入相似粒hash
				modifySimilarGranuleHash(path, md5);
			}
		}
		// 根据相似路径-个体对的多少,动态调整cache的大小,
		similarGranuleCache.resize(similarGranuleHash,true);
	}

	public void modifyRaceHash(String md5, String raceId) {
		synchronized (raceHash) {
			if (raceHash.get(md5) == null) {
				raceHash.put(md5, raceId);
			}
		}
	}

//	public void modifyMMapHash(String md5, String mmap) {
//		synchronized (mMapHash) {
//			if (mMapHash.get(md5) == null) {
//				mMapHash.put(md5, mmap);
//			}
//		}
//	}

	// 放入个体hash中
	public void modifyGranuleHash(String md5, String indPath) {
		synchronized (granuleHash) {
			if (granuleHash.get(md5) == null) {
				granuleHash.put(md5, indPath);
			}
		}
	}

	// 放入相似粒hash
	public void modifySimilarGranuleHash(String similarPath, String md5) {
		List<String> md5HashList = similarGranuleHash.get(similarPath);
		synchronized (similarGranuleHash) {
			if (md5HashList == null) {
				List<String> newMd5HashList = new ArrayList<String>();
				newMd5HashList.add(md5);
				similarGranuleHash.put(similarPath, newMd5HashList);
			} else {
				if (!md5HashList.contains(md5)) {
					md5HashList.add(md5);
				}
				similarGranuleHash.put(similarPath, md5HashList);
			}
		}
	}

	// 放入相似粒缓存
	// public void modifySimilarGranuleCache(String similarPath, String md5) {
	// List<String> md5CacheList = similarGranuleCache.get(similarPath);
	// if (md5CacheList == null) {
	// List<String> newMd5CacheList = new ArrayList<String>();
	// newMd5CacheList.add(md5);
	// similarGranuleCache.put(similarPath, newMd5CacheList);
	// } else {
	// if (!md5CacheList.contains(md5)) {
	// md5CacheList.add(md5);
	// }
	// similarGranuleCache.put(similarPath, md5CacheList);
	// }
	//
	// }

	public void updateCache(String path, List<String> md5List) {
		// cache被装满时,
		synchronized (similarGranuleCache) {
			if (similarGranuleCache.size() == similarGranuleCache.getMaxSize()) {
				String removeItem = Utility.getOldestItem(cacheExpired);
				similarGranuleCache.remove(removeItem, true);
				cacheExpired.remove(removeItem);
			}
			int size = md5List.size();
			String md5 = "";
			for (int i = 0; i < size; i++) {
				md5 = md5List.get(i);
				similarGranuleCache.put(path, md5);
			}
			modifyCacheExpired(path);
		}
	}

	public void modifyCacheExpired(String similarPath) {
		synchronized (cacheExpired) {
			cacheExpired.put(similarPath, new Date());
		}
	}

	// 获取需要装入cache的内容,一般为该数据及其下一条可用数据,
	public List<String> getCacheList(String md5Code, String md5, int i, List<String> md5Array) {
		List<String> md5CacheList = new ArrayList<String>();
		md5CacheList.add(md5);
		int size = md5Array.size();
		String nextMd5 = "";
		for (int j = i + 1; j < size; j++) {
			nextMd5 = md5Array.get(j);
			if (!nextMd5.equals(md5Code)) {
				md5CacheList.add(nextMd5);
				break;
			}
		}
		return md5CacheList;
	}

	// public Map<String, ActiveIndividual> getActive() {
	// return active;
	// }

	// 处理获取文件失败的注册个体
	public void handRegisRedoProcess() {
		Document doc = Utility.loadFromXML("src\\redoUpdate.xml");
		NodeList nodeList = doc.getElementsByTagName("g-tree");
		List<Node> list = Utility.getListNodeFromNodeList(nodeList);
		// test
		ServerGetUpFileByClientThread sgft = new ServerGetUpFileByClientThread(list, "");
		new Thread(sgft).start();
	}

//	public static void main(String[] args) {
//		List<String> hm = new ArrayList<String>();
//		for (int i = 0; i < 70; i++) {
//			hm.add("a" + i);
//		}
//		List<String> cm = new ArrayList<String>();
//		for (int j = 30; j < 41; j++) {
//			cm.add("a" + j);
//		}
//		Date d1 = new Date();
//		Timestamp ts1 = new Timestamp(d1.getTime());
//		System.out.println(ts1);
//		for (int m = 0; m < 10000000; m++) {
//			for (int i = 0; i < 100; i++) {
//				if (hm.get(i).equals("a35")) {
//					break;
//				}
//			}
//		}
//		Date d2 = new Date();
//		Timestamp ts2 = new Timestamp(d2.getTime());
//		System.out.println(ts2);
//		for (int n = 0; n < 10000000; n++) {
//			for (int j = 0; j < 11; j++) {
//				if (cm.get(j).equals("a35")) {
//					break;
//				}
//			}
//		}
//		Date d3 = new Date();
//		Timestamp ts3 = new Timestamp(d3.getTime());
//		System.out.println(ts3);
//	}
}


text:
package org.gol.rules;

import java.util.Collection;
import java.util.stream.Collectors;

import org.gol.Cell;

public class OverPopulationRule implements IRule {

	@Override
	public Action whatNext(Cell cell, Collection<Cell> neighbours) {
		if(cell.isDead()){
			return  Action.NOTHING;
		}
		Long countOfAliveNeighbours = neighbours.stream().filter((c) -> c.isAlive()).collect(Collectors.counting());
		if (countOfAliveNeighbours > 3){
			return Action.DIE;
		}
		return Action.NOTHING;
	}

}


text:
package org.apache.accumulo.examples.simple.dirlist;

import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;

import org.apache.accumulo.core.cli.ClientOnRequiredTable;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.client.IteratorSetting;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.iterators.user.RegExFilter;
import org.apache.accumulo.core.security.Authorizations;
import org.apache.hadoop.io.Text;

import com.beust.jcommander.Parameter;

/**
 * Provides utility methods for getting the info for a file, listing the contents of a directory, and performing single wild card searches on file or directory
 * names. See docs/examples/README.dirlist for instructions.
 */
public class QueryUtil {
  private Connector conn = null;
  private String tableName;
  private Authorizations auths;
  public static final Text DIR_COLF = new Text("dir");
  public static final Text FORWARD_PREFIX = new Text("f");
  public static final Text REVERSE_PREFIX = new Text("r");
  public static final Text INDEX_COLF = new Text("i");
  public static final Text COUNTS_COLQ = new Text("counts");

  public QueryUtil(Opts opts) throws AccumuloException,
      AccumuloSecurityException {
    conn = opts.getConnector();
    this.tableName = opts.tableName;
    this.auths = opts.auths;
  }

  /**
   * Calculates the depth of a path, i.e. the number of forward slashes in the path name.
   *
   * @param path
   *          the full path of a file or directory
   * @return the depth of the path
   */
  public static int getDepth(String path) {
    int numSlashes = 0;
    int index = -1;
    while ((index = path.indexOf("/", index + 1)) >= 0)
      numSlashes++;
    return numSlashes;
  }

  /**
   * Given a path, construct an accumulo row prepended with the path's depth for the directory table.
   *
   * @param path
   *          the full path of a file or directory
   * @return the accumulo row associated with this path
   */
  public static Text getRow(String path) {
    Text row = new Text(String.format("%03d", getDepth(path)));
    row.append(path.getBytes(), 0, path.length());
    return row;
  }

  /**
   * Given a path, construct an accumulo row prepended with the {@link #FORWARD_PREFIX} for the index table.
   *
   * @param path
   *          the full path of a file or directory
   * @return the accumulo row associated with this path
   */
  public static Text getForwardIndex(String path) {
    String part = path.substring(path.lastIndexOf("/") + 1);
    if (part.length() == 0)
      return null;
    Text row = new Text(FORWARD_PREFIX);
    row.append(part.getBytes(), 0, part.length());
    return row;
  }

  /**
   * Given a path, construct an accumulo row prepended with the {@link #REVERSE_PREFIX} with the path reversed for the index table.
   *
   * @param path
   *          the full path of a file or directory
   * @return the accumulo row associated with this path
   */
  public static Text getReverseIndex(String path) {
    String part = path.substring(path.lastIndexOf("/") + 1);
    if (part.length() == 0)
      return null;
    byte[] rev = new byte[part.length()];
    int i = part.length() - 1;
    for (byte b : part.getBytes())
      rev[i--] = b;
    Text row = new Text(REVERSE_PREFIX);
    row.append(rev, 0, rev.length);
    return row;
  }

  /**
   * Returns either the {@link #DIR_COLF} or a decoded string version of the colf.
   *
   * @param colf
   *          the column family
   */
  public static String getType(Text colf) {
    if (colf.equals(DIR_COLF))
      return colf.toString() + ":";
    return Long.toString(Ingest.encoder.decode(colf.getBytes())) + ":";
  }

  /**
   * Scans over the directory table and pulls out stat information about a path.
   *
   * @param path
   *          the full path of a file or directory
   */
  public Map<String,String> getData(String path) throws TableNotFoundException {
    if (path.endsWith("/"))
      path = path.substring(0, path.length() - 1);
    Scanner scanner = conn.createScanner(tableName, auths);
    scanner.setRange(new Range(getRow(path)));
    Map<String,String> data = new TreeMap<String,String>();
    for (Entry<Key,Value> e : scanner) {
      String type = getType(e.getKey().getColumnFamily());
      data.put("fullname", e.getKey().getRow().toString().substring(3));
      data.put(type + e.getKey().getColumnQualifier().toString() + ":" + e.getKey().getColumnVisibility().toString(), new String(e.getValue().get()));
    }
    return data;
  }

  /**
   * Uses the directory table to list the contents of a directory.
   *
   * @param path
   *          the full path of a directory
   */
  public Map<String,Map<String,String>> getDirList(String path) throws TableNotFoundException {
    if (!path.endsWith("/"))
      path = path + "/";
    Map<String,Map<String,String>> fim = new TreeMap<String,Map<String,String>>();
    Scanner scanner = conn.createScanner(tableName, auths);
    scanner.setRange(Range.prefix(getRow(path)));
    for (Entry<Key,Value> e : scanner) {
      String name = e.getKey().getRow().toString();
      name = name.substring(name.lastIndexOf("/") + 1);
      String type = getType(e.getKey().getColumnFamily());
      if (!fim.containsKey(name)) {
        fim.put(name, new TreeMap<String,String>());
        fim.get(name).put("fullname", e.getKey().getRow().toString().substring(3));
      }
      fim.get(name).put(type + e.getKey().getColumnQualifier().toString() + ":" + e.getKey().getColumnVisibility().toString(), new String(e.getValue().get()));
    }
    return fim;
  }

  /**
   * Scans over the index table for files or directories with a given name.
   *
   * @param term
   *          the name a file or directory to search for
   */
  public Iterable<Entry<Key,Value>> exactTermSearch(String term) throws Exception {
    System.out.println("executing exactTermSearch for " + term);
    Scanner scanner = conn.createScanner(tableName, auths);
    scanner.setRange(new Range(getForwardIndex(term)));
    return scanner;
  }

  /**
   * Scans over the index table for files or directories with a given name, prefix, or suffix (indicated by a wildcard '*' at the beginning or end of the term.
   *
   * @param exp
   *          the name a file or directory to search for with an optional wildcard '*' at the beginning or end
   */
  public Iterable<Entry<Key,Value>> singleRestrictedWildCardSearch(String exp) throws Exception {
    if (exp.indexOf("/") >= 0)
      throw new Exception("this method only works with unqualified names");

    Scanner scanner = conn.createScanner(tableName, auths);
    if (exp.startsWith("*")) {
      System.out.println("executing beginning wildcard search for " + exp);
      exp = exp.substring(1);
      scanner.setRange(Range.prefix(getReverseIndex(exp)));
    } else if (exp.endsWith("*")) {
      System.out.println("executing ending wildcard search for " + exp);
      exp = exp.substring(0, exp.length() - 1);
      scanner.setRange(Range.prefix(getForwardIndex(exp)));
    } else if (exp.indexOf("*") >= 0) {
      throw new Exception("this method only works for beginning or ending wild cards");
    } else {
      return exactTermSearch(exp);
    }
    return scanner;
  }

  /**
   * Scans over the index table for files or directories with a given name that can contain a single wildcard '*' anywhere in the term.
   *
   * @param exp
   *          the name a file or directory to search for with one optional wildcard '*'
   */
  public Iterable<Entry<Key,Value>> singleWildCardSearch(String exp) throws Exception {
    int starIndex = exp.indexOf("*");
    if (exp.indexOf("*", starIndex + 1) >= 0)
      throw new Exception("only one wild card for search");

    if (starIndex < 0) {
      return exactTermSearch(exp);
    } else if (starIndex == 0 || starIndex == exp.length() - 1) {
      return singleRestrictedWildCardSearch(exp);
    }

    String firstPart = exp.substring(0, starIndex);
    String lastPart = exp.substring(starIndex + 1);
    String regexString = ".*/" + exp.replace("*", "[^/]*");

    Scanner scanner = conn.createScanner(tableName, auths);
    if (firstPart.length() >= lastPart.length()) {
      System.out.println("executing middle wildcard search for " + regexString + " from entries starting with " + firstPart);
      scanner.setRange(Range.prefix(getForwardIndex(firstPart)));
    } else {
      System.out.println("executing middle wildcard search for " + regexString + " from entries ending with " + lastPart);
      scanner.setRange(Range.prefix(getReverseIndex(lastPart)));
    }
    IteratorSetting regex = new IteratorSetting(50, "regex", RegExFilter.class);
    RegExFilter.setRegexs(regex, null, null, regexString, null, false);
    scanner.addScanIterator(regex);
    return scanner;
  }

  public static class Opts extends ClientOnRequiredTable {
    @Parameter(names="--path", description="the directory to list")
    String path = "/";
    @Parameter(names="--search", description="find a file or directorys with the given name")
    boolean search = false;
  }

  /**
   * Lists the contents of a directory using the directory table, or searches for file or directory names (if the -search flag is included).
   *
   * @param args
   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    Opts opts = new Opts();
    opts.parseArgs(QueryUtil.class.getName(), args);
    QueryUtil q = new QueryUtil(opts);
    if (opts.search) {
      for (Entry<Key,Value> e : q.singleWildCardSearch(opts.path)) {
        System.out.println(e.getKey().getColumnQualifier());
      }
    } else {
      for (Entry<String,Map<String,String>> e : q.getDirList(opts.path).entrySet()) {
        System.out.println(e);
      }
    }
  }
}


text:
<?php

namespace Inei\Bundle\AuthBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Inei\Bundle\AuthBundle\Entity\Usuarios;
use Symfony\Component\HttpFoundation\Response;

class SecuredController extends Controller
{

    /**
     * @Route("/user/add", name="_add_user")
     * @Template()
     */
    public function adduserAction()
    {
        $factory = $this->get('security.encoder_factory');
        $user = new Usuarios();

        $encoder = $factory->getEncoder($user);
        $password = $encoder->encodePassword('admin', $user->getSalt());
        $user->setPassword($password);
        $user->setNombres("Herald Matias Olivares Zarsoza");
        $user->setUsername("herald");
        $user->setEmail("heraldmatias.oz@gmail.com");

        $em = $this->getDoctrine()->getManager();
        $em->persist($user);
        $em->flush();
        return new Response('Created user id '.$user->getId());
    }

    /**
     * @Route("/login", name="_admin_login")
     * @Template()
     */
    public function loginAction(Request $request)
    {
        if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
            $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
        } else {
            $error = $request->getSession()->get(SecurityContext::AUTHENTICATION_ERROR);
        }

        return array(
            'last_username' => $request->getSession()->get(SecurityContext::LAST_USERNAME),
            'error'         => $error,
        );
    }

    /**
     * @Route("/login_check", name="_admin_security_check")
     */
    public function securityCheckAction()
    {
        // The security layer will intercept this request
    }

    /**
     * @Route("/logout", name="_admin_logout")
     */
    public function logoutAction()
    {
        // The security layer will intercept this request
    }

    /**
     * @Route("/", name="_admin")
     * @Template()
     */
    public function indexAction()
    {
        return array(
            'context' => 'algo',
        );
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Linzer biol. Beitr. 34(2): 1063 (2002)

#### Original name
Dimerella isidiosa Breuss

### Remarks
null


text:
/*
 * Created by SharpDevelop.
 * User: junian
 * Date: 8/30/2014
 * Time: 8:06 PM
 *
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Text;

namespace Net.Junian.SDEmu.Utilities
{
	/// <summary>
	/// Description of ComDataConverter.
	/// </summary>
	public class SerialDataConverter
	{
		public SerialDataConverter()
		{
		}

		public static byte[] IntToBytes(int value)
		{
			byte[] bytes = BitConverter.GetBytes(value);
			if(BitConverter.IsLittleEndian)
				Array.Reverse(bytes);
			return bytes;
		}

		public static int BytesToInt(byte[] bytes)
		{
			if(BitConverter.IsLittleEndian)
				Array.Reverse(bytes);
			return BitConverter.ToInt32(bytes, 0);
		}

		public static byte[] HexStringToBytes(string hexString)
		{
			if(string.IsNullOrEmpty(hexString))
				return null;

			var sb = new StringBuilder();
            var hexStr = hexString.ToUpper();

            foreach(var c in hexStr)
            	if((c >= '0' && c<='9') || (c>='A' && c<='F'))
            		sb.Append(c);

            if((sb.Length & 1) == 1)
            	sb.Insert(0, '0');

            hexStr = sb.ToString();
            var bytes = new List<byte>();

            for(int i=0;i<hexStr.Length;i+=2)
            {
            	bytes.Add(
            		Convert.ToByte(
            			new StringBuilder()
	            			.Append(hexStr[i])
	            			.Append(hexStr[i+1])
	            			.ToString(), 16));
            }

            return bytes.ToArray();
		}

		public static string BytesToHexString(byte[] bytes)
		{
			if(bytes == null || bytes.Length<=0)
				return string.Empty;
			return BitConverter.ToString(bytes);
		}

		public static byte[] StringToBytes(string str)
		{
			if(string.IsNullOrEmpty(str))
				return null;
			return System.Text.Encoding.UTF8.GetBytes(str);
		}

		public static string BytesToString(byte[] bytes)
		{
			if(bytes == null || bytes.Length <= 0)
				return string.Empty;
			return System.Text.Encoding.UTF8.GetString(bytes);
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

namespace Alexa.NET.Management.SkillDevelopment
{
    [JsonConverter(typeof(SkillDevelopmentEventConverter))]
    public abstract class SkillDevelopmentEvent
    {
        [JsonProperty("requestId")]
        public string RequestId { get; set; }

        [JsonProperty("timestamp")]
        public DateTime DateTime { get; set; }

        [JsonProperty("eventName"),JsonConverter(typeof(StringEnumConverter))]
        public AlexaDevelopmentEventType EventName { get; set; }
    }

    public abstract class SkillDevelopmentEvent<T>:SkillDevelopmentEvent where T:SkillDevelopmentEventPayload
    {
        [JsonProperty("payload")]
        public T Payload { get; set; }
    }
}


text:
#include "Python.h"
#include "structmember.h" /* for offsetof macro if needed */
#include "numpy/arrayobject.h"

/* Use a Python float as the cannonical type being added
*/

typedef struct _floatint {
    PyObject_HEAD
    npy_int32 first;
    npy_int32 last;
} PyFloatIntObject;

static PyTypeObject PyFloatInt_Type = {
        PyObject_HEAD_INIT(NULL)
        0,                                          /*ob_size*/
        "floatint.floatint",                         /*tp_name*/
        sizeof(PyFloatIntObject),                   /*tp_basicsize*/
};

static PyArray_ArrFuncs _PyFloatInt_Funcs;

#define _ALIGN(type) offsetof(struct {char c; type v;},v)

/* The scalar-type */

static PyArray_Descr _PyFloatInt_Dtype = {
    PyObject_HEAD_INIT(NULL)
    &PyFloatInt_Type,
    'f',
    '0',
    '=',
    0,
    0,
    sizeof(double),
    _ALIGN(double),
    NULL,
    NULL,
    NULL,
    &_PyFloatInt_Funcs
};

static void
twoint_copyswap(void *dst, void *src, int swap, void *arr)
{
    if (src != NULL)
	memcpy(dst, src, sizeof(double));

    if (swap) {
	register char *a, *b, c;
	a = (char *)dst;
	b = a + 7;
	c = *a; *a++ = *b; *b-- = c;
	c = *a; *a++ = *b; *b-- = c;
	c = *a; *a++ = *b; *b-- = c;
	c = *a; *a++ = *b; *b   = c;
    }
}

static PyObject *
twoint_getitem(char *ip, PyArrayObject *ap) {
    npy_int32 a[2];

    if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) {
	a[0] = *((npy_int32 *)ip);
	a[1] = *((npy_int32 *)ip + 1);
    }
    else {
	ap->descr->f->copyswap(a, ip, !PyArray_ISNOTSWAPPED(ap),
			       ap);
    }
    return Py_BuildValue("(ii)", a[0], a[1]);
}

static int
twoint_setitem(PyObject *op, char *ov, PyArrayObject *ap) {
    npy_int32 a[2];

    if (!PyTuple_Check(op)) {
	PyErr_SetString(PyExc_TypeError, "must be a tuple");
	return -1;
    }
    if (!PyArg_ParseTuple(op, "ii", a, a+1)) return -1;

    if (ap == NULL || PyArray_ISBEHAVED(ap)) {
	memcpy(ov, a, sizeof(double));
    }
    else {
	ap->descr->f->copyswap(ov, a, !PyArray_ISNOTSWAPPED(ap),
			       ap);
    }
    return 0;
}

static PyArray_Descr * _register_dtype(void)
{
    int userval;
    PyArray_InitArrFuncs(&_PyFloatInt_Funcs);
    /* Add copyswap,
       nonzero, getitem, setitem*/
    _PyFloatInt_Funcs.copyswap = twoint_copyswap;
    _PyFloatInt_Funcs.getitem = (PyArray_GetItemFunc *)twoint_getitem;
    _PyFloatInt_Funcs.setitem = (PyArray_SetItemFunc *)twoint_setitem;
    _PyFloatInt_Dtype.ob_type = &PyArrayDescr_Type;

    userval = PyArray_RegisterDataType(&_PyFloatInt_Dtype);
    return PyArray_DescrFromType(userval);
}

/* Initialization function for the module (*must* be called init<name>) */

PyMODINIT_FUNC initfloatint(void) {
    PyObject *m, *d;
    PyArray_Descr *dtype;

    /* Create the module and add the functions */
    m = Py_InitModule("floatint", NULL);

    /* Import the array objects */
    import_array();

    /* Initialize the new float type */

    /* Add some symbolic constants to the module */
    d = PyModule_GetDict(m);

    if (PyType_Ready(&PyFloat_Type) < 0) return;
    PyFloatInt_Type.tp_base = &PyFloat_Type;
    /* This is only needed because we are sub-typing the
       Float type and must pre-set some function pointers
       to get PyType_Ready to fill in the rest.
     */
    PyFloatInt_Type.tp_alloc = PyType_GenericAlloc;
    PyFloatInt_Type.tp_new = PyFloat_Type.tp_new;
    PyFloatInt_Type.tp_dealloc = PyFloat_Type.tp_dealloc;
    PyFloatInt_Type.tp_free = PyObject_Del;
    if (PyType_Ready(&PyFloatInt_Type) < 0) return;
    /* End specific code */

    dtype = _register_dtype();
    Py_XINCREF(dtype);
    if (dtype != NULL) {
	PyDict_SetItemString(d, "floatint_type", (PyObject *)dtype);
    }
    Py_INCREF(&PyFloatInt_Type);
    PyDict_SetItemString(d, "floatint", (PyObject *)&PyFloatInt_Type);
    return;
}


text:
<?php
require_once(dirname(__FILE__).'/test/lib/bootstrap.php');

$h = new lime_harness(new lime_output_color());
$h->register(dirname(__FILE__)."/test");
$h->register(dirname(__FILE__)."/test/bugs");
$h->run();


text:
package main

import (
    "fmt"
    "net/http"
)

type Hello struct{}

type String string

type Struct struct {
  Greeting string
  Punct    string
  Who      string
}

func (h Hello) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    fmt.Fprint(w, "Hello!")
}

func (s String) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    fmt.Fprint(w, s)
}

func (s Struct) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    fmt.Fprint(w, s.Greeting + s.Punct + s.Who)
}

// Package http serves HTTP requests using any value that implements http.Handler
func main() {
    h := Hello{}
    http.Handle("/", h)
    http.Handle("/string", String("I'm a frayed knot."))
    http.Handle("/struct", Struct{"Hello", ":", "Gophers!"})
    http.ListenAndServe("localhost:4000", nil)
}


text:
package org.springframework.security.ldap.authentication;

import org.junit.*;
import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.crypto.keygen.KeyGenerators;
import org.springframework.security.crypto.password.LdapShaPasswordEncoder;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;

import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DistinguishedName;
import org.springframework.security.ldap.ApacheDsContainerConfig;
import org.springframework.security.ldap.DefaultSpringSecurityContextSource;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import static org.assertj.core.api.Assertions.*;

/**
 * Tests for {@link PasswordComparisonAuthenticator}.
 *
 * @author Luke Taylor
 * @author Eddú Meléndez
 */
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = ApacheDsContainerConfig.class)
public class PasswordComparisonAuthenticatorTests {
	// ~ Instance fields
	// ================================================================================================

	@Autowired
	private DefaultSpringSecurityContextSource contextSource;
	private PasswordComparisonAuthenticator authenticator;
	private Authentication bob;
	private Authentication ben;

	// ~ Methods
	// ========================================================================================================

	@Before
	public void setUp() throws Exception {
		authenticator = new PasswordComparisonAuthenticator(this.contextSource);
		authenticator.setPasswordEncoder(NoOpPasswordEncoder.getInstance());
		authenticator.setUserDnPatterns(new String[] { "uid={0},ou=people" });
		bob = new UsernamePasswordAuthenticationToken("bob", "bobspassword");
		ben = new UsernamePasswordAuthenticationToken("ben", "benspassword");
	}

	@Test
	public void testAllAttributesAreRetrievedByDefault() {
		DirContextAdapter user = (DirContextAdapter) authenticator.authenticate(bob);
		// System.out.println(user.getAttributes().toString());
		assertThat(user.getAttributes().size()).withFailMessage("User should have 5 attributes").isEqualTo(5);
	}

	@Test
	public void testFailedSearchGivesUserNotFoundException() throws Exception {
		authenticator = new PasswordComparisonAuthenticator(this.contextSource);
		assertThat(authenticator.getUserDns("Bob")).withFailMessage("User DN matches shouldn't be available").isEmpty();
		authenticator.setUserSearch(new MockUserSearch(null));
		authenticator.afterPropertiesSet();

		try {
			authenticator.authenticate(new UsernamePasswordAuthenticationToken("Joe",
					"pass"));
			fail("Expected exception on failed user search");
		}
		catch (UsernameNotFoundException expected) {
		}
	}

	@Test(expected = BadCredentialsException.class)
	public void testLdapPasswordCompareFailsWithWrongPassword() {
		// Don't retrieve the password
		authenticator.setUserAttributes(new String[] { "uid", "cn", "sn" });
		authenticator.authenticate(new UsernamePasswordAuthenticationToken("bob",
				"wrongpass"));
	}

	@Test
	public void testMultipleDnPatternsWorkOk() {
		authenticator.setUserDnPatterns(new String[] { "uid={0},ou=nonexistent",
				"uid={0},ou=people" });
		authenticator.authenticate(bob);
	}

	@Test
	public void testOnlySpecifiedAttributesAreRetrieved() throws Exception {
		authenticator.setUserAttributes(new String[] { "uid", "userPassword" });

		DirContextAdapter user = (DirContextAdapter) authenticator.authenticate(bob);
		assertThat(user
				.getAttributes().size()).withFailMessage("Should have retrieved 2 attribute (uid)").isEqualTo(2);
	}

	@Test
	public void testLdapCompareSucceedsWithCorrectPassword() {
		// Don't retrieve the password
		authenticator.setUserAttributes(new String[] { "uid" });
		authenticator.authenticate(bob);
	}

	@Test
	public void testLdapCompareSucceedsWithShaEncodedPassword() {
		// Don't retrieve the password
		authenticator.setUserAttributes(new String[] { "uid" });
		authenticator.setPasswordEncoder(new LdapShaPasswordEncoder(KeyGenerators.shared(0)));
		authenticator.setUsePasswordAttrCompare(false);
		authenticator.authenticate(ben);
	}

	@Test(expected = IllegalArgumentException.class)
	public void testPasswordEncoderCantBeNull() {
		authenticator.setPasswordEncoder(null);
	}

	@Test
	public void testUseOfDifferentPasswordAttributeSucceeds() {
		authenticator.setPasswordAttributeName("uid");
		authenticator.authenticate(new UsernamePasswordAuthenticationToken("bob", "bob"));
	}

	@Test
	public void testLdapCompareWithDifferentPasswordAttributeSucceeds() {
		authenticator.setUserAttributes(new String[] { "uid" });
		authenticator.setPasswordAttributeName("cn");
		authenticator.authenticate(new UsernamePasswordAuthenticationToken("ben",
				"Ben Alex"));
	}

	@Test
	public void testWithUserSearch() {
		authenticator = new PasswordComparisonAuthenticator(this.contextSource);
		authenticator.setPasswordEncoder(NoOpPasswordEncoder.getInstance());
		assertThat(authenticator.getUserDns("Bob")).withFailMessage("User DN matches shouldn't be available").isEmpty();

		DirContextAdapter ctx = new DirContextAdapter(new DistinguishedName(
				"uid=Bob,ou=people"));
		ctx.setAttributeValue("userPassword", "bobspassword");

		authenticator.setUserSearch(new MockUserSearch(ctx));
		authenticator.authenticate(new UsernamePasswordAuthenticationToken(
				"shouldntbeused", "bobspassword"));
	}
}


text:
namespace silifuzz {

// Pad `code` with architecture-specific trap instructions until `code` is
// exactly `target_size` bytes long.
// `target_size` - `code`.size() must not be negative and must also be a
// multiple of the trap instruction size.
template <typename Arch>
void PadToSizeWithTraps(std::string& code, size_t target_size);

// Returns the bytes that RestoreUContext() writes on the stack of the context
// it is jumping into. These bytes may depend on the GRegSet of the context it
// is jumping into. These bytes are immediately below the stack pointer and
// will be overwritten by any subsequent "push" instructions.
template <typename Arch>
std::string RestoreUContextStackBytes(const GRegSet<Arch>& gregs);

}  // namespace silifuzz

#endif  // THIRD_PARTY_SILIFUZZ_UTIL_ARCH_MEM_H_


text:
package org.snf4j.core.codec.zip;

import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.nio.ByteBuffer;
import java.util.zip.Deflater;

import org.junit.Test;
import org.snf4j.core.handler.SessionEvent;
import org.snf4j.core.session.ISession;

public class ZlibEncoderTest extends EncoderTest {

	@Test
	public void testConstructor() throws Exception {
		ZlibEncoder e = new ZlibEncoder();
		assertTrue(e.getInboundType() == byte[].class);
		assertTrue(e.getOutboundType() == ByteBuffer.class);

		byte[] data = "1234567890".getBytes();
		Deflater deflater = getDeflater(e);
		Deflater expected = new Deflater(6);
		byte[] dbuf = new byte[100];
		byte[] ebuf = new byte[100];
		deflater.setInput(data);
		expected.setInput(data);
		int elen = expected.deflate(ebuf,0, 2, Deflater.SYNC_FLUSH);
		int dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		e = new ZlibEncoder(1);
		deflater = getDeflater(e);
		expected = new Deflater(1);
		deflater.setInput(data);
		expected.setInput(data);
		elen = expected.deflate(ebuf,0, 2, Deflater.SYNC_FLUSH);
		dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		e = new ZlibEncoder(1, ZlibCodec.Mode.ZLIB);
		deflater = getDeflater(e);
		deflater.setInput(data);
		dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		e = new ZlibEncoder(1, ZlibCodec.Mode.AUTO);
		deflater = getDeflater(e);
		deflater.setInput(data);
		dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		e = new ZlibEncoder(1, ZlibCodec.Mode.RAW);
		deflater = getDeflater(e);
		expected = new Deflater(1,true);
		deflater.setInput(data);
		expected.setInput(data);
		elen = expected.deflate(ebuf,0, 2, Deflater.SYNC_FLUSH);
		dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		byte[] dict = new byte[1];
		e = new ZlibEncoder(1, dict);
		deflater = getDeflater(e);
		expected = new Deflater(1);
		expected.setDictionary(dict);
		deflater.setInput(data);
		expected.setInput(data);
		elen = expected.deflate(ebuf,0, 2, Deflater.SYNC_FLUSH);
		dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		e = new ZlibEncoder(dict);
		deflater = getDeflater(e);
		expected = new Deflater(6);
		expected.setDictionary(dict);
		deflater.setInput(data);
		expected.setInput(data);
		elen = expected.deflate(ebuf,0, 2, Deflater.SYNC_FLUSH);
		dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		e = new ZlibEncoder(1, (byte[])null);
		deflater = getDeflater(e);
		expected = new Deflater(1);
		deflater.setInput(data);
		expected.setInput(data);
		elen = expected.deflate(ebuf,0, 2, Deflater.SYNC_FLUSH);
		dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		e = new ZlibEncoder((byte[])null);
		deflater = getDeflater(e);
		expected = new Deflater(6);
		deflater.setInput(data);
		expected.setInput(data);
		elen = expected.deflate(ebuf,0, 2, Deflater.SYNC_FLUSH);
		dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		e = new ZlibEncoder(1, dict, ZlibCodec.Mode.RAW);
		deflater = getDeflater(e);
		expected = new Deflater(1,true);
		expected.setDictionary(dict);
		deflater.setInput(data);
		expected.setInput(data);
		elen = expected.deflate(ebuf,0, 2, Deflater.SYNC_FLUSH);
		dlen = deflater.deflate(dbuf,0, 2, Deflater.SYNC_FLUSH);
		assertEquals(elen, dlen);
		assertArrayEquals(ebuf, dbuf);

		for (int i=0; i<10; i++) {
			e = new ZlibEncoder(i);
		}
		try {
			e = new ZlibEncoder(-1); fail();
		}
		catch (IllegalArgumentException ex) {
		}
		try {
			e = new ZlibEncoder(10); fail();
		}
		catch (IllegalArgumentException ex) {
		}
		try {
			e = new ZlibEncoder(6, new byte[0], null); fail();
		}
		catch (NullPointerException ex) {
		}
	}

	@Test
	public void testFinish() throws Exception {

		//no data deflated
		TestZlibEncoder e = new TestZlibEncoder();
		e.finish();
		assertFalse(e.isFinished());
		e.encode(null, new byte[0], out);
		assertTrue(e.isFinished());
		assertDeflate("", 1, true, false);
		e.encode(null, "ew".getBytes(), out);
		assertEquals(2, out.size());
		assertEquals("ew", new String(out.get(1).array()));
		out.clear();
		e = new TestZlibEncoder(ZlibCodec.Mode.RAW);
		e.finish();
		assertFalse(e.isFinished());
		e.encode(null, new byte[0], out);
		assertTrue(e.isFinished());
		assertDeflate("", 1, true, true);
		e.encode(null, "ew".getBytes(), out);
		assertEquals(2, out.size());
		assertEquals("ew", new String(out.get(1).array()));
		out.clear();

		//data deflated
		e = new TestZlibEncoder();
		e.encode(null, "1234".getBytes(), out);
		assertDeflate("1234", 1, false, false);
		e.finish();
		assertFalse(e.isFinished());
		e.encode(null, "567".getBytes(), out);
		assertDeflate("1234", 3, true, false);
		assertTrue(e.isFinished());
		assertEquals("567", new String(out.get(2).array()));
		out.clear();
		e = new TestZlibEncoder(ZlibCodec.Mode.RAW);
		e.encode(null, "1234".getBytes(), out);
		assertDeflate("1234", 1, false, true);
		e.finish();
		assertFalse(e.isFinished());
		e.encode(null, "567".getBytes(), out);
		assertDeflate("1234", 3, true, true);
		assertTrue(e.isFinished());
		assertEquals("567", new String(out.get(2).array()));
		out.clear();

		//bound to short
		e = new TestZlibEncoder();
		e.deflateBound = 2;
		e.finish();
		assertFalse(e.isFinished());
		e.encode(null, new byte[0], out);
		assertTrue(e.isFinished());
		assertNull(getDeflater(e));
		assertDeflate("", 2, true, false);
		e.encode(null, "ew".getBytes(), out);
		assertEquals(3, out.size());
		assertEquals("ew", new String(out.get(2).array()));
		out.clear();
	}

	@Test
	public void testEncode() throws Exception {
		TestZlibEncoder e = new TestZlibEncoder();

		e.encode(null, new byte[0], out);
		assertEquals(0, out.size());
		assertEquals(0, e.preDeflateCount);

		e.encode(null, "a".getBytes(), out);
		assertDeflate("a", 1);
		out.clear();

		e = new TestZlibEncoder();
		e.encode(null, "abcdefghij".getBytes(), out);
		assertDeflate("abcdefghij", 1);
		out.clear();

		e = new TestZlibEncoder();
		e.encode(null, "123456789".getBytes(), out);
		e.encode(null, "abcdefghi".getBytes(), out);
		assertDeflate("123456789abcdefghi", 2);
		out.clear();

		String inData = "1234567890abcdefghijklmnop";
		e = new TestZlibEncoder();
		e.encode(null, inData.getBytes(), out);
		assertDeflate(inData, 1);
		int limit = out.get(0).limit();
		out.clear();

		e = new TestZlibEncoder();
		e.deflateBound = limit-2;
		e.encode(null, inData.getBytes(), out);
		assertDeflate(inData, 2);
		out.clear();

		e = new TestZlibEncoder();
		e.deflateBound = limit;
		e.encode(null, inData.getBytes(), out);
		assertDeflate(inData, 2);
		out.clear();

		e = new TestZlibEncoder();
		e.deflateBound = 0;
		e.encode(null, inData.getBytes(), out);
		assertDeflate(inData, out.size());

	}

	static int expectedBound(int len) {
		return len + ((len + 7) >> 3) + ((len + 63) >> 6) + 5 + 10;
	}

	@Test
	public void testDeflateBound() throws Exception {
		TestZlibEncoder e = new TestZlibEncoder();
		e.encode(null, "1".getBytes(), out);
		assertTrue(expectedBound(1) == e.boundOut);

		e = new TestZlibEncoder();
		e.encode(null, new byte[1000], out);
		assertTrue(expectedBound(1000) == e.boundOut);

	}

	@Test
	public void testDeflateWithDictionary() throws Exception {
		byte[] dic = "abcd".getBytes();
		ZlibEncoder e = new ZlibEncoder(6, dic);
		e.encode(null, "abcdabcd".getBytes(), out);
		dictionary = dic;
		assertDeflate("abcdabcd", 1);
		out.clear();

		e = new ZlibEncoder(6, dic, ZlibCodec.Mode.ZLIB);
		e.encode(null, "abcdabcd".getBytes(), out);
		dictionary = dic;
		assertDeflate("abcdabcd", 1);
	}

	@Test
	public void testEvents() throws Exception {
		ZlibEncoder d = new ZlibEncoder();

		assertFalse(d.isFinished());
		d.added(null, null);
		d.removed(null, null);
		d.event(null, SessionEvent.CREATED);
		assertFalse(d.isFinished());
		d.event(null, SessionEvent.OPENED);
		assertFalse(d.isFinished());
		d.event(null, SessionEvent.READY);
		assertFalse(d.isFinished());
		d.event(null, SessionEvent.CLOSED);
		assertFalse(d.isFinished());
		assertNotNull(getDeflater(d));
		d.event(null, SessionEvent.ENDING);
		assertTrue(d.isFinished());
		assertNull(getDeflater(d));

		d.event(null, SessionEvent.CREATED);
		d.event(null, SessionEvent.OPENED);
		d.event(null, SessionEvent.READY);
		d.event(null, SessionEvent.CLOSED);
		d.event(null, SessionEvent.ENDING);
	}

	static class TestZlibEncoder extends ZlibEncoder {

		int preDeflateCount;
		int preFinishCount;
		int postFinishCount;
		int boundIn;
		int boundOut;
		int deflateBound = -1;

		TestZlibEncoder() {
			super(6, ZlibCodec.Mode.ZLIB);
		}

		TestZlibEncoder(Mode mode) {
			super(6, mode);
		}

		protected void preDeflate(ISession session, byte[] in, ByteBuffer out) throws Exception {
			++preDeflateCount;
			super.preDeflate(session, in, out);
		}

		protected void preFinish(ISession session, ByteBuffer out) throws Exception {
			++preFinishCount;
			super.preFinish(session, out);
		}

		protected void postFinish(ISession session, ByteBuffer out) throws Exception {
			++postFinishCount;
			super.postFinish(session, out);
		}

		protected int deflateBound(int len) {
			boundOut = deflateBound == -1 ? super.deflateBound(len) : deflateBound;
			boundIn = len;
			deflateBound = -1;
			return boundOut;
		}
	}

}


text:
class Rosenbrock
{
    private:

        // Constants
        static constexpr int n1 = 3;
        static constexpr int n2 = 2;
        static constexpr double a = 1.0/20.0;
        static constexpr double b = 100.0/20.0;
        static constexpr double mu = 1.0;

	private:
		std::vector<std::vector<double>> xs;

	public:
		// Constructor only gives size of params
		Rosenbrock();

		// Generate the point from the prior
		void from_prior(DNest4::RNG& rng);

		// Metropolis-Hastings proposals
		double perturb(DNest4::RNG& rng);

		// Likelihood function
		double log_likelihood() const;

		// Print to stream
		void print(std::ostream& out) const;

		// Return string with column information
		std::string description() const;
};

#endif


text:
package linkedlist.singly;

import linkedlist.singly.introduction.LinkedList;

import java.util.Objects;

/**
 * https://www.geeksforgeeks.org/iteratively-reverse-a-linked-list-using-only-2-pointers/
 *

 * Given pointer to the head node of a linked list, the task is to reverse the linked list.
 *

 * Examples:
 *

 * Input : Head of following linked list
 * 1->2->3->4->NULL
 * Output : Linked list should be changed to,
 * 4->3->2->1->NULL
 *

 * Input : Head of following linked list
 * 1->2->3->4->5->NULL
 * Output : Linked list should be changed to,
 * 5->4->3->2->1->NULL
 */
public class IterativelyReverse extends LinkedList {

    public void reverse() {
        Node prev = null, current = head;
        while (Objects.nonNull(current)) {
            Node next = current.getNext();
            current.setNext(prev);
            prev = current;
            current = next;
        }
        head = prev;
    }

    public static void main(String[] args) {
        IterativelyReverse llist = new IterativelyReverse();
        llist.push(20);
        llist.push(4);
        llist.push(15);
        llist.push(85);

        System.out.println("Given Linked List");
        llist.printList();
        llist.reverse();
        System.out.println("\nReversed Linked List");
        llist.printList();

    }
}


text:
using Livet;
using MetroTrilithon.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShipTimerForKCV.ViewModels
{
    public class LogViewModel : ViewModel
    {
        #region log 変更通知プロパティ

        private string _LogText;

        public virtual string LogText
        {
            get { return this._LogText; }
            set
            {
                if (this._LogText != value)
                {
                    this._LogText = value;
                    this.RaisePropertyChanged();
                }
            }
        }

        #endregion
    }
}


text:
$currentPath = Convert-Path .
Write-Host "Current path: " + $currentPath

$path = $env:APPVEYOR_BUILD_FOLDER + "\Deploy\wox.nuspec"
Write-Host "nuspec path: " + $path
$releasePath = $env:APPVEYOR_BUILD_FOLDER + "\Output\Release"
& nuget.exe pack $path -Version $env:APPVEYOR_BUILD_VERSION -Properties Configuration=Release -BasePath $releasePath

$nupkgPath = $env:APPVEYOR_BUILD_FOLDER + "\Wox." + $env:APPVEYOR_BUILD_VERSION + ".nupkg"
Write-Host "nupkg path: " + $nupkgPath

# must use Squirrel.com, Squirrel.exe will produce nothing
$squirrelPath = $env:APPVEYOR_BUILD_FOLDER + "\packages\squirrel*\tools\Squirrel.com"
Write-Host "squirrel path: " + $squirrelPath
$iconPath = $env:APPVEYOR_BUILD_FOLDER + "\Wox\Resources\app.ico"
& $squirrelPath --releasify $nupkgPath --setupIcon $iconPath --no-msi

$path = "Releases\" + "Wox-" + $env:APPVEYOR_BUILD_VERSION + ".exe"
mv Releases\Setup.exe $path


text:
//snippet-sourcedescription:[ses_listreceiptfilters.js demonstrates how to list the Amazon SES IP filters for an AWS account.]
//snippet-keyword:[JavaScript]
//snippet-sourcesyntax:[javascript]
//snippet-keyword:[Code Sample]
//snippet-keyword:[Amazon Simple Email Service]
//snippet-service:[ses]
//snippet-sourcetype:[full-example]
//snippet-sourcedate:[2018-06-02]
//snippet-sourceauthor:[AWS-JSDG]

// ABOUT THIS NODE.JS SAMPLE: This sample is part of the SDK for JavaScript Developer Guide topic at
// https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/ses-examples-ip-filters.html

// snippet-start:[ses.JavaScript.filters.listReceiptFilters]
// Load the AWS SDK for Node.js
var AWS = require('aws-sdk');
// Set the region
AWS.config.update({region: 'REGION'});

// Create the promise and SES service object
var sendPromise = new AWS.SES({apiVersion: '2010-12-01'}).listReceiptFilters({}).promise();

// Handle promise's fulfilled/rejected states
sendPromise.then(
  function(data) {
    console.log(data.Filters);
  }).catch(
    function(err) {
    console.error(err, err.stack);
  });
// snippet-end:[ses.JavaScript.filters.listReceiptFilters]


text:
int32_t RtspReceiveResponse(uint32_t sockfd, BufferControl *bctrl);
int32_t RtspCheckResponseStatus(char *buff);

#endif


text:
ALTER TABLE fcp_review_request DROP COLUMN reviewed;
ALTER TABLE fcp_review_request ADD COLUMN fk_reviewed_comment INTEGER REFERENCES issuecomment (id);


text:
package org.apache.ignite.internal.visor.compute;

import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.ignite.IgniteCompute;
import org.apache.ignite.compute.ComputeJobResult;
import org.apache.ignite.compute.ComputeTaskFuture;
import org.apache.ignite.internal.processors.task.GridInternal;
import org.apache.ignite.internal.util.typedef.internal.S;
import org.apache.ignite.internal.visor.VisorJob;
import org.apache.ignite.internal.visor.VisorMultiNodeTask;
import org.apache.ignite.lang.IgniteUuid;
import org.jetbrains.annotations.Nullable;

/**
 * Cancels given tasks sessions.
 */
@GridInternal
public class VisorComputeCancelSessionsTask extends VisorMultiNodeTask<VisorComputeCancelSessionsTaskArg, Void, Void> {
    /** */
    private static final long serialVersionUID = 0L;

    /** {@inheritDoc} */
    @Override protected VisorComputeCancelSessionsJob job(VisorComputeCancelSessionsTaskArg arg) {
        return new VisorComputeCancelSessionsJob(arg, debug);
    }

    /** {@inheritDoc} */
    @Nullable @Override protected Void reduce0(List<ComputeJobResult> results) {
        // No-op, just awaiting all jobs done.
        return null;
    }

    /**
     * Job that cancel tasks.
     */
    private static class VisorComputeCancelSessionsJob extends VisorJob<VisorComputeCancelSessionsTaskArg, Void> {
        /** */
        private static final long serialVersionUID = 0L;

        /**
         * @param arg Map with task sessions IDs to cancel.
         * @param debug Debug flag.
         */
        private VisorComputeCancelSessionsJob(VisorComputeCancelSessionsTaskArg arg, boolean debug) {
            super(arg, debug);
        }

        /** {@inheritDoc} */
        @Override protected Void run(VisorComputeCancelSessionsTaskArg arg) {
            Set<IgniteUuid> sesIds = arg.getSessionIds().get(ignite.localNode().id());

            if (sesIds != null && !sesIds.isEmpty()) {
                IgniteCompute compute = ignite.compute(ignite.cluster().forLocal());

                Map<IgniteUuid, ComputeTaskFuture<Object>> futs = compute.activeTaskFutures();

                for (IgniteUuid sesId : sesIds) {
                    ComputeTaskFuture<Object> fut = futs.get(sesId);

                    if (fut != null)
                        fut.cancel();
                }
            }

            return null;
        }

        /** {@inheritDoc} */
        @Override public String toString() {
            return S.toString(VisorComputeCancelSessionsJob.class, this);
        }
    }
}


text:
import should from 'should';
import sinon from 'sinon';
import Resource from '../../../lib/resource.js';
import HtmlHandler from '../../../lib/resource-handler/html/index.js';

import HtmlImgSrcsetTag from '../../../lib/resource-handler/path-containers/html-img-srcset-tag.js';
import HtmlCommonTag from '../../../lib/resource-handler/path-containers/html-common-tag.js';
import CssText from '../../../lib/resource-handler/path-containers/css-text.js';

describe('ResourceHandler: Html', () => {
	let downloadChildrenPaths, htmlHandler;

	beforeEach(() => {
		downloadChildrenPaths = sinon.stub().resolves();
	});

	describe('constructor', () => {
		describe('sources', () => {
			it('should initialize sources if updateMissingSources was not passed', () => {
				const sources = [{ selector: 'img', attr: 'src'}];
				htmlHandler = new HtmlHandler({sources}, {downloadChildrenPaths});

				htmlHandler.downloadSources.should.eql(sources);
				htmlHandler.updateSources.should.eql([]);
				htmlHandler.allSources.should.eql(sources);
			});

			it('should initialize sources if updateMissingSources = false', () => {
				const sources = [{ selector: 'img', attr: 'src'}];
				htmlHandler = new HtmlHandler({sources, updateMissingSources: false}, {downloadChildrenPaths});

				htmlHandler.downloadSources.should.eql(sources);
				htmlHandler.updateSources.should.eql([]);
				htmlHandler.allSources.should.eql(sources);
			});

			it('should initialize sources if updateMissingSources = true', () => {
				const sources = [{ selector: 'img', attr: 'src'}];
				htmlHandler = new HtmlHandler({sources, updateMissingSources: true}, {downloadChildrenPaths});

				htmlHandler.downloadSources.should.eql(sources);
				htmlHandler.updateSources.should.eql(sources);
				htmlHandler.allSources.should.eql(sources);
			});

			it('should initialize sources if updateMissingSources is array of sources', () => {
				const sources = [{ selector: 'img', attr: 'src'}];
				const updateMissingSources = [{ selector: 'a', attr: 'href'}];
				htmlHandler = new HtmlHandler({sources, updateMissingSources}, {downloadChildrenPaths});

				htmlHandler.downloadSources.should.eql(sources);
				htmlHandler.updateSources.should.eql(updateMissingSources);
				htmlHandler.allSources.should.eql([{ selector: 'img', attr: 'src'}, { selector: 'a', attr: 'href'}]);
			});

			it('should initialize sources without duplicates if updateMissingSources is array of sources', () => {
				const sources = [{ selector: 'img', attr: 'src'}];
				const updateMissingSources = [{ selector: 'img', attr: 'src'}, { selector: 'a', attr: 'href'}];
				htmlHandler = new HtmlHandler({sources, updateMissingSources}, {downloadChildrenPaths});

				htmlHandler.downloadSources.should.eql(sources);
				htmlHandler.updateSources.should.eql(updateMissingSources);
				htmlHandler.allSources.should.eql([{ selector: 'img', attr: 'src'}, { selector: 'a', attr: 'href'}]);
			});
		});
	});

	describe('<base> tag', () => {
		beforeEach(() => {
			htmlHandler = new HtmlHandler({ sources: [] }, {downloadChildrenPaths});
		});

		it('should remove base tag from text and update resource url for absolute href', () => {
			const html = `

					<base href="http://some-other-domain.com/src">

			`;
			const resource = new Resource('http://example.com', 'index.html');
			resource.setText(html);

			return htmlHandler.handle(resource).then(() =>{
				resource.getUrl().should.be.eql('http://some-other-domain.com/src');
				resource.getText().should.not.containEql('<base');
			});
		});

		it('should remove base tag from text and update resource url for relative href', () => {
			const html = `

					<base href="/src">

			`;
			const resource = new Resource('http://example.com', 'index.html');
			resource.setText(html);

			return htmlHandler.handle(resource).then(() => {
				resource.getUrl().should.be.eql('http://example.com/src');
				resource.getText().should.not.containEql('<base');
			});
		});

		it('should not remove base tag if it doesn\'t have href attribute', () => {
			const html = `

					<base target="_blank">

			`;
			const resource = new Resource('http://example.com', 'index.html');
			resource.setText(html);

			return htmlHandler.handle(resource).then(() => {
				resource.getUrl().should.be.eql('http://example.com');
				resource.getText().should.containEql('<base target="_blank">');
			});
		});
	});

	describe('<meta> tag', () => {
		beforeEach(() => {
			htmlHandler = new HtmlHandler({ sources: [] }, {downloadChildrenPaths});
		});

		it('should change encoding of resouce if html contains <meta> with charset attr', async () => {
			const html = `

					<meta charset="UTF-8">

			`;
			const resource = new Resource('http://example.com', 'index.html');
			resource.setText(html);

			await htmlHandler.handle(resource);
			should(resource.getEncoding()).eql('utf8');
		});
	});

	it('should not encode text to html entities', () => {
		htmlHandler = new HtmlHandler({ sources: [] }, {downloadChildrenPaths});
		const html = `

Этот текст не должен быть преобразован в html entities

		`;

		const resource = new Resource('http://example.com', 'index.html');
		resource.setText(html);

		return htmlHandler.handle(resource).then(() => {
			resource.getText().should.containEql('Этот текст не должен быть преобразован в html entities');
		});
	});

	it('should not update attribute names to lowercase', () => {
		htmlHandler = new HtmlHandler({ sources: [] }, {downloadChildrenPaths});
		const html = `

				<svg width="50" height="50" viewBox="0 0 100 100">
  					<ellipse cx="50" cy="50" rx="50" ry="50"></ellipse>
				</svg>

		`;

		const resource = new Resource('http://example.com', 'index.html');
		resource.setText(html);

		return htmlHandler.handle(resource).then(() => {
			resource.getText().should.containEql('viewBox="0 0 100 100"');
		});
	});

	it('should call downloadChildrenResources for each source', () => {
		const sources = [{ selector: 'img', attr: 'src' }];
		htmlHandler = new HtmlHandler({sources}, {downloadChildrenPaths});

		const html = `

		`;

		const resource = new Resource('http://example.com', 'index.html');
		resource.setText(html);

		return htmlHandler.handle(resource).then(() =>{
			htmlHandler.downloadChildrenPaths.calledThrice.should.be.eql(true);
		});
	});

	it('should not call downloadChildrenResources if source attr is empty', () =>{
		const sources = [{ selector: 'img', attr: 'src' }];
		htmlHandler = new HtmlHandler({sources}, {downloadChildrenPaths});

		const html = `

		`;

		const resource = new Resource('http://example.com', 'index.html');
		resource.setText(html);

		return htmlHandler.handle(resource).then(() =>{
			htmlHandler.downloadChildrenPaths.called.should.be.eql(false);
		});
	});

	it('should use correct path containers based on tag', () => {
		const sources = [
			{ selector: 'img', attr: 'src' },
			{ selector: 'img', attr: 'srcset' },
			{ selector: '.styled', attr: 'style' }
		];
		htmlHandler = new HtmlHandler({sources}, {downloadChildrenPaths});

		const html = `

		`;

		const resource = new Resource('http://example.com', 'index.html');
		resource.setText(html);

		return htmlHandler.handle(resource).then(() =>{
			htmlHandler.downloadChildrenPaths.calledThrice.should.be.eql(true);
			htmlHandler.downloadChildrenPaths.args[0][0].should.be.instanceOf(HtmlCommonTag);
			htmlHandler.downloadChildrenPaths.args[1][0].should.be.instanceOf(HtmlImgSrcsetTag);
			htmlHandler.downloadChildrenPaths.args[2][0].should.be.instanceOf(CssText);
		});
	});

	it('should remove SRI check for loaded resources', () => {
		const sources = [
			{ selector: 'script', attr: 'src'}
		];
		htmlHandler = new HtmlHandler({sources}, {downloadChildrenPaths});

		const html = `

				<link href="http://examlpe.com/style.css" integrity="sha256-gaWb8m2IHSkoZnT23u/necREOC//MiCFtQukVUYMyuU=" rel="stylesheet">

		`;

		const resource = new Resource('http://example.com', 'index.html');
		resource.setText(html);

		// before handle should contain both integrity checks
		resource.getText().should.containEql('integrity="sha256-gaWb8m2IHSkoZnT23u/necREOC//MiCFtQukVUYMyuU="');
		resource.getText().should.containEql('integrity="sha256-X+Q/xqnlEgxCczSjjpp2AUGGgqM5gcBzhRQ0p+EAUEk="');

		return htmlHandler.handle(resource).then(() => {
			// after handle should contain integrity check for styles
			// but not contain integrity check for script because it was loaded
			resource.getText().should.containEql('integrity="sha256-gaWb8m2IHSkoZnT23u/necREOC//MiCFtQukVUYMyuU="');
			resource.getText().should.not.containEql('integrity="sha256-X+Q/xqnlEgxCczSjjpp2AUGGgqM5gcBzhRQ0p+EAUEk="');
		});
	});

	it('should use html entities for updated attributes', async () => {
		const sources = [
			{ selector: '[style]', attr: 'style' },
		];
		downloadChildrenPaths.onFirstCall().resolves('width: 300px; height: 300px; background-image:url("./images/cat.jpg")');
		htmlHandler = new HtmlHandler({sources}, {downloadChildrenPaths});

		const html = `

		`;

		const resource = new Resource('http://example.com', 'index.html');
		resource.setText(html);

		await htmlHandler.handle(resource);
		const text = resource.getText();

		should(text).containEql('style="width: 300px; height: 300px; background-image:url("./images/cat.jpg")"');
	});
});


text:
'''

Integration test for testing thick/thick data volume operations on mini.

@author: zhaohao.chen
'''

import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.zstack_test.zstack_test_volume as test_volume_header
import zstackwoodpecker.operations.volume_operations as vol_ops
import zstackwoodpecker.zstack_test.zstack_test_vm as test_vm_header
import zstackwoodpecker.operations.vm_operations as vm_ops
import zstackwoodpecker.header.volume as volume_header
import time
import os
import random
import threading

PROVISION = ["volumeProvisioningStrategy::ThinProvisioning","volumeProvisioningStrategy::ThickProvisioning"]
round_num = 10
volume = None
vm = None
volumes = []
ts_attach = []
ts = []
test_obj_dict = test_state.TestStateDict()
#state
CREATED = volume_header.CREATED
DETACHED = volume_header.DETACHED
ATTACHED = volume_header.ATTACHED
DELETED = volume_header.DELETED
EXPUNGED = volume_header.EXPUNGED

def vol_random_ops(vol, vm, vm_uuid):
    i = 0
    while vol.state != EXPUNGED:
        test_util.test_logger("op round%s: volume state %s" % (i,vol.state))
        i += 1
        if vol.state == CREATED or vol.state == DETACHED:
            op = random.choice([vol.delete, vol.attach])
            if op == vol.attach:
                op(vm)
            else:
                op()
            continue
        elif vol.state == ATTACHED:
            op = random.choice([vol.delete, vol.detach])
            if op == vol.detach:
               op(vm_uuid)
            else:
               op()
            continue
        elif vol.state == DELETED:
            op = random.choice([vol.expunge, vol.recover])
            op()
            continue
    return

def test():
    global vm
    global test_obj_dict
    VM_CPU= 2
    VM_MEM = 2147483648
    #1.create vm
    vm_creation_option = test_util.VmOption()
    image_name = os.environ.get('imageName_s')
    image_uuid = test_lib.lib_get_image_by_name(image_name).uuid
    l3_name = os.environ.get('l3VlanNetworkName1')
    l3_net_uuid = test_lib.lib_get_l3_by_name(l3_name).uuid
    vm_creation_option.set_l3_uuids([l3_net_uuid])
    vm_creation_option.set_image_uuid(image_uuid)
    vm_creation_option.set_name('Mini_vm_datavolume_test')
    vm_creation_option.set_cpu_num(VM_CPU)
    vm_creation_option.set_memory_size(VM_MEM)
    vm = test_vm_header.ZstackTestVm()
    vm.set_creation_option(vm_creation_option)
    vm.create()
    vm.check()
    test_obj_dict.add_vm(vm)
    vm_uuid = vm.get_vm().uuid
    vm_cluster_uuid = vm.get_vm().clusterUuid
    #2.data volume operations test
    mini_cluster = "miniStorage::clusterUuid::%s" % vm_cluster_uuid
    volume_creation_option = test_util.VolumeOption()
    volume_creation_option.set_system_tags([mini_cluster])
    ps_uuid = res_ops.query_resource(res_ops.PRIMARY_STORAGE)[0].uuid
    volume_creation_option.set_primary_storage_uuid(ps_uuid)
    #create thin/thick data volume with random disksize and random provision type
    for i in range(round_num):
        volume_name = "volume_%s" % i
        volume_creation_option.set_name(volume_name)
        max_size = (res_ops.query_resource(res_ops.PRIMARY_STORAGE)[0].availableCapacity - 1073741824)/(20 * 512)
        disk_size = random.randint(2048, max_size) * 512
        volume_creation_option.set_diskSize(disk_size)
        volume_creation_option.set_system_tags([random.choice(PROVISION)])
        volume = test_volume_header.ZstackTestVolume()
        volume.set_volume(vol_ops.create_volume_from_diskSize(volume_creation_option))
        volume.check()
        test_obj_dict.add_volume(volume)
        volume.state = CREATED
        volumes.append(volume)
    for vol in volumes:
        t = threading.Thread(target=vol_random_ops,args=(vol, vm, vm_uuid))
        ts.append(t)
        test_util.test_logger("thread added")
        t.start()
        test_util.test_logger("thread started")
    for t in ts:
        t.join()
    test_util.test_pass("Mini Data Volume Operations Test Success")

def error_cleanup():
    global test_obj_dict
    test_lib.lib_error_cleanup(test_obj_dict)

def env_recover():
    global test_obj_dict
    test_lib.lib_error_cleanup(test_obj_dict)


text:
import os, linecache, re, json

work_directory_path = os.path.dirname(os.path.realpath(__file__))

fr_words_file = open(work_directory_path + "/fr_words.txt", "rU", encoding="ISO-8859-1")
fr_words = set()
for word in fr_words_file:
  fr_words |= {word.rstrip()}

data_directory_path = work_directory_path + "/ICDAR2017_datasetPostOCR_Evaluation_2M_v1.2"
fr_data_directory_paths = [data_directory_path + "/fr_monograph", data_directory_path + "/fr_periodical"]

output_file = open(work_directory_path + "/Results/result_fr_words.json", "w")
output_file.write("{")

for fr_data_directory_path in fr_data_directory_paths:
  for root_path, directories, files in os.walk(fr_data_directory_path):
    for file in files:
      if os.path.splitext(file)[1] == ".txt":
        output_file.write("\n    \""+os.path.basename(root_path)+"/"+file+"\": ")
        errors = {}
        file_path = root_path + "/" + file
        ocr_output = linecache.getline(file_path, 1)[14:].strip()

        word_begin_index = 0

        for i, character in enumerate(ocr_output):
          if character == ' ':
            word_end_index = i

            token = ocr_output[word_begin_index:word_end_index]

            apostrophe_pos = token.find("'")
            if apostrophe_pos != -1:
              # article = token[:apostrophe_pos]
              word = token[apostrophe_pos+1:]
            else:
              word = token

            clean_word = re.sub("\W+", '', word.lower()) ## TODO: handle "-" sign
            if clean_word not in fr_words:
              errors[str(word_begin_index)+":1"] = {}

            word_begin_index = word_end_index + 1

        token = ocr_output[word_begin_index:]

        apostrophe_pos = token.find("'")
        if apostrophe_pos != -1:
          word = token[apostrophe_pos+1:]
        else:
          word = token

        clean_word = re.sub("\W+", '', word.lower())
        if clean_word not in fr_words:
          errors[str(word_begin_index)+":1"] = {}

        output_file.write(json.dumps(errors, indent=8)+",")

output_file.seek(0, 2)
output_file.truncate(output_file.tell() - 1)

output_file = open(work_directory_path + "/Results/result_fr_words.json", "a")
output_file.write("\n}")


text:
cask "naver-whale" do
  version "2.9.118.38"
  sha256 :no_check

  url "http://update.whale.naver.net/downloads/installers/NaverWhale.dmg",
      verified: "update.whale.naver.net/downloads/installers/"
  name "NAVER Whale"
  desc "Web browser"
  homepage "https://whale.naver.com/"

  livecheck do
    url "https://cv.whale.naver.com/version/latest_version"
    strategy :page_match do |page|
      JSON.parse(page)["message"]["@version"]
    end
  end

  app "Whale.app"

  zap trash: [
    "~/Library/Caches/com.naver.Whale",
    "~/Library/Preferences/com.naver.Whale.plist",
    "~/Library/Saved Application State/com.naver.Whale.savedState",
  ]
end


text:
package cruise.umple.umple.impl;

import cruise.umple.umple.AssociationPosition_;
import cruise.umple.umple.ElementPosition_;
import cruise.umple.umple.Position_;
import cruise.umple.umple.UmplePackage;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 *
 * An implementation of the model object 'Position '.
 *
 *

 * The following features are implemented:
 *

 *
{@link cruise.umple.umple.impl.Position_Impl#getAssociationPosition_1 Association Position 1}

 *
{@link cruise.umple.umple.impl.Position_Impl#getElementPosition_1 Element Position 1}

 *

 *

 *
 * @generated
 */
public class Position_Impl extends MinimalEObjectImpl.Container implements Position_
{
  /**
   * The cached value of the '{@link #getAssociationPosition_1() Association Position 1}' containment reference list.
   *
   *
   * @see #getAssociationPosition_1()
   * @generated
   * @ordered
   */
  protected EList<AssociationPosition_> associationPosition_1;

  /**
   * The cached value of the '{@link #getElementPosition_1() Element Position 1}' containment reference list.
   *
   *
   * @see #getElementPosition_1()
   * @generated
   * @ordered
   */
  protected EList<ElementPosition_> elementPosition_1;

  /**
   *
   *
   * @generated
   */
  protected Position_Impl()
  {
    super();
  }

  /**
   *
   *
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return UmplePackage.eINSTANCE.getPosition_();
  }

  /**
   *
   *
   * @generated
   */
  public EList<AssociationPosition_> getAssociationPosition_1()
  {
    if (associationPosition_1 == null)
    {
      associationPosition_1 = new EObjectContainmentEList<AssociationPosition_>(AssociationPosition_.class, this, UmplePackage.POSITION___ASSOCIATION_POSITION_1);
    }
    return associationPosition_1;
  }

  /**
   *
   *
   * @generated
   */
  public EList<ElementPosition_> getElementPosition_1()
  {
    if (elementPosition_1 == null)
    {
      elementPosition_1 = new EObjectContainmentEList<ElementPosition_>(ElementPosition_.class, this, UmplePackage.POSITION___ELEMENT_POSITION_1);
    }
    return elementPosition_1;
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case UmplePackage.POSITION___ASSOCIATION_POSITION_1:
        return ((InternalEList<?>)getAssociationPosition_1()).basicRemove(otherEnd, msgs);
      case UmplePackage.POSITION___ELEMENT_POSITION_1:
        return ((InternalEList<?>)getElementPosition_1()).basicRemove(otherEnd, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case UmplePackage.POSITION___ASSOCIATION_POSITION_1:
        return getAssociationPosition_1();
      case UmplePackage.POSITION___ELEMENT_POSITION_1:
        return getElementPosition_1();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   *
   *
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case UmplePackage.POSITION___ASSOCIATION_POSITION_1:
        getAssociationPosition_1().clear();
        getAssociationPosition_1().addAll((Collection<? extends AssociationPosition_>)newValue);
        return;
      case UmplePackage.POSITION___ELEMENT_POSITION_1:
        getElementPosition_1().clear();
        getElementPosition_1().addAll((Collection<? extends ElementPosition_>)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case UmplePackage.POSITION___ASSOCIATION_POSITION_1:
        getAssociationPosition_1().clear();
        return;
      case UmplePackage.POSITION___ELEMENT_POSITION_1:
        getElementPosition_1().clear();
        return;
    }
    super.eUnset(featureID);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case UmplePackage.POSITION___ASSOCIATION_POSITION_1:
        return associationPosition_1 != null && !associationPosition_1.isEmpty();
      case UmplePackage.POSITION___ELEMENT_POSITION_1:
        return elementPosition_1 != null && !elementPosition_1.isEmpty();
    }
    return super.eIsSet(featureID);
  }

} //Position_Impl


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <!-- From: file:/home/jasper/Development/EdhrouterRedux/android/app/build/intermediates/exploded-aar/com.facebook.react/react-native/0.20.1/res/values-es-rES/values-es-rES.xml -->
    <eat-comment/>
    <string name="catalyst_debugjs">Debug JS</string>
    <string name="catalyst_element_inspector">Inspeccionar elemento</string>
    <string name="catalyst_jsload_error">Unable to download JS bundle</string>
    <string name="catalyst_jsload_message">Fetching JS bundle</string>
    <string name="catalyst_jsload_title">Espera...</string>
    <string name="catalyst_reloadjs">Reload JS</string>
    <string name="catalyst_settings">Dev Settings</string>
    <string name="catalyst_settings_title">Catalyst Dev Settings</string>
</resources>


text:
namespace MyServer.Web.Pages.About
{
    using Microsoft.AspNetCore.Mvc.RazorPages;

    public class CvModel : PageModel
    {
        public void OnGet()
        {
        }
    }
}