text:
package org.rioproject.resolver;

import org.apache.maven.settings.building.SettingsBuildingException;
import org.junit.Assert;
import org.rioproject.resolver.maven2.Repository;
import org.eclipse.aether.installation.InstallationException;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Utilities for working with test project
 */
public class Util {

    static ProjectModuleResolver verifyAndInstall() throws InstallationException, IOException, SettingsBuildingException {
        File projectPom = new File("src/test/resources/project/pom.xml");
        File projectAPIPom = new File("src/test/resources/project/project-api/pom.xml");
        File projectAPITarget = new File("src/test/resources/project/project-api/target");
        if (!projectAPITarget.exists())
            if (projectAPITarget.mkdirs())
                System.out.println("Created " + projectAPITarget.getPath());
        File projectServicePom = new File("src/test/resources/project/project-service/pom.xml");
        File projectServiceTarget = new File("src/test/resources/project/project-service/target");
        if (!projectServiceTarget.exists())
            if (projectServiceTarget.mkdirs())
                System.out.println("Created " + projectServiceTarget.getPath());
        File apiArtifact = new File(projectAPITarget, "project-api-2.0.jar");
        if (!apiArtifact.exists())
            createPhonyArtifact(apiArtifact);

        File serviceArtifact = new File(projectServiceTarget, "project-service-2.0.jar");
        if (!serviceArtifact.exists())
            createPhonyArtifact(serviceArtifact);
        File srcPom = new File("src/test/resources/project/project-service/pom.xml");
        Assert.assertTrue(srcPom.exists());

        ProjectModuleResolver r = new ProjectModuleResolver();

        r.getAetherService().install("org.rioproject.resolver.test", "project", "2.0", projectPom, null);
        r.getAetherService().install("org.rioproject.resolver.test.project", "project-api", "2.0", projectAPIPom, apiArtifact);
        r.getAetherService().install("org.rioproject.resolver.test.project", "project-service", "2.0", projectServicePom, serviceArtifact);
        return r;
    }

    public static void cleanProjectFromRepository() {
        File project = new File(Repository.getLocalRepository(), "org/rioproject/resolver/test");
        remove(project);
    }

    private static void createPhonyArtifact(File target) throws IOException {
        FileWriter writer = new FileWriter(target);
        BufferedWriter out = new BufferedWriter(writer);
        out.write("phony");
        out.close();
    }

    static void remove(File file) {
        if (file.isDirectory()) {
            File[] files = file.listFiles();
            for (File f : files) {
                if (f.isDirectory())
                    remove(f);
                else {
                    if (f.delete()) {
                        System.out.println("Removed " + f.getAbsolutePath());
                    } else {
                        if (f.exists())
                            System.out.println("Unable to remove " + f.getAbsolutePath());
                    }
                }
            }
            if (file.delete()) {
                System.out.println("Removed " + file.getAbsolutePath());
            } else {
                if (file.exists())
                    System.out.println("Unable to remove " + file.getAbsolutePath());
            }
        } else {
            if (file.delete()) {
                System.out.println("Removed " + file.getAbsolutePath());
            } else {
                if (file.exists())
                    System.out.println("Unable to remove " + file.getAbsolutePath());
            }
        }
    }
}


text:
package laughinglen.kafka.testing;

import com.google.common.collect.ImmutableList;
import org.assertj.core.util.Lists;

import java.util.List;

public final class ByteArray {
	private final List<Byte> bytes = Lists.newArrayList();

	public void add(final byte b)	{
		bytes.add(b);
	}

	public final List<Byte> bytes()	{
		return ImmutableList.copyOf(bytes);
	}
}

redpajama_set_name: RedPajamaGithub


text:
namespace Emulator
{
	class CTimer;
	typedef std::function<void(INT64, INT64)> TimerCallback;

    class Scheduler
    {
	public:
        Scheduler(long quantum) //us
        {
            Quantum = quantum;
            CurrentTime = 0;
			executingDevice = nullptr;
        }

        void Reset()
        {
            this->CurrentTime = 0L;
        }

		void RegisterTimer(CTimer* timer);

        void UnregisterTimer(CTimer* timer)
        {
            for (auto it = timers.begin(); it != timers.end(); it++)
			{
				if (*it == timer) {
					timers.erase(it);
					return;
				}
            }
        }

        void RegisterDevice(Emulator::IDevice* device)
        {
            devices.push_back(device);
        }

        void UnregisterDevice(Emulator::IDevice* device)
        {
			for (std::vector<Emulator::IDevice*>::iterator it = devices.begin();
				 it != devices.end(); it++)
			{
				if (*it == device) {
					devices.erase(it);
					break;
				}
			}
        }

        void Timeslice()
        {
            ExecuteTimers();

			INT64 untilTime = CurrentTime + Quantum;
			for (size_t i = 0; i < devices.size(); i++)
			{
				Emulator::IDevice* device = devices[i];

				INT64 timeNextTimer = GetTimeNextTimer();
				if (timeNextTimer > 0 && timeNextTimer < untilTime)
				{
					untilTime = timeNextTimer;
				}

				if (untilTime > CurrentTime)
				{
					executingDevice = device;
					INT64 t = device->Execute(untilTime);

					if (t < untilTime) {
						untilTime = t;
					}

					executingDevice = nullptr;
				}
			}

			CurrentTime = (long)untilTime;
        }

		long get_CurrentTime() const
		{
			// if we're active, add in the time from the current slice
			long result = CurrentTime;
			if (executingDevice != nullptr) {
				result = result + (long)executingDevice->get_ExecutionTimeInCurrentTimeslice();
			}
			return result;
		}

	private:
		void ExecuteTimers();
		INT64 GetTimeNextTimer();

		long CurrentTime; // us
		long Quantum; // us
		std::vector<CTimer*> timers; // weak refs

        std::vector<IDevice*> devices; // weak refs
		IDevice* executingDevice; // weak ref
    };

	class CTimer
	{
	public:
		CTimer(const std::string& tag, Emulator::Scheduler& scheduler, TimerCallback callback) :
			ExpirationTime(0),
			Enabled(false),
			tag(tag),
			Scheduler(scheduler),
			Callback(callback),
			Period(0),
			IsPeriodic(false)
		{
			scheduler.RegisterTimer(this);
		}
		~CTimer();

		void Start(INT64 period, bool isPeriodic, long param = 0)
		{
			ASSERT(period >= 0);

			Param = param;
			Period = period;
			IsPeriodic = isPeriodic;
			Enabled = true;
			Scheduler.UnregisterTimer(this);
			ExpirationTime = Scheduler.get_CurrentTime() + Period;
			Scheduler.RegisterTimer(this);
		}

		void Stop()
		{
			Enabled = false;
		}

		void OnTick(long currentTime);

	public:
		INT64 ExpirationTime;
		bool Enabled;
	private:
		std::string tag;
		Scheduler& Scheduler;
		TimerCallback Callback;
		INT64 Period; // us
		bool IsPeriodic;
		long Param;
	};

} // Emulator


text:
package servlet

import javax.servlet._
import org.slf4j.LoggerFactory
import javax.servlet.http.HttpServletRequest
import util.Keys

/**
 * Controls the transaction with the open session in view pattern.
 */
class TransactionFilter extends Filter {

  private val logger = LoggerFactory.getLogger(classOf[TransactionFilter])

  def init(config: FilterConfig) = {}

  def destroy(): Unit = {}

  def doFilter(req: ServletRequest, res: ServletResponse, chain: FilterChain): Unit = {
    if(req.asInstanceOf[HttpServletRequest].getRequestURI().startsWith("/assets/")){
      // assets don't need transaction
      chain.doFilter(req, res)
    } else {
      Database(req.getServletContext) withTransaction { session =>
        logger.debug("begin transaction")
        req.setAttribute(Keys.Request.DBSession, session)
        chain.doFilter(req, res)
        logger.debug("end transaction")
      }
    }
  }

}

object Database {

  def apply(context: ServletContext): slick.jdbc.JdbcBackend.Database =
    slick.jdbc.JdbcBackend.Database.forURL(context.getInitParameter("db.url"),
        context.getInitParameter("db.user"),
        context.getInitParameter("db.password"))

  def getSession(req: ServletRequest): slick.jdbc.JdbcBackend#Session =
    req.getAttribute(Keys.Request.DBSession).asInstanceOf[slick.jdbc.JdbcBackend#Session]

}


text:
<!DOCTYPE html>

        <title>VODca - Video on demand center</title>
        <link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css" />
        <link rel="stylesheet" href="/css/main.css" type="text/css" />

VODca - Your personal Video-on-demand server

            <?php echo $content; ?>

                © 2012 by AVGP | Geekonaut


text:
{% extends 'matches/base.html' %}

{% load staticfiles %}

{% block page_title %}Player Details{% endblock %}

{% block page_head %}{{ block.super }}
{% endblock %}

{% block content %}
<p>
	{% if player %}
	Name: {{player.name}}
	{% else %}
	No player available.
	{% endif %}
</p>
{% endblock %}


text:
"""
A test suite for local matrices.
"""
import unittest
import NTPolySwig as nt

from scipy.io import mmwrite, mmread

class TestParameters:
    '''An internal class for holding test parameters.'''

    def __init__(self, rows, columns, sparsity):
        '''Default constructor
        @param[in] rows matrix rows.
        @param[in] columns matrix columns.
        @param[in] sparsity matrix sparsity.
        '''
        # Matrix rows.
        self.rows = rows
        # Matrix columns.
        self.columns = columns
        # Matrix sparsity.
        self.sparsity = sparsity

    def create_matrix(self, square=False, complex=False):
        '''
        Function to create a matrix for a given set of parameters.
        '''
        from scipy.sparse import random, csr_matrix

        r = self.rows
        c = self.columns
        s = self.sparsity
        if square:
            r = c
        if complex:
            mat = random(r, c, s, format="csr")
            mat += 1j * random(r, c, s, format="csr")
        else:
            mat = random(r, c, s, format="csr")

        return csr_matrix(mat)

class TestLocalMatrix(unittest.TestCase):
    '''A test class for local matrices.'''
    from os import environ
    from os.path import join
    # Parameters for the matrices
    parameters = []
    # Location of the scratch directory.
    scratch_dir = environ['SCRATCHDIR']
    file1 = join(scratch_dir, "matrix1.mtx")
    file2 = join(scratch_dir, "matrix2.mtx")
    file3 = join(scratch_dir, "matrix3.mtx")
    SMatrix = nt.Matrix_lsr
    MatrixMemoryPool = nt.MatrixMemoryPool_r
    complex = False

    def _compare_mat(self, val1, val2):
        from helpers import THRESHOLD
        from scipy.sparse.linalg import norm

        normval = abs(norm(val1 - val2))
        self.assertLessEqual(normval, THRESHOLD)

    def _compare(self, val1, val2):
        from helpers import THRESHOLD
        from scipy.linalg import norm

        normval = abs(norm(val1 - val2))
        self.assertLessEqual(normval, THRESHOLD)

    def setUp(self):
        '''Set up a test.'''
        self.parameters = []
        self.parameters.append(TestParameters(2, 4, 0.0))
        self.parameters.append(TestParameters(8, 8, 0.0))
        self.parameters.append(TestParameters(2, 2, 1.0))
        self.parameters.append(TestParameters(4, 4, 1.0))
        self.parameters.append(TestParameters(19, 19, 1.0))
        self.parameters.append(TestParameters(4, 2, 1.0))
        self.parameters.append(TestParameters(2, 4, 1.0))
        self.parameters.append(TestParameters(4, 4, 0.2))
        self.parameters.append(TestParameters(8, 8, 1.0))

    def test_read(self):
        '''Test routines to read and write matrices.'''
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)
            matrix2 = self.SMatrix(self.file1)
            matrix2.WriteToMatrixMarket(self.file2)
            ResultMat = mmread(self.file2)
            self._compare_mat(matrix1, ResultMat)

    def test_readcircular(self):
        '''Test routines to read a matrix produced by ntpoly.'''
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)
            matrix2 = self.SMatrix(self.file1)
            matrix2.WriteToMatrixMarket(self.file2)
            matrix3 = self.SMatrix(self.file2)
            matrix3.WriteToMatrixMarket(self.file3)
            ResultMat = mmread(self.file3)

            self._compare_mat(matrix1, ResultMat)

    def test_readsymmetric(self):
        '''Test routines to read and write matrices.'''
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex, square=True)
            matrix1 = matrix1 + matrix1.H
            mmwrite(self.file1, matrix1)
            matrix2 = self.SMatrix(self.file1)
            matrix2.WriteToMatrixMarket(self.file2)
            ResultMat = mmread(self.file2)

            self._compare_mat(matrix1, ResultMat)

    def test_addition(self):
        '''Test routines to add together matrices.'''
        from random import uniform
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            matrix2 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)
            mmwrite(self.file2, matrix2)
            alpha = uniform(1.0, 2.0)
            CheckMat = alpha * matrix1 + matrix2
            matrix1 = self.SMatrix(self.file1)
            matrix2 = self.SMatrix(self.file2)
            matrix2.Increment(matrix1, alpha, 0.0)
            matrix2.WriteToMatrixMarket(self.file2)
            ResultMat = mmread(self.file2)

            self._compare_mat(CheckMat, ResultMat)

    def test_addzero(self):
        '''Test routines to add together a matrix and zero.'''
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)

            CheckMat = matrix1
            matrix1 = self.SMatrix(self.file1)
            matrix2 = self.SMatrix(matrix1.GetColumns(), matrix1.GetRows())
            matrix2.Increment(matrix1, 1.0, 0.0)
            matrix2.WriteToMatrixMarket(self.file2)
            ResultMat = mmread(self.file2)
            self._compare_mat(CheckMat, ResultMat)

    def test_addzeroreverse(self):
        '''Test routines to add together a matrix and zero.'''
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)

            CheckMat = matrix1
            matrix1 = self.SMatrix(self.file1)
            matrix2 = self.SMatrix(matrix1.GetColumns(), matrix1.GetRows())
            matrix1.Increment(matrix2, 1.0, 0.0)
            matrix1.WriteToMatrixMarket(self.file2)
            ResultMat = mmread(self.file2)
            self._compare_mat(CheckMat, ResultMat)

    def test_dot(self):
        '''Test routines to dot two matrices.'''
        from numpy import sum, multiply
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            matrix2 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)
            mmwrite(self.file2, matrix2)
            check = sum(multiply(matrix1.todense(), matrix2.todense()))
            matrix1 = self.SMatrix(self.file1)
            matrix2 = self.SMatrix(self.file2)
            result = matrix2.Dot(matrix1)

            self._compare(result, check)

    def test_transpose(self):
        '''Test routines to transpose a matrix.'''
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)

            matrix2 = self.SMatrix(self.file1)
            matrix2T = self.SMatrix(matrix2.GetRows(), matrix2.GetColumns())
            matrix2T.Transpose(matrix2)
            matrix2T.WriteToMatrixMarket(self.file2)

            CheckMat = matrix1.T
            ResultMat = mmread(self.file2)

            self._compare_mat(CheckMat, ResultMat)

    def test_pairwise(self):
        '''Test routines to pairwise multiply two matrices.'''
        from scipy.sparse import csr_matrix
        from numpy import multiply
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            matrix2 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)
            mmwrite(self.file2, matrix2)
            CheckMat = csr_matrix(
                multiply(matrix1.todense(), matrix2.todense()))

            ntmatrix1 = self.SMatrix(self.file1)
            ntmatrix2 = self.SMatrix(self.file2)
            ntmatrix3 = self.SMatrix(
                ntmatrix1.GetColumns(), ntmatrix1.GetRows())
            ntmatrix3.PairwiseMultiply(ntmatrix1, ntmatrix2)
            ntmatrix3.WriteToMatrixMarket(self.file3)

            ResultMat = mmread(self.file3)
            self._compare_mat(CheckMat, ResultMat)

    def test_multiply(self):
        '''Test routines to multiply two matrices.'''
        from random import uniform
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            matrix2 = param.create_matrix(complex=self.complex).H
            mmwrite(self.file1, matrix1)
            mmwrite(self.file2, matrix2)
            alpha = uniform(1.0, 2.0)
            beta = 0.0
            if abs(beta) > 0.0:
                CheckMat = alpha * matrix1.dot(matrix2) + beta * matrix1
            else:
                CheckMat = alpha * matrix1.dot(matrix2)

            ntmatrix1 = self.SMatrix(self.file1)
            ntmatrix2 = self.SMatrix(self.file2)
            ntmatrix3 = self.SMatrix(ntmatrix2.GetColumns(),
                                     ntmatrix1.GetRows())
            memory_pool = self.MatrixMemoryPool(ntmatrix2.GetColumns(),
                                                ntmatrix1.GetRows())
            ntmatrix3.Gemm(ntmatrix1, ntmatrix2, False, False, alpha, beta,
                           0.0, memory_pool)
            ntmatrix3.WriteToMatrixMarket(self.file3)

            ResultMat = mmread(self.file3)
            self._compare_mat(CheckMat, ResultMat)

    def test_multiply_nt(self):
        '''Test routines to multiply two matrices.'''
        from random import uniform
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            matrix2 = param.create_matrix(complex=self.complex).H
            mmwrite(self.file1, matrix1)
            mmwrite(self.file2, matrix2.T)
            alpha = uniform(1.0, 2.0)
            beta = 0.0
            if abs(beta) > 0.0:
                CheckMat = alpha * matrix1.dot(matrix2) + beta * matrix1
            else:
                CheckMat = alpha * matrix1.dot(matrix2)

            ntmatrix1 = self.SMatrix(self.file1)
            ntmatrix2 = self.SMatrix(self.file2)
            ntmatrix3 = self.SMatrix(ntmatrix2.GetRows(),
                                     ntmatrix1.GetRows())
            memory_pool = self.MatrixMemoryPool(ntmatrix2.GetRows(),
                                                ntmatrix1.GetRows())
            ntmatrix3.Gemm(ntmatrix1, ntmatrix2, False, True, alpha, beta,
                           0.0, memory_pool)
            ntmatrix3.WriteToMatrixMarket(self.file3)

            ResultMat = mmread(self.file3)
            self._compare_mat(CheckMat, ResultMat)

    def test_multiply_tn(self):
        '''Test routines to multiply two matrices.'''
        from random import uniform
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            matrix2 = param.create_matrix(complex=self.complex).H
            mmwrite(self.file1, matrix1.T)
            mmwrite(self.file2, matrix2)
            alpha = uniform(1.0, 2.0)
            beta = 0.0
            if abs(beta) > 0.0:
                CheckMat = alpha * matrix1.dot(matrix2) + beta * matrix1
            else:
                CheckMat = alpha * matrix1.dot(matrix2)

            ntmatrix1 = self.SMatrix(self.file1)
            ntmatrix2 = self.SMatrix(self.file2)
            ntmatrix3 = self.SMatrix(ntmatrix2.GetColumns(),
                                     ntmatrix1.GetColumns())
            memory_pool = self.MatrixMemoryPool(ntmatrix2.GetColumns(),
                                                ntmatrix1.GetColumns())
            ntmatrix3.Gemm(ntmatrix1, ntmatrix2, True, False, alpha, beta,
                           0.0, memory_pool)
            ntmatrix3.WriteToMatrixMarket(self.file3)

            ResultMat = mmread(self.file3)
            self._compare_mat(CheckMat, ResultMat)

    def test_multiply_tt(self):
        '''Test routines to multiply two matrices.'''
        from random import uniform
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            matrix2 = param.create_matrix(complex=self.complex).H
            mmwrite(self.file1, matrix1.T)
            mmwrite(self.file2, matrix2.T)
            alpha = uniform(1.0, 2.0)
            beta = 0.0
            if abs(beta) > 0.0:
                CheckMat = alpha * matrix1.dot(matrix2) + beta * matrix1
            else:
                CheckMat = alpha * matrix1.dot(matrix2)

            ntmatrix1 = self.SMatrix(self.file1)
            ntmatrix2 = self.SMatrix(self.file2)
            ntmatrix3 = self.SMatrix(ntmatrix2.GetRows(),
                                     ntmatrix1.GetColumns())
            memory_pool = self.MatrixMemoryPool(ntmatrix2.GetRows(),
                                                ntmatrix1.GetColumns())
            ntmatrix3.Gemm(ntmatrix1, ntmatrix2, True, True, alpha, beta,
                           0.0, memory_pool)
            ntmatrix3.WriteToMatrixMarket(self.file3)

            ResultMat = mmread(self.file3)
            self._compare_mat(CheckMat, ResultMat)

    def test_multiply_zero(self):
        '''Test routines to multiply two matrices where one is zero.'''
        from random import uniform
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            matrix2 = 0 * param.create_matrix(complex=self.complex).H
            mmwrite(self.file1, matrix1)
            mmwrite(self.file2, matrix2)
            alpha = uniform(1.0, 2.0)
            beta = 0.0
            if abs(beta) > 0.0:
                CheckMat = alpha * matrix1.dot(matrix2) + beta * matrix1
            else:
                CheckMat = alpha * matrix1.dot(matrix2)

            ntmatrix1 = self.SMatrix(self.file1)
            ntmatrix2 = self.SMatrix(self.file2)
            ntmatrix3 = self.SMatrix(ntmatrix2.GetColumns(),
                                     ntmatrix1.GetRows())
            memory_pool = self.MatrixMemoryPool(ntmatrix2.GetColumns(),
                                                ntmatrix1.GetRows())
            ntmatrix3.Gemm(ntmatrix1, ntmatrix2, False, False, alpha, beta,
                           0.0, memory_pool)
            ntmatrix3.WriteToMatrixMarket(self.file3)

            ResultMat = mmread(self.file3)
            self._compare_mat(CheckMat, ResultMat)

    def test_get_row(self):
        '''Test function that extracts a row from the matrix'''
        from random import randint
        for param in self.parameters:
            if param.rows == 0:
                continue
            matrix1 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)
            row_num = randint(0, param.rows - 1)
            CheckMat = matrix1[row_num, :]

            ntmatrix1 = self.SMatrix(self.file1)
            ntmatrix2 = self.SMatrix(ntmatrix1.GetColumns(), 1)
            ntmatrix1.ExtractRow(row_num, ntmatrix2)
            ntmatrix2.WriteToMatrixMarket(self.file2)

            ResultMat = mmread(self.file2)
            self._compare_mat(CheckMat, ResultMat)

    def test_get_column(self):
        '''Test function that extracts a column from the matrix'''
        from random import randint
        for param in self.parameters:
            if param.columns == 0:
                continue
            matrix1 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)
            column_num = randint(0, param.columns - 1)
            CheckMat = matrix1[:, column_num]

            ntmatrix1 = self.SMatrix(self.file1)
            ntmatrix2 = self.SMatrix(1, ntmatrix1.GetRows())
            ntmatrix1.ExtractColumn(column_num, ntmatrix2)
            ntmatrix2.WriteToMatrixMarket(self.file2)

            ResultMat = mmread(self.file2)
            self._compare_mat(CheckMat, ResultMat)

class TestLocalMatrix_c(TestLocalMatrix):
    '''Specialization for complex matrices'''
    SMatrix = nt.Matrix_lsc
    MatrixMemoryPool = nt.MatrixMemoryPool_c
    complex = True

    def test_conjugatetranspose(self):
        '''Test routines to compute the conjugate transpose of a matrix.'''
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)

            matrix2 = self.SMatrix(self.file1)
            matrix2T = self.SMatrix(matrix2.GetRows(), matrix2.GetColumns())
            matrix2T.Transpose(matrix2)
            matrix2T.Conjugate()
            matrix2T.WriteToMatrixMarket(self.file2)

            CheckMat = matrix1.H
            ResultMat = mmread(self.file2)
            self._compare_mat(CheckMat, ResultMat)

    def test_dot(self):
        '''Test routines to dot two matrices.'''
        from numpy import sum, multiply, conj
        for param in self.parameters:
            matrix1 = param.create_matrix(complex=self.complex)
            matrix2 = param.create_matrix(complex=self.complex)
            mmwrite(self.file1, matrix1)
            mmwrite(self.file2, matrix2)
            check = sum(multiply(conj(matrix1.todense()), matrix2.todense()))
            matrix1 = self.SMatrix(self.file1)
            matrix2 = self.SMatrix(self.file2)
            result = matrix1.Dot(matrix2)

            self._compare(result, check)

###############################################################################
if __name__ == '__main__':
    unittest.main()


text:
package org.koivula.javatop;

import java.lang.management.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.HashSet;
import java.util.HashMap;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.Collections;
import java.util.Collection;
import java.util.Arrays;
import sun.tools.jstack.JStack;
import java.io.*;
import java.util.regex.*;

public class Javatop {

    private static void printUsage() {
        System.out.println("\nUsage: javatop [options..] [pid]");
        System.out.println("       javatop -i [file] [options..]\n");

        System.out.println("Collect and show thread information of a Java application by taking");
        System.out.println("multiple thread dump samples by connecting to the JVM similarly than");
        System.out.println("jstack tool.\n");

        System.out.println("Options:");
        System.out.println("    -t N     Take samples in N msec intervals (default: 100)");
        System.out.println("    -c N     Take total of N samples (default: 20)");
        System.out.println("    -w M     Print results using width N (default: 40)");
        System.out.println("    -j       Do not hide built-in JVM threads");
        System.out.println("    -b       Print black and white instead of ANSI colors");
        System.out.println("    -o FILE  Write samples into a file instead of printing results");
        System.out.println("    -a FILE  Take one sample and append it into a file. This option");
        System.out.println("             can be used from scripts to collect thread information");
        System.out.println("             of longer periods to be analyzed later");
        System.out.println("    -i FILE  Read samples from given file instead of connecting to a");
        System.out.println("             JVM instance and show results");
        System.out.println("    -r N-M   Print results from samples N-M (useful with -i option)");
        System.out.println("    -n N     Print a thread dump of sample N (useful with -i option)");
        System.out.println("    -s       Take pme sample and print thread dump (jstack)");
        System.out.println("    -d       Print debug information");

        System.out.println("\nFor more details see <https://github.com/tkoivula/javatop>\n");
    }

    public static void main(String[] args) {
        try {
            System.exit(run(args));
        } catch (NoClassDefFoundError t) {
            System.err.println("ERROR: No tools.jar found. Connecting with remote JVM requires JDK not JRE.");
            System.err.println("ERROR: Try setting JAVA_HOME environment variable or copy tools.jar into");
            System.err.println("ERROR: the same directory with javatop command.");
            System.exit(1);

        } catch (Throwable t) {
            String msg = t.getMessage();
            if (msg == null || msg.length() == 0) msg = "";
            System.out.println("ERROR: " + t.getClass().getName() + " " + msg);
            System.exit(2);
        }
    }

    protected static int run(String[] args) throws Exception {
        // Params and their defaults:
        int times = 20;
        int interval = 100;
        int width = 40;

        Integer min = null;
        Integer max = null;

        boolean hideJvmThreads = true;
        boolean append = false;
        File outputFile = null;
        File inputFile = null;
        boolean colors = true;

        boolean debug = false;
        boolean ok = true;
        boolean printStack = false;
        Integer printNthSample = null;

        String pid = null;
        for (int i = 0; i < args.length; ++i) {
            if (args[i].equals("-h") || args[i].equals("--help")) {
                ok = false;
            } else if (args[i].equals("-d")) {
                debug = true;
            } else if (args[i].equals("-t")) {
                interval = Integer.parseInt(args[++i]);
            } else if (args[i].equals("-c")) {
                times = Integer.parseInt(args[++i]);
            } else if (args[i].equals("-w")) {
                width = Integer.parseInt(args[++i]);
            } else if (args[i].equals("-o")) {
                outputFile = new File(args[++i]);
            } else if (args[i].equals("-a")) {
                outputFile = new File(args[++i]);
                append = true;
                times = 1;
            } else if (args[i].equals("-i")) {
                inputFile = new File(args[++i]);
            } else if (args[i].equals("-j")) {
                hideJvmThreads = false;
            } else if (args[i].equals("-b")) {
                colors = false;
            } else if (args[i].equals("-r")) {
                String[] minMax = args[++i].split("-");
                min = Integer.parseInt(minMax[0]);
                max = Integer.parseInt(minMax[1]);
            } else if (args[i].equals("-n")) {
                printNthSample = Integer.parseInt(args[++i]) - 1;
            } else if (args[i].equals("-s")) {
                printNthSample = 0;
                times = 1;
            } else {
                pid = args[i];
            }
        }

        // check that we have PID
        if (ok && pid == null && inputFile == null) {
            pid = Processes.findProcess("java");
            if (pid != null) {
                System.out.println("Found java process with pid " + pid);
            } else {
                System.err.println("Could not automatically detect the java process. Specify PID of the monitored JVM.");
                ok = false;
            }
        }

        if (!ok) {
            printUsage();
            return 1;
        }

        ThreadData dump;
        if (inputFile != null) {
            // Deserialize samples from file
            dump = ThreadData.readFrom(inputFile);

        } else {
           // Collect samples
           dump = new ThreadData();
           dump.collectSamples(pid, times, interval, debug);
        }
        if (min != null) {
            dump.select(min, max);
        }

        // Calculate
        dump.calc(hideJvmThreads);

        System.out.println("\n");

        if (printNthSample != null) {
            dump.print(printNthSample, System.out);
            System.exit(0);
        }

        if (outputFile != null) {
            // Serialize samples into a file
            dump.writeInto(outputFile, append);

        } else {
            // Print results
            printResults(dump, times, colors, width);

            //JStack.main(args);
        }
        return 0;
    }

    private static void printResults(ThreadData dump,
             int times, boolean colors, int width) {
        Long time1 = dump.threads.get(0).timestamp;
        Long time2 = dump.threads.get(dump.threads.size() - 1).timestamp;
        if (time1 != null && time2 != null) {
            System.out.println(String.format("Samples: %d (%tc - %tc)",
                  dump.threads.size(),
                  time1, time2));
        }
        System.out.println(String.format("Threads total: %d", dump.ids.size()));
        System.out.println(String.format("Short lived threads: %d",
            dump.countLessThan(times)));
        System.out.println("RUNNABLE threads: " + stat(dump.countStateEqual("RUNNABLE")));
        System.out.println("BLOCKED threads:  " + stat(dump.countStateEqual("BLOCKED")));
        System.out.println("I/O threads:      " + stat(dump.countStateEqual("IO")));

        ThreadTable table = new ThreadTable(dump);

        System.out.println("");
        System.out.println("");
        System.out.println(table.printLegend(colors));

        System.out.println("All threads:");
        Ascii.line(61);
        table.plot(width, false, colors);

        System.out.println("Grouped by names:");
        Ascii.line(61);
        table.plot(width, true, colors);
    }

    public static String stat(List<Long> values) {
        long min = values.get(0);
        long max = values.get(0);

        long sum = 0L;
        for (Long v: values) {
            sum += v;
            if (v < min) min = v;
            if (v > max) max = v;
        }
        Collections.sort(values);
        long mean = values.get(values.size() / 2);

        return String.format("min=%d, max=%d, average=%.2f, mean=%d",
                  min, max, 1.0 * sum / values.size(), mean);
    }

    public static String stat(List<Double> values, String prec) {
        double min = values.get(0);
        double max = values.get(0);

        double sum = 0.0;
        for (double v: values) {
            sum += v;
            if (v < min) min = v;
            if (v > max) max = v;
        }
        Collections.sort(values);
        double mean = values.get(values.size() / 2);

        return String.format("min="+prec+", max="+prec+", average="+prec+", mean="+prec,
                  min, max, 1.0 * sum / values.size(), mean);
    }

}


text:
Merci !!!

	Vous venez de valider une annonce sur passionrunning.com

	L'équipe Passion Running va valider et publier votre annonce dès que possible.

	Lorsque votre annonce sera validée, elle sera visible pendant 180 jours sur le site, vous pouvez la supprimer ou la modifier en vous connectant à votre espace grâce à votre email et votre mot de passe.


text:
package com.appglu.impl;

import java.util.concurrent.Callable;

import com.appglu.AsyncCallback;
import com.appglu.AsyncStorageOperations;
import com.appglu.StorageFile;
import com.appglu.StorageOperations;
import com.appglu.InputStreamCallback;

public final class AsyncStorageTemplate implements AsyncStorageOperations {

	private final AsyncExecutor asyncExecutor;

	private final StorageOperations storageOperations;

	public AsyncStorageTemplate(AsyncExecutor asyncExecutor, StorageOperations storageOperations) {
		this.asyncExecutor = asyncExecutor;
		this.storageOperations = storageOperations;
	}

	/**
	 * {@inheritDoc}
	 */
	public void streamStorageFileInBackground(final StorageFile file, final InputStreamCallback inputStreamCallback, AsyncCallback<Void> downloadCallback) {
		asyncExecutor.execute(downloadCallback, new Callable<Void>() {
			public Void call() {
				storageOperations.streamStorageFile(file, inputStreamCallback);
				return null;
			}
		});
	}

	/**
	 * {@inheritDoc}
	 */
	public void streamStorageFileIfModifiedSinceInBackground(final StorageFile file, final InputStreamCallback inputStreamCallback, AsyncCallback<Boolean> downloadCallback) {
		asyncExecutor.execute(downloadCallback, new Callable<Boolean>() {
			public Boolean call() {
				return storageOperations.streamStorageFileIfModifiedSince(file, inputStreamCallback);
			}
		});
	}

	/**
	 * {@inheritDoc}
	 */
	public void streamStorageFileIfNoneMatchInBackground(final StorageFile file, final InputStreamCallback inputStreamCallback, AsyncCallback<Boolean> downloadCallback) {
		asyncExecutor.execute(downloadCallback, new Callable<Boolean>() {
			public Boolean call() {
				return storageOperations.streamStorageFileIfNoneMatch(file, inputStreamCallback);
			}
		});
	}

}


text:
import { logger } from "./logger";
import * as clc from "colorette";

/* istanbul ignore next */
export function logError(error: any): void {
  if (error.children && error.children.length) {
    logger.error(clc.bold(clc.red("Error:")), clc.underline(error.message) + ":");
    error.children.forEach((child: any) => {
      let out = "- ";
      if (child.name) {
        out += clc.bold(child.name) + " ";
      }
      out += child.message;

      logger.error(out);
    });
  } else {
    if (error.original) {
      logger.debug(error.original.stack);
    }
    logger.error();
    logger.error(clc.bold(clc.red("Error:")), error.message);
  }
  if (error.context) {
    logger.debug("Error Context:", JSON.stringify(error.context, undefined, 2));
  }
}


text:
#ifndef MD5_H
#define MD5_H

/* Unlike previous versions of this code, uint32 need not be exactly
   32 bits, merely 32 bits or more.  Choosing a data type which is 32
   bits instead of 64 is not important; speed is considerably more
   important.  ANSI guarantees that "unsigned long" will be big enough,
   and always using it seems to have few disadvantages.  */
typedef unsigned long uint32;

struct MD5Context {
	uint32 buf[4];
	uint32 bits[2];
	unsigned char in[64];
};

void MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context,
			   unsigned char const *buf, unsigned len);
void MD5Final(unsigned char digest[16],
			  struct MD5Context *context);
void MD5Transform(uint32 buf[4], const unsigned char in[64]);

#endif /* !MD5_H */


text:
<!doctype html>

    <meta charset="UTF-8">
    <title>Pricing Table</title>

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css">

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.min.css">

    <link rel="stylesheet" href="assets/css/main.min.css">

    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/metisMenu/1.1.3/metisMenu.min.css">

    <link rel="stylesheet" href="assets/css/style-switcher.css">
    <link rel="stylesheet/less" type="text/css" href="assets/less/theme.less">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                Toggle navigation

              </button>

                  5

                  4

 Dashboard

 Tables

 File Manager

                    Form Elements

 General

 Validation

 WYSIWYG

 Wizard & File Upload

            <form class="main-search" action="">

                <input type="text" class="form-control" placeholder="Live Search ...">

            <button class="btn btn-primary btn-sm text-muted" type="button">

            </button>

            </form>

                Pricing Table

              16

Archie

 Administrator

Last Access :

                     16 Mar 16:32

Menu

               Dashboard

              Layouts

                    Boxed Layout

                    Boxed Layout & Fixed Header

                    Fixed Header and Fixed Mini Menu

                    Fixed Header & Menu

                    Fixed Header & Mini Menu

                    Fixed Header

                    Boxed Layout & Fixed Menu

                    Fixed Menu

                    Fixed & Mini Menu

                    Boxed and Fixed Header & Nav

                    No Header & Sidebars

                    No Header

                    No Left & Right Sidebar

                    No Left Sidebar & Main Search

                    No Left Sidebar

                    No Main Search

                    No Right Sidebar

                    Mini Sidebar

              Components

                    Bg Color

                    Bg Image

                    Buttons

                    Icon

                    Pricing Table

                    Progress

            Forms

                    Form General

                    Form Validation

                    Form Wizard

                    Form WYSIWYG

              Tables

      File Manager

            Typography

            Maps

            Charts

            Calendar

              Error Pages

                   403

                   404

                   405

                   500

                   503

                   offline

                   Under Construction

    Grid

    Blank Page

    Login Page

    	Unlimited Level Menu

                Level 1

 Level 2

 Level 2

                    Level 2

 Level 3

 Level 3

                        Level 3

 Level 4

 Level 4

                            Level 4

 Level 5

 Level 5

 Level 5

 Level 4

 Level 2

 Level 1

                Level 1

 Level 2

 Level 2

 Level 2

Dark
                  primary

                    <input type="radio" name="options" value="primary"> Primary

                    <input type="radio" name="options" value="success"> Success

                    <input type="radio" name="options" value="danger"> Danger

                    <input type="radio" name="options" value="info"> Info

                    <input type="radio" name="options" value="warning"> Warning

                    <input type="radio" name="options" value="default"> Default

Starter

                        Free

Premium Profile Listing

Unlimited File Access

Free Appointments

5 Bonus Points  every month

Customizable Profile Page

2 months  support

                      Get Started

Basic

                        $24.99
                        per month

Premium Profile Listing

Unlimited File Access

Free Appointments

20 Bonus Points  every month

Customizable Profile Page

6 months  support

                      Get Started

Premium

                        $49.99
                        per month

Premium Profile Listing

Unlimited File Access

Free Appointments

50 Bonus Points  every month

Customizable Profile Page

Lifetime  support

                      Get Started

Light
                  warning

                    <input type="radio" name="options" value="primary"> Primary

                    <input type="radio" name="options" value="success"> Success

                    <input type="radio" name="options" value="danger"> Danger

                    <input type="radio" name="options" value="info"> Info

                    <input type="radio" name="options" value="warning"> Warning

                    <input type="radio" name="options" value="default"> Default

Starter

                        Free

Premium Profile Listing

Unlimited File Access

Free Appointments

5 Bonus Points  every month

Customizable Profile Page

2 months  support

                      Get Started

Basic

                        $24.99
                        per month

Premium Profile Listing

Unlimited File Access

Free Appointments

20 Bonus Points  every month

Customizable Profile Page

6 months  support

                      Get Started

Premium

                        $49.99
                        per month

Premium Profile Listing

Unlimited File Access

Free Appointments

50 Bonus Points  every month

Customizable Profile Page

Lifetime  support

                      Get Started

Ultra

                        $149.99
                        per month

Premium Profile Listing

Unlimited File Access

Free Appointments

150 Bonus Points  every month

Customizable Profile Page

Eternity  support

                      Get Started

          <button type="button" class="close" data-dismiss="alert">×</button>
          Warning!  Best check yo self, you're not looking too good.

Visitor 1,4,4,7,5,9,10

Online Visitor Loading..

Popularity Loading..

New Users 1,3,4,5,3,5

          <button class="btn btn-block">Default</button>
          <button class="btn btn-primary btn-block">Primary</button>
          <button class="btn btn-info btn-block">Info</button>
          <button class="btn btn-success btn-block">Success</button>
          <button class="btn btn-danger btn-block">Danger</button>
          <button class="btn btn-warning btn-block">Warning</button>
          <button class="btn btn-inverse btn-block">Inverse</button>
          <button class="btn btn-metis-1 btn-block">btn-metis-1</button>
          <button class="btn btn-metis-2 btn-block">btn-metis-2</button>
          <button class="btn btn-metis-3 btn-block">btn-metis-3</button>
          <button class="btn btn-metis-4 btn-block">btn-metis-4</button>
          <button class="btn btn-metis-5 btn-block">btn-metis-5</button>
          <button class="btn btn-metis-6 btn-block">btn-metis-6</button>

          Default 20%

          Success 40%

          warning 60%

          Danger 80%

2014 © Metis Bootstrap Admin Template

            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

Modal title

              Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
              in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>


text:
class SUCloseOnClick : public LAttachment, public LBroadcaster
{
	public:
								SUCloseOnClick( const LWindow *closeThisOne );
		virtual		Boolean		Execute( MessageT inMessage, void *ioParam );

		static 		void		CreateSplashWindow( ResIDT inRezID, LCommander *inSuper );

	protected:
		LWindow		*mWindowToClose;
};


text:
from setuptools import setup, find_packages
from setuptools.command.install import install

def __read_requirement():
    with open('requirements.txt') as f:
        return f.readlines()

VERSION = '0.0.1'

setup(
    cmdclass={'install': install},
    name='python-orc',
    version=VERSION,
    keywords='Python ORC Reader',
    author='Bao Nguyen',
    author_email='b@nqbao.com',
    packages=find_packages(exclude=['tests']),
    data_files=[("share/python-orc", ['../java-gateway/target/gateway-%s-jar-with-dependencies.jar' % VERSION])],
    include_package_data=True,
    zip_safe=False,
    scripts=[
        "orc2csv"
    ],
    license="BSD License",
    url='https://github.com/nqbao/python-orc',
    description='Poor man Python ORC Reader',
    install_requires=__read_requirement(),
)


text:
import keystoneauth1.session

from gnocchiclient import client
from gnocchiclient.v1 import aggregates
from gnocchiclient.v1 import archive_policy
from gnocchiclient.v1 import archive_policy_rule
from gnocchiclient.v1 import build
from gnocchiclient.v1 import capabilities
from gnocchiclient.v1 import metric
from gnocchiclient.v1 import resource
from gnocchiclient.v1 import resource_type
from gnocchiclient.v1 import status

class Client(object):
    """Client for the Gnocchi v1 API.

    :param session: keystoneauth1 session
    :type session: py:class:`keystoneauth1.session.Session` (optional)
    :param adapter_options: options to pass to
                            py:class:`keystoneauth1.adapter.Adapter`
    :type adapter_options: dict (optional)
    :param session_options: options to pass to
                            py:class:`keystoneauth1.session.Session`
    :type session_options: dict (optional)
    """

    def __init__(self, session=None, adapter_options=None,
                 session_options=None):
        """Initialize a new client for the Gnocchi v1 API."""
        session_options = session_options or {}
        adapter_options = adapter_options or {}

        adapter_options.setdefault('service_type', "metric")

        if session is None:
            session = keystoneauth1.session.Session(**session_options)
        else:
            if session_options:
                raise ValueError("session and session_options are exclusive")

        self.api = client.SessionClient(session, **adapter_options)
        self.resource = resource.ResourceManager(self)
        self.resource_type = resource_type.ResourceTypeManager(self)
        self.archive_policy = archive_policy.ArchivePolicyManager(self)
        self.archive_policy_rule = (
            archive_policy_rule.ArchivePolicyRuleManager(self))
        self.metric = metric.MetricManager(self)
        self.aggregates = aggregates.AggregatesManager(self)
        self.capabilities = capabilities.CapabilitiesManager(self)
        self.status = status.StatusManager(self)
        self.build = build.BuildManager(self)


text:
export JAVA_OPTS="-Xms2g -Xmx2g -XX:MaxPermSize=256m -XX:+UseG1GC -XX:MaxGCPauseMillis=25 -verbosegc -Xloggc:/tmp/wildfly_gc.log"

mvn clean initialize package -Pbenchmark -Ddatabase.host=${DBHOST}
target/wildfly-8.1.0.Final/bin/standalone.sh -b 0.0.0.0 &


text:
package swim

import (
	"bytes"
	"compress/flate"
	"io"
)

// The flate codec wraps around a concrete codec implementation to provde
// DEFLATE compression.
type FlateCodec struct {
	Codec // The concrete codec to use
}

// Implementation of Codec.Decode()
func (c *FlateCodec) Decode(coded *CodedMessage) error {

	// decompress
	r := flate.NewReader(bytes.NewBuffer(coded.Bytes))
	var b bytes.Buffer
	if _, err := io.Copy(&b, r); err != nil {
		return err
	}
	if err := r.Close(); err != nil {
		return err
	}
	data := b.Bytes()

	// save decompressed
	coded.Bytes = data
	coded.Size = len(data)

	// concrete decode
	return c.Codec.Decode(coded)
}

// Implementation of Codec.Encode()
func (c *FlateCodec) Encode(coded *CodedMessage) error {

	// concrete encode
	if err := c.Codec.Encode(coded); err != nil {
		return err
	}

	// compress
	var b bytes.Buffer
	w, err := flate.NewWriter(&b, flate.BestCompression)
	if err != nil {
		return err
	}
	if _, err := w.Write(coded.Bytes); err != nil {
		return err
	}
	if err := w.Close(); err != nil {
		return err
	}
	data := b.Bytes()

	// save compressed
	coded.Bytes = data
	coded.Size = len(data)

	return nil
}


text:
module ActionController
  module ImplicitRender
    def send_action(method, *args)
      ret = super
      default_render unless performed?
      ret
    end

    def default_render(*args)
      render(*args)
    end

    def method_for_action(action_name)
      super || if template_exists?(action_name.to_s, _prefixes)
        "default_render"
      end
    end
  end
end


text:
#ifndef STAN_MATH_PRIM_PROB_SKEW_DOUBLE_EXPONENTIAL_CCDF_LOG_HPP
#define STAN_MATH_PRIM_PROB_SKEW_DOUBLE_EXPONENTIAL_CCDF_LOG_HPP

#include <stan/math/prim/meta.hpp>
#include <stan/math/prim/prob/skew_double_exponential_lccdf.hpp>

namespace stan {
namespace math {

/** \ingroup prob_dists
 * @deprecated use skew_double_exponential_lccdf
 */
template <typename T_y, typename T_loc, typename T_scale, typename T_skewness>
inline return_type_t<T_y, T_loc, T_scale, T_skewness>
skew_double_exponential_ccdf_log(const T_y& y, const T_loc& mu,
                                 const T_scale& sigma, const T_skewness& tau) {
  return skew_double_exponential_lccdf<T_y, T_loc, T_scale, T_skewness>(
      y, mu, sigma, tau);
}

}  // namespace math
}  // namespace stan
#endif


text:
package com.kodedu.service.extension;

import java.util.concurrent.CompletableFuture;

/**
 * Created by usta on 25.12.2014.
 */
public interface TreeService extends DefaultSettings {
    public final static String label = "core::service::extension::Tree";
    public void createFileTree(String tree, String type, ImageInfo imageInfo, String nodename, CompletableFuture completed);
    public void createHighlightFileTree(String tree, String type,ImageInfo imageInfo, String nodename,CompletableFuture completed);
}


text:
import * as assert from "assert";
import * as ByteBuffer from "bytebuffer";
import { EventEmitter } from "events";
import * as Long from "long";
import assertExists from "./assert-exists";
import * as consts from "./consts";
import { MAX_PLAYER_NAME_LENGTH, SIGNED_GUID_LEN } from "./consts";
import { DemoFile } from "./demo";
import { BitStream } from "./ext/bitbuffer";
import {
  CSVCMsgCreateStringTable,
  CSVCMsgUpdateStringTable
} from "./protobufs/netmessages";

/**
 * Player info structure.
 * @property {Long} xuid - 64-bit Steam ID (e.g. 76561197988627193)
 * @property {string} name - Player name
 * @property {int} userId - Local server user ID, unique while server is running
 * @property {string} guid - Steam2 ID string (e.g. STEAM_0:1:14180732)
 * @property {int} friendsId - Steam account number
 * @property {string} friendsName - Friends name
 * @property {bool} fakePlayer - true, if player is a bot
 * @property {bool} isHltv - true, if player is the HLTV proxy
 * @property {int[]} customFiles - custom files CRC for this player
 */

export interface IPlayerInfo {
  xuid: Long;
  name: string;
  userId: number;
  guid: string;
  friendsId: number;
  friendsName: string;
  fakePlayer: boolean;
  isHltv: boolean;
  // customFiles: number[];
}

function parseUserInfoData(buf: Buffer): IPlayerInfo {
  const bytebuf = ByteBuffer.wrap(buf, ByteBuffer.BIG_ENDIAN);
  bytebuf.skip(8);

  const hi = bytebuf.readUint32();
  const lo = bytebuf.readUint32();

  const xuid = Long.fromBits(lo, hi);
  const name = bytebuf
    .readString(MAX_PLAYER_NAME_LENGTH, ByteBuffer.METRICS_BYTES)
    .split("\0", 2)[0]!;
  const userId = bytebuf.readUint32();
  const guid = bytebuf
    .readString(SIGNED_GUID_LEN + 1, ByteBuffer.METRICS_BYTES)
    .split("\0", 2)[0]!;
  bytebuf.skip(3);
  const friendsId = bytebuf.readUint32();
  const friendsName = bytebuf
    .readString(MAX_PLAYER_NAME_LENGTH, ByteBuffer.METRICS_BYTES)
    .split("\0", 2)[0]!;
  const fakePlayer = bytebuf.readByte() !== 0;
  bytebuf.skip(3);
  const isHltv = bytebuf.readByte() !== 0;
  bytebuf.skip(3);

  return {
    xuid,
    name,
    userId,
    guid,
    friendsId,
    friendsName,
    fakePlayer,
    isHltv
  };
}

export interface IStringTableUpdateEvent<T> {
  table: IStringTable<T>;
  entryIndex: number;
  entry: string;
  userData: T | null;
  oldUserData: T | null;
}

export interface IStringTableEntry<T> {
  entry: string;
  userData: T | null;
}

export interface IStringTable<T> {
  name: string;
  entries: Array<IStringTableEntry<T>>;
  userDataSizeBits: number;
  userDataFixedSize: boolean;
  maxEntries: number;
}

export type WellKnownStringTable =
  | "downloadables"
  | "modelprecache"
  | "genericprecache"
  | "soundprecache"
  | "decalprecache"
  | "instancebaseline"
  | "lightstyles"
  | "userinfo"
  | "dynamicmodel"
  | "server_query_info"
  | "ExtraParticleFilesTable"
  | "ParticleEffectNames"
  | "EffectDispatch"
  | "VguiScreen"
  | "Materials"
  | "InfoPanel"
  | "Scenes"
  | "Movies"
  | "GameRulesCreation";

export declare interface StringTables {
  findTableByName(table: "userinfo"): IStringTable<IPlayerInfo> | undefined;
  findTableByName(
    table: WellKnownStringTable
  ): IStringTable<Buffer> | undefined;

  /**
   * Fired when a table is created. Entries are empty at this point.
   */
  on(event: "create", listener: (table: IStringTable<any>) => void): this;
  emit(name: "create", event: IStringTable<any>): boolean;

  /**
   * Fired after a table is created. Entries have been populated by now.
   */
  on(event: "postcreate", listener: (table: IStringTable<any>) => void): this;
  emit(name: "postcreate", event: IStringTable<any>): boolean;

  /**
   * Fired when a string table entry is updated.
   */
  on(
    event: "update",
    listener: (event: IStringTableUpdateEvent<any>) => void
  ): this;
  emit(name: "update", event: IStringTableUpdateEvent<any>): boolean;
}

/**
 * Handles string tables for a demo file.
 */
export class StringTables extends EventEmitter {
  public tables: Array<IStringTable<any>> = [];
  public userDataCallbacks: Record<string, ((buf: Buffer) => any) | undefined>;

  constructor() {
    super();

    /**
     * User data handlers. Transform raw buffer into any other value.
     * By default, `userinfo` user data is transformed to {@link PlayerInfo}
     * objects.
     */
    this.userDataCallbacks = {
      userinfo: parseUserInfoData
    };
  }

  public listen(messageEvents: DemoFile): void {
    messageEvents.on(
      "svc_UpdateStringTable",
      this._handleUpdateStringTable.bind(this)
    );
    messageEvents.on(
      "svc_CreateStringTable",
      this._handleCreateStringTable.bind(this)
    );
  }

  public findTableByName(
    name: WellKnownStringTable
  ): IStringTable<any> | undefined {
    return this.tables.find(table => table.name === name);
  }

  public handleStringTables(bitbuf: BitStream): void {
    const numTables = bitbuf.readUInt8();

    for (let i = 0; i < numTables; ++i) {
      const tableName = bitbuf.readCString();
      this._handleStringTable(tableName as WellKnownStringTable, bitbuf);
    }
  }

  private _handleStringTable(name: WellKnownStringTable, bitbuf: BitStream) {
    const userDataCallback = this.userDataCallbacks[name];

    const table = assertExists(this.findTableByName(name));
    const numEntries = bitbuf.readUInt16();

    for (let entryIndex = 0; entryIndex < numEntries; ++entryIndex) {
      const entry = bitbuf.readCString();
      let userData: unknown = null;

      // has user data?
      if (bitbuf.readOneBit()) {
        const userDataSize = bitbuf.readUInt16();
        const userDataBuf = bitbuf.readBytes(userDataSize);

        userData =
          userDataCallback === undefined
            ? userDataBuf
            : userDataCallback(userDataBuf);
      }

      const oldUserData: unknown = table.entries[entryIndex]?.userData;
      table.entries[entryIndex] = { entry, userData };

      this.emit("update", {
        table,
        entryIndex,
        entry,
        userData,
        oldUserData
      });
    }

    // parse client-side entries
    if (bitbuf.readOneBit()) {
      const numStrings = bitbuf.readUInt16();

      for (let i = 0; i < numStrings; ++i) {
        // eslint-disable-next-line @typescript-eslint/no-unused-vars
        const entry = bitbuf.readCString();
        let userData: unknown = null;

        if (bitbuf.readOneBit()) {
          const userDataSize = bitbuf.readUInt16();
          const userDataBuf = bitbuf.readBytes(userDataSize);

          // eslint-disable-next-line @typescript-eslint/no-unused-vars
          userData =
            userDataCallback === undefined
              ? userDataBuf
              : userDataCallback(userDataBuf);
        }

        // TODO: do something with client-side entries
      }
    }

    // table is ready
    this.emit("postcreate", table);
  }

  private _parseStringTableUpdate(
    bitbuf: BitStream,
    table: IStringTable<any>,
    entries: number
  ) {
    const history: Array<string | null> = [];

    const entryBits = Math.ceil(Math.log2(table.maxEntries));

    const userDataCallback = this.userDataCallbacks[table.name];

    assert(!bitbuf.readOneBit(), "dictionary encoding unsupported");

    let entryIndex = -1;
    for (let i = 0; i < entries; ++i) {
      entryIndex += 1;

      if (!bitbuf.readOneBit()) {
        entryIndex = bitbuf.readUBits(entryBits);
      }

      assert(
        entryIndex >= 0 && entryIndex < table.maxEntries,
        "bogus string index"
      );

      const existingEntry = table.entries[entryIndex];
      let entry = null;

      // has the entry changed?
      if (bitbuf.readOneBit()) {
        // substring check
        if (bitbuf.readOneBit()) {
          const index = bitbuf.readUBits(5);
          const bytesToCopy = bitbuf.readUBits(consts.SUBSTRING_BITS);

          const last = history[index];
          if (last == null) {
            throw new Error(
              "string table entry is delta from non existent entry"
            );
          }

          const subStr = last.slice(0, bytesToCopy);
          const suffix = bitbuf.readCString();

          entry = subStr + suffix;
        } else {
          entry = bitbuf.readCString();
        }
      } else {
        // If the string itself hasn't changed, this entry must already exist
        entry = assertExists(existingEntry).entry;
      }

      // read in the user data
      let userData: unknown = null;

      if (bitbuf.readOneBit()) {
        // don't read the length, it's fixed length and the length was networked down already
        if (table.userDataFixedSize) {
          const userDataArray = [bitbuf.readUBits(table.userDataSizeBits)];
          userData = Buffer.from(userDataArray);
        } else {
          const bytes = bitbuf.readUBits(consts.MAX_USERDATA_BITS);
          userData = bitbuf.readBytes(bytes);
        }

        if (userDataCallback !== undefined) {
          userData = userDataCallback(userData as Buffer);
        }
      } else {
        userData = existingEntry?.userData;
      }

      const oldUserData: unknown = existingEntry?.userData;
      table.entries[entryIndex] = { entry, userData };

      // add to history
      if (history.length > 31) {
        history.shift();
      }

      history.push(entry);

      this.emit("update", {
        table,
        entryIndex,
        entry,
        userData,
        oldUserData
      });
    }
  }

  private _handleCreateStringTable(msg: CSVCMsgCreateStringTable) {
    const bitbuf = BitStream.from(msg.stringData);

    // table shouldn't already exist
    assert(
      this.findTableByName(msg.name as WellKnownStringTable) === undefined,
      "table already exists"
    );

    assert(
      msg.userDataSize === Math.ceil(msg.userDataSizeBits / 8),
      "invalid user data byte size"
    );
    assert(msg.userDataSizeBits <= 32, "userdata value too large");

    // create an empty table
    const table: IStringTable<any> = {
      name: msg.name,
      entries: [],
      userDataSizeBits: msg.userDataSizeBits,
      userDataFixedSize: msg.userDataFixedSize,
      maxEntries: msg.maxEntries
    };

    this.emit("create", table);

    this._parseStringTableUpdate(bitbuf, table, msg.numEntries);

    this.tables.push(table);
  }

  private _handleUpdateStringTable(msg: CSVCMsgUpdateStringTable) {
    const bitbuf = BitStream.from(msg.stringData);

    const table = assertExists(this.tables[msg.tableId], "bad table index");
    this._parseStringTableUpdate(bitbuf, table, msg.numChangedEntries);
  }
}


text:
<title>RTShader - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="doxygen.css">
<link type="text/css" rel="stylesheet" href="tabs.css">

Main Page

Related Pages

Modules

Namespaces

Classes

Files

Directories

Classes |
Defines |
Typedefs |
Enumerations |
Functions |
Variables |
Friends

RTShader

Core

Collaboration diagram for RTShader:

<map name="group____RTShader" id="group____RTShader">
<area shape="rect" id="node1" href="group__Core.html" title="Core" alt="" coords="5,5,56,35"/></map>

Classes

class  	Ogre::RTShader::CGProgramProcessor

 	CG Language program processor class.  More...

class  	Ogre::RTShader::CGProgramWriter

 	CG target language writer implementation.  More...

class  	Ogre::RTShader::ShaderProgramWriterCGFactory

 	CG program writer factory implementation.  More...

class  	Ogre::RTShader::Function

 	A class that represents a shader based program function.  More...

class  	Ogre::RTShader::FunctionAtom

 	A class that represents an atomic code section of shader based program function.  More...

class  	Ogre::RTShader::Operand

 	A class that represents a function operand (its the combination of a parameter the in/out semantic and the used fields)  More...

class  	Ogre::RTShader::FunctionInvocation

 	A class that represents function invocation code from shader based program function.  More...

class  	Ogre::RTShader::ShaderGenerator

 	Shader generator system main interface.  More...

class  	Ogre::RTShader::GLSLESProgramProcessor

 	GLSL ES Language program processor class.  More...

class  	Ogre::RTShader::GLSLESProgramWriter

 	GLSL ES target language writer implementation.  More...

class  	Ogre::RTShader::ShaderProgramWriterGLSLESFactory

 	GLSL ES program writer factory implementation.  More...

class  	Ogre::RTShader::GLSLProgramProcessor

 	GLSL Language program processor class.  More...

class  	Ogre::RTShader::GLSLProgramWriter

 	GLSL target language writer implementation.  More...

class  	Ogre::RTShader::ShaderProgramWriterGLSLFactory

 	GLSL program writer factory implementation.  More...

class  	Ogre::RTShader::HLSLProgramProcessor

 	CG Language program processor class.  More...

class  	Ogre::RTShader::HLSLProgramWriter

 	HLSL target language writer implementation.  More...

class  	Ogre::RTShader::ShaderProgramWriterHLSLFactory

 	HLSL program writer factory implementation.  More...

class  	Ogre::RTShader::SGMaterialSerializerListener

 	This class responsible for translating core features of the RT Shader System for Ogre material scripts.  More...

class  	Ogre::RTShader::Parameter

 	A class that represents a shader based program parameter.  More...

class  	Ogre::RTShader::UniformParameter

 	Uniform parameter class.  More...

class  	Ogre::RTShader::ConstParameter< valueType >

 	Helper template which is the base for our ConstParameters.  More...

class  	Ogre::RTShader::ParameterFactory

 	Helper utility class that creates common parameters.  More...

class  	Ogre::RTShader::Program

 	A class that represents a shader based program.  More...

class  	Ogre::RTShader::ProgramManager

 	A singleton manager class that manages shader based programs.  More...

class  	Ogre::RTShader::ProgramProcessor

 	A class that provides extra processing services on CPU based programs.  More...

class  	Ogre::RTShader::ProgramSet

 	Container class for shader based programs.  More...

class  	Ogre::RTShader::ProgramWriter

 	Base class interface for shader program writers.  More...

class  	Ogre::RTShader::ProgramWriterFactory

 	Interface definition for factories of ShaderProgramWriter.  More...

class  	Ogre::RTShader::ProgramWriterManager

class  	Ogre::RTShader::RenderState

 	This is a container class for sub render state class.  More...

class  	Ogre::RTShader::TargetRenderState

 	This is the target render state.  More...

class  	Ogre::RTShader::SGScriptTranslator

 	This class responsible for translating core features of the RT Shader System for Ogre material scripts.  More...

class  	Ogre::RTShader::SubRenderState

 	This class is the base interface of sub part from a shader based rendering pipeline.  More...

class  	Ogre::RTShader::SubRenderStateAccessor

 	This class uses as accessor from a template SubRenderState to all of its instances that created based on it.  More...

class  	Ogre::RTShader::SubRenderStateFactory

 	Abstract factory interface for creating SubRenderState implementation instances.  More...

Defines

#define 	FFP_LIB_COMMON   "FFPLib_Common"

#define 	FFP_FUNC_ASSIGN   "FFP_Assign"

#define 	FFP_FUNC_CONSTRUCT   "FFP_Construct"

#define 	FFP_FUNC_MODULATE   "FFP_Modulate"

#define 	FFP_FUNC_ADD   "FFP_Add"

#define 	FFP_FUNC_SUBTRACT   "FFP_Subtract"

#define 	FFP_FUNC_LERP   "FFP_Lerp"

#define 	FFP_FUNC_DOTPRODUCT   "FFP_DotProduct"

#define 	FFP_FUNC_NORMALIZE   "FFP_Normalize"

#define 	FFP_LIB_TRANSFORM   "FFPLib_Transform"

#define 	FFP_FUNC_TRANSFORM   "FFP_Transform"

#define 	FFP_LIB_LIGHTING   "FFPLib_Lighting"

#define 	FFP_FUNC_LIGHT_DIRECTIONAL_DIFFUSE   "FFP_Light_Directional_Diffuse"

#define 	FFP_FUNC_LIGHT_DIRECTIONAL_DIFFUSESPECULAR   "FFP_Light_Directional_DiffuseSpecular"

#define 	FFP_FUNC_LIGHT_POINT_DIFFUSE   "FFP_Light_Point_Diffuse"

#define 	FFP_FUNC_LIGHT_POINT_DIFFUSESPECULAR   "FFP_Light_Point_DiffuseSpecular"

#define 	FFP_FUNC_LIGHT_SPOT_DIFFUSE   "FFP_Light_Spot_Diffuse"

#define 	FFP_FUNC_LIGHT_SPOT_DIFFUSESPECULAR   "FFP_Light_Spot_DiffuseSpecular"

#define 	FFP_LIB_TEXTURING   "FFPLib_Texturing"

#define 	FFP_FUNC_TRANSFORM_TEXCOORD   "FFP_TransformTexCoord"

#define 	FFP_FUNC_GENERATE_TEXCOORD_ENV_NORMAL   "FFP_GenerateTexCoord_EnvMap_Normal"

#define 	FFP_FUNC_GENERATE_TEXCOORD_ENV_SPHERE   "FFP_GenerateTexCoord_EnvMap_Sphere"

#define 	FFP_FUNC_GENERATE_TEXCOORD_ENV_REFLECT   "FFP_GenerateTexCoord_EnvMap_Reflect"

#define 	FFP_FUNC_GENERATE_TEXCOORD_PROJECTION   "FFP_GenerateTexCoord_Projection"

#define 	FFP_FUNC_SAMPLE_TEXTURE   "FFP_SampleTexture"

#define 	FFP_FUNC_SAMPLE_TEXTURE_PROJ   "FFP_SampleTextureProj"

#define 	FFP_FUNC_MODULATEX2   "FFP_ModulateX2"

#define 	FFP_FUNC_MODULATEX4   "FFP_ModulateX4"

#define 	FFP_FUNC_ADDSIGNED   "FFP_AddSigned"

#define 	FFP_FUNC_ADDSMOOTH   "FFP_AddSmooth"

#define 	FFP_LIB_FOG   "FFPLib_Fog"

#define 	FFP_FUNC_VERTEXFOG_LINEAR   "FFP_VertexFog_Linear"

#define 	FFP_FUNC_VERTEXFOG_EXP   "FFP_VertexFog_Exp"

#define 	FFP_FUNC_VERTEXFOG_EXP2   "FFP_VertexFog_Exp2"

#define 	FFP_FUNC_PIXELFOG_DEPTH   "FFP_PixelFog_Depth"

#define 	FFP_FUNC_PIXELFOG_LINEAR   "FFP_PixelFog_Linear"

#define 	FFP_FUNC_PIXELFOG_EXP   "FFP_PixelFog_Exp"

#define 	FFP_FUNC_PIXELFOG_EXP2   "FFP_PixelFog_Exp2"

Typedefs

typedef vector< Function * >::type 	Ogre::RTShader::ShaderFunctionList

typedef

ShaderFunctionList::iterator 	Ogre::RTShader::ShaderFunctionIterator

typedef

ShaderFunctionList::const_iterator 	Ogre::RTShader::ShaderFunctionConstIterator

typedef vector< FunctionAtom * >

::type 	Ogre::RTShader::FunctionAtomInstanceList

typedef

FunctionAtomInstanceList::iterator 	Ogre::RTShader::FunctionAtomInstanceIterator

typedef

FunctionAtomInstanceList::const_iterator 	Ogre::RTShader::FunctionAtomInstanceConstIterator

typedef vector

< ShaderGenerator::SGPass * >

::type 	Ogre::RTShader::SGMaterialSerializerListener::SGPassList

typedef SGPassList::iterator 	Ogre::RTShader::SGMaterialSerializerListener::SGPassListIterator

typedef SGPassList::const_iterator 	Ogre::RTShader::SGMaterialSerializerListener::SGPassListConstIterator

typedef SharedPtr< Parameter > 	Ogre::RTShader::ParameterPtr

typedef vector< ParameterPtr >

::type 	Ogre::RTShader::ShaderParameterList

typedef

ShaderParameterList::iterator 	Ogre::RTShader::ShaderParameterIterator

typedef

ShaderParameterList::const_iterator 	Ogre::RTShader::ShaderParameterConstIterator

typedef SharedPtr

< UniformParameter > 	Ogre::RTShader::UniformParameterPtr

typedef vector

< UniformParameterPtr >::type 	Ogre::RTShader::UniformParameterList

typedef

UniformParameterList::iterator 	Ogre::RTShader::UniformParameterIterator

typedef

UniformParameterList::const_iterator 	Ogre::RTShader::UniformParameterConstIterator

typedef vector< RenderState * >

::type 	Ogre::RTShader::RenderStateList

typedef RenderStateList::iterator 	Ogre::RTShader::RenderStateIterator

typedef

RenderStateList::const_iterator 	Ogre::RTShader::RenderStateConstIterator

typedef SharedPtr

< SubRenderStateAccessor > 	Ogre::RTShader::SubRenderStateAccessorPtr

typedef vector< SubRenderState * >

::type 	Ogre::RTShader::SubRenderStateList

typedef

SubRenderStateList::iterator 	Ogre::RTShader::SubRenderStateListIterator

typedef

SubRenderStateList::const_iterator 	Ogre::RTShader::SubRenderStateListConstIterator

typedef set< SubRenderState * >

::type 	Ogre::RTShader::SubRenderStateSet

typedef SubRenderStateSet::iterator 	Ogre::RTShader::SubRenderStateSetIterator

typedef

SubRenderStateSet::const_iterator 	Ogre::RTShader::SubRenderStateSetConstIterator

Enumerations

enum  	Ogre::RTShader::FFPVertexShaderStage {

  Ogre::RTShader::FFP_VS_PRE_PROCESS =  0,
Ogre::RTShader::FFP_VS_TRANSFORM =  100,
Ogre::RTShader::FFP_VS_COLOUR =  200,
Ogre::RTShader::FFP_VS_LIGHTING =  300,

  Ogre::RTShader::FFP_VS_TEXTURING =  400,
Ogre::RTShader::FFP_VS_FOG =  500,
Ogre::RTShader::FFP_VS_POST_PROCESS =  2000

 }

enum  	Ogre::RTShader::FFPFragmentShaderStage {

  Ogre::RTShader::FFP_PS_PRE_PROCESS =  0,
Ogre::RTShader::FFP_PS_COLOUR_BEGIN =  100,
Ogre::RTShader::FFP_PS_SAMPLING =  150,
Ogre::RTShader::FFP_PS_TEXTURING =  200,

  Ogre::RTShader::FFP_PS_COLOUR_END =  300,
Ogre::RTShader::FFP_PS_FOG =  400,
Ogre::RTShader::FFP_PS_POST_PROCESS =  500

 }

enum  	Ogre::RTShader::FFPShaderStage {

  Ogre::RTShader::FFP_PRE_PROCESS =  0,
Ogre::RTShader::FFP_TRANSFORM =  100,
Ogre::RTShader::FFP_COLOUR =  200,
Ogre::RTShader::FFP_LIGHTING =  300,

  Ogre::RTShader::FFP_TEXTURING =  400,
Ogre::RTShader::FFP_FOG =  500,
Ogre::RTShader::FFP_POST_PROCESS =  600

 }

Functions

virtual void 	Ogre::RTShader::SGMaterialSerializerListener::materialEventRaised (MaterialSerializer *ser, MaterialSerializer::SerializeEvent event, bool &skip, const Material *mat)

virtual void 	Ogre::RTShader::SGMaterialSerializerListener::techniqueEventRaised (MaterialSerializer *ser, MaterialSerializer::SerializeEvent event, bool &skip, const Technique *tech)

virtual void 	Ogre::RTShader::SGMaterialSerializerListener::passEventRaised (MaterialSerializer *ser, MaterialSerializer::SerializeEvent event, bool &skip, const Pass *tech)

virtual void 	Ogre::RTShader::SGMaterialSerializerListener::textureUnitStateEventRaised (MaterialSerializer *ser, MaterialSerializer::SerializeEvent event, bool &skip, const TextureUnitState *textureUnit)

 	Ogre::RTShader::SGMaterialSerializerListener::SGMaterialSerializerListener ()

 	Will be create and destroyed via ShaderGenerator interface.

 	Ogre::RTShader::SGMaterialSerializerListener::~SGMaterialSerializerListener ()

void 	Ogre::RTShader::SGMaterialSerializerListener::createSGPassList (Material *mat, SGPassList &passList)

 	Internal method that creates list of SGPass instances composing the given material.

ShaderGenerator::SGPass * 	Ogre::RTShader::SGMaterialSerializerListener::getShaderGeneratedPass (const Pass *srcPass)

 	Internal method that returns SGPass instance from a given source pass.

 	Ogre::RTShader::SGScriptTranslator::SGScriptTranslator ()

virtual void 	Ogre::RTShader::SGScriptTranslator::translate (ScriptCompiler *compiler, const AbstractNodePtr &node)

virtual SubRenderState * 	Ogre::RTShader::SGScriptTranslator::getGeneratedSubRenderState (const String &typeName)

 	Returns a sub render state of a given name which has already been created for material currently being generated by the script translator.

void 	Ogre::RTShader::SGScriptTranslator::translatePass (ScriptCompiler *compiler, const AbstractNodePtr &node)

 	Translates RT Shader System section within a pass context.

void 	Ogre::RTShader::SGScriptTranslator::translateTextureUnit (ScriptCompiler *compiler, const AbstractNodePtr &node)

 	Translates RT Shader System section within a texture_unit context.

void 	Ogre::RTShader::SGScriptTranslator::addSubRenderState (SubRenderState *newSubRenderState, const String &dstTechniqueSchemeName, const String &materialName, const String &groupName, unsigned short passIndex)

 	Adds a newly created subrender state to the material being translated.

Variables

Material * 	Ogre::RTShader::SGMaterialSerializerListener::mSourceMaterial

SGPassList 	Ogre::RTShader::SGMaterialSerializerListener::mSGPassList

RenderState * 	Ogre::RTShader::SGScriptTranslator::mGeneratedRenderState

Friends

class 	Ogre::RTShader::SGMaterialSerializerListener::ShaderGenerator

Define Documentation

          #define FFP_FUNC_ADD   "FFP_Add"

Definition at line 83 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_ADDSIGNED   "FFP_AddSigned"

Definition at line 113 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_ADDSMOOTH   "FFP_AddSmooth"

Definition at line 114 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_ASSIGN   "FFP_Assign"

Definition at line 80 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_CONSTRUCT   "FFP_Construct"

Definition at line 81 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_DOTPRODUCT   "FFP_DotProduct"

Definition at line 86 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_GENERATE_TEXCOORD_ENV_NORMAL   "FFP_GenerateTexCoord_EnvMap_Normal"

Definition at line 105 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_GENERATE_TEXCOORD_ENV_REFLECT   "FFP_GenerateTexCoord_EnvMap_Reflect"

Definition at line 107 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_GENERATE_TEXCOORD_ENV_SPHERE   "FFP_GenerateTexCoord_EnvMap_Sphere"

Definition at line 106 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_GENERATE_TEXCOORD_PROJECTION   "FFP_GenerateTexCoord_Projection"

Definition at line 108 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_LERP   "FFP_Lerp"

Definition at line 85 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_LIGHT_DIRECTIONAL_DIFFUSE   "FFP_Light_Directional_Diffuse"

Definition at line 95 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_LIGHT_DIRECTIONAL_DIFFUSESPECULAR   "FFP_Light_Directional_DiffuseSpecular"

Definition at line 96 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_LIGHT_POINT_DIFFUSE   "FFP_Light_Point_Diffuse"

Definition at line 97 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_LIGHT_POINT_DIFFUSESPECULAR   "FFP_Light_Point_DiffuseSpecular"

Definition at line 98 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_LIGHT_SPOT_DIFFUSE   "FFP_Light_Spot_Diffuse"

Definition at line 99 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_LIGHT_SPOT_DIFFUSESPECULAR   "FFP_Light_Spot_DiffuseSpecular"

Definition at line 100 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_MODULATE   "FFP_Modulate"

Definition at line 82 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_MODULATEX2   "FFP_ModulateX2"

Definition at line 111 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_MODULATEX4   "FFP_ModulateX4"

Definition at line 112 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_NORMALIZE   "FFP_Normalize"

Definition at line 87 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_PIXELFOG_DEPTH   "FFP_PixelFog_Depth"

Definition at line 121 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_PIXELFOG_EXP   "FFP_PixelFog_Exp"

Definition at line 123 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_PIXELFOG_EXP2   "FFP_PixelFog_Exp2"

Definition at line 124 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_PIXELFOG_LINEAR   "FFP_PixelFog_Linear"

Definition at line 122 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_SAMPLE_TEXTURE   "FFP_SampleTexture"

Definition at line 109 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_SAMPLE_TEXTURE_PROJ   "FFP_SampleTextureProj"

Definition at line 110 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_SUBTRACT   "FFP_Subtract"

Definition at line 84 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_TRANSFORM   "FFP_Transform"

Definition at line 91 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_TRANSFORM_TEXCOORD   "FFP_TransformTexCoord"

Definition at line 104 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_VERTEXFOG_EXP   "FFP_VertexFog_Exp"

Definition at line 119 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_VERTEXFOG_EXP2   "FFP_VertexFog_Exp2"

Definition at line 120 of file OgreShaderFFPRenderState.h.

          #define FFP_FUNC_VERTEXFOG_LINEAR   "FFP_VertexFog_Linear"

Definition at line 118 of file OgreShaderFFPRenderState.h.

          #define FFP_LIB_COMMON   "FFPLib_Common"

Definition at line 79 of file OgreShaderFFPRenderState.h.

          #define FFP_LIB_FOG   "FFPLib_Fog"

Definition at line 117 of file OgreShaderFFPRenderState.h.

          #define FFP_LIB_LIGHTING   "FFPLib_Lighting"

Definition at line 94 of file OgreShaderFFPRenderState.h.

          #define FFP_LIB_TEXTURING   "FFPLib_Texturing"

Definition at line 103 of file OgreShaderFFPRenderState.h.

          #define FFP_LIB_TRANSFORM   "FFPLib_Transform"

Definition at line 90 of file OgreShaderFFPRenderState.h.

Typedef Documentation

          typedef FunctionAtomInstanceList::const_iterator Ogre::RTShader::FunctionAtomInstanceConstIterator

Definition at line 248 of file OgreShaderFunctionAtom.h.

          typedef FunctionAtomInstanceList::iterator Ogre::RTShader::FunctionAtomInstanceIterator

Definition at line 247 of file OgreShaderFunctionAtom.h.

          typedef vector<FunctionAtom*>::type Ogre::RTShader::FunctionAtomInstanceList

Definition at line 246 of file OgreShaderFunctionAtom.h.

          typedef SharedPtr<Parameter> Ogre::RTShader::ParameterPtr

Definition at line 370 of file OgreShaderParameter.h.

          typedef RenderStateList::const_iterator Ogre::RTShader::RenderStateConstIterator

Definition at line 132 of file OgreShaderRenderState.h.

          typedef RenderStateList::iterator Ogre::RTShader::RenderStateIterator

Definition at line 131 of file OgreShaderRenderState.h.

          typedef vector<RenderState*>::type Ogre::RTShader::RenderStateList

Definition at line 130 of file OgreShaderRenderState.h.

          typedef vector<ShaderGenerator::SGPass*>::type Ogre::RTShader::SGMaterialSerializerListener::SGPassList [protected]

Definition at line 79 of file OgreShaderMaterialSerializerListener.h.

          typedef SGPassList::const_iterator Ogre::RTShader::SGMaterialSerializerListener::SGPassListConstIterator [protected]

Definition at line 81 of file OgreShaderMaterialSerializerListener.h.

          typedef SGPassList::iterator Ogre::RTShader::SGMaterialSerializerListener::SGPassListIterator [protected]

Definition at line 80 of file OgreShaderMaterialSerializerListener.h.

          typedef ShaderFunctionList::const_iterator Ogre::RTShader::ShaderFunctionConstIterator

Definition at line 226 of file OgreShaderFunction.h.

          typedef ShaderFunctionList::iterator Ogre::RTShader::ShaderFunctionIterator

Definition at line 225 of file OgreShaderFunction.h.

          typedef vector<Function*>::type Ogre::RTShader::ShaderFunctionList

Definition at line 224 of file OgreShaderFunction.h.

          typedef ShaderParameterList::const_iterator Ogre::RTShader::ShaderParameterConstIterator

Definition at line 373 of file OgreShaderParameter.h.

          typedef ShaderParameterList::iterator Ogre::RTShader::ShaderParameterIterator

Definition at line 372 of file OgreShaderParameter.h.

          typedef vector<ParameterPtr>::type Ogre::RTShader::ShaderParameterList

Definition at line 371 of file OgreShaderParameter.h.

          typedef SharedPtr<SubRenderStateAccessor> Ogre::RTShader::SubRenderStateAccessorPtr

Definition at line 48 of file OgreShaderSubRenderState.h.

          typedef vector<SubRenderState*>::type Ogre::RTShader::SubRenderStateList

Definition at line 162 of file OgreShaderSubRenderState.h.

          typedef SubRenderStateList::const_iterator Ogre::RTShader::SubRenderStateListConstIterator

Definition at line 164 of file OgreShaderSubRenderState.h.

          typedef SubRenderStateList::iterator Ogre::RTShader::SubRenderStateListIterator

Definition at line 163 of file OgreShaderSubRenderState.h.

          typedef set<SubRenderState*>::type Ogre::RTShader::SubRenderStateSet

Definition at line 166 of file OgreShaderSubRenderState.h.

          typedef SubRenderStateSet::const_iterator Ogre::RTShader::SubRenderStateSetConstIterator

Definition at line 168 of file OgreShaderSubRenderState.h.

          typedef SubRenderStateSet::iterator Ogre::RTShader::SubRenderStateSetIterator

Definition at line 167 of file OgreShaderSubRenderState.h.

          typedef UniformParameterList::const_iterator Ogre::RTShader::UniformParameterConstIterator

Definition at line 572 of file OgreShaderParameter.h.

          typedef UniformParameterList::iterator Ogre::RTShader::UniformParameterIterator

Definition at line 571 of file OgreShaderParameter.h.

          typedef vector<UniformParameterPtr>::type Ogre::RTShader::UniformParameterList

Definition at line 570 of file OgreShaderParameter.h.

          typedef SharedPtr<UniformParameter> Ogre::RTShader::UniformParameterPtr

Definition at line 569 of file OgreShaderParameter.h.

Enumeration Type Documentation

          enum Ogre::RTShader::FFPFragmentShaderStage

Enumerator:

FFP_PS_PRE_PROCESS

FFP_PS_COLOUR_BEGIN

FFP_PS_SAMPLING

FFP_PS_TEXTURING

FFP_PS_COLOUR_END

FFP_PS_FOG

FFP_PS_POST_PROCESS

Definition at line 55 of file OgreShaderFFPRenderState.h.

          enum Ogre::RTShader::FFPShaderStage

Enumerator:

FFP_PRE_PROCESS

FFP_TRANSFORM

FFP_COLOUR

FFP_LIGHTING

FFP_TEXTURING

FFP_FOG

FFP_POST_PROCESS

Definition at line 67 of file OgreShaderFFPRenderState.h.

          enum Ogre::RTShader::FFPVertexShaderStage

Enumerator:

FFP_VS_PRE_PROCESS

FFP_VS_TRANSFORM

FFP_VS_COLOUR

FFP_VS_LIGHTING

FFP_VS_TEXTURING

FFP_VS_FOG

FFP_VS_POST_PROCESS

Definition at line 43 of file OgreShaderFFPRenderState.h.

Function Documentation

          void Ogre::RTShader::SGScriptTranslator::addSubRenderState
          (
          SubRenderState *
          newSubRenderState,

          const String &
          dstTechniqueSchemeName,

          const String &
          materialName,

          const String &
          groupName,

          unsigned short
          passIndex

          )
          	 [protected]

Adds a newly created subrender state to the material being translated.

Parameters:

newSubRenderState	The sub-render state to add

dstTechniqueSchemeName	The technique which the sub render state is associated with

materialName	The material name which the sub render state is associated with

groupName	The material group name which the sub render state is associated with

passIndex	The index of the pass which the sub render state is associated with

          void Ogre::RTShader::SGMaterialSerializerListener::createSGPassList
          (
          Material *
          mat,

          SGPassList &
          passList

          )
          	 [protected]

Internal method that creates list of SGPass instances composing the given material.

          virtual SubRenderState* Ogre::RTShader::SGScriptTranslator::getGeneratedSubRenderState
          (
          const String &
          typeName	)
           [virtual]

Returns a sub render state of a given name which has already been created for material currently being generated by the script translator.

Note:

This function is meant to be used from within the createInstance function of sub-render state factories to avoid creating multiple sub-render state to the same material.

Parameters:

typeName	The type of the sub-render state to find.

          ShaderGenerator::SGPass* Ogre::RTShader::SGMaterialSerializerListener::getShaderGeneratedPass
          (
          const Pass *
          srcPass	)
           [protected]

Internal method that returns SGPass instance from a given source pass.

          virtual void Ogre::RTShader::SGMaterialSerializerListener::materialEventRaised
          (
          MaterialSerializer *
          ser,

          MaterialSerializer::SerializeEvent
          event,

          bool &
          skip,

          const Material *
          mat

          )
          	 [virtual]

See also:

MaterialSerializer::Listener::materialEventRaised

Reimplemented from Ogre::MaterialSerializer::Listener.

          virtual void Ogre::RTShader::SGMaterialSerializerListener::passEventRaised
          (
          MaterialSerializer *
          ser,

          MaterialSerializer::SerializeEvent
          event,

          bool &
          skip,

          const Pass *
          tech

          )
          	 [virtual]

See also:

MaterialSerializer::Listener::passEventRaised

Reimplemented from Ogre::MaterialSerializer::Listener.

          Ogre::RTShader::SGMaterialSerializerListener::SGMaterialSerializerListener
          (
          	)
           [protected]

Will be create and destroyed via ShaderGenerator interface.

          Ogre::RTShader::SGScriptTranslator::SGScriptTranslator
          (
          	)

          virtual void Ogre::RTShader::SGMaterialSerializerListener::techniqueEventRaised
          (
          MaterialSerializer *
          ser,

          MaterialSerializer::SerializeEvent
          event,

          bool &
          skip,

          const Technique *
          tech

          )
          	 [virtual]

See also:

MaterialSerializer::Listener::techniqueEventRaised

Reimplemented from Ogre::MaterialSerializer::Listener.

          virtual void Ogre::RTShader::SGMaterialSerializerListener::textureUnitStateEventRaised
          (
          MaterialSerializer *
          ser,

          MaterialSerializer::SerializeEvent
          event,

          bool &
          skip,

          const TextureUnitState *
          textureUnit

          )
          	 [virtual]

See also:

MaterialSerializer::Listener::textureUnitStateEventRaised

Reimplemented from Ogre::MaterialSerializer::Listener.

          virtual void Ogre::RTShader::SGScriptTranslator::translate
          (
          ScriptCompiler *
          compiler,

          const AbstractNodePtr &
          node

          )
          	 [virtual]

See also:

ScriptTranslator::translate.

Implements Ogre::ScriptTranslator.

          void Ogre::RTShader::SGScriptTranslator::translatePass
          (
          ScriptCompiler *
          compiler,

          const AbstractNodePtr &
          node

          )
          	 [protected]

Translates RT Shader System section within a pass context.

Parameters:

compiler	The compiler invoking this translator

node	The current AST node to be translated

          void Ogre::RTShader::SGScriptTranslator::translateTextureUnit
          (
          ScriptCompiler *
          compiler,

          const AbstractNodePtr &
          node

          )
          	 [protected]

Translates RT Shader System section within a texture_unit context.

Parameters:

compiler	The compiler invoking this translator

node	The current AST node to be translated

          Ogre::RTShader::SGMaterialSerializerListener::~SGMaterialSerializerListener
          (
          	)
           [protected]

Variable Documentation

          RenderState* Ogre::RTShader::SGScriptTranslator::mGeneratedRenderState [protected]

Definition at line 138 of file OgreShaderScriptTranslator.h.

          SGPassList Ogre::RTShader::SGMaterialSerializerListener::mSGPassList [protected]

Definition at line 101 of file OgreShaderMaterialSerializerListener.h.

          Material* Ogre::RTShader::SGMaterialSerializerListener::mSourceMaterial [protected]

Definition at line 99 of file OgreShaderMaterialSerializerListener.h.

Friends

          friend class ShaderGenerator [friend]

Definition at line 105 of file OgreShaderMaterialSerializerListener.h.

Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Last modified Sun Sep 2 2012 07:27:25


text:
package org.apache.river.test.spec.jeri.transport.util;

public class ArbitraryException extends RuntimeException{
}


text:
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// <memory_resource> feature macros

/*  Constant                                    Value
    __cpp_lib_memory_resource                   201603L

*/

// XFAIL
// #include <memory_resource>
#include <cassert>
#include "test_macros.h"

int main(int, char**)
{
//  ensure that the macros that are supposed to be defined in <memory_resource> are defined.

/*
#if !defined(__cpp_lib_fooby)
# error "__cpp_lib_fooby is not defined"
#elif __cpp_lib_fooby < 201606L
# error "__cpp_lib_fooby has an invalid value"
#endif
*/

  return 0;
}


text:
---
uid: SolidEdgeAssembly.GroundRelation3d.IsAttributeSetPresent(System.String)
summary:
remarks:
example: [*content]
---
[!code-vb[Main](..\snippets\SolidEdgeAssembly.GroundRelation3d.IsAttributeSetPresent.vb]
[!code-csharp[Main](..\snippets\SolidEdgeAssembly.GroundRelation3d.IsAttributeSetPresent.cs]


text:
import trimRight from 'trim-right';

export default function (opts) {
    const {visitors} = this.Compiler.prototype;
    const {root} = visitors;

    const {start, middle, end} = {
        start:  '/**\n',
        middle: ' * ',
        end:  '\n */\n',
        ...opts,
    };

    visitors.root = function (node) {
        const markdown = root.call(this, node);
        return start + markdown.split('\n').slice(0, -1).map(line => {
            return line.length ? `${middle}${line}` : trimRight(middle);
        }).join('\n') + end;
    };
}


text:
@interface CoreTFKeyBoardToolBarView ()

@property (strong, nonatomic) IBOutlet UIButton *preBtn;

@property (strong, nonatomic) IBOutlet UIButton *nextBtn;

@property (weak, nonatomic) IBOutlet UILabel *msgLabel;

@property (weak, nonatomic) IBOutlet UIImageView *leftImageView;
@property (weak, nonatomic) IBOutlet UIImageView *rightImageView;

@end

@implementation CoreTFKeyBoardToolBarView

-(void)awakeFromNib {
    [super awakeFromNib];
}

+(instancetype)keyBoardToolBarView {
    return [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] firstObject];
}

#pragma mark  上一个
- (IBAction)preBtnClick:(id)sender {
    if(self.preClickBlock != nil) self.preClickBlock();
}

#pragma mark  下一个
- (IBAction)nextBtnClick:(id)sender {
    if(self.nextClickBlock != nil) self.nextClickBlock();
}

#pragma mark  完成
- (IBAction)doneBtnClick:(id)sender {
    if(self.doneClickBlock != nil) self.doneClickBlock();
}

-(void)setIsFirst:(BOOL)isFirst{

    //记录
    _isFirst=isFirst;

    _preBtn.enabled=!isFirst;

    _leftImageView.image = [_leftImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    if (isFirst) {
        _leftImageView.tintColor = MyLightGray;
    }else {
        _leftImageView.tintColor = MYGreenColor;
    }
}

-(void)setIsLast:(BOOL)isLast{

    //记录
    _isLast=isLast;

    _nextBtn.enabled=!isLast;

    _rightImageView.image = [_rightImageView.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    if (isLast) {
        _rightImageView.tintColor = MyLightGray;
    }else {
        _rightImageView.tintColor = MYGreenColor;
    }
}

-(void)setMsg:(NSString *)msg{
    _msg=msg;
    if ([msg isEqualToString:@"关系"]) {
        msg = @"关系(可在设置修改)";
    }
    self.msgLabel.text = msg;
}

-(void)setHideToggleBtnsForSingleTF:(BOOL)hideToggleBtnsForSingleTF{
    _hideToggleBtnsForSingleTF = hideToggleBtnsForSingleTF;
    if(!hideToggleBtnsForSingleTF) return;
    self.preBtn.hidden = YES;
    self.nextBtn.hidden=YES;
}

@end