text:
package org.gradle.api.internal.artifacts;

import org.gradle.StartParameter;
import org.gradle.api.internal.ClassPathRegistry;
import org.gradle.api.internal.artifacts.component.ComponentIdentifierFactory;
import org.gradle.api.internal.artifacts.dsl.dependencies.DependencyFactory;
import org.gradle.api.internal.artifacts.ivyservice.*;
import org.gradle.api.internal.artifacts.ivyservice.dynamicversions.ModuleVersionsCache;
import org.gradle.api.internal.artifacts.ivyservice.dynamicversions.SingleFileBackedModuleVersionsCache;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ResolveIvyFactory;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.StartParameterResolutionOverride;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.memcache.InMemoryCachedRepositoryFactory;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.LatestStrategy;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.LatestVersionStrategy;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.ResolverStrategy;
import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionMatcher;
import org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleArtifactsCache;
import org.gradle.api.internal.artifacts.ivyservice.modulecache.DefaultModuleMetaDataCache;
import org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleArtifactsCache;
import org.gradle.api.internal.artifacts.ivyservice.modulecache.ModuleMetaDataCache;
import org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DependencyDescriptorFactory;
import org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultProjectComponentRegistry;
import org.gradle.api.internal.artifacts.ivyservice.projectmodule.DefaultProjectPublicationRegistry;
import org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectPublicationRegistry;
import org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultDependencyResolver;
import org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.ResolutionResultsStoreFactory;
import org.gradle.api.internal.artifacts.mvnsettings.*;
import org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransportFactory;
import org.gradle.api.internal.file.FileLookup;
import org.gradle.api.internal.file.TemporaryFileProvider;
import org.gradle.api.internal.file.TmpDirTemporaryFileProvider;
import org.gradle.api.internal.filestore.ivy.ArtifactIdentifierFileStore;
import org.gradle.api.internal.notations.ClientModuleNotationParserFactory;
import org.gradle.api.internal.notations.DependencyNotationParser;
import org.gradle.api.internal.notations.ProjectDependencyFactory;
import org.gradle.api.internal.project.ProjectInternal;
import org.gradle.api.internal.project.ProjectRegistry;
import org.gradle.cache.CacheRepository;
import org.gradle.initialization.ProjectAccessListener;
import org.gradle.internal.SystemProperties;
import org.gradle.internal.component.external.model.ModuleComponentArtifactMetaData;
import org.gradle.internal.reflect.Instantiator;
import org.gradle.internal.resource.cached.ByUrlCachedExternalResourceIndex;
import org.gradle.internal.resource.cached.ivy.ArtifactAtRepositoryCachedArtifactIndex;
import org.gradle.internal.resource.local.LocallyAvailableResourceFinder;
import org.gradle.internal.resource.local.UniquePathKeyFileStore;
import org.gradle.internal.resource.local.ivy.LocallyAvailableResourceFinderFactory;
import org.gradle.internal.resource.transport.sftp.SftpClientFactory;
import org.gradle.internal.service.ServiceRegistry;
import org.gradle.logging.ProgressLoggerFactory;
import org.gradle.util.BuildCommencedTimeProvider;

/**
 * The set of dependency management services that are created per build.
 */
class DependencyManagementBuildScopeServices {
    InMemoryCachedRepositoryFactory createInMemoryDependencyMetadataCache() {
        return new InMemoryCachedRepositoryFactory();
    }

    DependencyManagementServices createDependencyManagementServices(ServiceRegistry parent) {
        return new DefaultDependencyManagementServices(parent);
    }

    DependencyFactory createDependencyFactory(Instantiator instantiator,
                                              ProjectAccessListener projectAccessListener,
                                              StartParameter startParameter,
                                              ClassPathRegistry classPathRegistry,
                                              FileLookup fileLookup) {
        DefaultProjectDependencyFactory factory = new DefaultProjectDependencyFactory(
                projectAccessListener, instantiator, startParameter.isBuildProjectDependencies());

        ProjectDependencyFactory projectDependencyFactory = new ProjectDependencyFactory(factory);

        return new DefaultDependencyFactory(
                DependencyNotationParser.parser(instantiator, factory, classPathRegistry, fileLookup),
                new ClientModuleNotationParserFactory(instantiator).create(),
                projectDependencyFactory);
    }

    CacheLockingManager createCacheLockingManager(CacheRepository cacheRepository) {
        return new DefaultCacheLockingManager(cacheRepository);
    }

    BuildCommencedTimeProvider createBuildTimeProvider() {
        return new BuildCommencedTimeProvider();
    }

    ModuleVersionsCache createModuleVersionsCache(BuildCommencedTimeProvider timeProvider, CacheLockingManager cacheLockingManager) {
        return new SingleFileBackedModuleVersionsCache(
                timeProvider,
                cacheLockingManager
        );
    }

    ModuleArtifactsCache createModuleArtifactsCache(BuildCommencedTimeProvider timeProvider, CacheLockingManager cacheLockingManager) {
        return new DefaultModuleArtifactsCache(
                timeProvider,
                cacheLockingManager
        );
    }

    ModuleMetaDataCache createModuleDescriptorCache(BuildCommencedTimeProvider timeProvider, CacheLockingManager cacheLockingManager, ResolverStrategy resolverStrategy) {
        return new DefaultModuleMetaDataCache(
                timeProvider,
                cacheLockingManager,
                resolverStrategy
        );
    }

    ArtifactAtRepositoryCachedArtifactIndex createArtifactAtRepositoryCachedResolutionIndex(BuildCommencedTimeProvider timeProvider, CacheLockingManager cacheLockingManager) {
        return new ArtifactAtRepositoryCachedArtifactIndex(
                "artifact-at-repository",
                timeProvider,
                cacheLockingManager
        );
    }

    ByUrlCachedExternalResourceIndex createArtifactUrlCachedResolutionIndex(BuildCommencedTimeProvider timeProvider, CacheLockingManager cacheLockingManager) {
        return new ByUrlCachedExternalResourceIndex(
                "artifact-at-url",
                timeProvider,
                cacheLockingManager
        );
    }

    ArtifactIdentifierFileStore createArtifactRevisionIdFileStore(CacheLockingManager cacheLockingManager) {
        return new ArtifactIdentifierFileStore(new UniquePathKeyFileStore(cacheLockingManager.getFileStoreDirectory()), new TmpDirTemporaryFileProvider());
    }

    MavenSettingsProvider createMavenSettingsProvider() {
        return new DefaultMavenSettingsProvider(new DefaultMavenFileLocations());
    }

    LocalMavenRepositoryLocator createLocalMavenRepositoryLocator(MavenSettingsProvider mavenSettingsProvider) {
        return new DefaultLocalMavenRepositoryLocator(mavenSettingsProvider, SystemProperties.asMap(), System.getenv());
    }

    LocallyAvailableResourceFinder<ModuleComponentArtifactMetaData> createArtifactRevisionIdLocallyAvailableResourceFinder(ArtifactCacheMetaData artifactCacheMetaData, LocalMavenRepositoryLocator localMavenRepositoryLocator, ArtifactIdentifierFileStore fileStore) {
        LocallyAvailableResourceFinderFactory finderFactory = new LocallyAvailableResourceFinderFactory(
                artifactCacheMetaData,
                localMavenRepositoryLocator,
                fileStore);
        return finderFactory.create();
    }

    ResolverStrategy createResolverStrategy() {
        return new ResolverStrategy();
    }

    VersionMatcher createVersionMatcher(ResolverStrategy resolverStrategy) {
        return resolverStrategy.getVersionMatcher();
    }

    LatestStrategy createLatestStrategy(VersionMatcher versionMatcher) {
        return new LatestVersionStrategy(versionMatcher);
    }

    SftpClientFactory createSftpClientFactory() {
        return new SftpClientFactory();
    }

    RepositoryTransportFactory createRepositoryTransportFactory(ProgressLoggerFactory progressLoggerFactory,
                                                                TemporaryFileProvider temporaryFileProvider,
                                                                ByUrlCachedExternalResourceIndex externalResourceIndex,
                                                                BuildCommencedTimeProvider buildCommencedTimeProvider,
                                                                SftpClientFactory sftpClientFactory,
                                                                CacheLockingManager cacheLockingManager) {
        return new RepositoryTransportFactory(
                progressLoggerFactory,
                temporaryFileProvider,
                externalResourceIndex,
                buildCommencedTimeProvider,
                sftpClientFactory,
                cacheLockingManager
        );
    }

    ResolveIvyFactory createResolveIvyFactory(StartParameter startParameter, ModuleVersionsCache moduleVersionsCache, ModuleMetaDataCache moduleMetaDataCache, ModuleArtifactsCache moduleArtifactsCache,
                                              ArtifactAtRepositoryCachedArtifactIndex artifactAtRepositoryCachedArtifactIndex, CacheLockingManager cacheLockingManager,
                                              BuildCommencedTimeProvider buildCommencedTimeProvider, InMemoryCachedRepositoryFactory inMemoryCachedRepositoryFactory,
                                              VersionMatcher versionMatcher, LatestStrategy latestStrategy) {
        StartParameterResolutionOverride startParameterResolutionOverride = new StartParameterResolutionOverride(startParameter);
        return new ResolveIvyFactory(
                moduleVersionsCache,
                moduleMetaDataCache,
                moduleArtifactsCache,
                artifactAtRepositoryCachedArtifactIndex,
                cacheLockingManager,
                startParameterResolutionOverride,
                buildCommencedTimeProvider,
                inMemoryCachedRepositoryFactory,
                versionMatcher,
                latestStrategy);
    }

    ArtifactDependencyResolver createArtifactDependencyResolver(ResolveIvyFactory resolveIvyFactory, LocalComponentFactory publishModuleDescriptorConverter, DependencyDescriptorFactory dependencyDescriptorFactory,
                                                                CacheLockingManager cacheLockingManager, IvyContextManager ivyContextManager, ResolutionResultsStoreFactory resolutionResultsStoreFactory,
                                                                LatestStrategy latestStrategy, ProjectRegistry<ProjectInternal> projectRegistry, ComponentIdentifierFactory componentIdentifierFactory) {
        ArtifactDependencyResolver resolver = new DefaultDependencyResolver(
                resolveIvyFactory,
                publishModuleDescriptorConverter,
                dependencyDescriptorFactory,
                new DefaultProjectComponentRegistry(
                        publishModuleDescriptorConverter,
                        projectRegistry),
                cacheLockingManager,
                ivyContextManager,
                resolutionResultsStoreFactory,
                latestStrategy);
        return new ErrorHandlingArtifactDependencyResolver(
                new ShortcircuitEmptyConfigsArtifactDependencyResolver(
                        new SelfResolvingDependencyResolver(
                                new CacheLockingArtifactDependencyResolver(
                                        cacheLockingManager,
                                        resolver)),
                        componentIdentifierFactory));
    }

    ResolutionResultsStoreFactory createResolutionResultsStoreFactory(TemporaryFileProvider temporaryFileProvider) {
        return new ResolutionResultsStoreFactory(temporaryFileProvider);
    }

    ProjectPublicationRegistry createProjectPublicationRegistry() {
        return new DefaultProjectPublicationRegistry();
    }
}


text:
/**
 * @requires jsts/geom/GeometryFilter.js
 */

/**
 * A ConnectedElementPointFilter extracts a single point from each connected
 * element in a Geometry (e.g. a polygon, linestring or point) and returns them
 * in a list. The elements of the list are
 * {@link com.vividsolutions.jts.operation.distance.GeometryLocation}s.
 *
 * @param {[]}
 *          locations
 * @augments jsts.geom.GeometryFilter
 * @constructor
 */
jsts.operation.distance.ConnectedElementLocationFilter = function(locations) {
  this.locations = locations;
};

jsts.operation.distance.ConnectedElementLocationFilter.prototype = new jsts.geom.GeometryFilter();

/**
 * @type {[]}
 * @private
 */
jsts.operation.distance.ConnectedElementLocationFilter.prototype.locations = null;

/**
 * Returns a list containing a point from each Polygon, LineString, and Point
 * found inside the specified geometry. Thus, if the specified geometry is not a
 * GeometryCollection, an empty list will be returned. The elements of the list
 * are {@link com.vividsolutions.jts.operation.distance.GeometryLocation}s.
 *
 * @param {Geometry}
 *          geom
 * @return {[]}
 */
jsts.operation.distance.ConnectedElementLocationFilter.getLocations = function(
    geom) {
  var locations = [];
  geom.apply(new jsts.operation.distance.ConnectedElementLocationFilter(
      locations));
  return locations;
};

/**
 * @param {Geometry}
 *          geom
 */
jsts.operation.distance.ConnectedElementLocationFilter.prototype.filter = function(
    geom) {
  if (geom instanceof jsts.geom.Point || geom instanceof jsts.geom.LineString ||
      geom instanceof jsts.geom.Polygon)
    this.locations.push(new jsts.operation.distance.GeometryLocation(geom, 0,
        geom.getCoordinate()));
};

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using MySql.Data.MySqlClient;
using System.Data;
using System.Data.SqlClient;
using TeslaSQL.DataUtils;

namespace TeslaSQL.DataCopy
{
    public class MySQLToMSSQLDataCopy : IDataCopy
    {
        private MySQLDataUtils sourceDataUtils;
        private MSSQLDataUtils destDataUtils;
        private Logger logger;

        public MySQLToMSSQLDataCopy(MySQLDataUtils sourceDataUtils, MSSQLDataUtils destDataUtils, Logger logger)
        {
            this.sourceDataUtils = sourceDataUtils;
            this.destDataUtils = destDataUtils;
            this.logger = logger;
        }

        private void CopyDataFromQuery(string sourceDB, string destDB, MySqlCommand cmd, string destinationTable, string destinationSchema = "dbo", int queryTimeout = 36000, int bulkCopyTimeout = 36000)
        {
            destinationSchema = "dbo";
            sourceDB = sourceDB.Replace("[","");
            sourceDB = sourceDB.Replace("]","");
            using (IDataReader reader = sourceDataUtils.ExecuteReader(sourceDB, cmd, 1200))
            {
                destDataUtils.BulkCopy(reader, destDB, destinationSchema, destinationTable, bulkCopyTimeout);
            }
        }

        public void CopyTable(string sourceDB, string sourceTableName, string schema, string destDB, int timeout, string destTableName = null, string originalTableName = null)
        {
            //by default the dest table will have the same name as the source table
            destTableName = destTableName ?? sourceTableName;

            //drop table at destination and create from source schema
            CopyTableDefinition(sourceDB, sourceTableName, schema, destDB, destTableName, originalTableName);

            //if we are provided an original table name, get the configured fieldlists for it
            //if not (i.e. in the case of tblCTTableInfo in shardcoordinator) we can just use *
            string columnList;
            if (originalTableName == null)
            {
                columnList = "*";
            }
            else
            {
                var columns = sourceDataUtils.GetFieldList(sourceDB, sourceTableName, schema);
                columnList = string.Join(",", columns.Select(c => c.name));
            }

            //can't parametrize tablename or schema name but they have already been validated against the server so it's safe
            var cmd = new MySqlCommand(string.Format("SELECT {0} FROM {1}", columnList, sourceTableName));
            CopyDataFromQuery(sourceDB, destDB, cmd, destTableName, schema, timeout, timeout);
        }

        /// <summary>
        /// Copies the table from sourceDB.sourceTableName over to destDB.destTableName. Deletes the existing destination table first if it exists
        /// </summary>
        public void CopyTableDefinition(string sourceDB, string sourceTableName, string schema, string destDB, string destTableName, string originalTableName = null)
        {
            List<TColumn> columns = sourceDataUtils.GetFieldList(sourceDB, sourceTableName);
            List<String> pkColumnNames = new List<String>();

            StringBuilder script = new StringBuilder();
            String type;
            script.Append("CREATE TABLE [");
            //script.Append(schema);
            script.Append("dbo");
            script.Append("].[");
            script.Append(destTableName);
            script.AppendLine("](");

            foreach (TColumn column in columns)
            {
                script.Append('[');
                script.Append(column.name);
                script.Append("] [");
                type = DataType.MapDataType(SqlFlavor.MySQL, SqlFlavor.MSSQL, column.dataType.BaseType);
                script.Append(type);
                script.Append(']');

                if (column.isPk)
                {
                    pkColumnNames.Add(column.name);
                }

                switch (type)
                {
                    case "varchar":
                    case "nvarchar":
                    case "char":
                    case "nchar":
                    case "text":
                    case "ntext":
                        script.Append('(');
                        script.Append((column.dataType.CharacterMaximumLength != null && column.dataType.CharacterMaximumLength < 8000) ? column.dataType.CharacterMaximumLength.ToString() : "MAX");
                        script.Append(')');
                        break;
                    case "decimal":
                    case "numeric":
                    case "real":
                    case "float":
                        script.Append('(');
                        script.Append(column.dataType.NumericPrecision ?? 18);
                        if (column.dataType.NumericScale != null)
                        {
                            script.Append(',');
                            script.Append(column.dataType.NumericScale);
                        }
                        script.Append(')');
                        break;
                    default:
                        break;
                }

                if (column.isNullable)
                {
                    script.Append(" NULL");
                }
                else
                {
                    script.Append(" NOT NULL");
                }

                if (column != columns.Last())
                {
                    script.AppendLine(",");
                }
                else
                {
                    script.AppendLine();
                }
            }

            if (pkColumnNames.Count > 0)
            {
                script.Append(", CONSTRAINT pk_");
                script.Append(destTableName);
                script.Append(" PRIMARY KEY (");
                if (pkColumnNames.Count == 1)
                {
                    script.Append(pkColumnNames.FirstOrDefault());
                }
                else
                {
                    script.Append(pkColumnNames.Aggregate((i, j) => i + ", " + j));
                }
                script.Append(')');
            }
            script.Append(')');
            //drop it if it exists at the destination
            destDataUtils.DropTableIfExists(destDB, destTableName, "dbo");

            //create it at the destination
            destDataUtils.SqlNonQuery(destDB, new SqlCommand(script.ToString() + ";"));
        }

    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
org.apache.poi.ss.formula.ptg (POI API Documentation)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

Package org.apache.poi.ss.formula.ptg

formula package contains binary PTG structures used in Formulas

See:

          Description

Interface Summary

AreaI
Common interface for AreaPtg and Area3DPtg, and their child classes.

Pxg
An XSSF only special kind of Ptg, which stores the sheet / book
  reference in string form.

Pxg3D
An XSSF only special kind of Ptg, which stores a range of
  sheet / book references in string form.

Class Summary

AbstractFunctionPtg
This class provides the base functionality for Excel sheet functions
 There are two kinds of function Ptgs - tFunc and tFuncVar
 Therefore, this class will have ONLY two subclasses

AddPtg
Addition operator PTG the "+" binomial operator.

Area2DPtgBase
Common superclass of 2-D area refs

Area3DPtg
Title:        Area 3D Ptg - 3D reference (Sheet + Area)

Area3DPxg
Title:        XSSF Area 3D Reference (Sheet + Area)

AreaErrPtg
AreaErr - handles deleted cell area references.

AreaI.OffsetArea

AreaNPtg
Specifies a rectangular area of cells A1:A4 for instance.

AreaPtg
Specifies a rectangular area of cells A1:A4 for instance.

AreaPtgBase
Specifies a rectangular area of cells A1:A4 for instance.

ArrayPtg
ArrayPtg - handles arrays

 The ArrayPtg is a little weird, the size of the Ptg when parsing initially only
 includes the Ptg sid and the reserved bytes.

AttrPtg
"Special Attributes"
 This seems to be a Misc Stuff and Junk record.

AttrPtg.SpaceType

BoolPtg
Boolean (boolean) Stores a (java) boolean value in a formula.

ConcatPtg

ControlPtg
Common superclass for
 tExp
 tTbl
 tParen
 tNlr
 tAttr
 tSheet
 tEndSheet

Deleted3DPxg
An XSSF only representation of a reference to a deleted area

DeletedArea3DPtg
Title:        Deleted Area 3D Ptg - 3D referecnce (Sheet + Area)

DeletedRef3DPtg
Title:        Deleted Reference 3D Ptg

DividePtg
This PTG implements the standard binomial divide "/"

EqualPtg

ErrPtg

ExpPtg

FuncPtg

FuncVarPtg

GreaterEqualPtg
PTG class to implement greater or equal to

GreaterThanPtg
Greater than operator PTG ">"

IntersectionPtg

IntPtg
Integer (unsigned short integer) Stores an unsigned short value (java int) in
 a formula

LessEqualPtg
Ptg class to implement less than or equal

LessThanPtg
Less than operator PTG "<".

MemAreaPtg

MemErrPtg

MemFuncPtg

MissingArgPtg
Missing Function Arguments

 Avik Sengupta <avik at apache.org>

MultiplyPtg
Implements the standard mathmatical multiplication - *

NamePtg

NameXPtg
A Name, be that a Named Range or a Function / User Defined
  Function, addressed in the HSSF External Sheet style.

NameXPxg
A Name, be that a Named Range or a Function / User Defined
  Function, addressed in the HSSF External Sheet style.

NotEqualPtg
Ptg class to implement not equal

NumberPtg
Number Stores a floating point value in a formula value stored in a 8 byte
 field using IEEE notation

OperandPtg

OperationPtg
defines a Ptg that is an operation instead of an operand

ParenthesisPtg
While formula tokens are stored in RPN order and thus do not need parenthesis
 for precedence reasons, Parenthesis tokens ARE written to ensure that user
 entered parenthesis are displayed as-is on reading back

 Avik Sengupta <lists@aviksengupta.com> Andrew C.

PercentPtg
Percent PTG.

PowerPtg

Ptg
<tt>Ptg</tt> represents a syntactic token in a formula.

RangePtg

Ref3DPtg
Title:        Reference 3D Ptg

Ref3DPxg
Title:        XSSF 3D Reference

RefErrorPtg
RefError - handles deleted cell reference

RefNPtg
RefNPtg

RefPtg
ReferencePtg - handles references (such as A1, A2, IA4)

RefPtgBase
ReferencePtgBase - handles references (such as A1, A2, IA4)

ScalarConstantPtg
Common superclass of all Ptgs that represent simple constant values.

StringPtg
String Stores a String value in a formula value stored in the format
 <length 2 bytes>char[]

SubtractPtg

TblPtg
This ptg indicates a data table.

UnaryMinusPtg
Unary Plus operator
 does not have any effect on the operand

UnaryPlusPtg
Unary Plus operator
 does not have any effect on the operand

UnionPtg

UnknownPtg

ValueOperatorPtg
Common superclass of all value operators.

Package org.apache.poi.ss.formula.ptg Description

formula package contains binary PTG structures used in Formulas

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:

Apache POI Project

See Also:
org.apache.poi.hssf.record,
FormulaRecord

      Overview
    Package
      Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV PACKAGE
 NEXT PACKAGE

  FRAMES
 NO FRAMES

  All Classes

                Copyright 2016 The Apache Software Foundation or
        its licensors, as applicable.


text:
var http   = require('http');
var fs     = require('fs');
var stream = require('..');

http.createServer(demo).listen(3000);

function demo(req, res) {
  if (req.url === '/') {
    return fs.createReadStream(__dirname + '/server.html').pipe(res);
  }
  if (/youtube/.test(req.url)) {
    stream(req.url.slice(1)).pipe(res);
  }
}

console.log('open http://localhost:3000 for demo of audio stream');