text:
using System;

namespace AsmResolver.DotNet.Builder
{
    /// <summary>
    /// Provides a context in which a PE image construction takes place in.
    /// </summary>
    public class PEImageBuildContext
    {
        /// <summary>
        /// Creates a new empty build context.
        /// </summary>
        public PEImageBuildContext()
        {
            DiagnosticBag = new DiagnosticBag();
        }

        /// <summary>
        /// Creates a new build context.
        /// </summary>
        /// <param name="diagnosticBag">The diagnostic bag to use.</param>
        public PEImageBuildContext(DiagnosticBag diagnosticBag)
        {
            DiagnosticBag = diagnosticBag ?? throw new ArgumentNullException(nameof(diagnosticBag));
        }

        /// <summary>
        /// Gets the bag that collects all diagnostic information during the building process.
        /// </summary>
        public DiagnosticBag DiagnosticBag
        {
            get;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 39(5): 505 (1947)

#### Original name
Cantharellus pseudoclavatus A.H. Sm.

### Remarks
null


text:
from itertools import combinations_with_replacement
# Reading input string and r for combinations_with_replacement or in short calling as cwr
input_string, r_for_cwr = input().split()
# Sorting the string before applying cwr to get the str in lexicographic order
input_string = ''.join(sorted(input_string))
# Getting cwr for sorted input string and given r
input_string_cwr = list(combinations_with_replacement(input_string, int(r_for_cwr)))
# Looping through the list of tuples
for el in input_string_cwr:
    # Converting tuple to string and printing.
    print(''.join(el))


text:
package libfs

// MetricsFileName is the name of the KBFS metrics file -- it can be
// reached from any KBFS directory.
const MetricsFileName = ".kbfs_metrics"

// ReclaimQuotaFileName is the name of the KBFS quota-reclaiming file
// -- it can be reached anywhere within a top-level folder.
const ReclaimQuotaFileName = ".kbfs_reclaim_quota"

// RekeyFileName is the name of the KBFS rekeying file -- it can be
// reached anywhere within a top-level folder.
const RekeyFileName = ".kbfs_rekey"

// StatusFileName is the name of the KBFS status file -- it can be reached
// anywhere within a top-level folder or inside the Keybase root
const StatusFileName = ".kbfs_status"

// SyncFromServerFileName is the name of the KBFS sync-from-server
// file -- it can be reached anywhere within a top-level folder.
const SyncFromServerFileName = ".kbfs_sync_from_server"

// UnstageFileName is the name of the KBFS unstaging file -- it can be
// reached anywhere within a top-level folder.
const UnstageFileName = ".kbfs_unstage"

// DisableUpdatesFileName is the name of the KBFS update-disabling
// file -- it can be reached anywhere within a top-level folder.
const DisableUpdatesFileName = ".kbfs_disable_updates"

// EnableUpdatesFileName is the name of the KBFS update-enabling
// file -- it can be reached anywhere within a top-level folder.
const EnableUpdatesFileName = ".kbfs_enable_updates"

// ResetCachesFileName is the name of the KBFS unstaging file.
const ResetCachesFileName = ".kbfs_reset_caches"

// EnableJournalFileName is the name of the journal-enabling file. It
// can be reached anywhere within a top-level folder.
const EnableJournalFileName = ".kbfs_enable_journal"

// FlushJournalFileName is the name of the journal-flushing file. It
// can be reached anywhere within a top-level folder.
const FlushJournalFileName = ".kbfs_flush_journal"

// PauseJournalBackgroundWorkFileName is the name of the file that
// pauses the background work of a journal. It can be reached anywhere
// within a top-level folder.
const PauseJournalBackgroundWorkFileName = ".kbfs_pause_journal_background_work"

// ResumeJournalBackgroundWorkFileName is the name of the file that
// resumes the background work of a journal. It can be reached
// anywhere within a top-level folder.
const ResumeJournalBackgroundWorkFileName = ".kbfs_resume_journal_background_work"

// DisableJournalFileName is the name of the journal-disabling
// file. It can be reached anywhere within a top-level folder.
const DisableJournalFileName = ".kbfs_disable_journal"

// EnableAutoJournalsFileName is the name of the KBFS-wide
// auto-journal-enabling file.  It's accessible anywhere outside a TLF.
const EnableAutoJournalsFileName = ".kbfs_enable_auto_journals"

// DisableAutoJournalsFileName is the name of the KBFS-wide
// auto-journal-disabling file.  It's accessible anywhere outside a
// TLF.
const DisableAutoJournalsFileName = ".kbfs_disable_auto_journals"

// EnableBlockPrefetchingFileName is the name of the KBFS-wide
// prefetching-enabling file.  It's accessible anywhere outside a TLF.
const EnableBlockPrefetchingFileName = ".kbfs_enable_block_prefetching"

// DisableBlockPrefetchingFileName is the name of the KBFS-wide
// prefetching-disabling file.  It's accessible anywhere outside a TLF.
const DisableBlockPrefetchingFileName = ".kbfs_disable_block_prefetching"

// EnableDebugServerFileName is the name of the file to turn on the
// debug HTTP server. It's accessible anywhere outside a TLF.
const EnableDebugServerFileName = ".kbfs_enable_debug_server"

// DisableDebugServerFileName is the name of the file to turn on the
// debug HTTP server. It's accessible anywhere outside a TLF.
const DisableDebugServerFileName = ".kbfs_disable_debug_server"

// EditHistoryName is the name of the KBFS TLF edit history file --
// it can be reached anywhere within a top-level folder.
const EditHistoryName = ".kbfs_edit_history"

// UpdateHistoryFileName is the name of the KBFS update history -- it
// can be reached anywhere within a top-level folder.
const UpdateHistoryFileName = ".kbfs_update_history"

// FileInfoPrefix is the prefix of the per-file metadata files.
const FileInfoPrefix = ".kbfs_fileinfo_"

// EnableSyncFileName is the name of the file to enable the sync cache for a
// TLF. It can be reached anywhere within a TLF.
const EnableSyncFileName = ".kbfs_enable_sync"

// DisableSyncFileName is the name of the file to disable the sync cache for a
// TLF. It can be reached anywhere within a TLF.
const DisableSyncFileName = ".kbfs_disable_sync"

// ArchivedRevDirPrefix is the prefix to the directory at the root of a
// TLF that exposes a version of that TLF at the specified revision.
const ArchivedRevDirPrefix = ".kbfs_archived_rev="

// ArchivedTimeLinkPrefix is the prefix to the symlink at the root of a
// TLF that links to a version of that TLF at the specified time.
const ArchivedTimeLinkPrefix = ".kbfs_archived_time="

// ArchivedRelTimeFilePrefix is the prefix to the file at the root of
// a TLF that contains the directory name of an archived revision
// described by the given relative time.
const ArchivedRelTimeFilePrefix = ".kbfs_archived_reltime="


text:
#include "hw/hw.h"
#include "hw/boards.h"
#include "hw/loader.h"
#include "elf.h"
#include "exec/address-spaces.h"

#define KERNEL_LOAD_ADDR 0x10000

/* Board init.  */

static void dummy_m68k_init(MachineState *machine)
{
    ram_addr_t ram_size = machine->ram_size;
    const char *cpu_model = machine->cpu_model;
    const char *kernel_filename = machine->kernel_filename;
    CPUM68KState *env;
    MemoryRegion *address_space_mem =  get_system_memory();
    MemoryRegion *ram = g_new(MemoryRegion, 1);
    int kernel_size;
    uint64_t elf_entry;
    hwaddr entry;

    if (!cpu_model)
        cpu_model = "cfv4e";
    env = cpu_init(cpu_model);
    if (!env) {
        fprintf(stderr, "Unable to find m68k CPU definition\n");
        exit(1);
    }

    /* Initialize CPU registers.  */
    env->vbr = 0;

    /* RAM at address zero */
    memory_region_init_ram(ram, NULL, "dummy_m68k.ram", ram_size, &error_abort);
    vmstate_register_ram_global(ram);
    memory_region_add_subregion(address_space_mem, 0, ram);

    /* Load kernel.  */
    if (kernel_filename) {
        kernel_size = load_elf(kernel_filename, NULL, NULL, &elf_entry,
                               NULL, NULL, 1, ELF_MACHINE, 0);
        entry = elf_entry;
        if (kernel_size < 0) {
            kernel_size = load_uimage(kernel_filename, &entry, NULL, NULL);
        }
        if (kernel_size < 0) {
            kernel_size = load_image_targphys(kernel_filename,
                                              KERNEL_LOAD_ADDR,
                                              ram_size - KERNEL_LOAD_ADDR);
            entry = KERNEL_LOAD_ADDR;
        }
        if (kernel_size < 0) {
            fprintf(stderr, "qemu: could not load kernel '%s'\n",
                    kernel_filename);
            exit(1);
        }
    } else {
        entry = 0;
    }
    env->pc = entry;
}

static QEMUMachine dummy_m68k_machine = {
    .name = "dummy",
    .desc = "Dummy board",
    .init = dummy_m68k_init,
};

static void dummy_m68k_machine_init(void)
{
    qemu_register_machine(&dummy_m68k_machine);
}

machine_init(dummy_m68k_machine_init);


text:
class fps_cam_c {
  v3d_t pos;      // where the 'feet' are
  v3d_t target;    // where the camera is pointed
  v3d_t up;      // the 'up' vector for the camera

  double height;

  double facing;    // the angle on the x-z plane off the positive x-axis

  double elevation;    // the angle on the vertical plane off the x-z plane intersection...
  double elevation_min;  // upper constraint for elevation angle
  double elevation_max;  // lower constraint for elevation angle

public:
  fps_cam_c ();
  ~fps_cam_c ();

  // set with target, facing, elevation, and distance
  int setup_cam (v3d_t t, double f, double e, double d);

  // sets the height (y) for pos
  int set_foot_height (double h);

  // update the camera target
  int update_target (void);

  // make sure everything is legal
  int constrain (void);

  // pan view around view globe
  int pan (v2d_t a);

  // translate the camera and target position
  int translate (v2d_t a);

  // change height relative to its current value
  int change_height_rel (double delta);

  // change the camera position
  int set_cam (v3d_t a);

  // change the target position
  int set_target (v3d_t a);

  // set the near and far values for the camera
  int set_near_and_far (double n, double f);

  // use the gluLookAt () to set view at render time
  int look_at (frustum_c &f);

  // return the pos vector
  v3d_t get_pos (void);
};

#endif // FpsCam_h_


text:
[![NPM version](https://badge.fury.io/js/smb2.svg)](http://badge.fury.io/js/smb2) [![Dependency Status](https://david-dm.org/bchelli/node-smb2.svg?theme=shields.io)](https://david-dm.org/bchelli/node-smb2) [![Code Climate](https://codeclimate.com/github/bchelli/node-smb2.svg)](https://codeclimate.com/github/bchelli/node-smb2)

## Introduction

This library is a simple implementation of marsaud-smb2 for Node.js. It allows you to access a SMB2 share as if you were using the native fs library.

The development is still at an experimental stage and should not be yet considered for production environment.

## Different

add fileAttributes in readdir result Used to determine whether the file or folder ,mabe 0x0010 is folder,  0x0100 is file.

add fileSize in readdir

## Installation

```bash
npm install -S smb2c
```

## API

### var smb2Client = new SMB2 ( options )
The SMB2 class is the constructor of your SMB2 client.

the parameter ```options``` accepts this list of attributes:

- ```share``` (mandatory): the share you want to access
- ```domain``` (mandatory): the domain of which the user is registred
- ```username``` (mandatory): the username of the user that access the share
- ```password``` (mandatory): the password
- ```port``` (optional): default ```445```, the port of the SMB server
- ```packetConcurrency``` (optional): default ```20```, the number of simulatanous packet when writting / reading data from the share
- ```autoCloseTimeout``` (optional): default ```10000```, the timeout in milliseconds before to close the SMB2 session and the socket, if setted to ```0``` the connection will never be closed unless you do it

Example:
```javascript
// load the library
var SMB2 = require('smb2');

// create an SMB2 instance
var smb2Client = new SMB2({
  share:'\\\\000.000.000.000\\c$'
, domain:'DOMAIN'
, username:'username'
, password:'password!'
});
```

### smb2Client.readdir ( path, callback )
Asynchronous readdir(3). Reads the contents of a directory. The callback gets two arguments (err, files) where files is an array of the names of the files in the directory excluding '.' and '..'.

Example:
```javascript
smb2Client.readdir('Windows\\System32', function(err, files){
    if(err) throw err;
    console.log(files);
});
```

### smb2Client.readFile ( filename, [options], callback )
- ```filename``` String
- ```options``` Object
    - ```encoding``` String | Null default = null
- ```callback``` Function

Asynchronously reads the entire contents of a file. Example:
```javascript
smb2Client.readFile('path\\to\\my\\file.txt', function(err, data){
    if(err) throw err;
    console.log(data);
});
```
The callback is passed two arguments (err, data), where data is the contents of the file.

If no encoding is specified, then the raw buffer is returned.

### smb2Client.writeFile ( filename, data, [options], callback )
- ```filename``` String
- ```data``` String | Buffer
- ```options``` Object
    - ```encoding``` String | Null default = 'utf8'
- ```callback``` Function

Asynchronously writes data to a file, replacing the file if it already exists. data can be a string or a buffer.

The encoding option is ignored if data is a buffer. It defaults to 'utf8'.

Example:
```javascript
smb2Client.writeFile('path\\to\\my\\file.txt', 'Hello Node', function (err) {
    if (err) throw err;
    console.log('It\'s saved!');
});
```

### smb2Client.mkdir ( path, [mode], callback )
Asynchronous mkdir(2). No arguments other than a possible exception are given to the completion callback. mode defaults to 0777.

Example:
```javascript
smb2Client.mkdir('path\\to\\the\\folder', function (err) {
    if (err) throw err;
    console.log('Folder created!');
});
```

### smb2Client.rmdir ( path, callback )
Asynchronous rmdir(2). No arguments other than a possible exception are given to the completion callback.

Example:
```javascript
smb2Client.rmdir('path\\to\\the\\folder', function (err) {
    if (err) throw err;
    console.log('Folder deleted!');
});
```

### smb2Client.exists ( path, callback )
Test whether or not the given path exists by checking with the file system. Then call the callback argument with either true or false. Example:
```javascript
smb2Client.exists('path\\to\\my\\file.txt', function (err, exists) {
    if (err) throw err;
    console.log(exists ? "it's there" : "it's not there!");
});
```

### smb2Client.unlink ( path, callback )
Asynchronous unlink(2). No arguments other than a possible exception are given to the completion callback.
```javascript
smb2Client.unlink('path\\to\\my\\file.txt', function (err) {
    if (err) throw err;
    console.log("file has been deleted");
});
```

### smb2Client.rename ( oldPath, newPath, callback )
Asynchronous rename(2). No arguments other than a possible exception are given to the completion callback.
```javascript
smb2Client.rename('path\\to\\my\\file.txt', 'new\\path\\to\\my\\new-file-name.txt', function (err) {
    if (err) throw err;
    console.log("file has been renamed");
});
```

### smb2Client.close ( )
This function will close the open connection if opened, it will be called automatically after ```autoCloseTimeout``` ms of no SMB2 call on the server.

### smb2Client.createReadStream ( fileName, [options], callback )
Returns a read stream on the file. Unlike fs.createReadStream, this function is asynchronous, as we need use asynchronous smb requests to get the stream.

Example:
```javascript
smb2Client.createReadStream('path\\to\\the\\file', function (err, readStream) {
    if (err) throw err;
    var writeStream = fs.createWriteStream('localFile')
    readStream.pipe(writeStream)
});
```

### smb2Client.createWriteStream ( fileName, [options], callback )
Returns a write stream on the file. Unlike fs.createWriteStream, this function is asynchronous, as we need use asynchronous smb requests to get the stream.

Example:
```javascript
smb2Client.createWriteStream('path\\to\\the\\file', function (err, readStream) {
    if (err) throw err;
    var readStream = fs.createReadStream('localFile')
    readStream.pipe(writeStream)
});
```
### smb2Client.ensureDir ( path, callback )
Ensures that the directory exists. If the directory structure does not exist, it is created.

## Contributors
- [Benjamin Chelli](https://github.com/bchelli)
- [Fabrice Marsaud](https://github.com/marsaud)

## References

    The[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2 and 3
    Copyright (C) 2014 Microsoft
    http://msdn.microsoft.com/en-us/library/cc246482.aspx

## License

(The MIT License)

Copyright (c) 2013-2014 Benjamin Chelli <benjamin@chelli.net>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
namespace More.Windows.Input
{
    using FluentAssertions;
    using System;
    using Xunit;

    public class CredentialInteractionTest
    {
        [Fact]
        public void new_credential_interaction_should_not_allow_null_title()
        {
            // arrange
            var title = default( string );

            // act
            Action @new = () => new CredentialInteraction( title );

            // assert
            @new.ShouldThrow<ArgumentNullException>().And.ParamName.Should().Be( nameof( title ) );
        }

        [Fact]
        public void new_credential_interaction_should_set_title()
        {
            // arrange
            var expected = "Test";

            // act
            var interaction = new CredentialInteraction( expected );

            // assert
            interaction.Title.Should().Be( expected );
        }

        [Fact]
        public void saved_by_credential_manager_should_write_expected_value()
        {
            // arrange
            var interaction = new CredentialInteraction();

            interaction.MonitorEvents();

            // act
            interaction.SavedByCredentialManager = true;

            // assert
            interaction.SavedByCredentialManager.Should().BeTrue();
            interaction.ShouldRaisePropertyChangeFor( i => i.SavedByCredentialManager );
        }

        [Fact]
        public void user_elected_to_save_credential_should_write_expected_value()
        {
            // arrange
            var interaction = new CredentialInteraction();

            interaction.MonitorEvents();

            // act
            interaction.UserElectedToSaveCredential = true;

            // assert
            interaction.UserElectedToSaveCredential.Should().BeTrue();
            interaction.ShouldRaisePropertyChangeFor( i => i.UserElectedToSaveCredential );
        }

        [Fact]
        public void credential_should_write_expected_value()
        {
            // arrange
            var expected = new byte[] { 1, 2, 3 };
            var interaction = new CredentialInteraction();

            interaction.MonitorEvents();

            // act
            interaction.Credential = expected;

            // assert
            interaction.Credential.Should().Equal( expected );
            interaction.ShouldRaisePropertyChangeFor( i => i.Credential );
        }

        [Fact]
        public void domain_name_should_write_expected_value()
        {
            // arrange
            var expected = "Test";
            var interaction = new CredentialInteraction();

            interaction.MonitorEvents();

            // act
            interaction.DomainName = expected;

            // assert
            interaction.DomainName.Should().Be( expected );
            interaction.ShouldRaisePropertyChangeFor( i => i.DomainName );
        }

        [Fact]
        public void user_name_should_write_expected_value()
        {
            // arrange
            var expected = "Test";
            var interaction = new CredentialInteraction();

            interaction.MonitorEvents();

            // act
            interaction.UserName = expected;

            // assert
            interaction.UserName.Should().Be( expected );
            interaction.ShouldRaisePropertyChangeFor( i => i.UserName );
        }

        [Fact]
        public void password_should_write_expected_value()
        {
            // arrange
            var expected = "Test";
            var interaction = new CredentialInteraction();

            interaction.MonitorEvents();

            // act
            interaction.Password = expected;

            // assert
            interaction.Password.Should().Be( expected );
            interaction.ShouldRaisePropertyChangeFor( i => i.Password );
        }
    }
}


text:
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using System.Threading;

namespace Orleans.Runtime.MembershipService
{
    internal class SiloStatusOracle : ISiloStatusOracle
    {
        private readonly ILocalSiloDetails localSiloDetails;
        private readonly MembershipTableManager membershipTableManager;
        private readonly SiloStatusListenerManager listenerManager;
        private readonly ILogger log;
        private readonly object cacheUpdateLock = new object();
        private MembershipTableSnapshot cachedSnapshot;
        private Dictionary<SiloAddress, SiloStatus> siloStatusCache = new Dictionary<SiloAddress, SiloStatus>();
        private Dictionary<SiloAddress, SiloStatus> siloStatusCacheOnlyActive = new Dictionary<SiloAddress, SiloStatus>();

        public SiloStatusOracle(
            ILocalSiloDetails localSiloDetails,
            MembershipTableManager membershipTableManager,
            ILogger<SiloStatusOracle> logger,
            SiloStatusListenerManager listenerManager)
        {
            this.localSiloDetails = localSiloDetails;
            this.membershipTableManager = membershipTableManager;
            this.listenerManager = listenerManager;
            this.log = logger;
        }

        public SiloStatus CurrentStatus => this.membershipTableManager.CurrentStatus;
        public string SiloName => this.localSiloDetails.Name;
        public SiloAddress SiloAddress => this.localSiloDetails.SiloAddress;

        public SiloStatus GetApproximateSiloStatus(SiloAddress silo)
        {
            var status = this.membershipTableManager.MembershipTableSnapshot.GetSiloStatus(silo);

            if (status == SiloStatus.None)
            {
                if (this.CurrentStatus == SiloStatus.Active && this.log.IsEnabled(LogLevel.Debug))
                {
                    this.log.Debug(ErrorCode.Runtime_Error_100209, "-The given siloAddress {0} is not registered in this MembershipOracle.", silo);
                }
            }

            return status;
        }

        public Dictionary<SiloAddress, SiloStatus> GetApproximateSiloStatuses(bool onlyActive = false)
        {
            if (ReferenceEquals(this.cachedSnapshot, this.membershipTableManager.MembershipTableSnapshot))
            {
                return onlyActive ? this.siloStatusCacheOnlyActive : this.siloStatusCache;
            }

            lock (this.cacheUpdateLock)
            {
                var currentMembership = this.membershipTableManager.MembershipTableSnapshot;
                if (ReferenceEquals(this.cachedSnapshot, currentMembership))
                {
                    return onlyActive ? this.siloStatusCacheOnlyActive : this.siloStatusCache;
                }

                var newSiloStatusCache = new Dictionary<SiloAddress, SiloStatus>();
                var newSiloStatusCacheOnlyActive = new Dictionary<SiloAddress, SiloStatus>();
                foreach (var entry in currentMembership.Entries)
                {
                    var silo = entry.Key;
                    var status = entry.Value.Status;
                    newSiloStatusCache[silo] = status;
                    if (status == SiloStatus.Active) newSiloStatusCacheOnlyActive[silo] = status;
                }

                Interlocked.Exchange(ref this.cachedSnapshot, currentMembership);
                this.siloStatusCache = newSiloStatusCache;
                this.siloStatusCacheOnlyActive = newSiloStatusCacheOnlyActive;
                return onlyActive ? newSiloStatusCacheOnlyActive : newSiloStatusCache;
            }
        }

        public bool IsDeadSilo(SiloAddress silo)
        {
            if (silo.Equals(this.SiloAddress)) return false;

            var status = this.GetApproximateSiloStatus(silo);

            return status == SiloStatus.Dead;
        }

        public bool IsFunctionalDirectory(SiloAddress silo)
        {
            if (silo.Equals(this.SiloAddress)) return true;

            var status = this.GetApproximateSiloStatus(silo);
            return !status.IsTerminating();
        }

        public bool TryGetSiloName(SiloAddress siloAddress, out string siloName)
        {
            var snapshot = this.membershipTableManager.MembershipTableSnapshot.Entries;
            if (snapshot.TryGetValue(siloAddress, out var entry))
            {
                siloName = entry.SiloName;
                return true;
            }

            siloName = default;
            return false;
        }

        public bool SubscribeToSiloStatusEvents(ISiloStatusListener listener) => this.listenerManager.Subscribe(listener);

        public bool UnSubscribeFromSiloStatusEvents(ISiloStatusListener listener) => this.listenerManager.Unsubscribe(listener);

    }
}


text:
namespace NUnit.Framework.Constraints
{
    /// <summary>
    /// Abstract base class for all binary operators
    /// </summary>
    public abstract class BinaryOperator : ConstraintOperator
    {
        /// <summary>
        /// Reduce produces a constraint from the operator and
        /// any arguments. It takes the arguments from the constraint
        /// stack and pushes the resulting constraint on it.
        /// </summary>
        /// <param name="stack"></param>
        public override void Reduce(ConstraintBuilder.ConstraintStack stack)
        {
            IConstraint right = stack.Pop();
            IConstraint left = stack.Pop();
            stack.Push(ApplyOperator(left, right));
        }

        /// <summary>
        /// Gets the left precedence of the operator
        /// </summary>
        public override int LeftPrecedence
        {
            get
            {
                return RightContext is CollectionOperator || RightContext is ExactCountOperator
                    ? base.LeftPrecedence + 10
                    : base.LeftPrecedence;
            }
        }

        /// <summary>
        /// Gets the right precedence of the operator
        /// </summary>
        public override int RightPrecedence
        {
            get
            {
                return RightContext is CollectionOperator
                    ? base.RightPrecedence + 10
                    : base.RightPrecedence;
            }
        }

        /// <summary>
        /// Abstract method that produces a constraint by applying
        /// the operator to its left and right constraint arguments.
        /// </summary>
        public abstract IConstraint ApplyOperator(IConstraint left, IConstraint right);
    }
}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Composition;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.LanguageServer.Handler;
using Microsoft.CodeAnalysis.LanguageServer.Handler.DocumentChanges;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.CodeAnalysis.Shared.Collections;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.LanguageServer.Protocol;
using Roslyn.Utilities;
using static Microsoft.CodeAnalysis.LanguageServer.Handler.RequestExecutionQueue;

namespace Microsoft.CodeAnalysis.LanguageServer;

/// <summary>
/// Manages the registered workspaces and corresponding LSP solutions for an LSP server.
/// This type is tied to a particular server.
/// </summary>
/// <remarks>
/// This type provides an LSP view of the registered workspace solutions so that all LSP requests operate
/// on the state of the world that matches the LSP requests we've recieved.
///
/// This is done by storing the LSP text as provided by client didOpen/didClose/didChange requests.  When asked for a document we provide either
/// <list type="bullet">
///     <item> The exact workspace solution instance if all the LSP text matches what is currently in the workspace.</item>
///     <item> A fork from the workspace current solution with the LSP text applied if the LSP text does not match.  This can happen since
///     LSP text sync is asynchronous and not guaranteed to match the text in the workspace (though the majority of the time in VS it does).</item>
/// </list>
///
/// Doing the forking like this has a few nice properties.
/// <list type="bullet">
///   <item>99% of the time the VS workspace matches the LSP text.  In those cases we do 0 re-parsing, share compilations, versions, checksum calcs, etc.</item>
///   <item>In the 1% of the time that we do not match, we can simply and easily compute a fork.</item>
///   <item>The code is relatively straightforward</item>
/// </list>
/// </remarks>
internal class LspWorkspaceManager : IDocumentChangeTracker, ILspService
{
    /// <summary>
    /// A cache from workspace to the last solution we returned for LSP.
    ///
    /// The forkedFromVersion is not null when the solution was created from a fork of the workspace with LSP text applied on top.
    /// It is null when LSP reuses the workspace solution (the LSP text matches the contents of the workspace).
    ///
    /// Access to this is gauranteed to be serial by the <see cref="RequestExecutionQueue"/>
    /// </summary>
    private readonly Dictionary<Workspace, (int? forkedFromVersion, Solution solution)> _cachedLspSolutions = new();

    /// <summary>
    /// Stores the current source text for each URI that is being tracked by LSP.
    /// Each time an LSP text sync notification comes in, this source text is updated to match.
    /// Used as the backing implementation for the <see cref="IDocumentChangeTracker"/>.
    ///
    /// Note that the text here is tracked regardless of whether or not we found a matching roslyn document
    /// for the URI.
    ///
    /// Access to this is gauranteed to be serial by the <see cref="RequestExecutionQueue"/>
    /// </summary>
    private ImmutableDictionary<Uri, SourceText> _trackedDocuments = ImmutableDictionary<Uri, SourceText>.Empty;

    private readonly string _hostWorkspaceKind;
    private readonly ILspLogger _logger;
    private readonly LspMiscellaneousFilesWorkspace? _lspMiscellaneousFilesWorkspace;
    private readonly LspWorkspaceRegistrationService _lspWorkspaceRegistrationService;
    private readonly RequestTelemetryLogger _requestTelemetryLogger;

    public LspWorkspaceManager(
        ILspLogger logger,
        LspMiscellaneousFilesWorkspace? lspMiscellaneousFilesWorkspace,
        LspWorkspaceRegistrationService lspWorkspaceRegistrationService,
        RequestTelemetryLogger requestTelemetryLogger)
    {
        _hostWorkspaceKind = lspWorkspaceRegistrationService.GetHostWorkspaceKind();

        _lspMiscellaneousFilesWorkspace = lspMiscellaneousFilesWorkspace;
        _logger = logger;
        _requestTelemetryLogger = requestTelemetryLogger;

        _lspWorkspaceRegistrationService = lspWorkspaceRegistrationService;
    }

    #region Implementation of IDocumentChangeTracker

    /// <summary>
    /// Called by the <see cref="DidOpenHandler"/> when a document is opened in LSP.
    ///
    /// <see cref="DidOpenHandler.MutatesSolutionState"/> is true which means this runs serially in the <see cref="RequestExecutionQueue"/>
    /// </summary>
    public void StartTracking(Uri uri, SourceText documentText)
    {
        // First, store the LSP view of the text as the uri is now owned by the LSP client.
        Contract.ThrowIfTrue(_trackedDocuments.ContainsKey(uri), $"didOpen received for {uri} which is already open.");
        _trackedDocuments = _trackedDocuments.Add(uri, documentText);

        // If LSP changed, we need to compare against the workspace again to get the updated solution.
        _cachedLspSolutions.Clear();
    }

    /// <summary>
    /// Called by the <see cref="DidCloseHandler"/> when a document is closed in LSP.
    ///
    /// <see cref="DidCloseHandler.MutatesSolutionState"/> is true which means this runs serially in the <see cref="RequestExecutionQueue"/>
    /// </summary>
    public void StopTracking(Uri uri)
    {
        // First, stop tracking this URI and source text as it is no longer owned by LSP.
        Contract.ThrowIfFalse(_trackedDocuments.ContainsKey(uri), $"didClose received for {uri} which is not open.");
        _trackedDocuments = _trackedDocuments.Remove(uri);

        // If LSP changed, we need to compare against the workspace again to get the updated solution.
        _cachedLspSolutions.Clear();

        // Also remove it from our loose files workspace if it is still there.
        _lspMiscellaneousFilesWorkspace?.TryRemoveMiscellaneousDocument(uri);
    }

    /// <summary>
    /// Called by the <see cref="DidChangeHandler"/> when a document's text is updated in LSP.
    ///
    /// <see cref="DidChangeHandler.MutatesSolutionState"/> is true which means this runs serially in the <see cref="RequestExecutionQueue"/>
    /// </summary>
    public void UpdateTrackedDocument(Uri uri, SourceText newSourceText)
    {
        // Store the updated LSP view of the source text.
        Contract.ThrowIfFalse(_trackedDocuments.ContainsKey(uri), $"didChange received for {uri} which is not open.");
        _trackedDocuments = _trackedDocuments.SetItem(uri, newSourceText);

        // If LSP changed, we need to compare against the workspace again to get the updated solution.
        _cachedLspSolutions.Clear();
    }

    public ImmutableDictionary<Uri, SourceText> GetTrackedLspText() => _trackedDocuments;

    #endregion

    #region LSP Solution Retrieval

    /// <summary>
    /// Returns the LSP solution associated with the workspace with the specified <see cref="_hostWorkspaceKind"/>.
    /// This is the solution used for LSP requests that pertain to the entire workspace, for example code search or workspace diagnostics.
    ///
    /// This is always called serially in the <see cref="RequestExecutionQueue"/> when creating the <see cref="RequestContext"/>.
    /// </summary>
    public async Task<Solution?> TryGetHostLspSolutionAsync(CancellationToken cancellationToken)
    {
        // Ensure we have the latest lsp solutions
        var updatedSolutions = await GetLspSolutionsAsync(cancellationToken).ConfigureAwait(false);

        var (hostWorkspaceSolution, isForked) = updatedSolutions.FirstOrDefault(lspSolution => lspSolution.Solution.Workspace.Kind == _hostWorkspaceKind);
        _requestTelemetryLogger.UpdateUsedForkedSolutionCounter(isForked);

        return hostWorkspaceSolution;
    }

    /// <summary>
    /// Returns a document with the LSP tracked text forked from the appropriate workspace solution.
    ///
    /// This is always called serially in the <see cref="RequestExecutionQueue"/> when creating the <see cref="RequestContext"/>.
    /// </summary>
    public async Task<Document?> GetLspDocumentAsync(TextDocumentIdentifier textDocumentIdentifier, CancellationToken cancellationToken)
    {
        var uri = textDocumentIdentifier.Uri;

        // Get the LSP view of all the workspace solutions.
        var lspSolutions = await GetLspSolutionsAsync(cancellationToken).ConfigureAwait(false);

        // Find the matching document from the LSP solutions.
        foreach (var (lspSolution, isForked) in lspSolutions)
        {
            var documents = lspSolution.GetDocuments(uri);
            if (documents.Any())
            {
                var document = documents.FindDocumentInProjectContext(textDocumentIdentifier);

                // Record metadata on how we got this document.
                var workspaceKind = document.Project.Solution.Workspace.Kind;
                _requestTelemetryLogger.UpdateFindDocumentTelemetryData(success: true, workspaceKind);
                _requestTelemetryLogger.UpdateUsedForkedSolutionCounter(isForked);
                _logger.TraceInformation($"{document.FilePath} found in workspace {workspaceKind}");

                return document;
            }
        }

        // We didn't find the document in any workspace, record a telemetry notification that we did not find it.
        var searchedWorkspaceKinds = string.Join(";", lspSolutions.SelectAsArray(lspSolution => lspSolution.Solution.Workspace.Kind));
        _logger.TraceError($"Could not find '{uri}'.  Searched {searchedWorkspaceKinds}");
        _requestTelemetryLogger.UpdateFindDocumentTelemetryData(success: false, workspaceKind: null);

        // Add the document to our loose files workspace if its open.
        var miscDocument = _trackedDocuments.ContainsKey(uri) ? _lspMiscellaneousFilesWorkspace?.AddMiscellaneousDocument(uri, _trackedDocuments[uri], _logger) : null;
        return miscDocument;
    }

    /// <summary>
    /// Gets the LSP view of all the registered workspaces' current solutions.
    /// </summary>
    private async Task<ImmutableArray<(Solution Solution, bool IsForked)>> GetLspSolutionsAsync(CancellationToken cancellationToken)
    {
        // Ensure that the loose files workspace is searched last.
        var registeredWorkspaces = _lspWorkspaceRegistrationService.GetAllRegistrations();
        registeredWorkspaces = registeredWorkspaces
            .Where(workspace => workspace is not LspMiscellaneousFilesWorkspace)
            .Concat(registeredWorkspaces.Where(workspace => workspace is LspMiscellaneousFilesWorkspace)).ToImmutableArray();

        using var _ = ArrayBuilder<(Solution, bool)>.GetInstance(out var solutions);
        foreach (var workspace in registeredWorkspaces)
        {
            // Retrieve the workspace's current view of the world at the time the request comes in.
            // If this is changing underneath, it is either the job of the LSP client to poll us (diagnostics) or we send refresh notifications (semantic tokens) to the client
            // letting them know that our workspace has changed and they need to re-query us.
            var workspaceCurrentSolution = workspace.CurrentSolution;
            var lspSolution = await GetLspSolutionForWorkspaceAsync(workspaceCurrentSolution, cancellationToken).ConfigureAwait(false);
            solutions.Add(lspSolution);
        }

        return solutions.ToImmutable();

        async Task<(Solution Solution, bool IsForked)> GetLspSolutionForWorkspaceAsync(Solution workspaceCurrentSolution, CancellationToken cancellationToken)
        {
            // At a high level these are the steps we take to compute what the desired LSP solution should be.
            //
            //   1.  First we want to check if our workspace current solution is the same as the last workspace current solution that we verified matches the LSP text.
            //       If so, we can skip comparing the LSP text against the workspace text and just return the cached one since absolutely nothing has changed.
            //       Importantly, we do not return a cached forked solution - we do not want to re-use a forked solution if the LSP text has changed and now matches the workspace.
            //
            //   2.  If the cached solution isn't a match, we compare the LSP text to the workspace's text and return the workspace text if all LSP text matches.
            //       This check is performant as checksums will be computed for these documents in order to make requests OOP.  So these are already computed or will be later in this request.
            //
            //   3.  Third, we check to see if we have cached a forked LSP solution for the current set of LSP texts against the current workspace version.
            //       If so, we can just reuse that instead of re-forking and blowing away the trees / source generated docs / etc. that we created for the fork.
            //
            //   4.  We have nothing cached for this combination of LSP texts and workspace version.  We have exhausted our options and must create an LSP fork
            //       from the current workspace solution with the current LSP text.
            //
            //   We propogate the IsForked value back up so that we only report telemetry on forking if the forked solution is actually requested.

            // Step 1: Check if nothing has changed and we already verified that the workspace text matches our LSP text.
            if (_cachedLspSolutions.TryGetValue(workspaceCurrentSolution.Workspace, out var cachedSolution) && cachedSolution.solution == workspaceCurrentSolution)
            {
                return (workspaceCurrentSolution, IsForked: false);
            }

            // Step 2: Check to see if the LSP text matches the workspace text.
            var documentsInWorkspace = GetDocumentsForUris(_trackedDocuments.Keys.ToImmutableArray(), workspaceCurrentSolution);
            if (await DoesAllTextMatchWorkspaceSolutionAsync(documentsInWorkspace, cancellationToken).ConfigureAwait(false))
            {
                // Remember that the current LSP text matches the text in this workspace solution.
                _cachedLspSolutions[workspaceCurrentSolution.Workspace] = (forkedFromVersion: null, workspaceCurrentSolution);
                return (workspaceCurrentSolution, IsForked: false);
            }

            // Step 3: See if we can reuse a previously forked solution.
            if (cachedSolution != default && cachedSolution.forkedFromVersion == workspaceCurrentSolution.WorkspaceVersion)
            {
                return (cachedSolution.solution, IsForked: true);
            }

            // Step 4: Fork a new solution from the workspace with the LSP text applied.
            var lspSolution = workspaceCurrentSolution;
            foreach (var (uri, workspaceDocuments) in documentsInWorkspace)
            {
                lspSolution = lspSolution.WithDocumentText(workspaceDocuments.Select(d => d.Id), _trackedDocuments[uri]);
            }

            // Remember this forked solution and the workspace version it was forked from.
            _cachedLspSolutions[workspaceCurrentSolution.Workspace] = (workspaceCurrentSolution.WorkspaceVersion, lspSolution);
            return (lspSolution, IsForked: true);
        }
    }

    /// <summary>
    /// Given a set of documents from the workspace current solution, verify that the LSP text is the same as the document contents.
    /// </summary>
    private async Task<bool> DoesAllTextMatchWorkspaceSolutionAsync(ImmutableDictionary<Uri, ImmutableArray<Document>> documentsInWorkspace, CancellationToken cancellationToken)
    {
        foreach (var (uriInWorkspace, documentsForUri) in documentsInWorkspace)
        {
            // We're comparing text, so we can take any of the linked documents.
            var firstDocument = documentsForUri.First();
            var isTextEquivalent = await AreChecksumsEqualAsync(firstDocument, _trackedDocuments[uriInWorkspace], cancellationToken).ConfigureAwait(false);

            if (!isTextEquivalent)
            {
                _logger.TraceWarning($"Text for {uriInWorkspace} did not match document text {firstDocument.Id} in workspace's {firstDocument.Project.Solution.Workspace.Kind} current solution");
                return false;
            }
        }

        return true;
    }

    private static async Task<bool> AreChecksumsEqualAsync(Document document, SourceText lspText, CancellationToken cancellationToken)
    {
        var documentText = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
        var documentTextChecksum = documentText.GetChecksum();
        var lspTextChecksum = lspText.GetChecksum();
        return lspTextChecksum.SequenceEqual(documentTextChecksum);
    }

    #endregion

    /// <summary>
    /// Using the workspace's current solutions, find the matching documents in for each URI.
    /// </summary>
    private static ImmutableDictionary<Uri, ImmutableArray<Document>> GetDocumentsForUris(ImmutableArray<Uri> trackedDocuments, Solution workspaceCurrentSolution)
    {
        using var _ = PooledDictionary<Uri, ImmutableArray<Document>>.GetInstance(out var documentsInSolution);
        foreach (var trackedDoc in trackedDocuments)
        {
            var documents = workspaceCurrentSolution.GetDocuments(trackedDoc);
            if (documents.Any())
            {
                documentsInSolution[trackedDoc] = documents;
            }
        }

        return documentsInSolution.ToImmutableDictionary();
    }

    internal TestAccessor GetTestAccessor()
            => new(this);

    internal readonly struct TestAccessor
    {
        private readonly LspWorkspaceManager _manager;

        public TestAccessor(LspWorkspaceManager manager)
            => _manager = manager;

        public LspMiscellaneousFilesWorkspace? GetLspMiscellaneousFilesWorkspace()
            => _manager._lspMiscellaneousFilesWorkspace;

        public bool IsWorkspaceRegistered(Workspace workspace)
        {
            return _manager._lspWorkspaceRegistrationService.GetAllRegistrations().Contains(workspace);
        }
    }
}


text:
class AddBodyToProblems < ActiveRecord::Migration[4.2]
  def self.up
    add_column :problems, :body, :text
  end

  def self.down
    remove_column :problems, :body
  end
end


text:
 using UnityEngine;
using System.Collections;

public class MenuManager : MonoBehaviour {
	//private GameObject m_menu;
	private VRMenuManager m_menuManager;
	private GameObject m_headNode;
	private VRFPSInputController m_controller;
	private WandOnlyController m_wController;
	private GameObject m_wand;

	private vrKeyboard m_keyb;

	private bool m_isToggled  = false;

	// Use this for initialization
	void Start () {
		m_keyb = MiddleVR.VRDeviceMgr.GetKeyboard();
		m_headNode = GameObject.Find ("HeadNode");
		//m_menu = GameObject.Find ("VRMenu");
		//m_menuManager = m_menu.GetComponent<VRMenuManager> ();
		m_controller = GameObject.Find("Utilisateur").GetComponent<VRFPSInputController>();
		m_wController = GameObject.Find("Utilisateur").GetComponent<WandOnlyController>();
		m_wand = GameObject.Find ("VRWand");

		Cursor.visible = false;
	}

	// Update is called once per frame
	void Update () {
		/*if(m_keyb.IsKeyToggled (MiddleVR.VRK_F12))
		{
			DisplayOrHideMenu();
		}
		if(m_isToggled)
		{
			m_menu.transform.position = m_headNode.transform.position;
			m_menu.transform.rotation = m_headNode.transform.rotation;
			m_menu.transform.Translate(0, 0, 0.5f);
		}*/
	}

	/// <summary>
	/// Toggles the visibility of the VR menu
	/// </summary>
	public void DisplayOrHideMenu()
	{
		m_menuManager.ToggleVisiblity();
		m_isToggled = !m_isToggled;
		m_controller.enabled = !m_controller.enabled;
		m_wController.enabled = !m_wController.enabled;
		m_wand.transform.Translate(0, m_isToggled? -10f : 10f, 0);
		Cursor.visible = !Cursor.visible;
	}
}


text:
Drag-and-drop KML files, CSV files, shapefiles, or service urls here or onto the map

	The browser you are using does not support drag-and-drop functionality. Try newer versions of Chrome or Firefox if possible.

		<input data-dojo-attach-point="fileInputNode" class="fileInput" type="file" accept=".zip,.csv" />
		or Service url
		<input data-dojo-attach-point="serviceUrlInputNode" class="serviceUrlInput" type="text" />
		<button data-dojo-attach-point="manualAddButton">Add</button>


text:
#pragma once

#include "micropather/micropather.h"

namespace wss {

struct Layer;

class Path : public micropather::Graph
{
public:
	Path(const Layer& layer);

	void setMap(const Layer& layer);

	/**
	 * Return the least possible cost between 2 states.
	 * \param stateStart
	 * \param stateEnd
	 */
	virtual float LeastCostEstimate(void* stateStart, void* stateEnd);

	virtual void AdjacentCost(void* state, MP_VECTOR<micropather::StateCost> *adjacent);

	virtual void PrintStateInfo(void* state);

private:
	const Layer& _layer;

	bool _passable(size_t index);
};
}


text:
class Main {
  static void returnMethod() {}
  static void usage() {
    while (true) re<caret>
  }
}


text:
define(["require", "exports"], function(require, exports) {
    function exports() {
        return 1;
    }
    exports.exports = exports;
    function require() {
        return "require";
    }
    exports.require = require;
});


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.bmun.bmundelegate" >

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true"/>

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyDnLt_FEWLO0GjQRAkVwgLc3KWgRbPXkhA"/>
    </application>

</manifest>


text:
package javassist.compiler;

import javassist.*;
import javassist.bytecode.*;
import javassist.compiler.ast.*;

/* Code generator accepting extended Java syntax for Javassist.
 */

public class JvstCodeGen extends MemberCodeGen {
    String paramArrayName = null;
    String paramListName = null;
    CtClass[] paramTypeList = null;
    private int paramVarBase = 0;       // variable index for $0 or $1.
    private boolean useParam0 = false;  // true if $0 is used.
    private String param0Type = null;   // JVM name
    public static final String sigName = "$sig";
    public static final String dollarTypeName = "$type";
    public static final String clazzName = "$class";
    private CtClass dollarType = null;
    CtClass returnType = null;
    String returnCastName = null;
    private String returnVarName = null;        // null if $_ is not used.
    public static final String wrapperCastName = "$w";
    String proceedName = null;
    public static final String cflowName = "$cflow";
    ProceedHandler procHandler = null;  // null if not used.

    public JvstCodeGen(Bytecode b, CtClass cc, ClassPool cp) {
        super(b, cc, cp);
        setTypeChecker(new JvstTypeChecker(cc, cp, this));
    }

    /* Index of $1.
     */
    private int indexOfParam1() {
        return paramVarBase + (useParam0 ? 1 : 0);
    }

    /* Records a ProceedHandler obejct.
     *
     * @param name      the name of the special method call.
     *                  it is usually $proceed.
     */
    public void setProceedHandler(ProceedHandler h, String name) {
        proceedName = name;
        procHandler = h;
    }

    /* If the type of the expression compiled last is void,
     * add ACONST_NULL and change exprType, arrayDim, className.
     */
    public void addNullIfVoid() {
        if (exprType == VOID) {
            bytecode.addOpcode(ACONST_NULL);
            exprType = CLASS;
            arrayDim = 0;
            className = jvmJavaLangObject;
        }
    }

    /* To support $args, $sig, and $type.
     * $args is an array of parameter list.
     */
    public void atMember(Member mem) throws CompileError {
        String name = mem.get();
        if (name.equals(paramArrayName)) {
            compileParameterList(bytecode, paramTypeList, indexOfParam1());
            exprType = CLASS;
            arrayDim = 1;
            className = jvmJavaLangObject;
        }
        else if (name.equals(sigName)) {
            bytecode.addLdc(Descriptor.ofMethod(returnType, paramTypeList));
            bytecode.addInvokestatic("javassist/runtime/Desc", "getParams",
                                "(Ljava/lang/String;)[Ljava/lang/Class;");
            exprType = CLASS;
            arrayDim = 1;
            className = "java/lang/Class";
        }
        else if (name.equals(dollarTypeName)) {
            if (dollarType == null)
                throw new CompileError(dollarTypeName + " is not available");

            bytecode.addLdc(Descriptor.of(dollarType));
            callGetType("getType");
        }
        else if (name.equals(clazzName)) {
            if (param0Type == null)
                throw new CompileError(clazzName + " is not available");

            bytecode.addLdc(param0Type);
            callGetType("getClazz");
        }
        else
            super.atMember(mem);
    }

    private void callGetType(String method) {
        bytecode.addInvokestatic("javassist/runtime/Desc", method,
                                "(Ljava/lang/String;)Ljava/lang/Class;");
        exprType = CLASS;
        arrayDim = 0;
        className = "java/lang/Class";
    }

    protected void atFieldAssign(Expr expr, int op, ASTree left,
                        ASTree right, boolean doDup) throws CompileError
    {
        if (left instanceof Member
            && ((Member)left).get().equals(paramArrayName)) {
            if (op != '=')
                throw new CompileError("bad operator for " + paramArrayName);

            right.accept(this);
            if (arrayDim != 1 || exprType != CLASS)
                throw new CompileError("invalid type for " + paramArrayName);

            atAssignParamList(paramTypeList, bytecode);
            if (!doDup)
                bytecode.addOpcode(POP);
        }
        else
            super.atFieldAssign(expr, op, left, right, doDup);
    }

    protected void atAssignParamList(CtClass[] params, Bytecode code)
        throws CompileError
    {
        if (params == null)
            return;

        int varNo = indexOfParam1();
        int n = params.length;
        for (int i = 0; i < n; ++i) {
            code.addOpcode(DUP);
            code.addIconst(i);
            code.addOpcode(AALOAD);
            compileUnwrapValue(params[i], code);
            code.addStore(varNo, params[i]);
            varNo += is2word(exprType, arrayDim) ? 2 : 1;
        }
    }

    public void atCastExpr(CastExpr expr) throws CompileError {
        ASTList classname = expr.getClassName();
        if (classname != null && expr.getArrayDim() == 0) {
            ASTree p = classname.head();
            if (p instanceof Symbol && classname.tail() == null) {
                String typename = ((Symbol)p).get();
                if (typename.equals(returnCastName)) {
                    atCastToRtype(expr);
                    return;
                }
                else if (typename.equals(wrapperCastName)) {
                    atCastToWrapper(expr);
                    return;
                }
            }
        }

        super.atCastExpr(expr);
    }

    /**
     * Inserts a cast operator to the return type.
     * If the return type is void, this does nothing.
     */
    protected void atCastToRtype(CastExpr expr) throws CompileError {
        expr.getOprand().accept(this);
        if (exprType == VOID || isRefType(exprType) || arrayDim > 0)
            compileUnwrapValue(returnType, bytecode);
        else if (returnType instanceof CtPrimitiveType) {
            CtPrimitiveType pt = (CtPrimitiveType)returnType;
            int destType = MemberResolver.descToType(pt.getDescriptor());
            atNumCastExpr(exprType, destType);
            exprType = destType;
            arrayDim = 0;
            className = null;
        }
        else
            throw new CompileError("invalid cast");
    }

    protected void atCastToWrapper(CastExpr expr) throws CompileError {
        expr.getOprand().accept(this);
        if (isRefType(exprType) || arrayDim > 0)
            return;     // Object type.  do nothing.

        CtClass clazz = resolver.lookupClass(exprType, arrayDim, className);
        if (clazz instanceof CtPrimitiveType) {
            CtPrimitiveType pt = (CtPrimitiveType)clazz;
            String wrapper = pt.getWrapperName();
            bytecode.addNew(wrapper);           // new <wrapper>
            bytecode.addOpcode(DUP);            // dup
            if (pt.getDataSize() > 1)
                bytecode.addOpcode(DUP2_X2);    // dup2_x2
            else
                bytecode.addOpcode(DUP2_X1);    // dup2_x1

            bytecode.addOpcode(POP2);           // pop2
            bytecode.addInvokespecial(wrapper, "<init>",
                                      "(" + pt.getDescriptor() + ")V");
                                                // invokespecial
            exprType = CLASS;
            arrayDim = 0;
            className = jvmJavaLangObject;
        }
    }

    /* Delegates to a ProcHandler object if the method call is
     * $proceed().  It may process $cflow().
     */
    public void atCallExpr(CallExpr expr) throws CompileError {
        ASTree method = expr.oprand1();
        if (method instanceof Member) {
            String name = ((Member)method).get();
            if (procHandler != null && name.equals(proceedName)) {
                procHandler.doit(this, bytecode, (ASTList)expr.oprand2());
                return;
            }
            else if (name.equals(cflowName)) {
                atCflow((ASTList)expr.oprand2());
                return;
            }
        }

        super.atCallExpr(expr);
    }

    /* To support $cflow().
     */
    protected void atCflow(ASTList cname) throws CompileError {
        StringBuffer sbuf = new StringBuffer();
        if (cname == null || cname.tail() != null)
            throw new CompileError("bad " + cflowName);

        makeCflowName(sbuf, cname.head());
        String name = sbuf.toString();
        Object[] names = resolver.getClassPool().lookupCflow(name);
        if (names == null)
            throw new CompileError("no such " + cflowName + ": " + name);

        bytecode.addGetstatic((String)names[0], (String)names[1],
                              "Ljavassist/runtime/Cflow;");
        bytecode.addInvokevirtual("javassist.runtime.Cflow",
                                  "value", "()I");
        exprType = INT;
        arrayDim = 0;
        className = null;
    }

    /* Syntax:
     *
     * <cflow> : $cflow '(' <cflow name> ')'
     * <cflow name> : <identifier> ('.' <identifier>)*
     */
    private static void makeCflowName(StringBuffer sbuf, ASTree name)
        throws CompileError
    {
        if (name instanceof Symbol) {
            sbuf.append(((Symbol)name).get());
            return;
        }
        else if (name instanceof Expr) {
            Expr expr = (Expr)name;
            if (expr.getOperator() == '.') {
                makeCflowName(sbuf, expr.oprand1());
                sbuf.append('.');
                makeCflowName(sbuf, expr.oprand2());
                return;
            }
        }

        throw new CompileError("bad " + cflowName);
    }

    /* To support $$.  ($$) is equivalent to ($1, ..., $n).
     * It can be used only as a parameter list of method call.
     */
    public boolean isParamListName(ASTList args) {
        if (paramTypeList != null
            && args != null && args.tail() == null) {
            ASTree left = args.head();
            return (left instanceof Member
                    && ((Member)left).get().equals(paramListName));
        }
        else
            return false;
    }

    /*
    public int getMethodArgsLength(ASTList args) {
        if (!isParamListName(args))
            return super.getMethodArgsLength(args);

        return paramTypeList.length;
    }
    */

    public int getMethodArgsLength(ASTList args) {
        String pname = paramListName;
        int n = 0;
        while (args != null) {
            ASTree a = args.head();
            if (a instanceof Member && ((Member)a).get().equals(pname)) {
                if (paramTypeList != null)
                    n += paramTypeList.length;
            }
            else
                ++n;

            args = args.tail();
        }

        return n;
    }

    public void atMethodArgs(ASTList args, int[] types, int[] dims,
                                String[] cnames) throws CompileError {
        CtClass[] params = paramTypeList;
        String pname = paramListName;
        int i = 0;
        while (args != null) {
            ASTree a = args.head();
            if (a instanceof Member && ((Member)a).get().equals(pname)) {
                if (params != null) {
                    int n = params.length;
                    int regno = indexOfParam1();
                    for (int k = 0; k < n; ++k) {
                        CtClass p = params[k];
                        regno += bytecode.addLoad(regno, p);
                        setType(p);
                        types[i] = exprType;
                        dims[i] = arrayDim;
                        cnames[i] = className;
                        ++i;
                    }
                }
            }
            else {
                a.accept(this);
                types[i] = exprType;
                dims[i] = arrayDim;
                cnames[i] = className;
                ++i;
            }

            args = args.tail();
        }
    }

    /*
    public void atMethodArgs(ASTList args, int[] types, int[] dims,
                                String[] cnames) throws CompileError {
        if (!isParamListName(args)) {
            super.atMethodArgs(args, types, dims, cnames);
            return;
        }

        CtClass[] params = paramTypeList;
        if (params == null)
            return;

        int n = params.length;
        int regno = indexOfParam1();
        for (int i = 0; i < n; ++i) {
            CtClass p = params[i];
            regno += bytecode.addLoad(regno, p);
            setType(p);
            types[i] = exprType;
            dims[i] = arrayDim;
            cnames[i] = className;
        }
    }
    */

    /* called by Javac#recordSpecialProceed().
     */
    void compileInvokeSpecial(ASTree target, String classname,
                              String methodname, String descriptor,
                              ASTList args)
        throws CompileError
    {
        target.accept(this);
        int nargs = getMethodArgsLength(args);
        atMethodArgs(args, new int[nargs], new int[nargs],
                     new String[nargs]);
        bytecode.addInvokespecial(classname, methodname, descriptor);
        setReturnType(descriptor, false, false);
        addNullIfVoid();
    }

    /*
     * Makes it valid to write "return <expr>;" for a void method.
     */
    protected void atReturnStmnt(Stmnt st) throws CompileError {
        ASTree result = st.getLeft();
        if (result != null && returnType == CtClass.voidType) {
            compileExpr(result);
            if (is2word(exprType, arrayDim))
                bytecode.addOpcode(POP2);
            else if (exprType != VOID)
                bytecode.addOpcode(POP);

            result = null;
        }

        atReturnStmnt2(result);
    }

    /**
     * Makes a cast to the return type ($r) available.
     * It also enables $_.
     *
     * <p>If the return type is void, ($r) does nothing.
     * The type of $_ is java.lang.Object.
     *
     * @param resultName        null if $_ is not used.
     * @return          -1 or the variable index assigned to $_.
     */
    public int recordReturnType(CtClass type, String castName,
                 String resultName, SymbolTable tbl) throws CompileError
    {
        returnType = type;
        returnCastName = castName;
        returnVarName = resultName;
        if (resultName == null)
            return -1;
        else {
            int varNo = getMaxLocals();
            int locals = varNo + recordVar(type, resultName, varNo, tbl);
            setMaxLocals(locals);
            return varNo;
        }
    }

    /**
     * Makes $type available.
     */
    public void recordType(CtClass t) {
        dollarType = t;
    }

    /**
     * Makes method parameters $0, $1, ..., $args, $$, and $class available.
     * $0 is equivalent to THIS if the method is not static.  Otherwise,
     * if the method is static, then $0 is not available.
     */
    public int recordParams(CtClass[] params, boolean isStatic,
                             String prefix, String paramVarName,
                             String paramsName, SymbolTable tbl)
        throws CompileError
    {
        return recordParams(params, isStatic, prefix, paramVarName,
                            paramsName, !isStatic, 0, getThisName(), tbl);
    }

    /**
     * Makes method parameters $0, $1, ..., $args, $$, and $class available.
     * $0 is available only if use0 is true.  It might not be equivalent
     * to THIS.
     *
     * @param params    the parameter types (the types of $1, $2, ..)
     * @param prefix    it must be "$" (the first letter of $0, $1, ...)
     * @param paramVarName      it must be "$args"
     * @param paramsName        it must be "$$"
     * @param use0      true if $0 is used.
     * @param paramBase the register number of $0 (use0 is true)
     *                          or $1 (otherwise).
     * @param target    the class of $0.  If use0 is false, target
     *                  can be null.  The value of "target" is also used
     *                  as the name of the type represented by $class.
     * @param isStatic  true if the method in which the compiled bytecode
     *                  is embedded is static.
     */
    public int recordParams(CtClass[] params, boolean isStatic,
                            String prefix, String paramVarName,
                            String paramsName, boolean use0,
                            int paramBase, String target,
                            SymbolTable tbl)
        throws CompileError
    {
        int varNo;

        paramTypeList = params;
        paramArrayName = paramVarName;
        paramListName = paramsName;
        paramVarBase = paramBase;
        useParam0 = use0;

        if (target != null)
            param0Type = MemberResolver.jvmToJavaName(target);

        inStaticMethod = isStatic;
        varNo = paramBase;
        if (use0) {
            String varName = prefix + "0";
            Declarator decl
                = new Declarator(CLASS, MemberResolver.javaToJvmName(target),
                                 0, varNo++, new Symbol(varName));
            tbl.append(varName, decl);
        }

        for (int i = 0; i < params.length; ++i)
            varNo += recordVar(params[i], prefix + (i + 1), varNo, tbl);

        if (getMaxLocals() < varNo)
            setMaxLocals(varNo);

        return varNo;
    }

    /**
     * Makes the given variable name available.
     *
     * @param type      variable type
     * @param varName   variable name
     */
    public int recordVariable(CtClass type, String varName, SymbolTable tbl)
        throws CompileError
    {
        if (varName == null)
            return -1;
        else {
            int varNo = getMaxLocals();
            int locals = varNo + recordVar(type, varName, varNo, tbl);
            setMaxLocals(locals);
            return varNo;
        }
    }

    private int recordVar(CtClass cc, String varName, int varNo,
                          SymbolTable tbl) throws CompileError
    {
        if (cc == CtClass.voidType) {
            exprType = CLASS;
            arrayDim = 0;
            className = jvmJavaLangObject;
        }
        else
            setType(cc);

        Declarator decl
            = new Declarator(exprType, className, arrayDim,
                             varNo, new Symbol(varName));
        tbl.append(varName, decl);
        return is2word(exprType, arrayDim) ? 2 : 1;
    }

    /**
     * Makes the given variable name available.
     *
     * @param typeDesc  the type descriptor of the variable
     * @param varName   variable name
     * @param varNo     an index into the local variable array
     */
    public void recordVariable(String typeDesc, String varName, int varNo,
                               SymbolTable tbl) throws CompileError
    {
        char c;
        int dim = 0;
        while ((c = typeDesc.charAt(dim)) == '[')
            ++dim;

        int type = MemberResolver.descToType(c);
        String cname = null;
        if (type == CLASS) {
            if (dim == 0)
                cname = typeDesc.substring(1, typeDesc.length() - 1);
            else
                cname = typeDesc.substring(dim + 1, typeDesc.length() - 1);
        }

        Declarator decl
            = new Declarator(type, cname, dim, varNo, new Symbol(varName));
        tbl.append(varName, decl);
    }

    /* compileParameterList() returns the stack size used
     * by the produced code.
     *
     * This method correctly computes the max_stack value.
     *
     * @param regno     the index of the local variable in which
     *                  the first argument is received.
     *                  (0: static method, 1: regular method.)
     */
    public static int compileParameterList(Bytecode code,
                                CtClass[] params, int regno) {
        if (params == null) {
            code.addIconst(0);                          // iconst_0
            code.addAnewarray(javaLangObject);          // anewarray Object
            return 1;
        }
        else {
            CtClass[] args = new CtClass[1];
            int n = params.length;
            code.addIconst(n);                          // iconst_<n>
            code.addAnewarray(javaLangObject);          // anewarray Object
            for (int i = 0; i < n; ++i) {
                code.addOpcode(Bytecode.DUP);           // dup
                code.addIconst(i);                      // iconst_<i>
                if (params[i].isPrimitive()) {
                    CtPrimitiveType pt = (CtPrimitiveType)params[i];
                    String wrapper = pt.getWrapperName();
                    code.addNew(wrapper);               // new <wrapper>
                    code.addOpcode(Bytecode.DUP);       // dup
                    int s = code.addLoad(regno, pt);    // ?load <regno>
                    regno += s;
                    args[0] = pt;
                    code.addInvokespecial(wrapper, "<init>",
                                Descriptor.ofMethod(CtClass.voidType, args));
                                                        // invokespecial
                }
                else {
                    code.addAload(regno);               // aload <regno>
                    ++regno;
                }

                code.addOpcode(Bytecode.AASTORE);       // aastore
            }

            return 8;
        }
    }

    protected void compileUnwrapValue(CtClass type, Bytecode code)
        throws CompileError
    {
        if (type == CtClass.voidType) {
            addNullIfVoid();
            return;
        }

        if (exprType == VOID)
            throw new CompileError("invalid type for " + returnCastName);

        if (type instanceof CtPrimitiveType) {
            CtPrimitiveType pt = (CtPrimitiveType)type;
            // pt is not voidType.
            String wrapper = pt.getWrapperName();
            code.addCheckcast(wrapper);
            code.addInvokevirtual(wrapper, pt.getGetMethodName(),
                                  pt.getGetMethodDescriptor());
            setType(type);
        }
        else {
            code.addCheckcast(type);
            setType(type);
        }
    }

    /* Sets exprType, arrayDim, and className;
     * If type is void, then this method does nothing.
     */
    public void setType(CtClass type) throws CompileError {
        setType(type, 0);
    }

    private void setType(CtClass type, int dim) throws CompileError {
        if (type.isPrimitive()) {
            CtPrimitiveType pt = (CtPrimitiveType)type;
            exprType = MemberResolver.descToType(pt.getDescriptor());
            arrayDim = dim;
            className = null;
        }
        else if (type.isArray())
            try {
                setType(type.getComponentType(), dim + 1);
            }
            catch (NotFoundException e) {
                throw new CompileError("undefined type: " + type.getName());
            }
        else {
            exprType = CLASS;
            arrayDim = dim;
            className = MemberResolver.javaToJvmName(type.getName());
        }
    }

    /* Performs implicit coercion from exprType to type.
     */
    public void doNumCast(CtClass type) throws CompileError {
        if (arrayDim == 0 && !isRefType(exprType))
            if (type instanceof CtPrimitiveType) {
                CtPrimitiveType pt = (CtPrimitiveType)type;
                atNumCastExpr(exprType,
                              MemberResolver.descToType(pt.getDescriptor()));
            }
            else
                throw new CompileError("type mismatch");
    }
}


text:
import { NgModule } from '@angular/core';
import { MomentPipe } from './moment/moment.pipe';
import { DewidowPipe } from './dewidow/dewidow.pipe';

@NgModule({
  declarations: [
    MomentPipe,
    DewidowPipe,
  ],
  exports: [
    MomentPipe,
    DewidowPipe,
  ]
})
export class PipesModule {
}