text:
/*	$OpenBSD: _wcstoul.h,v 1.3 2015/10/01 02:32:07 guenther Exp $	*/
/* $NetBSD: _wcstoul.h,v 1.2 2003/08/07 16:43:03 agc Exp $ */

/*
 * Copyright (c) 1990, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * Original version ID:
 * @(#)strtoul.c	8.1 (Berkeley) 6/4/93
 * Citrus: xpg4dl/FreeBSD/lib/libc/locale/wcstoul.c,v 1.2 2001/09/21 16:11:41 yamt Exp
 * NetBSD: wcstoul.c,v 1.1 2001/09/27 16:30:37 yamt Exp
 */

/*
 * function template for wcstoul, wcstoull and wcstoumax.
 *
 * parameters:
 *	FUNCNAME  : function name
 *      uint_type : return type
 *      MAX_VALUE : upper limit of the return type
 */

uint_type
FUNCNAME(const wchar_t *nptr, wchar_t **endptr, int base)
{
	const wchar_t *s;
	uint_type acc, cutoff;
	wint_t wc;
	int i;
	int neg, any, cutlim;

	if (base && (base < 2 || base > 36)) {
		errno = EINVAL;
		return 0;
	}

	/*
	 * Skip white space and pick up leading +/- sign if any.
	 * If base is 0, allow 0x for hex and 0 for octal, else
	 * assume decimal; if base is already 16, allow 0x.
	 */
	s = nptr;
	do {
		wc = (wchar_t) *s++;
	} while (iswspace(wc));
	if (wc == L'-') {
		neg = 1;
		wc = *s++;
	} else {
		neg = 0;
		if (wc == L'+')
			wc = *s++;
	}
	if ((base == 0 || base == 16) &&
	    wc == L'0' && (*s == L'x' || *s == L'X')) {
		wc = s[1];
		s += 2;
		base = 16;
	}
	if (base == 0)
		base = wc == L'0' ? 8 : 10;

	/*
	 * See strtoul for comments as to the logic used.
	 */
	cutoff = MAX_VALUE / (uint_type)base;
	cutlim = (int)(MAX_VALUE % (uint_type)base);
	for (acc = 0, any = 0;; wc = (wchar_t) *s++) {
		i = wctoint(wc);
		if (i == (wint_t)-1)
			break;
		if (i >= base)
			break;
		if (any < 0)
			continue;
		if (acc > cutoff || (acc == cutoff && i > cutlim)) {
			any = -1;
			acc = MAX_VALUE;
			errno = ERANGE;
		} else {
			any = 1;
			acc *= (uint_type)base;
			acc += i;
		}
	}
	if (neg && any > 0)
		acc = -acc;
	if (endptr != 0)
		*endptr = (wchar_t *)(any ? s - 1 : nptr);
	return (acc);
}
DEF_STRONG(FUNCNAME);


text:
package de.codescape.jira.plugins.scrumpoker.service;

import com.atlassian.activeobjects.test.TestActiveObjects;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.issue.IssueManager;
import com.atlassian.jira.issue.MutableIssue;
import de.codescape.jira.plugins.scrumpoker.ScrumPokerTestDatabaseUpdater;
import de.codescape.jira.plugins.scrumpoker.ao.ScrumPokerProject;
import de.codescape.jira.plugins.scrumpoker.ao.ScrumPokerSession;
import de.codescape.jira.plugins.scrumpoker.model.GlobalSettings;
import net.java.ao.EntityManager;
import net.java.ao.test.converters.NameConverters;
import net.java.ao.test.jdbc.Data;
import net.java.ao.test.jdbc.Hsql;
import net.java.ao.test.jdbc.Jdbc;
import net.java.ao.test.junit.ActiveObjectsJUnitRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;

import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.*;

@RunWith(ActiveObjectsJUnitRunner.class)
@Data(ScrumPokerTestDatabaseUpdater.class)
@Jdbc(Hsql.class)
@NameConverters
public class ScrumPokerSessionServiceImplTest {

    private static final int EXPECTED_SESSION_TIMEOUT = 12;

    @SuppressWarnings("unused")
    private EntityManager entityManager;
    private TestActiveObjects activeObjects;

    private ScrumPokerSessionService scrumPokerSessionService;

    private EstimateFieldService estimateFieldService;

    @Before
    public void before() {
        activeObjects = new TestActiveObjects(entityManager);

        IssueManager issueManager = mock(IssueManager.class);
        MutableIssue issue = mock(MutableIssue.class);
        when(issueManager.getIssueObject(ArgumentMatchers.startsWith("ISSUE-"))).thenReturn(issue);

        GlobalSettingsService scrumPokerSettingsService = mock(GlobalSettingsService.class);
        GlobalSettings globalSettings = mock(GlobalSettings.class);
        when(scrumPokerSettingsService.load()).thenReturn(globalSettings);
        when(globalSettings.getSessionTimeout()).thenReturn(EXPECTED_SESSION_TIMEOUT);

        // TODO add tests with project specific card set configured
        ScrumPokerProject scrumPokerProject = mock(ScrumPokerProject.class);
        ProjectSettingsService projectSettingsService = mock(ProjectSettingsService.class);
        when(projectSettingsService.loadSettings(anyLong())).thenReturn(scrumPokerProject);

        estimateFieldService = mock(EstimateFieldService.class);
        when(estimateFieldService.isEstimable(ArgumentMatchers.any(Issue.class))).thenReturn(true);

        ErrorLogService errorLogService = mock(ErrorLogService.class);

        scrumPokerSessionService = new ScrumPokerSessionServiceImpl(activeObjects, issueManager,
            scrumPokerSettingsService, projectSettingsService, estimateFieldService, errorLogService);
    }

    /* tests for byIssueKey() */

    @Test
    public void shouldCreateSessionIfNotExists() {
        scrumPokerSessionService.byIssueKey("ISSUE-1", "USER-1");
        assertThat(activeObjects.get(ScrumPokerSession.class, "ISSUE-1").getCreatorUserKey(), equalTo("USER-1"));
    }

    @Test
    public void shouldCreateNewSessionIfUpdateDateOfExistingSessionIsOlderThanSessionTimeout() {
        // given a session with the update date older than the session timeout
        ScrumPokerSession scrumPokerSession = scrumPokerSessionService.byIssueKey("ISSUE-1", "USER-1");
        scrumPokerSession.setCreateDate(beforeTimeout());
        scrumPokerSession.setUpdateDate(scrumPokerSession.getCreateDate());
        scrumPokerSession.save();
        // when requesting this session
        ScrumPokerSession newScrumPokerSession = scrumPokerSessionService.byIssueKey("ISSUE-1", "USER-1");
        // then a new session shall be created and returned
        assertThat(scrumPokerSession.getCreateDate(), is(not(equalTo(newScrumPokerSession.getCreateDate()))));
    }

    @Test
    public void shouldReturnExistingSessionIfUpdateDateOfExistingSessionIsYoungerThanSessionTimeout() {
        // given a session with the update date younger than the session timeout
        ScrumPokerSession scrumPokerSession = scrumPokerSessionService.byIssueKey("ISSUE-1", "USER-1");
        scrumPokerSession.setCreateDate(afterTimeout());
        scrumPokerSession.setUpdateDate(scrumPokerSession.getCreateDate());
        scrumPokerSession.save();
        // when requesting this session
        ScrumPokerSession newScrumPokerSession = scrumPokerSessionService.byIssueKey("ISSUE-1", "USER-1");
        // then the current session shall be returned
        assertThat(scrumPokerSession.getCreateDate(), is(equalTo(newScrumPokerSession.getCreateDate())));
    }

    @Test(expected = IllegalStateException.class)
    public void shouldNotCreateSessionForIssueKeyWhichDoesNotExist() {
        scrumPokerSessionService.byIssueKey("UNKNOWN", "USER-1");
        fail();
    }

    @Test(expected = IllegalStateException.class)
    public void shouldNotCreateSessionForIssueWhichCannotBeEstimated() {
        reset(estimateFieldService);
        when(estimateFieldService.isEstimable(ArgumentMatchers.any(Issue.class))).thenReturn(false);
        scrumPokerSessionService.byIssueKey("ISSUE-21", "USER-1");
        fail();
    }

    /* tests for addVote() */

    @Test
    public void shouldAddVoteToSession() {
        scrumPokerSessionService.addVote("ISSUE-1", "USER-1", "5");
        assertThat(activeObjects.get(ScrumPokerSession.class, "ISSUE-1").getVotes().length, equalTo(1));
    }

    @Test
    public void shouldOverrideVoteOnSessionForSameUser() {
        scrumPokerSessionService.addVote("ISSUE-1", "USER-1", "5");
        scrumPokerSessionService.addVote("ISSUE-1", "USER-1", "8");
        assertThat(activeObjects.get(ScrumPokerSession.class, "ISSUE-1").getVotes().length, equalTo(1));
        assertThat(activeObjects.get(ScrumPokerSession.class, "ISSUE-1").getVotes()[0].getVote(), equalTo("8"));
    }

    @Test
    public void shouldHideSessionWhenNewVoteIsAdded() {
        scrumPokerSessionService.addVote("ISSUE-1", "USER-1", "5");
        scrumPokerSessionService.reveal("ISSUE-1", "USER-1");
        scrumPokerSessionService.addVote("ISSUE-1", "USER-2", "8");
        ScrumPokerSession scrumPokerSession = scrumPokerSessionService.byIssueKey("ISSUE-1", "USER-1");
        assertThat(scrumPokerSession.isVisible(), is(false));
    }

    /* tests for reset() */

    @Test
    public void shouldRemoveAllVotesOnReset() {
        scrumPokerSessionService.addVote("ISSUE-1", "USER-1", "5");
        scrumPokerSessionService.addVote("ISSUE-1", "USER-2", "8");
        ScrumPokerSession scrumPokerSession = scrumPokerSessionService.reset("ISSUE-1", "USER-3");
        assertThat(scrumPokerSession.getVotes().length, equalTo(0));
    }

    /* tests for confirm() */

    @Test
    public void shouldAddUserAndDateWhenVoteIsConfirmed() {
        scrumPokerSessionService.addVote("ISSUE-1", "USER-1", "5");
        ScrumPokerSession scrumPokerSession = scrumPokerSessionService.confirm("ISSUE-1", "USER-2", "5");
        assertThat(scrumPokerSession.getConfirmedEstimate(), is(equalTo("5")));
        assertThat(scrumPokerSession.getConfirmedUserKey(), is(equalTo("USER-2")));
        assertThat(scrumPokerSession.getConfirmedDate(), is(notNullValue()));
    }

    /* tests for recent() */

    @Test
    public void shouldIncludeNewSessionInRecentSessions() {
        // given a newly created session
        scrumPokerSessionService.addVote("ISSUE-1", "USER-2", "5");
        // when querying for recent sessions
        List<ScrumPokerSession> recent = scrumPokerSessionService.recent();
        // then it should be included
        assertThat(recent.size(), equalTo(1));
        assertThat(recent.get(0).getIssueKey(), is(equalTo("ISSUE-1")));
    }

    @Test
    public void shouldOnlyIncludeSessionsWithinTheTimeoutInRecentSessions() {
        // given one session older than the timeout
        scrumPokerSessionService.addVote("ISSUE-1", "USER-2", "5");
        ScrumPokerSession scrumPokerSession = scrumPokerSessionService.byIssueKey("ISSUE-1", "USER-2");
        scrumPokerSession.setUpdateDate(beforeTimeout());
        scrumPokerSession.save();
        // given one session inside the timeout
        scrumPokerSessionService.addVote("ISSUE-2", "USER-2", "8");
        // when querying recent sessions
        List<ScrumPokerSession> recent = scrumPokerSessionService.recent();
        // then only the new one should be included
        assertThat(recent.size(), is(equalTo(1)));
        assertThat(recent.get(0).getIssueKey(), is(equalTo("ISSUE-2")));
    }

    /* tests for cancel() */

    @Test
    public void shouldCancelASessionIfCurrentUserIsTheCreatorOfTheSession() {
        scrumPokerSessionService.byIssueKey("ISSUE-9", "USER-1");
        ScrumPokerSession cancelledSession = scrumPokerSessionService.cancel("ISSUE-9", "USER-1");
        assertThat(cancelledSession.isCancelled(), is(true));
    }

    @Test
    public void shouldNotCancelASessionIfCurrentUserIsNotTheCreatorOfTheSession() {
        scrumPokerSessionService.byIssueKey("ISSUE-9", "USER-1");
        ScrumPokerSession cancelledSession = scrumPokerSessionService.cancel("ISSUE-9", "USER-2");
        assertThat(cancelledSession.isCancelled(), is(false));
    }

    /* tests for references() */

    @Test
    public void referencesShouldReturnReferencesWithTheVotingUserAndEstimation() throws Exception {
        scrumPokerSessionService.addVote("ISSUE-1", "USER-1", "3");
        scrumPokerSessionService.confirm("ISSUE-1", "USER-1", "8");
        Thread.sleep(1);

        scrumPokerSessionService.addVote("ISSUE-2", "USER-1", "8");
        scrumPokerSessionService.confirm("ISSUE-2", "USER-1", "8");
        Thread.sleep(1);

        scrumPokerSessionService.addVote("ISSUE-5", "USER-1", "5");
        scrumPokerSessionService.confirm("ISSUE-5", "USER-1", "8");
        Thread.sleep(1);

        scrumPokerSessionService.addVote("ISSUE-8", "USER-1", "8");
        scrumPokerSessionService.confirm("ISSUE-8", "USER-1", "8");
        Thread.sleep(1);

        scrumPokerSessionService.addVote("ISSUE-3", "USER-2", "8");
        scrumPokerSessionService.confirm("ISSUE-3", "USER-2", "8");

        List<ScrumPokerSession> references = scrumPokerSessionService.references("USER-1", "8");
        assertThat(references.size(), is(3));
        assertThat(references.stream().map(ScrumPokerSession::getIssueKey).collect(Collectors.toList()),
            hasItems("ISSUE-8", "ISSUE-5", "ISSUE-2"));
    }

    @Test
    public void referencesShouldReturnAnEmptyListWhenNoReferencesExistWithTheSameEstimationForTheSameUser() {
        scrumPokerSessionService.addVote("ISSUE-1", "USER-1", "3");
        scrumPokerSessionService.confirm("ISSUE-1", "USER-2", "5");

        scrumPokerSessionService.addVote("ISSUE-2", "USER-1", "8");
        scrumPokerSessionService.confirm("ISSUE-2", "USER-2", "3");

        List<ScrumPokerSession> references = scrumPokerSessionService.references("USER-1", "8");
        assertThat(references.isEmpty(), is(true));
    }

    @Test
    public void referencesShouldIncludeSessionsWhereTheCurrentUserIsOnlyTheCreatorOfTheSession() {
        scrumPokerSessionService.byIssueKey("ISSUE-1", "STARTER-KEY");
        scrumPokerSessionService.addVote("ISSUE-1", "USER-KEY", "3");
        scrumPokerSessionService.confirm("ISSUE-1", "CONFIRMED-KEY", "3");

        List<ScrumPokerSession> references = scrumPokerSessionService.references("STARTER-KEY", "3");
        assertThat(references.stream().map(ScrumPokerSession::getIssueKey).collect(Collectors.toList()),
            hasItem("ISSUE-1"));
    }

    @Test
    public void referencesShouldIncludeSessionsWhereTheCurrentUserIsOnlyTheConfirmingUserOfTheSession() {
        scrumPokerSessionService.byIssueKey("ISSUE-1", "STARTER-KEY");
        scrumPokerSessionService.addVote("ISSUE-1", "USER-KEY", "3");
        scrumPokerSessionService.confirm("ISSUE-1", "CONFIRMED-KEY", "3");

        List<ScrumPokerSession> references = scrumPokerSessionService.references("CONFIRMED-KEY", "3");
        assertThat(references.stream().map(ScrumPokerSession::getIssueKey).collect(Collectors.toList()),
            hasItem("ISSUE-1"));
    }

    @Test
    public void referencesShouldNotIncludeSessionsMoreThanOneTime() {
        scrumPokerSessionService.byIssueKey("ISSUE-1", "USER-KEY");
        scrumPokerSessionService.addVote("ISSUE-1", "USER-KEY", "3");
        scrumPokerSessionService.addVote("ISSUE-1", "ANOTHER-KEY", "3");
        scrumPokerSessionService.addVote("ISSUE-1", "YET-ANOTHER-KEY", "3");
        scrumPokerSessionService.confirm("ISSUE-1", "USER-KEY", "3");

        List<ScrumPokerSession> references = scrumPokerSessionService.references("USER-KEY", "3");
        assertThat(references.size(), is(equalTo(1)));
        assertThat(references.stream().map(ScrumPokerSession::getIssueKey).collect(Collectors.toList()),
            hasItem("ISSUE-1"));
    }

    /* supporting methods */

    private Date beforeTimeout() {
        return new Date(System.currentTimeMillis() - 1000 * 3600 * (EXPECTED_SESSION_TIMEOUT + 1));
    }

    private Date afterTimeout() {
        return new Date(System.currentTimeMillis() - 1000 * 3600 * (EXPECTED_SESSION_TIMEOUT - 1));
    }

}

redpajama_set_name: RedPajamaGithub


text:
.class public Lcom/google/android/gms/auth/api/credentials/zze;
.super Ljava/lang/Object;

# interfaces
.implements Landroid/os/Parcelable$Creator;

# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Landroid/os/Parcelable$Creator",
        "<",
        "Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;",
        ">;"
    }
.end annotation

# direct methods
.method public constructor <init>()V
    .registers 1

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

    return-void
.end method

.method static zza(Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;Landroid/os/Parcel;I)V
    .registers 7

    const/4 v3, 0x0

    invoke-static {p1}, Lcom/google/android/gms/common/internal/safeparcel/zzb;->zzaq(Landroid/os/Parcel;)I

    move-result v0

    const/4 v1, 0x1

    iget-object v2, p0, Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;->zzSv:Ljava/lang/String;

    invoke-static {p1, v1, v2, v3}, Lcom/google/android/gms/common/internal/safeparcel/zzb;->zza(Landroid/os/Parcel;ILjava/lang/String;Z)V

    const/16 v1, 0x3e8

    iget v2, p0, Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;->mVersionCode:I

    invoke-static {p1, v1, v2}, Lcom/google/android/gms/common/internal/safeparcel/zzb;->zzc(Landroid/os/Parcel;II)V

    const/4 v1, 0x2

    iget-object v2, p0, Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;->zzSw:Ljava/util/List;

    invoke-static {p1, v1, v2, v3}, Lcom/google/android/gms/common/internal/safeparcel/zzb;->zzb(Landroid/os/Parcel;ILjava/util/List;Z)V

    const/4 v1, 0x3

    iget-object v2, p0, Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;->zzSx:Ljava/util/List;

    invoke-static {p1, v1, v2, v3}, Lcom/google/android/gms/common/internal/safeparcel/zzb;->zza(Landroid/os/Parcel;ILjava/util/List;Z)V

    const/4 v1, 0x4

    iget v2, p0, Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;->zzSy:I

    invoke-static {p1, v1, v2}, Lcom/google/android/gms/common/internal/safeparcel/zzb;->zzc(Landroid/os/Parcel;II)V

    const/4 v1, 0x5

    iget v2, p0, Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;->zzSz:I

    invoke-static {p1, v1, v2}, Lcom/google/android/gms/common/internal/safeparcel/zzb;->zzc(Landroid/os/Parcel;II)V

    invoke-static {p1, v0}, Lcom/google/android/gms/common/internal/safeparcel/zzb;->zzI(Landroid/os/Parcel;I)V

    return-void
.end method

# virtual methods
.method public synthetic createFromParcel(Landroid/os/Parcel;)Ljava/lang/Object;
    .registers 3
    .param p1, "x0"    # Landroid/os/Parcel;

    .prologue
    invoke-virtual {p0, p1}, Lcom/google/android/gms/auth/api/credentials/zze;->zzI(Landroid/os/Parcel;)Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;

    move-result-object v0

    return-object v0
.end method

.method public synthetic newArray(I)[Ljava/lang/Object;
    .registers 3
    .param p1, "x0"    # I

    .prologue
    invoke-virtual {p0, p1}, Lcom/google/android/gms/auth/api/credentials/zze;->zzaz(I)[Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;

    move-result-object v0

    return-object v0
.end method

.method public zzI(Landroid/os/Parcel;)Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;
    .registers 11

    const/4 v4, 0x0

    const/4 v6, 0x0

    invoke-static {p1}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzap(Landroid/os/Parcel;)I

    move-result v0

    move v5, v6

    move-object v3, v4

    move-object v2, v4

    move v1, v6

    :goto_a
    invoke-virtual {p1}, Landroid/os/Parcel;->dataPosition()I

    move-result v7

    if-ge v7, v0, :cond_3d

    invoke-static {p1}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzao(Landroid/os/Parcel;)I

    move-result v7

    invoke-static {v7}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzbM(I)I

    move-result v8

    sparse-switch v8, :sswitch_data_62

    invoke-static {p1, v7}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzb(Landroid/os/Parcel;I)V

    goto :goto_a

    :sswitch_1f
    invoke-static {p1, v7}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzp(Landroid/os/Parcel;I)Ljava/lang/String;

    move-result-object v2

    goto :goto_a

    :sswitch_24
    invoke-static {p1, v7}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzg(Landroid/os/Parcel;I)I

    move-result v1

    goto :goto_a

    :sswitch_29
    invoke-static {p1, v7}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzD(Landroid/os/Parcel;I)Ljava/util/ArrayList;

    move-result-object v3

    goto :goto_a

    :sswitch_2e
    invoke-static {p1, v7}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzC(Landroid/os/Parcel;I)Ljava/util/ArrayList;

    move-result-object v4

    goto :goto_a

    :sswitch_33
    invoke-static {p1, v7}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzg(Landroid/os/Parcel;I)I

    move-result v5

    goto :goto_a

    :sswitch_38
    invoke-static {p1, v7}, Lcom/google/android/gms/common/internal/safeparcel/zza;->zzg(Landroid/os/Parcel;I)I

    move-result v6

    goto :goto_a

    :cond_3d
    invoke-virtual {p1}, Landroid/os/Parcel;->dataPosition()I

    move-result v7

    if-eq v7, v0, :cond_5c

    new-instance v1, Lcom/google/android/gms/common/internal/safeparcel/zza$zza;

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "Overread allowed size end="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {v1, v0, p1}, Lcom/google/android/gms/common/internal/safeparcel/zza$zza;-><init>(Ljava/lang/String;Landroid/os/Parcel;)V

    throw v1

    :cond_5c
    new-instance v0, Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;

    invoke-direct/range {v0 .. v6}, Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;-><init>(ILjava/lang/String;Ljava/util/List;Ljava/util/List;II)V

    return-object v0

    :sswitch_data_62
    .sparse-switch
        0x1 -> :sswitch_1f
        0x2 -> :sswitch_29
        0x3 -> :sswitch_2e
        0x4 -> :sswitch_33
        0x5 -> :sswitch_38
        0x3e8 -> :sswitch_24
    .end sparse-switch
.end method

.method public zzaz(I)[Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;
    .registers 3

    new-array v0, p1, [Lcom/google/android/gms/auth/api/credentials/PasswordSpecification;

    return-object v0
.end method


text:
using namespace Microsoft::Graphics::Canvas;

TEST_CLASS(CanvasDrawingSessionTests)
{
    //
    // CanvasDrawingSession interop is tested more directly in test.internal.
    // This exercises the published API.
    //
    TEST_METHOD(CanvasDrawingSession_Interop)
    {
        ComPtr<ID2D1DeviceContext1> context = CreateTestD2DDeviceContext();

        auto drawingSession = GetOrCreate<CanvasDrawingSession>(context.Get());
        auto actualContext = GetWrappedResource<ID2D1DeviceContext1>(drawingSession);

        Assert::AreEqual(context.Get(), actualContext.Get());
    }

    //
    // Tests the projections of the state properties, and that they actually
    // call through to D2D.
    //
    TEST_METHOD(CanvasDrawingSession_StateProperties)
    {
        ComPtr<ID2D1DeviceContext1> context = CreateTestD2DDeviceContext();

        float3x2 someTransform = { 1, 2, 3, 4, 5, 6 };
        float3x2 identity = { 1, 0, 0, 1, 0, 0};

        context->SetAntialiasMode(D2D1_ANTIALIAS_MODE_ALIASED);
        context->SetPrimitiveBlend(D2D1_PRIMITIVE_BLEND_COPY);
        context->SetTextAntialiasMode(D2D1_TEXT_ANTIALIAS_MODE_ALIASED);
        context->SetTransform(reinterpret_cast<const D2D1_MATRIX_3X2_F*>(&someTransform));
        context->SetUnitMode(D2D1_UNIT_MODE_PIXELS);

        auto drawingSession = GetOrCreate<CanvasDrawingSession>(context.Get());

        Assert::AreEqual(CanvasAntialiasing::Aliased, drawingSession->Antialiasing);
        Assert::AreEqual(CanvasBlend::Copy, drawingSession->Blend);
        Assert::AreEqual(CanvasTextAntialiasing::Aliased, drawingSession->TextAntialiasing);
        Assert::AreEqual<float3x2>(someTransform, drawingSession->Transform);
        Assert::AreEqual(CanvasUnits::Pixels, drawingSession->Units);

        drawingSession->Antialiasing = CanvasAntialiasing::Antialiased;
        drawingSession->Blend = CanvasBlend::SourceOver;
        drawingSession->TextAntialiasing = CanvasTextAntialiasing::Auto;
        drawingSession->Transform = identity;
        drawingSession->Units = CanvasUnits::Dips;

        Assert::AreEqual(D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, context->GetAntialiasMode());
        Assert::AreEqual(D2D1_PRIMITIVE_BLEND_SOURCE_OVER, context->GetPrimitiveBlend());
        Assert::AreEqual(D2D1_TEXT_ANTIALIAS_MODE_DEFAULT, context->GetTextAntialiasMode());
        Assert::AreEqual(D2D1_UNIT_MODE_DIPS, context->GetUnitMode());

        float3x2 verifyTransform;
        context->GetTransform(reinterpret_cast<D2D1_MATRIX_3X2_F*>(&verifyTransform));
        Assert::AreEqual(identity, verifyTransform);
    }

    TEST_METHOD(CanvasDrawingSession_Interop_get_Device)
    {
        //
        // This verifes that the device retrieved from get_Device returns
        // something which is actually compatible with the drawing session.
        //
        CanvasDevice^ canvasDeviceA = ref new CanvasDevice();
        auto d2dDeviceA = GetWrappedResource<ID2D1Device1>(canvasDeviceA);
        ComPtr<ID2D1DeviceContext1> d2dDeviceContextA;
        ThrowIfFailed(d2dDeviceA->CreateDeviceContext(
            D2D1_DEVICE_CONTEXT_OPTIONS_NONE,
            &d2dDeviceContextA));

        auto drawingSessionA = GetOrCreate<CanvasDrawingSession>(d2dDeviceContextA.Get());

        CanvasDevice^ deviceB = drawingSessionA->Device;
        auto d2dDeviceB = GetWrappedResource<ID2D1Device1>(deviceB);

        Assert::AreEqual(d2dDeviceA.Get(), d2dDeviceB.Get());
    }
};


text:
export YAFRAINC=$TDBNODE/org.yafra.clibs/include
export YAFRALIBS=$TDBNODE/org.yafra.clibs/libs
export YAFRALIBPATH=$WORKNODE/libs
export INCX11=`$YAFRABIN/getx11inc`
export INCMOTIF=`$YAFRABIN/getmotifinc`
export LIBX11=`$YAFRABIN/getx11lib`
export LIBMOTIF=`$YAFRABIN/getmotiflib`

#
# setup control flags
#
export OMANUAL=
export OSHARED=1
export ODEBUG=1

#
# setup foundation LIBS
#
export PSSYSLIB=$YAFRALIBS/pssys
export PSMUMELIB=$YAFRALIBS/psmume
export PSIPCLIB=$YAFRALIBS/psipc
export PSSERCOMLIB=$YAFRALIBS/pssercom
export PSGUILIB=$YAFRALIBS/psgui
export PSMATRIXLIB=$YAFRALIBS/matrix
export PSMODULLIB=$YAFRALIBS/psmodul

export YAFRALIBSO=$WORKNODE/obj/libs
export PSSYSLIBO=$YAFRALIBSO
export PSIPCLIBO=$YAFRALIBSO
export PSMUMELIBO=$YAFRALIBSO
export PSSERCOMLIBO=$YAFRALIBSO
export PSMODULLIBO=$YAFRALIBSO
export PSGUILIBO=$YAFRALIBSO
export PSMATRIXLIBO=$YAFRALIBSO

#
# section: travelDB
#
#travelDB
export TDB=$TDBNODE/org.yafra.tdb.classic
export TDBCS=$TDB/csharp
export TDBS=$TDB
export TDBI=$MAPOS/include
export TDBSETUP=$TDBNODE/org.yafra.tdb.setup
export TDBDB=$YAFRADB/traveldb
export TDBO=$WORKNODE/obj/tdb

#set which database to use
export TDBMYSQL=1
#export TDBMSSQL=1
#export TDBORACLE=1
#export TDBORACLECLASSIC=1
#export TDBODBC=1

#
# add on's
#
export YAFRAADDONS=$TDBNODE
export CMDSRV=$TDBNODE/org.yafra.tdb.addons.cmdsrv
export PSWHAT=$TDBNODE/org.yafra.tdb.addons.pswhat
export PSEDIT=$TDBNODE/org.yafra.tdb.addons.psedit
export CMDSRVO=$WORKNODE/obj/addons
export PSWHATO=$WORKNODE/obj/addons
export PSEDITO=$WORKNODE/obj/addons
export TESTSUITEO=$WORKNODE/obj/testsuite

#
# depreciated
#
export MPDBMYSQL=$TDBMYSQL


text:
var flow = require('nimble');
var exec = require('child_process').exec;

function downloadNodeVersion(version, destination, callback) {
  var url = 'http://nodejs.org/dist/node-v' + version + '.tar.gz';
  var filepath = destination + '/' + version + '.tgz';
  exec('curl ' + url + ' >' + filepath, callback);
}

flow.series([
  function (callback) {
    flow.parallel([
      function (callback) {
        console.log('Downloading Node v0.4.6...');
        downloadNodeVersion('0.4.6', '/tmp', callback);
      },
      function (callback) {
        console.log('Downloading Node v0.4.7...');
        downloadNodeVersion('0.4.7', '/tmp', callback);
      }
    ], callback);
  },
  function(callback) {
    console.log('Creating archive of downloaded files...');
    exec(
      'tar cvf node_distros.tar /tmp/0.4.6.tgz /tmp/0.4.7.tgz',
      function(error, stdout, stderr) {
        console.log('All done!');
        callback();
      }
    );
  }
]);


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = hoursToSeconds;

var _index = _interopRequireDefault(require("../_lib/requiredArgs/index.js"));

var _index2 = require("../constants/index.js");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * @name hoursToSeconds
 * @category Conversion Helpers
 * @summary Convert hours to seconds.
 *
 * @description
 * Convert a number of hours to a full number of seconds.
 *
 * @param {number} hours - number of hours to be converted
 *
 * @returns {number} the number of hours converted in seconds
 * @throws {TypeError} 1 argument required
 *
 * @example
 * // Convert 2 hours to seconds:
 * const result = hoursToSeconds(2)
 * //=> 7200
 */
function hoursToSeconds(hours) {
  (0, _index.default)(1, arguments);
  return Math.floor(hours * _index2.secondsInHour);
}

module.exports = exports.default;


text:
<?php

namespace tests\codeception\backend\unit;

use yii\codeception\TestCase as TestCaseOld;

class TestCase extends TestCaseOld
{
    public $appConfig = '@tests/codeception/config/backend/unit.php';
}


text:
package org.ohdsi.webapi.versioning;

import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.ohdsi.webapi.AbstractDatabaseTest;
import org.ohdsi.webapi.service.dto.CommonEntityExtDTO;
import org.ohdsi.webapi.shiro.Entities.UserEntity;
import org.ohdsi.webapi.shiro.Entities.UserRepository;
import org.ohdsi.webapi.versioning.dto.VersionDTO;
import org.ohdsi.webapi.versioning.dto.VersionFullDTO;
import org.ohdsi.webapi.versioning.dto.VersionUpdateDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.ConversionService;
import org.springframework.util.ResourceUtils;

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Objects;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

public abstract class BaseVersioningTest<S extends CommonEntityExtDTO,
        T extends VersionFullDTO<?>, ID extends Number> extends AbstractDatabaseTest {
    protected S initialDTO;

    @Autowired
    protected UserRepository userRepository;

    @Autowired
    protected ConversionService conversionService;

    protected String getExpression(String path) throws IOException {
        File ple_spec = ResourceUtils.getFile(Objects.requireNonNull(this.getClass().getResource(path)));
        return FileUtils.readFileToString(ple_spec, StandardCharsets.UTF_8);
    }

    @Before
    public void createInitialData() throws IOException {
        UserEntity user = new UserEntity();
        user.setLogin("anonymous");
        userRepository.save(user);

        doCreateInitialData();
    }

    protected abstract void doCreateInitialData() throws IOException;

    @After
    public void clear() {
        doClear();
        userRepository.deleteAll();
    }

    @Test
    public void createAndGetVersion() throws Exception {
        S dto = getEntity(getId(initialDTO));
        dto.setName(dto.getName() + "__copy");
        updateEntity(dto);

        List<VersionDTO> versions = getVersions(getId(dto));
        assertEquals(1, versions.size());

        VersionDTO version = versions.get(0);
        T fullDTO = getVersion(getId(dto), version.getVersion());
        assertNotNull(fullDTO);

        checkClientDTOEquality(fullDTO);
    }

    @Test
    public void deleteVersion() throws Exception {
        S dto = getEntity(getId(initialDTO));
        dto.setName(dto.getName() + "__copy");
        updateEntity(dto);

        List<VersionDTO> versions = getVersions(getId(dto));
        assertEquals(1, versions.size());

        VersionDTO version = versions.get(0);
        deleteVersion(getId(dto), version.getVersion());

        versions = getVersions(getId(dto));
        assertTrue(versions.get(0).isArchived());
    }

    @Test
    public void createAndGetMultipleVersions() throws Exception {
        S dto = getEntity(getId(initialDTO));
        int count = 3;
        for (int i = 0; i < count; i++) {
            updateEntity(dto);
        }

        List<VersionDTO> versions = getVersions(getId(dto));
        assertEquals(count, versions.size());
    }

    @Test
    public void updateVersion() throws Exception {
        S dto = getEntity(getId(initialDTO));
        dto.setName(dto.getName() + "__copy");
        updateEntity(dto);

        List<VersionDTO> versions = getVersions(getId(dto));
        VersionDTO version = versions.get(0);

        VersionUpdateDTO updateDTO = new VersionUpdateDTO();
        updateDTO.setVersion(version.getVersion());
        updateDTO.setArchived(true);
        updateDTO.setComment("test comment");

        updateVersion(getId(dto), version.getVersion(), updateDTO);

        T fullDTO = getVersion(getId(dto), version.getVersion());
        version = fullDTO.getVersionDTO();
        assertEquals(version.getComment(), updateDTO.getComment());
        assertEquals(version.isArchived(), updateDTO.isArchived());
    }

    @Test
    public void copyAssetFromVersion() throws Exception {
        S dto = getEntity(getId(initialDTO));
        dto.setName(dto.getName() + "__copy");
        updateEntity(dto);

        List<VersionDTO> versions = getVersions(getId(dto));
        VersionDTO version = versions.get(0);

        S newDTO = copyAssetFromVersion(getId(dto), version.getVersion());
        checkServerDTOEquality(newDTO);
    }

    protected abstract void doClear();

    protected abstract void checkServerDTOEquality(S dto);

    protected abstract void checkClientDTOEquality(T dto);

    protected abstract List<VersionDTO> getVersions(ID id);

    protected abstract T getVersion(ID id, int version);

    protected abstract String getExpressionPath();

    protected abstract S getEntity(ID id);

    protected abstract S updateEntity(S dto) throws Exception;

    protected abstract S copyAssetFromVersion(ID id, int version);

    protected abstract void updateVersion(ID id, int version, VersionUpdateDTO updateDTO);

    protected abstract void deleteVersion(ID id, int version);

    protected abstract ID getId(S dto);
}


text:
<?php

$lang["error_no_permission_module"] = "Bu modüle erişim yetkiniz yok";
$lang["error_unknown"] = "bilinmeyen";


text:
Raspberry PI home automation for FireServiceRota

## Installation

- Setup your Raspberry Pi. See instructions [here](https://www.raspberrypi.org/documentation/setup/).
- Start your Raspberry Pi and open the [terminal](https://www.raspberrypi.org/documentation/usage/terminal/README.md).
- Execute the following commands to download the code for FirePi and install the required dependencies:

  ```
  wget https://github.com/rhomeister/firepi/archive/master.zip

  unzip master.zip

  cd firepi-master

  sudo apt-get -y install python-setuptools

  sudo python setup.py install
  ```

## Starting the program

- Execute `sudo python firepi` and follow the instructions


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

using MHApi.CameraLink.Imports;

namespace MHApi.CameraLink
{
    /// <summary>
    /// Represents a camera link board pulse
    /// that can be triggered from and emitted
    /// on various lines
    /// </summary>
    public class IMGPulse : IDisposable
    {
        #region Fields

        /// <summary>
        /// The id of the generated pulse
        /// </summary>
        uint _plsId;

        #endregion

        #region Constructor

        /// <summary>
        /// Creates a new pulse that is triggered based on an external line
        /// </summary>
        /// <param name="timeBase">The timebase of the pulse</param>
        /// <param name="delay">The ticks of the off-phase</param>
        /// <param name="width">The ticks of the on-phase</param>
        /// <param name="signalType">The type of trigger signal line</param>
        /// <param name="signalIdentifier">The trigger signal line identifier</param>
        /// <param name="signalPolarity">The polarity of the trigger signal</param>
        /// <param name="outputType">The type of pulse output line</param>
        /// <param name="outputNumber">The output line identifier</param>
        /// <param name="outputPolarity">The polarity of the on-phase</param>
        /// <param name="pulseMode">The pulse generation mode</param>
        public IMGPulse(PulseTimebase timeBase, uint delay, uint width, IMG_SIGNAL_TYPE signalType, uint signalIdentifier, TriggerPolarity signalPolarity, IMG_SIGNAL_TYPE outputType, uint outputNumber, PulsePolarity outputPolarity, PulseMode pulseMode)
        {
            NIImaq.CheckError(NIImaq.imgPulseCreate2(timeBase, delay, width, signalType, signalIdentifier, signalPolarity, outputType, outputNumber, outputPolarity, pulseMode, ref _plsId));
        }

        /// <summary>
        /// Creates a new pulse that is triggered based on an internal event/signal
        /// </summary>
        /// <param name="timeBase">The timebase of the pulse</param>
        /// <param name="delay">The ticks of the off-phase</param>
        /// <param name="width">The ticks of the on-phase</param>
        /// <param name="signalType">The type of trigger signal line</param>
        /// <param name="triggerEvent">The internal trigger event</param>
        /// <param name="signalPolarity">The polarity of the trigger signal</param>
        /// <param name="outputType">The type of pulse output line</param>
        /// <param name="outputNumber">The output line identifier</param>
        /// <param name="outputPolarity">The polarity of the on-phase</param>
        /// <param name="pulseMode">The pulse generation mode</param>
        public IMGPulse(PulseTimebase timeBase, uint delay, uint width, IMG_SIGNAL_TYPE signalType, InternalSignalIdentifier triggerEvent, TriggerPolarity signalPolarity, IMG_SIGNAL_TYPE outputType, uint outputNumber, PulsePolarity outputPolarity, PulseMode pulseMode)
        {
            if (signalType != IMG_SIGNAL_TYPE.IMG_SIGNAL_STATUS)
            {
                throw new ArgumentException("signalType","If an internal event is specified to trigger pulse generation, the signal type must be IMG_SIGNAL_STATUS!");
            }
            NIImaq.CheckError(NIImaq.imgPulseCreate2(timeBase, delay, width, signalType, triggerEvent, signalPolarity, outputType, outputNumber, outputPolarity, pulseMode, ref _plsId));
        }

        #endregion

        #region Methods

        /// <summary>
        /// Arms a triggered pulse to be run on the
        /// configured session
        /// </summary>
        /// <param name="sessionId">The session to which the pulse should be associated</param>
        public void Start(uint sessionId)
        {
            NIImaq.CheckError(NIImaq.imgPulseStart(_plsId, sessionId));
        }

        /// <summary>
        /// Stops pulse generation
        /// </summary>
        public void Stop()
        {
            NIImaq.CheckError(NIImaq.imgPulseStop(_plsId));
        }

        #endregion

        #region Cleanup

        public bool IsDisposed { get; private set; }

		protected virtual void Dispose(bool disposing)
		{
			if (IsDisposed)
				return;
            if (NIImaq.imgPulseDispose(_plsId) != 0)
                System.Diagnostics.Debug.WriteLine("Could not dispose pulse");
		}

		public void Dispose()
		{
			Dispose(true);
            IsDisposed = true;
		}

		~IMGPulse()
		{
			if (!IsDisposed)
            {
                Dispose(false);
			}
		}

		#endregion
    }
}


text:
var common = require("ui/list-picker/list-picker-common");
var types = require("utils/types");
global.moduleMerge(common, exports);
var ListPicker = (function (_super) {
    __extends(ListPicker, _super);
    function ListPicker() {
        _super.call(this);
    }
    Object.defineProperty(ListPicker.prototype, "android", {
        get: function () {
            return this._android;
        },
        enumerable: true,
        configurable: true
    });
    ListPicker.prototype._createUI = function () {
        this._android = new android.widget.NumberPicker(this._context);
        this._android.setDescendantFocusability(android.widget.NumberPicker.FOCUS_BLOCK_DESCENDANTS);
        this._android.setMinValue(0);
        this._android.setMaxValue(0);
        this._android.setValue(0);
        var that = new WeakRef(this);
        this._formatter = new android.widget.NumberPicker.Formatter({
            get owner() {
                return that.get();
            },
            format: function (index) {
                if (this.owner) {
                    return this.owner._getItemAsString(index);
                }
                return " ";
            }
        });
        this._android.setFormatter(this._formatter);
        this._valueChangedListener = new android.widget.NumberPicker.OnValueChangeListener({
            get owner() {
                return that.get();
            },
            onValueChange: function (picker, oldVal, newVal) {
                if (this.owner) {
                    this.owner._onPropertyChangedFromNative(common.ListPicker.selectedIndexProperty, newVal);
                }
            }
        });
        this._android.setOnValueChangedListener(this._valueChangedListener);
        var mInputTextField = java.lang.Class.forName("android.widget.NumberPicker").getDeclaredField("mInputText");
        mInputTextField.setAccessible(true);
        this._editText = mInputTextField.get(this._android);
        this._editText.setFilters([]);
        this._editText.setText(" ", android.widget.TextView.BufferType.NORMAL);
    };
    ListPicker.prototype._onSelectedIndexPropertyChanged = function (data) {
        _super.prototype._onSelectedIndexPropertyChanged.call(this, data);
        if (this.android && types.isNumber(data.newValue)) {
            this.android.setValue(data.newValue);
        }
    };
    ListPicker.prototype._onItemsPropertyChanged = function (data) {
        if (this.android) {
            if (!data.newValue || !data.newValue.length) {
                this.android.setMaxValue(0);
            }
            else {
                this.android.setMaxValue(data.newValue.length - 1);
            }
            this.android.setWrapSelectorWheel(false);
        }
        this._updateSelectedIndexOnItemsPropertyChanged(data.newValue);
        this._fixNumberPickerRendering();
    };
    ListPicker.prototype._fixNumberPickerRendering = function () {
        if (!this.android) {
            return;
        }
        this.android.setFormatter(null);
        this.android.setFormatter(this._formatter);
        if (this._editText) {
            this._editText.setFilters([]);
        }
        this._editText.invalidate();
        this.android.invalidate();
    };
    return ListPicker;
})(common.ListPicker);
exports.ListPicker = ListPicker;


text:
#region S# License

#endregion S# License
using System.Linq;
using System.Xml.Linq;

namespace XMLCommToHTM
{
	using Ecng.Common;

	public static class XMLUtils
	{
		private static Navigation _nav;

		public static XElement GetTagInnerXml(XElement docInfo, string tag, Navigation nav, bool addCss)
		{
			_nav = nav;

			if (docInfo == null)
				return null;

			ReplaceSee(docInfo);
			var s = docInfo.Elements(tag).Select(e => GetInnerXmlPriv(e, addCss)).ToArray();

			if (s.Length == 0)
				return null;

			return new XElement("span", s);
		}
		//public static string GetTagText2(XElement docInfo, string tag)
		//{
		//	return GetTagText(docInfo, tag, _=>_.Value);
		//}

		public static XElement ToSpan(this string content)
		{
			return new XElement("span", content);
		}

		public static XElement GetInnerXml(XElement elem, Navigation nav)
		{
			_nav = nav;
			return GetInnerXmlPriv(elem, false);
		}

		static XElement GetInnerXmlPriv(XElement elem, bool addCss)
		{
			if (elem == null)
				return null;

			ReplaceSee(elem);

			using (var r = elem.CreateReader(ReaderOptions.OmitDuplicateNamespaces))
			{
				r.MoveToContent();
				var str = r.ReadInnerXml().Trim();

				//if (str.FirstOrDefault() != '<')
				str = "<span>{0}</span>".Put(str);

				var retVal = new XElement("div", XElement.Parse(str));

				if (addCss)
					retVal.Add(new XAttribute("class", "doc_" + elem.Name));

				return retVal;
			}
		}

		/// <summary>
		/// Создает элемент, и добавляет содержимое innerXML как XML содержимое, а не как строку
		/// Т.е. при создании не делает escape для строки xmlPart.
		/// Другого способа не нашлось
		/// </summary>
		/// <param name="tagName"></param>
		/// <param name="innerXml"></param>
		/// <returns></returns>
		public static XElement NewXElement(string tagName, string innerXml)
		{
			string s2 = string.Format("<{0}>{1}</{0}>",tagName,innerXml);
			return XElement.Parse(s2, LoadOptions.PreserveWhitespace);
		}

		static void ReplaceSee(XElement elem)
		{
			var see=elem.Descendants("see").ToArray();

			for (int i = 0; i < see.Length; i++)
			{
				if (see[i].Attribute("cref") == null)
				{
					see[i].AddAfterSelf("");
				}
				else
				{
					var s = see[i].Attribute("cref").Value.Substring(2);
					var link = GenerateHtml.BuildUrl(s, _nav.GetSeeTagHref(s));
					see[i].AddAfterSelf(link);
				}
				see[i].Remove();
			}

		}
		//System.Security.SecurityElement.Escape(xml);

	}
}


text:
using namespace std;

//ToDo: use a ini serializer to save settings.
//The reason that two diffrent libs should be used is that the parser only libs are usualy faster than the serialaztion and parser libs.
char* defaultSettings = ";DownloadMii Config File\n[DownloadMii]             ; Main configuration\nnightly=true    	   ; Ex: true\nautoUpdate=true	       ; Ex: true\nthemePath=\"none\" 	   ; Ex: \"/3ds/downloadmii/flatTheme.dmt\"\n"; //used when the file is not found, invalid or corrupt, empty
Settings_s settings;

Result settingsInit(char* settingsPath){
	char mkdbuffer[1024];
	snprintf(mkdbuffer, 256, "/%s/%s", HBPATH, "downloadmii");
	mkdir(HBPATH, 0777);
	mkdir(mkdbuffer, 0777); //In case the "DownladMii" folder doesnt exist

	//Load data
	string data;
	char *file_contents;
	long input_file_size;
	FILE *input_file = fopen(settingsPath, "ab+");
	fseek(input_file, 0, SEEK_END);
	input_file_size = ftell(input_file);
	rewind(input_file);
	file_contents = (char*)malloc(input_file_size * (sizeof(char)));
	fread(file_contents, sizeof(char), input_file_size, input_file);
	fclose(input_file);
	data = file_contents;
	if (file_contents == NULL || file_contents == 0) {
		print("Error, ini file NULL!\n");
		print("settingsInit: resetting/creating settings file... ");
		createSettings();
		print("Done!\n");
		print("settingsInit: re-running function...\n");
		settingsInit(settingsPath);
	}

	CSimpleIniA ini(false,false,false);
	SI_Error rc = ini.LoadData(data);

    if (rc < 0) {
        print("Error, cant parse ini file(might be null)\n");
		print("settingsInit: resetting/creating settings file... ");
		createSettings();
		print("Done!\n");
		print("settingsInit: re-running function...\n");
		settingsInit(settingsPath);
    }
	else{
		settings.nightly = ini.GetBoolValue("DownloadMii", "nightly", false);
		settings.autoUpdate = ini.GetBoolValue("DownloadMii", "autoUpdate", false);
		settings.themePath = ini.GetValue("DownloadMii", "themePath", "none");
		settings.acceptedBeta = ini.GetBoolValue("DownloadMii", "acceptedBeta", false);
		settings.fileContent = file_contents;
	}
	return 0;
}

Result settingsExit(char* settingsPath) {
	char buffer[2046];
	CSimpleIniA ini(false, false, false);

	print("settings: applying changes...");
	ini.SetBoolValue("DownloadMii", "acceptedBeta", settings.acceptedBeta,	";True if the user have accepted the beta agreement.");
	ini.SetBoolValue("DownloadMii", "autoUpdate", settings.autoUpdate,		";Auto download new updates. (Unused)");
	ini.SetValue("DownloadMii", "themePath", settings.themePath.c_str(),	";Path to theme. (Unused)");
	ini.SetBoolValue("DownloadMii", "nightly", settings.nightly,			";Receive nightly builds. (Unused)");
	ini.Save(settings.fileContent);
	print(" Done\nsettings: saving file...");
	FILE *fp;
	fp = fopen(settingsPath, "w+");
	snprintf(buffer, 256, "%s", settings.fileContent.c_str());
	fprintf(fp, buffer);
	fclose(fp);
	print(" Done\n");
	return 0;
}

Result createSettings(){
	mkdir("sdmc:/3ds/downloadmii", 0777);
	FILE *fh = fopen("sdmc:/3ds/downloadmii/settings.ini", "w+");
	if ( fh != NULL )
	{
		fprintf(fh, defaultSettings);
		fclose(fh);
		print("createSettings: settings.ini generated!\n");
		return 0;
	}
	else{
		print("createSettings: Error, couldnt create file settings.ini\n");
	}
	return -1;
}


text:
layout: page
title: Squad Systems Executive Retreat
date: 2016-05-24
author: Jeffrey Allen
tags: weekly links, java
status: published
summary: Nulla congue felis hendrerit, ultrices nibh sed.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 04/17/2016
  endDate: 04/19/2016
  ctyhocn: SLCHSHX
  groupCode: SSER
published: true
---
Maecenas non mauris mi. Nunc porttitor ultrices arcu sit amet dignissim. Quisque ut vehicula lorem. Phasellus porta tincidunt euismod. Proin aliquam, erat a gravida pulvinar, mi arcu bibendum sem, volutpat feugiat arcu tellus ut lectus. Fusce massa magna, imperdiet at pharetra vitae, condimentum eu magna. Curabitur eu eleifend tellus, eget porttitor velit. Nam vitae dolor vel risus congue fermentum ut et risus. Curabitur a nunc faucibus, venenatis est eu, laoreet mi. Pellentesque porttitor consequat justo ultricies gravida. Ut placerat arcu nec facilisis malesuada.

1 Pellentesque ullamcorper nibh at dapibus ultrices
1 Phasellus a nisl elementum, dictum urna eu, volutpat nunc.

Phasellus quis urna ut metus pharetra maximus nec sit amet augue. Sed vitae efficitur sem. Sed sed sollicitudin metus. Donec mattis id mi et convallis. Donec vitae augue quis erat vestibulum bibendum nec sed elit. Aliquam posuere enim quis hendrerit hendrerit. Quisque purus lacus, sagittis eu dolor at, iaculis consequat orci.
Cras aliquam purus eu nisi porta, vitae suscipit sapien gravida. Morbi quis enim faucibus, hendrerit est molestie, efficitur nunc. Pellentesque in commodo sem. Fusce euismod mauris pellentesque, pretium ante vitae, auctor justo. Suspendisse convallis sapien at pulvinar ultricies. Maecenas ullamcorper sem lorem. Etiam ligula lorem, pretium pharetra turpis volutpat, elementum sodales arcu. Nunc sed enim mollis tortor congue ornare nec at orci. Nulla id mi tincidunt, tincidunt lectus vitae, faucibus lectus. Proin rutrum mi nisi, eget fringilla tortor dapibus sed. Aliquam porta sed urna a faucibus.


text:
package com.lyokone.location.location.providers.locationprovider;

import android.app.Activity;
import android.content.Context;
import android.content.IntentSender.SendIntentException;
import android.location.Location;
import android.os.Looper;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.android.gms.common.api.ResolvableApiException;
import com.google.android.gms.location.FusedLocationProviderClient;
import com.google.android.gms.location.LocationCallback;
import com.google.android.gms.location.LocationRequest;
import com.google.android.gms.location.LocationResult;
import com.google.android.gms.location.LocationServices;
import com.google.android.gms.location.LocationSettingsRequest;
import com.google.android.gms.location.LocationSettingsResponse;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.lyokone.location.location.constants.RequestCode;

class GooglePlayServicesLocationSource extends LocationCallback {

    private final FusedLocationProviderClient fusedLocationProviderClient;
    private final LocationRequest locationRequest;
    private final SourceListener sourceListener;

    interface SourceListener extends OnSuccessListener<LocationSettingsResponse>, OnFailureListener {
        void onSuccess(LocationSettingsResponse locationSettingsResponse);

        void onFailure(@NonNull Exception exception);

        void onLocationResult(@Nullable LocationResult locationResult);

        void onLastKnowLocationTaskReceived(@NonNull Task<Location> task);
    }

    GooglePlayServicesLocationSource(Context context, LocationRequest locationRequest, SourceListener sourceListener) {
        this.sourceListener = sourceListener;
        this.locationRequest = locationRequest;
        this.fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);
    }

    void checkLocationSettings() {
        LocationServices.getSettingsClient(fusedLocationProviderClient.getApplicationContext())
                .checkLocationSettings(
                        new LocationSettingsRequest.Builder()
                                .addLocationRequest(locationRequest)
                                .build()
                )
                .addOnSuccessListener(new OnSuccessListener<LocationSettingsResponse>() {
                    @Override
                    public void onSuccess(LocationSettingsResponse locationSettingsResponse) {
                        if (sourceListener != null)
                            sourceListener.onSuccess(locationSettingsResponse);
                    }
                })
                .addOnFailureListener(new OnFailureListener() {
                    @Override
                    public void onFailure(@NonNull Exception exception) {
                        if (sourceListener != null) sourceListener.onFailure(exception);
                    }
                });
    }

    void startSettingsApiResolutionForResult(@NonNull ResolvableApiException resolvable, Activity activity) throws SendIntentException {
        resolvable.startResolutionForResult(activity, RequestCode.SETTINGS_API);
    }

    @SuppressWarnings("ResourceType")
    void requestLocationUpdate() {
        // This method is suited for the foreground use cases
        fusedLocationProviderClient.requestLocationUpdates(locationRequest, this, Looper.myLooper());
    }

    @NonNull
    Task<Void> removeLocationUpdates() {
        return fusedLocationProviderClient.removeLocationUpdates(this);
    }

    @SuppressWarnings("ResourceType")
    void requestLastLocation() {
        fusedLocationProviderClient.getLastLocation()
                .addOnCompleteListener(new OnCompleteListener<Location>() {
                    @Override
                    public void onComplete(@NonNull Task<Location> task) {
                        if (sourceListener != null)
                            sourceListener.onLastKnowLocationTaskReceived(task);
                    }
                });
    }

    @Override
    public void onLocationResult(@Nullable LocationResult locationResult) {
        if (sourceListener != null) sourceListener.onLocationResult(locationResult);
    }

}


text:
<?php

/** Zend_Oauth_Signature_SignatureAbstract */
require_once 'Zend/Oauth/Signature/SignatureAbstract.php';

/**
 * @category   Zend
 * @package    Zend_Oauth
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Oauth_Signature_Plaintext extends Zend_Oauth_Signature_SignatureAbstract
{
    /**
     * Sign a request
     *
     * @param  array $params
     * @param  null|string $method
     * @param  null|string $url
     * @return string
     */
    public function sign(array $params, $method = null, $url = null)
    {
        if ($this->_tokenSecret === null) {
            return $this->_consumerSecret . '&';
        }
        $return = implode('&', array($this->_consumerSecret, $this->_tokenSecret));
        return $return;
    }
}


text:
package com.github.xsavikx.androidscreencast.ui;

import com.android.ddmlib.IDevice;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

public final class JDialogDeviceList extends JDialog implements ActionListener {

    private static final long serialVersionUID = -3719844308147203239L;
    private static final String DEFAULT_HOST = "127.0.0.1";
    private static final int DEFAULT_PORT = 1324;

    private final JTextField jtfHost = new JTextField(DEFAULT_HOST);
    private final JFormattedTextField jftfPort = new JFormattedTextField(DEFAULT_PORT);
    private final JList<IDevice> jlDevices = new JList<>();
    private final JPanel jpAgent = new JPanel();
    private final JPanel jpButtons = new JPanel();
    private final JButton jbOk = new JButton("OK");
    private final JButton jbQuit = new JButton("Quit");

    private boolean cancelled = false;
    private final IDevice[] devices;

    public JDialogDeviceList(IDevice[] devices) {
        super();
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        setModal(true);
        this.devices = devices;
        initialize();
    }

    @Override
    public void actionPerformed(ActionEvent arg0) {
        if (arg0.getSource() == jbQuit) {
            this.dispose();
        }
    }

    public IDevice getDevice() {
        if (cancelled)
            return null;
        return jlDevices.getSelectedValue();
    }

    private void initialize() {
        setTitle("Please select a device");
        jlDevices.setListData(devices);
        jlDevices.setPreferredSize(new Dimension(400, 300));
        if (devices.length != 0)
            jlDevices.setSelectedIndex(0);
        jbOk.setEnabled(!jlDevices.isSelectionEmpty());

        jpAgent.setBorder(BorderFactory.createTitledBorder("Agent"));
        jpAgent.setLayout(new BorderLayout(10, 10));
        jpAgent.add(jtfHost, BorderLayout.CENTER);
        jpAgent.add(jftfPort, BorderLayout.EAST);

        jpButtons.setLayout(new FlowLayout(FlowLayout.RIGHT));
        jpButtons.add(jbOk, BorderLayout.CENTER);
        jpButtons.add(jbQuit, BorderLayout.SOUTH);

        JPanel jpBottom = new JPanel();
        jpBottom.setLayout(new BorderLayout());
        jpBottom.add(jpAgent, BorderLayout.CENTER);
        jpBottom.add(jpButtons, BorderLayout.SOUTH);

        setLayout(new BorderLayout());
        add(jlDevices, BorderLayout.CENTER);
        add(jpBottom, BorderLayout.SOUTH);

        pack();
        setLocationRelativeTo(null);

        jbOk.addActionListener(this);
        jbQuit.addActionListener(this);
        jlDevices.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                if (e.getClickCount() == 2) {
                    int index = jlDevices.locationToIndex(e.getPoint());
                    jlDevices.ensureIndexIsVisible(index);
                    cancelled = false;
                    setVisible(false);
                }
            }

        });
    }
}


text:
using System.IO;
using Amazon;
using Amazon.Runtime;
using Amazon.S3;
using Amazon.S3.Model;
using Amazon.SQS;
using GzipS3Client.Configuration;
using GzipS3Client.Extensions;

namespace GzipS3Client
{
    public class AmazonStorageService : IStorageService
    {
        private readonly IAmazonS3Configuration _s3Configuration;

        public AmazonStorageService(IAmazonS3Configuration s3Configuration)
        {
            _s3Configuration = s3Configuration;
        }

        private IAmazonS3 CreateS3Client()
        {
            var accessKey = _s3Configuration.AccessKey;
            var secretKey = _s3Configuration.SecretKey;

            var client = new AmazonS3Client(new BasicAWSCredentials(accessKey, secretKey), new AmazonS3Config { ServiceURL = _s3Configuration.ServiceUrl });

            return client;
        }

        public void Save(IFileContent fileContent)
        {
            var client = CreateS3Client();

            using (var stream = new MemoryStream(fileContent.Content))
            {
                var bytesCompressed = stream.GzipCompress();

                using (var compressedStream = new MemoryStream(bytesCompressed))
                {
                    var putRequest = new PutObjectRequest
                    {
                        CannedACL = S3CannedACL.Private,
                        BucketName = _s3Configuration.BucketName,
                        InputStream = compressedStream,
                        Key = fileContent.Key,
                    };

                    client.PutObject(putRequest);
                }
            }
        }

        public string CreateUrl(IFileContent fileContent)
        {
            return CreateUrl(fileContent.Key);
        }

        public string CreateUrl(string key)
        {
            var serviceUrlWithBucketName = _s3Configuration.ServiceUrl.Replace("http://s3-", string.Format("http://{0}.s3-", _s3Configuration.BucketName));

            if (serviceUrlWithBucketName.EndsWith("/"))
            {
                return serviceUrlWithBucketName + key;
            }

            return serviceUrlWithBucketName + "/" + key;
        }

        public IFileContent Get(string key)
        {
            var client = CreateS3Client();

            var getRequest = new GetObjectRequest
            {
                BucketName = _s3Configuration.BucketName,
                Key = key
            };

            var response = client.GetObject(getRequest);
            var responseBytes = response.ResponseStream.ReadBytes();
            var content = responseBytes.GzipDescompress().ReadBytes();

            return new FileContent(key, content);
        }

        public void Delete(string key)
        {
            var client = CreateS3Client();

            var deleteRequest = new DeleteObjectRequest
            {
                BucketName = _s3Configuration.BucketName,
                Key = key,
            };

            client.DeleteObject(deleteRequest);
        }

        public bool ContainsFile(string key)
        {
            var client = CreateS3Client();

            try
            {
                client.GetObjectMetadata(new GetObjectMetadataRequest
                {
                    BucketName = _s3Configuration.BucketName,
                    Key = key,
                });

                return true;
            }
            catch (AmazonS3Exception ex)
            {
                if (ex.StatusCode == System.Net.HttpStatusCode.NotFound) return false;
                return false;
            }
        }
    }
}


text:
  {{ entry.who }}
  reordered policies in
  {{ entry.organizationId }}
  /
  {{ entry.entityId }}
  version
  {{ entry.entityVersion }}.


text:
package com.getbase.android.db.provider;

import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.OperationApplicationException;
import android.database.Cursor;
import android.net.Uri;
import android.os.RemoteException;

import java.util.ArrayList;

class ContentResolverCrudHandler implements CrudHandler {

  private final ContentResolver contentResolver;

  ContentResolverCrudHandler(ContentResolver contentResolver) {
    this.contentResolver = contentResolver;
  }

  @Override
  public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String orderBy) {
    return contentResolver.query(uri, projection, selection, selectionArgs, orderBy);
  }

  @Override
  public Uri insert(Uri uri, ContentValues values) {
    return contentResolver.insert(uri, values);
  }

  @Override
  public ContentProviderResult[] applyBatch(String authority, ArrayList<ContentProviderOperation> operations) throws RemoteException, OperationApplicationException {
    return contentResolver.applyBatch(authority, operations);
  }

  @Override
  public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
    return contentResolver.update(uri, values, selection, selectionArgs);
  }

  @Override
  public int delete(Uri uri, String selection, String[] selectionArgs) {
    return contentResolver.delete(uri, selection, selectionArgs);
  }
}


text:
module Bebox
  class ProvisionWizard
    include Bebox::Logger
    include Bebox::WizardsHelper
    # Apply a step for the nodes in a environment
    def apply_step(project_root, environment, step)
      # Check if environment has configured the ssh keys
      (return warn _('wizard.provision.ssh_key_advice')%{environment: environment}) unless Bebox::Environment.check_environment_access(project_root, environment)
      nodes_to_step = Bebox::Node.nodes_in_environment(project_root, environment, previous_checkpoint(step))
      # Check if there are nodes for provisioning step-N
      (return warn _('wizard.provision.no_provision_nodes')%{step: step}) unless nodes_to_step.count > 0
      nodes_for_provisioning(nodes_to_step, step)
      # Apply the nodes provisioning for step-N
      in_step_nodes = Bebox::Node.list(project_root, environment, "steps/#{step}")
      outputs = []
      nodes_to_step.each do |node|
        next unless check_node_to_step(node, in_step_nodes, step)
        outputs << provision_step_in_node(project_root, environment, step, in_step_nodes, node)
      end
      return outputs
    end

    def provision_step_in_node(project_root, environment, step, in_step_nodes, node)
      title _('wizard.provision.title')%{step: step, hostname: node.hostname}
      generate_pre_provision_files(project_root, step, node)
      provision = Bebox::Provision.new(project_root, environment, node, step)
      output = provision.apply.success?
      output ? (ok _('wizard.provision.apply_success')%{hostname: node.hostname, step: step}) : (error _('wizard.provision.apply_failure')%{step: step, hostname: node.hostname})
      return output
    end

    def generate_pre_provision_files(project_root, step, node)
      role = Bebox::Provision.role_from_node(project_root, step, node.hostname)
      profiles = Bebox::Provision.profiles_from_role(project_root, role) unless role.nil?
      # Before apply generate the Puppetfile with modules from all associated profiles
      Bebox::Provision.generate_puppetfile(project_root, step, profiles) unless profiles.nil?
      # Before apply generate the roles and profiles modules structure for puppet step
      Bebox::Provision.generate_roles_and_profiles(project_root, step, role, profiles)
    end

    def check_node_to_step(node, in_step_nodes, step)
      return true unless in_step_nodes.include?(node.hostname)
      confirm_action?(_('wizard.provision.confirm_reprovision')%{hostname: node.hostname, step: step, start: node.checkpoint_parameter_from_file('steps/' + step, 'started_at'), end: node.checkpoint_parameter_from_file('steps/' + step, 'finished_at')})
    end

    def nodes_for_provisioning(nodes, step)
      title _('wizard.provision.nodes_title')%{step: step}
      nodes.each{|node| msg(node.hostname)}
      linebreak
    end

    # Obtain the previous checkpoint (step/phase) for a node
    def previous_checkpoint(step)
      case step
        when 'prepared_nodes'
          'nodes'
        when 'step-0'
          'prepared_nodes'
        when 'step-1'
          'steps/step-0'
        when 'step-2'
          'steps/step-1'
        when 'step-3'
          'steps/step-2'
      end
    end
  end
end


text:
$(window).unload(function() {
  $.rails.enableFormElements($($.rails.formSubmitSelector));
});


text:
import { RECEIVE_SUSPECTED_PLAGIARISM } from "../constants";

const initialState = {
  revisions: [],
  loading: true
};

export default function suspectedPlagiarism(state = initialState, action) {
  switch (action.type) {
    case RECEIVE_SUSPECTED_PLAGIARISM: {
      return {
        revisions: action.payload.data.revisions,
        loading: false
      };
    }
    default:
      return state;
  }
}


text:
title: Istio 0.6
weight: 95
icon: /img/notes.svg
---

In addition to the usual pile of bug fixes and performance improvements, this release includes the new or
updated features detailed below.

{{< relnote_links >}}

## Networking

- **Custom Envoy Configuration**. Pilot now supports ferrying custom Envoy configuration to the
proxy. [Learn more](https://github.com/mandarjog/istioluawebhook)

## Mixer adapters

- **SolarWinds**. Mixer can now interface to AppOptics and Papertrail.
[Learn more](/docs/reference/config/policy-and-telemetry/adapters/solarwinds/)

- **Redis Quota**. Mixer now supports a Redis-based adapter for rate limit tracking.
[Learn more](/docs/reference/config/policy-and-telemetry/adapters/redisquota/)

- **Datadog**. Mixer now provides an adapter to deliver metric data to a Datadog agent.
[Learn more](/docs/reference/config/policy-and-telemetry/adapters/datadog/)

## Other

- **Separate Check & Report Clusters**. When configuring Envoy, it's now possible to use different clusters
for Mixer instances that are used for Mixer's Check functionality from those used for Mixer's Report
functionality. This may be useful in large deployments for better scaling of Mixer instances.

- **Monitoring Dashboards**. There are now preliminary Mixer & Pilot monitoring dashboard in Grafana.

- **Servicegraph Visualization**. Servicegraph has a new visualization. [Learn more](/docs/tasks/telemetry/servicegraph/).

- **Liveness and Readiness Probes**. Istio components now provide canonical liveness and readiness
probe support to help ensure mesh infrastructure health. [Learn more](/docs/tasks/security/health-check/)

- **Egress Policy and Telemetry**. Istio can monitor traffic to external services defined by `EgressRule` or External Service. Istio can also apply
Mixer policies on this traffic.


text:
#ifndef OPENCVWRAPPER_H
#define OPENCVWRAPPER_H

#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/opencv.hpp>

#include <QImage>
#include <QRect>
#include <QVector>

#define USE_DLIB_DETECTOR

class OpenCvWrapper
{
public:
    static OpenCvWrapper& Instance();
    QVector<QRect> detectFaceRects(const cv::Mat&/*IplImage**/, bool oneFace=false);
    QVector<QRect> detectFaceRects(const QImage*, bool oneFace=false);

    QVector<std::pair<QRect,QImage> > detectFaces(const QVector<QRect>& faceRects, const QImage& image);

    enum FilterType{
        None, Noise, Smooth, Erode, Dilate, Morphology, Threshold, Sharpness, Brightness, Blackout, Sobel, Laplace
    };

    QImage putFilter(QImage* srcImage, FilterType filterType, int level=1);
private:
    OpenCvWrapper();
    OpenCvWrapper(const OpenCvWrapper&);
    OpenCvWrapper& operator=(const OpenCvWrapper&);
#ifdef USE_DLIB_DETECTOR
    cv::CascadeClassifier  face_cascade,eye_cascade;
#endif
    void loadCascade(cv::CascadeClassifier& cascade, const char* filename);
    //CvMemStorage* storage;

};

#endif // OPENCVWRAPPER_H


text:
@(request: RequestHeader)

Handler Not Found

You requested: @request.path


text: A Richtext Element based on Ckeditor


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is Mozilla Communicator client code, released
 * March 31, 1998.
 *
 * The Initial Developer of the Original Code is
 * Netscape Communications Corporation.
 * Portions created by the Initial Developer are Copyright (C) 1998
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

gTestfile = 'continue.js';

/**
   Filename:     continue.js
   Description:  'Tests the continue statement'

   Author:       Nick Lerissa
   Date:         March 18, 1998
*/

var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
var VERSION = 'no version';
startTest();
var TITLE   = 'statements: continue';

writeHeaderToLog("Executing script: continue.js");
writeHeaderToLog( SECTION + " "+ TITLE);

var i,j;

j = 0;
for (i = 0; i < 200; i++)
{
  if (i == 100)
    continue;
  j++;
}

// '"continue" in a "for" loop'
new TestCase ( SECTION, '"continue" in "for" loop',
	       199, j);

j = 0;
out1:
for (i = 0; i < 1000; i++)
{
  if (i == 100)
  {
  out2:
    for (var k = 0; k < 1000; k++)
    {
      if (k == 500) continue out1;
    }
    j = 3000;
  }
  j++;
}

// '"continue" in a "for" loop with a "label"'
new TestCase ( SECTION, '"continue" in "for" loop with a "label"',
	       999, j);

i = 0;
j = 1;

while (i != j)
{
  i++;
  if (i == 100) continue;
  j++;
}

// '"continue" in a "while" loop'
new TestCase ( SECTION, '"continue" in a "while" loop',
	       100, j );

j = 0;
i = 0;
out3:
while (i < 1000)
{
  if (i == 100)
  {
    var k = 0;
  out4:
    while (k < 1000)
    {
      if (k == 500)
      {
	i++;
	continue out3;
      }
      k++;
    }
    j = 3000;
  }
  j++;
  i++;
}

// '"continue" in a "while" loop with a "label"'
new TestCase ( SECTION, '"continue" in a "while" loop with a "label"',
	       999, j);

i = 0;
j = 1;

do
{
  i++;
  if (i == 100) continue;
  j++;
} while (i != j);

// '"continue" in a "do" loop'
new TestCase ( SECTION, '"continue" in a "do" loop',
	       100, j );

j = 0;
i = 0;
out5:
do
{
  if (i == 100)
  {
    var k = 0;
  out6:
    do
    {
      if (k == 500)
      {
	i++;
	continue out5;
      }
      k++;
    }while (k < 1000);
    j = 3000;
  }
  j++;
  i++;
}while (i < 1000);

// '"continue" in a "do" loop with a "label"'
new TestCase ( SECTION, '"continue" in a "do" loop with a "label"',
	       999, j);

test();


text:
import gql from 'graphql-tag';

export const GenerateSipConfig = gql`
  mutation GenerateSipConfig($phoneNumber: String!) {
    generateSipConfig(input: { phoneNumber: $phoneNumber }) {
      config
    }
  }
`;

export const UpdateDialer = gql`
  mutation updateDialer($phoneNumber: String!) {
    updateDialer(input: { phoneNumber: $phoneNumber }) @client {
      phoneNumber
    }
  }
`;


text:
package localvicinity.localvicinity.com.localvicinity;

/**
 * Created by Tim on 2/19/2015.
 */

import java.util.Comparator;

public class DistanceComporator implements Comparator<MyLocation> {

    @Override
    public int compare(MyLocation a, MyLocation b) {
        return a.getDistance() - b.getDistance(); // Ascending
    }
}


text:
  Tarnac est
       un village
       situé dans le département de Corrèze en Limousin. Elle comptait 331 habitants en 2008.

Si vous pensez emmenager à Tarnac, vous pourrez aisément trouver une maison à acheter.

À proximité de Tarnac sont positionnées géographiquement les villes de
Saint-Hilaire-les-Courbes située à 11 km, 162 habitants,
Nedde située à 10 km, 537 habitants,
La Villedieu à 7 km, 48 habitants,
Lacelle à 10 km, 140 habitants,
Saint-Merd-les-Oussines localisée à 9 km, 120 habitants,
Faux-la-Montagne localisée à 7 km, 364 habitants,
 entre autres. De plus, Tarnac est située à seulement 22 km de Meymac.

La ville propose quelques  équipements sportifs, elle propose entre autres un terrain de tennis et deux boucles de randonnée.

Le parc de logements, à Tarnac, se décomposait en 2011 en neuf appartements et 404 maisons soit
 un marché plutôt équilibré.


text:
using System.Collections.Generic;
using System.Linq;
using System.Text;
using _01.Vehicles.VehicleModels;

namespace _01.Vehicles.Core
{
    public class VehicleManager
    {
        private Dictionary<string, Vehicle> vehicles;

        public VehicleManager()
        {
            this.vehicles = new Dictionary<string, Vehicle>();
        }

        public void CreateCar(List<string> arguments)
        {
            var fuelQuantity = double.Parse(arguments[0]);
            var fuelConsumptionPerKm = double.Parse(arguments[1]);
            vehicles.Add("car", new Car(fuelQuantity, fuelConsumptionPerKm));
        }

        public void CreateTruck(List<string> arguments)
        {
            var fuelQuantity = double.Parse(arguments[0]);
            var fuelConsumptionPerKm = double.Parse(arguments[1]);
            vehicles.Add("truck", new Truck(fuelQuantity, fuelConsumptionPerKm));
        }

        public string DriveCar(List<string> commandArgs)
        {
            var car = vehicles.FirstOrDefault(x => x.Key == "car").Value;
            var drivenDistance = car.FuelConsumptionPerKm * double.Parse(commandArgs[0]);
            if (car.FuelQuantity > drivenDistance)
            {
                this.vehicles["car"].FuelQuantity -= drivenDistance;
                return $"Car travelled {commandArgs[0]} km";
            }
            else
            {
                return "Car needs refueling";
            }
        }

        public string DriveTruck(List<string> commandArgs)
        {
            var truck = vehicles.FirstOrDefault(x => x.Key == "truck").Value;
            var drivenDistance = truck.FuelConsumptionPerKm * double.Parse(commandArgs[0]);
            if (truck.FuelQuantity > drivenDistance)
            {
                this.vehicles["truck"].FuelQuantity -= drivenDistance;
                return $"Truck travelled {commandArgs[0]} km";
            }
            else
            {
                return "Truck needs refueling";
            }
        }

        public void RefuelCar(List<string> commandArgs)
        {
            this.vehicles["car"].FuelQuantity += double.Parse(commandArgs[0]);
        }

        public void RefuelTruck(List<string> commandArgs)
        {
            this.vehicles["truck"].FuelQuantity += double.Parse(commandArgs[0]);
        }

        public string PrintFuel()
        {
            var sb = new StringBuilder();
            foreach (var vehicle in vehicles)
            {
                sb.AppendLine($"{vehicle.Value.GetType().Name}: {vehicle.Value.FuelQuantity:F2}");
            }
            return sb.ToString().Trim();
        }
    }
}


text:
.class Lcom/android/common/widget/GroupingListAdapter$1;
.super Landroid/database/ContentObserver;
.source "GroupingListAdapter.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/common/widget/GroupingListAdapter;
.end annotation

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

# instance fields
.field final synthetic this$0:Lcom/android/common/widget/GroupingListAdapter;

# direct methods
.method constructor <init>(Lcom/android/common/widget/GroupingListAdapter;Landroid/os/Handler;)V
    .locals 0
    .param p2, "x0"    # Landroid/os/Handler;

    .prologue
    .line 90
    iput-object p1, p0, Lcom/android/common/widget/GroupingListAdapter$1;->this$0:Lcom/android/common/widget/GroupingListAdapter;

    invoke-direct {p0, p2}, Landroid/database/ContentObserver;-><init>(Landroid/os/Handler;)V

    return-void
.end method

# virtual methods
.method public deliverSelfNotifications()Z
    .locals 1

    .prologue
    .line 94
    const/4 v0, 0x1

    return v0
.end method

.method public onChange(Z)V
    .locals 1
    .param p1, "selfChange"    # Z

    .prologue
    .line 99
    iget-object v0, p0, Lcom/android/common/widget/GroupingListAdapter$1;->this$0:Lcom/android/common/widget/GroupingListAdapter;

    invoke-virtual {v0}, Lcom/android/common/widget/GroupingListAdapter;->onContentChanged()V

    .line 100
    return-void
.end method


text:
<?php

use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;

/**
 * This class has been auto-generated
 * by the Symfony Routing Component.
 */
class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
{
    public function __construct(RequestContext $context)
    {
        $this->context = $context;
    }

    public function match($rawPathinfo)
    {
        $allow = array();
        $pathinfo = rawurldecode($rawPathinfo);
        $trimmedPathinfo = rtrim($pathinfo, '/');
        $context = $this->context;
        $request = $this->request ?: $this->createRequest($pathinfo);
        $requestMethod = $canonicalMethod = $context->getMethod();

        if ('HEAD' === $requestMethod) {
            $canonicalMethod = 'GET';
        }

        // just_head
        if ('/just_head' === $pathinfo) {
            $ret = array('_route' => 'just_head');
            if (!in_array($requestMethod, array('HEAD'))) {
                $allow = array_merge($allow, array('HEAD'));
                goto not_just_head;
            }

            return $ret;
        }
        not_just_head:

        // head_and_get
        if ('/head_and_get' === $pathinfo) {
            $ret = array('_route' => 'head_and_get');
            if (!in_array($canonicalMethod, array('HEAD', 'GET'))) {
                $allow = array_merge($allow, array('HEAD', 'GET'));
                goto not_head_and_get;
            }

            return $ret;
        }
        not_head_and_get:

        // get_and_head
        if ('/get_and_head' === $pathinfo) {
            $ret = array('_route' => 'get_and_head');
            if (!in_array($canonicalMethod, array('GET', 'HEAD'))) {
                $allow = array_merge($allow, array('GET', 'HEAD'));
                goto not_get_and_head;
            }

            return $ret;
        }
        not_get_and_head:

        // post_and_head
        if ('/post_and_head' === $pathinfo) {
            $ret = array('_route' => 'post_and_head');
            if (!in_array($requestMethod, array('POST', 'HEAD'))) {
                $allow = array_merge($allow, array('POST', 'HEAD'));
                goto not_post_and_head;
            }

            return $ret;
        }
        not_post_and_head:

        if (0 === strpos($pathinfo, '/put_and_post')) {
            // put_and_post
            if ('/put_and_post' === $pathinfo) {
                $ret = array('_route' => 'put_and_post');
                if (!in_array($requestMethod, array('PUT', 'POST'))) {
                    $allow = array_merge($allow, array('PUT', 'POST'));
                    goto not_put_and_post;
                }

                return $ret;
            }
            not_put_and_post:

            // put_and_get_and_head
            if ('/put_and_post' === $pathinfo) {
                $ret = array('_route' => 'put_and_get_and_head');
                if (!in_array($canonicalMethod, array('PUT', 'GET', 'HEAD'))) {
                    $allow = array_merge($allow, array('PUT', 'GET', 'HEAD'));
                    goto not_put_and_get_and_head;
                }

                return $ret;
            }
            not_put_and_get_and_head:

        }

        if ('/' === $pathinfo && !$allow) {
            throw new Symfony\Component\Routing\Exception\NoConfigurationException();
        }

        throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
    }
}


text:
using System;
using System.Diagnostics;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using System.Web;
using System.Web.Hosting;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using T4MVC;
namespace ReactTest.Controllers
{
    public partial class HomeController
    {
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public HomeController() { }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected HomeController(Dummy d) { }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected RedirectToRouteResult RedirectToAction(ActionResult result)
        {
            var callInfo = result.GetT4MVCResult();
            return RedirectToRoute(callInfo.RouteValueDictionary);
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected RedirectToRouteResult RedirectToAction(Task<ActionResult> taskResult)
        {
            return RedirectToAction(taskResult.Result);
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
        {
            var callInfo = result.GetT4MVCResult();
            return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        protected RedirectToRouteResult RedirectToActionPermanent(Task<ActionResult> taskResult)
        {
            return RedirectToActionPermanent(taskResult.Result);
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public HomeController Actions { get { return MVC.Home; } }
        [GeneratedCode("T4MVC", "2.0")]
        public readonly string Area = "";
        [GeneratedCode("T4MVC", "2.0")]
        public readonly string Name = "Home";
        [GeneratedCode("T4MVC", "2.0")]
        public const string NameConst = "Home";
        [GeneratedCode("T4MVC", "2.0")]
        static readonly ActionNamesClass s_actions = new ActionNamesClass();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ActionNamesClass ActionNames { get { return s_actions; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionNamesClass
        {
            public readonly string Index = "Index";
            public readonly string About = "About";
            public readonly string Contact = "Contact";
        }

        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ActionNameConstants
        {
            public const string Index = "Index";
            public const string About = "About";
            public const string Contact = "Contact";
        }

        static readonly ViewsClass s_views = new ViewsClass();
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public ViewsClass Views { get { return s_views; } }
        [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
        public class ViewsClass
        {
            static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
            public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
            public class _ViewNamesClass
            {
                public readonly string About = "About";
                public readonly string Contact = "Contact";
                public readonly string Index = "Index";
            }
            public readonly string About = "~/Views/Home/About.cshtml";
            public readonly string Contact = "~/Views/Home/Contact.cshtml";
            public readonly string Index = "~/Views/Home/Index.cshtml";
        }
    }

    [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
    public partial class T4MVC_HomeController : ReactTest.Controllers.HomeController
    {
        public T4MVC_HomeController() : base(Dummy.Instance) { }

        [NonAction]
        partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);

        [NonAction]
        public override System.Web.Mvc.ActionResult Index()
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
            IndexOverride(callInfo);
            return callInfo;
        }

        [NonAction]
        partial void AboutOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);

        [NonAction]
        public override System.Web.Mvc.ActionResult About()
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.About);
            AboutOverride(callInfo);
            return callInfo;
        }

        [NonAction]
        partial void ContactOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);

        [NonAction]
        public override System.Web.Mvc.ActionResult Contact()
        {
            var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Contact);
            ContactOverride(callInfo);
            return callInfo;
        }

    }
}

#endregion T4MVC
#pragma warning restore 1591, 3008, 3009, 0108, 0114


text:
'use strict';

var express = require('express'),
	async = require('async'),
	models = require('../models'),
	categoryTreeLoader = require('../middleware/category-tree-loader');

var shopRouter = express.Router();

function getOrderItem(skuId, cart) {
	return cart.orderItems.filter(function(orderItem) {
		return orderItem.skuId === skuId;
	})[0];
}

/* POST Add product to shopping cart */
shopRouter.post('/cart/:productId', function(req, res, next) {
	var cart = req.shoppingCart,
		skuId = req.params.productId + '#' + req.body.colorId + '#' + req.body.sizeId,
		prevOrderItem = getOrderItem(skuId, cart);

	if (prevOrderItem) {
		prevOrderItem.quantity += 1;
	} else {
		// console.log(req.body);
		cart.orderItems.push({
			skuId: skuId,
			productId: parseInt(req.params.productId, 10),
			colorId: parseInt(req.body.colorId, 10),
			sizeId: parseInt(req.body.sizeId, 10),
			categoryId: parseInt(req.body.categoryId, 10),
			quantity: 1
		});
	}

	req.session.cart = cart;
	res.json({status: 1, shopCartItem: cart.orderItems[cart.orderItems.length - 1]});
});

/* DELETE Remove product from shopping cart */
shopRouter.delete('/cart/:productId', function(req, res, next) {
	var cart = req.shoppingCart,
		skuId = req.params.productId + '#' + req.body.colorId + '#' + req.body.sizeId,
		prevOrderItem = getOrderItem(skuId, cart);

	if (prevOrderItem) {
		// if (prevOrderItem.quantity > 1) {
		// 	prevOrderItem.quantity -= 1;
		// } else {
		// 	cart.orderItems.splice(cart.orderItems.indexOf(prevOrderItem), 1);
		// }
		cart.orderItems.splice(cart.orderItems.indexOf(prevOrderItem), 1);

		req.session.cart = cart;
		res.json({status: 1});

	} else {
		res.status(412).json({status: 0});
	}

});

/* GET shopping cart */
shopRouter.get('/cart', categoryTreeLoader, function(req, res, next) {

	var orderTotalAmount = req.shoppingCart.orderItems.reduce(function (total, oi) {
		return total + (oi.quantity * oi.price);
	}, 0);

	res.render('shop-cart', {
		cart: { orderItems: req.shoppingCart.orderItems },
		orderTotalAmount: orderTotalAmount.toFixed(2)
	});
});

module.exports = shopRouter;


text:
module Zermelo
  module Associations
    class IndexData
      attr_writer  :data_klass_name
      attr_accessor :name, :type, :index_klass

      def initialize(opts = {})
        [:name, :type, :index_klass].each do |a|
          send("#{a}=".to_sym, opts[a])
        end
      end

      def data_klass
        @data_klass ||= @data_klass_name.constantize
      end
    end
  end
end


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `JoystickSubsystem` struct in crate `sdl2`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, JoystickSubsystem">

    <title>sdl2::JoystickSubsystem - Rust</title>

    <link rel="stylesheet" type="text/css" href="../normalize.css">
    <link rel="stylesheet" type="text/css" href="../rustdoc.css">
    <link rel="stylesheet" type="text/css" href="../main.css">

sdl2

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options…"
                       type="search">

        </form>

Struct sdl2::<wbr>JoystickSubsystem

                       [−]

               [src]

pub struct JoystickSubsystem { /* fields omitted */ }

Methods

impl JoystickSubsystem

[src]

fn num_joysticks(&self) -> Result<u32, String>

Retreive the total number of attached joysticks and controllers identified by SDL.

fn open(&self, joystick_index: u32) -> Result<Joystick, IntegerOrSdlError>

Attempt to open the joystick at number id and return it.

fn name_for_index(&self,
                  joystick_index: u32)
                  -> Result<String, IntegerOrSdlError>

Return the name of the joystick at index id

fn device_guid(&self, joystick_index: u32) -> Result<Guid, IntegerOrSdlError>

Get the GUID for the joystick number id

fn set_event_state(&self, state: bool)

If state is true joystick events are processed, otherwise
they're ignored.

fn event_state(&self) -> bool

Return true if joystick events are processed.

fn update(&self)

Force joystick update when not using the event loop

impl JoystickSubsystem

[src]

fn sdl(&self) -> Sdl

Obtain an SDL context.

Trait Implementations

impl Debug for JoystickSubsystem

[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Clone for JoystickSubsystem

[src]

fn clone(&self) -> JoystickSubsystem

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

Help

Keyboard Shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

+

Collapse/expand all sections

Search Tricks

                    Prefix searches with a type followed by a colon (e.g.
                    fn:) to restrict the search to a given type.

                    Accepted types are: fn, mod,
                    struct, enum,
                    trait, type, macro,
                    and const.

                    Search functions by type signature (e.g.
                    vec -> usize or * -> vec)