text:
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.ui.modelutil;

import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

import android.view.View;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.robolectric.annotation.Config;

import org.chromium.base.test.BaseRobolectricTestRunner;
import org.chromium.ui.modelutil.MVCListAdapter.ModelList;

import java.util.ArrayList;
import java.util.List;

/**
 * Tests to ensure/validate SimpleRecyclerViewAdapter behavior.
 */
@RunWith(BaseRobolectricTestRunner.class)
@Config(manifest = Config.NONE)
public class SimpleRecyclerViewAdapterTest {
    private static final PropertyModel.WritableIntPropertyKey INT_PROPERTY =
            new PropertyModel.WritableIntPropertyKey();
    private static final Integer VIEW_TYPE_1 = 1;
    private static final Integer VIEW_TYPE_2 = 2;
    private static final Integer VIEW_TYPE_3 = 3;

    private ModelList mModelList;
    private PropertyModel mModel;

    // Mockito Spies allow us to intercept calls to parent class.
    private SimpleRecyclerViewAdapter mSpyAdapter;

    @Mock
    View mMockView;

    @Before
    public void setUp() {
        MockitoAnnotations.initMocks(this);

        mModel = new PropertyModel(INT_PROPERTY);
        mModelList = new ModelList();

        // Note: this behaves both like a mock and a real object.
        // Methods calls can be mocked or tracked to validate class behavior.
        mSpyAdapter = Mockito.mock(SimpleRecyclerViewAdapter.class,
                Mockito.withSettings()
                        .useConstructor(mModelList)
                        .defaultAnswer(Mockito.CALLS_REAL_METHODS));

        mSpyAdapter.registerType(VIEW_TYPE_1, parent -> mMockView, (m, v, p) -> {});
        mSpyAdapter.registerType(VIEW_TYPE_2, parent -> mMockView, (m, v, p) -> {});
        mSpyAdapter.registerType(VIEW_TYPE_3, parent -> mMockView, (m, v, p) -> {});
    }

    @Test
    public void testObserver_listModelItemsAdded() {
        mModelList.add(new ModelListAdapter.ListItem(VIEW_TYPE_1, mModel));
        verify(mSpyAdapter, times(1)).notifyItemRangeInserted(0, 1);
        mModelList.add(new ModelListAdapter.ListItem(VIEW_TYPE_2, mModel));
        verify(mSpyAdapter, times(1)).notifyItemRangeInserted(1, 1);
    }

    @Test
    public void testObserver_listModelItemsAddedInBatch() {
        mModelList.add(new ModelListAdapter.ListItem(VIEW_TYPE_1, mModel));
        verify(mSpyAdapter, times(1)).notifyItemRangeInserted(0, 1);
        List<ModelListAdapter.ListItem> items = new ArrayList<>();
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_1, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_2, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_3, mModel));
        mModelList.addAll(items);
        verify(mSpyAdapter, times(1)).notifyItemRangeInserted(1, 3);
    }

    @Test
    public void testObserver_listModelItemsSet() {
        List<ModelListAdapter.ListItem> items = new ArrayList<>();
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_1, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_2, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_3, mModel));
        mModelList.set(items);
        verify(mSpyAdapter, times(1)).notifyItemRangeInserted(0, 3);
    }

    @Test
    public void testObserver_listModelItemsRemove() {
        List<ModelListAdapter.ListItem> items = new ArrayList<>();
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_1, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_2, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_3, mModel));
        mModelList.set(items);
        verify(mSpyAdapter, times(1)).notifyItemRangeInserted(0, 3);
        mModelList.removeRange(0, 2);
        verify(mSpyAdapter, times(1)).notifyItemRangeRemoved(0, 2);
    }

    @Test
    public void testObserver_listModelItemsClear() {
        List<ModelListAdapter.ListItem> items = new ArrayList<>();
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_1, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_2, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_3, mModel));
        mModelList.set(items);
        verify(mSpyAdapter, times(1)).notifyItemRangeInserted(0, 3);
        mModelList.clear();
        verify(mSpyAdapter, times(1)).notifyItemRangeRemoved(0, 3);
    }

    @Test
    public void testObserver_listModelItemMoved() {
        List<ModelListAdapter.ListItem> items = new ArrayList<>();
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_1, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_2, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_3, mModel));
        mModelList.set(items);
        verify(mSpyAdapter, times(1)).notifyItemRangeInserted(0, 3);

        mModelList.move(1, 2);
        verify(mSpyAdapter, times(1)).notifyItemMoved(1, 2);
    }

    @Test
    public void testObserver_listModelItemUpdated() {
        List<ModelListAdapter.ListItem> items = new ArrayList<>();
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_1, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_2, mModel));
        items.add(new ModelListAdapter.ListItem(VIEW_TYPE_3, mModel));
        mModelList.set(items);
        verify(mSpyAdapter, times(1)).notifyItemRangeInserted(0, 3);

        mModelList.update(1, new ModelListAdapter.ListItem(VIEW_TYPE_2, mModel));
        verify(mSpyAdapter, times(1)).notifyItemRangeChanged(1, 1);
    }
}


text:
function Get-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Collections.Hashtable])]
    param
    (
        [parameter(Mandatory = $true)]
        [System.String]
        $Source,

        [parameter(Mandatory = $true)]
        [System.String]
        $Destination,

        [System.String]
        $LogOutput
    )

    $returnValue = @{
        Source = if (Test-Path $Source){$Source};
        Destination = if (Test-Path $Destination){$Destination};
        LogOutput = if ($LogOutput){
                        if(Test-Path $LogOutput){$LogOutput}
                        }
    }

    $returnValue
}

function Set-TargetResource
{
    [CmdletBinding()]
    param
    (
        [parameter(Mandatory = $true)]
        [System.String]
        $Source,

        [parameter(Mandatory = $true)]
        [System.String]
        $Destination,

        [System.String]
        $Files,

        [System.UInt32]
        $Retry,

        [System.UInt32]
        $Wait,

        [System.Boolean]
        $SubdirectoriesIncludingEmpty = $False,

        [System.Boolean]
        $Restartable = $False,

        [System.Boolean]
        $MultiThreaded = $False,

        [System.String]
        $ExcludeFiles,

        [System.String]
        $LogOutput,

        [System.Boolean]
        $AppendLog = $False,

        [System.String]
        $AdditionalArgs
    )

    [string]$Arguments = ''
    if ($Retry -ne '') {$Arguments += " /R:$Retry"}
    if ($Wait -ne '') {$Arguments += " /W:$Wait"}
    if ($SubdirectoriesIncludingEmpty) {$Arguments += ' /E'}
    if ($Restartable) {$Arguments += ' /Z'}
    if ($MultiThreaded) {$Arguments += ' /MT'}
    if ($ExcludeFiles -ne '') {$Arguments += " /XF $ExcludeFiles"}
    if ($ExcludeDirs -ne '') {$Arguments += " /XD $ExcludeDirs"}
    if ($LogOutput -ne '' -AND $AppendLog) {
        $Arguments += " /LOG+:$LogOutput"
        }
    if ($LogOutput -ne '' -AND -not $AppendLog) {
        $Arguments += " /LOG:$LogOutput"
     }
    if ($AdditionalArgs -ne $null) {$Arguments += " $AdditionalArgs"}

    try {
        Write-Verbose "Executing: Robocopy.exe `"$($Source)`" `"$($Destination)`" $($Arguments)"
        Invoke-Robocopy $Source $Destination $Arguments
        }
    catch {
        Write-Warning "An error occured executing Robocopy.exe.  ERROR: $_"
        }
}

function Test-TargetResource
{
    [CmdletBinding()]
    [OutputType([System.Boolean])]
    param
    (
        [parameter(Mandatory = $true)]
        [System.String]
        $Source,

        [parameter(Mandatory = $true)]
        [System.String]
        $Destination,

        [System.String]
        $Files,

        [System.UInt32]
        $Retry,

        [System.UInt32]
        $Wait,

        [System.Boolean]
        $SubdirectoriesIncludingEmpty,

        [System.Boolean]
        $Restartable,

        [System.Boolean]
        $MultiThreaded,

        [System.String]
        $ExcludeFiles,

        [System.String]
        $LogOutput,

        [System.Boolean]
        $AppendLog,

        [System.String]
        $AdditionalArgs
    )

    try {
        $result = Invoke-RobocopyTest $Source $Destination
        }
    catch {
        Write-Warning "An error occured while getting the file list from Robocopy.exe.  ERROR: $_"
        }

    # https://support.microsoft.com/en-us/kb/954404
    # ROBOCOPY $LASTEXITCODE is a bitflag:
    #  0: Source and destination are completely synchronized
    #  1: One or more files were copied successfully (new files present)
    #  2: extra files/directories detected
    #  4: mismatched files/directories
    #  8: copy errors and retries exceeded
    # 16: serious error
    if ($result -ge 0 -and $result -lt 8) {[system.boolean]$result = $true}
    else {[system.boolean]$result = $false}

    $result
}

# Helper Functions

function Invoke-RobocopyTest {
param (
    [parameter(Mandatory = $true)]
    [System.String]
    $source,

    [parameter(Mandatory = $true)]
    [System.String]
    $destination
)
    $output = & robocopy.exe /L $source $destination
    $LASTEXITCODE
}
 # Invoke-RobocopyTest C:\DSCTestMOF C:\DSCTestMOF2

function Invoke-Robocopy {
param (
    [parameter(Mandatory = $true)]
    [System.String]
    $source,

    [parameter(Mandatory = $true)]
    [System.String]
    $destination,

    [System.String]
    $Arguments
)

    # This is a safe use of invoke-expression.  Input is only passed as parameters to Robocopy.exe, it cannot be executed directly
    $output = Invoke-Expression "Robocopy.exe `"$Source`" `"$Destination`" $Arguments"

    $LASTEXITCODE
}
 # Invoke-Robocopy -source C:\DSCTestMOF -destination C:\DSCTestMOF2 -Arguments '/E /MT'

Export-ModuleMember -Function *-TargetResource

redpajama_set_name: RedPajamaGithub


text:
package com.intellij.ui.components;

import com.intellij.ui.Gray;
import com.intellij.util.ui.GraphicsUtil;
import com.intellij.util.ui.UIUtil;

import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicToggleButtonUI;
import java.awt.*;

/**
 * @author Konstantin Bulenkov
 */
public class OnOffButton extends JToggleButton {
  private String myOnText;
  private String myOffText;
  public OnOffButton() {
    setUI(OnOffButtonUI.createUI(this));
    setOpaque(false);
    setBorder(null);
  }

  public String getOnText() {
    return myOnText == null ? "ON" : myOnText;
  }

  public void setOnText(String onText) {
    myOnText = onText;
  }

  public String getOffText() {
    return myOffText == null ? "OFF" : myOffText;
  }

  public void setOffText(String offText) {
    myOffText = offText;
  }

  @Override
  protected void paintComponent(Graphics g) {
    super.paintComponent(g);
  }

  public static class OnOffButtonUI extends BasicToggleButtonUI {
    private final OnOffButton myButton;

    public OnOffButtonUI(OnOffButton checkBox) {
      myButton = checkBox;
    }

    @SuppressWarnings({"MethodOverridesStaticMethodOfSuperclass", "UnusedDeclaration"})
    public static ComponentUI createUI(JComponent c) {
      return new OnOffButtonUI((OnOffButton)c);
    }

    @Override
    public Dimension getPreferredSize(JComponent c) {
      final OnOffButton button = (OnOffButton)c;
      String text = button.getOffText().length() > button.getOnText().length() ? button.getOffText() : button.getOnText();
      text = text.toUpperCase();
      final FontMetrics fm = c.getFontMetrics(c.getFont());
      int w = fm.stringWidth(text);
      int h = fm.getHeight();
      h += 2*4;
      w += 3 * h / 2 + 4;
      return new Dimension(w, h);
    }
    @Override
    public void paint(Graphics gr, JComponent c) {
      final OnOffButton button = (OnOffButton)c;
      final Dimension size = button.getSize();
      int w = size.width-8;
      int h = size.height-6;
      if (h % 2 == 1) {
        h--;
      }
      Graphics2D g = ((Graphics2D)gr);
      GraphicsUtil.setupAAPainting(g);
      g.translate(1,1);
      if (button.isSelected()) {
        g.setColor(new Color(13, 41, 62));
        g.fillRoundRect(0, 0, w, h, h, h);
        g.setColor(UIUtil.getBorderColor());
        g.drawRoundRect(0, 0, w, h, h, h);
        g.setColor(Gray._128);
        g.fillOval(w - h + 1, 1, h - 1, h - 1);
        g.setColor(UIUtil.getListForeground(true));
        g.drawString(button.getOnText(), h/2, h - 4);
      } else {
        g.setColor(UIUtil.getPanelBackground());
        g.fillRoundRect(0, 0, w, h, h, h);
        g.setColor(UIUtil.getBorderColor());
        g.drawRoundRect(0, 0, w, h, h, h);
        g.setColor(UIUtil.getLabelDisabledForeground());
        g.drawString(button.getOffText(), h + 4 , h - 4);
        g.setColor(UIUtil.getBorderColor());
        g.setPaint(new GradientPaint(h,0, Gray._178, 0,h, Gray._240));
        g.fillOval(0, 0, h, h);
        g.setColor(UIUtil.getBorderColor());
        g.drawOval(0, 0, h, h);
      }
      g.translate(-1, -1);
    }

    @Override
    public Dimension getMinimumSize(JComponent c) {
      return getPreferredSize(c);
    }

    @Override
    public Dimension getMaximumSize(JComponent c) {
      return getPreferredSize(c);
    }
  }
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Home 01 - Mexin</title>
	<meta name="description" content="">
	<meta name="author" content="">

	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

	<link rel="stylesheet" href="css/style.css" type="text/css"  media="all">
	<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,900|Roboto|Roboto+Slab:300,400' rel='stylesheet' type='text/css'>

	<link rel="shortcut icon" href="images/favicon.ico">

 Form | Terms | Contact

					<form action="#" method="get">
						<input type="text" class="search-text-box" id="search-box">
					</form>

Home

Home 1 - Main Page

Home 2 - Full Sections

Home 3 - Parallax Sections

Home 4 - Dark Half

Headers

Header Fixed

Header 2

Header 3

Header 4

Header 5

Pages

Services

About us

About us - Extended

About me

Our team

Right Side-Bar

Left Side-Bar

FAQ

Contact

404 Not Found

Features

Shop

Shop 1

Shop 2

Product

Elements

Icons

Pricing Tables

Columns

Timeline

Left Navigation

Sub Menu

Menu Item 01

Menu Item 02

Menu Item 03

Blog

Blog 1

Blog 1 - Left Sidebar

Blog 2

Blog 2 - Left Sidebar

Blog - Both Sidebar

Blog - Timeline

Blog - Single Post

work

Portfolio 2 Columns

Portfolio 3 Columns

Portfolio 4 Columns

Portfolio Pinterest

Portfolio Timeline

Portfolio Item (Single)

					<form action="#" method="get">
						<input type="text" class="search-text-box2">
					</form>

ultra

            Responsive

Focus on the Mobile Devices

          Purchase Now

clean Design

Minimal, spacious and easy to read

          Purchase Now

EASY TO USE

Every element is cohesive and intentional

		  Purchase Now

RETINA READY

Looks beautiful on smarthpones and tablets

		  Purchase Now

Responsive

Innovative design always develops in tandem with innovative technology, and can never be an end in itself. Lorem ipsum dolor

      Learn more

Lots of Features

Innovative design always develops in tandem with innovative technology, and can never be an end in itself. Lorem ipsum dolor

      Learn more

Retina Ready

Innovative design always develops in tandem with innovative technology, and can never be an end in itself. Lorem ipsum dolor

      Learn more

Recent Works

Lorem ipsum dolor sit amet, consectetur adipiscing elit Aenean nisl orci

      See All

Categories

Design

Print

Video

Other

Archives

May 2012 (2)

April 2012 (3)

March 2012 (5)

February 2012 (1)

Save the World

10 MAY 2013 - DESIGN, Print

Mall Admirer

10 MAY 2013 - DESIGN, video

Spoilt for choice

10 MAY 2013 - DESIGN, Print

Busy girl

10 MAY 2013 - DESIGN, Print

 Purchase Now

Clean, Flat, Modern & Responsive Template

Minimal design helps viewers navigate though the design.

Only Use what is necessary

Aliquam enim enim, pharetra in sodales at, interdum sit amet dui. Nullam vulputate euismod urna non pharetra. Phasellus blandit mattis ipsum, ac laoreet lorem lacinia et. Cras et ligula libero.

        Haretra in sodales atsen interdum

Clean and User friendly layouts

Aliquam enim enim, pharetra in sodales at, interdum sit amet dui. Nullam vulputate euismod urna non pharetra. Phasellus blandit mattis ipsum, ac laoreet lorem lacinia et. Cras et ligula.

        Haretra in sodales atsen interdum

Latest from Blog

Job Seeking Out of Your Industry

10 MAY 2013

Magnifying Uses of Small Spaces

10 MAY 2013

What Your College Degree Will Be Worth

10 MAY 2013

Quote of the week

Care and accuracy in the design process show respect towards the consumer.

        John Smith  - Manager at Mexin

Contact Information

Address:  No.28 - 63739 street lorem ipsum City, Country

Phone:  + 1 (234) 567 8901

Fax:  + 1 (234) 567 8901

Email:  support@yoursite.com

flickr photostream

Aliquam enim enim, pharetra in sodales at, interdum sit amet dui. Nullam vulputate euismod urna non pharetra. Phasellus blandit mattis ipsum, ac laoreet lorem lacinia et. Cras et ligula libero.

 About | Services | Pricing | Contact

	  © 2012. All Rights Reserved. Powered by WordPress


text:
module SecurityGuard
  module Concerns
    module InputToOutput
      def input_to_output(args)
        input_data, filenames = read_data_from(args[:input])

        output_data = send(args[:process], input_data)

        write_data_to args[:output],
                      :output_data => output_data,
                      :filenames   => filenames
      end

      private

      def read_data_from(folder)
        files = Dir["#{folder}/*"].sort

        raise Exception.new('Input folder is invalid or is empty.') if files.empty?

        input_data = []
        filenames  = []

        files.each do |file|
          input_data << File.readlines(file).map{ |line| line.downcase.strip }
          filenames  << File.basename(file)
        end

        [input_data, filenames]
      end

      def write_data_to(folder, opts)
        opts[:output_data].each_with_index do |array, index|
          File.open("#{folder}/#{opts[:filenames][index]}", 'w') do |f|
            f.puts array
          end
        end
      end
    end
  end
end


text:
-s service
-l label
-w password

```bash
security add-generic-password -a ${USER} -s myfirstaccount -w mypassword databases.keychain-db

security find-generic-password -s myfirstaccount -w databases.keychain-db

security delete-generic-password -s myfirstaccount databases.keychain-db
```

### Open New Terminal Tab via Command Line ###

```bash
osascript -e 'tell application "Terminal" to activate' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down'
```

### Troubleshooting ###

Problem:
```bash
Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.
```

Solution:
```bash
sudo xcodebuild -license accept
```

Problem: "SSL certificate problem: Invalid certificate chain"
Solution: https://support.apple.com/en-ca/HT203811

Screenshot Awesomeness (screenshot regions): `cmd+shift+4` then press `spacebar`


text:
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

package com.intellij.openapi.roots.impl;

import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.io.IOException;

/**
 * Represents a non-linear operation which is executed before indexing process
 * is started {@link PushedFilePropertiesUpdater#pushAllPropertiesNow()}.
 *

 * During this process any pusher is allowed to set some properties to any of files being indexed.
 *

 * Most frequently property represents some kind of "language level"
 * which is in most cases required to determine the algorithm of stub and other indexes building.
 *

 * After property was pushed it can be retrieved any time using {@link FilePropertyPusher#getFileDataKey()}.
 *

 * The computation of the value (simplified) for a given {@link VirtualFile} works as follows:
 *

 *
 the {@link #getImmediateValue(Project, VirtualFile)} is executed,
 *      a non-null result is returned

 *
 the {@link #getImmediateValue(Module)} is executed for the module of a file,
 *      a non-null result is retuned

 *
 iterate all parent file that is in content root of the file
 *      and try to return first non-null
 *      result of the {@link #getImmediateValue(Project, VirtualFile)} call
 *

 *
 try calling the {@link #getImmediateValue(Project, VirtualFile)} with {@code null} as {@link VirtualFile}
 *      and return a non-null value

 *
 fallback to {@link #getDefaultValue()} and return it

 *

 * Once the value is computed, it calls the {@link #persistAttribute(Project, VirtualFile, Object)}
 * to test if the value is changed, if so, the implementation is responsible to notify back
 *

 * This API is intended to be used to prepare state for indexing, please do not use it for other purposes
 *

 * Note: Don't use plugin-specific classes as pushed properties, consider using String instead.
 * Otherwise, the plugin becomes not dynamic because its classes will be hard-referenced as VirtualFile's user data.
 * For example, instead of pushing SomeLanguageDialect instances, push someLanguageDialect.getName() and
 * restore SomeLanguageDialect by name where needed.
 */
public interface FilePropertyPusher<T> {
  ExtensionPointName<FilePropertyPusher<?>> EP_NAME = ExtensionPointName.create("com.intellij.filePropertyPusher");

  default void initExtra(@NotNull Project project) {
    project.getMessageBus();
  }

  default void afterRootsChanged(@NotNull Project project) {}

  /**
   * After property was pushed it can be retrieved any time using {@link FilePropertyPusher#getFileDataKey()}
   * from {@link VirtualFile#getUserData(Key)}.
   */
  @NotNull
  Key<T> getFileDataKey();

  boolean pushDirectoriesOnly();

  @NotNull
  T getDefaultValue();

  @Nullable
  T getImmediateValue(@NotNull Module module);

  @Nullable
  T getImmediateValue(@NotNull Project project, @Nullable VirtualFile file);

  default boolean acceptsFile(@NotNull VirtualFile file, @NotNull Project project) {
    return acceptsFile(file);
  }

  boolean acceptsDirectory(@NotNull VirtualFile file, @NotNull Project project);

  /**
   * This method is called to persist the computed Pusher value (of type T).
   * The implementation is supposed to call {@link PushedFilePropertiesUpdater#filePropertiesChanged}
   * if a change is detected to issue the {@para fileOrDir} re-index
   */
  void persistAttribute(@NotNull Project project, @NotNull VirtualFile fileOrDir, @NotNull T value) throws IOException;

  //<editor-fold desc="Deprecated APIs" defaultState="collapsed">

  /**
   * @deprecated Please override {@link FilePropertyPusher#acceptsFile(VirtualFile, Project)}
   */
  @Deprecated(forRemoval = true)
  @SuppressWarnings("DeprecatedIsStillUsed")
  default boolean acceptsFile(@NotNull VirtualFile file) {
    return false;
  }
  //</editor-fold>
}


text:
if [ "$GHUNIT_CLI" = "" ] && [ "$GHUNIT_AUTORUN" = "" ]; then
exit 0
fi

export DYLD_ROOT_PATH="$SDKROOT"
export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR"
export IPHONE_SIMULATOR_ROOT="$SDKROOT"

export NSDebugEnabled=YES
export NSZombieEnabled=YES
export NSDeallocateZombies=NO
export NSHangOnUncaughtException=YES
export NSAutoreleaseFreedObjectCheckEnabled=YES

export DYLD_FRAMEWORK_PATH="$CONFIGURATION_BUILD_DIR"

TEST_TARGET_EXECUTABLE_PATH="$TARGET_BUILD_DIR/$EXECUTABLE_PATH"

if [ ! -e "$TEST_TARGET_EXECUTABLE_PATH" ]; then
echo ""
echo "  ------------------------------------------------------------------------"
echo "  Missing executable path: "
echo "     $TEST_TARGET_EXECUTABLE_PATH."
echo "  The product may have failed to build or could have an old xcodebuild in your path (from 3.x instead of 4.x)."
echo "  ------------------------------------------------------------------------"
echo ""
exit 1
fi

RUN_CMD="\"$TEST_TARGET_EXECUTABLE_PATH\" -RegisterForSystemEvents"

echo "Running: $RUN_CMD"
set +o errexit # Disable exiting on error so script continues if tests fail
eval $RUN_CMD
RETVAL=$?
set -o errexit

unset DYLD_ROOT_PATH
unset DYLD_FRAMEWORK_PATH
unset IPHONE_SIMULATOR_ROOT

if [ -n "$WRITE_JUNIT_XML" ]; then
MY_TMPDIR=`/usr/bin/getconf DARWIN_USER_TEMP_DIR`
RESULTS_DIR="${MY_TMPDIR}test-results"

if [ -d "$RESULTS_DIR" ]; then
`$CP -r "$RESULTS_DIR" "$BUILD_DIR" && rm -r "$RESULTS_DIR"`
fi
fi

exit $RETVAL


text:
var express = require('express');
//create application
var app = express();

//serves file without any routs. File is provided as 2nd argment
app.use(express.static(process.argv[3] || path.join(__dirname, 'public')));
//port number is in 1st argument
app.listen(process.argv[2]);


text:
import Exception from './Exception'
import Expected from './Expected'

describe('js:Exception', () => {
  describe('constructor', () => {
    test('correctly constructs the Type instance', () => {
      const source = function () {}
      const target = {
        index: 0,
        type: 'Argument',
        value: 'test'
      }
      const expected = new Expected({
        data: {},
        exceptionToError: () => {},
        expectation: 'foo'
      })
      const instance = new Exception({ expected, source, target })
      expect(instance).toBeInstanceOf(Exception)
      expect(instance).toMatchObject({
        expected,
        source,
        target,
        type: 'Expected:Argument:foo'
      })
    })
  })

  describe('toError', () => {
    test('calls the toError method of the expected', () => {
      const source = function () {}
      const target = {
        index: 0,
        type: 'Argument',
        value: 'test'
      }
      const expected = {
        toError: jest.fn(() => new Error('test'))
      }
      const instance = new Exception({ expected, source, target })
      const result = instance.toError()
      expect(result).toBeInstanceOf(Error)
      expect(result.message).toBe('test')
    })
  })
})


text:
namespace Fixtures.AcceptanceTestsBodyFile
{
    using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Net;
    using System.Net.Http;
    using System.Net.Http.Headers;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using Models;

    /// <summary>
    /// Files operations.
    /// </summary>
    public partial class Files : IServiceOperations<AutoRestSwaggerBATFileService>, IFiles
    {
        /// <summary>
        /// Initializes a new instance of the Files class.
        /// </summary>
        /// <param name='client'>
        /// Reference to the service client.
        /// </param>
        public Files(AutoRestSwaggerBATFileService client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }
            this.Client = client;
        }

        /// <summary>
        /// Gets a reference to the AutoRestSwaggerBATFileService
        /// </summary>
        public AutoRestSwaggerBATFileService Client { get; private set; }

        /// <summary>
        /// Get file
        /// </summary>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public async Task<HttpOperationResponse<System.IO.Stream>> GetFileWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            // Tracing
            bool _shouldTrace = ServiceClientTracing.IsEnabled;
            string _invocationId = null;
            if (_shouldTrace)
            {
                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(_invocationId, this, "GetFile", tracingParameters);
            }
            // Construct URL
            var _baseUrl = this.Client.BaseUri.AbsoluteUri;
            var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "files/stream/nonempty").ToString();
            // Create HTTP transport objects
            HttpRequestMessage _httpRequest = new HttpRequestMessage();
            _httpRequest.Method = new HttpMethod("GET");
            _httpRequest.RequestUri = new Uri(_url);
            // Set Headers
            if (customHeaders != null)
            {
                foreach(var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Send Request
            if (_shouldTrace)
            {
                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            HttpResponseMessage _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            if (_shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            HttpStatusCode _statusCode = _httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            if ((int)_statusCode != 200)
            {
                var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    string _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                    Error _errorBody = SafeJsonConvert.DeserializeObject<Error>(_responseContent, this.Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex.Body = _errorBody;
                    }
                }
                catch (JsonException)
                {
                    // Ignore the exception
                }
                ex.Request = _httpRequest;
                ex.Response = _httpResponse;
                if (_shouldTrace)
                {
                    ServiceClientTracing.Error(_invocationId, ex);
                }
                throw ex;
            }
            // Create Result
            var _result = new HttpOperationResponse<System.IO.Stream>();
            _result.Request = _httpRequest;
            _result.Response = _httpResponse;
            // Deserialize Response
            if ((int)_statusCode == 200)
            {
                _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
            }
            if (_shouldTrace)
            {
                ServiceClientTracing.Exit(_invocationId, _result);
            }
            return _result;
        }

        /// <summary>
        /// Get empty file
        /// </summary>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public async Task<HttpOperationResponse<System.IO.Stream>> GetEmptyFileWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            // Tracing
            bool _shouldTrace = ServiceClientTracing.IsEnabled;
            string _invocationId = null;
            if (_shouldTrace)
            {
                _invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(_invocationId, this, "GetEmptyFile", tracingParameters);
            }
            // Construct URL
            var _baseUrl = this.Client.BaseUri.AbsoluteUri;
            var _url = new Uri(new Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "files/stream/empty").ToString();
            // Create HTTP transport objects
            HttpRequestMessage _httpRequest = new HttpRequestMessage();
            _httpRequest.Method = new HttpMethod("GET");
            _httpRequest.RequestUri = new Uri(_url);
            // Set Headers
            if (customHeaders != null)
            {
                foreach(var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Send Request
            if (_shouldTrace)
            {
                ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            HttpResponseMessage _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            if (_shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            HttpStatusCode _statusCode = _httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            if ((int)_statusCode != 200)
            {
                var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    string _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                    Error _errorBody = SafeJsonConvert.DeserializeObject<Error>(_responseContent, this.Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex.Body = _errorBody;
                    }
                }
                catch (JsonException)
                {
                    // Ignore the exception
                }
                ex.Request = _httpRequest;
                ex.Response = _httpResponse;
                if (_shouldTrace)
                {
                    ServiceClientTracing.Error(_invocationId, ex);
                }
                throw ex;
            }
            // Create Result
            var _result = new HttpOperationResponse<System.IO.Stream>();
            _result.Request = _httpRequest;
            _result.Response = _httpResponse;
            // Deserialize Response
            if ((int)_statusCode == 200)
            {
                _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false);
            }
            if (_shouldTrace)
            {
                ServiceClientTracing.Exit(_invocationId, _result);
            }
            return _result;
        }

    }
}


text:
import json
import time

def user_data():
    with open('json/user.json') as json_data:
        user_data = json.load(json_data)
    return user_data

class User:
    def __init__(self):
        data = user_data()
        self.first_time = data["first-time"]
        self.first_time_vocabulary = data["first-time-vocabulary"]
        self.date = data["date"]

    def make_it_old(self, x):
        # Change the status of "first-time" to False
        data = user_data()
        if x == "neltume":
            data["first-time"] = "False"
            with open('json/user.json', 'w') as json_data:
                json.dump(data, json_data)
            self.first_time = data["first-time"]
        elif x == "vocabulary":
            data["first-time-vocabulary"] = "False"
            with open('json/user.json', 'w') as json_data:
                json.dump(data, json_data)
            self.first_time_vocabulary = data["first-time-vocabulary"]

    def set_date(self):
        current_date = time.localtime()
        date = [current_date[0], current_date[1], current_date[2]]
        data = user_data()
        data["date"] = date
        with open('json/user.json', 'w') as json_data:
            json.dump(data, json_data)
        self.date = data["date"]


text:
namespace System.Runtime.InteropServices
{
    using System;
    using System.Collections.Generic;
    using System.Threading;

    using ObjectHandle = IntPtr;
    using GCHandleCookie = IntPtr;

    // Internal class used to map a GCHandle to an IntPtr. Instead of handing out the underlying CLR
    // handle, we now hand out a cookie that can later be converted back to the CLR handle it
    // is associated with.

    // NOTE:
    // this implementation uses a single lock between FindOrAddHandle and RemoveHandleIfPresent which
    // could create some scalability issues when this MDA is turned on.  if this is affecting perf
    // then additional tuning work will be required.

    internal class GCHandleCookieTable
    {
        private const int InitialHandleCount = 10;
        private const int MaxListSize = 0xFFFFFF;
        private const uint CookieMaskIndex = 0x00FFFFFF;
        private const uint CookieMaskSentinal = 0xFF000000;

        internal GCHandleCookieTable()
        {
            m_HandleList = new ObjectHandle[InitialHandleCount];
            m_CycleCounts = new byte[InitialHandleCount];
            m_HandleToCookieMap = new Dictionary<ObjectHandle, GCHandleCookie>(InitialHandleCount);
            m_syncObject = new object();

            for (int i = 0; i < InitialHandleCount; i++)
            {
                m_HandleList[i] = ObjectHandle.Zero;
                m_CycleCounts[i] = 0;
            }
        }

        // Retrieve a cookie for the passed in handle. If no cookie has yet been allocated for
        // this handle, one will be created. This method is thread safe.
        internal GCHandleCookie FindOrAddHandle(ObjectHandle handle)
        {
            // Don't accept a null object handle
            if (handle == ObjectHandle.Zero)
                return GCHandleCookie.Zero;

            GCHandleCookie cookie = GCHandleCookie.Zero;

            lock (m_syncObject)
            {
                // First see if we already have a cookie for this handle.
                if (m_HandleToCookieMap.ContainsKey(handle))
                    return m_HandleToCookieMap[handle];

                if ((m_FreeIndex < m_HandleList.Length) && (Volatile.Read(ref m_HandleList[m_FreeIndex]) == ObjectHandle.Zero))
                {
                    Volatile.Write(ref m_HandleList[m_FreeIndex],  handle);
                    cookie = GetCookieFromData((uint)m_FreeIndex, m_CycleCounts[m_FreeIndex]);

                    // Set our next guess just one higher as this index is now in use.
                    // it's ok if this sets m_FreeIndex > m_HandleList.Length as this condition is
                    // checked at the beginning of the if statement.
                    ++m_FreeIndex;
                }
                else
                {
                    for (m_FreeIndex = 0; m_FreeIndex < MaxListSize; ++m_FreeIndex)
                    {
                        if (m_HandleList[m_FreeIndex] == ObjectHandle.Zero)
                        {
                            Volatile.Write(ref m_HandleList[m_FreeIndex], handle);
                            cookie = GetCookieFromData((uint)m_FreeIndex, m_CycleCounts[m_FreeIndex]);

                            // this will be our next guess for a free index.
                            // it's ok if this sets m_FreeIndex > m_HandleList.Length
                            // since we check for this condition in the if statement.
                            ++m_FreeIndex;
                            break;
                        }

                        if (m_FreeIndex + 1 == m_HandleList.Length)
                            GrowArrays();
                    }
                }

                if (cookie == GCHandleCookie.Zero)
                    throw new OutOfMemoryException(Environment.GetResourceString("OutOfMemory_GCHandleMDA"));

                // This handle hasn't been added to the map yet so add it.
                m_HandleToCookieMap.Add(handle, cookie);
            }

            return cookie;
        }

        // Get a handle.
        internal ObjectHandle GetHandle(GCHandleCookie cookie)
        {
            ObjectHandle oh = ObjectHandle.Zero;

            if (!ValidateCookie(cookie))
                return ObjectHandle.Zero;

            oh = Volatile.Read(ref m_HandleList[GetIndexFromCookie(cookie)]);

            return oh;
        }

        // Remove the handle from the cookie table if it is present.
        //
        internal void RemoveHandleIfPresent(ObjectHandle handle)
        {
            if (handle == ObjectHandle.Zero)
                return;

            lock (m_syncObject)
            {
                if (m_HandleToCookieMap.ContainsKey(handle))
                {
                    GCHandleCookie cookie = m_HandleToCookieMap[handle];

                    // Remove it from the array first
                    if (!ValidateCookie(cookie))
                        return;

                    int index = GetIndexFromCookie(cookie);

                    m_CycleCounts[index]++;
                    Volatile.Write(ref m_HandleList[index], ObjectHandle.Zero);

                    // Remove it from the hashtable last
                    m_HandleToCookieMap.Remove(handle);

                    // Update our guess
                    m_FreeIndex = index;
                }
            }
        }

        private bool ValidateCookie(GCHandleCookie cookie)
        {
            int index;
            byte xorData;

            GetDataFromCookie(cookie, out index, out xorData);

            // Validate the index
            if (index >= MaxListSize)
                return false;

            if (index >= m_HandleList.Length)
                return false;

            if (Volatile.Read(ref m_HandleList[index]) == ObjectHandle.Zero)
                return false;

            // Validate the xorData byte (this contains the cycle count and appdomain id).
            byte ADID = (byte)(AppDomain.CurrentDomain.Id % 0xFF);
            byte goodData = (byte)(Volatile.Read(ref m_CycleCounts[index]) ^ ADID);
            if (xorData != goodData)
                return false;

            return true;
        }

        // Double the size of our arrays - must be called with the lock taken.
        private void GrowArrays()
        {
            int CurrLength = m_HandleList.Length;

            ObjectHandle[] newHandleList = new ObjectHandle[CurrLength * 2];
            byte[] newCycleCounts = new byte[CurrLength * 2];

            Array.Copy(m_HandleList, newHandleList, CurrLength);
            Array.Copy(m_CycleCounts, newCycleCounts, CurrLength);

            m_HandleList = newHandleList;
            m_CycleCounts = newCycleCounts;
        }

        // Generate a cookie based on the index, cyclecount, and current domain id.
        private GCHandleCookie GetCookieFromData(uint index, byte cycleCount)
        {
            byte ADID = (byte)(AppDomain.CurrentDomain.Id % 0xFF);
            return (GCHandleCookie)(((cycleCount ^ ADID) << 24) + index + 1);
        }

        // Break down the cookie into its parts
        private void GetDataFromCookie(GCHandleCookie cookie, out int index, out byte xorData)
        {
            uint intCookie = (uint)cookie;
            index = (int)(intCookie & CookieMaskIndex) - 1;
            xorData = (byte)((intCookie & CookieMaskSentinal) >> 24);
        }

        // Just get the index from the cookie
        private int GetIndexFromCookie(GCHandleCookie cookie)
        {
            uint intCookie = (uint)cookie;
            return (int)(intCookie & CookieMaskIndex) - 1;
        }

        private Dictionary<ObjectHandle, GCHandleCookie> m_HandleToCookieMap;
        private volatile ObjectHandle[] m_HandleList;
        private volatile byte[] m_CycleCounts;
        private int m_FreeIndex;
        private readonly object m_syncObject;
    }
}

#endif


text:
Summary of the useful of SQL Server T-SQL scripts

### Database
1. [Restore database with new name](./RestoreDBWithNewName.sql)

### Table
1. [Truncate all tables](./TruncateAllTables.sql)
2. [Delete all tables](./DeleteAllTables.sql)

### Column
1. [Search all columns by string](./SearchAllColums.sql)
2. [Search column name by string](./SearchColumnName.sql)
3. [Update column From Select](./UpdateFromSelect.sql)

### Foreign Key
1. [List All Foreign Key](./ListFKByTableName.sql)

### Stored Procedure
1. [Search all stored procedures](./SearchAllStoredProcedure.sql)

### Database Diagram
1. [Copy Database Diagram](./CopyDatabaseDiagram.sql)


text:
<?php

declare(strict_types=1);

namespace Sylius\Behat\Context\Transform;

use Behat\Behat\Context\Context;
use Sylius\Component\Addressing\Model\ZoneInterface;
use Sylius\Component\Resource\Repository\RepositoryInterface;
use Webmozart\Assert\Assert;

/**
 * @author Łukasz Chruściel <lukasz.chrusciel@lakion.com>
 */
final class ZoneContext implements Context
{
    /**
     * @var RepositoryInterface
     */
    private $zoneRepository;

    /**
     * @param RepositoryInterface $zoneRepository
     */
    public function __construct(RepositoryInterface $zoneRepository)
    {
        $this->zoneRepository = $zoneRepository;
    }

    /**
     * @Transform /^"([^"]+)" zone$/
     * @Transform /^zone "([^"]+)"$/
     * @Transform :zone
     */
    public function getZoneByCode($code)
    {
        return $this->getZoneBy(['code' => $code]);
    }

    /**
     * @Transform /^zone named "([^"]+)"$/
     */
    public function getZoneByName($name)
    {
        return $this->getZoneBy(['name' => $name]);
    }

    /**
     * @Transform /^rest of the world$/
     */
    public function getRestOfTheWorldZone()
    {
        $zone = $this->zoneRepository->findOneBy(['code' => 'RoW']);
        Assert::notNull(
            $zone,
            'Rest of the world zone does not exist.'
        );

        return $zone;
    }

    /**
     * @param array $parameters
     *
     * @return ZoneInterface
     */
    private function getZoneBy(array $parameters)
    {
        $existingZone = $this->zoneRepository->findOneBy($parameters);
        Assert::notNull(
            $existingZone,
            'Zone does not exist.'
        );

        return $existingZone;
    }
}


text:
package org.dasein.cloud.azure.network.model;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;

/**
 * Created by Jeffrey Yan on 9/16/2015.
 *
 * @author Jeffrey Yan
 * @since 2015.09.1
 */
@XmlRootElement(name="NetworkConfiguration", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
@XmlAccessorType(XmlAccessType.FIELD)
public class NetworkConfigurationModel {
    @XmlElement(name="VirtualNetworkConfiguration", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
    private VirtualNetworkConfiguration virtualNetworkConfiguration;

    public VirtualNetworkConfiguration getVirtualNetworkConfiguration() {
        return virtualNetworkConfiguration;
    }

    public void setVirtualNetworkConfiguration(VirtualNetworkConfiguration virtualNetworkConfiguration) {
        this.virtualNetworkConfiguration = virtualNetworkConfiguration;
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class VirtualNetworkConfiguration {
        @XmlElement(name="Dns", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private Dns dns;

        @XmlElementWrapper(name = "LocalNetworkSites", namespace = "http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        @XmlElement(name="LocalNetworkSite", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private List<LocalNetworkSite> localNetworkSites;

        @XmlElementWrapper(name = "VirtualNetworkSites", namespace = "http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        @XmlElement(name="VirtualNetworkSite", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private List<VirtualNetworkSite> virtualNetworkSites;

        public Dns getDns() {
            return dns;
        }

        public void setDns(Dns dns) {
            this.dns = dns;
        }

        public List<LocalNetworkSite> getLocalNetworkSites() {
            return localNetworkSites;
        }

        public void setLocalNetworkSites(List<LocalNetworkSite> localNetworkSites) {
            this.localNetworkSites = localNetworkSites;
        }

        public List<VirtualNetworkSite> getVirtualNetworkSites() {
            return virtualNetworkSites;
        }

        public void setVirtualNetworkSites(List<VirtualNetworkSite> virtualNetworkSites) {
            this.virtualNetworkSites = virtualNetworkSites;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Dns {
        @XmlElementWrapper(name = "DnsServers", namespace = "http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        @XmlElement(name="DnsServer", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private List<DnsServer> dnsServers;

        public List<DnsServer> getDnsServers() {
            return dnsServers;
        }

        public void setDnsServers(List<DnsServer> dnsServers) {
            this.dnsServers = dnsServers;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class DnsServer {
        @XmlAttribute(name="name")
        private String name;

        @XmlAttribute(name="IPAddress")
        private String ipAddress;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getIpAddress() {
            return ipAddress;
        }

        public void setIpAddress(String ipAddress) {
            this.ipAddress = ipAddress;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class LocalNetworkSite {
        @XmlAttribute(name="name")
        private String name;

        @XmlElement(name="VPNGatewayAddress", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private String vpnGatewayAddress;

        @XmlElement(name="AddressSpace", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private AddressSpace addressSpace;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getVpnGatewayAddress() {
            return vpnGatewayAddress;
        }

        public void setVpnGatewayAddress(String vpnGatewayAddress) {
            this.vpnGatewayAddress = vpnGatewayAddress;
        }

        public AddressSpace getAddressSpace() {
            return addressSpace;
        }

        public void setAddressSpace(AddressSpace addressSpace) {
            this.addressSpace = addressSpace;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class AddressSpace {
        @XmlElement(name="AddressPrefix", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private String addressPrefix;

        public String getAddressPrefix() {
            return addressPrefix;
        }

        public void setAddressPrefix(String addressPrefix) {
            this.addressPrefix = addressPrefix;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class VirtualNetworkSite {
        @XmlAttribute(name="name")
        private String name;

        @XmlAttribute(name="AffinityGroup")
        private String affinityGroup;

        @XmlAttribute(name="Location")
        private String location;

        @XmlElement(name="Gateway", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private Gateway gateway;

        @XmlElementWrapper(name = "DnsServersRef", namespace = "http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        @XmlElement(name="DnsServerRef", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private List<DnsServerRef> dnsServerRef;

        @XmlElementWrapper(name = "Subnets", namespace = "http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        @XmlElement(name="Subnet", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private List<Subnet> subnets;

        @XmlElement(name="AddressSpace", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private AddressSpace addressSpace;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAffinityGroup() {
            return affinityGroup;
        }

        public void setAffinityGroup(String affinityGroup) {
            this.affinityGroup = affinityGroup;
        }

        public String getLocation() {
            return location;
        }

        public void setLocation(String location) {
            this.location = location;
        }

        public Gateway getGateway() {
            return gateway;
        }

        public void setGateway(Gateway gateway) {
            this.gateway = gateway;
        }

        public List<DnsServerRef> getDnsServerRef() {
            return dnsServerRef;
        }

        public void setDnsServerRef(List<DnsServerRef> dnsServerRef) {
            this.dnsServerRef = dnsServerRef;
        }

        public List<Subnet> getSubnets() {
            return subnets;
        }

        public void setSubnets(List<Subnet> subnets) {
            this.subnets = subnets;
        }

        public AddressSpace getAddressSpace() {
            return addressSpace;
        }

        public void setAddressSpace(AddressSpace addressSpace) {
            this.addressSpace = addressSpace;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Gateway {
        @XmlElement(name="VPNClientAddressPool", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private VPNClientAddressPool vpnClientAddressPool;

        @XmlElement(name="ConnectionsToLocalNetwork", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private ConnectionsToLocalNetwork connectionsToLocalNetwork;

        public VPNClientAddressPool getVpnClientAddressPool() {
            return vpnClientAddressPool;
        }

        public void setVpnClientAddressPool(VPNClientAddressPool vpnClientAddressPool) {
            this.vpnClientAddressPool = vpnClientAddressPool;
        }

        public ConnectionsToLocalNetwork getConnectionsToLocalNetwork() {
            return connectionsToLocalNetwork;
        }

        public void setConnectionsToLocalNetwork(ConnectionsToLocalNetwork connectionsToLocalNetwork) {
            this.connectionsToLocalNetwork = connectionsToLocalNetwork;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class VPNClientAddressPool {
        @XmlElement(name="AddressPrefix", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private String addressPrefix;

        public String getAddressPrefix() {
            return addressPrefix;
        }

        public void setAddressPrefix(String addressPrefix) {
            this.addressPrefix = addressPrefix;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class ConnectionsToLocalNetwork {
        @XmlElement(name="LocalNetworkSiteRef", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private LocalNetworkSiteRef localNetworkSiteRef;

        public LocalNetworkSiteRef getLocalNetworkSiteRef() {
            return localNetworkSiteRef;
        }

        public void setLocalNetworkSiteRef(LocalNetworkSiteRef localNetworkSiteRef) {
            this.localNetworkSiteRef = localNetworkSiteRef;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class LocalNetworkSiteRef {
        @XmlAttribute(name="name")
        private String name;

        @XmlElement(name="Connection", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private Connection connection;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Connection getConnection() {
            return connection;
        }

        public void setConnection(Connection connection) {
            this.connection = connection;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Connection {
        @XmlAttribute(name="type")
        private String type;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class DnsServerRef {
        @XmlAttribute(name="name")
        private String name;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    @XmlAccessorType(XmlAccessType.FIELD)
    public static class Subnet {
        @XmlAttribute(name="name")
        private String name;

        @XmlElement(name="AddressPrefix", namespace ="http://schemas.microsoft.com/ServiceHosting/2011/07/NetworkConfiguration")
        private String addressPrefix;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAddressPrefix() {
            return addressPrefix;
        }

        public void setAddressPrefix(String addressPrefix) {
            this.addressPrefix = addressPrefix;
        }
    }
}


text:
/**
 * @file
 *
 * This file defines the base class for message bus objects that
 * are implemented and registered locally.
 *
 */

/******************************************************************************
 * Copyright (c) 2012-2013, AllSeen Alliance. All rights reserved.
 *
 *    Permission to use, copy, modify, and/or distribute this software for any
 *    purpose with or without fee is hereby granted, provided that the above
 *    copyright notice and this permission notice appear in all copies.
 *
 *    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 *    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 *    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 *    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 *    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 *    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 *    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 ******************************************************************************/

using System;
using System.Threading;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace AllJoynUnity
{
	public partial class AllJoyn
	{
		/**
		 * Message Bus Object base class
		 */
		public class BusObject : IDisposable
		{
			/**
			 * %BusObject constructor.
			 *
			 * @param path           Object path for object.
			 */
			public BusObject(string path) : this(path, false) { }
			/**
			 * %BusObject constructor.
			 *
			 * @param path           Object path for object.
			 * @param isPlaceholder  Place-holder objects are created by the bus itself and serve only
			 *                       as parent objects (in the object path sense) to other objects.
			 */
			public BusObject(string path, bool isPlaceholder)
			{
				// Can't let the GC free these delegates so they must be members
				_propertyGet = new InternalPropertyGetEventHandler(this._PropertyGet);
				_propertySet = new InternalPropertySetEventHandler(this._PropertySet);
				_objectRegistered = new InternalObjectRegisteredEventHandler(this._ObjectRegistered);
				_objectUnregistered = new InternalObjectUnregisteredEventHandler(this._ObjectUnregistered);

				// Ref holder for method handler internal delegates
				_methodHandlerDelegateRefHolder = new List<InternalMethodHandler>();

				callbacks.property_get = Marshal.GetFunctionPointerForDelegate(_propertyGet);
				callbacks.property_set = Marshal.GetFunctionPointerForDelegate(_propertySet);
				callbacks.object_registered = Marshal.GetFunctionPointerForDelegate(_objectRegistered);
				callbacks.object_unregistered = Marshal.GetFunctionPointerForDelegate(_objectUnregistered);

				main = GCHandle.Alloc(callbacks, GCHandleType.Pinned);
				_busObject = alljoyn_busobject_create(path, isPlaceholder ? 1 : 0, main.AddrOfPinnedObject(), IntPtr.Zero);
			}

			/**
			 * %BusObject constructor.
			 *
			 * Use of this BusObject constructor is depricated and will be
			 * removed Please use other BusObject Constructor BusObject(string, bool)
			 *
			 * @param bus            Bus that this object exists on.
			 * @param path           Object path for object.
			 * @param isPlaceholder  Place-holder objects are created by the bus itself and serve only
			 *                       as parent objects (in the object path sense) to other objects.
			 */
			[Obsolete("Creation of a BusObject no longer requires a BusAttachment.")]
			public BusObject(BusAttachment bus, string path, bool isPlaceholder) : this(path, isPlaceholder){}

			/**
			 * Request the raw pointer of the AllJoyn C BusObject
			 *
			 * @return the raw pointer of the AllJoyn C BusObject
			 */
			public IntPtr getAddr()
			{
				return _busObject;
			}

			/**
			 * Add an interface to this object. If the interface has properties this will also add the
			 * standard property access interface. An interface must be added before its method handlers can be
			 * added. Note that the Peer interface (org.freedesktop.DBus.peer) is implicit on all objects and
			 * cannot be explicitly added, and the Properties interface (org.freedesktop,DBus.Properties) is
			 * automatically added when needed and cannot be explicitly added.
			 *
			 * Once an object is registered, it should not add any additional interfaces. Doing so would
			 * confuse remote objects that may have already introspected this object.
			 *
			 * @param iface  The interface to add
			 *
			 * @return
			 *      - QStatus.OK if the interface was successfully added.
			 *      - QStatus.BUS_IFACE_ALREADY_EXISTS if the interface already exists.
			 *      - An error status otherwise
			 */
			public QStatus AddInterface(InterfaceDescription iface)
			{
				return alljoyn_busobject_addinterface(_busObject, iface.UnmanagedPtr);
			}

			/**
			 * Add a method handler to this object. The interface for the method handler must have already
			 * been added by calling AddInterface().
			 *
			 * @param member   Interface member implemented by handler.
			 * @param handler  Method handler.
			 *
			 * @return
			 *      - QStatus.OK if the method handler was added.
			 *      - An error status otherwise
			 */
			public QStatus AddMethodHandler(InterfaceDescription.Member member, MethodHandler handler)
			{
				InternalMethodHandler internalMethodHandler = (IntPtr bus, IntPtr m, IntPtr msg) =>
				{
					MethodHandler h = handler;
					h(new InterfaceDescription.Member(m), new Message(msg));
				};
				_methodHandlerDelegateRefHolder.Add(internalMethodHandler);

				GCHandle membGch = GCHandle.Alloc(member._member, GCHandleType.Pinned);

				MethodEntry entry;
				entry.member = membGch.AddrOfPinnedObject();
				entry.method_handler = Marshal.GetFunctionPointerForDelegate(internalMethodHandler);

				GCHandle gch = GCHandle.Alloc(entry, GCHandleType.Pinned);
				QStatus ret = alljoyn_busobject_addmethodhandlers(_busObject, gch.AddrOfPinnedObject(), (UIntPtr)1);
				gch.Free();
				membGch.Free();

				return ret;
			}

			/**
			 * Reply to a method call.
			 *
			 * @param message      The method call message
			 * @param args     The reply arguments (can be NULL)
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			[Obsolete("Usage of MethodReply that takes MsgArgs been depricated. Please use MsgArg inplace of MsgArgs")]
			protected QStatus MethodReply(Message message, MsgArgs args)
			{
				return alljoyn_busobject_methodreply_args(_busObject, message.UnmanagedPtr, args.UnmanagedPtr,
					(UIntPtr)args.Length);
			}

			/**
			 * Reply to a method call.
			 *
			 * @param message      The method call message
			 * @param args     The reply arguments (can be NULL)
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			protected QStatus MethodReply(Message message, MsgArg args)
			{
				return alljoyn_busobject_methodreply_args(_busObject, message.UnmanagedPtr, args.UnmanagedPtr,
					(UIntPtr)args.Length);
			}

			/**
			 * Reply to a method call with an error message.
			 *
			 * @param message              The method call message
			 * @param error            The name of the error
			 * @param errorMessage     An error message string
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			protected QStatus MethodReply(Message message, string error, string errorMessage)
			{
				return alljoyn_busobject_methodreply_err(_busObject, message.UnmanagedPtr, error,
					errorMessage);
			}

			/**
			 * Reply to a method call with an error message.
			 *
			 * @param message        The method call message
			 * @param status     The status code for the error
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			protected QStatus MethodReply(Message message, QStatus status)
			{
				return alljoyn_busobject_methodreply_status(_busObject, message.UnmanagedPtr, status.value);
			}

			/**
			 * Send a signal.
			 *
			 * @param destination      The unique or well-known bus name or the signal recipient (NULL for broadcast signals)
			 * @param sessionId        A unique SessionId for this AllJoyn session instance
			 * @param signal           Interface member of signal being emitted.
			 * @param args             The arguments for the signal (can be NULL)
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			[Obsolete("Usage of Signal that takes MsgArgs been depricated. Please use MsgArg inplace of MsgArgs")]
			protected QStatus Signal(string destination, uint sessionId, InterfaceDescription.Member signal, MsgArgs args)
			{
				return alljoyn_busobject_signal(_busObject, destination, sessionId, signal._member, args.UnmanagedPtr, (UIntPtr)args.Length, 0, 0, IntPtr.Zero);
			}

			/**
			 * Send a signal.
			 *
			 * @param destination      The unique or well-known bus name or the signal recipient (NULL for broadcast signals)
			 * @param sessionId        A unique SessionId for this AllJoyn session instance
			 * @param signal           Interface member of signal being emitted.
			 * @param args             The arguments for the signal (can be NULL)
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			protected QStatus Signal(string destination, uint sessionId, InterfaceDescription.Member signal, MsgArg args)
			{
				return alljoyn_busobject_signal(_busObject, destination, sessionId, signal._member, args.UnmanagedPtr, (UIntPtr)args.Length, 0, 0, IntPtr.Zero);
			}

			/**
			 * Send a signal.
			 *
			 * @param destination      The unique or well-known bus name or the signal recipient (NULL for broadcast signals)
			 * @param sessionId        A unique SessionId for this AllJoyn session instance
			 * @param signal           Interface member of signal being emitted.
			 * @param args             The arguments for the signal (can be NULL)
			 * @param msg              The sent signal message is returned to the caller
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			protected QStatus Signal(string destination, uint sessionId, InterfaceDescription.Member signal, MsgArg args, Message msg)
			{
				return alljoyn_busobject_signal(_busObject, destination, sessionId, signal._member, args.UnmanagedPtr, (UIntPtr)args.Length, 0, 0, msg.UnmanagedPtr);
			}

			/**
			 * Send a signal.
			 *
			 * @param destination      The unique or well-known bus name or the signal recipient (NULL for broadcast signals)
			 * @param sessionId        A unique SessionId for this AllJoyn session instance
			 * @param signal           Interface member of signal being emitted.
			 * @param args             The arguments for the signal (can be NULL)
			 * @param timeToLife       If non-zero this specifies the useful lifetime for this signal.
			 *                         The units are milliseconds for non-sessionless signals and seconds for
			 *                         sessionless signals. If delivery of the signal is delayed beyond the
			 *                         timeToLive due to network congestion or other factors the signal may
			 *                         be discarded. There is no guarantee that expired signals will not still
			 *                         be delivered.
			 * @param flags            Logical OR of the message flags for this signals. The following flags apply to signals:
			 *                         - If ALLJOYN_FLAG_SESSIONLESS is set the signal will be sent out to any listener without requireing a connected session.
			 *                         - If ALLJOYN_FLAG_GLOBAL_BROADCAST is set broadcast signal (null destination) will be forwarded across bus-to-bus connections.
			 *                         - If ALLJOYN_FLAG_COMPRESSED is set the header is compressed for destinations that can handle header compression.
			 *                         - If ALLJOYN_FLAG_ENCRYPTED is set the message is authenticated and the payload if any is encrypted.
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			[Obsolete("Usage of Signal that takes MsgArgs been depricated. Please use MsgArg inplace of MsgArgs")]
			protected QStatus Signal(string destination, uint sessionId, InterfaceDescription.Member signal,
				MsgArgs args, ushort timeToLife, byte flags)
			{
				return alljoyn_busobject_signal(_busObject, destination, sessionId, signal._member, args.UnmanagedPtr, (UIntPtr)args.Length, timeToLife, flags, IntPtr.Zero);
			}

			/**
			 * Send a signal.
			 *
			 * @param destination      The unique or well-known bus name or the signal recipient (NULL for broadcast signals)
			 * @param sessionId        A unique SessionId for this AllJoyn session instance
			 * @param signal           Interface member of signal being emitted.
			 * @param args             The arguments for the signal (can be NULL)
			 * @param timeToLife       If non-zero this specifies in milliseconds the useful lifetime for this
			 *                         signal. If delivery of the signal is delayed beyond the timeToLive due to
			 *                         network congestion or other factors the signal may be discarded. There is
			 *                         no guarantee that expired signals will not still be delivered.
			 * @param flags            Logical OR of the message flags for this signals. The following flags apply to signals:
			 *                         - If ALLJOYN_FLAG_SESSIONLESS is set the signal will be sent out to any listener without requireing a connected session
			 *                         - If ALLJOYN_FLAG_GLOBAL_BROADCAST is set broadcast signal (null destination) will be
			 *                           forwarded across bus-to-bus connections.
			 *                         - If ALLJOYN_FLAG_COMPRESSED is set the header is compressed for destinations that can
			 *                           handle header compression.
			 *                         - If ALLJOYN_FLAG_ENCRYPTED is set the message is authenticated and the payload if any
			 *                           is encrypted.
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			protected QStatus Signal(string destination, uint sessionId, InterfaceDescription.Member signal,
				MsgArg args, ushort timeToLife, byte flags)
			{
				return alljoyn_busobject_signal(_busObject, destination, sessionId, signal._member, args.UnmanagedPtr, (UIntPtr)args.Length, timeToLife, flags, IntPtr.Zero);
			}

			/**
			 * Send a signal.
			 *
			 * @param destination      The unique or well-known bus name or the signal recipient (NULL for broadcast signals)
			 * @param sessionId        A unique SessionId for this AllJoyn session instance
			 * @param signal           Interface member of signal being emitted.
			 * @param args             The arguments for the signal (can be NULL)
			 * @param timeToLife       If non-zero this specifies in milliseconds the useful lifetime for this
			 *                         signal. If delivery of the signal is delayed beyond the timeToLive due to
			 *                         network congestion or other factors the signal may be discarded. There is
			 *                         no guarantee that expired signals will not still be delivered.
			 * @param flags            Logical OR of the message flags for this signals. The following flags apply to signals:
			 *                         - If ALLJOYN_FLAG_SESSIONLESS is set the signal will be sent out to any listener without
			 *                           requireing a connected session
			 *                         - If ALLJOYN_FLAG_GLOBAL_BROADCAST is set broadcast signal (null destination) will be
			 *                           forwarded across bus-to-bus connections.
			 *                         - If ALLJOYN_FLAG_COMPRESSED is set the header is compressed for destinations that can
			 *                           handle header compression.
			 *                         - If ALLJOYN_FLAG_ENCRYPTED is set the message is authenticated and the payload if any
			 *                           is encrypted.
			 * @param msg              The sent signal message is returned to the caller.
			 * @return
			 *      - QStatus.OK if successful
			 *      - An error status otherwise
			 */
			protected QStatus Signal(string destination, uint sessionId, InterfaceDescription.Member signal,
				MsgArg args, ushort timeToLife, byte flags, Message msg)
			{
				return alljoyn_busobject_signal(_busObject, destination, sessionId, signal._member, args.UnmanagedPtr, (UIntPtr)args.Length, timeToLife, flags, msg.UnmanagedPtr);
			}

			/**
			 * Remove sessionless message sent from this object from local daemon's
			 * store/forward cache.
			 *
			 * @param serialNumber    Serial number of previously sent sessionless signal.
			 * @return  QStatus.OK if successful.
			 */
			public QStatus CancelSessionlessMessage(uint serialNumber)
			{
				return alljoyn_busobject_cancelsessionlessmessage_serial(_busObject, serialNumber);
			}

			/**
			 * Remove sessionless message sent from this object from local daemon's
			 * store/forward cache.
			 *
			 * @param msg    Message to be removed.
			 * @return   QStatus.OK if successful.
			 */
			public QStatus CancelSessionlessMessage(Message msg)
			{
				return alljoyn_busobject_cancelsessionlessmessage(_busObject, msg.UnmanagedPtr);
			}
			#region Properties
			/**
			 * Return the path for the object
			 *
			 * @return Object path
			 */
			public string Path
			{
				get
				{
					return Marshal.PtrToStringAnsi(alljoyn_busobject_getpath(_busObject));
				}
			}

			/**
			 * Get the name of this object.
			 * The name is the last component of the path.
			 *
			 * @return Last component of object path.
			 */
			public string Name
			{
				get
				{
					UIntPtr nameSz = alljoyn_busobject_getname(_busObject, IntPtr.Zero, (UIntPtr)0);
					byte[] sink = new byte[(int)nameSz];

					GCHandle gch = GCHandle.Alloc(sink, GCHandleType.Pinned);
					alljoyn_busobject_getname(_busObject, gch.AddrOfPinnedObject(), nameSz);
					gch.Free();
					// The returned buffer will contain a nul character an so we must remove the last character.
					if ((int)nameSz != 0)
					{
						return System.Text.ASCIIEncoding.ASCII.GetString(sink, 0, (Int32)nameSz - 1);
					}
					else
					{
						return "";
					}
				}
			}

			/**
			 * Indicates if this object is secure.
			 *
			 * @param bus    The busobject we want to check for security
			 *
			 * @return Return QCC_TRUE if authentication is required to emit signals or
			 *                call methods on this object.
			 */
			public bool IsSecure
			{
				get
				{
					return alljoyn_busobject_issecure(_busObject);
				}
			}
			#endregion

			#region Delegates
			[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
			/**
			 * MethodHandlers are %MessageReceiver methods which are called by AllJoyn library
			 * to forward AllJoyn method_calls to AllJoyn library users.
			 *
			 * @param member    Method interface member entry.
			 * @param message   The received method call message.
			 */
			public delegate void MethodHandler(InterfaceDescription.Member member, Message message);
			[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
			private delegate void InternalMethodHandler(IntPtr bus, IntPtr member, IntPtr message);
			[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
			private delegate void InternalPropertyGetEventHandler(IntPtr context, IntPtr ifcName, IntPtr propName, IntPtr val);
			[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
			private delegate void InternalPropertySetEventHandler(IntPtr context, IntPtr ifcName, IntPtr propName, IntPtr val);
			[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
			private delegate void InternalObjectRegisteredEventHandler(IntPtr context);
			[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
			private delegate void InternalObjectUnregisteredEventHandler(IntPtr context);
			#endregion

			#region Virtual Methods
			/**
			 * Handle a bus request to read a property from this object.
			 * BusObjects that implement properties should override this method.
			 * The default version simply returns QStatus.BUS_NO_SUCH_PROPERTY
			 *
			 * @param ifcName   Identifies the interface that the property is defined on
			 * @param propName  Identifies the the property to get
			 * @param[out] val  Returns the property value. The type of this value is the actual value
			 *                  type.
			 */
			protected virtual void OnPropertyGet(string ifcName, string propName, MsgArg val)
			{

			}

			/**
			 * Handle a bus attempt to write a property value to this object.
			 * BusObjects that implement properties should override this method.
			 * This default version just replies with QStatus.BUS_NO_SUCH_PROPERTY
			 *
			 * @param ifcName    Identifies the interface that the property is defined on
			 * @param propName  Identifies the the property to set
			 * @param val        The property value to set. The type of this value is the actual value
			 *                   type.
			 */
			protected virtual void OnPropertySet(string ifcName, string propName, MsgArg val)
			{

			}

			/**
			 * Called by the message bus when the object has been successfully registered. The object can
			 * perform any initialization such as adding match rules at this time.
			 */
			protected virtual void OnObjectRegistered()
			{

			}

			/**
			 * Called by the message bus when the object has been successfully unregistered
			 * @remark
			 * This base class implementation @b must be called explicitly by any overriding derived class.
			 */
			protected virtual void OnObjectUnregistered()
			{

			}
			#endregion

			#region Callbacks
			private void _PropertyGet(IntPtr context, IntPtr ifcName, IntPtr propName, IntPtr val)
			{

				OnPropertyGet(Marshal.PtrToStringAnsi(ifcName),
					Marshal.PtrToStringAnsi(propName), new MsgArg(val));
			}

			private void _PropertySet(IntPtr context, IntPtr ifcName, IntPtr propName, IntPtr val)
			{

				OnPropertySet(Marshal.PtrToStringAnsi(ifcName),
					Marshal.PtrToStringAnsi(propName), new MsgArg(val));
			}

			private void _ObjectRegistered(IntPtr context)
			{

				OnObjectRegistered();
			}

			private void _ObjectUnregistered(IntPtr context)
			{

				OnObjectUnregistered();
			}
			#endregion

			#region DLL Imports
			[DllImport(DLL_IMPORT_TARGET)]
			private extern static IntPtr alljoyn_busobject_create(
				[MarshalAs(UnmanagedType.LPStr)] string path,
				int isPlaceholder,
				IntPtr callbacks_in,
				IntPtr context_in);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static IntPtr alljoyn_busobject_destroy(IntPtr bus);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static IntPtr alljoyn_busobject_getpath(IntPtr bus);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static UIntPtr alljoyn_busobject_getname(IntPtr bus, IntPtr buffer, UIntPtr bufferSz);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static int alljoyn_busobject_addinterface(IntPtr bus, IntPtr iface);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static int alljoyn_busobject_addmethodhandlers(IntPtr bus,
				IntPtr entries, UIntPtr numEntries);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static int alljoyn_busobject_methodreply_args(IntPtr bus,
				IntPtr msg, IntPtr msgArgs, UIntPtr numArgs);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static int alljoyn_busobject_methodreply_err(IntPtr bus, IntPtr msg,
				[MarshalAs(UnmanagedType.LPStr)] string error,
				[MarshalAs(UnmanagedType.LPStr)] string errorMsg);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static int alljoyn_busobject_methodreply_status(IntPtr bus, IntPtr msg, int status);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static int alljoyn_busobject_signal(IntPtr bus,
				[MarshalAs(UnmanagedType.LPStr)] string destination,
				uint sessionId,
				InterfaceDescription._Member signal,
				IntPtr msgArgs, UIntPtr numArgs,
				ushort timeToLive, byte flags, IntPtr msg);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static int alljoyn_busobject_cancelsessionlessmessage_serial(IntPtr bus, uint serialNumber);

			[DllImport(DLL_IMPORT_TARGET)]
			private extern static int alljoyn_busobject_cancelsessionlessmessage(IntPtr bus, IntPtr msg);

			[DllImport(DLL_IMPORT_TARGET)]
			[return: MarshalAs(UnmanagedType.U1)]
			private extern static bool alljoyn_busobject_issecure(IntPtr bus);
			#endregion

			#region IDisposable
			~BusObject()
			{

				Dispose(false);
			}

			/**
			 * Dispose the BusObject
			 * @param disposing	describes if its activly being disposed
			 */
			protected virtual void Dispose(bool disposing)
			{

				if(!_isDisposed)
				{
					Thread destroyThread = new Thread((object o) => {
						alljoyn_busobject_destroy(_busObject);
					});
					destroyThread.Start();
					while(destroyThread.IsAlive)
					{
						AllJoyn.TriggerCallbacks();
						Thread.Sleep(0);
					}
					_busObject = IntPtr.Zero;
					main.Free();
				}
				_isDisposed = true;
			}

			/**
			 * Dispose the BusObject
			 */
			public void Dispose()
			{
				Dispose(true);
				GC.SuppressFinalize(this);
			}
			#endregion

			#region Structs
			[StructLayout(LayoutKind.Sequential)]
			private struct BusObjectCallbacks
			{
				public IntPtr property_get;
				public IntPtr property_set;
				public IntPtr object_registered;
				public IntPtr object_unregistered;
			}

			[StructLayout(LayoutKind.Sequential)]
			private struct MethodEntry
			{
				public IntPtr member;
				public IntPtr method_handler;
			}
			#endregion

			#region Internal Properties
			internal IntPtr UnmanagedPtr
			{
				get
				{
					return _busObject;
				}
			}
			#endregion

			#region Data
			IntPtr _busObject;
			bool _isDisposed = false;

			GCHandle main;
			InternalPropertyGetEventHandler _propertyGet;
			InternalPropertySetEventHandler _propertySet;
			InternalObjectRegisteredEventHandler _objectRegistered;
			InternalObjectUnregisteredEventHandler _objectUnregistered;

			BusObjectCallbacks callbacks;

			List<InternalMethodHandler> _methodHandlerDelegateRefHolder;
			#endregion
		}
	}
}


text:
import 'rxjs'
import 'reflect-metadata'
import '../../node_modules/zone.js/dist/zone.js'


text:
package ca.uhn.fhir.rest.gclient;

import static org.apache.commons.lang3.StringUtils.isNotBlank;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.rest.param.ParamPrefixEnum;
import ca.uhn.fhir.rest.param.ParameterUtil;

class QuantityCriterion implements ICriterion<QuantityClientParam>, ICriterionInternal {

	private String myValue;
	private String myName;
	private String mySystem;
	private String myUnits;
	private ParamPrefixEnum myPrefix;

	public QuantityCriterion(String theParamName, ParamPrefixEnum thePrefix, String theValue, String theSystem, String theUnits) {
		myValue = theValue;
		myPrefix = thePrefix;
		myName = theParamName;
		mySystem = theSystem;
		myUnits = theUnits;
	}

	@Override
	public String getParameterName() {
		return myName;
	}

	@Override
	public String getParameterValue(FhirContext theContext) {
		StringBuilder b = new StringBuilder();
		if (isNotBlank(myValue) || isNotBlank(mySystem) || isNotBlank(myUnits)) {
			if (myPrefix != null) {
				b.append(ParameterUtil.escapeWithDefault(myPrefix.getValueForContext(theContext)));
			}
			b.append(ParameterUtil.escapeWithDefault(myValue));
			b.append('|');
			b.append(ParameterUtil.escapeWithDefault(mySystem));
			b.append('|');
			b.append(ParameterUtil.escapeWithDefault(myUnits));
		}
		return b.toString();
	}

}


text:
using System.Collections.Generic;
using System.IO;
using Microsoft.DotNet.ProjectModel;
using Microsoft.DotNet.ProjectModel.Files;
using Microsoft.DotNet.Tools.Pack;
using NuGet;

namespace Microsoft.DotNet.Tools.Compiler
{
    public class SymbolPackageGenerator: PackageGenerator
    {
        public SymbolPackageGenerator(Project project, string configuration, ArtifactPathsCalculator artifactPathsCalculator)
            : base(project, configuration, artifactPathsCalculator)
        {
        }

        protected override string GetPackageName()
        {
            return $"{Project.Name}.{Project.Version}.symbols";
        }

        protected override void ProcessContext(ProjectContext context)
        {
            base.ProcessContext(context);

            var inputFolder = ArtifactPathsCalculator.InputPathForContext(context);
            var ouptutName =  Project.GetCompilerOptions(context.TargetFramework, Configuration).OutputName;

            TryAddOutputFile(context, inputFolder, $"{ouptutName}.pdb");
            TryAddOutputFile(context, inputFolder, $"{ouptutName}.mdb");
        }

        protected override bool GeneratePackage(string nupkg, List<DiagnosticMessage> packDiagnostics)
        {
            var compilerOptions = Project.GetCompilerOptions(
                Project.GetTargetFramework(targetFramework: null).FrameworkName, Configuration);

            if (compilerOptions.CompileInclude == null)
            {
                foreach (var path in Project.Files.SourceFiles)
                {
                    var srcFile = new PhysicalPackageFile
                    {
                        SourcePath = path,
                        TargetPath = Path.Combine("src", Common.PathUtility.GetRelativePath(Project.ProjectDirectory, path))
                    };

                    PackageBuilder.Files.Add(srcFile);
                }
            }
            else
            {
                var includeFiles = IncludeFilesResolver.GetIncludeFiles(compilerOptions.CompileInclude, "/", diagnostics: null);
                foreach (var entry in includeFiles)
                {
                    var srcFile = new PhysicalPackageFile
                    {
                        SourcePath = entry.SourcePath,
                        TargetPath = Path.Combine("src", entry.TargetPath)
                    };

                    PackageBuilder.Files.Add(srcFile);
                }
            }

            return base.GeneratePackage(nupkg, packDiagnostics);
        }
    }
}