text:
package fuzz

import (
	"errors"

	fuzz "github.com/AdaLogics/go-fuzz-headers"

	"istio.io/istio/pilot/pkg/model"
	"istio.io/istio/pilot/pkg/serviceregistry/memory"
	"istio.io/istio/pkg/config/host"
	"istio.io/istio/pkg/config/mesh"
	"istio.io/istio/pkg/config/protocol"
)

var protocols = []protocol.Instance{
	protocol.TCP,
	protocol.UDP,
	protocol.GRPC,
	protocol.GRPCWeb,
	protocol.HTTP,
	protocol.HTTP_PROXY,
	protocol.HTTP2,
	protocol.HTTPS,
	protocol.TLS,
	protocol.Mongo,
	protocol.Redis,
	protocol.MySQL,
}

// Creates a new fuzzed ServiceInstance
func NewSI(f *fuzz.ConsumeFuzzer) (*model.ServiceInstance, error) {
	si := &model.ServiceInstance{}
	err := f.GenerateStruct(si)
	if err != nil {
		return si, err
	}
	s, err := NewS(f)
	if err != nil {
		return si, err
	}
	p, err := createPort(f)
	if err != nil {
		return si, err
	}
	s.Ports = append(s.Ports, p)
	si.ServicePort = p
	si.Service = s
	err = si.Validate()
	if err != nil {
		return si, err
	}
	return si, nil
}

// Gets a protocol from global var protocols
func getProtocolInstance(f *fuzz.ConsumeFuzzer) (protocol.Instance, error) {
	pIndex, err := f.GetInt()
	if err != nil {
		return protocol.Unsupported, errors.New("could not create protocolInstance")
	}
	i := protocols[pIndex%len(protocols)]
	return i, nil
}

// Creates a new fuzzed Port
func createPort(f *fuzz.ConsumeFuzzer) (*model.Port, error) {
	p := &model.Port{}
	name, err := f.GetString()
	if err != nil {
		return p, err
	}
	port, err := f.GetInt()
	if err != nil {
		return p, err
	}
	protocolinstance, err := getProtocolInstance(f)
	if err != nil {
		return p, err
	}
	p.Name = name
	p.Port = port
	p.Protocol = protocolinstance
	return p, nil
}

// Creates a new fuzzed Port slice
func createPorts(f *fuzz.ConsumeFuzzer) ([]*model.Port, error) {
	ports := make([]*model.Port, 0, 20)
	numberOfPorts, err := f.GetInt()
	if err != nil {
		return ports, err
	}
	// Maximum 20 ports:
	maxPorts := numberOfPorts % 20
	if maxPorts == 0 {
		maxPorts = 1
	}
	for i := 0; i < maxPorts; i++ {
		port, err := createPort(f)
		if err != nil {
			return ports, err
		}
		ports = append(ports, port)
	}
	return ports, nil
}

// Creates a new fuzzed Service
func NewS(f *fuzz.ConsumeFuzzer) (*model.Service, error) {
	s := &model.Service{}
	err := f.GenerateStruct(s)
	if err != nil {
		return s, err
	}
	ports, err := createPorts(f)
	if err != nil {
		return s, err
	}
	s.Ports = ports
	hostname, err := f.GetString()
	if err != nil {
		return s, err
	}
	s.Hostname = host.Name(hostname)
	err = s.Validate()
	if err != nil {
		return s, err
	}
	return s, nil
}

// Creates an Environment with fuzzed values
// and passes that to InitContext
func FuzzInitContext(data []byte) int {
	f := fuzz.NewConsumer(data)

	// Create service instances
	serviceInstances := make([]*model.ServiceInstance, 0, 20)
	number, err := f.GetInt()
	if err != nil {
		return 0
	}
	// We allow a maximum of 20 service instances
	numberOfS := number % 20
	for i := 0; i < numberOfS; i++ {
		si, err := NewSI(f)
		if err != nil {
			return 0
		}
		serviceInstances = append(serviceInstances, si)
	}

	// Create services
	services := make([]*model.Service, 0, 20)
	number, err = f.GetInt()
	if err != nil {
		return 0
	}
	// We allow a maximum of 20 services
	numberOfS = number % 20
	for i := 0; i < numberOfS; i++ {
		s, err := NewS(f)
		if err != nil {
			return 0
		}
		services = append(services, s)
	}

	configString, err := f.GetString()
	if err != nil {
		return 0
	}
	m, err := mesh.ApplyMeshConfigDefaults(configString)
	if err != nil {
		return 0
	}

	env := &model.Environment{}
	store := model.NewFakeStore()

	env.ConfigStore = store
	sd := memory.NewServiceDiscovery(services...)
	sd.WantGetProxyServiceInstances = serviceInstances
	env.ServiceDiscovery = sd

	env.Watcher = mesh.NewFixedWatcher(m)
	env.EndpointIndex = model.NewEndpointIndex()
	env.Init()
	pc := model.NewPushContext()
	_ = pc.InitContext(env, nil, nil)
	return 1
}

func FuzzBNMUnmarshalJSON(data []byte) int {
	var bnm model.BootstrapNodeMetadata
	_ = bnm.UnmarshalJSON(data)
	return 1
}

redpajama_set_name: RedPajamaGithub


text:
\documentclass[a4paper,12pt, titlepage]{article}
\usepackage[finnish]{babel} %suomenkielinen tavutus
\usepackage[T1]{fontenc} %skanditavutus
\usepackage[utf8]{inputenc}        	% skandit utf-8 koodauksella
%\usepackage[ansinew]{inputenc}        	% skandit utf-8 koodauksella, kokeile tata, jos utf-8 ylla ei toimi.

\usepackage{graphicx}
\usepackage{pdfpages}
\usepackage{hyperref}
\usepackage{tabularx}
\usepackage{geometry}
 \geometry{
 a4paper,
 total={170mm,257mm},
 left=20mm,
 top=20mm,
 }

\linespread{1.24} %rivivali 1.5
\sloppy % Vahentaa tavutuksen tarvetta, "leventamalla" rivin keskella olevia valilyönteja.

\title{Helpperin arkkitehtuuri}
\author{ Maiju Airosmaa \\ Kalle Hiljanen \\
Outi Jussila \\ Eetu Mattila \\ Johanna Vehniäinen \\[1cm] Ohjelmiston arkkitehtuuridokumentaatio \\ Helsingin yliopisto}
\date{Toukokuu 2016}

\begin{document}

\maketitle

\tableofcontents
\newpage

\section{Järjestelmän yleiskuvaus ja rakenne}
\noindent
Sovellus on kehitetty käyttämällä Ruby on Railsia. Käytössä on Rubyn versio 2.3.1 ja Railsin versio 4.2.6. Näkymien toiminnallisuuksien toteutuksessa on käytetty myös jonkun verran Javascriptiä. Data selaimen ja kontrollereiden välillä on välitetty osittain JSON-muodossa.
\newline
\newline
Ohjelmiston arkkitehtuuri noudattaa MVC-mallia eli keskustelu näkymien ja mallien sekä tietokannan välillä tapahtuu kontrollereiden kautta.

\section{Relaatiotietokantakaavio}

\noindent\makebox[\textwidth]{%
\begin{tabularx}{1.1\textwidth}{XX}
  \includegraphics[width=190mm]{kaavio}
\end{tabularx}}
\newline
\newline
\newline
\newline
Tietokannassa on yhteensä 8 taulua. Lisäksi kaksi PublicActivity- ja Unread-gemin luomia tauluja, jotka on jätetty selkeyden vuoksi pois kaaviosta.
\newline
Käyttäjällä (User) voi olla useita ilmoituksia (Post), arvosteluja (Rating), keskusteluja (Conversation) ja viestejä (Message). Arvosteluissa käyttäjä on joko arvioituna (revieved\_id) tai arvioijana (reviewer\_id).
\newline
Ilmoitukseen liittyy yksi käyttäjä ilmoittajana (user\_id) ja voi liittyä yksi käyttäjä suorittajana (doer\_id). Lisäksi ilmoituksella voi olla useita kiinnostuneita käyttäjiä Candidate-taulun kautta. Ilmoitukseen liittyy maksimissaan kaksi arvostelua, jotka kuuluvat ilmoittajalle ja suorittajalle. Ilmoitus muuttuu suoritetuksi (scope rated), kun arvosteluja on kaksi. Ilmoitus kuuluu yhdelle tai useammalle kategorialle (Category) välitaulun (PostCategory) kautta.
\newline
Keskusteluun liittyy kaksi käyttäjää (sender\_id, recipient\_id). Lisäksi keskustelu voi liittyä yhteen ilmoitukseen. Kahden käyttäjän välillä voi olla vain yksi keskustelu, joka ei liity mihinkään ilmoitukseen, ja lisäksi heidän välillään voi olla ilmoituskohtaisia keskusteluja. Keskusteluun liittyy useita viestejä. Viestit liittyvät keskustelun kautta ilmoituksiin. Viestien attribuutti post\_id ei ole käytössä.

\section{Liitteet}

GitHub:
\url{https://github.com/xjoxjox/helpperi}

\end{document}


text:
package model.AI;

import java.util.PriorityQueue;

import model.Player;

public class AIOpponent extends Player{

	PriorityQueue<AIAction> myRankedActions = new PriorityQueue<AIAction>(0,new AIActionComparator());

	public void rankAndPerformAction(){

		AIAction bestOption = myRankedActions.poll();
		bestOption.getAbility().useAbility();

	}

	public void refresh(){
		myRankedActions.clear();
		super.refresh();
	}

}


text:
/*	$NetBSD: mkdevsw.c,v 1.10.24.1 2015/03/06 21:00:23 snj Exp $	*/

/*
 * Copyright (c) 2002 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by MAEKAWA Masahide (gehenna@NetBSD.org).
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif

#include <sys/cdefs.h>
__RCSID("$NetBSD: mkdevsw.c,v 1.10.24.1 2015/03/06 21:00:23 snj Exp $");

#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <err.h>

#include "defs.h"

static void emitconv(FILE *);
static void emitdev(FILE *);
static void emitdevm(FILE *);
static void emitheader(FILE *);

int
mkdevsw(void)
{
	FILE *fp;

	if ((fp = fopen("devsw.c.tmp", "w")) == NULL) {
		warn("cannot create devsw.c");
		return (1);
	}

	emitheader(fp);
	emitdevm(fp);
	emitconv(fp);
	emitdev(fp);

	fflush(fp);
	if (ferror(fp)) {
		warn("error writing devsw.c");
		fclose(fp);
		return 1;
	}

	(void)fclose(fp);

	if (moveifchanged("devsw.c.tmp", "devsw.c") != 0) {
		warn("error renaming devsw.c");
		return (1);
	}

	return (0);
}

static void
emitheader(FILE *fp)
{
	autogen_comment(fp, "devsw.c");

	fputs("#include <sys/param.h>\n"
		  "#include <sys/conf.h>\n", fp);
}

static void
dentry(FILE *fp, struct hashtab *t, devmajor_t i, char p)
{
	const struct devm *dm;
	char mstr[16];

	(void)snprintf(mstr, sizeof(mstr), "%d", i);
	if ((dm = ht_lookup(t, intern(mstr))) == NULL)
		return;

	fprintf(fp, "extern const struct %cdevsw %s_%cdevsw;\n",
	    p, dm->dm_name, p);
}

static void
pentry(FILE *fp, struct hashtab *t, devmajor_t i, char p)
{
	const struct devm *dm;
	char mstr[16];

	(void)snprintf(mstr, sizeof(mstr), "%d", i);
	dm = ht_lookup(t, intern(mstr));

	if (dm)
		fprintf(fp, "\t&%s_%cdevsw", dm->dm_name, p);
	else
		fputs("\tNULL", fp);

	fprintf(fp, ",\t// %3d\n", i);
}

/*
 * Emit device switch table for character/block device.
 */
static void
emitdevm(FILE *fp)
{
	devmajor_t i;

	fputs("\n/* device switch table for block device */\n", fp);

	for (i = 0; i <= maxbdevm ; i++)
		dentry(fp, cdevmtab, i, 'b');

	fputs("\nconst struct bdevsw *bdevsw0[] = {\n", fp);

	for (i = 0; i <= maxbdevm; i++)
		pentry(fp, bdevmtab, i, 'b');

	fputs("};\n\nconst struct bdevsw **bdevsw = bdevsw0;\n", fp);

	fputs("const int sys_bdevsws = __arraycount(bdevsw0);\n"
		  "int max_bdevsws = __arraycount(bdevsw0);\n", fp);

	fputs("\n/* device switch table for character device */\n", fp);

	for (i = 0; i <= maxcdevm; i++)
		dentry(fp, cdevmtab, i, 'c');

	fputs("\nconst struct cdevsw *cdevsw0[] = {\n", fp);

	for (i = 0; i <= maxcdevm; i++)
		pentry(fp, cdevmtab, i, 'c');

	fputs("};\n\nconst struct cdevsw **cdevsw = cdevsw0;\n", fp);

	fputs("const int sys_cdevsws = __arraycount(cdevsw0);\n"
		  "int max_cdevsws = __arraycount(cdevsw0);\n", fp);
}

/*
 * Emit device major conversion table.
 */
static void
emitconv(FILE *fp)
{
	struct devm *dm;

	fputs("\n/* device conversion table */\n"
		  "struct devsw_conv devsw_conv0[] = {\n", fp);
	TAILQ_FOREACH(dm, &alldevms, dm_next) {
		if (version < 20100430) {
			/* Emit compatible structure */
			fprintf(fp, "\t{ \"%s\", %d, %d },\n", dm->dm_name,
			    dm->dm_bmajor, dm->dm_cmajor);
			continue;
		}
		struct nvlist *nv;
		const char *d_class, *d_flags = "0";
		int d_vec[2] = { 0, 0 };
		int i = 0;

		/*
		 * "parse" info.  currently the rules are simple:
		 *  1) first entry defines class
		 *  2) next ones without n_str are d_vectdim
		 *  3) next one with n_str is d_flags
		 *  4) EOL
		 */
		nv = dm->dm_devnodes;
		d_class = nv->nv_str;
		while ((nv = nv->nv_next) != NULL) {
			if (i > 2)
				panic("invalid devnode definition");
			if (nv->nv_str) {
				d_flags = nv->nv_str;
				break;
			}
			if (nv->nv_num > INT_MAX || nv->nv_num < INT_MIN)
				panic("out of range devnode definition");
			d_vec[i++] = (int)nv->nv_num;
		}

		fprintf(fp, "\t{ \"%s\", %d, %d, %s, %s, { %d, %d }},\n",
			    dm->dm_name, dm->dm_bmajor, dm->dm_cmajor,
			    d_class, d_flags, d_vec[0], d_vec[1]);

	}
	fputs("};\n\n"
		  "struct devsw_conv *devsw_conv = devsw_conv0;\n"
		  "int max_devsw_convs = __arraycount(devsw_conv0);\n",
		  fp);
}

/*
 * Emit specific device major informations.
 */
static void
emitdev(FILE *fp)
{
	struct devm *dm;
	char mstr[16];

	fputs("\n", fp);

	(void)strlcpy(mstr, "swap", sizeof(mstr));
	if ((dm = ht_lookup(bdevmtab, intern(mstr))) != NULL) {
		fprintf(fp, "const dev_t swapdev = makedev(%d, 0);\n",
			    dm->dm_bmajor);
	}

	(void)strlcpy(mstr, "mem", sizeof(mstr));
	if ((dm = ht_lookup(cdevmtab, intern(mstr))) == NULL)
		panic("memory device is not configured");
	fprintf(fp, "const dev_t zerodev = makedev(%d, DEV_ZERO);\n",
		    dm->dm_cmajor);

	fputs("\n/* mem_no is only used in iskmemdev() */\n", fp);
	fprintf(fp, "const int mem_no = %d;\n", dm->dm_cmajor);
}


text:
package io.netty.handler.ssl;

import static io.netty.handler.ssl.ApplicationProtocolUtil.toList;
import static io.netty.util.internal.ObjectUtil.checkNotNull;

import java.util.Collections;
import java.util.List;
import java.util.Set;

import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLHandshakeException;

/**
 * Common base class for {@link JdkApplicationProtocolNegotiator} classes to inherit from.
 */
class JdkBaseApplicationProtocolNegotiator implements JdkApplicationProtocolNegotiator {
    private final List<String> protocols;
    private final ProtocolSelectorFactory selectorFactory;
    private final ProtocolSelectionListenerFactory listenerFactory;
    private final SslEngineWrapperFactory wrapperFactory;

    /**
     * Create a new instance.
     * @param wrapperFactory Determines which application protocol will be used by wrapping the SSLEngine in use.
     * @param selectorFactory How the peer selecting the protocol should behave.
     * @param listenerFactory How the peer being notified of the selected protocol should behave.
     * @param protocols The order of iteration determines the preference of support for protocols.
     */
    JdkBaseApplicationProtocolNegotiator(SslEngineWrapperFactory wrapperFactory,
            ProtocolSelectorFactory selectorFactory, ProtocolSelectionListenerFactory listenerFactory,
            Iterable<String> protocols) {
        this(wrapperFactory, selectorFactory, listenerFactory, toList(protocols));
    }

    /**
     * Create a new instance.
     * @param wrapperFactory Determines which application protocol will be used by wrapping the SSLEngine in use.
     * @param selectorFactory How the peer selecting the protocol should behave.
     * @param listenerFactory How the peer being notified of the selected protocol should behave.
     * @param protocols The order of iteration determines the preference of support for protocols.
     */
    JdkBaseApplicationProtocolNegotiator(SslEngineWrapperFactory wrapperFactory,
            ProtocolSelectorFactory selectorFactory, ProtocolSelectionListenerFactory listenerFactory,
            String... protocols) {
        this(wrapperFactory, selectorFactory, listenerFactory, toList(protocols));
    }

    /**
     * Create a new instance.
     * @param wrapperFactory Determines which application protocol will be used by wrapping the SSLEngine in use.
     * @param selectorFactory How the peer selecting the protocol should behave.
     * @param listenerFactory How the peer being notified of the selected protocol should behave.
     * @param protocols The order of iteration determines the preference of support for protocols.
     */
    private JdkBaseApplicationProtocolNegotiator(SslEngineWrapperFactory wrapperFactory,
            ProtocolSelectorFactory selectorFactory, ProtocolSelectionListenerFactory listenerFactory,
            List<String> protocols) {
        this.wrapperFactory = checkNotNull(wrapperFactory, "wrapperFactory");
        this.selectorFactory = checkNotNull(selectorFactory, "selectorFactory");
        this.listenerFactory = checkNotNull(listenerFactory, "listenerFactory");
        this.protocols = Collections.unmodifiableList(checkNotNull(protocols, "protocols"));
    }

    @Override
    public List<String> protocols() {
        return protocols;
    }

    @Override
    public ProtocolSelectorFactory protocolSelectorFactory() {
        return selectorFactory;
    }

    @Override
    public ProtocolSelectionListenerFactory protocolListenerFactory() {
        return listenerFactory;
    }

    @Override
    public SslEngineWrapperFactory wrapperFactory() {
        return wrapperFactory;
    }

    static final ProtocolSelectorFactory FAIL_SELECTOR_FACTORY = new ProtocolSelectorFactory() {
        @Override
        public ProtocolSelector newSelector(SSLEngine engine, Set<String> supportedProtocols) {
            return new FailProtocolSelector((JdkSslEngine) engine, supportedProtocols);
        }
    };

    static final ProtocolSelectorFactory NO_FAIL_SELECTOR_FACTORY = new ProtocolSelectorFactory() {
        @Override
        public ProtocolSelector newSelector(SSLEngine engine, Set<String> supportedProtocols) {
            return new NoFailProtocolSelector((JdkSslEngine) engine, supportedProtocols);
        }
    };

    static final ProtocolSelectionListenerFactory FAIL_SELECTION_LISTENER_FACTORY =
            new ProtocolSelectionListenerFactory() {
        @Override
        public ProtocolSelectionListener newListener(SSLEngine engine, List<String> supportedProtocols) {
            return new FailProtocolSelectionListener((JdkSslEngine) engine, supportedProtocols);
        }
    };

    static final ProtocolSelectionListenerFactory NO_FAIL_SELECTION_LISTENER_FACTORY =
            new ProtocolSelectionListenerFactory() {
        @Override
        public ProtocolSelectionListener newListener(SSLEngine engine, List<String> supportedProtocols) {
            return new NoFailProtocolSelectionListener((JdkSslEngine) engine, supportedProtocols);
        }
    };

    static class NoFailProtocolSelector implements ProtocolSelector {
        private final JdkSslEngine engineWrapper;
        private final Set<String> supportedProtocols;

        NoFailProtocolSelector(JdkSslEngine engineWrapper, Set<String> supportedProtocols) {
            this.engineWrapper = engineWrapper;
            this.supportedProtocols = supportedProtocols;
        }

        @Override
        public void unsupported() {
            engineWrapper.getSession().setApplicationProtocol(null);
        }

        @Override
        public String select(List<String> protocols) throws Exception {
            for (String p : supportedProtocols) {
                if (protocols.contains(p)) {
                    engineWrapper.getSession().setApplicationProtocol(p);
                    return p;
                }
            }
            return noSelectMatchFound();
        }

        public String noSelectMatchFound() throws Exception {
            engineWrapper.getSession().setApplicationProtocol(null);
            return null;
        }
    }

    private static final class FailProtocolSelector extends NoFailProtocolSelector {
        FailProtocolSelector(JdkSslEngine engineWrapper, Set<String> supportedProtocols) {
            super(engineWrapper, supportedProtocols);
        }

        @Override
        public String noSelectMatchFound() throws Exception {
            throw new SSLHandshakeException("Selected protocol is not supported");
        }
    }

    private static class NoFailProtocolSelectionListener implements ProtocolSelectionListener {
        private final JdkSslEngine engineWrapper;
        private final List<String> supportedProtocols;

        NoFailProtocolSelectionListener(JdkSslEngine engineWrapper, List<String> supportedProtocols) {
            this.engineWrapper = engineWrapper;
            this.supportedProtocols = supportedProtocols;
        }

        @Override
        public void unsupported() {
            engineWrapper.getSession().setApplicationProtocol(null);
        }

        @Override
        public void selected(String protocol) throws Exception {
            if (supportedProtocols.contains(protocol)) {
                engineWrapper.getSession().setApplicationProtocol(protocol);
            } else {
                noSelectedMatchFound(protocol);
            }
        }

        protected void noSelectedMatchFound(String protocol) throws Exception {
            // Will never be called.
        }
    }

    private static final class FailProtocolSelectionListener extends NoFailProtocolSelectionListener {
        FailProtocolSelectionListener(JdkSslEngine engineWrapper, List<String> supportedProtocols) {
            super(engineWrapper, supportedProtocols);
        }

        @Override
        protected void noSelectedMatchFound(String protocol) throws Exception {
            throw new SSLHandshakeException("No compatible protocols found");
        }
    }
}


text:
include(ExternalProject)

# Convenience variables
set(PREFIX_DIR ${CMAKE_BINARY_DIR}/CMakeExternals/Prefix)
set(BUILD_DIR ${CMAKE_BINARY_DIR}/CMakeExternals/Build)
set(INSTALL_DIR ${CMAKE_BINARY_DIR}/CMakeExternals/Install)

# Options for iOS
set(OPENGL_ES_VERSION "2.0" CACHE STRING "OpenGL ES version (2.0 or 3.0)")
set_property(CACHE OPENGL_ES_VERSION PROPERTY STRINGS 2.0 3.0)

set(IOS_SIMULATOR_ARCHITECTURES "i386;x86_64"
    CACHE STRING "iOS Simulator Architectures")
set(IOS_DEVICE_ARCHITECTURES "arm64;armv7;armv7s"
    CACHE STRING "iOS Device Architectures")

set(CMAKE_FRAMEWORK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/frameworks"
    CACHE PATH "Framework install path")

# Fail if the install path is invalid
if (NOT EXISTS ${CMAKE_INSTALL_PREFIX})
  message(FATAL_ERROR
    "Install path ${CMAKE_INSTALL_PREFIX} does not exist.")
endif()

# Try to make the framework install directory if it doesn't exist
if (NOT EXISTS ${CMAKE_FRAMEWORK_INSTALL_PREFIX})
  file(MAKE_DIRECTORY ${CMAKE_FRAMEWORK_INSTALL_PREFIX})
  if (NOT EXISTS ${CMAKE_FRAMEWORK_INSTALL_PREFIX})
    message(FATAL_ERROR
      "Framework install path ${CMAKE_FRAMEWORK_INSTALL_PREFIX} does not exist.")
  endif()
endif()

# First, determine how to build
if (CMAKE_GENERATOR MATCHES "NMake Makefiles")
  set(VTK_BUILD_COMMAND BUILD_COMMAND nmake)
elseif (CMAKE_GENERATOR MATCHES "Ninja")
  set(VTK_BUILD_COMMAND BUILD_COMMAND ninja)
else()
  set(VTK_BUILD_COMMAND BUILD_COMMAND make)
endif()

set(BUILD_ALWAYS_STRING)
if(${CMAKE_VERSION} GREATER 3.0)
  set(BUILD_ALWAYS_STRING BUILD_ALWAYS 1)
endif()

# Compile a minimal VTK for its compile tools
macro(compile_vtk_tools)
  ExternalProject_Add(
    vtk-compile-tools
    SOURCE_DIR ${CMAKE_SOURCE_DIR}
    PREFIX ${PREFIX_DIR}/vtk-compile-tools
    BINARY_DIR ${BUILD_DIR}/vtk-compile-tools
    ${VTK_BUILD_COMMAND} vtkCompileTools
    ${BUILD_ALWAYS_STRING}
    INSTALL_DIR ${INSTALL_DIR}/vtk-compile-tools
    CMAKE_CACHE_ARGS
      -DCMAKE_BUILD_TYPE:STRING=Release
      -DVTK_BUILD_ALL_MODULES:BOOL=OFF
      -DVTK_Group_Rendering:BOOL=OFF
      -DVTK_Group_StandAlone:BOOL=ON
      -DBUILD_SHARED_LIBS:BOOL=ON
      -DBUILD_EXAMPLES:BOOL=OFF
      -DBUILD_TESTING:BOOL=OFF
      -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}/vtk-compile-tools
  )
endmacro()
compile_vtk_tools()

# Hide some CMake configs from the user
mark_as_advanced(
  BUILD_SHARED_LIBS
  CMAKE_INSTALL_PREFIX
  CMAKE_OSX_ARCHITECTURES
  CMAKE_OSX_DEPLOYMENT_TARGET
  CMAKE_OSX_ROOT
  VTK_RENDERING_BACKEND
)

# Now cross-compile VTK with custom toolchains
set(ios_cmake_flags
  -DBUILD_SHARED_LIBS:BOOL=OFF
  -DBUILD_TESTING:BOOL=OFF
  -DBUILD_EXAMPLES:BOOL=${BUILD_EXAMPLES}
  -DVTK_RENDERING_BACKEND:STRING=OpenGL2
  -DOPENGL_ES_VERSION:STRING=${OPENGL_ES_VERSION}
  -DVTK_Group_Rendering:BOOL=OFF
  -DVTK_Group_StandAlone:BOOL=OFF
  -DVTK_Group_Imaging:BOOL=OFF
  -DVTK_Group_MPI:BOOL=OFF
  -DVTK_Group_Views:BOOL=OFF
  -DVTK_Group_Qt:BOOL=OFF
  -DVTK_Group_Tk:BOOL=OFF
  -DVTK_Group_Web:BOOL=OFF
  -DModule_vtkFiltersCore:BOOL=ON
  -DModule_vtkFiltersModeling:BOOL=ON
  -DModule_vtkFiltersSources:BOOL=ON
  -DModule_vtkFiltersGeometry:BOOL=ON
  -DModule_vtkIOGeometry:BOOL=ON
  -DModule_vtkIOLegacy:BOOL=ON
  -DModule_vtkIOImage:BOOL=ON
  -DModule_vtkIOPLY:BOOL=ON
  -DModule_vtkIOInfovis:BOOL=ON
  -DModule_vtkImagingCore:BOOL=ON
  -DModule_vtkInteractionStyle:BOOL=ON
  -DModule_vtkParallelCore:BOOL=ON
  -DModule_vtkRenderingCore:BOOL=ON
  -DModule_vtkRenderingFreeType:BOOL=OFF
)

# add volume rendering for ES 3.0
if (OPENGL_ES_VERSION STREQUAL "3.0")
  set(ios_cmake_flags ${ios_cmake_flags}
    -DModule_vtkRenderingVolumeOpenGL2:BOOL=ON
    )
endif()

macro(crosscompile target toolchain_file archs)
  ExternalProject_Add(
    ${target}
    SOURCE_DIR ${CMAKE_SOURCE_DIR}
    PREFIX ${PREFIX_DIR}/${target}
    BINARY_DIR ${BUILD_DIR}/${target}
    INSTALL_DIR ${INSTALL_DIR}/${target}
    DEPENDS vtk-compile-tools
    ${BUILD_ALWAYS_STRING}
    CMAKE_ARGS
      -DCMAKE_CROSSCOMPILING:BOOL=ON
      -DCMAKE_OSX_ARCHITECTURES:STRING=${archs}
      -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
      -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${toolchain_file}
      -DVTKCompileTools_DIR:PATH=${BUILD_DIR}/vtk-compile-tools
      -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}/${target}
      ${ios_cmake_flags}
  )
endmacro()

crosscompile(vtk-ios-simulator
  CMake/ios.simulator.toolchain.cmake
  "${IOS_SIMULATOR_ARCHITECTURES}"
 )

# for each architecture
set(IOS_ARCHITECTURES arm64 armv7 armv7s)
foreach (arch ${IOS_ARCHITECTURES})
  set(CMAKE_CC_ARCH ${arch})
  configure_file(CMake/ios.device.toolchain.cmake.in
               ${CMAKE_CURRENT_BINARY_DIR}/CMake/ios.device.toolchain.${arch}.cmake
               @ONLY)
  crosscompile(vtk-ios-device-${arch}
    ${CMAKE_CURRENT_BINARY_DIR}/CMake/ios.device.toolchain.${arch}.cmake
    ${arch}
  )
  set(VTK_DEVICE_LIBS "${VTK_DEVICE_LIBS}
    \"${INSTALL_DIR}/vtk-ios-device-${arch}/lib/libvtk*.a\"" )
  set(VTK_DEVICE_DEPENDS ${VTK_DEVICE_DEPENDS}
    vtk-ios-device-${arch} )
endforeach()

# Pile it all into a framework
set(VTK_SIMULATOR_LIBS
    "${INSTALL_DIR}/vtk-ios-simulator/lib/libvtk*.a" )
set(VTK_INSTALLED_HEADERS
    "${INSTALL_DIR}/vtk-ios-device-arm64/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
set(VTK_GLOB_LIBS "${VTK_DEVICE_LIBS} \"${VTK_SIMULATOR_LIBS}\"")
configure_file(CMake/MakeFramework.cmake.in
               ${CMAKE_CURRENT_BINARY_DIR}/CMake/MakeFramework.cmake
               @ONLY)
add_custom_target(vtk-framework ALL
  COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/CMake/MakeFramework.cmake
  DEPENDS ${VTK_DEVICE_DEPENDS} vtk-ios-simulator)


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Not-Predicate Generator (!a)</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Spirit 2.5.7">
<link rel="up" href="../operator.html" title="Generator Operators">
<link rel="prev" href="and_predicate.html" title="And-Predicate Generator (&a)">
<link rel="next" href="../stream.html" title="Stream Generators">

Home
Libraries
People
FAQ
More

Not-Predicate
          Generator (!a)

            Description

            The not-predicate generator is used to test, whether the embedded generator
            fails, without generating any output. It succeeds if the embedded generator
            fails.

            Header

// forwards to <boost/spirit/home/karma/operator/not_predicate.hpp>
#include <boost/spirit/include/karma_not_predicate.hpp>

            Also, see Include Structure.

            Model
            of

              UnaryGenerator

            Expression
            Semantics

            Semantics of an expression is defined only where it differs from, or
            is not defined in UnaryGenerator.

<colgroup>
<col>
<col>
</colgroup>

                      Expression

                      Semantics

                      !a

                      The generator a
                      is executed for the sole purpose of testing whether it succeeds.
                      The not-predicate generator succeeds if its embedded generator
                      fails (unless the underlying output stream reports an error).
                      The not-predicate never produces any output.

            The not generator is implemented by redirecting all output produced by
            its embedded generator into a discarding device.

            Attributes

            See Compound
            Attribute Notation.

<colgroup>
<col>
<col>
</colgroup>

                      Expression

                      Attribute

                      !a
                      (not-predicate, unary !)

                      a:
                      A -->
                      !a: A

Note

              The attribute of the not-predicate is not always unused_type,
              which is different from Qi's not-predicate. This is necessary as the
              generator the and-predicate is attached to most of the time needs an
              attribute.

            Complexity

              The overall complexity of the not-predicate generator is defined by
              the complexity of its embedded generator. The complexity of the not-predicate
              generator itself is O(1).

            Example

Note

              The test harness for the example(s) below is presented in the Basics Examples
              section.

            Some includes:

#include <boost/spirit/include/karma.hpp>
#include <boost/spirit/include/support_utree.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/fusion/include/std_pair.hpp>
#include <iostream>
#include <string>

            Some using declarations:

using boost::spirit::karma::double_;
using boost::spirit::karma::ascii::char_;
using boost::spirit::karma::ascii::string;
using boost::phoenix::ref;

            Basic usage of a not predicate generator:

test_generator_attr("c", !char_('a') << 'b' | 'c', 'a');
test_generator_attr("b", !char_('a') << 'b' | 'c', 'x');

test_generator_attr("def", !string("123") << "abc" | "def", "123");
test_generator_attr("abc", !string("123") << "abc" | "def", "456");

Copyright © 2001-2011 Joel de Guzman, Hartmut Kaiser

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


text:
NilIO emulates a null device

## Install

	gem install nilio

## Use

Make sure you got it:

	>> require "nilio"
	=> true

Create a NilIO:

	>> null_device = NilIO.instance
	=> #<NilIO: ... >

Write to it:

	>> null_device.write("It's so nil")
	=> 11

Read from it:

	>> null_device.read(1)
	=>

It's always EOF:

	>> null_device.eof?
	=> true


text:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfAsset xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>debugFont.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>debugFont.tga</SourceFile>
  </Asset>
  <Asset xsi:type="UbershaderAsset">
    <AssetPath>debugRender.hlsl</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <GraphicsProfile>HiDef</GraphicsProfile>
    <DisableOptimization>false</DisableOptimization>
    <OptimizationLevel>1</OptimizationLevel>
    <AvoidFlowControl>false</AvoidFlowControl>
    <PreferFlowControl>false</PreferFlowControl>
    <MatrixPacking>RowMajor</MatrixPacking>
    <PSEntryPoint>PSMain</PSEntryPoint>
    <VSEntryPoint>VSMain</VSEntryPoint>
    <GSEntryPoint>GSMain</GSEntryPoint>
    <DSEntryPoint>DSMain</DSEntryPoint>
    <HSEntryPoint>HSMain</HSEntryPoint>
    <CSEntryPoint>CSMain</CSEntryPoint>
    <SourceFile>debugRender.hlsl</SourceFile>
    <ShowPemutations>false</ShowPemutations>
    <ListingPath>E:\GitHub\FusionFramework\FusionSamples\GISDemo\Content\Temp\0EC7C2D14F65EFBA65B361728EE70CD3.html</ListingPath>
  </Asset>
  <Asset xsi:type="UbershaderAsset">
    <AssetPath>spriteBatch.hlsl</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <GraphicsProfile>HiDef</GraphicsProfile>
    <DisableOptimization>false</DisableOptimization>
    <OptimizationLevel>1</OptimizationLevel>
    <AvoidFlowControl>false</AvoidFlowControl>
    <PreferFlowControl>false</PreferFlowControl>
    <MatrixPacking>RowMajor</MatrixPacking>
    <PSEntryPoint>PSMain</PSEntryPoint>
    <VSEntryPoint>VSMain</VSEntryPoint>
    <GSEntryPoint>GSMain</GSEntryPoint>
    <DSEntryPoint>DSMain</DSEntryPoint>
    <HSEntryPoint>HSMain</HSEntryPoint>
    <CSEntryPoint>CSMain</CSEntryPoint>
    <SourceFile>spriteBatch.hlsl</SourceFile>
    <ShowPemutations>false</ShowPemutations>
    <ListingPath>E:\GitHub\FusionFramework\FusionSamples\GISDemo\Content\Temp\A41575F61A6644F1898EE4AE0783DAF8.html</ListingPath>
  </Asset>
  <Asset xsi:type="UbershaderAsset">
    <AssetPath>Globe.hlsl</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <GraphicsProfile>HiDef</GraphicsProfile>
    <DisableOptimization>false</DisableOptimization>
    <OptimizationLevel>1</OptimizationLevel>
    <AvoidFlowControl>false</AvoidFlowControl>
    <PreferFlowControl>false</PreferFlowControl>
    <MatrixPacking>RowMajor</MatrixPacking>
    <PSEntryPoint>PSMain</PSEntryPoint>
    <VSEntryPoint>VSMain</VSEntryPoint>
    <GSEntryPoint>GSMain</GSEntryPoint>
    <DSEntryPoint>DSMain</DSEntryPoint>
    <HSEntryPoint>HSMain</HSEntryPoint>
    <CSEntryPoint>CSMain</CSEntryPoint>
    <SourceFile>Globe.hlsl</SourceFile>
    <ShowPemutations>false</ShowPemutations>
    <ListingPath>E:\GitHub\FusionFramework\FusionSamples\GISDemo\Content\Temp\94E598E0CF52E1B5521A5D6B7AF4339B.html</ListingPath>
  </Asset>
  <Asset xsi:type="UbershaderAsset">
    <AssetPath>GeoObjects.hlsl</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <GraphicsProfile>HiDef</GraphicsProfile>
    <DisableOptimization>false</DisableOptimization>
    <OptimizationLevel>1</OptimizationLevel>
    <AvoidFlowControl>false</AvoidFlowControl>
    <PreferFlowControl>false</PreferFlowControl>
    <MatrixPacking>RowMajor</MatrixPacking>
    <PSEntryPoint>PSMain</PSEntryPoint>
    <VSEntryPoint>VSMain</VSEntryPoint>
    <GSEntryPoint>GSMain</GSEntryPoint>
    <DSEntryPoint>DSMain</DSEntryPoint>
    <HSEntryPoint>HSMain</HSEntryPoint>
    <CSEntryPoint>CSMain</CSEntryPoint>
    <SourceFile>GeoObjects.hlsl</SourceFile>
    <ShowPemutations>false</ShowPemutations>
    <ListingPath>E:\GitHub\FusionFramework\FusionSamples\GISDemo\Content\Temp\C805B1BEF7FCAFD87CE66E069B5513FE.html</ListingPath>
  </Asset>
  <Asset xsi:type="UbershaderAsset">
    <AssetPath>Map.hlsl</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <GraphicsProfile>HiDef</GraphicsProfile>
    <DisableOptimization>false</DisableOptimization>
    <OptimizationLevel>1</OptimizationLevel>
    <AvoidFlowControl>false</AvoidFlowControl>
    <PreferFlowControl>false</PreferFlowControl>
    <MatrixPacking>RowMajor</MatrixPacking>
    <PSEntryPoint>PSMain</PSEntryPoint>
    <VSEntryPoint>VSMain</VSEntryPoint>
    <GSEntryPoint>GSMain</GSEntryPoint>
    <DSEntryPoint>DSMain</DSEntryPoint>
    <HSEntryPoint>HSMain</HSEntryPoint>
    <CSEntryPoint>CSMain</CSEntryPoint>
    <SourceFile>Map.hlsl</SourceFile>
    <ShowPemutations>false</ShowPemutations>
    <ListingPath>E:\GitHub\FusionFramework\FusionSamples\GISDemo\Content\Temp\2D791728A8E970FFD6CC2C07B4B8B87F.html</ListingPath>
  </Asset>
  <Asset xsi:type="UbershaderAsset">
    <AssetPath>stereo.hlsl</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <GraphicsProfile>HiDef</GraphicsProfile>
    <DisableOptimization>false</DisableOptimization>
    <OptimizationLevel>1</OptimizationLevel>
    <AvoidFlowControl>false</AvoidFlowControl>
    <PreferFlowControl>false</PreferFlowControl>
    <MatrixPacking>RowMajor</MatrixPacking>
    <PSEntryPoint>PSMain</PSEntryPoint>
    <VSEntryPoint>VSMain</VSEntryPoint>
    <GSEntryPoint>GSMain</GSEntryPoint>
    <DSEntryPoint>DSMain</DSEntryPoint>
    <HSEntryPoint>HSMain</HSEntryPoint>
    <CSEntryPoint>CSMain</CSEntryPoint>
    <SourceFile>stereo.hlsl</SourceFile>
    <ShowPemutations>true</ShowPemutations>
    <ListingPath>E:\GitHub\FusionFramework\FusionSamples\GISDemo\Content\Temp\4B9F5097212F68238CEF9BFF980979F4.html</ListingPath>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>empty.png</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>empty.png</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>redframe.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>redframe.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>NE2_50M_SR_W_4096.jpg</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>NE2_50M_SR_W_4096.jpg</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>palette.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>palette.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Urban/geoObjects.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Urban/geoObjects.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Urban/Railroads.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Urban/Railroads.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Urban/SocioClasses.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Urban/SocioClasses.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Urban/SocioClasses2.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Urban/SocioClasses2.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Urban/trainMarker.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Urban/trainMarker.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>palette3.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>palette3.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>palette2.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>palette2.tga</SourceFile>
  </Asset>
  <Asset xsi:type="BMFontSpriteFontAsset">
    <AssetPath>Fonts/headerFont.bmfc</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <SourcePath>Fonts/headerFont.bmfc</SourcePath>
  </Asset>
  <Asset xsi:type="BMFontSpriteFontAsset">
    <AssetPath>Fonts/labelBigLightFont.bmfc</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <SourcePath>Fonts/labelBigLightFont.bmfc</SourcePath>
  </Asset>
  <Asset xsi:type="BMFontSpriteFontAsset">
    <AssetPath>Fonts/labelFontAccent.bmfc</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <SourcePath>Fonts/labelFontAccent.bmfc</SourcePath>
  </Asset>
  <Asset xsi:type="BMFontSpriteFontAsset">
    <AssetPath>Fonts/labelFontNormal.bmfc</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <SourcePath>Fonts/labelFontNormal.bmfc</SourcePath>
  </Asset>
  <Asset xsi:type="BMFontSpriteFontAsset">
    <AssetPath>Fonts/labelMapCityFont.bmfc</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <SourcePath>Fonts/labelMapCityFont.bmfc</SourcePath>
  </Asset>
  <Asset xsi:type="BMFontSpriteFontAsset">
    <AssetPath>Fonts/plotAxisMarkerFont.bmfc</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <SourcePath>Fonts/plotAxisMarkerFont.bmfc</SourcePath>
  </Asset>
  <Asset xsi:type="BMFontSpriteFontAsset">
    <AssetPath>Fonts/plotAxisMarkerLightFont.bmfc</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <SourcePath>Fonts/plotAxisMarkerLightFont.bmfc</SourcePath>
  </Asset>
  <Asset xsi:type="BMFontSpriteFontAsset">
    <AssetPath>Fonts/titleFont.bmfc</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <SourcePath>Fonts/titleFont.bmfc</SourcePath>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Fonts/headerFont.bmfc\Page#0</AssetPath>
    <BuildOrder>1</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Temp\3DC699B7E3DABC3B3A60BAEC9CA13917_0.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Fonts/labelBigLightFont.bmfc\Page#0</AssetPath>
    <BuildOrder>1</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Temp\D96B13C13554A4539531EEBB1898EF2F_0.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Fonts/labelFontAccent.bmfc\Page#0</AssetPath>
    <BuildOrder>1</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Temp\0CCCFEC089E74225793DF60DEEE981F3_0.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Fonts/labelFontNormal.bmfc\Page#0</AssetPath>
    <BuildOrder>1</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Temp\051F2757DE7610B8A188CA38D54F19D8_0.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Fonts/labelMapCityFont.bmfc\Page#0</AssetPath>
    <BuildOrder>1</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Temp\7E039B73FCDA3CDF3CC8F3FB317E7B70_0.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Fonts/plotAxisMarkerFont.bmfc\Page#0</AssetPath>
    <BuildOrder>1</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Temp\C91BEB31ADB48FCE7FD7AD62CF4E2060_0.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Fonts/plotAxisMarkerLightFont.bmfc\Page#0</AssetPath>
    <BuildOrder>1</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Temp\9E9A38AD911A790FF6C89750F682BFD7_0.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Fonts/titleFont.bmfc\Page#0</AssetPath>
    <BuildOrder>1</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Temp\B6E297507182832FA77C5F5E0060DAF7_0.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>UI/beam.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>UI/beam.tga</SourceFile>
  </Asset>
  <Asset xsi:type="ImageFileTextureAsset">
    <AssetPath>Urban/InfectionDot.tga</AssetPath>
    <BuildOrder>0</BuildOrder>
    <IgnoreToolChanges>false</IgnoreToolChanges>
    <NoMips>false</NoMips>
    <Fast>false</Fast>
    <ToNormal>false</ToNormal>
    <Color>true</Color>
    <Alpha>false</Alpha>
    <Normal>false</Normal>
    <Compression>RGB</Compression>
    <SourceFile>Urban/InfectionDot.tga</SourceFile>
  </Asset>
</ArrayOfAsset>


text:
using UnityEngine;

public class ScreenshotTool : MonoBehaviour
{
    // Use this for initialization
    private void Start()
    {
    }

    // Update is called once per frame
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            Debug.Log("Screenshot captured.");
            Application.CaptureScreenshot("screenshot.png", 2);
        }
    }
}


text:
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 04, 2017 at 06:38 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `agrihome`
--

-- --------------------------------------------------------

--
-- Table structure for table `cara_tanam`
--

CREATE TABLE `cara_tanam` (
  `idtype_ct` int(5) NOT NULL,
  `type_ct` char(15) NOT NULL,
  `deskrpsi_ct` longtext CHARACTER SET hp8 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `jenis_tanaman`
--

CREATE TABLE `jenis_tanaman` (
  `idtype_jt` int(5) NOT NULL,
  `idtype_ct` int(5) NOT NULL,
  `jenis_tanaman` char(7) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `kalender_tanaman`
--

CREATE TABLE `kalender_tanaman` (
  `kalendertanaman_id` int(5) NOT NULL,
  `tanam_id` varchar(5) NOT NULL,
  `username_id` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `penyakit_tanaman`
--

CREATE TABLE `penyakit_tanaman` (
  `id_penyakit` int(5) NOT NULL,
  `nama_tanaman` char(15) NOT NULL,
  `deskripsi_penyakit` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tanam`
--

CREATE TABLE `tanam` (
  `tanam_id` int(5) NOT NULL,
  `tanaman_id` varchar(5) NOT NULL,
  `tanggal_tanam` date NOT NULL,
  `tanggal_panen` date NOT NULL,
  `reminder` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `tanaman`
--

CREATE TABLE `tanaman` (
  `tanaman_id` varchar(5) NOT NULL,
  `idtype_jt` int(5) NOT NULL,
  `nama_tanaman` char(15) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `user`
--

CREATE TABLE `user` (
  `username_id` varchar(10) NOT NULL,
  `fullname_user` char(15) NOT NULL,
  `password_user` varchar(10) NOT NULL,
  `email_user` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `cara_tanam`
--
ALTER TABLE `cara_tanam`
  ADD PRIMARY KEY (`idtype_ct`);

--
-- Indexes for table `jenis_tanaman`
--
ALTER TABLE `jenis_tanaman`
  ADD PRIMARY KEY (`idtype_jt`);

--
-- Indexes for table `kalender_tanaman`
--
ALTER TABLE `kalender_tanaman`
  ADD PRIMARY KEY (`kalendertanaman_id`);

--
-- Indexes for table `penyakit_tanaman`
--
ALTER TABLE `penyakit_tanaman`
  ADD PRIMARY KEY (`id_penyakit`);

--
-- Indexes for table `tanam`
--
ALTER TABLE `tanam`
  ADD PRIMARY KEY (`tanam_id`);

--
-- Indexes for table `tanaman`
--
ALTER TABLE `tanaman`
  ADD PRIMARY KEY (`tanaman_id`);

--
-- Indexes for table `user`
--
ALTER TABLE `user`
  ADD PRIMARY KEY (`username_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `jenis_tanaman`
--
ALTER TABLE `jenis_tanaman`
  MODIFY `idtype_jt` int(5) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `kalender_tanaman`
--
ALTER TABLE `kalender_tanaman`
  MODIFY `kalendertanaman_id` int(5) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `penyakit_tanaman`
--
ALTER TABLE `penyakit_tanaman`
  MODIFY `id_penyakit` int(5) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tanam`
--
ALTER TABLE `tanam`
  MODIFY `tanam_id` int(5) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


text:
if (typeof(SeatHolder) == "undefined") {

var scriptElement = (function deriveScriptElement() {
  var id = "tu_dummy_script";
  document.write('<script id="' + id + '"></script>');

  var dummyScript = document.getElementById(id);
  var element = dummyScript.previousSibling;

  dummyScript.parentNode.removeChild(dummyScript);
  return element;
}());
var scriptHost = (function deriveScriptHost() {
  var src = scriptElement.getAttribute("src");
  return src.match(/^\w+\:\/\//) ? src.match(/^\w+\:\/\/[^\/]*\//)[0] : "";
}());

// *
// * SeatHolder 0.8.1 (Uncompressed)
// * The modest Javascript placeholder (used in http://gettopup.com)
// *
// * This library requires jQuery (http://jquery.com)
// *
// * (c) 2010 Paul Engel (Internetbureau Holder B.V.)
// * Except otherwise noted, SeatHolder is licensed under
// * http://creativecommons.org/licenses/by-sa/3.0
// *
// * $Date: 2010-05-28 16:25:48 +0100 (Fri, 28 May 2010) $
// *

SeatHolder = (function() {
  var hintClass = "sh_hint", hideClass = "sh_hide";

  var injectCode = function() {
    var style = "<style>" +
                  "." + hintClass + " { color: " + SeatHolder.hintColor +" !important } " +
                  "." + hideClass + " { display: none !important }" +
                "</style>";

    jQuery(style).prependTo("head");
  };
  var bind = function() {
    var hintedElements = [];

    jQuery.each(jQuery(SeatHolder.selector), function(i, element) {
      element = jQuery(element);
      var seatholder = element.attr("seatholder");

      if (seatholder == null) {
        return;
      }

      if (seatholder.match(/^&/)) {
        onBlur(null, element);
      } else {
        hintedElements.push(element);
      }

      element.focus(onFocus)
             .blur(onBlur);
    });

    jQuery.each(hintedElements, function(i, element) {
      element         = jQuery(element);
      var hintElement = element.data("hint_element");

      if (typeof(hintElement) == "undefined") {
        (hintElement = element.attr("type").toLowerCase() == "textarea" ?
                         jQuery("<" + element.attr("type") + "/>") :
                         jQuery("<input/>").attr("type", element.attr("type")))
                       .attr("readonly", true)
                       .data("hinted_element", element)
                       .focus(onHintFocus);

        jQuery.each(element.get(0).attributes, function(index, attribute) {
          var key   = attribute.name;
          var value = attribute.value;

          if ((jQuery.inArray(key, ["class", "size", "cols", "rows"]) != -1) || key.match(/^data-/)) {
            switch(attribute) {
              case "class":
                hintElement.attr(key, value.replace(hideClass, "")); break;
              default:
                hintElement.attr(key, value);
            }
          }
        });

        hintElement.addClass(hintClass);
        element.data("hint_element", hintElement)
               .before(hintElement);
      }

      hintElement.val(element.attr("seatholder"));
      onBlur(null, element);
    });
  };

  var onHintFocus = function(event) {
    var hintElement = jQuery(event.target).addClass(hideClass);

    hintElement.data("hinted_element")
               .removeClass(hideClass)
               .focus();
  };
  var onFocus = function(event) {
    var element = jQuery(event.target);
    var seatholder = element.attr("seatholder");

    if (element.val() == seatholder.replace(/^&/, "")) {
      element.val("");
    }

    var input = element.get(0);

    if (input.createTextRange) {
      var oRange = input.createTextRange();
      oRange.moveStart("character", 0);
      oRange.moveEnd("character", element.val().length);
      oRange.select();
    } else if (input.setSelectionRange) {
      input.setSelectionRange(0, element.val().length);
    }
  };
  var onBlur = function(event, element) {
    if (element == null) {
      element = jQuery(event.target);
    }

    var seatholder  = element.attr("seatholder");
    var hintElement = element.data("hint_element");
    if (typeof(hintElement) == "undefined") {
      hintElement = null;
    }

    if ((element.val().length > 0 && element.val() != seatholder.replace(/^&/, ""))) {
			if (hintElement) {
      	hintElement.addClass(hideClass);
      }
			return;
    }

    if (seatholder.match(/^&/)) {
      element.val(seatholder.replace(/^&/, ""));
    } else {
      element.val("")
             .addClass(hideClass);
      hintElement.removeClass(hideClass);
    }
  };

  return {
    version: "0.8.1",
    selector: "[seatholder]",
    hintColor: "#AAA",
    init: function() {
      jQuery(document).ready(function() {
        injectCode();
        bind();
      });
    },
    rebind: function() {
      bind();
    }
  };
}());

(function () {
  var missing_libs = [];

  if (typeof(jQuery) == "undefined") {
    missing_libs.push("core");
  }

  if (missing_libs.length == 0) {
    SeatHolder.init();
  } else {
    var src = scriptElement.getAttribute("src").replace(/(development\/)?seat_holder(\-min)?\.js.*$/, "jquery/" + missing_libs.sort().join(".") + ".js");
    document.write('<script src="' + src + '" type="text/javascript" ' +
                           'onload="SeatHolder.init()" onreadystatechange="SeatHolder.init()">' +
                   '</script>');
  }
}());

}


text:
package com.thoughtworks.go.server.scheduling;

import java.util.concurrent.ConcurrentSkipListSet;

import com.thoughtworks.go.config.CaseInsensitiveString;
import com.thoughtworks.go.config.PipelineConfig;
import org.springframework.stereotype.Component;

/**
 * @understands what is currently being schedule
 */
@Component
public class TriggerMonitor {
    ConcurrentSkipListSet<CaseInsensitiveString> triggeredPipelines = new ConcurrentSkipListSet<>();

    public boolean isAlreadyTriggered(CaseInsensitiveString pipelineName) {
        return triggeredPipelines.contains(pipelineName);
    }

    public boolean markPipelineAsAlreadyTriggered(PipelineConfig pipelineConfig) {
        return markPipelineAsAlreadyTriggered(pipelineConfig.name());
    }

    public boolean markPipelineAsAlreadyTriggered(CaseInsensitiveString pipelineName) {
        return triggeredPipelines.add(pipelineName);
    }

    public void markPipelineAsCanBeTriggered(PipelineConfig pipelineConfig) {
        triggeredPipelines.remove(pipelineConfig.name());
    }

    public void clear_for_test() {
        triggeredPipelines.clear();
    }
}


text:
#!/bin/bash
#
#
#------------------------------------------------------------------------
# Copyright 2009-2013 by The Regents of the University of California
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# you may obtain a copy of the License from
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ------------------------------------------------------------------------
#

hostname

#Import cluster properties
. conf/cluster.properties

#Get the IP address of the cc
CCHOST_NAME=`cat conf/master`
CCHOST=`bin/getip.sh`

#Remove the temp dir
rm -rf $CCTMP_DIR
mkdir $CCTMP_DIR

#Remove the logs dir
rm -rf $CCLOGS_DIR
mkdir $CCLOGS_DIR

#Export JAVA_HOME and JAVA_OPTS
export JAVA_HOME=$JAVA_HOME
export JAVA_OPTS=$CCJAVA_OPTS

PREGELIX_HOME=`pwd`

#Enter the temp dir
cd $CCTMP_DIR

if [ -f "conf/topology.xml"  ]; then
#Launch hyracks cc script with topology
${PREGELIX_HOME}/bin/pregelixcc -client-net-ip-address $CCHOST -cluster-net-ip-address $CCHOST -client-net-port $CC_CLIENTPORT -cluster-net-port $CC_CLUSTERPORT -heartbeat-period 5000 -max-heartbeat-lapse-periods 4 -default-max-job-attempts 0 -job-history-size 0 -cluster-topology "conf/topology.xml" &> $CCLOGS_DIR/cc.log &
else
#Launch hyracks cc script without toplogy
${PREGELIX_HOME}/bin/pregelixcc -client-net-ip-address $CCHOST -cluster-net-ip-address $CCHOST -client-net-port $CC_CLIENTPORT -cluster-net-port $CC_CLUSTERPORT -heartbeat-period 5000 -max-heartbeat-lapse-periods 4 -default-max-job-attempts 0 -job-history-size 0 &> $CCLOGS_DIR/cc.log &
fi


text:
RemoteBus
======

Small library to pass messages between iOS apps and extensions. RemoteBus simulates a bus between app and extension to provide a mechanism to to synchronize data or just pass events in a easy way.

Demo
-----------
![Demo][1]

Usage
-----------
```objc
    // Create bus for this app group and name
    remoteBus = [[RBRemoteBus alloc] initWithName:@"OneBus" appGroupIdentifier:@"group.com.arturogutierrez.remotebus"];

    // Subscribe for remote events
    [remoteBus subscribeForIdentifier:@"SomeEventIdentifier" subscriber:^(RBMessage *message) {
        NSString *text = (NSString *) message.body;
        [self.label setText:text];
    }];

    // Pass an event
    RBMessage *message = [[RBMessage alloc] initWithIdentifier:@"AnotherEventIdentifier" body:@"Hey there!"];
    [remoteBus sendMessage:message];
```

Installation
-----------
* Download the source files (Classes folder) and add to your project or install it via [CocoaPods](https://github.com/cocoapods/cocoapods)
* Configure your app and extension to use same app group container. You can learn how to do it [here](https://developer.apple.com/library/ios/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/EnablingAppSandbox.html#//apple_ref/doc/uid/TP40011195-CH4-SW19) or [here](https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionScenarios.html).

Pod
-----------

You can install [RemoteBus](https://github.com/arturogutierrez/RemoteBus) via [CocoaPods](https://github.com/cocoapods/cocoapods):

```Ruby
pod 'RemoteBus', '~> 1.0.0'
```

Example
-----------
You can check a example in the [Example](Example) folder or just take a look into the [Tests](Example/RemoteBusExampleTests).

Developed By
------------

* Arturo Gutiérrez Díaz-Guerra - <arturo.gutierrez@gmail.com>

License
-------

    The MIT License (MIT)

    Copyright (c) 2015 Arturo Gutiérrez Díaz-Guerra

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.

[1]: ./Art/remotebusdemo.gif


text:
// RobotBuilder Version: 1.0
//
// This file was generated by RobotBuilder. It contains sections of
// code that are automatically generated and assigned by robotbuilder.
// These sections will be updated in the future when you export to
// Java from RobotBuilder. Do not put any code or make any change in
// the blocks indicating autogenerated code or it will be lost on an
// update. Deleting the comments indicating the section will prevent
// it from being updated in the future.
package org.usfirst.frc4579.FinalProject;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import org.usfirst.frc4579.FinalProject.commands.AutonomousCG;
import org.usfirst.frc4579.FinalProject.subsystems.Camera;
import org.usfirst.frc4579.FinalProject.subsystems.DriveTrain;
import org.usfirst.frc4579.FinalProject.subsystems.Roller;
import org.usfirst.frc4579.FinalProject.subsystems.Shooter;
import org.usfirst.frc4579.FinalProject.subsystems.Elevator;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Robot extends IterativeRobot {

    Command autonomousCommand;
    Command autonomous;
    public static boolean useCamera = false;
    public static int tilterMethod = 0;
    public static int setpoint = 0;
    public static boolean tiltManual = true;

    public static OI oi;
    // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
    public static DriveTrain driveTrain;
    public static Elevator elevator;
    public static Shooter shooter;
    public static Roller roller;
    public static Camera camera;
    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DECLARATIONS
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit() {
        System.out.println("......Starting Robot robotInit().");
        RobotMap.init();
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
        driveTrain = new DriveTrain();
        shooter = new Shooter();
        roller = new Roller();
        elevator = new Elevator();
        camera = new Camera();
        // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
        // This MUST be here. If the OI creates Commands (which it very likely
        // will), constructing it during the construction of CommandBase (from
        // which commands extend), subsystems are not guaranteed to be
        // yet. Thus, their requires() statements may grab null pointers. Bad
        // news. Don't move it.
        oi = new OI();

        //The following lines try to initialize the camera if expected.
        if (useCamera) {
            int count = 0;
            camera.cameraPreInit();
            while (!camera.cameraInitialized && (count < 6)) {
                camera.cameraInit();   //Ten seconds max per cycle.
                count += 1;
                System.out.println("\n....Camera Loop " + count);
            }
            System.out.println("....Camera?: " + camera.cameraInitialized);
            SmartDashboard.putBoolean("Camera?", camera.cameraInitialized);

            for (int i = 0; i < 3; i++) {
                camera.lightOn();
                Timer.delay(0.5);
                camera.lightOff();
                Timer.delay(0.5);
            }
        }
        // instantiate the command used for the autonomous period
        // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS
        // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS

        //autonomousCommand = new AutonomousCommand();
        autonomous = new AutonomousCG();
    }

    public void autonomousInit() {
        // schedule the autonomous command (example)
        System.out.println("......Starting autonomous.start()");
        //if (autonomousCommand != null) autonomousCommand.start();
        if (autonomous != null) {
            autonomous.start();
        }
        System.out.println("......Ending autonomous.start()");
    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {
        Scheduler.getInstance().run();
    }

    public void teleopInit() {
        // This makes sure that the autonomous stops running when
        // teleop starts running. If you want the autonomous to
        // continue until interrupted by another command, remove
        // this line or comment it out.
        //if (autonomousCommand != null) autonomousCommand.cancel();
        if (autonomous != null) {
            autonomous.cancel();
            RobotMap.driveTrainRobotDrive41.setSafetyEnabled(true);
        }
    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
        Scheduler.getInstance().run();
    }

    /**
     * This function called periodically during test mode
     */
    public void testPeriodic() {
        LiveWindow.run();
    }
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Android.App;
using Android.Content.PM;
using Android.OS;
using Android.Support.V4.App;
using Android.Support.V4.Widget;
using Android.Text.Format;
using Android.Views;
using Android.Widget;
using Toggl.Joey.UI.Adapters;
using Toggl.Joey.UI.Components;
using Toggl.Joey.UI.Fragments;
using Toggl.Joey.UI.Views;
using Toggl.Phoebe;
using Toggl.Phoebe.Data;
using Toggl.Phoebe.Net;
using XPlatUtils;
using ActionBarDrawerToggle = Android.Support.V7.App.ActionBarDrawerToggle;
using Fragment = Android.Support.V4.App.Fragment;
using Toolbar = Android.Support.V7.Widget.Toolbar;

namespace Toggl.Joey.UI.Activities
{
    [Activity (
         ScreenOrientation = ScreenOrientation.Portrait,
         Name = "toggl.joey.ui.activities.MainDrawerActivity",
         Label = "@string/EntryName",
         Exported = true,
         #if DEBUG
         // The actual entry-point is defined in manifest via activity-alias, this here is just to
         // make adb launch the activity automatically when developing.
         #endif
         Theme = "@style/Theme.Toggl.App")]
    public class MainDrawerActivity : BaseActivity
    {
        private const string PageStackExtra = "com.toggl.timer.page_stack";
        private const string LastSyncArgument = "com.toggl.timer.last_sync";
        private const string LastSyncResultArgument = "com.toggl.timer.last_sync_result";
        private readonly TimerComponent barTimer = new TimerComponent ();
        private readonly Lazy<LogTimeEntriesListFragment> trackingFragment = new Lazy<LogTimeEntriesListFragment> ();
        private readonly Lazy<SettingsListFragment> settingsFragment = new Lazy<SettingsListFragment> ();
        private readonly Lazy<ReportsPagerFragment> reportFragment = new Lazy<ReportsPagerFragment> ();
        private readonly Lazy<FeedbackFragment> feedbackFragment = new Lazy<FeedbackFragment> ();
        private readonly List<int> pageStack = new List<int> ();
        private readonly Handler handler = new Handler ();
        private DrawerListAdapter drawerAdapter;
        private ImageButton syncRetryButton;
        private TextView syncStatusText;
        private long lastSyncInMillis;
        private int syncStatus;
        private Subscription<SyncStartedMessage> drawerSyncStarted;
        private Subscription<SyncFinishedMessage> drawerSyncFinished;
        private static readonly int syncing = 0;
        private static readonly int syncSuccessful = 1;
        private static readonly int syncHadErrors = 2;
        private static readonly int syncFatalError = 3;

        private ListView DrawerListView { get; set; }

        private TextView DrawerUserName { get; set; }

        private ProfileImageView DrawerImage { get; set; }

        private View DrawerUserView { get; set; }

        private DrawerLayout DrawerLayout { get; set; }

        protected ActionBarDrawerToggle DrawerToggle { get; private set; }

        private FrameLayout DrawerSyncView { get; set; }

        private Toolbar MainToolbar { get; set; }

        protected override void OnCreateActivity (Bundle state)
        {
            base.OnCreateActivity (state);

            SetContentView (Resource.Layout.MainDrawerActivity);

            MainToolbar = FindViewById<Toolbar> (Resource.Id.MainToolbar);
            DrawerListView = FindViewById<ListView> (Resource.Id.DrawerListView);
            DrawerUserView = LayoutInflater.Inflate (Resource.Layout.MainDrawerListHeader, null);
            DrawerUserName = DrawerUserView.FindViewById<TextView> (Resource.Id.TitleTextView);
            DrawerImage = DrawerUserView.FindViewById<ProfileImageView> (Resource.Id.IconProfileImageView);
            DrawerListView.AddHeaderView (DrawerUserView);
            DrawerListView.Adapter = drawerAdapter = new DrawerListAdapter ();
            DrawerListView.ItemClick += OnDrawerListViewItemClick;

            var authManager = ServiceContainer.Resolve<AuthManager> ();
            authManager.PropertyChanged += OnUserChangedEvent;

            DrawerLayout = FindViewById<DrawerLayout> (Resource.Id.DrawerLayout);
            DrawerToggle = new ActionBarDrawerToggle (this, DrawerLayout, MainToolbar, Resource.String.EntryName, Resource.String.EntryName);

            DrawerLayout.SetDrawerShadow (Resource.Drawable.drawershadow, (int)GravityFlags.Start);
            DrawerLayout.SetDrawerListener (DrawerToggle);

            Timer.OnCreate (this);

            var lp = new Android.Support.V7.App.ActionBar.LayoutParams (ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.MatchParent, (int)GravityFlags.Right);

            MainToolbar.SetNavigationIcon (Resource.Drawable.ic_menu_black_24dp);
            SetSupportActionBar (MainToolbar);
            SupportActionBar.SetTitle (Resource.String.MainDrawerTimer);
            SupportActionBar.SetCustomView (Timer.Root, lp);
            SupportActionBar.SetDisplayShowCustomEnabled (true);

            var bus = ServiceContainer.Resolve<MessageBus> ();
            drawerSyncStarted = bus.Subscribe<SyncStartedMessage> (SyncStarted);
            drawerSyncFinished = bus.Subscribe<SyncFinishedMessage> (SyncFinished);

            DrawerSyncView = FindViewById<FrameLayout> (Resource.Id.DrawerSyncStatus);

            syncRetryButton = DrawerSyncView.FindViewById<ImageButton> (Resource.Id.SyncRetryButton);
            syncRetryButton.Click += OnSyncRetryClick;

            syncStatusText = DrawerSyncView.FindViewById<TextView> (Resource.Id.SyncStatusText);

            if (state == null) {
                OpenPage (DrawerListAdapter.TimerPageId);
            } else {
                // Restore page stack
                pageStack.Clear ();
                var arr = state.GetIntArray (PageStackExtra);
                if (arr != null) {
                    pageStack.AddRange (arr);
                }
            }

            // Make sure that the user will see newest data when they start the activity
            ServiceContainer.Resolve<ISyncManager> ().Run ();
        }

        private void OnUserChangedEvent (object sender, PropertyChangedEventArgs args)
        {
            var userData = ServiceContainer.Resolve<AuthManager> ().User;
            if (userData == null) {
                return;
            }
            DrawerUserName.Text = userData.Name;
            DrawerImage.ImageUrl = userData.ImageUrl;
        }

        protected override void OnSaveInstanceState (Bundle outState)
        {
            outState.PutIntArray (PageStackExtra, pageStack.ToArray ());
            outState.PutLong (LastSyncArgument, lastSyncInMillis);
            outState.PutInt (LastSyncResultArgument, syncStatus);
            base.OnSaveInstanceState (outState);
        }

        protected override void OnPostCreate (Bundle savedInstanceState)
        {
            if (savedInstanceState != null) {
                lastSyncInMillis = savedInstanceState.GetLong (LastSyncArgument);
                syncStatus = savedInstanceState.GetInt (LastSyncResultArgument);
                UpdateSyncStatus ();
            }
            base.OnPostCreate (savedInstanceState);
        }

        public override void OnConfigurationChanged (Android.Content.Res.Configuration newConfig)
        {
            base.OnConfigurationChanged (newConfig);
            DrawerToggle.OnConfigurationChanged (newConfig);
        }

        public override bool OnOptionsItemSelected (IMenuItem item)
        {
            return DrawerToggle.OnOptionsItemSelected (item) || base.OnOptionsItemSelected (item);
        }

        protected override void OnStart ()
        {
            base.OnStart ();
            Timer.OnStart ();
        }

        protected override void OnStop ()
        {
            base.OnStop ();
            Timer.OnStop ();
        }

        protected override void OnDestroy ()
        {
            Timer.OnDestroy (this);

            var bus = ServiceContainer.Resolve<MessageBus> ();

            if (drawerSyncStarted != null) {
                bus.Unsubscribe (drawerSyncStarted);
                drawerSyncStarted = null;
            }

            if (drawerSyncFinished != null) {
                bus.Unsubscribe (drawerSyncFinished);
                drawerSyncFinished = null;
            }

            base.OnDestroy ();
        }

        public override void OnBackPressed ()
        {
            if (pageStack.Count > 0) {
                pageStack.RemoveAt (pageStack.Count - 1);
                var pageId = pageStack.Count > 0 ? pageStack [pageStack.Count - 1] : DrawerListAdapter.TimerPageId;
                OpenPage (pageId);
            } else {
                base.OnBackPressed ();
            }
        }

        private void SetMenuSelection (int pos)
        {
            int parentPos = drawerAdapter.GetParentPosition (pos -1);
            DrawerListView.ClearChoices ();
            if (parentPos > -1) {
                DrawerListView.ChoiceMode = (ChoiceMode)ListView.ChoiceModeMultiple;
                DrawerListView.SetItemChecked (parentPos, true);
                DrawerListView.SetItemChecked (pos, true);
            } else {
                DrawerListView.ChoiceMode = (ChoiceMode)ListView.ChoiceModeSingle;
                DrawerListView.SetItemChecked (pos, true);
            }
        }

        private void OpenPage (int id)
        {
            if (id == DrawerListAdapter.SettingsPageId) {
                OpenFragment (settingsFragment.Value);
                SupportActionBar.SetTitle (Resource.String.MainDrawerSettings);
            } else if (id == DrawerListAdapter.ReportsPageId) {
                drawerAdapter.ExpandCollapse (DrawerListAdapter.ReportsPageId);
                if (reportFragment.Value.ZoomLevel == ZoomLevel.Week) {
                    SupportActionBar.SetTitle (Resource.String.MainDrawerReportsWeek);
                    id = DrawerListAdapter.ReportsWeekPageId;
                } else if (reportFragment.Value.ZoomLevel == ZoomLevel.Month) {
                    SupportActionBar.SetTitle (Resource.String.MainDrawerReportsMonth);
                    id = DrawerListAdapter.ReportsMonthPageId;
                } else {
                    SupportActionBar.SetTitle (Resource.String.MainDrawerReportsYear);
                    id = DrawerListAdapter.ReportsYearPageId;
                }
                OpenFragment (reportFragment.Value);
            } else if (id == DrawerListAdapter.ReportsWeekPageId) {
                drawerAdapter.ExpandCollapse (DrawerListAdapter.ReportsPageId);
                SupportActionBar.SetTitle (Resource.String.MainDrawerReportsWeek);
                reportFragment.Value.ZoomLevel = ZoomLevel.Week;
                OpenFragment (reportFragment.Value);
            } else if (id == DrawerListAdapter.ReportsMonthPageId) {
                drawerAdapter.ExpandCollapse (DrawerListAdapter.ReportsPageId);
                SupportActionBar.SetTitle (Resource.String.MainDrawerReportsMonth);
                reportFragment.Value.ZoomLevel = ZoomLevel.Month;
                OpenFragment (reportFragment.Value);
            } else if (id == DrawerListAdapter.ReportsYearPageId) {
                drawerAdapter.ExpandCollapse (DrawerListAdapter.ReportsPageId);
                SupportActionBar.SetTitle (Resource.String.MainDrawerReportsYear);
                reportFragment.Value.ZoomLevel = ZoomLevel.Year;
                OpenFragment (reportFragment.Value);
            } else if (id == DrawerListAdapter.FeedbackPageId) {
                SupportActionBar.SetTitle (Resource.String.MainDrawerFeedback);
                drawerAdapter.ExpandCollapse (DrawerListAdapter.FeedbackPageId);
                OpenFragment (feedbackFragment.Value);
            } else {
                SupportActionBar.SetTitle (Resource.String.MainDrawerTimer);
                OpenFragment (trackingFragment.Value);
                drawerAdapter.ExpandCollapse (DrawerListAdapter.TimerPageId);
                Timer.HideAction = false;
            }
            SetMenuSelection (drawerAdapter.GetItemPosition (id));

            pageStack.Remove (id);
            pageStack.Add (id);
            // Make sure we don't store the timer page as the first page (this is implied)
            if (pageStack.Count == 1 && id == DrawerListAdapter.TimerPageId) {
                pageStack.Clear ();
            }
        }

        private void OpenFragment (Fragment fragment)
        {
            var old = FragmentManager.FindFragmentById (Resource.Id.ContentFrameLayout);
            if (old == null) {
                FragmentManager.BeginTransaction ()
                .Add (Resource.Id.ContentFrameLayout, fragment)
                .Commit ();
            } else if (old != fragment) {
                // The detach/attach is a workaround for https://code.google.com/p/android/issues/detail?id=42601
                FragmentManager.BeginTransaction ()
                .Detach (old)
                .Replace (Resource.Id.ContentFrameLayout, fragment)
                .Attach (fragment)
                .Commit ();
            }
        }

        private void OnDrawerListViewItemClick (object sender, ListView.ItemClickEventArgs e)
        {
            // If tap outside options just close drawer
            if (e.Id == -1) {
                DrawerLayout.CloseDrawers ();
                return;
            }

            // Configure timer component for selected page:
            if (e.Id != DrawerListAdapter.TimerPageId) {
                Timer.HideAction = true;
                Timer.HideDuration = false;
            } else {
                Timer.HideAction = false;
            }

            if (e.Id == DrawerListAdapter.TimerPageId) {
                OpenPage (DrawerListAdapter.TimerPageId);

            } else if (e.Id == DrawerListAdapter.LogoutPageId) {
                var authManager = ServiceContainer.Resolve<AuthManager> ();
                authManager.Forget ();
                StartAuthActivity ();
            } else if (e.Id == DrawerListAdapter.ReportsPageId) {
                OpenPage (DrawerListAdapter.ReportsPageId);
            } else if (e.Id == DrawerListAdapter.ReportsWeekPageId) {
                OpenPage (DrawerListAdapter.ReportsWeekPageId);
            } else if (e.Id == DrawerListAdapter.ReportsMonthPageId) {
                OpenPage (DrawerListAdapter.ReportsMonthPageId);
            } else if (e.Id == DrawerListAdapter.ReportsYearPageId) {
                OpenPage (DrawerListAdapter.ReportsYearPageId);
            } else if (e.Id == DrawerListAdapter.SettingsPageId) {
                OpenPage (DrawerListAdapter.SettingsPageId);

            } else if (e.Id == DrawerListAdapter.FeedbackPageId) {
                OpenPage (DrawerListAdapter.FeedbackPageId);
            }

            DrawerLayout.CloseDrawers ();
        }

        protected void SyncStarted (SyncStartedMessage msg)
        {
            syncRetryButton.Enabled = false;
            syncStatus = syncing;
            syncStatusText.SetText (Resource.String.CurrentlySyncingStatusText);
        }

        private void SyncFinished (SyncFinishedMessage msg)
        {
            syncRetryButton.Enabled = true;
            if (msg.FatalError != null) {
                syncStatus = syncFatalError;
            } else if (msg.HadErrors) {
                syncStatus = syncHadErrors;
            } else {
                syncStatus = syncSuccessful;
            }
            lastSyncInMillis = Toggl.Phoebe.Time.Now.Ticks / TimeSpan.TicksPerMillisecond;
            UpdateSyncStatus ();
        }

        private void OnSyncRetryClick (object sender, EventArgs e)
        {
            var syncManager = ServiceContainer.Resolve<ISyncManager> ();
            syncManager.Run ();
        }

        private void UpdateSyncStatus ()
        {
            if (syncStatus == syncing) {
                syncStatusText.SetText (Resource.String.CurrentlySyncingStatusText);
            } else if (syncStatus == syncHadErrors) {
                syncStatusText.SetText (Resource.String.LastSyncHadErrors);
            } else if (syncStatus == syncFatalError) {
                syncStatusText.SetText (Resource.String.LastSyncFatalError);
            } else {
                syncStatusText.Text = String.Format (Resources.GetString (Resource.String.LastSyncStatusText), ResolveLastSyncTime ());
            }
            handler.RemoveCallbacks (UpdateSyncStatus);
            handler.PostDelayed (UpdateSyncStatus, DateUtils.MinuteInMillis);
        }

        private String ResolveLastSyncTime ()
        {
            var NowInMillis = Toggl.Phoebe.Time.Now.Ticks / TimeSpan.TicksPerMillisecond;
            if (NowInMillis - lastSyncInMillis < DateUtils.MinuteInMillis) {
                return Resources.GetString (Resource.String.LastSyncJustNow);
            }
            return DateUtils.GetRelativeTimeSpanString (lastSyncInMillis, NowInMillis, 0L);
        }

        public TimerComponent Timer
        {
            get { return barTimer; }
        }
    }
}


text:
#ifndef ALITRDCHECKESD_H
#define ALITRDCHECKESD_H

/* $Id: AliTRDcheckESD.h 27496 2008-07-22 08:35:45Z cblume $ */

/////////////////////////////////////////////////////
//
// Check basic detector results at ESD level
//
// Author
//   Alex Bercuci <A.Bercuci@gsi.de>
//   Ionut Arsene <iarsene@cern.ch>
//
//////////////////////////////////////////////////////

#ifndef ALIANALYSISTASK_H
#include "AliAnalysisTaskSE.h"
#endif

class AliESDEvent;
class AliMCEvent;
class AliESDpid;
class AliCFContainer;
class AliAnalysisCuts;
class AliESDtrack;
class TH1;
class TH2;
class TH1F;
class TH1D;
class TH2F;
class TH3F;
class TH3;
class TObjArray;
class TGraph;
class TGraphErrors;
class TAxis;

class AliTRDcheckESD : public AliAnalysisTaskSE {
public:
  enum ETRDcheckESDstatus {
     kMC        = BIT(0)  // use MC info
    ,kCollision = BIT(1)  //
  };

  enum ETrdCfVariables {
    // Event wise variables
    kEventVtxZ=0,                // event vtx. Z        ---
    kEventMult,                  // event multiplicity  ---
    kEventTrigger,               // trigger class
    kEventBC,                    // event BC        ---
    // Track wise variables
    kTrackTOFBC,                 // track TOF BC    ---
    kTrackDCAxy,                 // dca xy          ---
    kTrackDCAz,                  // dca z           ---
    kTrackCharge,                // charge          ---
    kTrackOuterParamRadius,      // outer param radius
    kTrackPhi,                   // phi at the vertex  ---
    kTrackPhiTRD,                // phi at the entrance of TRD  ---
    kTrackEta,                   // eta at the vertex  ---
    kTrackEtaTRD,                // eta at the entrance of TRD  ---
    kTrackPt,                    // pt at the vertex     ---
    kTrackPtTRD,                 // pt at the entrance of TRD ---
    kTrackP,                     // p at the vertex      ---
    kTrackPTRD,                  // p at the entrance of TRD  ---
    kTrackTrdChi2,               // TRD track chi2 ---
    kTrackTrdTracklets,          // number of TRD tracklets  ---
    kTrackTrdClusters,           // number of TRD clusters   ---
    kTrackTrdQuality,            // TRD quality for TOF
    kTrackTRDBudget,             // TRD material budget
    kTrackTOFchi2,               // TOF chi2
    // Tracklets wise variables
    kTrackletQtot,               // tracklet qtot in each layer
    kTrackletClustersVsRows,     // clusters / crossed rows
    kTrackletClusters,           // number of clusters per tracklet
    kTrackletP,                  // tracklet p in each layer
    kTrackPlossTRDlayer,         // p loss at each layer
    kTrackletLayer,              // layer of the current tracklet
    // Tracklet slice variables
    kTrackletSlice,              // tracklet slice number
    kTrackletPHslice,            // charge per tracklet slice
    kNTrdCfVariables,
    kNMaxAssignedTriggers = 200
  };

  enum ETrdCfSteps {
    kTPCreference=0,
    kTRD,
    kTOF,
    kTOFin,
    kTOFout,
    kNSteps
  };

  AliTRDcheckESD();
  AliTRDcheckESD(char* name);
  virtual ~AliTRDcheckESD();

  void          UserCreateOutputObjects();
  void          UserExec(Option_t *);

  void          SetRefTrackFilter(AliAnalysisCuts* const filter) {fReferenceTrackFilter = filter;}

  Bool_t        HasMC() const { return TESTBIT(fStatus, kMC);}
  Bool_t        IsCollision() const {return TESTBIT(fStatus, kCollision);}
  void          SetCollision(Bool_t set=kTRUE) {set ? SETBIT(fStatus, kCollision) : CLRBIT(fStatus, kCollision);}
  TObjArray*    Histos();
  Int_t         GetTriggerCounter(const Char_t* triggerName) const;
  void          PrintTriggers() const;
  Bool_t        Load(const Char_t *fn="AnalysisResults.root", const Char_t *dir="TRD_Performance", const Char_t *name=NULL);
  void          SetMC(Bool_t mc = kTRUE) { mc ? SETBIT(fStatus, kMC) : CLRBIT(fStatus, kMC);}
  Bool_t        PutTrendValue(const Char_t *name, Double_t val);
  void          Terminate(Option_t *);
  void          MakeSummaryFromCF(Double_t* trendValues=0x0, const Char_t* triggerName="", Bool_t useIsolatedBC=kFALSE, Bool_t cutTOFbc=kFALSE);
  Int_t         GetNAssignedTriggers();
  void          AddUserTrigger(const Char_t* name) {fUserEnabledTriggers += name; fUserEnabledTriggers += ";";}

  void          AddCFContainer(const Char_t* name, const Char_t* title, Int_t nSteps, Int_t* steps,
		               Int_t nVars, UInt_t* vars, TArrayD* binLimits);

private:
  static const Float_t fgkxTPC; // end radial position of TPC
  static const Float_t fgkxTOF; // start radial position of TOF
  static const Char_t* fgkVarNames[kNTrdCfVariables];
  static const Char_t* fgkStepNames[kNSteps];

  void PlotTrackingSummaryFromCF(Double_t* trendValues=0x0,
				 const Char_t* triggerName="",
                                 Bool_t useIsolatedBC=kFALSE, Bool_t cutTOFbc=kFALSE);   // 1 <= centralityClass <= 5; 0-all centrality classes together
  void PlotPidSummaryFromCF(Double_t* trendValues=0x0,
			    const Char_t* triggerName="",
                            Bool_t useIsolatedBC=kFALSE, Bool_t cutTOFbc=kFALSE);        // 1 <= centralityClass <= 5; 0-all centrality classes together
  void PlotCentSummaryFromCF(Double_t* trendValues=0x0, const Char_t* triggerName="",
                             Bool_t useIsolatedBC=kFALSE, Bool_t cutTOFbc=kFALSE);       // centrality dependent plots
  void PlotOtherSummaryFromCF(Double_t* trendValues);

  AliTRDcheckESD(const AliTRDcheckESD&);
  AliTRDcheckESD& operator=(const AliTRDcheckESD&);
  Int_t         Pdg2Idx(Int_t pdg) const;
  void          Process(TH1 **h, TGraphErrors *g);
  void          Process2D(TH2 * const h, TGraphErrors **g);
  void          PrintStatus(ULong_t s);
  TH2F*         Proj3D(TH3* hist, TH2* accMap, Int_t binLow, Int_t binHigh, Float_t &entries);
  TH1D*         Proj2D(TH2* hist, TH1* mpvErr=0x0, TH1* widthErr=0x0, TH1* chi2=0x0);
  TH1F*         EfficiencyTRD(TH3* tpc3D, TH3* trd3D, Bool_t useAcceptance=kTRUE);
  TH1F*         EfficiencyFromPhiPt(AliCFContainer* cf, Int_t minNtrkl, Int_t maxNtrkl, Int_t stepNom, Int_t stepDenom, Int_t var=kTrackPt);
  void          DrawTRDGrid();
  void          SetStyle(TH1* hist, Int_t lineStyle, Int_t lineColor, Int_t lineWidth,
                         Int_t markerStyle, Int_t markerColor, Int_t markerSize);
  void          SetStyle(TAxis* axis, const Char_t* title, Float_t titleSize, Float_t titleOffset, Bool_t centerTitle,
                         Float_t labelSize);
  void          CheckActiveSM(TH1D* phiProj, Bool_t activeSM[18]);
  void          FindIsolatedBCs(TH1D* bcHist, Bool_t isIsolated[3500]);
  void          InitializeCFContainers();
  Int_t         GetTriggerIndex(const Char_t* name, Bool_t createNew=kTRUE);
  void          FillEventInfo(Double_t* values);
  void          FillTrackInfo(Double_t* values, AliESDtrack* esdTrack);
  void          FillTrackletInfo(Double_t* values, AliESDtrack* esdTrack, Int_t iPlane,
                                 Double_t* localSagitaPhi, Double_t localMom[][3], Bool_t* localMomGood);
  void          FillTrackletSliceInfo(Double_t* values, AliESDtrack* esdTrack, Int_t iSlice);
  //void          FillCFContainer(AliCFContainer* cf, Double_t* values, Int_t step);
  void          FillCFContainer(AliCFContainer* cf, Double_t* values, Bool_t* stepSelections);
  Bool_t        IsTrackSelected(AliESDtrack* track, Double_t* values, Int_t step);
  void          FillGlobalTrackContainers(Double_t* values, Bool_t* stepSelections, Int_t itrig);
  void          FillTrdTrackletContainers(Double_t* values, Bool_t* stepSelections, Int_t itrig);
  void          FillTrdSliceContainers(Double_t* values, Bool_t* stepSelections, Int_t itrig);

  Int_t            fStatus;            // bit mask for controlling the task
  Int_t            fNRefFigures;       // number of current ref plots
  AliESDEvent      *fESD;              //! ESD event
  AliMCEvent       *fMC;               //! MC event
  AliESDpid        *fESDpid;           //  ESD pid object
  static FILE      *fgFile;            //! trend file streamer
  TObjArray*        fHistos;           //! QA histograms

  AliAnalysisCuts* fReferenceTrackFilter;     // reference track filter
  Bool_t           fPhysSelTriggersEnabled;   // flag wheter physics selection triggers were enabled
  TString          fUserEnabledTriggers;      // list of user enabled triggers
  Int_t            fNAssignedTriggers;        // number of assigned triggers

  ClassDef(AliTRDcheckESD, 10)          // user oriented TRD analysis based on ESD-MC data
};
#endif


text:
import logging
import functools
import json

from horsemeat import HorsemeatJSONEncoder

log = logging.getLogger(__name__)

class RelationWrapper(object):

    @property
    def __jsondata__(self):
        return self.__dict__

    @staticmethod
    def none_or_s(s):

        if s in set(["$-", "#N/A", "NULL"]):
            return

        elif isinstance(s, basestring):
            s2 = s.strip().replace("$", "").replace("%", "").replace(",", "").replace("-", "")

            if s2:
                return s2

        elif isinstance(s, (float, int)):
            return s

class KeepixJSONEncoder(HorsemeatJSONEncoder):

    """
    Each project can modify this just for fun if they want.
    """

# TODO: add a docstring on this guy.
fancyjsondumps = functools.partial(
    json.dumps,
    cls=KeepixJSONEncoder,
    sort_keys=True,
    indent=4,
    separators=(',', ': '))

# These imports are down here on purpose, after the definition of
# RelationWrapper.
from profiles.pg import indicators
from profiles.pg import locations


text:
#ifndef ALKES_TESTDRIVER_INTERNAL_H_INCLUDED_
#define ALKES_TESTDRIVER_INTERNAL_H_INCLUDED_

#include "alkes.h"
#include "alkes/tree.h"

#if (ALKES_API_WIN32 == 1)
#if defined(ALKES_TD_EXPORTS)
#define AL_TD_EXPORT    __declspec(dllexport)
#else
#define AL_TD_EXPORT    __declspec(dllimport)
#endif
#else
#define AL_TD_EXPORT
#endif

#endif