text:
#pragma once
#include <functional>
#include <type_traits>
#include <vector>
#include "base.h"

namespace gen
{

	struct reduce_policy
	{
		struct one;
		struct two;
	};

	template<typename T>
	class Reduce : public IGen<Reduce<T>, typename T::value_type>
	{
	public:
		//typedef RED generator_type;

	protected:

		const T gen_begin_;
		const T gen_end_;
		T gen_itr_;
		//std::vector<value_type> init_;		// Not currently used. ment for advance reduce. Remove it... place it in advance reduce???
		const std::function<value_type(value_type, value_type)> binary_op_;

		constexpr Reduce(const T & gen_begin, const T & gen_end,
			std::function<value_type(value_type, value_type)> binary_op,
			T gen_itr, typename T::value_type value, bool finished)
			:
			IGen<Reduce<T>, typename T::value_type>(value, finished),
			binary_op_(binary_op), gen_begin_(gen_begin), gen_end_(gen_end), gen_itr_(gen_itr)
		{
		}

	public:

		constexpr Reduce(const T & gen, std::function<value_type(value_type, value_type)> binary_op) :
			IGen<Reduce<T>, typename T::value_type>(*std::begin(gen), false),
			binary_op_(binary_op), gen_begin_(gen), gen_end_(std::end(gen)), gen_itr_(gen)
		{
		}
		constexpr Reduce(T gen_begin, T gen_end, std::function<value_type(value_type, value_type)> binary_op) :
			IGen<Reduce<T>, typename T::value_type>(*gen_begin, false),
			gen_begin_(gen_begin), gen_end_(gen_end), binary_op_(binary_op), gen_itr_(gen_begin)
		{
		}

		inline Reduce& operator++()
		{
			if (gen_itr_ != gen_end_)
			{
				value_ = binary_op_(value_, *gen_itr_);
				++gen_itr_;
			}
			else
				finished_ = true;

			return *this;
		}
		inline Reduce& operator++(int)
		{
			return this->operator++();
		}

		constexpr Reduce begin() const
		{
			return Reduce(gen_begin_, gen_end_, binary_op_);
		}

		constexpr Reduce end() const
		{
			return Reduce(gen_begin_, gen_end_, binary_op_, gen_itr_, value_, true);
		}
	};

	template<typename T>
	constexpr Reduce<T> reduce(T gen)
	{
		return Reduce<T>(gen, std::plus<T::value_type>());
	}
	template<typename T>
	constexpr Reduce<T> reduce(T begin, T end)
	{
		return Reduce<T>(begin, end, std::plus<T::value_type>());
	}

	template<typename T>
	constexpr Reduce<T> reduce(T gen, std::function<decltype(T::value_type())(decltype(T::value_type()), decltype(T::value_type()))> binary_op)
	{
		return Reduce<T>(gen, binary_op);
	}
	template<typename T>
	constexpr Reduce<T> reduce(T begin, T end, std::function<decltype(T::value_type())(decltype(T::value_type()), decltype(T::value_type()))> binary_op)
	{
		return Reduce<T>(begin, end, binary_op);
	}

	/*template<typename RED, typename T>
	class ReduceBase : public IGen<ReduceBase<RED, T>, typename T::value_type>
	{
	public:
		//typedef RED generator_type;

	protected:

		const T gen_begin_;
		const T gen_end_;
		std::vector<value_type> init_;		// Not currently used. ment for advance reduce. Remove it... place it in advance reduce???
		std::function<value_type(value_type, value_type)> binary_op_;

	public:

		constexpr ReduceBase(T gen, std::vector<value_type> init, std::function<value_type(value_type, value_type)> binary_op) :
			IGen<Range<VAL>, VAL>(start, false),
			init_(init), binary_op_(binary_op), gen_begin_(std::begin(gen)), gen_end_(std::end(gen)),
		{
			// = std::begin(gen);
			//gen_end_ = std::end(gen);
			//value_ = *gen_begin_;
		}
		constexpr ReduceBase(T gen_begin, T gen_end, std::vector<value_type> init, std::function<value_type(value_type, value_type)> binary_op) :
			IGen<Range<VAL>, VAL>(start, false),
			gen_begin_(gen_begin), gen_end_(gen_end), init_(init), binary_op_(binary_op),
		{
			//value_ = *gen_begin;
		}

		RED& operator++(int)
		{
			return this->operator++();
		}

		constexpr RED begin()
		{
			return RED(gen_begin_, gen_end_, init_, binary_op_);
		}

		constexpr RED end()
		{
			auto ret = RED(gen_begin_, gen_end_, init_, binary_op_);
			ret.finished_ = true;
			return ret;
		}
	};

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

	template<typename T>
	class Reduce : public ReduceBase<Reduce<T>, T>
	{
	public:
		using ReduceBase<Reduce<T>, T>::ReduceBase;

		Reduce& operator++()
		{
			if (gen_begin_ != gen_end_)
			{
				value_ = binary_op_(value_, *gen_begin_);
				++gen_begin_;
			}
			else
				finished_ = true;

			return *this;
		}
	};
	*/

	/*template<typename T>
	Reduce<T> reduce(T gen)
	{
		return Reduce<T>(gen, std::vector<decltype(T::value_type())> {}, std::plus<T::value_type>());
	}
	template<typename T>
	Reduce<T> reduce(T begin, T end)
	{
		return Reduce<T>(begin, end, std::vector<decltype(T::value_type())> {}, std::plus<T::value_type>());
	}

	template<typename T>
	Reduce<T> reduce(T gen, std::function<decltype(T::value_type())(decltype(T::value_type()), decltype(T::value_type()))> binary_op)
	{
		return Reduce<T>(gen, std::vector<decltype(T::value_type())> {}, binary_op);
	}
	template<typename T>
	Reduce<T> reduce(T begin, T end, std::function<decltype(T::value_type())(decltype(T::value_type()), decltype(T::value_type()))> binary_op)
	{
		return Reduce<T>(begin, end, std::vector<decltype(T::value_type())> {}, binary_op);
	}*/

	////////////////////////////////////////////////////////////////////////////////
	//
	//		Advance Reduce is skipped for now. only wanted to try out enable_if
	//

	/*template<typename T, typename P>
	class ReduceAdvBase : public ReduceBase<ReduceAdvBase<T, P>, T>
	{
	public:
		using ReduceBase<ReduceAdvBase<T, P>, T>::ReduceBase;

		template<typename U = P>
		typename std::enable_if<std::is_same<U, reduce_policy::one>::value>::type
			next()
		{
			if (gen_begin_ != gen_end_)
			{
				value_ = binary_op_(value_, *gen_begin_);
				++gen_begin_;
			}
			else
				finished_ = true;

			//return *this;
		}

		template<typename U = P>
		typename std::enable_if<std::is_same<U, reduce_policy::two>::value>::type
			next()
		{
			if (gen_begin_ != gen_end_)
			{
				value_ = binary_op_(value_, *gen_begin_);
				++gen_begin_;
			}
			else
				finished_ = true;

			//return *this;
		}

		ReduceAdvBase& operator++()
		{
			next();
			return *this;
		}
	};*/

	/*template<typename T>
	class ReduceAdvBase<T, reduce_policy> : public ReduceBase<ReduceAdvBase<T, reduce_policy>, T>
	{
	public:
		using ReduceBase<ReduceAdvBase<T, reduce_policy>, T>::ReduceBase;

		ReduceAdvBase& operator++() //override
		{
			//
			if (gen_begin_ != gen_end_)
			{
			value_ = binary_op_(value_, *gen_begin_);
			++gen_begin_;
			}
			else
				finished_ = true;

			return *this;
		}
	};*/

	/*template<typename P, typename T>
	ReduceAdvBase<T, P> reduce_advance(T gen, std::vector<int> init) //-> decltype(ReduceAdvBase<T, policy>)
	{
		return ReduceAdvBase<T, P>(gen, init, std::plus<T::value_type>());
	}*/

	/*template<typename T, typename P>
	ReduceAdvBase<T, P> reduce_advance(reduce_policy policy, T begin, T end, std::vector<decltype(T::value_type())> init)
	{
		return ReduceAdvBase<T, policy>(begin, end, init, std::plus<T::value_type>());
	}

	template<typename T, typename P>
	ReduceAdvBase<T, P> reduce_advance(reduce_policy policy, T gen, std::vector<decltype(T::value_type())> init, std::function<decltype(T::value_type())(decltype(T::value_type()), decltype(T::value_type()))> binary_op)
	{
		return ReduceAdvBase<T, policy>(gen, init, binary_op);
	}
	template<typename T, typename P>
	ReduceAdvBase<T, P> reduce_advance(reduce_policy policy, T begin, T end, std::vector<decltype(T::value_type())> init, std::function<decltype(T::value_type())(decltype(T::value_type()), decltype(T::value_type()))> binary_op)
	{
		return ReduceAdvBase<T, policy>(begin, init, end, binary_op);
	}*/

}


text:
package org.yarlithub.yschool.classroom.core;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yarlithub.yschool.repository.model.obj.yschool.Classroom;
import org.yarlithub.yschool.repository.model.obj.yschool.Grade;
import org.yarlithub.yschool.repository.services.data.DataLayerYschool;
import org.yarlithub.yschool.repository.services.data.DataLayerYschoolImpl;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Jay Krish
 * Date: 10/25/13
 * Time: 12:20 AM
 * To change this template use File | Settings | File Templates.
 * Updated by Phool Chandra
 */

public class ClassroomHelper {
	private static final Logger logger = LoggerFactory.getLogger(ClassroomHelper.class);
    static DataLayerYschool dataLayerYschool = DataLayerYschoolImpl.getInstance();

    /**
     * Returns Classroom objects for the current year for the given grade.
     *
     * @param grade org.yarlithub.yschool.repository.model.obj.yschool.Grade
     * @param year  int year.
     * @return List of org.yarlithub.yschool.repository.model.obj.yschool.Classroom,
     * empty list if no matching occurred.
     */
    public static List<Classroom> getClassrooms(Grade grade, int year) {
    	logger.debug("with in Helper method...");
        Criteria classroomCriteria = dataLayerYschool.createCriteria(Classroom.class);
        classroomCriteria.add(Restrictions.eq("year", year));
        classroomCriteria.add(Restrictions.eq("gradeIdgrade", grade));
        return classroomCriteria.list();
    }
    public static String getStaffNameByClassId(Classroom classroom){
    	return null;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package de.proteinms.omxparser.util;

import java.util.LinkedList;
import java.util.List;
import java.io.Serializable;

/**
 * Scaled product abundance.
 *

 * Please see "OMSSA.mod.xsd" for further information:
 *

 * See http://www.ncbi.nlm.nih.gov/data_specs/schema/OMSSA.mod.xsd
 *
 * @author Steffen Huber
 * @author Harald Barsnes
 */
public class MSSpectrum_abundance implements Serializable {

    /**
     * The list of MSSpectrum_abundance_E values from the omx file.
     *
     * Note that this value has to be divided by MSResponse_scale to get the
     * real abundance value.
     */
    public List<Integer> MSSpectrum_abundance_E = new LinkedList<Integer>();

    /**
     * Adds an element to the MSSpectrum_abundance_E list.
     *
     * @param s the element to add as a String
     */
    public void setMSSpectrum_abundance_E(String s) {
        MSSpectrum_abundance_E.add(Integer.valueOf(s));
    }
}


text:
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.chrome.browser.download.home.list;

import androidx.annotation.Nullable;

import org.chromium.chrome.browser.download.home.list.ListItem.ViewListItem;
import org.chromium.ui.modelutil.ListObservable;
import org.chromium.ui.modelutil.ListObservable.ListObserver;
import org.chromium.ui.modelutil.ListObservableImpl;
import org.chromium.ui.modelutil.PropertyModel;
import org.chromium.ui.modelutil.SimpleList;

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

/**
 * A wrapper class that adds decoration {@link ListItem}s to a {@link ListItemModel}.
 * TODO(bauerb): Replace this with InnerNode (once it has been migrated to the UI architecture)
 */
class DecoratedListItemModel
        extends ListObservableImpl<Void> implements ListObserver<Void>, SimpleList<ListItem> {
    private final ListItemModel mModel;

    private final List<ViewListItem> mHeaderItems = new ArrayList<>();

    /** Creates a {@link DecoratedListItemModel} instance that wraos {@code model}. */
    public DecoratedListItemModel(ListItemModel model) {
        mModel = model;
        mModel.addObserver(this);
    }

    /** @see ListItemModel#getProperties() */
    public PropertyModel getProperties() {
        return mModel.getProperties();
    }

    /** Adds {@code item} as a header for the list. */
    public void addHeader(ViewListItem item) {
        int index = mHeaderItems.size();
        mHeaderItems.add(item);
        notifyItemInserted(index);
    }

    // SimpleList implementation.
    @Override
    public int size() {
        return mModel.size() + mHeaderItems.size();
    }

    @Override
    public ListItem get(int index) {
        if (index < mHeaderItems.size()) return mHeaderItems.get(index);
        return mModel.get(convertIndexForSource(index));
    }

    // ListObserver implementation.
    @Override
    public void onItemRangeInserted(ListObservable source, int index, int count) {
        notifyItemRangeInserted(convertIndexFromSource(index), count);
    }

    @Override
    public void onItemRangeRemoved(ListObservable source, int index, int count) {
        notifyItemRangeRemoved(convertIndexFromSource(index), count);
    }

    @Override
    public void onItemRangeChanged(
            ListObservable source, int index, int count, @Nullable Void payload) {
        assert payload == null;
        notifyItemRangeChanged(convertIndexFromSource(index), count, payload);
    }

    private int convertIndexForSource(int index) {
        return index - mHeaderItems.size();
    }

    private int convertIndexFromSource(int index) {
        return index + mHeaderItems.size();
    }
}


text:
class `OffsetRequest`
=====================

**Header File:** `<libkafka_asio/offset_request.h>`

**Namespace:** `libkafka_asio`

Implementation of the Kafka OffsetRequest as described on the
[Kafka wiki](https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-OffsetRequest).
Offset requests are used to get the valid range of offsets for a topic partition
from a Kafka server. They must be send to the Kafka broker, which is currently
acting as leader for that topic partition.

<img src="http://yuml.me/diagram/nofunky;scale:80/class/
[OffsetRequest]++-*[Topic],
[Topic]++-*[Topic::Partition]"
/>

Member Functions
----------------

### FetchTopicOffset
```cpp
void FetchTopicOffset(const String& topic_name,
                      Int32 partition,
                      Int64 time,
                      Int32 max_number_of_offsets)
```

Fetches offset information for the given topic partition. The optional `time`
parameter can be used to ask for messages before a certain time in the past.
Time must be specified in milliseconds. Two special values exist for this
parameters:

* `libkafka_asio::constants::kOffsetTimeLatest` (`-1`) (Default) and
* `libkafka_asio::constants::kOffsetTimeEarliest` (`-2`).

The maximum number of offsets to fetch can optionally be specified as well.

```cpp
OffsetRequest request;

// Fetch latest offset for topic 'foo' partition 0
request.FetchOffset("foo", 0);
```

### Clear
```cpp
void Clear()
```

Clears all entries of this request for fetching offsets of topic partitions.

### replica_id
```cpp
Int32 replica_id() const
```

Always returns `-1`.

### topics
```cpp
const TopicVector& topics() const
```

Returns a reference to the list of topics of this offset request. This
method is mainly used internally for getting the request data during the
conversion to the Kafka wire format.

Types
-----

### Topic
```cpp
struct Topic
```

+ `topic_name`:
   Name of the topic to fetch data for.
+ `partitions`:
   Set of partitions of this topic to fetch offset data for.

### Topic::Partition
```cpp
struct Topic::Partition
```

+ `partition`:
   Number, identifying this topic partition.
+ `time`:
   Time in milliseconds to ask for messages before.
+ `max_number_of_offsets`:
   The maximum number of offsets to fetch for this topic partition.

### ResponseType
```cpp
typedef OffsetResponse ResponseType
```

Type of the response object of an offset request.

### MutableResponseType
```cpp
typedef MutableOffsetResponse MutableResponseType
```

Type of a mutable response object for a offset request. This type is used by
the library at when reading-in the response from a Kafka server.

### TopicVector
```cpp
typedef std::vector<Topic> TopicVector
```

Vector of topics to fetch offset data for.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>RestController (RESThub Spring stack 2.0.0 API)</title>
<meta name="date" content="2012-11-30">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.resthub.web.controller

Interface RestController<T,ID extends Serializable>

Type Parameters:

T - Your resource POJO to manage, maybe an entity or DTO class

ID - Primary resource identifier at webservice level, usually Long or String

All Known Implementing Classes:

RepositoryBasedRestController, ServiceBasedRestController

public interface RestController<T,ID extends Serializable>

REST controller interface

Method Summary

Methods

Modifier and Type
Method and Description

T
create(T resource)

Create a new resource

 REST webservice published : POST /

void
delete()

Delete all resources

 REST webservice published : DELETE /

 Return No Content http status code if the request has been correctly processed

void
delete(ID id)

Delete a resource by its identifier

 REST webservice published : DELETE /{id}

 Return No Content http status code if the request has been correctly processed

Iterable<T>
findAll()

Find all resources, and return the full collection (plain list not paginated)

 REST webservice published : GET /?

Iterable<T>
findAllXml()

XML findAll is currently unimplemented, see https://github.com/FasterXML/jackson-dataformat-xml/issues/38 for more details

T
findById(ID id)

Find a resource by its identifier

 REST webservice published : GET /{id}

org.springframework.data.domain.Page<T>
findPaginated(Integer page,
             Integer size)

Find all resources, and return a paginated collection

 REST webservice published : GET /search?

T
update(ID id,
      T resource)

Update an existing resource

 REST webservice published : PUT /{id}

Method Detail

create

@RequestMapping(method=POST)
@ResponseStatus(value=CREATED)
@ResponseBody
T create(@RequestBody
                                                  T resource)

Create a new resource

 REST webservice published : POST /

Parameters:

resource - The resource to create

Returns:

CREATED http status code if the request has been correctly processed, with updated resource enclosed in the body, usually with and additional identifier automatically created by the database

update

@RequestMapping(value="{id}",
                method=PUT)
@ResponseBody
T update(@PathVariable
                                   ID id,
                                   @RequestBody
                                   T resource)

Update an existing resource

 REST webservice published : PUT /{id}

Parameters:

id - The identifier of the resource to update, usually a Long or String identifier. It is explicitely provided in order to handle cases where the identifier could be changed.

resource - The resource to update

Returns:

OK http status code if the request has been correctly processed, with the updated resource enclosed in the body

Throws:

NotFoundException, - BadRequestException

findAllXml

@RequestMapping(method=GET,
                params="page=no",
                produces="application/xml")
@ResponseBody
Iterable<T> findAllXml()

XML findAll is currently unimplemented, see https://github.com/FasterXML/jackson-dataformat-xml/issues/38 for more details

Returns:

findAll

@RequestMapping(method=GET,
                params="page=no",
                produces="application/json")
@ResponseBody
Iterable<T> findAll()

Find all resources, and return the full collection (plain list not paginated)

 REST webservice published : GET /?page=no

Returns:

OK http status code if the request has been correctly processed, with the list of all resource enclosed in the body. Be carefull, this list should be big since it will return ALL resources. In this case, consider using paginated findAll method instead.

findPaginated

@RequestMapping(method=GET)
@ResponseBody
org.springframework.data.domain.Page<T> findPaginated(@RequestParam(value="page",required=false,defaultValue="1")
                                                                                Integer page,
                                                                                @RequestParam(value="size",required=false,defaultValue="10")
                                                                                Integer size)

Find all resources, and return a paginated collection

 REST webservice published : GET /search?page=0&size=20

Parameters:

page - Page number starting from 0. default to 0

size - Number of resources by pages. default to 10

Returns:

OK http status code if the request has been correctly processed, with the a paginated collection of all resource enclosed in the body.

findById

@RequestMapping(value="{id}",
                method=GET)
@ResponseBody
T findById(@PathVariable
                                     ID id)

Find a resource by its identifier

 REST webservice published : GET /{id}

Parameters:

id - The identifier of the resouce to find

Returns:

OK http status code if the request has been correctly processed, with resource found enclosed in the body

Throws:

NotFoundException

delete

@RequestMapping(method=DELETE)
@ResponseStatus(value=NO_CONTENT)
void delete()

Delete all resources

 REST webservice published : DELETE /

 Return No Content http status code if the request has been correctly processed

delete

@RequestMapping(value="{id}",
                method=DELETE)
@ResponseStatus(value=NO_CONTENT)
void delete(@PathVariable
                                        ID id)

Delete a resource by its identifier

 REST webservice published : DELETE /{id}

 Return No Content http status code if the request has been correctly processed

Parameters:

id - The identifier of the resource to delete

Throws:

NotFoundException

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2009-2012. All Rights Reserved.


text:
<meta charset="UTF-8">
<title>Paragraph.<init> - biomedicus-core</title>
<link rel="stylesheet" href="../../../style.css">

biomedicus-core / edu.umn.biomedicus.structure / Paragraph / <init>

<init>

Paragraph(<span class="identifier" id="edu.umn.biomedicus.structure.Paragraph$<init>(kotlin.Int, kotlin.Int)/startIndex">startIndex: Int, <span class="identifier" id="edu.umn.biomedicus.structure.Paragraph$<init>(kotlin.Int, kotlin.Int)/endIndex">endIndex: Int)


text:
require 'rake/clean'
require 'rbconfig'

RUBY_INCLUDE_DIR = Config::CONFIG["archdir"]
RUBY_BIN_DIR = Config::CONFIG["bindir"]
RUBY_LIB_DIR = Config::CONFIG["libdir"]
RUBY_SHARED_LIB = Config::CONFIG["LIBRUBY"]
RUBY_SHARED_DLL = RUBY_SHARED_LIB.gsub(/lib$/, 'dll')

CLEAN.include('*.o')
CLOBBER.include('ruby_prof.so')

task :default => "ruby_prof"

SRC = FileList['../ext/*.c']
OBJ = SRC.collect do |file_name|
  File.basename(file_name).ext('o')
end

SRC.each do |srcfile|
  objfile = File.basename(srcfile).ext('o')
  file objfile => srcfile do
    command = "gcc -c -fPIC -O2 -Wall -o #{objfile} #{srcfile} -I#{RUBY_INCLUDE_DIR}"
    sh "sh -c '#{command}'"
  end
end

file "ruby_prof" => OBJ do
  command = "gcc -shared -o ruby_prof.so #{OBJ} #{RUBY_BIN_DIR}/#{RUBY_SHARED_DLL}"
  sh "sh -c '#{command}'"
end


text:
<?php
	#
	# $Id: sanity_test_failures.php,v 1.3 2013-04-07 01:19:59 dan Exp $
	#
	# Copyright (c) 2003-2004 DVL Software Limited
	#

	require_once($_SERVER['DOCUMENT_ROOT'] . '/../include/constants.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/../classes/commit_record.php');
	require_once($_SERVER['DOCUMENT_ROOT'] . '/../classes/display_commit.php');

// base class for keeping statistics on page rendering issues
class SanityTestFailures {

	var $Debug = 0;
	var $dbh;
	var $MaxNumberOfPorts;

	var $Filter;
	var $WatchListAsk    = '';	// either default or ask.  the watch list to which add/remove works.
	var $UserID          = 0;
	var $DaysMarkedAsNew = 10;
	var $MessageID       = '';
	var $LocalResult;
	var $HTML;

	function SanityTestFailures($dbh) {
		$this->dbh = $dbh;
	}

	function SetMaxNumberOfPorts($MaxNumberOfPorts) {
		$this->MaxNumberOfPorts = $MaxNumberOfPorts;
	}

	function SetDaysMarkedAsNew($DaysMarkedAsNew) {
		$this->DaysMarkedAsNew = $DaysMarkedAsNew;
	}

	function SetUserID($UserID) {
		$this->UserID = $UserID;
	}

	function SetWatchListAsk($WatchListAsk) {
		$this->WatchListAsk = $WatchListAsk;
	}

	function SetFilter($Filter) {
		$this->Filter = $Filter;
	}

	function SetMessageID($MessageID) {
		$this->MessageID = $MessageID;
	}

	function CreateHTML() {
		GLOBAL	$freshports_CommitMsgMaxNumOfLinesToShow;

		if (IsSet($this->Filter)) {
			$sql = "select * from SanityTestFailures($this->UserID, '" . pg_escape_string($this->Filter) . "')";
		} else {
			$sql = "set client_encoding = 'ISO-8859-15';
SELECT S.*, STF.message as stf_message
  FROM SanityTestFailures(" . pg_escape_string($this->UserID) . ") S LEFT OUTER JOIN sanity_test_failures STF
    ON S.commit_log_id = STF.commit_log_id";
		}

		if ($this->MessageID != '') {
			$sql .= " WHERE message_id = '" . pg_escape_string($this->MessageID) . "'";
		}

		$sql .= " ORDER BY S.commit_date_raw DESC, S.category, S.port";

		if ($this->Debug) echo "\n
sql=$sql
\n";

		$result = pg_exec($this->dbh, $sql);
		if (!$result) {
            die("read from database failed");
			exit;
		}

		$DisplayCommit = new DisplayCommit($this->dbh, $result);
		$DisplayCommit->Debug = $this->Debug;

		$DisplayCommit->SetDaysMarkedAsNew($this->DaysMarkedAsNew);
		$DisplayCommit->SetUserID($this->UserID);
		$DisplayCommit->SetWatchListAsk($this->WatchListAsk);
		$DisplayCommit->SanityTestFailure = true;

		$RetVal = $DisplayCommit->CreateHTML();

		$this->HTML = $DisplayCommit->HTML;

		return $RetVal;

	}
}


text:
package org.locationtech.geomesa.fs.tools.compact

import com.beust.jcommander.{Parameter, ParameterException, Parameters}
import com.typesafe.scalalogging.LazyLogging
import org.apache.hadoop.fs.Path
import org.locationtech.geomesa.fs.data.FileSystemDataStore
import org.locationtech.geomesa.fs.storage.orc.OrcFileSystemStorage
import org.locationtech.geomesa.fs.tools.FsDataStoreCommand
import org.locationtech.geomesa.fs.tools.FsDataStoreCommand.{FsDistributedCommand, FsParams, PartitionParam}
import org.locationtech.geomesa.fs.tools.compact.FileSystemCompactionJob.{OrcCompactionJob, ParquetCompactionJob}
import org.locationtech.geomesa.fs.tools.compact.FsCompactCommand.CompactCommand
import org.locationtech.geomesa.jobs.JobResult.{JobFailure, JobSuccess}
import org.locationtech.geomesa.parquet.ParquetFileSystemStorage
import org.locationtech.geomesa.tools.Command.CommandException
import org.locationtech.geomesa.tools.DistributedRunParam.RunModes
import org.locationtech.geomesa.tools._
import org.locationtech.geomesa.tools.ingest.IngestCommand
import org.locationtech.geomesa.tools.utils.ParameterConverters.BytesConverter
import org.locationtech.geomesa.tools.utils.TerminalCallback.PrintProgress
import org.locationtech.geomesa.utils.io.PathUtils
import org.locationtech.geomesa.utils.text.TextTools

import java.util.Locale
import java.util.concurrent.{CountDownLatch, Executors}
import scala.util.control.NonFatal

// need to mixin FsDistributedCommand to pick up base libjars file
class FsCompactCommand extends CompactCommand with FsDistributedCommand

object FsCompactCommand {

  trait CompactCommand extends FsDataStoreCommand with DistributedCommand with LazyLogging {

    import scala.collection.JavaConverters._

    override val name: String = "compact"
    override val params = new CompactParams

    override def libjarsFiles: Seq[String] = Seq("org/locationtech/geomesa/tools/ingest-libjars.list")

    override def execute(): Unit = withDataStore(compact)

    def compact(ds: FileSystemDataStore): Unit = {
      Command.user.info("Beginning compaction process...")

      val storage = ds.storage(params.featureName)

      val toCompact = if (params.partitions.isEmpty) { storage.getPartitions } else {
        val filtered = params.partitions.asScala.flatMap(storage.metadata.getPartition)
        if (filtered.lengthCompare(params.partitions.size()) != 0) {
          val unmatched = params.partitions.asScala.filterNot(name => filtered.exists(_.name == name))
          throw new ParameterException(s"Partition(s) ${unmatched.mkString(", ")} cannot be found in metadata")
        }
        filtered
      }

      val mode = params.mode.getOrElse {
        if (PathUtils.isRemote(storage.context.root.toString)) { RunModes.Distributed } else { RunModes.Local }
      }
      val fileSize = Option(params.targetFileSize).map(_.longValue)

      Command.user.info(s"Compacting ${toCompact.size} partitions in ${mode.toString.toLowerCase(Locale.US)} mode")

      val start = System.currentTimeMillis()
      val status = new PrintProgress(System.err, TextTools.buildString(' ', 60), '\u003d', '\u003e', '\u003e')

      mode match {
        case RunModes.Local =>
          val total = toCompact.length
          val latch = new CountDownLatch(total)
          val executor = Executors.newFixedThreadPool(math.max(1, math.min(params.threads, total)))

          try {
            toCompact.foreach { p =>
              executor.submit(
                new Runnable() {
                  override def run(): Unit = {
                    try {
                      logger.info(s"Compacting ${p.name}")
                      storage.compact(Some(p.name), fileSize)
                    } catch {
                      case NonFatal(e) => logger.error(s"Error processing partition '${p.name}':", e)
                    } finally {
                      latch.countDown()
                    }
                  }
                }
              )
            }
          } finally {
            executor.shutdown()
          }

          while (latch.getCount > 0) {
            Thread.sleep(1000)
            status("", 1f - latch.getCount.toFloat / total, Seq.empty, done = false)
          }
          status("", 1f, Seq.empty, done = true)
          Command.user.info("Compacting metadata")
          storage.metadata.compact(None, None, math.max(1, params.threads))
          Command.user.info(s"Local compaction complete in ${TextTools.getTime(start)}")

        case RunModes.Distributed =>
          val encoding = storage.metadata.encoding
          val job = if (ParquetFileSystemStorage.Encoding.equalsIgnoreCase(encoding)) {
            new ParquetCompactionJob()
          } else if (OrcFileSystemStorage.Encoding.equalsIgnoreCase(encoding)) {
            new OrcCompactionJob()
          } else {
            throw new ParameterException(s"Compaction is not supported for encoding '$encoding'")
          }
          val tempDir = Option(params.tempPath).map(t => new Path(t))
          job.run(storage, toCompact.toSeq, fileSize, tempDir, libjarsFiles, libjarsPaths, status) match {
            case JobSuccess(message, counts) =>
              Command.user.info(s"Distributed compaction complete in ${TextTools.getTime(start)}")
              val success = counts(FileSystemCompactionJob.MappedCounter)
              val failed = counts(FileSystemCompactionJob.FailedCounter)
              Command.user.info(IngestCommand.getStatInfo(success, failed, "Compacted", message))

            case JobFailure(message) =>
              Command.user.error(s"Distributed compaction failed in ${TextTools.getTime(start)}")
              throw new CommandException(message)
          }
      }
    }
  }

  @Parameters(commandDescription = "Compact partitions")
  class CompactParams extends FsParams
      with RequiredTypeNameParam with TempPathParam with PartitionParam with DistributedRunParam {

    @Parameter(names = Array("-t", "--threads"), description = "Number of threads if using local mode")
    var threads: Integer = 4

    @Parameter(
      names = Array("--target-file-size"),
      description = "Target size for data files",
      converter = classOf[BytesConverter])
    var targetFileSize: java.lang.Long = _
  }
}


text:
package com.google.schemaorg.core;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import com.google.schemaorg.SchemaOrgType;
import com.google.schemaorg.SchemaOrgTypeImpl;
import com.google.schemaorg.ValueType;
import com.google.schemaorg.core.datatype.Text;
import com.google.schemaorg.core.datatype.URL;
import com.google.schemaorg.goog.GoogConstants;
import com.google.schemaorg.goog.PopularityScoreSpecification;

/** Implementation of {@link Class}. */
public class ClassImpl extends IntangibleImpl implements Class {
  private static final ImmutableSet<String> PROPERTY_SET = initializePropertySet();

  private static ImmutableSet<String> initializePropertySet() {
    ImmutableSet.Builder<String> builder = ImmutableSet.builder();

    builder.add(CoreConstants.PROPERTY_ADDITIONAL_TYPE);

    builder.add(CoreConstants.PROPERTY_ALTERNATE_NAME);

    builder.add(CoreConstants.PROPERTY_DESCRIPTION);

    builder.add(CoreConstants.PROPERTY_IMAGE);

    builder.add(CoreConstants.PROPERTY_MAIN_ENTITY_OF_PAGE);

    builder.add(CoreConstants.PROPERTY_NAME);

    builder.add(CoreConstants.PROPERTY_POTENTIAL_ACTION);

    builder.add(CoreConstants.PROPERTY_SAME_AS);

    builder.add(CoreConstants.PROPERTY_SUPERSEDED_BY);

    builder.add(CoreConstants.PROPERTY_URL);

    builder.add(GoogConstants.PROPERTY_DETAILED_DESCRIPTION);

    builder.add(GoogConstants.PROPERTY_POPULARITY_SCORE);

    return builder.build();
  }

  static final class BuilderImpl extends SchemaOrgTypeImpl.BuilderImpl<Class.Builder>
      implements Class.Builder {

    @Override
    public Class.Builder addAdditionalType(URL value) {
      return addProperty(CoreConstants.PROPERTY_ADDITIONAL_TYPE, value);
    }

    @Override
    public Class.Builder addAdditionalType(String value) {
      return addProperty(CoreConstants.PROPERTY_ADDITIONAL_TYPE, Text.of(value));
    }

    @Override
    public Class.Builder addAlternateName(Text value) {
      return addProperty(CoreConstants.PROPERTY_ALTERNATE_NAME, value);
    }

    @Override
    public Class.Builder addAlternateName(String value) {
      return addProperty(CoreConstants.PROPERTY_ALTERNATE_NAME, Text.of(value));
    }

    @Override
    public Class.Builder addDescription(Text value) {
      return addProperty(CoreConstants.PROPERTY_DESCRIPTION, value);
    }

    @Override
    public Class.Builder addDescription(String value) {
      return addProperty(CoreConstants.PROPERTY_DESCRIPTION, Text.of(value));
    }

    @Override
    public Class.Builder addImage(ImageObject value) {
      return addProperty(CoreConstants.PROPERTY_IMAGE, value);
    }

    @Override
    public Class.Builder addImage(ImageObject.Builder value) {
      return addProperty(CoreConstants.PROPERTY_IMAGE, value.build());
    }

    @Override
    public Class.Builder addImage(URL value) {
      return addProperty(CoreConstants.PROPERTY_IMAGE, value);
    }

    @Override
    public Class.Builder addImage(String value) {
      return addProperty(CoreConstants.PROPERTY_IMAGE, Text.of(value));
    }

    @Override
    public Class.Builder addMainEntityOfPage(CreativeWork value) {
      return addProperty(CoreConstants.PROPERTY_MAIN_ENTITY_OF_PAGE, value);
    }

    @Override
    public Class.Builder addMainEntityOfPage(CreativeWork.Builder value) {
      return addProperty(CoreConstants.PROPERTY_MAIN_ENTITY_OF_PAGE, value.build());
    }

    @Override
    public Class.Builder addMainEntityOfPage(URL value) {
      return addProperty(CoreConstants.PROPERTY_MAIN_ENTITY_OF_PAGE, value);
    }

    @Override
    public Class.Builder addMainEntityOfPage(String value) {
      return addProperty(CoreConstants.PROPERTY_MAIN_ENTITY_OF_PAGE, Text.of(value));
    }

    @Override
    public Class.Builder addName(Text value) {
      return addProperty(CoreConstants.PROPERTY_NAME, value);
    }

    @Override
    public Class.Builder addName(String value) {
      return addProperty(CoreConstants.PROPERTY_NAME, Text.of(value));
    }

    @Override
    public Class.Builder addPotentialAction(Action value) {
      return addProperty(CoreConstants.PROPERTY_POTENTIAL_ACTION, value);
    }

    @Override
    public Class.Builder addPotentialAction(Action.Builder value) {
      return addProperty(CoreConstants.PROPERTY_POTENTIAL_ACTION, value.build());
    }

    @Override
    public Class.Builder addPotentialAction(String value) {
      return addProperty(CoreConstants.PROPERTY_POTENTIAL_ACTION, Text.of(value));
    }

    @Override
    public Class.Builder addSameAs(URL value) {
      return addProperty(CoreConstants.PROPERTY_SAME_AS, value);
    }

    @Override
    public Class.Builder addSameAs(String value) {
      return addProperty(CoreConstants.PROPERTY_SAME_AS, Text.of(value));
    }

    @Override
    public Class.Builder addSupersededBy(Class value) {
      return addProperty(CoreConstants.PROPERTY_SUPERSEDED_BY, value);
    }

    @Override
    public Class.Builder addSupersededBy(Class.Builder value) {
      return addProperty(CoreConstants.PROPERTY_SUPERSEDED_BY, value.build());
    }

    @Override
    public Class.Builder addSupersededBy(Enumeration value) {
      return addProperty(CoreConstants.PROPERTY_SUPERSEDED_BY, value);
    }

    @Override
    public Class.Builder addSupersededBy(Property value) {
      return addProperty(CoreConstants.PROPERTY_SUPERSEDED_BY, value);
    }

    @Override
    public Class.Builder addSupersededBy(Property.Builder value) {
      return addProperty(CoreConstants.PROPERTY_SUPERSEDED_BY, value.build());
    }

    @Override
    public Class.Builder addSupersededBy(String value) {
      return addProperty(CoreConstants.PROPERTY_SUPERSEDED_BY, Text.of(value));
    }

    @Override
    public Class.Builder addUrl(URL value) {
      return addProperty(CoreConstants.PROPERTY_URL, value);
    }

    @Override
    public Class.Builder addUrl(String value) {
      return addProperty(CoreConstants.PROPERTY_URL, Text.of(value));
    }

    @Override
    public Class.Builder addDetailedDescription(Article value) {
      return addProperty(GoogConstants.PROPERTY_DETAILED_DESCRIPTION, value);
    }

    @Override
    public Class.Builder addDetailedDescription(Article.Builder value) {
      return addProperty(GoogConstants.PROPERTY_DETAILED_DESCRIPTION, value.build());
    }

    @Override
    public Class.Builder addDetailedDescription(String value) {
      return addProperty(GoogConstants.PROPERTY_DETAILED_DESCRIPTION, Text.of(value));
    }

    @Override
    public Class.Builder addPopularityScore(PopularityScoreSpecification value) {
      return addProperty(GoogConstants.PROPERTY_POPULARITY_SCORE, value);
    }

    @Override
    public Class.Builder addPopularityScore(PopularityScoreSpecification.Builder value) {
      return addProperty(GoogConstants.PROPERTY_POPULARITY_SCORE, value.build());
    }

    @Override
    public Class.Builder addPopularityScore(String value) {
      return addProperty(GoogConstants.PROPERTY_POPULARITY_SCORE, Text.of(value));
    }

    @Override
    public Class build() {
      return new ClassImpl(properties, reverseMap);
    }
  }

  public ClassImpl(Multimap<String, ValueType> properties, Multimap<String, Thing> reverseMap) {
    super(properties, reverseMap);
  }

  @Override
  public String getFullTypeName() {
    return CoreConstants.TYPE_CLASS;
  }

  @Override
  public boolean includesProperty(String property) {
    return PROPERTY_SET.contains(CoreConstants.NAMESPACE + property)
        || PROPERTY_SET.contains(GoogConstants.NAMESPACE + property)
        || PROPERTY_SET.contains(property);
  }

  @Override
  public ImmutableList<SchemaOrgType> getSupersededByList() {
    return getProperty(CoreConstants.PROPERTY_SUPERSEDED_BY);
  }
}


text:
package ro.pub.cs.systems.eim.practicaltest01var06;

import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class PracticalTest01Var06MainActivity extends Activity {
	private EditText topEditText = null, lowEditText = null;
	private Button details = null, passButton = null, naviButton = null;
	private PassListener passListener = new PassListener();
	private ButtonListener buttonListener = new ButtonListener();
	private static final int SECONDARY_ACTIVITY_REQUEST_CODE = 0;
	IntentFilter intentFilter = new IntentFilter();

	private MessageBroadcastReceiver messageBroadcastReceiver = new MessageBroadcastReceiver();
	private class MessageBroadcastReceiver extends BroadcastReceiver {
	  @Override
	  public void onReceive(Context context, Intent intent) {
	    Log.d("[Message]", intent.getStringExtra("message"));
	  }
	}
	private class ButtonListener implements View.OnClickListener {

		@Override
		public void onClick(View arg0) {
			// TODO Auto-generated method stub

			switch (arg0.getId()) {
			case R.id.details:
				if (details.getText().toString().contains("More details")) {
					details.setText("Less details");
					passButton.setVisibility(View.VISIBLE);
					lowEditText.setVisibility(View.VISIBLE);
				} else if (details.getText().toString()
						.contains("Less details")) {
					details.setText("More details");
					passButton.setVisibility(View.INVISIBLE);
					lowEditText.setVisibility(View.INVISIBLE);
				} else
					break;

				break;

			case R.id.navigate_to_secondary_activity:
				Intent intent = new Intent(getApplicationContext(),
						PracticalTest01Var06SecondaryActivity.class);
				intent.putExtra("toptext", topEditText.getText());
				intent.putExtra("lowertext", lowEditText.getText());

				startActivityForResult(intent, SECONDARY_ACTIVITY_REQUEST_CODE);
			default:
				break;
			}

		}

	}

	@Override
	protected void onActivityResult(int requestCode, int resultCode,
			Intent intent) {
		if (requestCode == SECONDARY_ACTIVITY_REQUEST_CODE) {
			Toast.makeText(this,
					"The activity returned with result " + resultCode,
					Toast.LENGTH_LONG).show();
		}
	}

	private class PassListener implements TextWatcher {

		@Override
		public void afterTextChanged(Editable arg0) {
			// TODO Auto-generated method stub

		}

		@Override
		public void beforeTextChanged(CharSequence arg0, int arg1, int arg2,
				int arg3) {
			// TODO Auto-generated method stub
			passButton.setText("Failed");
			passButton.setBackground(getApplicationContext().getResources()
					.getDrawable(R.color.red));
		}

		@Override
		public void onTextChanged(CharSequence arg0, int arg1, int arg2,
				int arg3) {
			// TODO Auto-generated method stub

			if (arg0.toString().startsWith("http")) {
				passButton.setText("Pass");
				passButton.setBackground(getApplicationContext().getResources()
						.getDrawable(R.color.green));

				Intent service = new Intent(getApplicationContext(),PracticalTest01Var06SecondaryActivity.class);
				getApplication().startService(service);

			} else {
				passButton.setText("Failed");
				passButton.setBackground(getApplicationContext().getResources()
						.getDrawable(R.color.red));
			}
		}

	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_practical_test01_var06_main);

		topEditText = (EditText) findViewById(R.id.top_edit_text);
		lowEditText = (EditText) findViewById(R.id.lower_edit_text);
		details = (Button) findViewById(R.id.details);
		passButton = (Button) findViewById(R.id.pass_button);
		naviButton = (Button) findViewById(R.id.navigate_to_secondary_activity);

		// B.1
		details.setOnClickListener(buttonListener);
		lowEditText.addTextChangedListener(passListener);
		naviButton.setOnClickListener(buttonListener);

		//
		intentFilter.addAction("action");

	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.practical_test01_var06_main, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle action bar item clicks here. The action bar will
		// automatically handle clicks on the Home/Up button, so long
		// as you specify a parent activity in AndroidManifest.xml.
		int id = item.getItemId();
		if (id == R.id.action_settings) {
			return true;
		}
		return super.onOptionsItemSelected(item);
	}

	@Override
	protected void onSaveInstanceState(Bundle savedInstanceState) {
		savedInstanceState.putString("toptext", topEditText.getText()
				.toString());
		savedInstanceState.putString("lowertext", lowEditText.getText()
				.toString());

	}

	@Override
	protected void onRestoreInstanceState(Bundle savedInstanceState) {
		if (savedInstanceState.containsKey("toptext")) {
			topEditText.setText(savedInstanceState.getString("toptext"));

		}

		if (savedInstanceState.containsKey("lowertext")) {
			lowEditText.setText(savedInstanceState.getString("lowertext"));

		}
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		registerReceiver(messageBroadcastReceiver, intentFilter);
	}
	@Override
	protected void onPause() {
	    unregisterReceiver(messageBroadcastReceiver);
	    super.onPause();
	  }

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		//stopService(service);
		super.onDestroy();
	}

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycotaxon 89(2): 498 (2004)

#### Original name
Inocybe misakaensis Matheny & Watling

### Remarks
null


text:
layout: page
title: Year in Review
description: Reviewing last year for Pakistan via news.
img: /assets/img/year_review.png
importance: 3
year: 2019
redirect: http://awaisrauf.github.io/deepCuriosity/2018-in-review-Data-Science-Prespective
category: research
---


text:
<?php

namespace Eureka\Component\Application;

use Eureka\Component\Routing\RouteInterface;

/**
 * Application interface
 *
 * @author Romain Cottard
 */
interface ApplicationInterface
{
    /**
     * Run Application
     *
     * @return void
     */
    public function run();
}


text:
import {_module} from "../apimanPlugin";
import angular = require("angular");

_module.controller("Apiman.EditPolicyDefController",
        ['$q', '$scope', '$location', 'ApimanSvcs', 'PageLifecycle', '$routeParams',
        function ($q, $scope, $location, ApimanSvcs, PageLifecycle, $routeParams) {
            var params = $routeParams;

            var pageData = {
                policyDef: $q(function(resolve, reject) {
                    ApimanSvcs.get({ entityType: 'policyDefs', secondaryType: params.policyDef }, function(policyDef) {
                        resolve(policyDef);
                        $scope.policyDefJSON = angular.toJson(policyDef, true);
                    }, reject);
                })
            };

            $scope.updatePolicyDef  = function() {
                var policyDefUpdate:any = {};
                var policyDef = JSON.parse($scope.policyDefJSON);
                policyDefUpdate.name = policyDef.name
                policyDefUpdate.description = policyDef.description;
                policyDefUpdate.icon = policyDef.icon;

                ApimanSvcs.update({ entityType: 'policyDefs', secondaryType: $scope.policyDef.id }, policyDefUpdate, function(reply) {
                     PageLifecycle.redirectTo('/admin/policyDefs');
                }, PageLifecycle.handleError);
            }

            PageLifecycle.loadPage('EditPolicyDef', 'admin', pageData, $scope, function() {
                PageLifecycle.setPageTitle('edit-policyDef');
            });
    }]);


text:
namespace Data
{
	Parameters_Method_LLG::Parameters_Method_LLG(std::string output_folder, std::array<bool,9> output, scalar force_convergence, long int n_iterations, long int n_iterations_log,
		int seed_i, scalar temperature_i, scalar damping_i, scalar time_step_i, bool renorm_sd_i,
		scalar stt_magnitude_i, Vector3 stt_polarisation_normal_i):
		Parameters_Method(output_folder, {output[0], output[1], output[2]}, force_convergence, n_iterations, n_iterations_log),
		output_energy_single(output[3]), output_energy_archive(output[4]), output_energy_spin_resolved(output[5]),
		output_energy_divide_by_nspins(output[6]), output_configuration_single(output[7]), output_configuration_archive(output[8]),
		seed(seed_i), temperature(temperature_i), damping(damping_i), dt(time_step_i), renorm_sd(renorm_sd_i),
		stt_magnitude(stt_magnitude_i), stt_polarisation_normal(stt_polarisation_normal_i)
	{
		prng = std::mt19937(seed);
		distribution_real = std::uniform_real_distribution<scalar>(0.0, 1.0);
		distribution_minus_plus_one = std::uniform_real_distribution<scalar>(-1.0, 1.0);
		distribution_int = std::uniform_int_distribution<int>(0, 1);
	}
}


text:
requestAnimationFrame
=======

requestAnimationFrame for the browser and node.js

```javascript
var requestAnimationFrame = require("@nathanfaucett/request_animation_frame");

requestAnimationFrame(function(ms) {
    console.log(ms);
});
```


text:
require 'spec_helper'

RSpec.describe Gitlab::SlashCommands::Presenters::Access do
  shared_examples_for 'displays an error message' do
    it do
      expect(subject[:text]).to match(error_message)
      expect(subject[:response_type]).to be(:ephemeral)
    end
  end

  describe '#access_denied' do
    let(:project) { build(:project) }

    subject { described_class.new.access_denied(project) }

    it { is_expected.to be_a(Hash) }

    it_behaves_like 'displays an error message' do
      let(:error_message) { 'you do not have access to the GitLab project' }
    end
  end

  describe '#generic_access_denied' do
    subject { described_class.new.generic_access_denied }

    it { is_expected.to be_a(Hash) }

    it_behaves_like 'displays an error message' do
      let(:error_message) { 'You are not allowed to perform the given chatops command.' }
    end
  end

  describe '#deactivated' do
    subject { described_class.new.deactivated }

    it { is_expected.to be_a(Hash) }

    it_behaves_like 'displays an error message' do
      let(:error_message) { 'your account has been deactivated by your administrator' }
    end
  end

  describe '#not_found' do
    subject { described_class.new.not_found }

    it { is_expected.to be_a(Hash) }

    it 'tells the user the resource was not found' do
      expect(subject[:text]).to match("not found!")
      expect(subject[:response_type]).to be(:ephemeral)
    end
  end

  describe '#authorize' do
    context 'with an authorization URL' do
      subject { described_class.new('http://authorize.me').authorize }

      it { is_expected.to be_a(Hash) }

      it 'tells the user to authorize' do
        expect(subject[:text]).to match("connect your GitLab account")
        expect(subject[:response_type]).to be(:ephemeral)
      end
    end

    context 'without authorization url' do
      subject { described_class.new.authorize }

      it { is_expected.to be_a(Hash) }

      it 'tells the user to authorize' do
        expect(subject[:text]).to match("Couldn't identify you")
        expect(subject[:response_type]).to be(:ephemeral)
      end
    end
  end
end


text:
module W3ClientApi
  class << self
    attr_accessor :configuration
  end

  def self.configure
    self.configuration ||= Configuration.new
    yield(configuration)
  end

  class Configuration
    attr_accessor :user
    attr_accessor :host
    attr_accessor :path
    attr_accessor :password
    attr_accessor :db
    attr_accessor :key

    def initialize
      @db = 'replace-me-with-your-db'
      @user = 'replace-me-with-your-user'
      @host = 'replace-me-with-your-host'
      @password = 'replace-me-with-your-password-host'
      @path = 'replace-me-with-your-path'
      @key = 'raplace-me-with-your-key'
    end
  end
end


text:
namespace ui {

namespace {

scoped_refptr<base::RefCountedMemory> EncodeImageAsPNG(
    const gfx::Image& image) {
  if (image.IsEmpty())
    return nullptr;
  DCHECK(!image.AsImageSkia().GetRepresentation(1.0f).is_null());
  return image.As1xPNGBytes();
}

scoped_refptr<base::RefCountedMemory> EncodeImageAsJPEG(
    const gfx::Image& image) {
  std::vector<uint8_t> result;
  DCHECK(!image.AsImageSkia().GetRepresentation(1.0f).is_null());
  gfx::JPEG1xEncodedDataFromImage(image, 100, &result);
  return base::RefCountedBytes::TakeVector(&result);
}

void EncodeImageAndScheduleCallback(
    scoped_refptr<base::RefCountedMemory> (*encode_func)(const gfx::Image&),
    base::OnceCallback<void(scoped_refptr<base::RefCountedMemory> data)>
        callback,
    gfx::Image image) {
  base::ThreadPool::PostTaskAndReplyWithResult(
      FROM_HERE, {base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
      base::BindOnce(encode_func, std::move(image)), std::move(callback));
}

}  // namespace

void GrabWindowSnapshotAsyncPNG(gfx::NativeWindow window,
                                const gfx::Rect& source_rect,
                                GrabWindowSnapshotAsyncPNGCallback callback) {
  GrabWindowSnapshotAsync(
      window, source_rect,
      base::BindOnce(&EncodeImageAndScheduleCallback, &EncodeImageAsPNG,
                     std::move(callback)));
}

void GrabWindowSnapshotAsyncJPEG(gfx::NativeWindow window,
                                 const gfx::Rect& source_rect,
                                 GrabWindowSnapshotAsyncJPEGCallback callback) {
  GrabWindowSnapshotAsync(
      window, source_rect,
      base::BindOnce(&EncodeImageAndScheduleCallback, &EncodeImageAsJPEG,
                     std::move(callback)));
}

}  // namespace ui


text:
namespace arc {

class FakeWallpaperInstance : public mojom::WallpaperInstance {
 public:
  FakeWallpaperInstance();
  ~FakeWallpaperInstance() override;

  const std::vector<int32_t>& changed_ids() const { return changed_ids_; }

  // Overridden from mojom::WallpaperInstance
  void InitDeprecated(mojom::WallpaperHostPtr host_ptr) override;
  void Init(mojom::WallpaperHostPtr host_ptr, InitCallback callback) override;
  void OnWallpaperChanged(int32_t walpaper_id) override;

 private:
  std::vector<int32_t> changed_ids_;

  // Keeps the binding alive so that calls to this class can be correctly
  // routed.
  mojom::WallpaperHostPtr host_;

  DISALLOW_COPY_AND_ASSIGN(FakeWallpaperInstance);
};

}  // namespace arc

#endif  // COMPONENTS_ARC_TEST_FAKE_WALLPAPER_INSTANCE_H_


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace CMS.Client.Admin {

    public partial class editemail {

        /// <summary>
        /// imgIcon control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Image imgIcon;

        /// <summary>
        /// litModules control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Literal litModules;

        /// <summary>
        /// btn_home control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink btn_home;

        /// <summary>
        /// btn_editpage control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink btn_editpage;

        /// <summary>
        /// HyperLink1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink HyperLink1;

        /// <summary>
        /// btn_add control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink btn_add;

        /// <summary>
        /// ImageButton1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.ImageButton ImageButton1;

        /// <summary>
        /// btn_edit control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink btn_edit;

        /// <summary>
        /// ImageButton3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.ImageButton ImageButton3;

        /// <summary>
        /// HyperLink3 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HyperLink HyperLink3;

        /// <summary>
        /// clientview control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Literal clientview;

        /// <summary>
        /// Label1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label1;

        /// <summary>
        /// txtName control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtName;

        /// <summary>
        /// RequiredFieldValidator1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;

        /// <summary>
        /// Label2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label2;

        /// <summary>
        /// txtEmailAddress control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox txtEmailAddress;

        /// <summary>
        /// RegularExpressionValidator2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RegularExpressionValidator RegularExpressionValidator2;

        /// <summary>
        /// RequiredFieldValidator5 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator5;

        /// <summary>
        /// hddEmailID control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.HiddenField hddEmailID;
    }
}


text:
package org.semanticweb.elk.reasoner.saturation.rules.propagations;

import java.util.Set;

import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedClassExpression;
import org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedObjectProperty;
import org.semanticweb.elk.reasoner.saturation.conclusions.interfaces.Propagation;
import org.semanticweb.elk.reasoner.saturation.conclusions.interfaces.Subsumer;
import org.semanticweb.elk.reasoner.saturation.context.Context;
import org.semanticweb.elk.reasoner.saturation.context.ContextPremises;
import org.semanticweb.elk.reasoner.saturation.rules.ConclusionProducer;
import org.semanticweb.elk.reasoner.saturation.tracing.inferences.PropagatedSubsumer;

/**
 * A {@link PropagationRule} producing {@link Subsumer}s in the {@link Context}s
 * in which the rule applies propagated over reflexive backward links stored in
 * this {@link Context}
 *
 * @see Context#getLocalReflexiveObjectProperties()
 * @see NonReflexivePropagationRule
 *
 * @author "Yevgeny Kazakov"
 *
 */
public class ReflexivePropagationRule extends AbstractPropagationRule {

	public static final String NAME = "Reflexive Propagation";

	private static final ReflexivePropagationRule INSTANCE_ = new ReflexivePropagationRule();

	public static final ReflexivePropagationRule getInstance() {
		return INSTANCE_;
	}

	@Override
	public String getName() {
		return NAME;
	}

	@Override
	public void apply(Propagation premise, ContextPremises premises,
			ConclusionProducer producer) {
		final Set<IndexedObjectProperty> reflexive = premises
				.getLocalReflexiveObjectProperties();
		if (reflexive.contains(premise.getRelation())) {
			// producer.produce(premises.getRoot(), new
			// ComposedSubsumer(premise.getCarry()));
			IndexedClassExpression thisRoot = premises.getRoot();

			producer.produce(thisRoot, new PropagatedSubsumer(thisRoot,
					premise, premise.getRelation(), thisRoot));
		}
	}

	@Override
	public void accept(PropagationRuleVisitor visitor, Propagation premise,
			ContextPremises premises, ConclusionProducer producer) {
		visitor.visit(this, premise, premises, producer);
	}

}


text:
import { useTheme as useThemeWithoutDefault } from '@material-ui/styles';
import * as React from 'react';
import defaultTheme from './defaultTheme';
export default function useTheme() {
  const theme = useThemeWithoutDefault() || defaultTheme;

  if (process.env.NODE_ENV !== 'production') {
    // eslint-disable-next-line react-hooks/rules-of-hooks
    React.useDebugValue(theme);
  }

  return theme;
}


text:
GLSLCompiler package for sublime text.

This package adds a .glsl file build-system.

It builds glsl code with shipped binary, and print errors if there's any.

We use keywords "vs", "vertex", "fs", "fragment", "ps", "pixel" to determine if the input file is vertex shader or not.

If no keyword were found. It will pass #define VERTEX_SHADER / FRAGMENT_SHADER and compile the same shader twice.

## OSX

Install library sfml from home-brew to use shipped binary directlly.

Or you can build the executable by yourself.

If you encounter permission issues, just call 'chmod 755 path\to\glslcompiler'.

## Windows

Nothing todo so far.


text:
namespace layout
{
////////////////////////////////////////

/// @brief Layout that strings areas in a line.
///
/// This layout puts all areas side by side in a particular direction.
class overlap : public layout
{
public:
    /// @brief Default constructor.
    overlap( void );

    /// @brief Add an area.
    /// @param a Area to add.
    void add( const std::shared_ptr<area> &a ) { _areas.push_back( a ); }

    void compute_bounds( void ) override;

    void compute_layout( void ) override;

private:
    std::list<std::weak_ptr<area>> _areas;
};

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

} // namespace layout


text:
app.controller('mapController', function($scope, $stateParams, communityDataService, directionsDataService, $state) {

    $scope.useCommute = directionsDataService.getUseCommute();

    //Obtain lat and lng for searched city
    var lat = parseFloat($stateParams.lat),
        lng = parseFloat($stateParams.lng);

    //Hard code bound for Chicago
    var NW = {lat: 41.9786, lng: -87.9047},
        SE = {lat: 41.6600, lng: -87.5500};

    var defaultBounds = new google.maps.LatLngBounds(NW, SE);
    var defaultCenter = defaultBounds.getCenter();

    var colors = [ "#771155", "#AA4488", "#CC99BB", "#114477",
        "#4477AA", "#77AADD", "#117777", "#44AAAA", "#77CCCC", "#117744",
        "#44AA77", "#88CCAA", "#777711", "#AAAA44", "#DDDD77", "#774411",
        "#AA7744", "#DDAA77", "#771122", "#AA4455", "#DD7788" ];

    angular.element(document).ready(function () {
        $scope.map = new google.maps.Map(document.getElementById('map'), {
            disableDefaultUI: true,
            center: {lat: defaultCenter.lat(), lng: defaultCenter.lng()},
            zoom: 8,
            scaleControl: false
        });

        $scope.map.fitBounds(defaultBounds);
        google.maps.event.addListenerOnce(map, 'idle', function() {
            google.maps.event.trigger(map, 'resize');
        });
        setPreferences();

        $scope.directionsService = new google.maps.DirectionsService();
        $scope.directionsDisplay = new google.maps.DirectionsRenderer();
        $scope.directionsDisplay.setMap($scope.map);
    });

    $scope.categories = {
        violentCrimePctOfAvg    :   'Safety',
        nonViolentCrimePctOfAvg :   'Quality of Life',
        nightlifePctOfAvg       :   'Nightlife',
        pricePctOfAvg           :   'Affordability',
        crowdedPctOfAvg         :   'Breathing Room'
    };

    $scope.orderedCategories = [
      'violentCrimePctOfAvg',
      'nonViolentCrimePctOfAvg',
      'nightlifePctOfAvg',
      'pricePctOfAvg',
      'crowdedPctOfAvg'
    ];

    $scope.preferences = [];
    $scope.preferencesObj = {};
    $scope.neighborhoods = {};
    $scope.showDetail = false;

    //Update communities when time limit changes
    $scope.$on('timeChange', function(ev){
        filterData();
        var remove = [];
        for (var id in $scope.neighborhoods) {
            if ($scope.neighborhoods.hasOwnProperty(id) &&
                    !$scope.preferencesObj[id]) {
                remove.push($scope.neighborhoods[id]);
                delete $scope.neighborhoods[id];
            }
        }
        var add = [];
        for (var i = 0; i < $scope.preferences.length; ++i) {
            if (!$scope.neighborhoods[$scope.preferences[i].communityID]) {
                add.push($scope.preferences[i]);
            }
        }
        removeNeighborhoods(remove);
        mapPreferences(add);
    });

    //Retrieve commute time for the communities
    $scope.communityTimes = directionsDataService.getCommunityTime();
    $scope.timeLimit = directionsDataService.getTimeLimit();

    function addColors(result) {
        for (var i = 0; i < result.length; ++i) {
            result[i].color = colors[i % colors.length];
        }
        return result;
    }

    function invertResult(result) {
        if (result[0].normalizedPreferences.nightlifePctOfAvg < 1) {
            $scope.categories.nightlifePctOfAvg = 'Quietness';
        }
        for (var i = 0; i < result.length; ++i) {
            for (var criteria in result[i].allCriteria) {
                if (result[i].allCriteria.hasOwnProperty(criteria) &&
                      (criteria !== 'nightlifePctOfAvg' ||
                       result[i].normalizedPreferences[criteria] < 1)) {
                    var inverse = 2 - result[i].allCriteria[criteria].value;
                    if (inverse < 0) {
                      result[i].allCriteria[criteria].value = 0.05;
                    } else if (inverse > 2) {
                      result[i].allCriteria[criteria].value = 2;
                    } else {
                      result[i].allCriteria[criteria].value = inverse;
                    }
                    // result[i].allCriteria[criteria].value = (inverse < 0) ?
                    //     0.05 : inverse;
                }
            }
            // for (var badCriteria in result[i].badCriteria) {
            //     if (result[i].badCriteria.hasOwnProperty(badCriteria) &&
            //         badCriteria !== 'nightlifePctOfAvg') {
            //         var inverse = 2 - result[i].badCriteria[badCriteria];
            //         result[i].badCriteria[badCriteria] = (inverse < 0) ?
            //             0.05 : inverse;
            //     }
            // }
        }
        return result;
    }

    //Populate map with preferences from database
    function setPreferences() {
        communityDataService.preferences()
            .done(function (result) {
                var invertedResult = invertResult(result);
                $scope.communityData = addColors(invertedResult);
                $scope.safeApply();
                filterData();
                mapPreferences($scope.preferences);
            })
            .fail(function () {
                console.error("Unable to retrieve preferences");
            });

    };

    //Filter data based on time limit
    function filterData(){
        $scope.preferences = [];
        $scope.preferencesObj = {};
        $scope.$apply();
        var count = 0;
        for (var i = 0; i < $scope.communityData.length && count < 10; ++i) {

            if ($scope.useCommute){
                var time = $scope.communityTimes[$scope.communityData[i].communityID];
                if (time === null || time > $scope.timeLimit){
                    continue;
                }
            }

            $scope.preferences.push($scope.communityData[i]);
            $scope.preferencesObj[$scope.communityData[i].communityID] = true;
            count++;
        }
        $scope.safeApply();
    };

    //Remove neighborhoods
    function removeNeighborhoods(communities){
        for (var id in communities) {
            if (communities.hasOwnProperty(id)) {
                communities[id].setMap(null);
            }
        }
        $scope.$apply();
    };

    //Map the preferred neighborhoods
    function mapPreferences(communities) {
        $scope.$apply();

        for (var i = 0; i < communities.length; i++) {

            var preference = communities[i];

            var neighborhood = new google.maps.Polygon({
                map             : $scope.map,
                paths           : preference.outline,
                fillColor       : preference.color,
                strokeOpacity   : 1,
                fillOpacity     : 0.9,
                name            : preference.name,
                prefIndex       : i
            });

            $scope.neighborhoods[preference.communityID] = neighborhood;

            google.maps.event.addListener(neighborhood, 'click', function (event) {
                $scope.selectedPreference = communities[this.prefIndex];
                $scope.showDetail = true;

                //calcRoute($scope.preferences[this.prefIndex].bounds.getCenter());

                var bounds = new google.maps.LatLngBounds();

                for (var j =0; j < $scope.selectedPreference.outline.length; j++) {
                    var point = new google.maps.LatLng($scope.selectedPreference.outline[j]);
                    bounds.extend(point);
                }

                $scope.map.fitBounds(bounds);
                google.maps.event.addListenerOnce(map, 'idle', function() {
                    google.maps.event.trigger(map, 'resize');
                });
                $scope.safeApply();
            });

        }
    };

    $scope.choose = function (index) {
        var id = $scope.preferences[index].communityID;
        google.maps.event.trigger($scope.neighborhoods[id], 'click', function (event) {
        });
    };

    $scope.$on('return', function () {
        returnToMainPanel();
    });

    function returnToMainPanel() {
        $scope.showDetail = false;
        $scope.map.fitBounds(defaultBounds);
        google.maps.event.addListenerOnce(map, 'idle', function() {
            google.maps.event.trigger(map, 'resize');
        });
    }

    $scope.safeApply = function(fn) {
        var phase = this.$root.$$phase;
        if(phase == '$apply' || phase == '$digest') {
            if(fn && (typeof(fn) === 'function')) {
                fn();
            }
        } else {
            this.$apply(fn);
        }
    };

    $scope.getStars = function(n) {
        return new Array(n);
    };

    function calcRoute(end) {
        var request = {
            origin:defaultCenter,
            destination:end,
            travelMode: google.maps.TravelMode.DRIVING
        };
        $scope.directionsService.route(request, function(result, status) {
            if (status == google.maps.DirectionsStatus.OK) {
                $scope.directionsDisplay.setDirections(result);
            }
        });
    }
});


text:
@class UserInfoModel;
@interface UserSearchCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIImageView *faceImageView;
@property (weak, nonatomic) IBOutlet UILabel *usernameLabel;
@property (weak, nonatomic) IBOutlet UILabel *groupnameLabel;
@property (weak, nonatomic) IBOutlet UIImageView *postImageView;
@property(strong, nonatomic) UserInfoModel *infoModel;
@end


text:
package com.common.emotion.view;
/**
 * 用于处理导航点的两种状态
 * @author zhenning.yang
 *
 */
public interface IDoubleStateIndicator {
	public void check(int position);
	public void unCheck();
}


text:
layout: page
title: Rain Street Enterprises Executive Retreat
date: 2016-05-24
author: Arthur Nguyen
tags: weekly links, java
status: published
summary: Curabitur vulputate ut nisi sit amet lacinia. Nam.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 02/09/2016
  endDate: 02/12/2016
  ctyhocn: HLVVAHX
  groupCode: RSEER
published: true
---
Etiam ornare ac purus sit amet varius. Aliquam ac mi nulla. Vestibulum a malesuada erat. Pellentesque nec rhoncus erat. Nulla facilisi. Vestibulum faucibus sodales accumsan. Praesent eget est commodo, scelerisque turpis vitae, tristique velit. Curabitur sed scelerisque dui. Sed id sapien facilisis, molestie est eget, posuere nulla. Duis congue laoreet mattis.

1 In aliquet diam in orci mattis, nec aliquet turpis tempus
1 Praesent egestas arcu vitae auctor ultrices
1 Nam sollicitudin enim ac congue porttitor
1 Phasellus ullamcorper nulla eu magna sagittis tempus.

Suspendisse sed elit cursus, facilisis sapien non, convallis sem. Proin interdum mollis eros, eu dignissim mi dictum ac. Nam dapibus vestibulum purus sed consequat. Cras odio tortor, mollis non felis ut, tincidunt ultrices felis. Sed nulla urna, pellentesque ut nisl at, fermentum ornare dui. Proin ex justo, eleifend sed pretium ac, ultricies sit amet felis. Morbi sed lorem sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sit amet risus lacus. Maecenas ac porta lectus. Donec fermentum, massa sed auctor pellentesque, leo nisi scelerisque augue, non porta odio sapien nec neque. Maecenas quis libero auctor, lobortis eros vitae, fringilla elit. Donec vel sagittis dui, vel tempor ante. Curabitur at tortor quis arcu scelerisque eleifend id hendrerit velit.


text:
import sys

sys.path.append('./stig-jre/src/')
sys.path.append("./stig-apache/src/")
sys.path.append("./stig-windows10/src/")
from jre_auditor import JREAuditor
from apache_auditor import ApacheAuditor
from windows10_auditor import Windows10Auditor
from Tkinter import *

LOG_FILENAME = "Results.txt"

class Selection:

    def __init__(self):

        self.jre_audit = JREAuditor()
        self.apache_audit = ApacheAuditor()
        self.windows10_audit = Windows10Auditor()
        self.master = Tk()

        self.run_jre = IntVar()
        self.run_apache = IntVar()
        self.run_windows10 = IntVar()

        self.windows_button = Checkbutton(
            self.master, text="Windows 10", variable=self.run_windows10)
        self.windows_button.pack()

        self.jre_button = Checkbutton(
            self.master, text="Jave Runtime Environment", variable=self.run_jre)
        self.jre_button.pack()

        self.apache_button = Checkbutton(
            self.master, text="Apache Server", variable=self.run_apache)
        self.apache_button.pack()

        self.run_button = Button(self.master, text="Run", command=self.run)
        self.run_button.pack()

        self.exit_button = Button(self.master, text="Exit", command=self.exit)
        self.exit_button.pack()

        while(1):
            self.master.update()

    def run(self):

        logs = []

        if self.run_jre.get() == 1:
            log = self.jre_audit.audit()
            logs.append(log)
        if self.run_apache.get() == 1:
            log = self.apache_audit.audit()
            logs.append(log)
        if self.run_windows10.get() == 1:
            log = self.windows10_audit.audit()
            logs.append(log)
        self.build_output(logs)

    def exit(self):
        del self.jre_audit
        del self.apache_audit
        del self.master
        quit()

    def build_output(self, logs, out_log=LOG_FILENAME):
        """
        Concatenates all the log files in files list into single file
        with name filename.

        :returns: string -- filename of the log file
        """
        out_log = open(out_log, 'w')
        out_log.write("AUDIT RESULTS\n\n")

        for log in logs:
            self.copy(log, out_log)
        out_log.close()

    def copy(self, input, output):
        """
        Copy the data from file input into file output
        """
        in_log = open(input, 'r')
        for line in in_log:
            output.write(line)
        in_log.close()

if __name__ == '__main__':
    selection = Selection()


text:
'use strict';

var file = require('fs-utils');
var path = require('path');
var relative = require('relative');
var stripBanner = require('strip-banner');
var _ = require('lodash');

var format = require('./format');
var parseComments = require('./parse');
var lineCount = require('./line-count');
var condense = require('./condense');
var tmpl = 'lib/comment.tmpl.md';

var comments = module.exports = function comments(src, dest, options) {
  options = options || {};
  tmpl = options.tmpl || tmpl;
  var page = {};

  file.expand(src, {filter: 'isFile'}).map(function(filepath) {
    filepath = path.resolve(filepath);
    var name = file.filename(filepath);
    var relpath = relative(dest, filepath);

    // Read file
    var content = file.readFileSync(filepath, options);
    var origLen = lineCount(content);

    // Strip banners so they don't end up in docs
    content = stripBanner(content);
    var stripLen = lineCount(content);
    var offset = origLen - stripLen;

    page[name] = {};
    page[name].name = file.basename(name);
    page[name].path = file.normalizeSlash(relpath);
    page[name].comments = [];

    // Allow passing a filtering function as a second param.
    var comments = parseComments(content, options.fn);

    page[name].comments.push(comments.map(function (comment) {
      comment.line = comment.line + offset;
      return comment;
    }));
  });

  return page;
};

comments.process = function(obj) {
  var result = _.template(tmpl, obj);
  return format(condense(result));
};


text:
<!DOCTYPE html>

    <title>ZIP 322: Generic Signed Message Format</title>
    <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="css/style.css">

ZIP: 322
Title: Generic Signed Message Format
Owners: Jack Grigg <jack@electriccoin.co>
        Daira Hopwood <daira@electriccoin.co>
Status: Reserved
Category: Standards / RPC / Wallet
Discussions-To: <https://github.com/zcash/zips/issues/429>


text:
Cervix SWEI simulations for project with University of Wisconsin Madison (T.J.
Hall).


text:
/**
 *
 */
package com.museviral.training.tdd.example.tictactoe;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import com.museviral.training.tdd.example.tictactoe.TicTacToeEngine.Token;

/**
 * A text console for the Tic Tac Toe game.
 *
 * @author Cyril
 * @since 0.2.0
 */
public class TicTacToeConsole {

	private TicTacToeEngine engine;

	private int inputX, inputY;

	public TicTacToeConsole(final TicTacToeEngine engine) {
		super();

		this.engine = engine;
	}

	/**
	 * Start the game. This function will return once the player choose not to
	 * continue playing.
	 */
	public void start() {

		boolean done = false;

		while (!done) {

			startGameRound();

			drawGameFinish();

			boolean newGame = askNewGame();

			if (newGame) {
				engine.restart();
			} else {
				done = true;
			}

		}

		println("");
		println("Thanks for playing!");

	}

	/**
	 * Ask the user if he wants to contineu playing or quit.
	 *
	 * @return
	 */
	protected boolean askNewGame() {

		println("Do you want to start a new game? (y/n) ");

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		boolean r = false;

		while (true) {

			try {
				String s = br.readLine();
				if (s != null)
					s = s.trim();

				if ("y".equalsIgnoreCase(s) || "n".equalsIgnoreCase(s)) {
					r = "y".equalsIgnoreCase(s) ? true : false;
					break;
				} else {

					println("unknown input, please enter 'y' or 'n'");

				}

			} catch (Throwable t) {

			}

		}

		return r;

	}

	/**
	 * Draw the game result if the game is finished.
	 */
	private void drawGameFinish() {

		if (engine.getGameState() == TicTacToeEngine.GameState.Complete) {

			print("Game over.");

			if (engine.getWinner() == null) {
				print(" Game draw.");
			} else {

				print(" Winner is " + tokenToString(engine.getWinner()) + ".");

			}

			println("\n\n");
		}

	}

	/**
	 * This function handles the logic for a complete cycle of a game.
	 */
	private void startGameRound() {

		while (engine.getGameState() != TicTacToeEngine.GameState.Complete) {

			drawUI();

			askUserInput();

			handleInput();

		}
	}

	private void handleInput() {

		boolean valid = engine.place(inputX - 1, inputY - 1);
		if (!valid) {
			println("coordinates invalid, please reenter");
		}

	}

	private void askUserInput() {

		int userX = readX();
		int userY = readY();

		inputX = userX;
		inputY = userY;

	}

	protected int readX() {

		int n;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while (true) {

			print("Please enter X (1 to " + engine.getWidth() + "): ");
			String s = null;
			try {
				s = br.readLine();
			} catch (IOException e) {
			}

			try {
				n = Integer.parseInt(s);
			} catch (Throwable t) {
				println("Input invalid, please enter valid value");
				continue;
			}

			if (n <= 0) {
				println("Must be non-zero positive integer");
			} else if (n > engine.getWidth()) {
				println("Too large (>" + engine.getWidth() + ")");
			} else {
				break;
			}
		}

		return n;

	}

	protected int readY() {

		int n;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while (true) {

			print("Please enter Y (1 to " + engine.getWidth() + "): ");
			String s = null;
			try {
				s = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}

			try {
				n = Integer.parseInt(s);
			} catch (Throwable t) {
				println("Input invalid, please enter valid value");
				continue;
			}

			if (n <= 0) {
				println("Must be non-zero positive integer");
			} else if (n > engine.getWidth()) {
				println("Too large (>" + engine.getHeight() + ")");
			} else {
				break;
			}
		}

		return n;

	}

	/**
	 * Draw the user interface.
	 */
	public void drawUI() {

		drawCurrentPlayer();

		drawBoard();

	}

	/**
	 * Draw the board status.
	 */
	public void drawBoard() {

		for (int y = 0; y < engine.getHeight(); y++) {

			StringBuffer sb = new StringBuffer();

			// build the content of a row.
			for (int x = 0; x < engine.getWidth(); x++) {
				Token token = engine.getToken(x, y);
				if (sb.length() > 0) {
					sb.append(" ");
				}
				sb.append(tokenToString(token));
			}

			// draw the row
			println(sb.toString());

		}

		println("");

	}

	public void drawCurrentPlayer() {

		println("Current player: " + tokenToString(engine.getNextToken()));

	}

	protected void println(Object o) {
		System.out.println(o);
	}

	protected void print(Object o) {
		System.out.print(o);
	}

	/**
	 * Convert the token to string representation.
	 *
	 * @param token
	 * @return
	 */
	public String tokenToString(TicTacToeEngine.Token token) {

		if (token == null)
			return ".";

		switch (token) {
		case CIRCLE:
			return "O";
		case CROSS:
			return "X";
		default:
			return " ";
		}
	}
}


text:
/*
 * Public prototypes for base64 encoding/decoding.
 *
 * $Id: nssb64.h,v 1.2 2000/04/06 00:42:49 repka%netscape.com Exp $
 */
#ifndef _NSSB64_H_
#define _NSSB64_H_

#include "seccomon.h"
#include "nssb64t.h"

SEC_BEGIN_PROTOS

/*
 * Functions to start a base64 decoding/encoding context.
 */

extern NSSBase64Decoder *
NSSBase64Decoder_Create (PRInt32 (*output_fn) (void *, const unsigned char *,
					       PRInt32),
			 void *output_arg);

extern NSSBase64Encoder *
NSSBase64Encoder_Create (PRInt32 (*output_fn) (void *, const char *, PRInt32),
			 void *output_arg);

/*
 * Push data through the decoder/encoder, causing the output_fn (provided
 * to Create) to be called with the decoded/encoded data.
 */

extern SECStatus
NSSBase64Decoder_Update (NSSBase64Decoder *data, const char *buffer,
			 PRUint32 size);

extern SECStatus
NSSBase64Encoder_Update (NSSBase64Encoder *data, const unsigned char *buffer,
			 PRUint32 size);

/*
 * When you're done processing, call this to close the context.
 * If "abort_p" is false, then calling this may cause the output_fn
 * to be called one last time (as the last buffered data is flushed out).
 */

extern SECStatus
NSSBase64Decoder_Destroy (NSSBase64Decoder *data, PRBool abort_p);

extern SECStatus
NSSBase64Encoder_Destroy (NSSBase64Encoder *data, PRBool abort_p);

/*
 * Perform base64 decoding from an ascii string "inStr" to an Item.
 * The length of the input must be provided as "inLen".  The Item
 * may be provided (as "outItemOpt"); you can also pass in a NULL
 * and the Item will be allocated for you.
 *
 * In any case, the data within the Item will be allocated for you.
 * All allocation will happen out of the passed-in "arenaOpt", if non-NULL.
 * If "arenaOpt" is NULL, standard allocation (heap) will be used and
 * you will want to free the result via SECITEM_FreeItem.
 *
 * Return value is NULL on error, the Item (allocated or provided) otherwise.
 */
extern SECItem *
NSSBase64_DecodeBuffer (PRArenaPool *arenaOpt, SECItem *outItemOpt,
			const char *inStr, unsigned int inLen);

/*
 * Perform base64 encoding of binary data "inItem" to an ascii string.
 * The output buffer may be provided (as "outStrOpt"); you can also pass
 * in a NULL and the buffer will be allocated for you.  The result will
 * be null-terminated, and if the buffer is provided, "maxOutLen" must
 * specify the maximum length of the buffer and will be checked to
 * supply sufficient space space for the encoded result.  (If "outStrOpt"
 * is NULL, "maxOutLen" is ignored.)
 *
 * If "outStrOpt" is NULL, allocation will happen out of the passed-in
 * "arenaOpt", if *it* is non-NULL, otherwise standard allocation (heap)
 * will be used.
 *
 * Return value is NULL on error, the output buffer (allocated or provided)
 * otherwise.
 */
extern char *
NSSBase64_EncodeItem (PRArenaPool *arenaOpt, char *outStrOpt,
		      unsigned int maxOutLen, SECItem *inItem);

SEC_END_PROTOS

#endif /* _NSSB64_H_ */


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15">

    dotted
    dashed
    solid
    double

    groove
    ridge
    inset
    outset

partial attributes merged

border:thin solid red;

border:red thin solid;

{ border:thin solid; }{border:blue; } (merged, reset all - color has no effect)

{ border:thin solid; }{border-color:green; } (merged, overwrite only color)

{ border:thin solid; }{border:blue; } (merged, reset all - color has no effect)

{ border:thin solid; }{border-color:green; } (merged, overwrite only color)

{ border:thin blue solid; }{border-color:green; } (merged, overwrite only color)

{ border:thin blue solid; }{border-style:dashed; } (merged, overwrite only style)

{ border:thin blue solid; }{border-width:thick; } (merged, overwrite only width)

{ border:thin blue solid; }{border-width:medium; } (merged, overwrite only width)

{ border:thin blue solid; }{border-width:3pt; } (merged, overwrite only width)

top:

border-top:thin solid red;

border-top:red thin solid;

{ border-top:thin solid; }{border-top-color:green; } (merged, overwrite only color)

{ border-top:thin solid; }{border-top:blue; } (merged, reset all - color has no effect)

right left bottom:

border-right:thin solid red;

border-left:thin solid red;

border-bottom:thin solid red;

Individual Attributes

{border:thin blue solid;}{border-top-color:red;}

{border:thin blue solid;}{border-right-color:red;}

{border:thin blue solid;}{border-bottom-color:red;}

{border:thin blue solid;}{border-left-color:red;}

{border:thin blue solid;}{border-top-style:dashed;}

{border:thin blue solid;}{border-right-style:dashed;}

{border:thin blue solid;}{border-bottom-style:dashed;}

{border:thin blue solid;}{border-left-style:dashed;}

{border:thin blue solid;}{border-top-width:medium;}

{border:thin blue solid;}{border-right-width:medium;}

{border:thin blue solid;}{border-bottom-width:medium;}

{border:thin blue solid;}{border-left-width:medium;}

Individual side specific Attributes

{border:thin blue solid;}{border-color:red;}

{border:thin blue solid;}{border-color:red green;}

{border:thin blue solid;}{border-color:red green blue;}

{border:thin blue solid;}{border-color:red green blue gray;}

{border:thin blue solid;}{border-style:dashed;}

{border:thin blue solid;}{border-style:dashed dotted;}

{border:thin blue solid;}{border-style:dashed dotted double;}

{border:thin blue solid;}{border-style:dashed dotted double groove;}

{border:thin blue solid;}{border-width:1pt;}

{border:thin blue solid;}{border-width:1pt 2pt;}

{border:thin blue solid;}{border-width:1pt 2pt 3pt;}

{border:thin blue solid;}{border-width:1pt 2pt 3pt 4pt;}

Misc. values


text:
using System;
using System.Collections.Generic;
using Microsoft.Msagl.Core.DataStructures;
using Microsoft.Msagl.Core.Geometry;
using Microsoft.Msagl.Core.Geometry.Curves;
using Microsoft.Msagl.Core.Layout;
using Microsoft.Msagl.Core;
using System.Diagnostics;

namespace Microsoft.Msagl.Routing {
    ///
    /// A shape wrapping an ICurve, providing additional information.
    ///
    [DebuggerDisplay("Shape = {UserData}")]
    public class Shape {

        readonly Set<Shape> parents = new Set<Shape>();
        ///
        /// shape parents
        ///
        public IEnumerable<Shape> Parents {
            get { return parents; }
        }

        readonly Set<Shape> children = new Set<Shape>();
        ///
        /// shape children
        ///
        public IEnumerable<Shape> Children {
            get { return children; }
        }
        ///
        /// The curve of the shape.
        ///
        public virtual ICurve BoundaryCurve {
            get { return boundaryCurve; }
            set {boundaryCurve = value; }
        }
        ICurve boundaryCurve;

        ///
        /// The bounding box of the shape.
        ///
        public Rectangle BoundingBox { get { return BoundaryCurve.BoundingBox; } }

        ///
        /// The set of Ports for this obstacle, usually RelativePorts.  In the event of overlapping
        /// obstacles, this identifies the obstacle to which the port applies.
        ///
        public Set<Port> Ports { get { return ports; } }

        private readonly Set<Port> ports = new Set<Port>();

        ///
        /// A location for storing user data associated with the Shape.
        ///
        public object UserData { get; set; }

        ///
        /// Default constructor.
        ///
        public Shape() : this (null) {
        }

        ///
        /// Constructor taking the ID and the curve of the shape.
        ///
        /// <param name="boundaryCurve"></param>
        public Shape(ICurve boundaryCurve) {
            this.boundaryCurve = boundaryCurve;     // RelativeShape throws an exception on BoundaryCurve_set so set _boundaryCurve directly.
        }

        ///
        /// A group is a shape that has children.
        ///
        public bool IsGroup {
            get { return children.Count > 0; }
        }

        internal bool IsTransparent { get; set; }

        internal IEnumerable<Shape> Descendants {
            get {
                var q = new Queue<Shape>();
                foreach (var shape in Children)
                    q.Enqueue(shape);
                while (q.Count > 0) {
                    var sh = q.Dequeue();
                    yield return sh;
                    foreach (var shape in sh.Children)
                        q.Enqueue(shape);
                }
            }
        }

        internal IEnumerable<Shape> Ancestors {
            get {
                var q = new Queue<Shape>();
                foreach (var shape in Parents)
                    q.Enqueue(shape);
                while (q.Count > 0) {
                    var sh = q.Dequeue();
                    yield return sh;
                    foreach (var shape in sh.Parents)
                        q.Enqueue(shape);
                }
            }
        }
        ///
        /// Adds a parent. A shape can have several parents
        ///
        ///<param name="shape"></param>
        public void AddParent(Shape shape) {
            ValidateArg.IsNotNull(shape, "shape");
            parents.Insert(shape);
            shape.children.Insert(this);
        }

        ///
        ///
        ///<param name="shape"></param>
        public void AddChild(Shape shape) {
            ValidateArg.IsNotNull(shape, "shape");
            shape.parents.Insert(this);
            children.Insert(shape);
        }
        ///
        ///
        ///
        /// <param name="shape"></param>
        public void RemoveChild(Shape shape) {
            ValidateArg.IsNotNull(shape, "shape");
            children.Remove(shape);
            shape.parents.Remove(this);
        }

        ///
        ///
        ///
        /// <param name="shape"></param>
        public void RemoveParent(Shape shape) {
            ValidateArg.IsNotNull(shape, "shape");
            parents.Remove(shape);
            shape.children.Remove(this);
        }

#if TEST_MSAGL
        ///
        ///
        ///
        /// <returns></returns>
        public override string ToString()
        {
            return UserData == null ? "null" : UserData.ToString();
        }
#endif
    }
}


text:
package org.apache.logging.log4j.core.appender;

import static org.fusesource.jansi.Ansi.ansi;
import static org.fusesource.jansi.Ansi.Color.CYAN;
import static org.fusesource.jansi.Ansi.Color.RED;

import java.util.Map.Entry;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.categories.Layouts;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configurator;
import org.junit.Test;
import org.junit.experimental.categories.Category;

/**
 * Shows how to use ANSI escape codes to color messages. Each message is printed to the console in color, but the rest
 * of the log entry (time stamp for example) is in the default color for that console.
 *

 * Running from a Windows command line from the root of the project:
 *

 *
 *

 * mvn -Dtest=org.apache.logging.log4j.core.appender.ConsoleAppenderJAnsiMessageMain test
 *

 *
 * or, on Windows:
 *
 *

 * java -classpath log4j-core\target\test-classes;log4j-core\target\classes;log4j-api\target\classes;%USERPROFILE%\.m2\repository\org\fusesource\jansi\jansi\1.14\jansi-1.14.jar; org.apache.logging.log4j.core.appender.ConsoleAppenderJAnsiMessageMain log4j-core/src/test/resources/log4j2-console-msg-ansi.xml
 *

 *
 */
@Category(Layouts.Jansi.class)
public class ConsoleAppenderJAnsiMessageMain {

    public static void main(final String[] args) {
        new ConsoleAppenderJAnsiMessageMain().test(args);
    }

    /**
     * This is a @Test method to make it easy to run from a command line with {@code mvn -Dtest=FQCN test}
     */
    @Test
    public void test() {
        test(null);
    }

    public void test(final String[] args) {
        // System.out.println(System.getProperty("java.class.path"));
        final String config = args == null || args.length == 0 ? "target/test-classes/log4j2-console-msg-ansi.xml"
                : args[0];
        try (final LoggerContext ctx = Configurator.initialize(ConsoleAppenderAnsiMessagesMain.class.getName(),
                config)) {
            final Logger logger = LogManager.getLogger(ConsoleAppenderJAnsiMessageMain.class);
            logger.info(ansi().fg(RED).a("Hello").fg(CYAN).a(" World").reset());
            // JAnsi format:
            // logger.info("@|red Hello|@ @|cyan World|@");
            for (final Entry<Object, Object> entry : System.getProperties().entrySet()) {
                logger.info("@|KeyStyle {}|@ = @|ValueStyle {}|@", entry.getKey(), entry.getValue());
            }
        }
    }

}