text:
package com.intellij.codeInsight.daemon.impl.quickfix;

import com.intellij.codeInsight.daemon.quickFix.LightQuickFixParameterizedTestCase;
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;

public class RemoveUnusedVariableTest extends LightQuickFixParameterizedTestCase {
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    enableInspectionTool(new UnusedDeclarationInspection());
  }

  @Override
  protected String getBasePath() {
    return "/codeInsight/daemonCodeAnalyzer/quickFix/removeUnusedVariable";
  }
}


text:
/*
 *
 */
package com.mind_era.knime.hits.plate.format;

import java.util.AbstractCollection;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import com.mind_era.knime.hits.plate.format.CombinationPattern;
import com.mind_era.knime.hits.plate.format.PlateFormatNodeModel.PlateFormatCellFactory;

/**
 *
 * @author Gabor Bakos
 */
@RunWith(Parameterized.class)
public class CombinationPatternUpToDownMergeTests extends CombinationPatternBase {
	private final int smallPlate, smallRow,smallCol, largePlate, largeRow, largeCol;
	/**
	 * @param smallPlate
	 *            The plate number on small (96 well plate) (starting from
	 *            {@code 1}).
	 * @param smallRow
	 *            The row number on small (96 well plate) (starting from {@code
	 *            1}).
	 * @param smallCol
	 *            The column number on small (96 well plate) (starting from
	 *            {@code 1}).
	 * @param largePlate
	 *            The plate number on large (384 well plate) (starting from
	 *            {@code 1}).
	 * @param largeRow
	 *            The row number on large (384 well plate) (starting from
	 *            {@code 1}).
	 * @param largeCol
	 *            The column number on large (384 well plate) (starting from
	 *            {@code 1}).
	 */
	public CombinationPatternUpToDownMergeTests(int smallPlate, int smallRow,
			int smallCol, int largePlate, int largeRow, int largeCol) {
		super();
		this.smallPlate = smallPlate;
		this.smallRow = smallRow;
		this.smallCol = smallCol;
		this.largePlate = largePlate;
		this.largeRow = largeRow;
		this.largeCol = largeCol;
	}

	/**
	 * Exhaustive (for 2 384 well plates) test data for
	 * {@link CombinationPattern#UpToDownThenRight8Pipettes}.
	 *
	 * @return An {@link Iterator} to the data.
	 */
	@Parameters
	public static List<Object[]> exhaustiveUpToDown8Pipettes() {
		return Arrays.asList(new AbstractCollection<Object[]>() {
			private static final int MAX_SMALL_PLATES = 8;
			private static final int MAX_SMALL_ROWS = 8;
			private static final int MAX_SMALL_COLS = 12;
			@Override
			public Iterator<Object[]> iterator() {

				return new Iterator<Object[]>() {
					private int smallPlate = 1;
					private int smallRow = 1;
					private int smallCol = 1;

					@Override
					public boolean hasNext() {
						return smallPlate <= MAX_SMALL_PLATES;
					}

					@Override
					public Object[] next() {
						@SuppressWarnings("boxing")
						final Object[] ret = new Object[] { smallPlate, smallRow,
							smallCol, (smallPlate - 1) / 4 + 1,
							(smallRow - 1) * 2 + 1 + (smallPlate - 1) % 2,
							smallCol + (smallPlate - 1) % 4 / 2 * 12 };
						if (++smallCol > MAX_SMALL_COLS) {
							smallCol = 1;
							if (++smallRow > MAX_SMALL_ROWS) {
								smallRow = 1;
								++smallPlate;
							}
						}
						return ret;
					}

					@Override
					public void remove() {
						throw new UnsupportedOperationException();
					}

				};
			}
			@Override
			public int size() {
				return MAX_SMALL_PLATES * MAX_SMALL_ROWS * MAX_SMALL_COLS;
			}
		}.toArray(new Object[0][]));
	}

	/**
	 * Tests the {@link CombinationPattern#UpToDownThenRight8Pipettes} version
	 * of {@link PlateFormatCellFactory}.
	 */
	@Test
	public void upToDownMergeTests() {
		asserts(CombinationPattern.UpToDownThenRight8Pipettes, smallPlate,
				smallRow, smallCol, largePlate, largeRow, largeCol);
	}
}

redpajama_set_name: RedPajamaGithub


text:
package test.sanitycheck;

import org.testng.annotations.Test;

public class SampleTest3
{
   @Test()
   public void test3() {}
}


text:
set -e

if [[ $COVERAGE = yes ]]; then

    cd $TRAVIS_BUILD_DIR

    wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.1.0/php-coveralls.phar
    chmod +x php-coveralls.phar

    ./php-coveralls.phar --json_path=api/build/logs/coveralls-upload.json -vvv -x $TRAVIS_BUILD_DIR/api/build/logs/clover.xml

    wget https://scrutinizer-ci.com/ocular.phar
    php ocular.phar code-coverage:upload --format=php-clover api/build/logs/clover.xml

    wget https://codecov.io/bash
    chmod +x bash
    ./bash -F client -s client/build/logs/ -f "*.xml"
fi


text:
// den0bot (c) StanR 2020 - MIT License
using System;
using Newtonsoft.Json;

namespace den0bot.Modules.Osu.Types.V2
{
	public class TimeframeCount
	{
		[JsonProperty("start_date")]
		public DateTime StartDate { get; set; }

		[JsonProperty("count")]
		public uint Count { get; set; }
	}
}


text:
package org.openehealth.ipf.commons.ihe.xds.core.transform.requests;

import org.openehealth.ipf.commons.ihe.xds.core.metadata.Association;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.DocumentEntry;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.Folder;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.SubmissionSet;
import org.openehealth.ipf.commons.ihe.xds.core.metadata.XDSMetaClass;

/**
 * Query parameters used for the stored queries.
 * @author Jens Riemschneider
 */
public enum QueryParameter {
    /** Used to filter {@link DocumentEntry#getPatientId()}. */
    DOC_ENTRY_PATIENT_ID("$XDSDocumentEntryPatientId"),
    /** Used to filter {@link DocumentEntry#getClassCode()}. */
    DOC_ENTRY_CLASS_CODE("$XDSDocumentEntryClassCode"),
    /** Used to filter {@link DocumentEntry#getTypeCode()}. */
    DOC_ENTRY_TYPE_CODE("$XDSDocumentEntryTypeCode"),
    /** Used to filter {@link DocumentEntry#getClassCode()}. */
    DOC_ENTRY_CLASS_CODE_SCHEME("$XDSDocumentEntryClassCodeScheme"),
    /** Used to filter {@link DocumentEntry#getAuthors()}. */
    DOC_ENTRY_AUTHOR_PERSON("$XDSDocumentEntryAuthorPerson"),
    /** Used to filter {@link DocumentEntry#getCreationTime()}. */
    DOC_ENTRY_CREATION_TIME_FROM("$XDSDocumentEntryCreationTimeFrom"),
    /** Used to filter {@link DocumentEntry#getCreationTime()}. */
    DOC_ENTRY_CREATION_TIME_TO("$XDSDocumentEntryCreationTimeTo"),
    /** Used to filter {@link DocumentEntry#getFormatCode()}. */
    DOC_ENTRY_FORMAT_CODE("$XDSDocumentEntryFormatCode"),
    /** Used to filter {@link DocumentEntry#getFormatCode()}. */
    DOC_ENTRY_FORMAT_CODE_SCHEME("$XDSDocumentEntryFormatCodeScheme"),
    /** Used to filter {@link DocumentEntry#getHealthcareFacilityTypeCode()}. */
    DOC_ENTRY_HEALTHCARE_FACILITY_TYPE_CODE("$XDSDocumentEntryHealthcareFacilityTypeCode"),
    /** Used to filter {@link DocumentEntry#getHealthcareFacilityTypeCode()}. */
    DOC_ENTRY_HEALTHCARE_FACILITY_TYPE_CODE_SCHEME("$XDSDocumentEntryHealthcareFacilityTypeCodeScheme"),
    /** Used to filter {@link DocumentEntry#getPracticeSettingCode()}. */
    DOC_ENTRY_PRACTICE_SETTING_CODE("$XDSDocumentEntryPracticeSettingCode"),
    /** Used to filter {@link DocumentEntry#getPracticeSettingCode()}. */
    DOC_ENTRY_PRACTICE_SETTING_CODE_SCHEME("$XDSDocumentEntryPracticeSettingCodeScheme"),
    /** Used to filter {@link DocumentEntry#getServiceStartTime()}. */
    DOC_ENTRY_SERVICE_START_TIME_FROM("$XDSDocumentEntryServiceStartTimeFrom"),
    /** Used to filter {@link DocumentEntry#getServiceStartTime()}. */
    DOC_ENTRY_SERVICE_START_TIME_TO("$XDSDocumentEntryServiceStartTimeTo"),
    /** Used to filter {@link DocumentEntry#getServiceStopTime()}. */
    DOC_ENTRY_SERVICE_STOP_TIME_FROM("$XDSDocumentEntryServiceStopTimeFrom"),
    /** Used to filter {@link DocumentEntry#getServiceStopTime()}. */
    DOC_ENTRY_SERVICE_STOP_TIME_TO("$XDSDocumentEntryServiceStopTimeTo"),
    /** Used to filter {@link DocumentEntry#getAvailabilityStatus()}. */
    DOC_ENTRY_STATUS("$XDSDocumentEntryStatus"),
    /** Used to filter {@link DocumentEntry#getEventCodeList()}. */
    DOC_ENTRY_EVENT_CODE("$XDSDocumentEntryEventCodeList"),
    /** Used to filter {@link DocumentEntry#getEventCodeList()}. */
    DOC_ENTRY_EVENT_CODE_SCHEME("$XDSDocumentEntryEventCodeListScheme"),
    /** Used to filter {@link DocumentEntry#getConfidentialityCodes()}. */
    DOC_ENTRY_CONFIDENTIALITY_CODE("$XDSDocumentEntryConfidentialityCode"),
    /** Used to filter {@link DocumentEntry#getConfidentialityCodes()}. */
    DOC_ENTRY_CONFIDENTIALITY_CODE_SCHEME("$XDSDocumentEntryConfidentialityCodeScheme"),
    /** Used to filter {@link DocumentEntry#getEntryUuid()}. */
    DOC_ENTRY_UUID("$XDSDocumentEntryEntryUUID"),
    /** Used to filter {@link DocumentEntry#getUniqueId()}. */
    DOC_ENTRY_UNIQUE_ID("$XDSDocumentEntryUniqueId"),
    /** Used to filter {@link DocumentEntry#getType()}. */
    DOC_ENTRY_TYPE("$XDSDocumentEntryType"),
    /** Used to filter {@link DocumentEntry#getReferenceIdList()}. */
    DOC_ENTRY_REFERENCE_IDS("$XDSDocumentEntryReferenceIdList"),
    /** Used to filter {@link DocumentEntry#getDocumentAvailability()}. */
    DOC_ENTRY_DOCUMENT_AVAILABILITY("$XDSDocumentEntryDocumentAvailability"),
    /** Used to filter {@link DocumentEntry#getLogicalUuid()}. */
    DOC_ENTRY_LOGICAL_ID("$XDSDocumentEntryLogicalID"),

    // specific for DE:GEMATIK
    /** Used to filter {@link DocumentEntry#getTitle()}. */
    DOC_ENTRY_TITLE("$XDSDocumentEntryTitle"),
    /** Used to filter {@link DocumentEntry#getAuthors()}. */
    DOC_ENTRY_AUTHOR_INSTITUTION("$XDSDocumentEntryAuthorInstitution"),

    // specific for PHARM-1
    /** Used to filter {@link DocumentEntry#getServiceStartTime()}. */
    DOC_ENTRY_SERVICE_START_FROM("$XDSDocumentEntryServiceStartFrom"),
    /** Used to filter {@link DocumentEntry#getServiceStartTime()}. */
    DOC_ENTRY_SERVICE_START_TO("$XDSDocumentEntryServiceStartTo"),
    /** Used to filter {@link DocumentEntry#getServiceStopTime()}. */
    DOC_ENTRY_SERVICE_END_FROM("$XDSDocumentEntryServiceEndFrom"),
    /** Used to filter {@link DocumentEntry#getServiceStopTime()}. */
    DOC_ENTRY_SERVICE_END_TO("$XDSDocumentEntryServiceEndTo"),

    /** Used to filter {@link Folder#getCodeList()}. */
    FOLDER_CODES("$XDSFolderCodeList"),
    /** Used to filter {@link Folder#getCodeList()}. */
    FOLDER_CODES_SCHEME("$XDSFolderCodeListScheme"),
    /** Used to filter {@link Folder#getLastUpdateTime()}. */
    FOLDER_LAST_UPDATE_TIME_FROM("$XDSFolderLastUpdateTimeFrom"),
    /** Used to filter {@link Folder#getLastUpdateTime()}. */
    FOLDER_LAST_UPDATE_TIME_TO("$XDSFolderLastUpdateTimeTo"),
    /** Used to filter {@link Folder#getPatientId()}. */
    FOLDER_PATIENT_ID("$XDSFolderPatientId"),
    /** Used to filter {@link Folder#getAvailabilityStatus()}. */
    FOLDER_STATUS("$XDSFolderStatus"),
    /** Used to filter {@link Folder#getEntryUuid()}. */
    FOLDER_UUID("$XDSFolderEntryUUID"),
    /** Used to filter {@link Folder#getUniqueId()}. */
    FOLDER_UNIQUE_ID("$XDSFolderUniqueId"),
    /** Used to filter {@link Folder#getLogicalUuid()}. */
    FOLDER_LOGICAL_ID("$XDSFolderLogicalID"),

    /** Used to filter {@link SubmissionSet#getPatientId()}. */
    SUBMISSION_SET_PATIENT_ID("$XDSSubmissionSetPatientId"),
    /** Used to filter {@link SubmissionSet#getSourceId()}. */
    SUBMISSION_SET_SOURCE_ID("$XDSSubmissionSetSourceId"),
    /** Used to filter {@link SubmissionSet#getSubmissionTime()}. */
    SUBMISSION_SET_SUBMISSION_TIME_FROM("$XDSSubmissionSetSubmissionTimeFrom"),
    /** Used to filter {@link SubmissionSet#getSubmissionTime()}. */
    SUBMISSION_SET_SUBMISSION_TIME_TO("$XDSSubmissionSetSubmissionTimeTo"),
    /** Used to filter {@link SubmissionSet#getAuthors()}. */
    SUBMISSION_SET_AUTHOR_PERSON("$XDSSubmissionSetAuthorPerson"),
    /** Used to filter {@link SubmissionSet#getContentTypeCode()}. */
    SUBMISSION_SET_CONTENT_TYPE_CODE("$XDSSubmissionSetContentType"),
    /** Used to filter {@link SubmissionSet#getContentTypeCode()}. */
    SUBMISSION_SET_CONTENT_TYPE_CODE_SCHEME("$XDSSubmissionSetContentTypeScheme"),
    /** Used to filter {@link SubmissionSet#getAvailabilityStatus()}. */
    SUBMISSION_SET_STATUS("$XDSSubmissionSetStatus"),
    /** Used to filter {@link SubmissionSet#getEntryUuid()}. */
    SUBMISSION_SET_UUID("$XDSSubmissionSetEntryUUID"),
    /** Used to filter {@link SubmissionSet#getUniqueId()}. */
    SUBMISSION_SET_UNIQUE_ID("$XDSSubmissionSetUniqueId"),

    /** Used to filter {@link XDSMetaClass#getEntryUuid()}. */
    UUID("$uuid"),
    /** Used to filter {@link XDSMetaClass#getPatientId()}. */
    PATIENT_ID("$patientId"),
    /** Used to filter {@link Association#getAssociationType()}. */
    ASSOCIATION_TYPE("$AssociationTypes"),
    /** Used to filter {@link Association#getAvailabilityStatus()}. */
    ASSOCIATION_STATUS("$XDSAssociationStatus"),
    /** Used to filter {none}. */
    METADATA_LEVEL("$MetadataLevel");

    private final String slotName;

    QueryParameter(String slotName) {
        this.slotName = slotName;
    }

    /**
     * @return name of the slot used in the ebXML representation of the parameter.
     */
    public String getSlotName() {
        return slotName;
    }

    /**
     * @param slotName
     *      query slot name.
     * @return
     *      a {@link QueryParameter} element which corresponds to the given
     *      slot name, or null when none found.
     */
    public static QueryParameter valueOfSlotName(String slotName) {
        if (slotName == null) {
            return null;
        }

        for (var queryParameter : QueryParameter.values()) {
            if (slotName.equals(queryParameter.getSlotName())) {
                return queryParameter;
            }
        }

        return null;
    }

}


text:
import os.path as op

def eq_(a, b, msg=None):
    assert a == b, msg or "%r != %r" % (a, b)

class TestData:
    @staticmethod
    def filepath(relative_path, *args):
        if args:
            relative_path = op.join([relative_path] + list(args))
        datadirpath = op.join(op.dirname(__file__), 'testdata')
        resultpath = op.join(datadirpath, relative_path)
        assert op.exists(resultpath)
        return resultpath


text:
C    Copyright(C) 2014-2017 National Technology & Engineering Solutions of
C    Sandia, LLC (NTESS).  Under the terms of Contract DE-NA0003525 with
C    NTESS, the U.S. Government retains certain rights in this software.
C
C    Redistribution and use in source and binary forms, with or without
C    modification, are permitted provided that the following conditions are
C    met:
C
C    * Redistributions of source code must retain the above copyright
C       notice, this list of conditions and the following disclaimer.
C
C    * Redistributions in binary form must reproduce the above
C      copyright notice, this list of conditions and the following
C      disclaimer in the documentation and/or other materials provided
C      with the distribution.
C
C    * Neither the name of NTESS nor the names of its
C      contributors may be used to endorse or promote products derived
C      from this software without specific prior written permission.
C
C    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
C    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
C    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
C    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
C    OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
C    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
C    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
C    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
C    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
C    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
C    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
C

C $Id: dmess.f,v 1.2 2007/07/24 13:10:18 gdsjaar Exp $
C $Log: dmess.f,v $
C Revision 1.2  2007/07/24 13:10:18  gdsjaar
C Fix problem with boundary condition memory overwrite.
C
C Remove old ls5 and r25 terminal tests
C
C Revision 1.1.1.1  1990/11/30 11:06:17  gdsjaar
C FASTQ Version 2.0X
C
c Revision 1.1  90/11/30  11:06:16  gdsjaar
c Initial revision
c
C
CC* FILE: [.MAIN]DMESS.FOR
CC* MODIFIED BY: TED BLACKER
CC* MODIFICATION DATE: 7/6/90
CC* MODIFICATION: COMPLETED HEADER INFORMATION
C
      SUBROUTINE DMESS (DEV1, TEXT)
C***********************************************************************
C
C  SUBROUTINE DMESS = PRINTS A ONE LINE MESSAGE AT THE BOTTOM OF THE
C                       SCREEN
C
C***********************************************************************
C
      CHARACTER*(*) TEXT, DEV1*3
C
      CALL MESAGE (TEXT)
      RETURN
C
      END


text:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML//EN">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Stat 133 Fall 2014; Final Project</title>

Election Plots

Jason Zhang, Jeremy Young, Michael Tran, Patrick Lin

The original 10 variables we trained and tested our predictors on were:

"Percent; HOUSEHOLDS BY TYPE - Households with one or more people 65 years and over",

"Estimate; HOUSEHOLDS BY TYPE - Average family size",

"Percent; MARITAL STATUS - Divorced",

"Percent; EDUCATIONAL ATTAINMENT - Some college",

"Percent; EMPLOYMENT STATUS - Percent Unemployed",

"Percent; HOUSEHOLDS BY TYPE - Households with one or more people under 18 years",

"Percent; INDUSTRY - Agriculture",

"Percent; INDUSTRY - Professional",

"Estimate; INCOME AND BENEFITS (IN 2010 INFLATION-ADJUSTED DOLLARS) - Median household income (dollars)",

"Percent; PERCENTAGE OF FAMILIES AND PEOPLE WHOSE INCOME IN THE PAST 12 MONTHS IS BELOW THE POVERTY LEVEL - All families",

  These were all chosen somewhat arbitrarily as conditions we thought would affect election rates or were interesting to observe. We later added five more variables to test our recursive partitioning model:

"Estimate; HOUSEHOLDS BY TYPE - Nonfamily households",

"Estimate; HOUSEHOLDS BY TYPE - Average household size",

"Estimate; MARITAL STATUS - Never married",

"Estimate; HOUSEHOLDS BY TYPE - Nonfamily households - Householder living alone",

"Estimate; HOUSEHOLDS BY TYPE - Family households (families) - Female householder"

3A Plot

Classification tree built by post() from the RPart library with the original 10 variables.

Classification tree built by RPart() with all 15 variables. The very bottom of the plot was generated slightly cropped.

4A Plot 1

Map of the 294 counties that were incorrectly predicted by both our KNN and RPart predictors on 10 variables. The KNN predictor alone incorrectly predicted the outcome for 390 counties while the RPart got 521 wrong, so there was substantial overlap in incorrect predictions. These could possibly be counties that voted differently enough in the 2004 and 2012 elections for both our predictors to be incorrect, or were affected more by other variables that we did not account for.

4A Plot 2

KNN error rates on the original 10 variables for various values of k.

4A Plot 3

RPart correct classification rate with 1, 2, 3... up to 15 variables. Variables were included in order of importance from analyzing the 2004 data given by summary() in the RPart library. This order however does not apply perfectly to the 2012 predictions, however, otherwise the greatest increases in classification rate would be seen with the first few variables. In fact, the classification rate goes down on the tenth variable, which corresponds to "Percent; INDUSTRY - Agriculture". Even so, the general trend is that our predictor is more accurate when given more variables.

4B Fancy Map

Party vote shift from '04 to '12 election. Arrows signify an increase in voting percentage from '04 to '12, with red corresponding to Republicans and blue to Democrats. The biggest increases are in the South, where we see the Democrats gaining in the Southeastern states and the Republicans winning more voters in the region around the Appalachian states, AR, and eastern TX.

<address></address>


text:
package org.springframework.boot.web.reactive.context;

import org.springframework.context.ConfigurableApplicationContext;

/**
 * Interface to provide configuration for a reactive web application.
 *
 * @author Stephane Nicoll
 * @since 2.0.0
 */
public interface ConfigurableReactiveWebApplicationContext
		extends ConfigurableApplicationContext, ReactiveWebApplicationContext {

}


text:
using System;

public static class Heap<T> where T : IComparable<T>
{
    public static void Sort(T[] arr)
    {
        throw new NotImplementedException();
    }
}


text:
class ProvidersController < ApplicationController
  rescue_from OpenIDConnect::Discovery::DiscoveryFailed, OpenIDConnect::Discovery::InvalidIdentifier do |e|
    flash[:error] = {
      title: 'Discovery Failed',
      text: 'Could not discover your OP.'
    }
    redirect_to root_url
  end

  def create
    provider = Provider.discover! params[:host]
    unless provider.registered?
      provider.register! provider_open_id_url(provider)
    end
    redirect_to provider.authorization_uri(
      provider_open_id_url(provider),
      new_nonce
    )
  end
end


text:
    {% highlight objective-c %}

    @protocol NSCoding
    - (void)encodeWithCoder:(NSCoder *)aCoder;
    - (instancetype)initWithCoder:(NSCoder *)aDecoder;
    @end

    [NSKeyedArchiver archiveRootObject:self.privateItems toFile:path]

    self.privateItems = [NSKeyedUnarchiver unarchiveObjectWithFile:path];
    {% endhighlight %}

## NSData

    {% highlight objective-c %}

    NSData* data = UIImageJPEGRepresentation(image, 0.5);
    [data writeToFile:imagePath atomically:YES];

    result = [UIImage imageWithContentsOfFile:imagePath];

    [[NSFileManager defaultManager] removeItemAtPath:imagePath error:nil];
    {% endhighlight %}

## The Application Bundle 只读

    {% highlight objective-c %}
    // Get a pointer to the application bundle
    NSBundle *applicationBundle = [NSBundle mainBundle];
    // Ask for the path to a resource named myImage.png in the bundle
    NSString *path = [applicationBundle pathForResource:@"myImage"
                                                 ofType:@"png"];
    {% endhighlight %}


text:
<?xml version="1.0" encoding="UTF-8"?>
<actions>
        <action>
            <actionName>CUSTOM-Deploy to Device</actionName>
            <displayName>Deploy to Device</displayName>
            <goals>
                <goal>android:deploy</goal>
            </goals>
        </action>
    </actions>


text:
package org.fest.swing.driver;

import static org.fest.swing.edt.GuiActionRunner.execute;
import static org.fest.util.Preconditions.checkNotNull;

import javax.annotation.Nullable;
import javax.swing.JProgressBar;

import org.fest.swing.annotation.RunsInEDT;
import org.fest.swing.edt.GuiQuery;

/**
 * Returns the value of a {@code JProgressBar}. This query is executed in the event dispatch thread (EDT.)
 *
 * @author Alex Ruiz
 */
final class JProgressBarValueQuery {
  @RunsInEDT
  static int valueOf(final JProgressBar progressBar) {
    Integer result = execute(new GuiQuery<Integer>() {
      @Override
      protected @Nullable Integer executeInEDT() {
        return progressBar.getValue();
      }
    });
    return checkNotNull(result);
  }

  private JProgressBarValueQuery() {}
}


text:
package org.jkiss.dbeaver.registry.maven.versioning;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/**
 * Construct a version range from a specification.
 *
 * @author Brett Porter
 */
public class VersionRange {
    private final ArtifactVersion recommendedVersion;

    private final List<Restriction> restrictions;

    private VersionRange(ArtifactVersion recommendedVersion,
                         List<Restriction> restrictions) {
        this.recommendedVersion = recommendedVersion;
        this.restrictions = restrictions;
    }

    public ArtifactVersion getRecommendedVersion() {
        return recommendedVersion;
    }

    public List<Restriction> getRestrictions() {
        return restrictions;
    }

    public VersionRange cloneOf() {
        List<Restriction> copiedRestrictions = null;

        if (restrictions != null) {
            copiedRestrictions = new ArrayList<>();

            if (!restrictions.isEmpty()) {
                copiedRestrictions.addAll(restrictions);
            }
        }

        return new VersionRange(recommendedVersion, copiedRestrictions);
    }

    /**
     * Create a version range from a string representation
     *

     * Some spec examples are
     *

     *
1.0 Version 1.0

     *
[1.0,2.0) Versions 1.0 (included) to 2.0 (not included)

     *
[1.0,2.0] Versions 1.0 to 2.0 (both included)

     *
[1.5,) Versions 1.5 and higher

     *
(,1.0],[1.2,) Versions up to 1.0 (included) and 1.2 or higher

     *

     *
     * @param spec string representation of a version or version range
     * @return a new {@link VersionRange} object that represents the spec
     * @throws InvalidVersionSpecificationException
     */
    public static VersionRange createFromVersionSpec(String spec)
        throws InvalidVersionSpecificationException {
        if (spec == null) {
            return null;
        }

        List<Restriction> restrictions = new ArrayList<>();
        String process = spec;
        ArtifactVersion version = null;
        ArtifactVersion upperBound = null;
        ArtifactVersion lowerBound = null;

        while (process.startsWith("[") || process.startsWith("(")) {
            int index1 = process.indexOf(")");
            int index2 = process.indexOf("]");

            int index = index2;
            if (index2 < 0 || index1 < index2) {
                if (index1 >= 0) {
                    index = index1;
                }
            }

            if (index < 0) {
                throw new InvalidVersionSpecificationException("Unbounded range: " + spec);
            }

            Restriction restriction = parseRestriction(process.substring(0, index + 1));
            if (lowerBound == null) {
                lowerBound = restriction.getLowerBound();
            }
            if (upperBound != null) {
                if (restriction.getLowerBound() == null || restriction.getLowerBound().compareTo(upperBound) < 0) {
                    throw new InvalidVersionSpecificationException("Ranges overlap: " + spec);
                }
            }
            restrictions.add(restriction);
            upperBound = restriction.getUpperBound();

            process = process.substring(index + 1).trim();

            if (process.length() > 0 && process.startsWith(",")) {
                process = process.substring(1).trim();
            }
        }

        if (process.length() > 0) {
            if (restrictions.size() > 0) {
                throw new InvalidVersionSpecificationException(
                    "Only fully-qualified sets allowed in multiple set scenario: " + spec);
            } else {
                version = new DefaultArtifactVersion(process);
                restrictions.add(Restriction.EVERYTHING);
            }
        }

        return new VersionRange(version, restrictions);
    }

    private static Restriction parseRestriction(String spec)
        throws InvalidVersionSpecificationException {
        boolean lowerBoundInclusive = spec.startsWith("[");
        boolean upperBoundInclusive = spec.endsWith("]");

        String process = spec.substring(1, spec.length() - 1).trim();

        Restriction restriction;

        int index = process.indexOf(",");

        if (index < 0) {
            if (!lowerBoundInclusive || !upperBoundInclusive) {
                throw new InvalidVersionSpecificationException("Single version must be surrounded by []: " + spec);
            }

            ArtifactVersion version = new DefaultArtifactVersion(process);

            restriction = new Restriction(version, lowerBoundInclusive, version, upperBoundInclusive);
        } else {
            String lowerBound = process.substring(0, index).trim();
            String upperBound = process.substring(index + 1).trim();
            if (lowerBound.equals(upperBound)) {
                throw new InvalidVersionSpecificationException("Range cannot have identical boundaries: " + spec);
            }

            ArtifactVersion lowerVersion = null;
            if (lowerBound.length() > 0) {
                lowerVersion = new DefaultArtifactVersion(lowerBound);
            }
            ArtifactVersion upperVersion = null;
            if (upperBound.length() > 0) {
                upperVersion = new DefaultArtifactVersion(upperBound);
            }

            if (upperVersion != null && lowerVersion != null && upperVersion.compareTo(lowerVersion) < 0) {
                throw new InvalidVersionSpecificationException("Range defies version ordering: " + spec);
            }

            restriction = new Restriction(lowerVersion, lowerBoundInclusive, upperVersion, upperBoundInclusive);
        }

        return restriction;
    }

    public static VersionRange createFromVersion(String version) {
        List<Restriction> restrictions = Collections.emptyList();
        return new VersionRange(new DefaultArtifactVersion(version), restrictions);
    }

    /**
     * Creates and returns a new VersionRange that is a restriction of this
     * version range and the specified version range.
     *

     * Note: Precedence is given to the recommended version from this version range over the
     * recommended version from the specified version range.
     *

     *
     * @param restriction the VersionRange that will be used to restrict this version
     *                    range.
     * @return the VersionRange that is a restriction of this version range and the
     * specified version range.
     *

     * The restrictions of the returned version range will be an intersection of the restrictions
     * of this version range and the specified version range if both version ranges have
     * restrictions. Otherwise, the restrictions on the returned range will be empty.
     *

     *

     * The recommended version of the returned version range will be the recommended version of
     * this version range, provided that ranges falls within the intersected restrictions. If
     * the restrictions are empty, this version range's recommended version is used if it is not
     * null. If it is null, the specified version range's recommended
     * version is used (provided it is non-null). If no recommended version can be
     * obtained, the returned version range's recommended version is set to null.
     *

     * @throws NullPointerException if the specified VersionRange is
     *                              null.
     */
    public VersionRange restrict(VersionRange restriction) {
        List<Restriction> r1 = this.restrictions;
        List<Restriction> r2 = restriction.restrictions;
        List<Restriction> restrictions;

        if (r1.isEmpty() || r2.isEmpty()) {
            restrictions = Collections.emptyList();
        } else {
            restrictions = intersection(r1, r2);
        }

        ArtifactVersion version = null;
        if (restrictions.size() > 0) {
            for (Restriction r : restrictions) {
                if (recommendedVersion != null && r.containsVersion(recommendedVersion)) {
                    // if we find the original, use that
                    version = recommendedVersion;
                    break;
                } else if (version == null && restriction.getRecommendedVersion() != null
                    && r.containsVersion(restriction.getRecommendedVersion())) {
                    // use this if we can, but prefer the original if possible
                    version = restriction.getRecommendedVersion();
                }
            }
        }
        // Either the original or the specified version ranges have no restrictions
        else if (recommendedVersion != null) {
            // Use the original recommended version since it exists
            version = recommendedVersion;
        } else if (restriction.recommendedVersion != null) {
            // Use the recommended version from the specified VersionRange since there is no
            // original recommended version
            version = restriction.recommendedVersion;
        }
/* TODO: should throw this immediately, but need artifact
        else
        {
            throw new OverConstrainedVersionException( "Restricting incompatible version ranges" );
        }
*/

        return new VersionRange(version, restrictions);
    }

    private List<Restriction> intersection(List<Restriction> r1, List<Restriction> r2) {
        List<Restriction> restrictions = new ArrayList<>(r1.size() + r2.size());
        Iterator<Restriction> i1 = r1.iterator();
        Iterator<Restriction> i2 = r2.iterator();
        Restriction res1 = i1.next();
        Restriction res2 = i2.next();

        boolean done = false;
        while (!done) {
            if (res1.getLowerBound() == null || res2.getUpperBound() == null
                || res1.getLowerBound().compareTo(res2.getUpperBound()) <= 0) {
                if (res1.getUpperBound() == null || res2.getLowerBound() == null
                    || res1.getUpperBound().compareTo(res2.getLowerBound()) >= 0) {
                    ArtifactVersion lower;
                    ArtifactVersion upper;
                    boolean lowerInclusive;
                    boolean upperInclusive;

                    // overlaps
                    if (res1.getLowerBound() == null) {
                        lower = res2.getLowerBound();
                        lowerInclusive = res2.isLowerBoundInclusive();
                    } else if (res2.getLowerBound() == null) {
                        lower = res1.getLowerBound();
                        lowerInclusive = res1.isLowerBoundInclusive();
                    } else {
                        int comparison = res1.getLowerBound().compareTo(res2.getLowerBound());
                        if (comparison < 0) {
                            lower = res2.getLowerBound();
                            lowerInclusive = res2.isLowerBoundInclusive();
                        } else if (comparison == 0) {
                            lower = res1.getLowerBound();
                            lowerInclusive = res1.isLowerBoundInclusive() && res2.isLowerBoundInclusive();
                        } else {
                            lower = res1.getLowerBound();
                            lowerInclusive = res1.isLowerBoundInclusive();
                        }
                    }

                    if (res1.getUpperBound() == null) {
                        upper = res2.getUpperBound();
                        upperInclusive = res2.isUpperBoundInclusive();
                    } else if (res2.getUpperBound() == null) {
                        upper = res1.getUpperBound();
                        upperInclusive = res1.isUpperBoundInclusive();
                    } else {
                        int comparison = res1.getUpperBound().compareTo(res2.getUpperBound());
                        if (comparison < 0) {
                            upper = res1.getUpperBound();
                            upperInclusive = res1.isUpperBoundInclusive();
                        } else if (comparison == 0) {
                            upper = res1.getUpperBound();
                            upperInclusive = res1.isUpperBoundInclusive() && res2.isUpperBoundInclusive();
                        } else {
                            upper = res2.getUpperBound();
                            upperInclusive = res2.isUpperBoundInclusive();
                        }
                    }

                    // don't add if they are equal and one is not inclusive
                    if (lower == null || upper == null || lower.compareTo(upper) != 0) {
                        restrictions.add(new Restriction(lower, lowerInclusive, upper, upperInclusive));
                    } else if (lowerInclusive && upperInclusive) {
                        restrictions.add(new Restriction(lower, lowerInclusive, upper, upperInclusive));
                    }

                    //noinspection ObjectEquality
                    if (upper == res2.getUpperBound()) {
                        // advance res2
                        if (i2.hasNext()) {
                            res2 = i2.next();
                        } else {
                            done = true;
                        }
                    } else {
                        // advance res1
                        if (i1.hasNext()) {
                            res1 = i1.next();
                        } else {
                            done = true;
                        }
                    }
                } else {
                    // move on to next in r1
                    if (i1.hasNext()) {
                        res1 = i1.next();
                    } else {
                        done = true;
                    }
                }
            } else {
                // move on to next in r2
                if (i2.hasNext()) {
                    res2 = i2.next();
                } else {
                    done = true;
                }
            }
        }

        return restrictions;
    }

    public String toString() {
        if (recommendedVersion != null) {
            return recommendedVersion.toString();
        } else {
            StringBuilder buf = new StringBuilder();
            for (Iterator<Restriction> i = restrictions.iterator(); i.hasNext(); ) {
                Restriction r = i.next();

                buf.append(r.toString());

                if (i.hasNext()) {
                    buf.append(',');
                }
            }
            return buf.toString();
        }
    }

    public ArtifactVersion matchVersion(List<ArtifactVersion> versions) {
        // TODO: could be more efficient by sorting the list and then moving along the restrictions in order?

        ArtifactVersion matched = null;
        for (ArtifactVersion version : versions) {
            if (containsVersion(version)) {
                // valid - check if it is greater than the currently matched version
                if (matched == null || version.compareTo(matched) > 0) {
                    matched = version;
                }
            }
        }
        return matched;
    }

    public boolean containsVersion(ArtifactVersion version) {
        for (Restriction restriction : restrictions) {
            if (restriction.containsVersion(version)) {
                return true;
            }
        }
        return false;
    }

    public boolean hasRestrictions() {
        return !restrictions.isEmpty() && recommendedVersion == null;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof VersionRange)) {
            return false;
        }
        VersionRange other = (VersionRange) obj;

        boolean equals =
            recommendedVersion == other.recommendedVersion
                || ((recommendedVersion != null) && recommendedVersion.equals(other.recommendedVersion));
        equals &=
            restrictions == other.restrictions
                || ((restrictions != null) && restrictions.equals(other.restrictions));
        return equals;
    }

    public int hashCode() {
        int hash = 7;
        hash = 31 * hash + (recommendedVersion == null ? 0 : recommendedVersion.hashCode());
        hash = 31 * hash + (restrictions == null ? 0 : restrictions.hashCode());
        return hash;
    }
}


text:
//
//  AppDelegate.m
//  FlowView
//
//  Created by Markus Müller on 13.01.12.
//  Copyright (c) 2012 www.isnotnil.com. All rights reserved.
//

#import "AppDelegate.h"
#import "MMFlowView.h"
#import "Item.h"
#import <Quartz/Quartz.h>

@interface AppDelegate ()

- (void)loadItems:(NSString*)aPath withRepresentationType:(NSString*)aRepresentationType;

@end

@implementation AppDelegate
{
	NSMutableArray *_items;
}

- (id)init {
    self = [super init];
    if (self) {
        _items = [ NSMutableArray array ];
    }
    return self;
}

#pragma mark - MMFlowViewDataSource

- (NSUInteger)numberOfItemsInFlowView:(MMFlowView *)aFlowView
{
	return [self countOfItems];
}

- (id<MMFlowViewItem>)flowView:(MMFlowView *)aFlowView itemAtIndex:(NSUInteger)index
{
	return [self objectInItemsAtIndex:index];
}

- (void)flowViewSelectionDidChange:(MMFlowView *)aFlowView
{
	[self.imageBrowserView setSelectionIndexes:[NSIndexSet indexSetWithIndex:aFlowView.selectedIndex]
						  byExtendingSelection:NO ];
	[self.imageBrowserView scrollIndexToVisible:(NSInteger)aFlowView.selectedIndex];
}

- (NSDragOperation)flowView:(MMFlowView *)aFlowView validateDrop:(id<NSDraggingInfo>)info proposedIndex:(NSUInteger)anIndex
{
	return anIndex == NSNotFound ? NSDragOperationNone : NSDragOperationCopy;
}

- (BOOL)flowView:(MMFlowView *)aFlowView acceptDrop:(id<NSDraggingInfo>)info atIndex:(NSUInteger)anIndex
{
	return YES;
}

#pragma mark - NSApplicationDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
	// Insert code here to initialize your application
	[ self loadItems:@"/Library/Desktop Pictures" withRepresentationType:kMMFlowViewURLRepresentationType ];
	// load all the movies
	NSArray * paths = NSSearchPathForDirectoriesInDomains( NSMoviesDirectory, NSUserDomainMask, YES);
	NSString *moviesPath = paths[0];
	[ self loadItems:moviesPath withRepresentationType:kMMFlowViewQTMoviePathRepresentationType ];

	[ self.flowView bind:NSContentArrayBinding
				toObject:self.itemArrayController
			 withKeyPath:@"arrangedObjects"
				 options:nil ];
	[ self.flowView bind:kMMFlowViewSelectedIndexKey
				toObject:self.itemArrayController
			 withKeyPath:@"selectionIndex"
				 options:nil ];
	// turn quicklook on
	[self.flowView setCanControlQuickLookPanel:YES];
	[self.imageBrowserView reloadData ];
}

- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
{
	return YES;
}

#pragma mark - accesors

- (NSArray*)items
{
	return [_items copy];
}

- (void)setItems:(NSArray *)someItems
{
	if (_items != someItems) {
		_items = [someItems mutableCopy];
	}
}

- (NSUInteger)countOfItems
{
	return [_items count];
}

- (id)objectInItemsAtIndex:(NSUInteger)index
{
	return _items[index];
}

- (NSArray*)itemsAtIndexes:(NSIndexSet *)indexes
{
	return [_items objectsAtIndexes:indexes];
}

- (void)insertObject:(id)object inItemsAtIndex:(NSUInteger)index
{
	[_items insertObject:object atIndex:index];
}

- (void)insertItems:(NSArray *)array atIndexes:(NSIndexSet*)indexes
{
	[_items insertObjects:array atIndexes:indexes];
}

- (void)removeObjectFromItemsAtIndex:(NSUInteger)index
{
	[_items removeObjectAtIndex:index];
}

- (void)removeItemsAtIndexes:(NSIndexSet *)indexes
{
	[_items removeObjectsAtIndexes:indexes];
}

#pragma mark - private implementation

- (void)loadItems:(NSString*)aPath withRepresentationType:(NSString*)aRepresentationType
{
	NSFileManager *fileManager = [NSFileManager defaultManager];
	BOOL isDirectory = NO;
    BOOL exists = [fileManager fileExistsAtPath:aPath isDirectory:&isDirectory];

	if ( exists && isDirectory ) {
		NSDirectoryEnumerator *dirEnumerator = [fileManager enumeratorAtURL:[NSURL fileURLWithPath:aPath]
												  includingPropertiesForKeys:@[NSURLNameKey, NSURLIsDirectoryKey]
																	 options:NSDirectoryEnumerationSkipsHiddenFiles
																errorHandler:nil ];
		for ( NSURL *url in dirEnumerator ) {
			NSNumber *isItemDirectory = NO;
			[url getResourceValue:&isItemDirectory
							forKey:NSURLIsDirectoryKey
							 error:NULL];
			if ( ![isItemDirectory boolValue] ) {
				[ self insertObject:[Item itemWithURL:url representationType:aRepresentationType]
					 inItemsAtIndex:[self countOfItems]];
			}
		}
	}
}

- (void)loadPDFDocument:(NSURL*)anURL
{
	PDFDocument *document = [[PDFDocument alloc] initWithURL:anURL];

	for (NSUInteger i = 0; i < document.pageCount; ++i) {
		PDFPage *page = [document pageAtIndex:i];
		[self insertObject:[Item itemWithPDFPage:page]
			inItemsAtIndex:[self countOfItems]];
	}
}

#pragma mark - IKImageBrowserDataSource

- (NSUInteger)numberOfItemsInImageBrowser:(IKImageBrowserView *)view
{
	return [ self countOfItems ];
}

- (id)imageBrowser:(IKImageBrowserView *)aBrowser itemAtIndex:(NSUInteger)index
{
	return [ self objectInItemsAtIndex:index ];
}

#pragma mark - IBActions

- (IBAction)openDocument:(id)sender
{
	NSOpenPanel *panel = [NSOpenPanel openPanel];

	[panel setAllowedFileTypes:@[@"com.adobe.pdf"]];
	[panel beginWithCompletionHandler:^(NSInteger result) {
		if (result == NSFileHandlingPanelOKButton) {
			[self loadPDFDocument:[panel URL]];
			[self.flowView reloadContent];
		}
	}];
}

- (IBAction)toggleReflection:(id)sender
{
	BOOL show = [(NSButton*)sender state] == NSOnState;
	self.flowView.showsReflection = show;
	[self.reflectionSlider setHidden:!show];
}

- (IBAction)toggleAngle:(id)sender
{
	self.flowView.stackedAngle = [sender selectedTag];
}

- (IBAction)toggleSpacing:(id)sender
{
	self.flowView.spacing = [sender selectedTag];
}

- (IBAction)reflectionChanged:(NSSlider *)sender
{
	self.flowView.reflectionOffset = -[sender floatValue] / 100.0;
}

@end


text:
package buffer

import (
	"encoding/binary"
)

// Limited is a dynamic buffer with a maximum size.  The default value is an
// empty buffer that cannot grow.
type Limited struct {
	d Dynamic
}

// MakeLimited buffer with a maximum size.  The slice must be empty.
//
// This function can be used in field initializer expressions.  The initialized
// field must not be copied.
func MakeLimited(b []byte, maxSize int) Limited {
	return Limited{MakeDynamicHint(b, maxSize)}
}

// NewLimited buffer with a maximum size.  The slice must be empty.
func NewLimited(b []byte, maxSize int) *Limited {
	l := MakeLimited(b, maxSize)
	return &l
}

// Len doesn't panic.
func (l *Limited) Len() int {
	return l.d.Len()
}

// Bytes doesn't panic.
func (l *Limited) Bytes() []byte {
	return l.d.Bytes()
}

// PutByte panicks with ErrSizeLimit if the buffer is already full.
func (l *Limited) PutByte(value byte) {
	if len(l.d.buf) >= l.d.maxSize {
		panic(ErrSizeLimit)
	}
	l.d.PutByte(value)
}

// Extend panicks with ErrSizeLimit if 4 bytes cannot be appended to the
// buffer.
func (l *Limited) PutUint32(i uint32) {
	binary.LittleEndian.PutUint32(l.Extend(4), i)
}

// Extend panicks with ErrSizeLimit if n bytes cannot be appended to the
// buffer.
func (l *Limited) Extend(n int) []byte {
	if len(l.d.buf)+n > l.d.maxSize {
		panic(ErrSizeLimit)
	}
	return l.d.Extend(n)
}

// ResizeBytes panicks with ErrSizeLimit if n is larger than maximum buffer
// size.
func (l *Limited) ResizeBytes(n int) []byte {
	if n > l.d.maxSize {
		panic(ErrSizeLimit)
	}
	return l.d.ResizeBytes(n)
}


text:
({
	createModal : function(cmp, event, helper) {
		var createPanelEvt = helper.getCreatePanelEvent(cmp, cmp.get('v.closeAfterCreate'));
		createPanelEvt.fire();
	},

	incrementTrasitionBeginCount : function(cmp, event) {
		var oldCount = cmp.get('v.tansitionBeginEventCount');
		cmp.set('v.tansitionBeginEventCount', ++oldCount);

		var param = event.getParams();
		if(param.hasGlassBackground) {
			oldCount = cmp.get('v.tansitionBeginEventHasGlassCount');
			cmp.set('v.tansitionBeginEventHasGlassCount', ++oldCount);
		}
	},

	incrementTrasitionEndCount : function(cmp, event) {
		var oldCount = cmp.get('v.tansitionEndEventCount');
		cmp.set('v.tansitionEndEventCount', ++oldCount);

		var param = event.getParams();
		if(param.hasGlassBackground) {
			oldCount = cmp.get('v.tansitionEndEventHasGlassCount');
			cmp.set('v.tansitionEndEventHasGlassCount', ++oldCount);
		}
	}
})


text:
def billboard(name, price = 30)
  name.chars.reduce(0) { |acc, _chr| acc + price }
end


text:
from __future__ import unicode_literals
import base64

import six

from moto.core.responses import BaseResponse
from .models import ses_backend

class EmailResponse(BaseResponse):

    def verify_email_identity(self):
        address = self.querystring.get('EmailAddress')[0]
        ses_backend.verify_email_identity(address)
        template = self.response_template(VERIFY_EMAIL_IDENTITY)
        return template.render()

    def verify_email_address(self):
        address = self.querystring.get('EmailAddress')[0]
        ses_backend.verify_email_address(address)
        template = self.response_template(VERIFY_EMAIL_ADDRESS)
        return template.render()

    def list_identities(self):
        identities = ses_backend.list_identities()
        template = self.response_template(LIST_IDENTITIES_RESPONSE)
        return template.render(identities=identities)

    def list_verified_email_addresses(self):
        email_addresses = ses_backend.list_verified_email_addresses()
        template = self.response_template(LIST_VERIFIED_EMAIL_RESPONSE)
        return template.render(email_addresses=email_addresses)

    def verify_domain_dkim(self):
        domain = self.querystring.get('Domain')[0]
        ses_backend.verify_domain(domain)
        template = self.response_template(VERIFY_DOMAIN_DKIM_RESPONSE)
        return template.render()

    def verify_domain_identity(self):
        domain = self.querystring.get('Domain')[0]
        ses_backend.verify_domain(domain)
        template = self.response_template(VERIFY_DOMAIN_IDENTITY_RESPONSE)
        return template.render()

    def delete_identity(self):
        domain = self.querystring.get('Identity')[0]
        ses_backend.delete_identity(domain)
        template = self.response_template(DELETE_IDENTITY_RESPONSE)
        return template.render()

    def send_email(self):
        bodydatakey = 'Message.Body.Text.Data'
        if 'Message.Body.Html.Data' in self.querystring:
            bodydatakey = 'Message.Body.Html.Data'
        body = self.querystring.get(bodydatakey)[0]
        source = self.querystring.get('Source')[0]
        subject = self.querystring.get('Message.Subject.Data')[0]
        destinations = {
            'ToAddresses': [],
            'CcAddresses': [],
            'BccAddresses': [],
        }
        for dest_type in destinations:
            # consume up to 51 to allow exception
            for i in six.moves.range(1, 52):
                field = 'Destination.%s.member.%s' % (dest_type, i)
                address = self.querystring.get(field)
                if address is None:
                    break
                destinations[dest_type].append(address[0])

        message = ses_backend.send_email(source, subject, body, destinations)
        template = self.response_template(SEND_EMAIL_RESPONSE)
        return template.render(message=message)

    def send_raw_email(self):
        source = self.querystring.get('Source')
        if source is not None:
            source, = source

        raw_data = self.querystring.get('RawMessage.Data')[0]
        raw_data = base64.b64decode(raw_data)
        if six.PY3:
            raw_data = raw_data.decode('utf-8')
        destinations = []
        # consume up to 51 to allow exception
        for i in six.moves.range(1, 52):
            field = 'Destinations.member.%s' % i
            address = self.querystring.get(field)
            if address is None:
                break
            destinations.append(address[0])

        message = ses_backend.send_raw_email(source, destinations, raw_data)
        template = self.response_template(SEND_RAW_EMAIL_RESPONSE)
        return template.render(message=message)

    def get_send_quota(self):
        quota = ses_backend.get_send_quota()
        template = self.response_template(GET_SEND_QUOTA_RESPONSE)
        return template.render(quota=quota)

VERIFY_EMAIL_IDENTITY = """<VerifyEmailIdentityResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <VerifyEmailIdentityResult/>
  <ResponseMetadata>
    <RequestId>47e0ef1a-9bf2-11e1-9279-0100e8cf109a</RequestId>
  </ResponseMetadata>
</VerifyEmailIdentityResponse>"""

VERIFY_EMAIL_ADDRESS = """<VerifyEmailAddressResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <VerifyEmailAddressResult/>
  <ResponseMetadata>
    <RequestId>47e0ef1a-9bf2-11e1-9279-0100e8cf109a</RequestId>
  </ResponseMetadata>
</VerifyEmailAddressResponse>"""

LIST_IDENTITIES_RESPONSE = """<ListIdentitiesResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <ListIdentitiesResult>
    <Identities>
        {% for identity in identities %}
          <member>{{ identity }}</member>
        {% endfor %}
    </Identities>
  </ListIdentitiesResult>
  <ResponseMetadata>
    <RequestId>cacecf23-9bf1-11e1-9279-0100e8cf109a</RequestId>
  </ResponseMetadata>
</ListIdentitiesResponse>"""

LIST_VERIFIED_EMAIL_RESPONSE = """<ListVerifiedEmailAddressesResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <ListVerifiedEmailAddressesResult>
    <VerifiedEmailAddresses>
        {% for email in email_addresses %}
          <member>{{ email }}</member>
        {% endfor %}
    </VerifiedEmailAddresses>
  </ListVerifiedEmailAddressesResult>
  <ResponseMetadata>
    <RequestId>cacecf23-9bf1-11e1-9279-0100e8cf109a</RequestId>
  </ResponseMetadata>
</ListVerifiedEmailAddressesResponse>"""

VERIFY_DOMAIN_DKIM_RESPONSE = """<VerifyDomainDkimResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <VerifyDomainDkimResult>
    <DkimTokens>
      <member>vvjuipp74whm76gqoni7qmwwn4w4qusjiainivf6sf</member>
      <member>3frqe7jn4obpuxjpwpolz6ipb3k5nvt2nhjpik2oy</member>
      <member>wrqplteh7oodxnad7hsl4mixg2uavzneazxv5sxi2</member>
    </DkimTokens>
    </VerifyDomainDkimResult>
    <ResponseMetadata>
      <RequestId>9662c15b-c469-11e1-99d1-797d6ecd6414</RequestId>
    </ResponseMetadata>
</VerifyDomainDkimResponse>"""

VERIFY_DOMAIN_IDENTITY_RESPONSE = """\
<VerifyDomainIdentityResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <VerifyDomainIdentityResult>
    <VerificationToken>QTKknzFg2J4ygwa+XvHAxUl1hyHoY0gVfZdfjIedHZ0=</VerificationToken>
  </VerifyDomainIdentityResult>
  <ResponseMetadata>
    <RequestId>94f6368e-9bf2-11e1-8ee7-c98a0037a2b6</RequestId>
  </ResponseMetadata>
</VerifyDomainIdentityResponse>"""

DELETE_IDENTITY_RESPONSE = """<DeleteIdentityResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <DeleteIdentityResult/>
  <ResponseMetadata>
    <RequestId>d96bd874-9bf2-11e1-8ee7-c98a0037a2b6</RequestId>
  </ResponseMetadata>
</DeleteIdentityResponse>"""

SEND_EMAIL_RESPONSE = """<SendEmailResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <SendEmailResult>
    <MessageId>{{ message.id }}</MessageId>
  </SendEmailResult>
  <ResponseMetadata>
    <RequestId>d5964849-c866-11e0-9beb-01a62d68c57f</RequestId>
  </ResponseMetadata>
</SendEmailResponse>"""

SEND_RAW_EMAIL_RESPONSE = """<SendRawEmailResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <SendRawEmailResult>
    <MessageId>{{ message.id }}</MessageId>
  </SendRawEmailResult>
  <ResponseMetadata>
    <RequestId>e0abcdfa-c866-11e0-b6d0-273d09173b49</RequestId>
  </ResponseMetadata>
</SendRawEmailResponse>"""

GET_SEND_QUOTA_RESPONSE = """<GetSendQuotaResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <GetSendQuotaResult>
    <SentLast24Hours>{{ quota.sent_past_24 }}</SentLast24Hours>
    <Max24HourSend>200.0</Max24HourSend>
    <MaxSendRate>1.0</MaxSendRate>
  </GetSendQuotaResult>
  <ResponseMetadata>
    <RequestId>273021c6-c866-11e0-b926-699e21c3af9e</RequestId>
  </ResponseMetadata>
</GetSendQuotaResponse>"""


text:
#region MIT License

#endregion

#if UseDouble
using Scalar = System.Double;
#else
using Scalar = System.Single;
#endif
using System;
using System.IO;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
//using System.Drawing;
using System.Reflection;
using System.Xml.Serialization;
using AdvanceMath;
using AdvanceMath.Geometry2D;
using Physics2DDotNet;
using Physics2DDotNet.Shapes;
using Physics2DDotNet.Collections;
using Tao.OpenGl;
using SdlDotNet;
using SdlDotNet.Graphics;
using SdlDotNet.Input;
using Color = System.Drawing.Color;
namespace Graphics2DDotNet
{
    public class ViewportMouseMotionEventArgs : ViewportMouseButtonEventArgs
    {
        Vector2D relative;
        public ViewportMouseMotionEventArgs(Vector2D position, Vector2D relative, bool buttonPressed, MouseButton button)
            : base(position, buttonPressed, button)
        {
            this.relative = relative;
        }
        public Vector2D Relative
        {
            get { return relative; }
        }
    }
}


text:
@class APBase;

@interface PublicWifiCompletePageViewController : MMWebViewController
{
    int _followFlag;
    id <PublicWifiCompletePageViewControllerDelegate> _delegate;
    APBase *_apBase;
}

@property(nonatomic) int followFlag; // @synthesize followFlag=_followFlag;
@property(retain, nonatomic) APBase *apBase; // @synthesize apBase=_apBase;
@property(nonatomic) __weak id <PublicWifiCompletePageViewControllerDelegate> delegate; // @synthesize delegate=_delegate;
- (void).cxx_destruct;
- (void)webViewDidFinishLoad:(id)arg1;
- (void)updateFollowFlag:(int)arg1;
- (_Bool)isShouldUpdateFollowFlagWithUserName:(id)arg1;
- (void)onBack;
- (_Bool)gestureRecognizerShouldBegin:(id)arg1;
- (void)onDone;
- (void)viewDidLoad;
- (id)initWithApBase:(id)arg1;

@end


text:
/* mac_i.h */

#ifndef MAC_I_H_FILE
#define MAC_I_H_FILE

#include <stdint.h>

#include "common/buffer.h"
#include "crypto/algorithms.h"

enum SSH_MAC_TYPE {
  SSH_MAC_NONE,
  SSH_MAC_HMAC_SHA2_256,
  SSH_MAC_HMAC_SHA2_512,

  SSH_MAC_INVALID
};

struct SSH_MAC_CTX;

enum SSH_MAC_TYPE ssh_mac_get_by_name(const char *name);
enum SSH_MAC_TYPE ssh_mac_get_by_name_n(const uint8_t *name, size_t name_len);
enum SSH_MAC_TYPE ssh_mac_get_by_name_str(const struct SSH_STRING *name);
int ssh_mac_get_supported_algos(struct SSH_BUFFER *ret);

int ssh_mac_get_len(enum SSH_MAC_TYPE type);

struct SSH_MAC_CTX *ssh_mac_new(enum SSH_MAC_TYPE type, const struct SSH_STRING *key);
void ssh_mac_free(struct SSH_MAC_CTX *mac);
int ssh_mac_compute(struct SSH_MAC_CTX *mac, uint8_t *out, uint32_t seq_num, const uint8_t *data, uint32_t len);

#endif /* MAC_I_H_FILE */


text:
title: 'Zdot Podcast: Spring Template Classes'
author: Tim
layout: post
redirect_from: /2005/02/09/zdot-podcast-spring-template-classes/
enclosure:
  - |
    |
        http://ia600400.us.archive.org/2/items/zdotpodcast/20050209-SpringTemplates.mp3
        15946209
        audio/mpeg

category:  podcast
tags:
  - patterns
  - spring
---

Download [Spring Template Classes.][1]

Today's podcasts gives takes brief look at a couple template classes provided by Spring, and why the idea is really important. I'm still working on a good format for show notes. Here's a bare bones version.

#### Show Notes

[Spring Live][2] by [Matt Raible][3]
[Manning's Spring In Action][4]
[Design Patterns][5]
Portland Pattern Repository [Template Pattern][6] description, better known as the [Template Method Pattern][7]

 [1]: http://ia600400.us.archive.org/2/items/zdotpodcast/20050209-SpringTemplates.mp3
 [2]: http://springlive.com
 [3]: http://raibledesigns.com
 [4]: http://manning.com/walls2
 [5]: http://www.amazon.com/exec/obidos/ASIN/0201633612/timshadel-com
 [6]: http://c2.com/cgi/wiki?TemplatePattern
 [7]: http://c2.com/cgi/wiki?TemplateMethodPattern


text:
<?xml version="1.0" encoding="UTF-8"?>
<meta xmlns="http://exist-db.org/xquery/repo">
    <description>Backend utilities for the Political Mashup project.</description>
    <author>Arjan Nusselder</author>
    <website>http://politicalmashup.nl/</website>
    <status>beta</status>
    <license>MIT</license>
    <copyright>true</copyright>
    <type>application</type>
    <target>backend</target>
    <prepare>pre-install.xql</prepare>
    <finish/>
    <deployed>2014-03-12T12:06:15.526+01:00</deployed>
</meta>