text:
package edu.clemson.cs.rsrg.typeandpopulate.query;

import edu.clemson.cs.rsrg.typeandpopulate.entry.SymbolTableEntry;
import edu.clemson.cs.rsrg.typeandpopulate.exception.DuplicateSymbolException;
import edu.clemson.cs.rsrg.typeandpopulate.query.searcher.TableSearcher;
import edu.clemson.cs.rsrg.typeandpopulate.query.searchpath.ScopeSearchPath;
import edu.clemson.cs.rsrg.typeandpopulate.symboltables.Scope;
import edu.clemson.cs.rsrg.typeandpopulate.symboltables.ScopeRepository;
import java.util.List;

/**
 *
The most basic implementation of {@link SymbolQuery}, which
 * pairs a {@link ScopeSearchPath} with a {@link TableSearcher} to
 * define a fully parameterized strategy for searching a set of scopes.

 *
 * @param <E> The return type of the base SymbolQuery.
 *
 * @version 2.0
 */
abstract class BaseSymbolQuery<E extends SymbolTableEntry>
        implements
            SymbolQuery<E> {

    // ===========================================================
    // Member Fields
    // ===========================================================

    /**
Search path.
 */
    private final ScopeSearchPath mySearchPath;

    /**
Symbol table searcher.
 */
    private final TableSearcher<E> mySearcher;

    // ===========================================================
    // Constructors
    // ===========================================================

    /**
     *
This is an helper constructor for storing the search path
     * and symbol table search strategy.

     *
     * @param path Search path.
     * @param searcher Symbol table searcher.
     */
    protected BaseSymbolQuery(ScopeSearchPath path, TableSearcher<E> searcher) {
        mySearchPath = path;
        mySearcher = searcher;
    }

    // ===========================================================
    // Public Methods
    // ===========================================================

    /**
     *
Given a source {@link Scope} and a
     * {@link ScopeRepository} containing any imports, from
     * which source is drawn, searches them appropriately,
     * returning a list of matching {@link SymbolTableEntry}s
     * that are subtypes of E.

     *
     *
If there are no matches, returns an empty list. If more than one
     * match is found where no more than one was expected, throws a
     * {@link DuplicateSymbolException}.

     *
     * @param source The source scope from which the search was spawned.
     * @param repo A repository of any referenced modules.
     *
     * @return A list of matches.
     */
    @Override
    public final List<E> searchFromContext(Scope source, ScopeRepository repo)
            throws DuplicateSymbolException {
        return mySearchPath.searchFromContext(mySearcher, source, repo);
    }

}


text:
    //什么时候该调用这个方法来从错误中恢复呢?当S.pos() <= errorEndPos???
    //那什么时候该判断S.pos() <= errorEndPos?当errorEndPos有可能改变吗?
    /** Skip forward until a suitable stop token is found.
     */
    private void skip(boolean stopAtImport, boolean stopAtMemberDecl, boolean stopAtIdentifier, boolean stopAtStatement) {
		try {//我加上的
		DEBUG.P(this,"skip(4)");
		DEBUG.P("stopAtImport    ="+stopAtImport);
		DEBUG.P("stopAtMemberDecl="+stopAtMemberDecl);
		DEBUG.P("stopAtIdentifier="+stopAtIdentifier);
		DEBUG.P("stopAtStatement ="+stopAtStatement);

		while (true) {
			switch (S.token()) {
				case SEMI:
                    S.nextToken();
                    return;
                case PUBLIC:
                case FINAL:
                case ABSTRACT:
                case MONKEYS_AT:
                case EOF:
                case CLASS:
                case INTERFACE:
                case ENUM:
                    return;
                case IMPORT:
                	//如果之前的错误是在分析import语句时发现的,经过若干次
                	//nextToken()后,找到了新的叫IMPORT的token,说明找到了
                	//一条新的import语句,现在就可以正常解析了
                    if (stopAtImport)
                        return;
                    break;
                case LBRACE:
                case RBRACE:
                case PRIVATE:
                case PROTECTED:
                case STATIC:
                case TRANSIENT:
                case NATIVE:
                case VOLATILE:
                case SYNCHRONIZED:
                case STRICTFP:
                case LT:
                case BYTE:
                case SHORT:
                case CHAR:
                case INT:
                case LONG:
                case FLOAT:
                case DOUBLE:
                case BOOLEAN:
                case VOID:
                    if (stopAtMemberDecl)
                        return;
                    break;
                case IDENTIFIER:
					if (stopAtIdentifier)
						return;
					break;
                case CASE:
                case DEFAULT:
                case IF:
                case FOR:
                case WHILE:
                case DO:
                case TRY:
                case SWITCH:
                case RETURN:
                case THROW:
                case BREAK:
                case CONTINUE:
                case ELSE:
                case FINALLY:
                case CATCH:
                    if (stopAtStatement)
                        return;
                    break;
            }
            S.nextToken();
        }

		}finally{//我加上的
		DEBUG.P(0,this,"skip(4)");
		}
    }

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace RockSolidIoc.Tests
{
  [TestClass()]
  public class UseLifetimeManagerAttributeTests
  {
    [TestMethod()]
    public void TestTypeOnlyConstructor()
    {
      Type mappedType = typeof(string);
      UseLifetimeManagerAttribute testAttribute = new UseLifetimeManagerAttribute(mappedType);
      Assert.AreEqual(mappedType, testAttribute.Type);
      Assert.AreEqual(String.Empty, testAttribute.Identifier);
    }

    [TestMethod()]
    public void TestTypeStringConstructor()
    {
      Type mappedType = typeof(string);
      string identifier = "identifier";
      UseLifetimeManagerAttribute testAttribute = new UseLifetimeManagerAttribute(mappedType, identifier);
      Assert.AreEqual(mappedType, testAttribute.Type);
      Assert.AreEqual(identifier, testAttribute.Identifier);
    }
  }

}


text:
<!DOCTYPE html>

  <meta name="project_path" value="/web/tools/workbox/_project.yaml" />
  <meta name="book_path" value="/web/tools/workbox/_book.yaml" />
  <meta name="gtm_var" data-key="docType" data-value="reference">
  <title>Class: BackgroundSyncPlugin</title>
  <link href="jsdoc.css" rel="stylesheet">

workbox-background-sync.<wbr>BackgroundSyncPlugin

class   static

              Version

              6.0.2

A class implementing the fetchDidFail lifecycle callback. This makes it
              easier to add failed requests to a background sync Queue.

Constructor

BackgroundSyncPlugin

 new
                BackgroundSyncPlugin(name, options)

Parameter

name

string

See the Queue
                          documentation for parameter details.

options

Optional

Object

See the
                          Queue documentation for
                          parameter details.


text:
$location  = $env:APPVEYOR_BUILD_FOLDER

$locationNuspec = $location + "\nuspec"
$locationNuspec

Set-Location -Path $locationNuspec

"Packaging to nuget..."
"Build folder : " + $location

$strPath = $location + '\MvvX.CouchBaseLite\MvvX.Plugins.CouchBaseLite\bin\Release\MvvX.Plugins.CouchBaseLite.dll'

$VersionInfos = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($strPath)
$ProductVersion = $VersionInfos.ProductVersion
"Product version : " + $ProductVersion

"Update nuspec versions ..."

$nuSpecFile =  $locationNuspec + '\MvvX.Plugins.CouchBaseLite.nuspec'
(Get-Content $nuSpecFile) |
Foreach-Object {$_ -replace "(<version>([0-9.]+)<\/version>)", "<version>$ProductVersion</version>" } |
Set-Content $nuSpecFile

$nuSpecFile =  $locationNuspec + '\MvvX.Plugins.CouchBaseLite.ForestDB.nuspec'
(Get-Content $nuSpecFile) |
Foreach-Object {$_ -replace "(<version>([0-9.]+)<\/version>)", "<version>$ProductVersion</version>" } |
Set-Content $nuSpecFile

$nuSpecFile =  $locationNuspec + '\MvvX.Plugins.CouchBaseLite.SQLCipher.nuspec'
(Get-Content $nuSpecFile) |
Foreach-Object {$_ -replace "(<version>([0-9.]+)<\/version>)", "<version>$ProductVersion</version>" } |
Set-Content $nuSpecFile

"Generate nuget packages ..."
.\NuGet.exe pack MvvX.Plugins.CouchBaseLite.nuspec
.\NuGet.exe pack MvvX.Plugins.CouchBaseLite.ForestDB.nuspec
.\NuGet.exe pack MvvX.Plugins.CouchBaseLite.SQLCipher.nuspec

$apiKey = $env:NuGetApiKey

"Publish packages ..."
.\NuGet push MvvX.Plugins.CouchBaseLite.$ProductVersion.nupkg -Source https://www.nuget.org/api/v2/package -ApiKey $apiKey
.\NuGet push MvvX.Plugins.CouchBaseLite.ForestDB.$ProductVersion.nupkg -Source https://www.nuget.org/api/v2/package -ApiKey $apiKey
.\NuGet push MvvX.Plugins.CouchBaseLite.SQLCipher.$ProductVersion.nupkg -Source https://www.nuget.org/api/v2/package -ApiKey $apiKey


text:
import {NgModule,Component,ElementRef,Input,Output,Renderer,AfterViewInit,OnDestroy} from '@angular/core';
import {CommonModule} from '@angular/common';
import {DomHandler} from '../dom/domhandler';

@Component({
    selector: 'p-lightbox',
    template: `

            <ng-content select="a"></ng-content>

                <ng-content></ng-content>

              {{captionText}}

    `,
    providers: [DomHandler]
})
export class Lightbox implements AfterViewInit,OnDestroy{

    @Input() images: any[];

    @Input() type: string = 'image';

    @Input() style: any;

    @Input() styleClass: string;

    @Input() appendTo: any;

    @Input() easing: 'ease-out';

    @Input() effectDuration: any = '500ms';

    public visible: boolean;

    public loading: boolean;

    public currentImage: any;

    public captionText: string;

    public zindex: any;

    public panel: any;

    public index: number;

    public mask: any;

    public preventDocumentClickListener: boolean;

    public documentClickListener: any;

    constructor(public el: ElementRef, public domHandler: DomHandler, public renderer: Renderer) {}

    onImageClick(event,image,i,content) {
        this.index = i;
        this.loading = true;
        content.style.width = 32 + 'px';
        content.style.height = 32 + 'px';
        this.show();
        this.displayImage(image);

        this.preventDocumentClickListener = true;
        event.preventDefault();
    }

    ngAfterViewInit() {
        this.panel = this.domHandler.findSingle(this.el.nativeElement, '.ui-lightbox ');

        if(this.appendTo) {
            if(this.appendTo === 'body')
                document.body.appendChild(this.panel);
            else
                this.domHandler.appendChild(this.panel, this.appendTo);
        }

        this.documentClickListener = this.renderer.listenGlobal('body', 'click', (event) => {
            if(!this.preventDocumentClickListener&&this.visible) {
                this.hide(event);
            }
            this.preventDocumentClickListener = false;
        });
    }

    onLinkClick(event,content) {
        this.show();
        this.preventDocumentClickListener = true;
        event.preventDefault();
    }

    displayImage(image) {
        setTimeout(() => {
            this.currentImage = image;
            this.captionText = image.title;
        }, 1000);
    }

    show() {
        this.mask = document.createElement('div');
        this.mask.style.zIndex = ++DomHandler.zindex;
        this.domHandler.addMultipleClasses(this.mask, 'ui-widget-overlay ui-dialog-mask');
        document.body.appendChild(this.mask);

        this.zindex = ++DomHandler.zindex;
        this.center();
        this.visible = true;
    }

    hide(event) {
        this.captionText = null;
        this.index = null;
        this.currentImage = null;
        this.visible = false;
        this.panel.style.left = 'auto';
        this.panel.style.top = 'auto';

        if(this.mask) {
            document.body.removeChild(this.mask);
            this.mask = null;
        }

        event.preventDefault();
    }

    center() {
        let elementWidth = this.domHandler.getOuterWidth(this.panel);
        let elementHeight = this.domHandler.getOuterHeight(this.panel);
        if(elementWidth == 0 && elementHeight == 0) {
            this.panel.style.visibility = 'hidden';
            this.panel.style.display = 'block';
            elementWidth = this.domHandler.getOuterWidth(this.panel);
            elementHeight = this.domHandler.getOuterHeight(this.panel);
            this.panel.style.display = 'none';
            this.panel.style.visibility = 'visible';
        }
        let viewport = this.domHandler.getViewport();
        let x = (viewport.width - elementWidth) / 2;
        let y = (viewport.height - elementHeight) / 2;

        this.panel.style.left = x + 'px';
        this.panel.style.top = y + 'px';
    }

    onImageLoad(event,content) {
        let image = event.target;
        image.style.visibility = 'hidden';
        image.style.display = 'block';
        let imageWidth = this.domHandler.getOuterWidth(image);
        let imageHeight = this.domHandler.getOuterHeight(image);
        image.style.display = 'none';
        image.style.visibility = 'visible';

        content.style.width = imageWidth + 'px';
        content.style.height = imageHeight + 'px';
        this.panel.style.left = parseInt(this.panel.style.left) + (this.domHandler.getOuterWidth(this.panel) - imageWidth) / 2 + 'px';
        this.panel.style.top = parseInt(this.panel.style.top) + (this.domHandler.getOuterHeight(this.panel) - imageHeight) / 2 + 'px';

        setTimeout(() => {
            this.domHandler.fadeIn(image, 500);
            image.style.display = 'block';
            //this.captionText = this.currentImage.title;
            this.loading = false;
        }, parseInt(this.effectDuration));
    }

    prev(placeholder: any) {
        this.captionText = null;
        this.loading = true;
        placeholder.style.display = 'none';
        if(this.index > 0) {
            this.displayImage(this.images[--this.index]);
        }
    }

    next(placeholder: any) {
        this.captionText = null;
        this.loading = true;
        placeholder.style.display = 'none';
        if(this.index <= (this.images.length - 1)) {
            this.displayImage(this.images[++this.index]);
        }
    }

    get leftVisible():boolean {
        return this.images && this.images.length && this.index != 0 && !this.loading;
    }

    get rightVisible():boolean {
        return this.images && this.images.length && this.index < (this.images.length - 1) && !this.loading;
    }

    ngOnDestroy() {
        if(this.documentClickListener) {
            this.documentClickListener();
        }

        if(this.appendTo) {
            this.el.nativeElement.appendChild(this.panel);
        }
    }

}

@NgModule({
    imports: [CommonModule],
    exports: [Lightbox],
    declarations: [Lightbox]
})
export class LightboxModule { }


text:
/**
 * @author Mat Groves http://matgroves.com/ @Doormat23
 */
'use strict';

var AbstractFilter = require('./AbstractFilter');

function BlurXFilter()
{
    AbstractFilter.call( this );

    this.passes = [this];

    // set the uniforms
    this.uniforms = {
        blur: {type: '1f', value: 1/512},
    };

    this.fragmentSrc = [
        'precision mediump float;',
        'varying vec2 vTextureCoord;',
        'varying float vColor;',
        'uniform float blur;',
        'uniform sampler2D uSampler;',

        'void main(void) {',
        '   vec4 sum = vec4(0.0);',

        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 4.0*blur, vTextureCoord.y)) * 0.05;',
        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 3.0*blur, vTextureCoord.y)) * 0.09;',
        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - 2.0*blur, vTextureCoord.y)) * 0.12;',
        '   sum += texture2D(uSampler, vec2(vTextureCoord.x - blur, vTextureCoord.y)) * 0.15;',
        '   sum += texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y)) * 0.16;',
        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + blur, vTextureCoord.y)) * 0.15;',
        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 2.0*blur, vTextureCoord.y)) * 0.12;',
        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 3.0*blur, vTextureCoord.y)) * 0.09;',
        '   sum += texture2D(uSampler, vec2(vTextureCoord.x + 4.0*blur, vTextureCoord.y)) * 0.05;',

        '   gl_FragColor = sum;',
        '}'
    ];
}

var proto = BlurXFilter.prototype = Object.create(AbstractFilter.prototype, {
    constructor: {value: BlurXFilter}
});

Object.defineProperty(proto, 'blur', {
    get: function() {
        return this.uniforms.blur.value / (1/7000);
    },
    set: function(value) {

        this.dirty = true;
        this.uniforms.blur.value = (1/7000) * value;
    }
});

module.exports = BlurXFilter;