text:
package us.kbase.auth2.service.api;

import static us.kbase.auth2.service.common.ServiceCommon.getToken;
import static us.kbase.auth2.service.ui.UIUtils.customRolesToList;

import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;

import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableMap;

import us.kbase.auth2.lib.Authentication;
import us.kbase.auth2.lib.CustomRole;
import us.kbase.auth2.lib.DisplayName;
import us.kbase.auth2.lib.Role;
import us.kbase.auth2.lib.UserName;
import us.kbase.auth2.lib.exceptions.AuthException;
import us.kbase.auth2.lib.exceptions.DisabledUserException;
import us.kbase.auth2.lib.exceptions.IllegalParameterException;
import us.kbase.auth2.lib.exceptions.InvalidTokenException;
import us.kbase.auth2.lib.exceptions.MissingParameterException;
import us.kbase.auth2.lib.exceptions.NoSuchRoleException;
import us.kbase.auth2.lib.exceptions.NoSuchUserException;
import us.kbase.auth2.lib.exceptions.NoTokenProvidedException;
import us.kbase.auth2.lib.exceptions.TestModeException;
import us.kbase.auth2.lib.exceptions.UnauthorizedException;
import us.kbase.auth2.lib.exceptions.UserExistsException;
import us.kbase.auth2.lib.storage.exceptions.AuthStorageException;
import us.kbase.auth2.lib.token.StoredToken;
import us.kbase.auth2.lib.token.TokenName;
import us.kbase.auth2.lib.token.TokenType;
import us.kbase.auth2.service.common.Fields;
import us.kbase.auth2.service.common.IncomingJSON;
import us.kbase.auth2.service.common.ServiceCommon;

@Path(APIPaths.TESTMODE)
public class TestMode {

	// TODO JAVADOC or swagger

	private final Authentication auth;

	@Inject
	public TestMode(final Authentication auth) {
		this.auth = auth;
	}

	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, Object> testRoot() {
		return ServiceCommon.root();
	}

	public static class CreateTestUser extends IncomingJSON {

		public final String userName;
		public final String displayName;

		@JsonCreator
		public CreateTestUser(
				@JsonProperty(Fields.USER) final String userName,
				@JsonProperty(Fields.DISPLAY) final String displayName) {
			this.userName = userName;
			this.displayName = displayName;
		}
	}

	@POST
	@Path(APIPaths.TESTMODE_USER)
	@Consumes(MediaType.APPLICATION_JSON)
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, Object> createTestUser(final CreateTestUser create)
			throws MissingParameterException, IllegalParameterException, UserExistsException,
					UnauthorizedException, TestModeException, AuthStorageException {
		if (create == null) {
			throw new MissingParameterException("JSON body missing");
		}
		create.exceptOnAdditionalProperties();
		final UserName user = new UserName(create.userName);
		auth.testModeCreateUser(user, new DisplayName(create.displayName));
		try {
			return Me.toUserMap(auth.testModeGetUser(user));
		} catch (NoSuchUserException e) {
			throw new RuntimeException("Neat, user creation is totally busted: " +
					e.getMessage(), e);
		}
	}

	@GET
	@Path(APIPaths.TESTMODE_USER_GET)
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, Object> getTestUser(@PathParam(APIPaths.USERNAME) final String userName)
			throws NoSuchUserException, TestModeException, MissingParameterException,
				IllegalParameterException, AuthStorageException {
		return Me.toUserMap(auth.testModeGetUser(new UserName(userName)));
	}

	public static class CreateTestToken extends IncomingJSON {
		public final String userName;
		public final String tokenName;
		public final String tokenType;

		@JsonCreator
		public CreateTestToken(
				@JsonProperty(Fields.USER) final String userName,
				@JsonProperty(Fields.TOKEN_NAME) final String tokenName,
				@JsonProperty(Fields.TOKEN_TYPE) final String tokenType) {
			this.userName = userName;
			this.tokenName = tokenName;
			this.tokenType = tokenType;
		}
	}

	@GET
	@Path(APIPaths.TESTMODE_USER_DISPLAY)
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, String> getUsers(
			@HeaderParam(APIConstants.HEADER_TOKEN) final String token,
			@QueryParam(Fields.LIST) final String users)
			throws IllegalParameterException, NoTokenProvidedException,
				InvalidTokenException, AuthStorageException, TestModeException {
		final Set<UserName> uns = Users.processUserListString(users);
		final Map<UserName, DisplayName> dns = auth.testModeGetUserDisplayNames(
				getToken(token), uns);
		return dns.entrySet().stream().collect(
				Collectors.toMap(e -> e.getKey().getName(), e -> e.getValue().getName()));
	}

	@POST
	@Path(APIPaths.TESTMODE_TOKEN_CREATE)
	@Consumes(MediaType.APPLICATION_JSON)
	@Produces(MediaType.APPLICATION_JSON)
	public NewAPIToken createTestToken(final CreateTestToken create)
			throws MissingParameterException, IllegalParameterException, NoSuchUserException,
				TestModeException, AuthStorageException {
		if (create == null) {
			throw new MissingParameterException("JSON body missing");
		}
		create.exceptOnAdditionalProperties();
		return new NewAPIToken(auth.testModeCreateToken(
				new UserName(create.userName),
				create.tokenName == null ? null : new TokenName(create.tokenName),
				getTokenType(create.tokenType)),
				auth.getSuggestedTokenCacheTime());
	}

	private TokenType getTokenType(final String tokenType) throws IllegalParameterException {
		try {
			return TokenType.getType(tokenType);
		} catch (IllegalArgumentException e) {
			throw new IllegalParameterException(e.getMessage(), e);
		}
	}

	@GET
	@Path(APIPaths.TESTMODE_TOKEN)
	@Produces(MediaType.APPLICATION_JSON)
	public APIToken getTestToken(@HeaderParam(APIConstants.HEADER_TOKEN) final String token)
			throws NoTokenProvidedException, InvalidTokenException, AuthStorageException,
				TestModeException {
		final StoredToken ht = auth.testModeGetToken(getToken(token));
		return new APIToken(ht, auth.getSuggestedTokenCacheTime());
	}

	@GET
	@Path(APIPaths.TESTMODE_ME)
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, Object> getTestMe(
			@HeaderParam(APIConstants.HEADER_TOKEN) final String token)
			throws InvalidTokenException, NoSuchUserException, TestModeException,
				NoTokenProvidedException, AuthStorageException {
		return Me.toUserMap(auth.testModeGetUser(getToken(token)));
	}

	public static class CustomRoleCreate extends IncomingJSON {
		public final String id;
		public final String description;

		@JsonCreator
		public CustomRoleCreate(
				@JsonProperty(Fields.ID) final String id,
				@JsonProperty(Fields.DESCRIPTION) final String description) {
			this.id = id;
			this.description = description;
		}
	}

	@POST
	@Path(APIPaths.TESTMODE_CUSTOM_ROLES)
	@Consumes(MediaType.APPLICATION_JSON)
	public void createTestCustomRole(final CustomRoleCreate create)
			throws TestModeException, MissingParameterException, IllegalParameterException,
				AuthStorageException {
		if (create == null) {
			throw new MissingParameterException("JSON body missing");
		}
		create.exceptOnAdditionalProperties();
		auth.testModeSetCustomRole(new CustomRole(create.id, create.description));
	}

	@GET
	@Path(APIPaths.TESTMODE_CUSTOM_ROLES)
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, Object> getTestCustomRoles()
			throws TestModeException, AuthStorageException {
		return ImmutableMap.of(Fields.CUSTOM_ROLES,
				customRolesToList(new TreeSet<>(auth.testModeGetCustomRoles())));
	}

	public static class UserRolesSet extends IncomingJSON {
		public String userName;
		public List<String> roles;
		public List<String> customRoles;

		@JsonCreator
		public UserRolesSet(
				@JsonProperty(Fields.USER) final String userName,
				@JsonProperty(Fields.ROLES) final List<String> roles,
				@JsonProperty(Fields.CUSTOM_ROLES) final List<String> customRoles) {
			this.userName = userName;
			this.roles = roles;
			this.customRoles = customRoles;
		}
	}

	@PUT
	@Path(APIPaths.TESTMODE_USER_ROLES)
	@Consumes(MediaType.APPLICATION_JSON)
	public void setTestModeUserRoles(final UserRolesSet set)
			throws MissingParameterException, IllegalParameterException, NoSuchUserException,
				NoSuchRoleException, TestModeException, AuthStorageException {
		if (set == null) {
			throw new MissingParameterException("JSON body missing");
		}
		set.exceptOnAdditionalProperties();
		final List<String> roles = set.roles == null ? Collections.emptyList() : set.roles;
		final List<String> customRoles = set.customRoles == null ? Collections.emptyList() :
			set.customRoles;
		noNulls(roles, "Null item in roles");
		noNulls(customRoles, "Null item in custom roles");
		auth.testModeSetRoles(
				new UserName(set.userName), toRoles(roles), new HashSet<>(customRoles));
	}

	private Set<Role> toRoles(final List<String> roles) throws IllegalParameterException {
		final Set<Role> ret = new HashSet<>();
		for (final String role: roles) {
			try {
				ret.add(Role.getRole(role));
			} catch (IllegalArgumentException e) {
				throw new IllegalParameterException(e.getMessage(), e);
			}
		}
		return ret;
	}

	private void noNulls(final List<String> l, final String message)
			throws IllegalParameterException {
		for (final String s: l) {
			if (s == null) {
				throw new IllegalParameterException(message);
			}
		}
	}

	@DELETE
	@Path(APIPaths.TESTMODE_CLEAR)
	public void clear() throws AuthStorageException {
		auth.testModeClear();
	}

	@GET
	@Path(APIPaths.TESTMODE_GLOBUS_TOKEN)
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, Object> getGlobusToken(
			@HeaderParam("x-globus-goauthtoken") final String xtoken,
			@HeaderParam("globus-goauthtoken") final String token,
			@QueryParam("grant_type") final String grantType)
			throws AuthStorageException, AuthException {

		return LegacyGlobus.getToken(
				(a, t) -> a.testModeGetToken(t), auth, xtoken, token, grantType);
	}

	// note does not return identity_id
	// note error structure is completely different
	@GET
	@Path(APIPaths.TESTMODE_GLOBUS_USER)
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, Object> getGlobusUser(
			@HeaderParam("x-globus-goauthtoken") final String xtoken,
			@HeaderParam("authorization") final String token,
			@PathParam("user") final String user)
			throws UnauthorizedException, AuthStorageException, NoSuchUserException,
				MissingParameterException, IllegalParameterException, TestModeException {

		return LegacyGlobus.getUser(
				(a, t, u) -> a.testModeGetUser(t, u), auth, xtoken, token, user);
	}

	@GET
	@Path(APIPaths.TESTMODE_KBASE_TOKEN)
	@Produces(MediaType.TEXT_HTML)
	public Response kbaseDummyGetMethod() {
		return new LegacyKBase(auth).dummyGetMethod();
	}

	@POST
	@Path(APIPaths.TESTMODE_KBASE_TOKEN)
	@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
	@Produces(MediaType.APPLICATION_JSON)
	public Map<String, Object> kbaseLogin(
			@Context final HttpHeaders headers,
			final MultivaluedMap<String, String> form)
			throws AuthStorageException, MissingParameterException, InvalidTokenException,
				DisabledUserException, TestModeException, NoSuchUserException {
		return LegacyKBase.kbaseLogin(
				auth,
				(a, t) -> a.testModeGetToken(t),
				(a, t) -> a.testModeGetUser(t),
				form,
				headers.getMediaType());
	}
}


text:
import os
import sys

def ldd(paths, processed=None):
    if not processed:
	processed = []
    for path in paths:
        new_ones = os.popen("ldd %s | sed '1,2d' | awk '{print $7}'" % path).read().split('\n')
        processed.append(path)

        for entry in new_ones:
            if entry in processed:
                continue
            if entry == "":
                continue
            ldd([entry], processed)
    return processed

print('\n'.join(sorted(ldd(sys.argv[1:]))))

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using SLNetworkComm;
using libsecondlife;

namespace SLeek
{
    public partial class IMTabWindow : UserControl
    {
        private SleekInstance instance;
        private SLNetCom netcom;
        private LLUUID target;
        private LLUUID session;
        private string toName;
        private IMTextManager textManager;
        private bool typing = false;

        public IMTabWindow(SleekInstance instance, LLUUID target, LLUUID session, string toName)
        {
            InitializeComponent();

            this.instance = instance;
            netcom = this.instance.Netcom;

            this.target = target;
            this.session = session;
            this.toName = toName;

            textManager = new IMTextManager(this.instance, new RichTextBoxPrinter(rtbIMText), this.session);
            this.Disposed += new EventHandler(IMTabWindow_Disposed);

            ApplyConfig(this.instance.Config.CurrentConfig);
            this.instance.Config.ConfigApplied += new EventHandler<ConfigAppliedEventArgs>(Config_ConfigApplied);
        }

        private void Config_ConfigApplied(object sender, ConfigAppliedEventArgs e)
        {
            ApplyConfig(e.AppliedConfig);
        }

        private void ApplyConfig(Config config)
        {
            if (config.InterfaceStyle == 0) //System
                toolStrip1.RenderMode = ToolStripRenderMode.System;
            else if (config.InterfaceStyle == 1) //Office 2003
                toolStrip1.RenderMode = ToolStripRenderMode.ManagerRenderMode;
        }

        private void AddNetcomEvents()
        {
            netcom.ClientLoginStatus += new EventHandler<ClientLoginEventArgs>(netcom_ClientLoginStatus);
            netcom.ClientDisconnected += new EventHandler<ClientDisconnectEventArgs>(netcom_ClientDisconnected);
        }

        private void netcom_ClientLoginStatus(object sender, ClientLoginEventArgs e)
        {
            if (e.Status != LoginStatus.Success) return;

            RefreshControls();
        }

        private void netcom_ClientDisconnected(object sender, ClientDisconnectEventArgs e)
        {
            RefreshControls();
        }

        private void IMTabWindow_Disposed(object sender, EventArgs e)
        {
            CleanUp();
        }

        public void CleanUp()
        {
            textManager.CleanUp();
            textManager = null;
        }

        private void btnSend_Click(object sender, EventArgs e)
        {
            netcom.SendInstantMessage(cbxInput.Text, target, session);
            this.ClearIMInput();
        }

        private void cbxInput_TextChanged(object sender, EventArgs e)
        {
            RefreshControls();
        }

        private void RefreshControls()
        {
            if (!netcom.IsLoggedIn)
            {
                cbxInput.Enabled = false;
                btnSend.Enabled = false;
                return;
            }

            if (cbxInput.Text.Length > 0)
            {
                btnSend.Enabled = true;

                if (!typing)
                {
                    netcom.SendIMStartTyping(target, session);
                    typing = true;
                }
            }
            else
            {
                btnSend.Enabled = false;
                netcom.SendIMStopTyping(target, session);
                typing = false;
            }
        }

        private void cbxInput_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.Enter) return;
            e.SuppressKeyPress = true;
            if (cbxInput.Text.Length == 0) return;

            netcom.SendInstantMessage(cbxInput.Text, target, session);
            this.ClearIMInput();
        }

        private void ClearIMInput()
        {
            cbxInput.Items.Add(cbxInput.Text);
            cbxInput.Text = string.Empty;
        }

        public void SelectIMInput()
        {
            cbxInput.Select();
        }

        private void rtbIMText_LinkClicked(object sender, LinkClickedEventArgs e)
        {
            if (e.LinkText.StartsWith("http://") || e.LinkText.StartsWith("ftp://"))
                System.Diagnostics.Process.Start(e.LinkText);
            else
                System.Diagnostics.Process.Start("http://" + e.LinkText);
        }

        private void tbtnProfile_Click(object sender, EventArgs e)
        {
            (new frmProfile(instance, toName, target)).Show();
        }

        private void cbxInput_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter) e.SuppressKeyPress = true;
        }

        public LLUUID TargetId
        {
            get { return target; }
            set { target = value; }
        }

        public string TargetName
        {
            get { return toName; }
            set { toName = value; }
        }

        public LLUUID SessionId
        {
            get { return session; }
            set { session = value; }
        }

        public IMTextManager TextManager
        {
            get { return textManager; }
            set { textManager = value; }
        }
    }
}


text:
import xml.dom.minidom

from xml.etree.ElementTree import Element, SubElement, tostring

class WorkflowXML(object):

    items = Element('items')

    def __init__(self):
        self.items = Element('items')

    def addItem(self, itemUid=u"", itemArg=u"", itemType=u"file",
                itemValid=u"yes", autocomplete=u"",
                title=u"", subtitle=u"", icon=u"", arg=u""):

        item = SubElement(self.items, 'item')

        # set the item attributes
        if itemUid != "":
            item.set("uid", itemUid)
        if itemArg != "":
            item.set("arg", itemArg)
        if itemType != "file":
            item.set("type", itemType)
        if itemValid != "yes":
            item.set("valid", itemValid)
        if autocomplete != "":
            item.set("autocomplete", autocomplete)

        # set item childs
        if title != "":
            _title = SubElement(item, 'title')
            _title.text = title
        if subtitle != "":
            _subtitle = SubElement(item, 'subtitle')
            _subtitle.text = subtitle
        if icon != "":
            _icon = SubElement(item, 'icon')
            _icon.text = icon
        if arg != "":
            _arg = SubElement(item, 'arg')
            _arg.text = arg

    def toPrettyString(self):
        s = tostring(self.items, 'utf-8')
        reparsedXml = xml.dom.minidom.parseString(s)
        prettyXmlString = reparsedXml.toprettyxml(indent='  ')
        return prettyXmlString

    def toString(self):
        s = tostring(self.items, 'utf-8')
        reparsedXml = xml.dom.minidom.parseString(s)
        xmlString = reparsedXml.toxml()
        return xmlString


text:
<?php

namespace DTS\eBaySDK\MerchantData\Types;

/**
 *
 * @property \DTS\eBaySDK\MerchantData\Types\TaxDetailsType[] $TaxDetails
 * @property \DTS\eBaySDK\MerchantData\Types\AmountType $TotalTaxAmount
 */
class TaxesType extends \DTS\eBaySDK\Types\BaseType
{
    /**
     * @var array Properties belonging to objects of this class.
     */
    private static $propertyTypes = array(
        'TaxDetails' => array(
            'type' => 'DTS\eBaySDK\MerchantData\Types\TaxDetailsType',
            'unbound' => true,
            'attribute' => false,
            'elementName' => 'TaxDetails'
        ),
        'TotalTaxAmount' => array(
            'type' => 'DTS\eBaySDK\MerchantData\Types\AmountType',
            'unbound' => false,
            'attribute' => false,
            'elementName' => 'TotalTaxAmount'
        )
    );

    /**
     * @param array $values Optional properties and values to assign to the object.
     */
    public function __construct(array $values = array())
    {
        list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);

        parent::__construct($parentValues);

        if (!array_key_exists(__CLASS__, self::$properties)) {
            self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
        }

        if (!array_key_exists(__CLASS__, self::$xmlNamespaces)) {
            self::$xmlNamespaces[__CLASS__] = 'urn:ebay:apis:eBLBaseComponents';
        }

        $this->setValues(__CLASS__, $childValues);
    }
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="Date-Revision-yyyymmdd" content="20150213" />
    <meta http-equiv="Content-Language" content="en" />
    <title>Play! 2.x Providers – Project Dependencies</title>
    <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.1.min.css" />
    <link rel="stylesheet" href="./css/site.css" />
    <link rel="stylesheet" href="./css/print.css" media="print" />

<link rel="stylesheet" type="text/css" href="./css/site.css"/>

Play! 2.x Providers

Last Published: 2015-02-13
                      |

Version: 1.0.0-beta1

Parent Project

        Play! 2.x

Modules

        Play! 2.x Provider for Play! 2.1.x

        Play! 2.x Provider for Play! 2.2.x

        Play! 2.x Provider for Play! 2.3.x

        Play! 2.x Provider for Play! 2.4.x

Project Documentation

        Project Information

            Dependencies

        Dependency Information

        Distribution Management

        About

        Issue Tracking

        Project License

        Project Modules

        Plugin Management

        Project Plugins

        Project Team

        Source Repository

        Project Summary

Project Dependencies

provided

The following is a list of provided dependencies for this project. These dependencies are required to compile the application, but should be provided by default when using the library:

GroupId
ArtifactId
Version
Type
License

com.google.code.play2-maven-plugin
play2-provider-api
1.0.0-beta1
jar
The Apache Software License, Version 2.0

org.codehaus.plexus
plexus-component-annotations
1.6
jar
The Apache Software License, Version 2.0

Project Transitive Dependencies

No transitive dependencies are required for this project.

Project Dependency Graph

Dependency Tree

com.google.code.play2-maven-plugin:play2-providers:pom:1.0.0-beta1

Play! 2.x Providers

Description: Play! 2.x Providers

URL: https://play2-maven-plugin.googlecode.com/svn/mavensite/1.0.0-beta1/play2-providers/

Project License: The Apache Software License, Version 2.0

com.google.code.play2-maven-plugin:play2-provider-api:jar:1.0.0-beta1 (provided)

Play! 2.x Provider API

Description: Play! 2.x Provider API

URL: https://play2-maven-plugin.googlecode.com/svn/mavensite/1.0.0-beta1/play2-provider-api/

Project License: The Apache Software License, Version 2.0

org.codehaus.plexus:plexus-component-annotations:jar:1.6 (provided)

Plexus :: Component Annotations

Description: Plexus Component "Java 5" Annotations, to describe plexus components properties in java sources with
    standard annotations instead of javadoc annotations.

URL: http://plexus.codehaus.org/plexus-containers/plexus-component-annotations/

Project License: The Apache Software License, Version 2.0

Licenses

The Apache Software License, Version 2.0: Play! 2.x Provider API, Play! 2.x Providers, Plexus :: Component Annotations

Dependency File Details

Filename
Size
Entries
Classes
Packages
Java Version
Debug Information

play2-provider-api-1.0.0-beta1.jar
11.76 kB
29
16
1
1.6
Yes

plexus-component-annotations-1.6.jar
4.26 kB
15
3
1
1.5
No

Total
Size
Entries
Classes
Packages
Java Version
Debug Information

2
16.03 kB
44
19
2
1.6
1

provided: 2
provided: 16.03 kB
provided: 44
provided: 19
provided: 2
-
provided: 1

Dependency Repository Locations

Repo ID
URL
Release
Snapshot

sonatype-nexus-snapshots
https://oss.sonatype.org/content/repositories/snapshots
No
Yes

central
https://repo.maven.apache.org/maven2
Yes
No

sonatype-play2-staging
https://oss.sonatype.org/content/repositories/comgooglecodeplay2-maven-plugin-1008/
Yes
No

Repository locations for each of the Dependencies.

Artifact
sonatype-nexus-snapshots
central
sonatype-play2-staging

com.google.code.play2-maven-plugin:play2-provider-api:jar:1.0.0-beta1
-
-

org.codehaus.plexus:plexus-component-annotations:jar:1.6
-

-

Total
sonatype-nexus-snapshots
central
sonatype-play2-staging

2 (provided: 2)
0
1
1

Copyright ©                   2013–2015.
          All rights reserved.


text:
package framework

import (
	"fmt"
	"io/ioutil"
	"os"
	"path"
	"reflect"
	"strings"
	"sync"

	"istio.io/istio/pkg/test/framework/components/environment/api"
	"istio.io/istio/pkg/test/framework/core"
	"istio.io/istio/pkg/test/framework/label"
	"istio.io/istio/pkg/test/framework/resource"
	"istio.io/istio/pkg/test/scopes"
)

// suiteContext contains suite-level items used during runtime.
type SuiteContext interface {
	resource.Context
}

var _ SuiteContext = &suiteContext{}

// suiteContext contains suite-level items used during runtime.
type suiteContext struct {
	settings    *core.Settings
	environment resource.Environment

	workDir string

	// context-level resources
	globalScope *scope

	contextMu    sync.Mutex
	contextNames map[string]struct{}

	suiteLabels label.Set
}

func newSuiteContext(s *core.Settings, envFn api.FactoryFn, labels label.Set) (*suiteContext, error) {
	scopeID := fmt.Sprintf("[suite(%s)]", s.TestID)

	workDir := path.Join(s.RunDir(), "_suite_context")
	if err := os.MkdirAll(workDir, os.ModePerm); err != nil {
		return nil, err
	}
	c := &suiteContext{
		settings:     s,
		globalScope:  newScope(scopeID, nil),
		workDir:      workDir,
		suiteLabels:  labels,
		contextNames: make(map[string]struct{}),
	}

	env, err := envFn(s.Environment, c)
	if err != nil {
		return nil, err
	}
	c.environment = env
	c.globalScope.add(env, &resourceID{id: scopeID})

	return c, nil
}

// allocateContextID allocates a unique context id for TestContexts. Useful for creating unique names to help with
// debugging
func (s *suiteContext) allocateContextID(prefix string) string {
	s.contextMu.Lock()
	defer s.contextMu.Unlock()

	candidate := prefix
	discriminator := 0
	for {
		if _, found := s.contextNames[candidate]; !found {
			s.contextNames[candidate] = struct{}{}
			return candidate
		}

		candidate = fmt.Sprintf("%s-%d", prefix, discriminator)
		discriminator++
	}
}

func (s *suiteContext) allocateResourceID(contextID string, r resource.Resource) string {
	s.contextMu.Lock()
	defer s.contextMu.Unlock()

	t := reflect.TypeOf(r)
	candidate := fmt.Sprintf("%s/[%s]", contextID, t.String())
	discriminator := 0
	for {
		if _, found := s.contextNames[candidate]; !found {
			s.contextNames[candidate] = struct{}{}
			return candidate
		}

		candidate = fmt.Sprintf("%s/[%s-%d]", contextID, t.String(), discriminator)
		discriminator++
	}
}

// TrackResource adds a new resource to track to the context at this level.
func (s *suiteContext) TrackResource(r resource.Resource) resource.ID {
	id := s.allocateResourceID(s.globalScope.id, r)
	rid := &resourceID{id: id}
	s.globalScope.add(r, rid)
	return rid
}

// Environment implements ResourceContext
func (s *suiteContext) Environment() resource.Environment {
	return s.environment
}

// Settings returns the current runtime.Settings.
func (s *suiteContext) Settings() *core.Settings {
	return s.settings
}

// CreateDirectory creates a new subdirectory within this context.
func (s *suiteContext) CreateDirectory(name string) (string, error) {
	dir, err := ioutil.TempDir(s.workDir, name)
	if err != nil {
		scopes.Framework.Errorf("Error creating temp dir: runID='%s', prefix='%s', workDir='%v', err='%v'",
			s.settings.RunID, name, s.workDir, err)
	} else {
		scopes.Framework.Debugf("Created a temp dir: runID='%s', name='%s'", s.settings.RunID, dir)
	}
	return dir, err
}

// CreateTmpDirectory creates a new temporary directory with the given prefix.
func (s *suiteContext) CreateTmpDirectory(prefix string) (string, error) {
	if len(prefix) != 0 && !strings.HasSuffix(prefix, "-") {
		prefix += "-"
	}

	dir, err := ioutil.TempDir(s.workDir, prefix)
	if err != nil {
		scopes.Framework.Errorf("Error creating temp dir: runID='%s', prefix='%s', workDir='%v', err='%v'",
			s.settings.RunID, prefix, s.workDir, err)
	} else {
		scopes.Framework.Debugf("Created a temp dir: runID='%s', name='%s'", s.settings.RunID, dir)
	}

	return dir, err
}


text:
using System;
using System.Net;
using System.Threading;
using System.Threading.Tasks;

namespace ATTM2X
{

	///
	/// Wrapper for AT&T M2X Trigger API
	///
	public sealed class M2XTrigger : M2XClass
	{
		public const string UrlPath = "/triggers";

		public readonly string TriggerId;
		public readonly M2XDevice Device;
		public readonly M2XDistribution Distribution;

		private M2XTrigger(M2XClient client, string triggerId)
			: base(client)
		{
			if (String.IsNullOrWhiteSpace(triggerId))
				throw new ArgumentException(String.Format("Invalid triggerId - {0}", triggerId));

			this.TriggerId = triggerId;
		}
		internal M2XTrigger(M2XDevice device, string streamName)
			: this(device.Client, streamName)
		{
			this.Device = device;
		}
		internal M2XTrigger(M2XDistribution distribution, string streamName)
			: this(distribution.Client, streamName)
		{
			this.Distribution = distribution;
		}

		internal override string BuildPath(string path)
		{
			path = String.Concat(M2XTrigger.UrlPath, "/", WebUtility.UrlEncode(this.TriggerId), path);
			return this.Device == null
				? this.Distribution.BuildPath(path)
				: this.Device.BuildPath(path);
		}

		///
		/// Method for Test Trigger endpoint
		///
		/// <param name="parms">Query parameters passed as keyword arguments. View M2X API Docs for listing of available parameters</param>
		/// <returns>M2XResponse - The API response, see M2X API docs for details</returns>
		public Task<M2XResponse> Test(object parms)
		{
			return MakeRequest("/test", M2XClientMethod.POST, parms);
		}

		///
		/// Method for Test Trigger endpoint
		///
		/// <param name="cancellationToken">CancellationToken</param>
		/// <param name="parms">Query parameters passed as keyword arguments. View M2X API Docs for listing of available parameters</param>
		/// <returns>M2XResponse - The API response, see M2X API docs for details</returns>
		public Task<M2XResponse> Test(CancellationToken cancellationToken, object parms)
		{
			return MakeRequest(cancellationToken, "/test", M2XClientMethod.POST, parms);
		}
	}
}


text:
Electron Release Server has a `Dockerfile` and a `docker-compose.yml`file.
So, you can use [docker](https://www.docker.com/) and [docker-compose](https://github.com/docker/compose).

## Requirements

Install [docker](https://www.docker.com/) and [docker-compose](https://github.com/docker/compose).

## Localserver

```bash
docker-compose up -d
# open localhost:5000 in browser
```

If you use [docker-machine](https://github.com/docker/machine) you should change
`APP_URL` at `docker-compose.yml` to address to your docker-machine.

## Configurations

To run the single container provide the next environment variables:

- `APP_USERNAME`, `APP_PASSWORD` – static username and password for authentication ref.
- `DB_HOST` – hostname of postgres
- `DB_PORT` – port of postgres
- `DB_USERNAME`, `DB_PASSWORD` – credentials to access postgres
- `DB_NAME` – Database name
- `TOKEN_SECRET` – Recommended: 63 random alpha-numeric characters
- `APP_URL` - base url for the app - [ref](http://sailsjs.org/documentation/reference/application/sails-get-base-url)

To use `production.js` set `NODE_ENV` to `"production"` – so you should not set the environment variables:
`APP_USERNAME`, `APP_PASSWORD`, `DB_HOST`, `DB_PORT`,
`DB_USERNAME`, `DB_PASSWORD`, `DB_NAME`, `TOKEN_SECRET`.

**Warning**: You can insert the `TOKEN_SECRET`, `APP_PASSWORD`, `DB_PASSWORD` directly into the `docker-compose.yml`, but keep your secrets and private information in private. The production secrets must not be committed publicly!

## How to run

Firstly you should start with development setting to run database migration.

After it you should `always` run in production mode – set `NODE_ENV` to `"production"`.


text:
<?php

define('__VERSION__', '0.1.1');

/**
 * Load composer.
 */
require_once __DIR__.'/../vendor/autoload.php';

/*
 * Load Configuration
 */
$dotenv = new Dotenv\Dotenv(__DIR__.'/../');
$dotenv->load();

/*
 * Initialize slim
 */
$app = new \Slim\Slim();

/*
 * Load services
 */
$services = require_once __DIR__.'/services.php';

/**
 * Load Bootstrap.
 */
require_once __DIR__.'/bootstrap.php';

/*
 * Setup default routes
 */
$app->get('/', 'App\Controllers\Controller:getHello');
$app->get('/health', 'App\Controllers\Controller:getHealth');
/*
 * Start slim
 */
$app->run();


text:
//==============================================================================
//         Copyright 2003 - 2012   LASMEA UMR 6602 CNRS/Univ. Clermont II
//         Copyright 2009 - 2012   LRI    UMR 8623 CNRS/Univ Paris Sud XI
//
//          Distributed under the Boost Software License, Version 1.0.
//                 See accompanying file LICENSE.txt or copy at
//                     http://www.boost.org/LICENSE_1_0.txt
//==============================================================================
#ifndef BOOST_SIMD_IEEE_FUNCTIONS_BITOFSIGN_HPP_INCLUDED
#define BOOST_SIMD_IEEE_FUNCTIONS_BITOFSIGN_HPP_INCLUDED
#include <boost/simd/include/functor.hpp>
#include <boost/dispatch/include/functor.hpp>

namespace boost { namespace simd { namespace tag
  {
   /*!
     @brief bitofsign generic tag

     Represents the bitofsign function in generic contexts.

     @par Models:
        Hierarchy
   **/
    struct bitofsign_ : ext::elementwise_<bitofsign_>
    {
      /// @brief Parent hierarchy
      typedef ext::elementwise_<bitofsign_> parent;
    };
  }
  /*!
    Returns a value of the same type as the input
    with all bits set to zero
    except the bit of sign which is preserved.
    Returns always zero for unsigned types

    @par Semantic:

    @code
    T r = bitofsign(a0);
    @endcode

    for signed types is similar to:

    @code
    T r = a0&SignMask;
    @endcode

    @see @funcref{sign}, @funcref{signnz}
    @param a0

    @return a value of same type as the input
  **/
  BOOST_DISPATCH_FUNCTION_IMPLEMENTATION(tag::bitofsign_, bitofsign, 1)
} }

#endif


text:
<ion-view view-title="Hiztegiak" style="margin-left:3px">
    <ion-content>

                        <input type="text" placeholder="Hizta" ng-model="hizta" ng-change="change()">

                            <input type="checkbox" ng-model=toggleValue ng-change="toggleAction()">

                    <button class="button button-small button-positive" ng-click="search()" ng-hide=searching>
                        {{euskEs}}
                    </button>

                    <ion-spinner icon="bubbles" ng-show=searching></ion-spinner>

                    {{hizta}}

{{elem}}

                    Ejemplos

{{elem.euskera}}

{{elem.gaztelania}}

    </ion-content>
</ion-view>


text:
class CouponFirstPurchaseValue < CouponValue
  include CouponFirstPurchase
end


text:
/**
 * Created by Matuszewski on 03/02/16.
 */
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var path = require('path');
require('dotenv').config();

module.exports = function(app, dir){
  // view engine setup
  app.set('views', path.join(dir, 'views'));
  app.set('view engine', 'jade');

// uncomment after placing your favicon in /public
//app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
  app.use(logger('dev'));
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(cookieParser());
}


text:
package org.apache.helix.manager.zk;

import java.util.HashMap;
import java.util.Map;
import java.util.Random;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.apache.helix.zookeeper.datamodel.ZNRecord;
import org.testng.Assert;
import org.testng.annotations.Test;

public class TestZNRecordStreamingSerializer {
  /**
   * Test the normal case of serialize/deserialize where ZNRecord is well-formed
   */
  @Test
  public void basicTest() {
    ZNRecord record = new ZNRecord("testId");
    record.setMapField("k1", ImmutableMap.of("a", "b", "c", "d"));
    record.setMapField("k2", ImmutableMap.of("e", "f", "g", "h"));
    record.setListField("k3", ImmutableList.of("a", "b", "c", "d"));
    record.setListField("k4", ImmutableList.of("d", "e", "f", "g"));
    record.setSimpleField("k5", "a");
    record.setSimpleField("k5", "b");
    ZNRecordStreamingSerializer serializer = new ZNRecordStreamingSerializer();
    ZNRecord result = (ZNRecord) serializer.deserialize(serializer.serialize(record));
    Assert.assertEquals(result, record);
  }

  // TODO: need to fix ZnRecordStreamingSerializer before enabling this test.
  @Test (enabled = false)
  public void testNullFields() {
    ZNRecord record = new ZNRecord("testId");
    record.setMapField("K1", null);
    record.setListField("k2", null);
    record.setSimpleField("k3", null);
    ZNRecordStreamingSerializer serializer = new ZNRecordStreamingSerializer();
    byte [] data = serializer.serialize(record);
    ZNRecord result = (ZNRecord) serializer.deserialize(data);

    Assert.assertEquals(result, record);
    Assert.assertNull(result.getMapField("K1"));
    Assert.assertNull(result.getListField("K2"));
    Assert.assertNull(result.getSimpleField("K3"));
    Assert.assertNull(result.getListField("K4"));
  }

  /**
   * Check that the ZNRecord is not constructed if there is no id in the json
   */
  @Test
  public void noIdTest() {
    StringBuilder jsonString =
        new StringBuilder("{\n").append("  \"simpleFields\": {},\n")
            .append("  \"listFields\": {},\n").append("  \"mapFields\": {}\n").append("}\n");
    ZNRecordStreamingSerializer serializer = new ZNRecordStreamingSerializer();
    ZNRecord result = (ZNRecord) serializer.deserialize(jsonString.toString().getBytes());
    Assert.assertNull(result);
  }

  /**
   * Test that the json still deserizalizes correctly if id is not first
   */
  @Test
  public void idNotFirstTest() {
    StringBuilder jsonString =
        new StringBuilder("{\n").append("  \"simpleFields\": {},\n")
            .append("  \"listFields\": {},\n").append("  \"mapFields\": {},\n")
            .append("\"id\": \"myId\"\n").append("}");
    ZNRecordStreamingSerializer serializer = new ZNRecordStreamingSerializer();
    ZNRecord result = (ZNRecord) serializer.deserialize(jsonString.toString().getBytes());
    Assert.assertNotNull(result);
    Assert.assertEquals(result.getId(), "myId");
  }

  /**
   * Test that simple, list, and map fields are initialized as empty even when not in json
   */
  @Test
  public void fieldAutoInitTest() {
    StringBuilder jsonString = new StringBuilder("{\n").append("\"id\": \"myId\"\n").append("}");
    ZNRecordStreamingSerializer serializer = new ZNRecordStreamingSerializer();
    ZNRecord result = (ZNRecord) serializer.deserialize(jsonString.toString().getBytes());
    Assert.assertNotNull(result);
    Assert.assertEquals(result.getId(), "myId");
    Assert.assertNotNull(result.getSimpleFields());
    Assert.assertTrue(result.getSimpleFields().isEmpty());
    Assert.assertNotNull(result.getListFields());
    Assert.assertTrue(result.getListFields().isEmpty());
    Assert.assertNotNull(result.getMapFields());
    Assert.assertTrue(result.getMapFields().isEmpty());
  }
  @Test
  public void testBasicCompression() {
    ZNRecord record = new ZNRecord("testId");
    int numPartitions = 1024;
    int replicas = 3;
    int numNodes = 100;
    Random random = new Random();
    for (int p = 0; p < numPartitions; p++) {
      Map<String, String> map = new HashMap<String, String>();
      for (int r = 0; r < replicas; r++) {
        map.put("host_" + random.nextInt(numNodes), "ONLINE");
      }
      record.setMapField("TestResource_" + p, map);
    }
    ZNRecordStreamingSerializer serializer = new ZNRecordStreamingSerializer();
    byte[] serializedBytes;
    serializedBytes = serializer.serialize(record);
    int uncompressedSize = serializedBytes.length;
    System.out.println("raw serialized data length = " + serializedBytes.length);
    record.setSimpleField("enableCompression", "true");
    serializedBytes = serializer.serialize(record);
    int compressedSize = serializedBytes.length;
    System.out.println("compressed serialized data length = " + serializedBytes.length);
    System.out.printf("compression ratio: %.2f \n", (uncompressedSize * 1.0 / compressedSize));
    ZNRecord result = (ZNRecord) serializer.deserialize(serializedBytes);
    Assert.assertEquals(result, record);
  }

  @Test
  public void testCompression() {
    int runId = 1;
    while (runId < 20) {
      int numPartitions = runId * 1000;
      int replicas = 3;
      int numNodes = 100;
      Random random = new Random();
      ZNRecord record = new ZNRecord("testId");
      System.out.println("Partitions:" + numPartitions);
      for (int p = 0; p < numPartitions; p++) {
        Map<String, String> map = new HashMap<String, String>();
        for (int r = 0; r < replicas; r++) {
          map.put("host_" + random.nextInt(numNodes), "ONLINE");
        }
        record.setMapField("TestResource_" + p, map);
      }
      ZNRecordStreamingSerializer serializer = new ZNRecordStreamingSerializer();
      byte[] serializedBytes;
      record.setSimpleField("enableCompression", "true");
      serializedBytes = serializer.serialize(record);
      int compressedSize = serializedBytes.length;
      System.out.println("compressed serialized data length = " + compressedSize);
      ZNRecord result = (ZNRecord) serializer.deserialize(serializedBytes);
      Assert.assertEquals(result, record);
      runId = runId + 1;
    }
  }
}


text:
.class Landroid/support/v4/print/PrintHelper$PrintHelperKitkatImpl$1;
.super Ljava/lang/Object;
.source "PrintHelper.java"

# interfaces
.implements Landroid/support/v4/print/PrintHelperKitkat$OnPrintFinishCallback;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Landroid/support/v4/print/PrintHelper$PrintHelperKitkatImpl;->printBitmap(Ljava/lang/String;Landroid/graphics/Bitmap;Landroid/support/v4/print/PrintHelper$OnPrintFinishCallback;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Landroid/support/v4/print/PrintHelper$PrintHelperKitkatImpl;

.field final synthetic val$callback:Landroid/support/v4/print/PrintHelper$OnPrintFinishCallback;

# direct methods
.method constructor <init>(Landroid/support/v4/print/PrintHelper$PrintHelperKitkatImpl;Landroid/support/v4/print/PrintHelper$OnPrintFinishCallback;)V
    .locals 0

    .prologue
    .line 198
    iput-object p1, p0, Landroid/support/v4/print/PrintHelper$PrintHelperKitkatImpl$1;->this$0:Landroid/support/v4/print/PrintHelper$PrintHelperKitkatImpl;

    iput-object p2, p0, Landroid/support/v4/print/PrintHelper$PrintHelperKitkatImpl$1;->val$callback:Landroid/support/v4/print/PrintHelper$OnPrintFinishCallback;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public onFinish()V
    .locals 1

    .prologue
    .line 201
    iget-object v0, p0, Landroid/support/v4/print/PrintHelper$PrintHelperKitkatImpl$1;->val$callback:Landroid/support/v4/print/PrintHelper$OnPrintFinishCallback;

    invoke-interface {v0}, Landroid/support/v4/print/PrintHelper$OnPrintFinishCallback;->onFinish()V

    .line 202
    return-void
.end method


text:
require "models/arunit2_model"
require "active_support/core_ext/object/with_options"

class College < ARUnit2Model
  has_many :courses

  with_options dependent: :destroy do |assoc|
    assoc.has_many :students, -> { where(active: true) }
  end
end


text:
package com.voudeonibus.models.api;

import java.util.Date;

import io.realm.RealmObject;

public class CategoryTime extends RealmObject {

    private Date date;

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }
}


text:
// Gulp setup for Start Here front end boilerplate

// Load required plugins
var gulp = require('gulp'),
    sass = require('gulp-ruby-sass'),
    autoprefixer = require('gulp-autoprefixer'),
    minifycss = require('gulp-minify-css'),
    jshint = require('gulp-jshint'),
    uglify = require('gulp-uglify'),
    rename = require('gulp-rename'),
    runSequence  = require('run-sequence'),
    imagemin = require('gulp-imagemin'),
    concat = require('gulp-concat'),
    browserSync = require('browser-sync').create(),
    svgstore = require('gulp-svgstore'),
    svgmin = require('gulp-svgmin'),
    svg2png = require('gulp-svg2png')

// File path vars
var paths = {
    scssSrc: 'scss/**/*.scss',
    imgSrc: 'images/**/*',
    svgSrc: 'svgs/*.svg'
}

// Setup browsersync
gulp.task('browser-sync', function() {
    browserSync.init({
        proxy: "barefootfunk.static"
    });
});

// Do the stuff!

// Sass compilation and output
gulp.task('styles', function() {
  return sass('scss/main.scss', { style: 'expanded' })
    .pipe(autoprefixer())
    .pipe(gulp.dest('css-compiled'))
    .pipe(rename({suffix: '.min'}))
    .pipe(minifycss())
    .pipe(gulp.dest('css-compiled'))
    .pipe(browserSync.stream());
});

// Javascript concatenation
// gulp.task('scripts', function() {
//   return gulp.src(['js/libs/*.js', 'js/main.js'])
//     .pipe(jshint())
//     .pipe(jshint.reporter('default'))
//     .pipe(concat('site.js'))
//     .pipe(gulp.dest('js/build'))
//     .pipe(rename({suffix: '.min'}))
//     .pipe(uglify())
//     .pipe(gulp.dest('js/build'))
//     .pipe(browserSync.stream());
// });

// Compress images (must run glulp images manually)
gulp.task('images', function() {
  return gulp.src(paths.imgSrc)
    .pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
    .pipe(gulp.dest('images'))
    .pipe(browserSync.stream());
});

// SVG time!
gulp.task('svgs', function() {
  return gulp.src(paths.svgSrc)
    .pipe(svgmin({
        plugins: [{
            removeViewBox: false
        }, {
            removeEmptyAttrs: false
        }]
    }))
    .pipe(gulp.dest('svgs'))
    .pipe(svgstore({ inlineSvg: true }))
    .pipe(rename({suffix: '-defs'}))
    .pipe(gulp.dest('svgs/build'))
    .pipe(browserSync.stream());
});
// convert to png for fallback
// gulp.task('svgfallback', function() {
//   return gulp.src(paths.svgSrc)
//     .pipe(svg2png())
//     .pipe(gulp.dest('images'));
// });

// Do the build
gulp.task('build', function(callback) {
  runSequence('styles',
              // 'svgs',
              // 'scripts',
              ['images', 'svgs'],// 'svgfallback'],
              callback
              );
});

// Gulp watch
gulp.task('watch', function() {
  // Init BrowserSync
  browserSync.init({
    files: ['*.html', '*.php'],
    proxy: 'barefootfunk.static',
    notify: false,
  });
  // Kick it off with a build
  gulp.start('build');
  // Watch sass files
  gulp.watch(paths.scssSrc, ['styles']);
  // // Watch js files
  // gulp.watch(['js/libs/*.js', 'js/main.js'], ['scripts']);
  // // Watch SVGs
  gulp.watch(paths.svgSrc, ['svgs']); //, 'svgfallback']);
});

// Make build the default task
gulp.task('default', function() {
    gulp.start('build');
});


text:
import { Component, Input, OnChanges } from "@angular/core";

@Component({
  selector: "ch-counter-spinner",
  templateUrl: "./counter-spinner.component.html",
  styleUrls: ["./counter-spinner.component.less"],
})
export class CounterSpinnerComponent implements OnChanges {
  @Input() count: number;

  offsetRight = 12;
  offsetTop = 5;
  fontSize = 17;

  constructor() {}

  ngOnChanges() {
    if (this.count.toString().length === 2) {
      this.offsetRight = 7;
      this.offsetTop = 5;
      this.fontSize = 17;
    } else if (this.count.toString().length > 2) {
      this.offsetRight = 8;
      this.offsetTop = 10;
      this.fontSize = 10;
    } else {
      this.offsetRight = 12;
      this.offsetTop = 5;
      this.fontSize = 17;
    }
  }
}


text:
package dev.nincodedo.ninbot.common.persistence;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.Embeddable;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Transient;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Embeddable
public class AuditMetadata {
    @CreatedBy
    private String createdBy;
    @CreatedDate
    private LocalDateTime createdDateTime;
    @LastModifiedBy
    private String modifiedBy;
    @LastModifiedDate
    private LocalDateTime modifiedDateTime;

    @PrePersist
    private void prePersist() {
        createdDateTime = LocalDateTime.now();
    }

    @PreUpdate
    private void preUpdate() {
        modifiedDateTime = LocalDateTime.now();
    }

    @Transient
    public void setCreatedModifiedBy(String userId) {
        if (createdBy == null) {
            createdBy = userId;
        } else {
            modifiedBy = userId;
        }
    }
}


text:
Report view
===========

The generated HTML report view presents three different tabs: a *diagram* tab,
a *measure logs* tab and a *source code* tab. For the purpose of this guide,
we will concentrate ourselves on the main tab, the *diagram* tab.

The diagram tab can be split up in 6 logical regions: tabs, filters, actors,
conversations, transactions and details. With the exception of the tab bar, the
other 5 regions are described in detail in the following subsections.

Filters
-------

.. figure:: /assets/region-filters.*
   :align: center
   :figclass: align-left
   :width: 200pt

   Diagram view with the *filters* region highlighted.

The filter bar allows to trigger different visualization modes of the different
transactions, by including or excluding one or more transactions based on some
criteria or by rendering a logical group of transactions differently.

The available filters and renderers are:

Display mode
   Triggers the visualization of transactions based on their TCP flags.
   Possible values are *all* to display all transactions, *hide ACK-only* to
   show all transactions but they with only the ``ACK`` flag set,
   *smart SYN/FIN* to group transactions belonging to the same three way
   handshake (or the same ``FIN`` sequence) into one and rendering it
   appropriately or *PSH only* to display only transactions containing actual
   POP method calls or responses.

Conversations filter
   A simple filter allowing to select or deselect visible conversations.

BindStatus display mode
   Triggers the visualization of ``BindStatus`` calls and responses. Possible
   values are *normal* to display them as normal transactions, *smart* to group
   them into a single transaction and render it appropriately or *hide* to
   completely hide any ``BindStatus`` related transaction.

Hide/show all details
   A simple switch to either hide all transaction details or to show them all.

Actors
------

.. figure:: /assets/region-actors.*
   :align: center
   :figclass: align-left
   :width: 200pt

   Diagram view with the *actors* region highlighted.

The actors region displays the different IP addresses and ports bound to each
conversation. When hovering a transaction, the two peers are automatically
highlighted.

This highlight mode can be fixed by clicking on a node and reset by clicking a
second time.

Additionally it is possible to hide or show all conversations from/to a given
actor or by clicking on it by keeping the ``alt`` or, respectively, the
``meta`` key respectively pressed.

Conversations
-------------

.. figure:: /assets/region-conversations.*
   :align: center
   :figclass: align-left
   :width: 200pt

   Diagram view with the *conversations* region highlighted.

The conversations region simply indicates for each transaction to which
conversation it belongs to. A conversation is simply the set of all
transactions which where transmitted on the same TCP connection.

The conversations are numbered, starting at zero, from the oldest to the
youngest and their number corresponds to the number displayed in the
*Conversations filter* too.

Transactions
------------

.. figure:: /assets/region-transactions.*
   :align: center
   :figclass: align-left
   :width: 200pt

   Diagram view with the *transactions* region highlighted.

This region displays from which actor to which actor a transaction happened
and, if the respective smart display filters are active, renders SYN/FIN and
BindStatus requests accordingly.

When overing a transaction, its bounds are automatically highlights in the same
way as it was for the actors above.

Details
-------

.. figure:: /assets/region-details.*
   :align: center
   :figclass: align-left
   :width: 200pt

   Diagram view with the *details* region highlighted.

This region is the most interesting and informational of the entire report.

It provides details such as TCP flags, POP invocation semantics, transaction
type, called object and method, passed arguments,... simply click on the
corresponding row to expand it and show all details of the transaction.

An example of expanded transaction details is displayed in the figure below;
the different parts composing it are explained in deeper detail after the
screenshot.

.. figure:: /assets/transaction-details.*
   :align: center
   :figclass: align-left clear

   Expanded details region for a single transaction.

Starting at the top-left corner, we are presented with the TCP flags which were
set for this transaction; possible values are ``ACK``, ``SYN``, ``PSH`` and
``FIN``.

Just after them, on the right, the transaction type; possible values are ``→``
for a method call, ``<-`` for a reply and ``×`` for an exception.

The next flags group, in green, represents the POP call semantics; possible
values for them are the well known ``SYNC``, ``ASYNC``, ``CONC``, ``SEQ``,
``MTX`` (for mutex) and ``CONSTRUCT`` (for constructor calls).

The rest of the line is dedicated to a short representation of the method call,
including class name, method name and the arguments if they are not too long
to be represented.

On the following line, inside the *decoded frame* field, the full decoded and
highlighted request is represented.

The original payload shows the hex encoded original content of the payload as
it was captured by ``tshark``.

The last line only remembers, in a textual way, the two involved actors with
the respective IP addresses and port numbers.

Other tabs
----------

Other two tabs are available in the tab bar, and although not providing as much
information as the diagram view, they can provide some useful insight in the
measure constructions, especially for a third party person watching at the
report for the first time.

Both views are file browsers but for two different file type groups:

Logs view
   This view groups all collected log files relative to this specific measure
   and presents them in a simple to use file browser with no additional
   syntax highlighting.

Source code view
   This view groups all source code files found in the original measure case
   folder and provides syntax highlighting for the different file types such as
   makefiles, POP-C++ headers, C++ source code,...


text:
//
//  Main.cpp
//  Annexation
//
//
//  0.1.0.170620_base         basic construction of the system
//  0.2.0.170620_base         basic implementation of the system in C#
//  0.2.1.170621_base         some alternatives applied on file operation
//  0.3.0.170621_base         reconstructed system with C++
//  0.3.1.170622_base         removed pointer operation of entity classes
//  0.3.2.170622_base         reconstructed entity classes' hierachy
//  0.3.3.170622_base         changed linked list mapping method to hash mapping
//  0.3.4.170623_alpha        many internal bugs fixed and basic system implemented, alpha version reached
//  0.3.5.170624_alpha        patches on file editing
//  1.0.0.170624_beta         initial gui added, beta version reached
//  1.0.1.170624_beta         some modifications were applied to gui
//  1.0.2.170624_beta         specific modifications of gui were applied
//  1.1.0.170625_beta         specific modifications of gui were applied
//  1.2.0.170625_beta         auto layout added
//  1.2.0.170625_beta patch 1 auto layout implemented
//  1.2.1.170625_beta patch 2 more bugs fixed
//  1.2.2.170625_beta         critical bugs fixed
//  1.2.3.170625_beta         prime bug fixed: corrected method of size calculation
//  1.3.0.170625_beta         final submission
//
//
//  Created by Emoin Lam on 22/06/2017.
//  Copyright © 2017 Emoin Lam. All rights reserved.
//

#include "AnnexationForm.h"
#include "FileSystem.h"
#include <cstdio>
#include <iostream>
using namespace Annexation;
using namespace System;
using namespace System::Windows::Forms;

[STAThread]
void Main(array<String^>^ args)
{
	Application::EnableVisualStyles();
	Application::SetCompatibleTextRenderingDefault(false);

	Annexation::AnnexationForm form;
	Application::Run(%form);
	System::Environment::Exit(0);
}


text:
var logger = require('./logger');

try {
  module.exports = require('bindings')('native.node');
} catch (err) {
  logger.error(err.message);
  process.exit(1);
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<plugin>

  <extension point="org.blueberry.ui.views">
    <view id="org.mitk.views.matchpoint.algorithm.control"
          name="MatchPoint Algorithm Control"
          class="QmitkMatchPoint"
		  category="Registration"
          icon="resources/icon.svg" />
  </extension>

</plugin>


text:
var ngOpbeat = require('./ngOpbeat')
var patchAngularBootstrap = require('./patches/bootstrapPatch')
var patchCommon = require('opbeat-js-core').patchCommon

function initialize (serviceFactory) {
  var serviceContainer = serviceFactory.getPerformanceServiceContainer()
  var services = serviceContainer.services
  if (!services.configService.isPlatformSupported()) {
    services.logger.warn('Platform is not supported.')
  } else {
    serviceContainer.initialize()
  }

  var alreadyRegistered = false
  patchCommon(serviceContainer)

  function noop () {}
  services['angularInitializer'] = {
    afterBootstrap: noop,
    beforeBootstrap: noop
  }

  function beforeBootstrap (modules) {
    services['angularInitializer'].beforeBootstrap()
  }

  function afterBootstrap () {
    services['angularInitializer'].afterBootstrap()
  }

  function opbeatBootstrap (fn, applyThis, applyArgs) {
    if (!alreadyRegistered) {
      alreadyRegistered = registerOpbeatModule(services)
    }
    var result
    if (services.configService.isPlatformSupported()) {
      beforeBootstrap()
      result = services.zoneService.runInOpbeatZone(fn, applyThis, applyArgs, 'angular:bootstrap')
      afterBootstrap()
    } else {
      result = fn.apply(applyThis, applyArgs)
    }
    return result
  }

  services.exceptionHandler = serviceFactory.getExceptionHandler()
  services.exceptionHandler.install()
  alreadyRegistered = registerOpbeatModule(services)
  patchAngularBootstrap(opbeatBootstrap)
}

function registerOpbeatModule (services) {
  return ngOpbeat(services)
}

module.exports = initialize


text:
var HtmlWidget = Base.extend({
    constructor: function(width, height, options) {
        this.width = width;
        this.height = height;
        this.options = options || {};
        this.box = $("<div>").attr("class", "html-widget").css({
            "width": this.width + "px",
            "height": this.height + "px"
        });
        this.setPosition(0,0);
        this.initialize(options);
        if("class" in options) {
            this.addClass(options.class)
        }
         $("#html-widgets").append(this.box);
    },
    addClass: function(cls) {
        this.box.addClass(cls);
    },
    removeClass: function(cls) {
        this.box.removeClass(cls);
    },
    setPosition: function(x, y) {
        this.x = x;
        this.y = y;
        this.box.css({"left":x+"px", "top": y+"px"});
    },
    initialize: function() {
        // override in subclasses...
        this.box.css({"background-color": "red"});
    }
});

var HtmlLabelWidget = HtmlWidget.extend({
    constructor: function(width, height, options, text) {
        console.log("Creating label widget");
        this.base(width, height, options);
        this.setText(text);
        this.box.addClass("html-label-widget");
   },

    initialize: function() {
        var self = this;
        this.body  = $("<div>");
        var style = {
            "width": this.width+"px",
            "height": this.height+"px",
            "text-align": "center"};
        if(this.options.backgroundColor) {
            style["background-color"] = this.options.backgroundColor;
        }
        this.body.css(style);
        this.box.html(this.body);
    },
    setText: function(text) {
        this.text = text;
        this.body.text(text);
    }
});

var HtmlImageWidget = HtmlWidget.extend({
    constructor: function(width, height, options, src) {
        console.log("Creating image widget");
        this.src = src;
        this.base(width, height, options);
        this.box.addClass("html-image-widget");
   },

    initialize: function() {
        var self = this;
        this.body = $('<img src="' + this.src + '"/>');
        var style = {
            "width": this.width+"px",
            "height": this.height+"px",
            "text-align": "center"};
        if(this.options.backgroundColor) {
            style["background-color"] = this.options.backgroundColor;
        }
        this.body.css(style);
        this.box.html(this.body);
    }
});

var HtmlInputWidget = HtmlWidget.extend({
    constructor: function(width, height, options, value) {
        console.log("Creating input widget");
        this.base(width, height, options);
        this.val(value);
        this.box.addClass("html-input-widget");
   },

    initialize: function() {
        var self = this;
        this.input  = $("<input>").attr("type", "text").attr("name", "textfield");
        if(this.options.maxlength) {
            this.input.attr("maxlength", this.options.maxlength);
        }
        var style = {
            "width": this.width+"px",
            "height": this.height+"px",
            "text-align": "center",
            "border": "none"};
        this.input.prop("readonly", this.options.readonly);
        this.input.css(style);
        this.input.on('input',function(e){
            console.log("changed!", self.val());
            self.onChange(self.val());
        });
        if(this.options.numbersOnly) {
            this.input.keydown(function (e) {
                // Allow: backspace, delete, tab, escape, enter and .
                if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
                     // Allow: Ctrl+A
                    (e.keyCode == 65 && e.ctrlKey === true) ||
                     // Allow: Ctrl+C
                    (e.keyCode == 67 && e.ctrlKey === true) ||
                     // Allow: Ctrl+X
                    (e.keyCode == 88 && e.ctrlKey === true) ||
                     // Allow: home, end, left, right
                    (e.keyCode >= 35 && e.keyCode <= 39)) {
                         // let it happen, don't do anything
                         return;
                }
                // convert to uppercase
                if (e.which >= 97 && e.which <= 122) {
                    var newKey = e.which - 32;
                    // I have tried setting those
                    e.keyCode = newKey;
                    e.charCode = newKey;
                }
                // Ensure that it is a number and stop the keypress
                if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
                    e.preventDefault();
                }
            });
        }
        if(this.options.lettersOnly) {
            this.input.keydown(function (e) {
                // Allow: backspace, delete, tab, escape, enter and .
                if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
                     // Allow: Ctrl+A
                    (e.keyCode == 65 && e.ctrlKey === true) ||
                     // Allow: Ctrl+C
                    (e.keyCode == 67 && e.ctrlKey === true) ||
                     // Allow: Ctrl+X
                    (e.keyCode == 88 && e.ctrlKey === true) ||
                     // Allow: home, end, left, right
                    (e.keyCode >= 35 && e.keyCode <= 39)) {
                         // let it happen, don't do anything
                         return;
                }
                // convert to uppercase
                if (e.which >= 97 && e.which <= 122) {
                    var newKey = e.which - 32;
                    // I have tried setting those
                    e.keyCode = newKey;
                    e.charCode = newKey;
                }
                // Ensure that it is a number and stop the keypress
                if (e.shiftKey || (e.keyCode < 65 || e.keyCode > 90)) {
                    e.preventDefault();
                }
            });
        }
        this.box.html(this.input);
    },
    onChange: function(val) {
        if(typeof(val)=="function") {
            this._onChange = val;
        } else {
            if(this._onChange) this._onChange(val);
        }
    },
    val: function(value) {
        if(arguments.length == 1) {
            this.value = value;
            this.input.val(this.value);
        } else {
            return this.input.val();
        }
    }

});

var HtmlButtonWidget = HtmlWidget.extend({
    constructor: function(width, height, options, text) {
        console.log("Creating button widget");
        this.base(width, height, options);
        this.setText(text);
        this.box.addClass("html-button-widget");
   },

    initialize: function() {
        var self = this;
        this.input  = $("<button>");
        var style = {
            "width": this.width+"px",
            "height": this.height+"px",
            "text-align": "center"};
        if(this.options.backgroundColor) {
            style["background-color"] = this.options.backgroundColor;
        }
        this.input.css(style);
        this.input.on('click',function(e){
            console.log("clicked!");
            self.onClick();
        });
        this.box.html(this.input);
    },
    setText: function(text) {
        this.text = text;
        this.input.text(text);
    },
    setDisabled: function(flag) {
        this.input.prop("disabled", flag);
    },
    onClick: function(val) {
        if(typeof(val)=="function") {
            this._onClick = val;
        } else {
            if(this._onClick) this._onClick(this);
        }
    }

});

var HtmlGridInputWidget = HtmlWidget.extend({

    constructor: function(width, height, rows, cols, options, value) {
        this.rows = rows;
        this.cols = cols;
        this.value = value;
        this.base(width, height, options);
        this.val(value);
        this.box.addClass("html-grid-input-widget");
    },
    initialize: function() {
        var self = this;
        var gap = this.options.gap || 0;
        var w = (this.width-(this.cols-1)*gap)/this.cols;
        var h = (this.height-(this.rows-1)*gap)/this.rows;
        this.inputs = [];
        var i=0;
        for(var y=0; y<this.rows; y++) {
            for(var x=0; x<this.cols; x++) {
                opts = $.extend({}, this.options);
                if(this.options.filledReadonly && this.value[i]) {
                    opts.readonly = true;
                }
                var inp = new HtmlInputWidget(w, h, opts, this.value[i]);
                inp.setPosition(x*w + x*gap, y*h + y*gap);
                inp.onChange(function(val) {
                    self.onChange(self.val());
                });
                this.inputs.push(inp);
                this.box.append(inp.box);
                i++;
            }
        }
        var self = this;
    },
    onChange: function(val) {
        if(typeof(val)=="function") {
            this._onChange = val;
        } else {
            if(this._onChange) this._onChange(val);
        }
    },
    val: function(value) {
        if(arguments.length == 1) {
            this.value = value;
            this._setValue(this.value);
        } else {
            return this._getValue();
        }
    },
    isFilled: function() {
        for(var i=0; i<this.inputs.length; i++) {
            if(!this.inputs[i].val()) return false;
        }
        return true;
    },
    _setValue: function(val) {
        for(var i=0; i<this.inputs.length; i++) {
            this.inputs[i].val(val[i]);
        }
    },
    _getValue: function() {
        var out = [];
        for(var i=0; i<this.inputs.length; i++) {
            out.push(this.inputs[i].val());
        }
        return out;
    }
});

var HtmlSeriesInputWidget = HtmlWidget.extend({

    constructor: function(width, height, options, value) {
        this.value = value;
        this.base(width, height, options);
        this.val(value);
        this.box.addClass("html-series-input-widget");
    },
    initialize: function() {
        var self = this;
        var gap = this.options.gap || 0;
        var w = (this.width-(this.value.length-1)*gap)/this.value.length;
        this.inputs = [];
        var i=0;
        for(var x=0; x<this.value.length; x++) {
            opts = $.extend({}, this.options);
            if(this.options.filledReadonly && this.value[i]) {
                opts.readonly = true;
            }
            var inp = new HtmlInputWidget(w, this.height, opts, this.value[i]);
            inp.setPosition(x*w + (x-1)*gap, 0);
            inp.onChange(function(val) {
                self.onChange(self.val());
            });
            this.inputs.push(inp);
            this.box.append(inp.box);
            i++;
        }
        var self = this;
    },
    onChange: function(val) {
        if(typeof(val)=="function") {
            this._onChange = val;
        } else {
            if(this._onChange) this._onChange(val);
        }
    },
    val: function(value) {
        if(arguments.length == 1) {
            this.value = value;
            this._setValue(this.value);
        } else {
            return this._getValue();
        }
    },
    isFilled: function() {
        for(var i=0; i<this.inputs.length; i++) {
            if(!this.inputs[i].val()) return false;
        }
        return true;
    },
    _setValue: function(val) {
        for(var i=0; i<this.inputs.length; i++) {
            this.inputs[i].val(val[i]);
        }
    },
    _getValue: function() {
        var out = [];
        for(var i=0; i<this.inputs.length; i++) {
            out.push(this.inputs[i].val());
        }
        return out;
    }
});

var HtmlMultiSeriesInputWidget = HtmlWidget.extend({

    constructor: function(width, height, options, value) {
        this.value = value;
        this.base(width, height, options);
        this.val(value);
        this.box.addClass("html-multi-series-input-widget");
    },
    initialize: function() {
        var self = this;
        var gap = this.options.gap || 0;
        var vgap = this.options.vgap || 0;
        var rows = this.value.length;
        var cols = 0;
        for(var i=0; i<this.value.length; i++) {
            if(this.value[i].length > cols) cols = this.value[i].length;
        }
        var h = (this.height-(rows-1)*vgap)/rows;
        var w = (this.width-(cols-1)*gap)/cols;
        this.inputs = [];
        var i=0;
        for(var y=0; y<rows; y++) {
            var ww = Math.floor(this.value[y].length*w + (this.value[y].length-1)*gap);
            opts = $.extend({}, this.options);
            var inp = new HtmlSeriesInputWidget(ww, h, opts, this.value[y]);
            inp.setPosition( Math.floor((this.width-ww)/2),  Math.floor(y*(h+vgap)));
            inp.onChange(function(val) {
                self.onChange(self.val());
            });
            this.inputs.push(inp);
            this.box.append(inp.box);
            i++;
        }
        var self = this;
    },
    onChange: function(val) {
        if(typeof(val)=="function") {
            this._onChange = val;
        } else {
            if(this._onChange) this._onChange(val);
        }
    },
    val: function(value) {
        if(arguments.length == 1) {
            this.value = value;
            this._setValue(this.value);
        } else {
            return this._getValue();
        }
    },
    isFilled: function() {
        for(var i=0; i<this.inputs.length; i++) {
            if(!this.inputs[i].isFilled()) return false;
        }
        return true;
    },
    _setValue: function(val) {
        for(var i=0; i<this.inputs.length; i++) {
            this.inputs[i].val(val[i]);
        }
    },
    _getValue: function() {
        var out = [];
        for(var i=0; i<this.inputs.length; i++) {
            out.push(this.inputs[i].val());
        }
        return out;
    }
});

var HtmlTimerWidget = HtmlWidget.extend({
    constructor: function(width, height, options, countdown) {
        console.log("Creating timer widget");
        this.base(width, height, options);
        this.countdown = countdown;
        this.box.addClass("html-timer-widget");
   },

    initialize: function() {
        var self = this;
        this.input  = $("<div>");
        var style = {
            "width": this.width+"px",
            "height": this.height+"px"
        };
        this.input.css(style);
        this.input.polartimer({
          timerSeconds: this.countdown,
          color: this.options.color || '#F00',
          opacity: this.options.opacity || 0.7,
          callback: function () {
            console.log('jquery.polartimer.js: done!');
          }
        });

        this.input.polartimer('start');
        this.box.html(this.input);
    }

});


text:
doctype HTML

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=7,IE=9">
		<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>Server Login Examples</title>

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

		<link type="text/css" rel="stylesheet" href="http://fast.fonts.com/cssapi/4a60d16b-c9e4-404d-89d3-809adb97d65c.css"/>

OAuth Server Logins

        Tech Workshop slides coming soon!

Examples:

Application Login

User Login


text:
{% extends "layout.html" %}
{% include "pageMacros.html" %}

{# the bodyClass block allows us to attach a classname to the body tag for easy style-scoping. #}
{# be sure to call super() so that any pages inheriting this one will be appending classes, not overriding them. #}
{% block bodyClass %}{{ super() }} default-page{% endblock %}

{% block headerMessage %} ASP'ID {% endblock %}

{% block upperClass %}bg-gold{% endblock %}

{% block mainContent %}

        {% if page.parent.type == 'default' %}
          ← {{ page.parent.title }}
        {% endif %}

{{ page.title }}

          {% for child in page.children %}

              {{ child.title }}

          {% endfor %}

{#
    #}

              {{ aposBlocks(page, 'main', [ 'one', 'two' ]) }}

            {{ aposArea(page, 'equipeDescription', {
              controls: ['style', 'bold', 'italic', 'createLink', 'unlink', 'slideshow', 'video'],
              styles: [
                { value: 'p', label: 'Text' },
                { value: 'h3', label: 'Title' },
                { value: 'h5', label: 'Subtitle' }
              ],
              lockups: ['left', 'right']
            }) }}

{% endblock %}


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

namespace Editor
{
    public class RowContainerPasteAction : EquationAction
    {
        public int SelectionStartIndex { get; set; }
        public int SelectedItems { get; set; }

        public EquationBase ActiveEquation { get; set; }
        public int ActiveEquationSelectionIndex { get; set; }
        public int ActiveEquationSelectedItems { get; set; }

        public TextEquation ActiveTextInChildRow { get; set; }
        public int CaretIndexOfActiveText { get; set; }
        public int SelectionStartIndexOfTextEquation { get; set; }
        public int SelectedItemsOfTextEquation { get; set; }
        public string TextEquationContents { get; set; }

        public int[] TextEquationFormats { get; set; }
        public EditorMode[] TextEquationModes { get; set; }
        public CharacterDecorationInfo[] TextEquationDecorations { get; set; }

        public string HeadTextOfPastedRows { get; set; }
        public string TailTextOfPastedRows { get; set; }

        public int[] HeadFormatsOfPastedRows { get; set; }
        public int[] TailFormatsOfPastedRows { get; set; }

        public EditorMode[] HeadModeOfPastedRows { get; set; }
        public EditorMode[] TailModesOfPastedRows { get; set; }

        public CharacterDecorationInfo[] HeadDecorationsOfPastedRows { get; set; }
        public CharacterDecorationInfo[] TailDecorationsOfPastedRows { get; set; }

        public List<EquationRow> Equations { get; set; }

        public RowContainerPasteAction(ISupportsUndo executor)
            : base(executor)
        {
        }
    }
}


text:
/*
 * Do not modify this file. This file is generated from the ec2-2015-04-15.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;

using Amazon.Runtime;
using Amazon.Runtime.Internal;

namespace Amazon.EC2.Model
{
    ///
    /// Container for the parameters to the DescribeAvailabilityZones operation.
    /// Describes one or more of the Availability Zones that are available to you. The results
    /// include zones only for the region you're currently using. If there is an event impacting
    /// an Availability Zone, you can use this request to view the state and any provided
    /// message for that Availability Zone.
    ///
    ///
    /// <para>
    /// For more information, see Regions
    /// and Availability Zones in the Amazon Elastic Compute Cloud User Guide.
    /// </para>
    ///
    public partial class DescribeAvailabilityZonesRequest : AmazonEC2Request
    {
        private List<Filter> _filters = new List<Filter>();
        private List<string> _zoneNames = new List<string>();

        ///
        /// Gets and sets the property Filters.
        /// <para>
        /// One or more filters.
        /// </para>
        ///

        /// <para>
        /// message - Information about the Availability Zone.
        /// </para>
        ///

        /// <para>
        /// region-name - The name of the region for the Availability Zone (for example,
        /// us-east-1).
        /// </para>
        ///

        /// <para>
        /// state - The state of the Availability Zone (available |
        /// impaired | unavailable).
        /// </para>
        ///

        /// <para>
        /// zone-name - The name of the Availability Zone (for example, us-east-1a).
        /// </para>
        ///

        ///
        public List<Filter> Filters
        {
            get { return this._filters; }
            set { this._filters = value; }
        }

        // Check to see if Filters property is set
        internal bool IsSetFilters()
        {
            return this._filters != null && this._filters.Count > 0;
        }

        ///
        /// Gets and sets the property ZoneNames.
        /// <para>
        /// The names of one or more Availability Zones.
        /// </para>
        ///
        public List<string> ZoneNames
        {
            get { return this._zoneNames; }
            set { this._zoneNames = value; }
        }

        // Check to see if ZoneNames property is set
        internal bool IsSetZoneNames()
        {
            return this._zoneNames != null && this._zoneNames.Count > 0;
        }

    }
}


text:
title: 'Notes'
layout: 'layouts/notes_archive.njk'
---


text:
using System;
using System.IO;
using System.Reflection;
using System.CodeDom.Compiler;

using MbUnit.Framework;
namespace MbUnit.Tests.Core.Graph
{
    public sealed class AssemblyCompiler
    {
        private AssemblyCompiler()
        {}

        public static void CreateAssemblies()
        {
            CreateAssembly("ParentAssembly");
            CreateAssembly("ChildAssembly");
            CreateAssembly("SickParentAssembly");
        }

        private static string LoadSource(string name)
        {
            Stream stream = typeof(AssemblyCompiler).Assembly.GetManifestResourceStream("MbUnit.Tests.Core.Graph." + name + ".cs");
            Assert.IsNotNull(stream);
            using (StreamReader reader = new StreamReader(stream))
            {
                return reader.ReadToEnd();
            }
        }

        public static Assembly CreateAssembly(string name)
        {
            ICodeCompiler compiler = new Microsoft.CSharp.CSharpCodeProvider().CreateCompiler();

            string source = LoadSource(name);

            CompilerParameters options = new CompilerParameters();
            options.GenerateExecutable = false;
            options.GenerateInMemory = false;
            options.OutputAssembly = name+".dll";
            options.ReferencedAssemblies.Add("MbUnit.Framework.dll");

            CompilerResults results = compiler.CompileAssemblyFromSource(options, source);
            if (results.Errors.HasErrors)
                CompilerAssert.DisplayErrors(results, Console.Out);
            Assert.IsFalse(results.Errors.HasErrors);
            return results.CompiledAssembly;
        }
    }
}


text:
package git

import (
	"bytes"
	"context"
	"errors"
	"fmt"
	"io"
	"os"
	"os/exec"
	"strings"
	"time"
	"unsafe"

	"code.gitea.io/gitea/modules/log"
	"code.gitea.io/gitea/modules/process"
	"code.gitea.io/gitea/modules/util"
)

var (
	// globalCommandArgs global command args for external package setting
	globalCommandArgs []CmdArg

	// defaultCommandExecutionTimeout default command execution timeout duration
	defaultCommandExecutionTimeout = 360 * time.Second
)

// DefaultLocale is the default LC_ALL to run git commands in.
const DefaultLocale = "C"

// Command represents a command with its subcommands or arguments.
type Command struct {
	name             string
	args             []string
	parentContext    context.Context
	desc             string
	globalArgsLength int
	brokenArgs       []string
}

type CmdArg string

func (c *Command) String() string {
	if len(c.args) == 0 {
		return c.name
	}
	return fmt.Sprintf("%s %s", c.name, strings.Join(c.args, " "))
}

// NewCommand creates and returns a new Git Command based on given command and arguments.
// Each argument should be safe to be trusted. User-provided arguments should be passed to AddDynamicArguments instead.
func NewCommand(ctx context.Context, args ...CmdArg) *Command {
	// Make an explicit copy of globalCommandArgs, otherwise append might overwrite it
	cargs := make([]string, 0, len(globalCommandArgs)+len(args))
	for _, arg := range globalCommandArgs {
		cargs = append(cargs, string(arg))
	}
	for _, arg := range args {
		cargs = append(cargs, string(arg))
	}
	return &Command{
		name:             GitExecutable,
		args:             cargs,
		parentContext:    ctx,
		globalArgsLength: len(globalCommandArgs),
	}
}

// NewCommandNoGlobals creates and returns a new Git Command based on given command and arguments only with the specify args and don't care global command args
// Each argument should be safe to be trusted. User-provided arguments should be passed to AddDynamicArguments instead.
func NewCommandNoGlobals(args ...CmdArg) *Command {
	return NewCommandContextNoGlobals(DefaultContext, args...)
}

// NewCommandContextNoGlobals creates and returns a new Git Command based on given command and arguments only with the specify args and don't care global command args
// Each argument should be safe to be trusted. User-provided arguments should be passed to AddDynamicArguments instead.
func NewCommandContextNoGlobals(ctx context.Context, args ...CmdArg) *Command {
	cargs := make([]string, 0, len(args))
	for _, arg := range args {
		cargs = append(cargs, string(arg))
	}
	return &Command{
		name:          GitExecutable,
		args:          cargs,
		parentContext: ctx,
	}
}

// SetParentContext sets the parent context for this command
func (c *Command) SetParentContext(ctx context.Context) *Command {
	c.parentContext = ctx
	return c
}

// SetDescription sets the description for this command which be returned on
// c.String()
func (c *Command) SetDescription(desc string) *Command {
	c.desc = desc
	return c
}

// AddArguments adds new git argument(s) to the command. Each argument must be safe to be trusted.
// User-provided arguments should be passed to AddDynamicArguments instead.
func (c *Command) AddArguments(args ...CmdArg) *Command {
	for _, arg := range args {
		c.args = append(c.args, string(arg))
	}
	return c
}

// AddDynamicArguments adds new dynamic argument(s) to the command.
// The arguments may come from user input and can not be trusted, so no leading '-' is allowed to avoid passing options
func (c *Command) AddDynamicArguments(args ...string) *Command {
	for _, arg := range args {
		if arg != "" && arg[0] == '-' {
			c.brokenArgs = append(c.brokenArgs, arg)
		}
	}
	if len(c.brokenArgs) != 0 {
		return c
	}
	c.args = append(c.args, args...)
	return c
}

// AddDashesAndList adds the "--" and then add the list as arguments, it's usually for adding file list
// At the moment, this function can be only called once, maybe in future it can be refactored to support multiple calls (if necessary)
func (c *Command) AddDashesAndList(list ...string) *Command {
	c.args = append(c.args, "--")
	// Some old code also checks `arg != ""`, IMO it's not necessary.
	// If the check is needed, the list should be prepared before the call to this function
	c.args = append(c.args, list...)
	return c
}

// CmdArgCheck checks whether the string is safe to be used as a dynamic argument.
// It panics if the check fails. Usually it should not be used, it's just for refactoring purpose
// deprecated
func CmdArgCheck(s string) CmdArg {
	if s != "" && s[0] == '-' {
		panic("invalid git cmd argument: " + s)
	}
	return CmdArg(s)
}

// RunOpts represents parameters to run the command. If UseContextTimeout is specified, then Timeout is ignored.
type RunOpts struct {
	Env               []string
	Timeout           time.Duration
	UseContextTimeout bool
	Dir               string
	Stdout, Stderr    io.Writer
	Stdin             io.Reader
	PipelineFunc      func(context.Context, context.CancelFunc) error
}

func commonBaseEnvs() []string {
	// at the moment, do not set "GIT_CONFIG_NOSYSTEM", users may have put some configs like "receive.certNonceSeed" in it
	envs := []string{
		"HOME=" + HomeDir(),        // make Gitea use internal git config only, to prevent conflicts with user's git config
		"GIT_NO_REPLACE_OBJECTS=1", // ignore replace references (https://git-scm.com/docs/git-replace)
	}

	// some environment variables should be passed to git command
	passThroughEnvKeys := []string{
		"GNUPGHOME", // git may call gnupg to do commit signing
	}
	for _, key := range passThroughEnvKeys {
		if val, ok := os.LookupEnv(key); ok {
			envs = append(envs, key+"="+val)
		}
	}
	return envs
}

// CommonGitCmdEnvs returns the common environment variables for a "git" command.
func CommonGitCmdEnvs() []string {
	return append(commonBaseEnvs(), []string{
		"LC_ALL=" + DefaultLocale,
		"GIT_TERMINAL_PROMPT=0", // avoid prompting for credentials interactively, supported since git v2.3
	}...)
}

// CommonCmdServEnvs is like CommonGitCmdEnvs, but it only returns minimal required environment variables for the "gitea serv" command
func CommonCmdServEnvs() []string {
	return commonBaseEnvs()
}

var ErrBrokenCommand = errors.New("git command is broken")

// Run runs the command with the RunOpts
func (c *Command) Run(opts *RunOpts) error {
	if len(c.brokenArgs) != 0 {
		log.Error("git command is broken: %s, broken args: %s", c.String(), strings.Join(c.brokenArgs, " "))
		return ErrBrokenCommand
	}
	if opts == nil {
		opts = &RunOpts{}
	}

	// We must not change the provided options
	timeout := opts.Timeout
	if timeout <= 0 {
		timeout = defaultCommandExecutionTimeout
	}

	if len(opts.Dir) == 0 {
		log.Debug("%s", c)
	} else {
		log.Debug("%s: %v", opts.Dir, c)
	}

	desc := c.desc
	if desc == "" {
		args := c.args[c.globalArgsLength:]
		var argSensitiveURLIndexes []int
		for i, arg := range c.args {
			if strings.Contains(arg, "://") && strings.Contains(arg, "@") {
				argSensitiveURLIndexes = append(argSensitiveURLIndexes, i)
			}
		}
		if len(argSensitiveURLIndexes) > 0 {
			args = make([]string, len(c.args))
			copy(args, c.args)
			for _, urlArgIndex := range argSensitiveURLIndexes {
				args[urlArgIndex] = util.SanitizeCredentialURLs(args[urlArgIndex])
			}
		}
		desc = fmt.Sprintf("%s %s [repo_path: %s]", c.name, strings.Join(args, " "), opts.Dir)
	}

	var ctx context.Context
	var cancel context.CancelFunc
	var finished context.CancelFunc

	if opts.UseContextTimeout {
		ctx, cancel, finished = process.GetManager().AddContext(c.parentContext, desc)
	} else {
		ctx, cancel, finished = process.GetManager().AddContextTimeout(c.parentContext, timeout, desc)
	}
	defer finished()

	cmd := exec.CommandContext(ctx, c.name, c.args...)
	if opts.Env == nil {
		cmd.Env = os.Environ()
	} else {
		cmd.Env = opts.Env
	}

	process.SetSysProcAttribute(cmd)
	cmd.Env = append(cmd.Env, CommonGitCmdEnvs()...)
	cmd.Dir = opts.Dir
	cmd.Stdout = opts.Stdout
	cmd.Stderr = opts.Stderr
	cmd.Stdin = opts.Stdin
	if err := cmd.Start(); err != nil {
		return err
	}

	if opts.PipelineFunc != nil {
		err := opts.PipelineFunc(ctx, cancel)
		if err != nil {
			cancel()
			_ = cmd.Wait()
			return err
		}
	}

	if err := cmd.Wait(); err != nil && ctx.Err() != context.DeadlineExceeded {
		return err
	}

	return ctx.Err()
}

type RunStdError interface {
	error
	Unwrap() error
	Stderr() string
	IsExitCode(code int) bool
}

type runStdError struct {
	err    error
	stderr string
	errMsg string
}

func (r *runStdError) Error() string {
	// the stderr must be in the returned error text, some code only checks `strings.Contains(err.Error(), "git error")`
	if r.errMsg == "" {
		r.errMsg = ConcatenateError(r.err, r.stderr).Error()
	}
	return r.errMsg
}

func (r *runStdError) Unwrap() error {
	return r.err
}

func (r *runStdError) Stderr() string {
	return r.stderr
}

func (r *runStdError) IsExitCode(code int) bool {
	var exitError *exec.ExitError
	if errors.As(r.err, &exitError) {
		return exitError.ExitCode() == code
	}
	return false
}

func bytesToString(b []byte) string {
	return *(*string)(unsafe.Pointer(&b)) // that's what Golang's strings.Builder.String() does (go/src/strings/builder.go)
}

// RunStdString runs the command with options and returns stdout/stderr as string. and store stderr to returned error (err combined with stderr).
func (c *Command) RunStdString(opts *RunOpts) (stdout, stderr string, runErr RunStdError) {
	stdoutBytes, stderrBytes, err := c.RunStdBytes(opts)
	stdout = bytesToString(stdoutBytes)
	stderr = bytesToString(stderrBytes)
	if err != nil {
		return stdout, stderr, &runStdError{err: err, stderr: stderr}
	}
	// even if there is no err, there could still be some stderr output, so we just return stdout/stderr as they are
	return stdout, stderr, nil
}

// RunStdBytes runs the command with options and returns stdout/stderr as bytes. and store stderr to returned error (err combined with stderr).
func (c *Command) RunStdBytes(opts *RunOpts) (stdout, stderr []byte, runErr RunStdError) {
	if opts == nil {
		opts = &RunOpts{}
	}
	if opts.Stdout != nil || opts.Stderr != nil {
		// we must panic here, otherwise there would be bugs if developers set Stdin/Stderr by mistake, and it would be very difficult to debug
		panic("stdout and stderr field must be nil when using RunStdBytes")
	}
	stdoutBuf := &bytes.Buffer{}
	stderrBuf := &bytes.Buffer{}

	// We must not change the provided options as it could break future calls - therefore make a copy.
	newOpts := &RunOpts{
		Env:               opts.Env,
		Timeout:           opts.Timeout,
		UseContextTimeout: opts.UseContextTimeout,
		Dir:               opts.Dir,
		Stdout:            stdoutBuf,
		Stderr:            stderrBuf,
		Stdin:             opts.Stdin,
		PipelineFunc:      opts.PipelineFunc,
	}

	err := c.Run(newOpts)
	stderr = stderrBuf.Bytes()
	if err != nil {
		return nil, stderr, &runStdError{err: err, stderr: bytesToString(stderr)}
	}
	// even if there is no err, there could still be some stderr output
	return stdoutBuf.Bytes(), stderr, nil
}

// AllowLFSFiltersArgs return globalCommandArgs with lfs filter, it should only be used for tests
func AllowLFSFiltersArgs() []CmdArg {
	// Now here we should explicitly allow lfs filters to run
	filteredLFSGlobalArgs := make([]CmdArg, len(globalCommandArgs))
	j := 0
	for _, arg := range globalCommandArgs {
		if strings.Contains(string(arg), "lfs") {
			j--
		} else {
			filteredLFSGlobalArgs[j] = arg
			j++
		}
	}
	return filteredLFSGlobalArgs[:j]
}


text:
// https://raw.github.com/kahlil/grunt-compass/master/tasks/compass.js

module.exports = function( grunt ) {

  // Create a new multi task.
  grunt.registerMultiTask( 'compass', 'This triggers the `compass compile` command.', function() {

    // Tell grunt this task is asynchronous.
    var done = this.async(),
      exec = require('child_process').exec,
      command = "compass compile",
      src = this.data.src,
      dest = this.data.dest,
      images = this.data.images,
      outputstyle = this.data.outputstyle,
      linecomments = this.data.linecomments,
      forcecompile = this.data.forcecompile,
      debugsass = this.data.debugsass,
      relativeassets = this.data.relativeassets,
      libRequire = this.data.require;

    if ( src !== undefined && dest !== undefined ) {
      command += ' --sass-dir="' + src + '" --css-dir="' + dest + '"';
    }

    if ( images !== undefined ) {
      command += ' --images-dir="' + images + '"';
    }

    if ( debugsass !== undefined ) {
      if ( debugsass === true ) {
        command += ' --debug-info';
      }
    }

    if ( relativeassets !== undefined ) {
      if ( relativeassets === true ) {
        command += ' --relative-assets';
      }
    }

    if ( outputstyle !== undefined ) {
      command += ' --output-style ' + outputstyle;
    }

    if ( linecomments === false ) {
      command += ' --no-line-comments';
    }

    if(libRequire !== undefined){
      command += ' --require '+ libRequire;
    }

    if ( forcecompile === true ) {
      command += ' --force';
    }

    function puts( error, stdout, stderr ) {

      grunt.log.write( '\n\nCOMPASS output:\n' );
      grunt.log.write( stdout );
      /* grunt.log.error( stderr );
       * compass sends falsy error message to stderr... real sass/compass errors come in through the "error" variable.
       */

      if ( error !== null ) {
        grunt.log.error( error );
        done(false);
      }
      else
      {
        done(true);
      }
    }

    exec( command, puts );
    grunt.log.write( '`' + command + '` was initiated.' );
  });
};


text:
package com.pepedyne.pepe.servos;

public class ToggleServo extends Servo {

   public ToggleServo(String name, int min, int max) {
      super(name, min, max);
      state = false;
      this.current = min;
   }

   private boolean state;

   @Override
   public void setCurrent(int value) {
      this.current = current;
      if (current < this.getLimit().getMin())
      {
         this.current = this.getLimit().getMin();
      }
      else if (current > this.getLimit().getMax())
      {
         this.current = this.getLimit().getMax();
      }
   }

   public void toggle() {
      state = !state;
      if (state)
      {
         this.current = this.getLimit().getMax();
      }
      else
      {
         this.current = this.getLimit().getMin();
      }

   }

}


text:
.class public final Landroid/provider/Telephony$Sms$Sent;
.super Ljava/lang/Object;
.source "Telephony.java"

# interfaces
.implements Landroid/provider/BaseColumns;
.implements Landroid/provider/Telephony$TextBasedSmsColumns;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/provider/Telephony$Sms;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x19
    name = "Sent"
.end annotation

# static fields
.field public static final CONTENT_URI:Landroid/net/Uri; = null

.field public static final DEFAULT_SORT_ORDER:Ljava/lang/String; = "date DESC"

# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 359
    const-string v0, "content://sms/sent"

    invoke-static {v0}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    sput-object v0, Landroid/provider/Telephony$Sms$Sent;->CONTENT_URI:Landroid/net/Uri;

    return-void
.end method

.method public constructor <init>()V
    .locals 0

    .prologue
    .line 355
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static addMessage(Landroid/content/ContentResolver;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;)Landroid/net/Uri;
    .locals 8
    .parameter "resolver"
    .parameter "address"
    .parameter "body"
    .parameter "subject"
    .parameter "date"

    .prologue
    .line 379
    sget-object v1, Landroid/provider/Telephony$Sms$Sent;->CONTENT_URI:Landroid/net/Uri;

    const/4 v6, 0x1

    const/4 v7, 0x0

    move-object v0, p0

    move-object v2, p1

    move-object v3, p2

    move-object v4, p3

    move-object v5, p4

    invoke-static/range {v0 .. v7}, Landroid/provider/Telephony$Sms;->addMessageToUri(Landroid/content/ContentResolver;Landroid/net/Uri;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;ZZ)Landroid/net/Uri;

    move-result-object v0

    return-object v0
.end method