text:
/*
 * sf-Smallscreen v1.2b - Provides small-screen compatibility for the jQuery Superfish plugin.
 *
 * Developer's note:
 * Built as a part of the Superfish project for Drupal (http://drupal.org/project/superfish)
 * Found any bug? have any cool ideas? contact me right away! http://drupal.org/user/619294/contact
 *
 * jQuery version: 1.3.x or higher.
 *
 * Dual licensed under the MIT and GPL licenses:
 *  http://www.opensource.org/licenses/mit-license.php
 *  http://www.gnu.org/licenses/gpl.html
  */

(function($){
  $.fn.sfsmallscreen = function(options){
    options = $.extend({
      mode: 'inactive',
      type: 'accordion',
      breakpoint: 768,
      breakpointUnit: 'px',
      useragent: '',
      title: '',
      addSelected: false,
      menuClasses: false,
      hyperlinkClasses: false,
      excludeClass_menu: '',
      excludeClass_hyperlink: '',
      includeClass_menu: '',
      includeClass_hyperlink: '',
      accordionButton: 1,
      expandText: 'Expand',
      collapseText: 'Collapse'
    }, options);

    // We need to clean up the menu from anything unnecessary.
    function refine(menu){
      var
      refined = menu.clone(),
      // Things that should not be in the small-screen menus.
      rm = refined.find('span.sf-sub-indicator, span.sf-description'),
      // This is a helper class for those who need to add extra markup that shouldn't exist
      // in the small-screen versions.
      rh = refined.find('.sf-smallscreen-remove'),
      // Mega-menus has to be removed too.
      mm = refined.find('ul.sf-megamenu');
      for (var a = 0; a < rh.length; a++){
        rh.eq(a).replaceWith(rh.eq(a).html());
      }
      for (var b = 0; b < rm.length; b++){
        rm.eq(b).remove();
      }
      if (mm.length > 0){
        mm.removeClass('sf-megamenu');
        var ol = refined.find('div.sf-megamenu-column > ol');
        for (var o = 0; o  ol','li.sf-megamenu-wrapper'];
        for (var i = 0; i < elements.length; i++){
          obj = refined.find(elements[i]);
          for (var t = 0; t < obj.length; t++){
            obj.eq(t).replaceWith(obj.eq(t).html());
          }
        }
        refined.find('.sf-megamenu-column').removeClass('sf-megamenu-column');
      }
      refined.add(refined.find('*')).css({width:''});
      return refined;
    }

    // Creating <option> elements out of the menu.
    function toSelect(menu, level){
      var
      items = '',
      childLI = $(menu).children('li');
      for (var a = 0; a < childLI.length; a++){
        var list = childLI.eq(a), parent = list.children('a, span');
        for (var b = 0; b < parent.length; b++){
          var
          item = parent.eq(b),
          path = item.is('a') ? item.attr('href') : '',
          // Class names modification.
          itemClone = item.clone(),
          classes = (options.hyperlinkClasses) ? ((options.excludeClass_hyperlink && itemClone.hasClass(options.excludeClass_hyperlink)) ? itemClone.removeClass(options.excludeClass_hyperlink).attr('class') : itemClone.attr('class')) : '',
          classes = (options.includeClass_hyperlink && !itemClone.hasClass(options.includeClass_hyperlink)) ? ((options.hyperlinkClasses) ? itemClone.addClass(options.includeClass_hyperlink).attr('class') : options.includeClass_hyperlink) : classes;
          // Retaining the active class if requested.
          if (options.addSelected && item.hasClass('active')){
            classes += ' active';
          }
          // <option> has to be disabled if the item is not a link.
          disable = item.is('span') || item.attr('href')=='#' ? ' disabled="disabled"' : '',
          // Crystal clear.
          subIndicator = 1 < level ? Array(level).join('-') + ' ' : '';
          // Preparing the <option> element.
          items += '<option value="' + path + '" class="' + classes + '"' + disable + '>' + subIndicator + $.trim(item.text()) +'</option>',
          childUL = list.find('> ul');
          // Using the function for the sub-menu of this item.
          for (var u = 0; u < childUL.length; u++){
            items += toSelect(childUL.eq(u), level + 1);
          }
        }
      }
      return items;
    }

    // Create the new version, hide the original.
    function convert(menu){
      var menuID = menu.attr('id'),
      // Creating a refined version of the menu.
      refinedMenu = refine(menu);
      // Currently the plugin provides two reactions to small screens.
      // Converting the menu to a <select> element, and converting to an accordion version of the menu.
      if (options.type == 'accordion'){
        var
        toggleID = menuID + '-toggle',
        accordionID = menuID + '-accordion';
        // Making sure the accordion does not exist.
        if ($('#' + accordionID).length == 0){
          var
          // Getting the style class.
          styleClass = menu.attr('class').split(' ').filter(function(item){
            return item.indexOf('sf-style-') > -1 ? item : '';
          }),
          // Creating the accordion.
          accordion = $(refinedMenu).attr('id', accordionID);
          // Removing unnecessary classes.
          accordion.removeClass('sf-horizontal sf-vertical sf-navbar sf-shadow sf-js-enabled');
          // Adding necessary classes.
          accordion.addClass('sf-accordion sf-hidden');
          // Removing style attributes and any unnecessary class.
          accordion.children('li').removeAttr('style').removeClass('sfHover');
          // Doing the same and making sure all the sub-menus are off-screen (hidden).
          accordion.find('ul').removeAttr('style').not('.sf-hidden').addClass('sf-hidden');
          // Creating the accordion toggle switch.
          var toggle = '
' + options.title + '
';

          // Adding Expand\Collapse buttons if requested.
          if (options.accordionButton == 2){
            var parent = accordion.find('li.menuparent');
            for (var i = 0; i < parent.length; i++){
              parent.eq(i).prepend('' + options.expandText + '');
            }
          }
          // Inserting the according and hiding the original menu.
          menu.before(toggle).before(accordion).hide();

          var
          accordionElement = $('#' + accordionID),
          // Deciding what should be used as accordion buttons.
          buttonElement = (options.accordionButton < 2) ? 'a.menuparent,span.nolink.menuparent' : 'a.sf-accordion-button',
          button = accordionElement.find(buttonElement);

          // Attaching a click event to the toggle switch.
          $('#' + toggleID).bind('click', function(e){
            // Preventing the click.
            e.preventDefault();
            // Adding the sf-expanded class.
            $(this).toggleClass('sf-expanded');

            if (accordionElement.hasClass('sf-expanded')){
              // If the accordion is already expanded:
              // Hiding its expanded sub-menus and then the accordion itself as well.
              accordionElement.add(accordionElement.find('li.sf-expanded')).removeClass('sf-expanded')
              .end().find('ul').hide()
              // This is a bit tricky, it's the same trick that has been in use in the main plugin for sometime.
              // Basically we'll add a class that keeps the sub-menu off-screen and still visible,
              // and make it invisible and removing the class one moment before showing or hiding it.
              // This helps screen reader software access all the menu items.
              .end().hide().addClass('sf-hidden').show();
              // Changing the caption of any existing accordion buttons to 'Expand'.
              if (options.accordionButton == 2){
                accordionElement.find('a.sf-accordion-button').text(options.expandText);
              }
            }
            else {
              // But if it's collapsed,
              accordionElement.addClass('sf-expanded').hide().removeClass('sf-hidden').show();
            }
          });

          // Attaching a click event to the buttons.
          button.bind('click', function(e){
            // Making sure the buttons does not exist already.
            if ($(this).closest('li').children('ul').length > 0){
              e.preventDefault();
              // Selecting the parent menu items.
              var parent = $(this).closest('li');
              // Creating and inserting Expand\Collapse buttons to the parent menu items,
              // of course only if not already happened.
              if (options.accordionButton == 1 && parent.children('a.menuparent,span.nolink.menuparent').length > 0 && parent.children('ul').children('li.sf-clone-parent').length == 0){
                var
                // Cloning the hyperlink of the parent menu item.
                cloneLink = parent.children('a.menuparent,span.nolink.menuparent').clone(),
                // Wrapping the hyerplinks in
.
                cloneLink = $('
').html(cloneLink);
                // Adding a helper class and attaching them to the sub-menus.
                parent.children('ul').addClass('sf-has-clone-parent').prepend(cloneLink);
              }
              // Once the button is clicked, collapse the sub-menu if it's expanded.
              if (parent.hasClass('sf-expanded')){
                parent.children('ul').slideUp('fast', function(){
                  // Doing the accessibility trick after hiding the sub-menu.
                  $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show();
                });
                // Changing the caption of the inserted Collapse link to 'Expand', if any is inserted.
                if (options.accordionButton == 2 && parent.children('.sf-accordion-button').length > 0){
                  parent.children('.sf-accordion-button').text(options.expandText);
                }
              }
              // Otherwise, expand the sub-menu.
              else {
                // Doing the accessibility trick and then showing the sub-menu.
                parent.children('ul').hide().removeClass('sf-hidden').slideDown('fast')
                // Changing the caption of the inserted Expand link to 'Collape', if any is inserted.
                .end().addClass('sf-expanded').children('a.sf-accordion-button').text(options.collapseText)
                // Hiding any expanded sub-menu of the same level.
                .end().siblings('li.sf-expanded').children('ul')
                .slideUp('fast', function(){
                  // Doing the accessibility trick after hiding it.
                  $(this).closest('li').removeClass('sf-expanded').end().addClass('sf-hidden').show();
                })
                // Assuming Expand\Collapse buttons do exist, resetting captions, in those hidden sub-menus.
                .parent().children('a.sf-accordion-button').text(options.expandText);
              }
            }
          });
        }
      }
      else {
        var
        // Class names modification.
        menuClone = menu.clone(), classes = (options.menuClasses) ? ((options.excludeClass_menu && menuClone.hasClass(options.excludeClass_menu)) ? menuClone.removeClass(options.excludeClass_menu).attr('class') : menuClone.attr('class')) : '',
        classes = (options.includeClass_menu && !menuClone.hasClass(options.includeClass_menu)) ? ((options.menuClasses) ? menuClone.addClass(options.includeClass_menu).attr('class') : options.includeClass_menu) : classes,
        classes = (classes) ? ' class="' + classes + '"' : '';

        // Making sure the <select> element does not exist already.
        if ($('#' + menuID + '-select').length == 0){
          // Creating the <option> elements.
          var newMenu = toSelect(refinedMenu, 1),
          // Creating the <select> element and assigning an ID and class name.
          selectList = $('<select' + classes + ' id="' + menuID + '-select"/>')
          // Attaching the title and the items to the <select> element.
          .html('<option>' + options.title + '</option>' + newMenu)
          // Attaching an event then.
          .change(function(){
            // Except for the first option that is the menu title and not a real menu item.
            if ($('option:selected', this).index()){
              window.location = selectList.val();
            }
          });
          // Applying the addSelected option to it.
          if (options.addSelected){
            selectList.find('.active').attr('selected', !0);
          }
          // Finally inserting the <select> element into the document then hiding the original menu.
          menu.before(selectList).hide();
        }
      }
    }

    // Turn everything back to normal.
    function turnBack(menu){
      var
      id = '#' + menu.attr('id');
      // Removing the small screen version.
      $(id + '-' + options.type).remove();
      // Removing the accordion toggle switch as well.
      if (options.type == 'accordion'){
        $(id + '-toggle').parent('div').remove();
      }
      // Crystal clear!
      $(id).show();
    }

    // Return original object to support chaining.
    // Although this is unnecessary because of the way the module uses these plugins.
    for (var s = 0; s < this.length; s++){
      var
      menu = $(this).eq(s),
      mode = options.mode;
      // The rest is crystal clear, isn't it? :)
      if (mode == 'always_active'){
        convert(menu);
      }
      else if (mode == 'window_width'){
        var breakpoint = (options.breakpointUnit == 'em') ? (options.breakpoint * parseFloat($('body').css('font-size'))) : options.breakpoint,
        windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth,
        timer;
        if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
          convert(menu);
        }
        else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
          convert(menu);
        }
        $(window).resize(function(){
          clearTimeout(timer);
          timer = setTimeout(function(){
            var windowWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
            if ((typeof Modernizr === 'undefined' || typeof Modernizr.mq !== 'function') && windowWidth < breakpoint){
              convert(menu);
            }
            else if (typeof Modernizr !== 'undefined' && typeof Modernizr.mq === 'function' && Modernizr.mq('(max-width:' + (breakpoint - 1) + 'px)')) {
              convert(menu);
            }
            else {
              turnBack(menu);
            }
          }, 50);
        });
      }
      else if (mode == 'useragent_custom'){
        if (options.useragent != ''){
          var ua = RegExp(options.useragent, 'i');
          if (navigator.userAgent.match(ua)){
            convert(menu);
          }
        }
      }
      else if (mode == 'useragent_predefined' && navigator.userAgent.match(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i)){
        convert(menu);
      }
    }
    return this;
  }
})(jQuery);


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <title>Animation in the GlobeControl</title>

  ## Animation in the GlobeControl

This sample demonstrates how to use camera and layer animation in the GlobeControl by loading a document that contains an animation file or by directly loading an ArcGlobe animation file (*.aga).

This sample also shows how to use the ToolbarControl and TOCControl, which allow you to search and select Globe documents, interact and navigate with the globe using different tools and commands, and turn layers on and off. The TOCControl and ToolbarControl property pages have been used to set the buddy controls and add the globe commands.

```
Language:              C#, VB
Subject:               Controls
Organization:          Esri, http://www.esri.com
Date:                  10/17/2019
ArcObjects SDK:        10.8
Visual Studio:         2017, 2019
.NET Target Framework: 4.5
```

### Resources

* [ArcObjects .NET API Reference online](http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm)
* [Sample Data Download](../../releases)
* [What's new](http://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#91cabc68-2271-400a-8ff9-c7fb25108546.htm)
* [Download the ArcObjects SDK for .Net from MyEsri.com](https://my.esri.com/)

### Usage
1. Open a globe document that contains animation or load the sample animation file (from the provided data folder).
1. Run play animation for a certain duration (default 10 seconds) or a number of iterations (default 500).

#### Additional information

When a document containing an animation file (.aga) is loaded into the GlobeControl (using the IGlobeControl.Load3dFile method), you can play the animation for the set amount of time (duration) or for a number of iterations. The sample also demonstrates how to loop an animation (cycles). In addition, you can directly load an animation file using the Load Animation File command button of the sample (using the IBasicScene.LoadAnimation method).

The two radio buttons indicate whether the animation will be played for the set duration or for the number of iterations. The Cycles text box indicates the number of times the animation plays. The sample demonstrates how to use the IGlobeControl.Load3dFile, IBasicScene.LoadAnimation, IAnimationTracks.ApplyTracks, and IAnimationTrack.InterpolateObjectProperties methods. In addition, the sample also illustrates how to access and manipulate different keyframes (IKeyframe) of different animation types (IAnimationTrack.AnimationType) in an animation track.

#### See Also
[GlobeControl class](http://desktop.arcgis.com/search/?q=GlobeControl%20class&p=0&language=en&product=arcobjects-sdk-dotnet&version=&n=15&collection=help)
[IGlobeControl interface](http://desktop.arcgis.com/search/?q=IGlobeControl%20interface&p=0&language=en&product=arcobjects-sdk-dotnet&version=&n=15&collection=help)

---------------------------------

#### Licensing

 Development licensing 	 Deployment licensing

 Engine Developer Kit 	 Engine: 3D Analyst

  	 ArcGIS Desktop Basic: 3D Analyst

  	 ArcGIS Desktop Standard: 3D Analyst

  	 ArcGIS Desktop Advanced: 3D Analyst

redpajama_set_name: RedPajamaGithub


text:
package org.scalajs.testsuite.javalib.util

import org.junit.Test
import org.junit.Assert._

import java.{util => ju}

import scala.collection.JavaConverters._

class HashtableTest {

  @Test def size(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertEquals(0, ht.size())
    ht.put(1, 1)
    assertEquals(1, ht.size())
    ht.put(2, 1)
    ht.put(3, 1)
    assertEquals(3, ht.size())
    ht.put(3, 2)
    assertEquals(3, ht.size())
    ht.remove(1)
    assertEquals(2, ht.size())
    ht.clear()
    assertEquals(0, ht.size())
  }

  @Test def isEmpty(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertTrue(ht.isEmpty)
    ht.put(3, 1)
    assertFalse(ht.isEmpty)
    ht.clear()
    assertTrue(ht.isEmpty)
  }

  @Test def keys(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertEquals(Set.empty[Int], ht.keys().asScala.toSet)
    ht.put(1, 4)
    assertEquals(Set(1), ht.keys().asScala.toSet)
    ht.put(2, 5)
    ht.put(3, 6)
    assertEquals(Set(1, 2, 3), ht.keys().asScala.toSet)
  }

  @Test def elements(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertEquals(Set.empty[Int], ht.elements().asScala.toSet)
    ht.put(1, 4)
    assertEquals(Set(4), ht.elements().asScala.toSet)
    ht.put(2, 5)
    ht.put(3, 6)
    assertEquals(Set(4, 5, 6), ht.elements().asScala.toSet)
  }

  @Test def contains(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertFalse(ht.contains(4))
    assertFalse(ht.contains(5))
    assertFalse(ht.contains(6))
    ht.put(1, 4)
    assertTrue(ht.contains(4))
    assertFalse(ht.contains(5))
    assertFalse(ht.contains(6))
    ht.put(2, 5)
    ht.put(3, 6)
    assertTrue(ht.contains(4))
    assertTrue(ht.contains(5))
    assertTrue(ht.contains(6))
  }

  @Test def containsValue(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertFalse(ht.containsValue(4))
    assertFalse(ht.containsValue(5))
    assertFalse(ht.containsValue(6))
    ht.put(1, 4)
    assertTrue(ht.containsValue(4))
    assertFalse(ht.containsValue(5))
    assertFalse(ht.containsValue(6))
    ht.put(2, 5)
    ht.put(3, 6)
    assertTrue(ht.containsValue(4))
    assertTrue(ht.containsValue(5))
    assertTrue(ht.containsValue(6))
  }

  @Test def containsKey(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertFalse(ht.containsKey(1))
    assertFalse(ht.containsKey(2))
    assertFalse(ht.containsKey(3))
    ht.put(1, 4)
    assertTrue(ht.containsKey(1))
    assertFalse(ht.containsKey(2))
    assertFalse(ht.containsKey(3))
    ht.put(2, 5)
    ht.put(3, 6)
    assertTrue(ht.containsKey(1))
    assertTrue(ht.containsKey(2))
    assertTrue(ht.containsKey(3))
  }

  @Test def get(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertEquals(null, ht.get(1))
    assertEquals(null, ht.get(2))
    assertEquals(null, ht.get(3))
    ht.put(1, 4)
    assertEquals(4, ht.get(1))
    assertEquals(null, ht.get(2))
    assertEquals(null, ht.get(3))
    ht.put(2, 5)
    ht.put(3, 6)
    assertEquals(4, ht.get(1))
    assertEquals(5, ht.get(2))
    assertEquals(6, ht.get(3))
  }

  @Test def put(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertEquals(null, ht.put(1, 4))
    assertEquals(4, ht.put(1, 3))
    assertEquals(3, ht.put(1, 5))
    assertEquals(null, ht.put(2, 5))
    assertEquals(2, ht.size)
  }

  @Test def remove(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    ht.put(1, 4)
    ht.put(2, 5)
    ht.put(3, 6)
    assertEquals(null, ht.remove(0))
    assertEquals(4, ht.remove(1))
    assertEquals(null, ht.remove(1))
    assertEquals(5, ht.remove(2))
    assertEquals(6, ht.remove(3))
  }

  @Test def clear(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    ht.put(1, 4)
    ht.put(2, 5)
    ht.put(3, 6)
    assertFalse(ht.isEmpty)
    ht.clear()
    assertTrue(ht.isEmpty)
    ht.put(1, 4)
    ht.clear()
    assertTrue(ht.isEmpty)
  }

  @Test def cloneTest(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    ht.put(1, 4)
    ht.put(2, 5)
    ht.put(3, 6)

    assertTrue(ht.clone().isInstanceOf[ju.Hashtable[_, _]])
    val clone = ht.clone().asInstanceOf[ju.Hashtable[Int, Int]]
    ht.clear()
    assertEquals(3, clone.size)
    assertEquals(4, clone.get(1))
    assertEquals(5, clone.get(2))
    assertEquals(6, clone.get(3))
  }

  @Test def toStringTest(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertEquals("{}", ht.toString)
    ht.put(1, 4)
    assertEquals("{1=4}", ht.toString)
    ht.put(2, 4)
    assertTrue(ht.toString.matches("\\{\\d=\\d, \\d=\\d\\}"))
    ht.put(3, 5)
    assertTrue(ht.toString.matches("\\{\\d=\\d, \\d=\\d, \\d=\\d\\}"))
  }

  @Test def keySet(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertEquals(Set.empty[Int], ht.keySet().asScala.toSet)
    ht.put(1, 4)
    assertEquals(Set(1), ht.keySet().asScala.toSet)
    ht.put(2, 5)
    assertEquals(Set(1, 2), ht.keySet().asScala.toSet)
    ht.put(3, 6)
    assertEquals(Set(1, 2, 3), ht.keySet().asScala.toSet)
  }

  @Test def entrySet(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    val entrySet = ht.entrySet()

    assertTrue(entrySet.isEmpty)
    ht.put(1, 4)
    assertEquals(Set(1), entrySet.asScala.map(_.getKey))
    assertEquals(Set(4), entrySet.asScala.map(_.getValue))
    ht.put(2, 5)
    assertEquals(Set(1, 2), entrySet.asScala.map(_.getKey))
    assertEquals(Set(4, 5), entrySet.asScala.map(_.getValue))
    ht.put(3, 6)
    assertEquals(Set(1, 2, 3), entrySet.asScala.map(_.getKey))
    assertEquals(Set(4, 5, 6), entrySet.asScala.map(_.getValue))

    // Directly test the iterator, including its mutation capabilities

    val allKeys = Set(1, 2, 3)

    val iter = entrySet.iterator()
    assertTrue(iter.hasNext())
    val firstEntry = iter.next()
    val firstKey = firstEntry.getKey()
    val expectedFirstValue = ht.get(firstKey)
    assertTrue(allKeys.contains(firstKey))
    assertEquals(expectedFirstValue, firstEntry.getValue())
    assertEquals(expectedFirstValue, firstEntry.setValue(42))
    assertEquals(42, ht.get(firstKey))
    assertEquals(42, firstEntry.getValue())

    assertTrue(iter.hasNext())
    val secondEntry = iter.next()
    val secondKey = secondEntry.getKey()
    assertTrue((allKeys - firstKey).contains(secondKey))
    iter.remove()

    assertTrue(iter.hasNext())
    val thirdEntry = iter.next()
    val thirdKey = thirdEntry.getKey()
    assertTrue((allKeys - firstKey - secondKey).contains(thirdKey))
    assertEquals(ht.get(thirdKey), thirdEntry.getValue())

    assertFalse(iter.hasNext())
    assertEquals(allKeys - secondKey, entrySet.asScala.map(_.getKey))
    assertTrue(ht.containsKey(firstKey) && ht.containsKey(thirdKey))
    assertFalse(ht.containsKey(secondKey))
  }

  @Test def values(): Unit = {
    val ht = new ju.Hashtable[Int, Int]
    assertEquals(Set.empty[Int], ht.values().asScala.toSet)
    ht.put(1, 4)
    assertEquals(Set(4), ht.values().asScala.toSet)
    ht.put(2, 5)
    assertEquals(Set(4, 5), ht.values().asScala.toSet)
    ht.put(3, 6)
    assertEquals(Set(4, 5, 6), ht.values().asScala.toSet)
  }
}


text:
table.layout-table  {width:100%; border-collapse:separate; margin-top: 8px;}
table.layout-table td  {border: 0;}
table.layout-table #region-main-wrap  {padding-left:12px; padding-right:12px;vertical-align:top;width: auto;}
table.layout-table #region-pre,
table.layout-table #region-post {vertical-align:top;width: 12em;}

table.layout-table #region-pre .block,
table.layout-table #region-post .block {position:relative;width:100%;}
table.layout-table #region-pre .block .header,
table.layout-table #region-post .block .header {width:100%;}


text:
<?php

$this->setProperty('status', 1);
$this->callMethod('enable');


text:
package se.sics.cooja.mspmote.interfaces;

import java.util.ArrayDeque;
import java.util.Collection;

import org.apache.log4j.Logger;
import org.jdom.Element;

import se.sics.cooja.COOJARadioPacket;
import se.sics.cooja.ClassDescription;
import se.sics.cooja.Mote;
import se.sics.cooja.MoteTimeEvent;
import se.sics.cooja.RadioPacket;
import se.sics.cooja.Simulation;
import se.sics.cooja.TimeEvent;
import se.sics.cooja.interfaces.CustomDataRadio;
import se.sics.cooja.interfaces.Position;
import se.sics.cooja.interfaces.Radio;
import se.sics.cooja.mspmote.MspMote;
import se.sics.cooja.mspmote.MspMoteTimeEvent;
import se.sics.mspsim.core.IOUnit;
import se.sics.mspsim.core.USART;
import se.sics.mspsim.core.USARTListener;
import se.sics.mspsim.core.USARTSource;

/**
 * TR1001 radio interface on ESB platform.
 * Assumes Contiki driver specifics such as preambles, synchbytes, GCR coding, CRC16.
 *
 * @author Fredrik Osterlind
 */
@ClassDescription("TR1001 Radio")
public class TR1001Radio extends Radio implements USARTListener, CustomDataRadio {
  private static Logger logger = Logger.getLogger(TR1001Radio.class);

  /**
   * Cross-level:
   * Delay used when feeding packet data to radio chip (us).
   * 416us corresponds to 19200 bit/s with encoding.
   */
  public static final long DELAY_BETWEEN_BYTES = 416;

  /* The data used when transmission is interfered */
  private static final Byte CORRUPTED_DATA = (byte) 0xff;

  private MspMote mote;

  private boolean isTransmitting = false;
  private boolean isReceiving = false;
  private boolean isInterfered = false;

  private RadioEvent lastEvent = RadioEvent.UNKNOWN;
  private long lastEventTime = 0;

  private USART radioUSART = null;

  private RadioPacket receivedPacket = null;
  private RadioPacket sentPacket = null;

  private byte receivedByte, sentByte;

  private TR1001RadioPacketConverter tr1001PacketConverter = null;

  private boolean radioOn = true; /* TODO MSPSim: Not implemented */
  private double signalStrength = 0;  /* TODO MSPSim: Not implemented */

  /**
   * Creates an interface to the TR1001 radio at mote.
   *
   * @param mote Mote
   */
  public TR1001Radio(Mote mote) {
    this.mote = (MspMote) mote;

    /* Start listening to CPU's USART */
    IOUnit usart = this.mote.getCPU().getIOUnit("USART 0");
    if (usart != null && usart instanceof USART) {
      radioUSART = (USART) usart;
      radioUSART.addUSARTListener(this);
    } else {
      throw new RuntimeException("Bad TR1001 IO: " + usart);
    }
  }

  /* Packet radio support */
  public RadioPacket getLastPacketTransmitted() {
    return sentPacket;
  }

  public RadioPacket getLastPacketReceived() {
    return receivedPacket;
  }

  public void setReceivedPacket(RadioPacket packet) {
    receivedPacket = packet;

    /* Convert to TR1001 packet data */
    byte[] arr = TR1001RadioPacketConverter.fromCoojaToTR1001(packet);
    final ArrayDeque<Byte> data = new ArrayDeque<Byte>();
    for (Byte b : arr) {
      data.addLast(b);
    }

    /* Feed incoming bytes to radio "slowly" via time events */
    TimeEvent receiveCrosslevelDataEvent = new MspMoteTimeEvent(mote, 0) {
      public void execute(long t) {
        super.execute(t);

        /* Stop receiving data when buffer is empty */
        if (data.isEmpty()) {
          return;
        }

        byte b = data.pop();
        if (isInterfered) {
          radioUSART.byteReceived(0xFF); /* Corrupted data */
        } else {
          radioUSART.byteReceived(b);
        }
        mote.requestImmediateWakeup();

        mote.getSimulation().scheduleEvent(this, t + DELAY_BETWEEN_BYTES);
      }
    };
    receiveCrosslevelDataEvent.execute(mote.getSimulation().getSimulationTime());
  }

  /* Custom data radio support */
  public Object getLastCustomDataTransmitted() {
    return sentByte;
  }

  public Object getLastCustomDataReceived() {
    return receivedByte;
  }

  public void receiveCustomData(Object data) {
    if (!(data instanceof Byte)) {
      logger.fatal("Received bad custom data: " + data);
      return;
    }

    receivedByte = isInterfered ? CORRUPTED_DATA : (Byte) data;

    final byte finalByte = receivedByte;
    mote.getSimulation().scheduleEvent(new MspMoteTimeEvent(mote, 0) {
      public void execute(long t) {
        super.execute(t);

        if (radioUSART.isReceiveFlagCleared()) {
          /*logger.info("----- TR1001 RECEIVED BYTE -----");*/
          radioUSART.byteReceived(finalByte);
        } else {
          logger.warn(mote.getSimulation().getSimulationTime() + ": ----- TR1001 RECEIVED BYTE DROPPED -----");
        }
        mote.requestImmediateWakeup();
      }
    }, mote.getSimulation().getSimulationTime());
  }

  /* USART listener support */
  public void dataReceived(USARTSource source, int data) {
    if (!isTransmitting()) {
      /* New transmission discovered */
      /*logger.info("----- NEW TR1001 TRANSMISSION DETECTED -----");*/
      tr1001PacketConverter = new TR1001RadioPacketConverter();

      lastEvent = RadioEvent.TRANSMISSION_STARTED;
      lastEventTime = mote.getSimulation().getSimulationTime();
      isTransmitting = true;
      this.setChanged();
      this.notifyObservers();

      /* Timeout transmission after some time */
      if (timeoutTransmission.isScheduled()) {
        logger.warn("Timeout TX event already scheduled");
        timeoutTransmission.remove();
      }
      mote.getSimulation().scheduleEvent(
          timeoutTransmission,
          mote.getSimulation().getSimulationTime() + 40*Simulation.MILLISECOND
      );
    }

    /* Deliver custom data byte */
    lastEvent = RadioEvent.CUSTOM_DATA_TRANSMITTED;
    sentByte = (byte) data;
    this.setChanged();
    this.notifyObservers();

    /* Detect full packet */
    boolean finished = tr1001PacketConverter.fromTR1001ToCoojaAccumulated(sentByte);
    if (finished) {
      timeoutTransmission.remove();

      /* Transmission finished - deliver packet immediately */
      if (tr1001PacketConverter.accumulatedConversionIsOk()) {
        /* Deliver packet */
        /* logger.info("----- TR1001 DELIVERED PACKET -----"); */
        sentPacket = tr1001PacketConverter.getAccumulatedConvertedCoojaPacket();
        lastEvent = RadioEvent.PACKET_TRANSMITTED;
        this.setChanged();
        this.notifyObservers();
      }

      /* Finish transmission */
      isTransmitting = false;
      lastEvent = RadioEvent.TRANSMISSION_FINISHED;
      TR1001Radio.this.setChanged();
      TR1001Radio.this.notifyObservers();
      /* logger.info("----- TR1001 TRANSMISSION ENDED -----"); */
    }
  }

  /* General radio support */
  public boolean isTransmitting() {
    return isTransmitting;
  }

  public boolean isReceiving() {
    return isReceiving;
  }

  public boolean isInterfered() {
    return isInterfered;
  }

  public int getChannel() {
    /* TODO Implement */
    return -1;
  }

  public void signalReceptionStart() {
    lastEvent = RadioEvent.RECEPTION_STARTED;
    isReceiving = true;
    isInterfered = false;
    this.setChanged();
    this.notifyObservers();
  }

  public void signalReceptionEnd() {
    isInterfered = false;
    isReceiving = false;
    lastEvent = RadioEvent.RECEPTION_FINISHED;
    this.setChanged();
    this.notifyObservers();
  }

  public RadioEvent getLastEvent() {
    return lastEvent;
  }

  public void interfereAnyReception() {
    if (!isInterfered()) {
      isInterfered = true;
      receivedPacket = null;

      lastEventTime = mote.getSimulation().getSimulationTime();
      lastEvent = RadioEvent.RECEPTION_INTERFERED;
      /*logger.info("----- TR1001 RECEPTION INTERFERED -----");*/
      this.setChanged();
      this.notifyObservers();
    }
  }

  public double getCurrentOutputPower() {
    // TODO Implement method
    return 0;
  }

  public int getOutputPowerIndicatorMax() {
    return 100;
  }

  public int getCurrentOutputPowerIndicator() {
    // TODO Implement output power indicator
    return 100;
  }

  public double getCurrentSignalStrength() {
    return signalStrength;
  }

  public void setCurrentSignalStrength(double signalStrength) {
    this.signalStrength = signalStrength;
  }

  public Position getPosition() {
    return mote.getInterfaces().getPosition();
  }

  private TimeEvent timeoutTransmission = new MoteTimeEvent(mote, 0) {
    public void execute(long t) {
      if (!isTransmitting()) {
        /* Nothing to do */
        return;
      }

      logger.warn("TR1001 transmission timed out, delivering empty packet");

      /* XXX Timeout: We may need to deliver an empty radio packet here */
      sentPacket = new COOJARadioPacket(new byte[0]);
      lastEvent = RadioEvent.PACKET_TRANSMITTED;
      TR1001Radio.this.setChanged();
      TR1001Radio.this.notifyObservers();

      isTransmitting = false;
      lastEvent = RadioEvent.TRANSMISSION_FINISHED;
      TR1001Radio.this.setChanged();
      TR1001Radio.this.notifyObservers();
    }
  };

  public Collection<Element> getConfigXML() {
    return null;
  }

  public void setConfigXML(Collection<Element> configXML, boolean visAvailable) {
  }

  public Mote getMote() {
    return mote;
  }

  public boolean isRadioOn() {
    /* TODO Implement me */
    return true;
  }
}


text:
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

class Always
  def can_handle?(response)
    true
  end
end
class Never
  def can_handle?(response)
    false
  end
end

describe Medie do

  it "should return acceptable registries" do

    handler = Always.new
    registry = Medie::Registry.new.use(handler)
    registry.for("anything").should == handler

  end

  it "should return nil if there is no handler available" do

    registry = Medie::Registry.new.use(Never.new)
    registry.for("anything").should be_nil

  end

  it "should always use the most recent registered handler" do

    handler = Always.new
    registry = Medie::Registry.new
    registry.use(Always.new)
    registry.use(handler)
    registry.for("anything").should == handler

  end

end


text:
FactoryGirl.define do
  factory :person do
    archetypeid 'openEHR-EHR-DEMOGRAPHIC.party.v1'
    path '/'
    name 'party'
    uid '1sadf3'
  end
end


text:
layout: post
title:  "Get CiviCRM version"
image: ''
date:   2016-10-22 00:06:31
tags:
- system-utilities
description: ''
categories:
- CiviCRM System Utilities
serie: learn
---

To get Current installed CiviCRM version :

```php?start_inline=1
$civicrmVersion = CRM_Utils_System::version();
```

To get only the first two parts (eg. 4.7) :

```php?start_inline=1
$civicrmVersion = CRM_Utils_System::majorVersion();
```


text:
using System;
using System.Collections.Generic;
using System.Globalization;

namespace Blog.Model.Identity
{
     public class ApplicationAuthenticationDescription
    {
        private const string CAPTION_PROPERTY_KEY = "Caption";
        private const string AUTHENTICATION_TYPE_PROPERTY_KEY = "AuthenticationType";

        public ApplicationAuthenticationDescription()
        {
            Properties = new Dictionary<string, object>(StringComparer.Ordinal);
        }

        public ApplicationAuthenticationDescription(IDictionary<string, object> properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException("properties");
            }
            Properties = properties;
        }

        public IDictionary<string, object> Properties { get; private set; }

        public string AuthenticationType
        {
            get { return GetString(AUTHENTICATION_TYPE_PROPERTY_KEY); }
            set { Properties[AUTHENTICATION_TYPE_PROPERTY_KEY] = value; }
        }

        public string Caption
        {
            get { return GetString(CAPTION_PROPERTY_KEY); }
            set { Properties[CAPTION_PROPERTY_KEY] = value; }
        }

        private string GetString(string name)
        {
            object value;
            if (Properties.TryGetValue(name, out value))
            {
                return Convert.ToString(value, CultureInfo.InvariantCulture);
            }
            return null;
        }
    }
}


text:
package im.actor.runtime.markdown;

import im.actor.runtime.RegExpRuntimeProvider;
import im.actor.runtime.regexp.MatcherCompat;
import im.actor.runtime.regexp.PatternCompat;

/**
 * Commonly used regular expression patterns.
 */
public class Patterns {
    private static final RegExpRuntimeProvider regExpProvider = new RegExpRuntimeProvider();

    /**
     * Good characters for Internationalized Resource Identifiers (IRI).
     * This comprises most common used Unicode characters allowed in IRI
     * as detailed in RFC 3987.
     * Specifically, those two byte Unicode characters are not included.
     */
    public static final String GOOD_IRI_CHAR =
            "a-zA-Z0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF";
    private static final String IP_ADDRESS_CHAR = "((25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9])\\.(25[0-5]|2[0-4]"
            + "[0-9]|[0-1][0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1]"
            + "[0-9]{2}|[1-9][0-9]|[1-9]|0)\\.(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}"
            + "|[1-9][0-9]|[0-9]))";
    public static final PatternCompat IP_ADDRESS = regExpProvider.getPattern(IP_ADDRESS_CHAR);
    /**
     * RFC 1035 Section 2.3.4 limits the labels to a maximum 63 octets.
     */
    private static final String IRI
            = "[" + GOOD_IRI_CHAR + "]([" + GOOD_IRI_CHAR + "\\-]{0,61}[" + GOOD_IRI_CHAR + "]){0,1}";
    private static final String GOOD_GTLD_CHAR =
            "a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF";
    private static final String GTLD = "[" + GOOD_GTLD_CHAR + "]{2,63}";
    private static final String HOST_NAME = "(" + IRI + "\\.)+" + GTLD;

    private static final String DOMAIN_NAME_CHAR = "(" + HOST_NAME + "|" + IP_ADDRESS_CHAR + ")";
    public static final PatternCompat DOMAIN_NAME = regExpProvider.getPattern(DOMAIN_NAME_CHAR);

    public static final String WEB_URL_CHAR = "((?:(http|https|Http|Https|rtsp|Rtsp):\\/\\/(?:(?:[a-zA-Z0-9\\$\\-\\_\\.\\+\\!\\*\\'\\(\\)"
            + "\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,64}(?:\\:(?:[a-zA-Z0-9\\$\\-\\_"
            + "\\.\\+\\!\\*\\'\\(\\)\\,\\;\\?\\&\\=]|(?:\\%[a-fA-F0-9]{2})){1,25})?\\@)?)?"
            + "(?:" + DOMAIN_NAME_CHAR + ")"
            + "(?:\\:\\d{1,5})?)" // plus option port number
            + "(\\/(?:(?:[" + GOOD_IRI_CHAR + "\\;\\/\\?\\:\\@\\&\\=\\#\\~"  // plus option query params
            + "\\-\\.\\+\\!\\*\\'\\(\\)\\,\\_])|(?:\\%[a-fA-F0-9]{2}))*)?"
            + "(?:\\b|$)"; // and finally, a word boundary or end of

    public static final String WEB_URL_START_CHAR = "^" + WEB_URL_CHAR;

    /**
     *  Regular expression pattern to match most part of RFC 3987
     *  Internationalized URLs, aka IRIs.  Commonly used Unicode characters are
     *  added.
     */
    public static final PatternCompat WEB_URL = regExpProvider.getPattern(WEB_URL_CHAR);
    public static final PatternCompat WEB_URL_START = regExpProvider.getPattern(WEB_URL_START_CHAR);

    // input.  This is to stop foo.sure from
    // matching as foo.su
    public static final PatternCompat EMAIL_ADDRESS
            = regExpProvider.getPattern(
            "[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" +
                    "\\@" +
                    "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" +
                    "(" +
                    "\\." +
                    "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" +
                    ")+"
    );
    /**
     * This pattern is intended for searching for things that look like they
     * might be phone numbers in arbitrary text, not for validating whether
     * something is in fact a phone number.  It will miss many things that
     * are legitimate phone numbers.
     *
     *
 The pattern matches the following:
     *

     *
Optionally, a + sign followed immediately by one or more digits. Spaces, dots, or dashes
     * may follow.
     *
Optionally, sets of digits in parentheses, separated by spaces, dots, or dashes.
     *
A string starting and ending with a digit, containing digits, spaces, dots, and/or dashes.
     *

     */
    public static final PatternCompat PHONE
            = regExpProvider.getPattern(    // sdd = space, dot, or dash
            "(\\+[0-9]+[\\- \\.]*)?"        // +<digits><sdd>*
                    + "(\\([0-9]+\\)[\\- \\.]*)?"   // (<digits>)<sdd>*
                    + "([0-9][0-9\\- \\.]+[0-9])"); // <digit><digit|sdd>+<digit>
    /**
     *  Convenience method to take all of the non-null matching groups in a
     *  regex Matcher and return them as a concatenated string.
     *
     *  @param matcher      The Matcher object from which grouped text will
     *                      be extracted
     *
     *  @return             A String comprising all of the non-null matched
     *                      groups concatenated together
     */
    public static final String concatGroups(MatcherCompat matcher) {
        StringBuilder b = new StringBuilder();
        final int numGroups = matcher.groupCount();
        for (int i = 1; i <= numGroups; i++) {
            String s = matcher.group(i);
            if (s != null) {
                b.append(s);
            }
        }
        return b.toString();
    }
    /**
     * Convenience method to return only the digits and plus signs
     * in the matching string.
     *
     * @param matcher      The Matcher object from which digits and plus will
     *                     be extracted
     *
     * @return             A String comprising all of the digits and plus in
     *                     the match
     */
    public static final String digitsAndPlusOnly(MatcherCompat matcher) {
        StringBuilder buffer = new StringBuilder();
        String matchingRegion = matcher.group();
        for (int i = 0, size = matchingRegion.length(); i < size; i++) {
            char character = matchingRegion.charAt(i);
            if (character == '+' || Character.isDigit(character)) {
                buffer.append(character);
            }
        }
        return buffer.toString();
    }
    /**
     * Do not create this static utility class.
     */
    private Patterns() {}
}


text:
<?php
/*
 * Third party plugins that hijack the theme will call wp_footer() to get the footer template.
 * We use this to end our output buffer (started in header.php) and render into the view/page-plugin.twig template.
 */
$timberContext = $GLOBALS['timberContext'];
if ( ! isset( $timberContext ) ) {
	throw new \Exception( 'Timber context not set in footer.' );
}
$timberContext['content'] = ob_get_contents();
ob_end_clean();
$templates = array( 'page-plugin.twig' );
Timber::render( $templates, $timberContext );


text:
class assert {
	enumeration {NONE=3, FALSE=2, TRUE=1, INIT=0} status; // desired outcome of assert test
	char1024 target; // the target property to test
	char32 part; // the target property part to test
	enumeration {outside=7, inside=6, !==3, >==2, >=5, <==1, <=4, ===0} relation; // the relation to use for the test
	char1024 value; // the value to compare with for binary tests
	char1024 within; // the bounds within which the value must bed compared
	char1024 lower; // the lower bound to compare with for interval tests
	char1024 upper; // the upper bound to compare with for interval tests
}

class assert {
	enumeration {NONE=3, FALSE=2, TRUE=1, INIT=0} status; // desired outcome of assert test
	char1024 target; // the target property to test
	char32 part; // the target property part to test
	enumeration {outside=7, inside=6, !==3, >==2, >=5, <==1, <=4, ===0} relation; // the relation to use for the test
	char1024 value; // the value to compare with for binary tests
	char1024 within; // the bounds within which the value must bed compared
	char1024 lower; // the lower bound to compare with for interval tests
	char1024 upper; // the upper bound to compare with for interval tests
}

class complex_assert {
	enumeration {ASSERT_NONE=3, ASSERT_FALSE=2, ASSERT_TRUE=1} status; // Conditions for the assert checks
	enumeration {ONCE_DONE=2, ONCE_TRUE=1, ONCE_FALSE=0} once; // Conditions for a single assert check
	enumeration {ANGLE=4, MAGNITUDE=3, IMAGINARY=2, REAL=1, FULL=0} operation; // Complex operation for the comparison
	complex value; // Value to assert
	double within; // Tolerance for a successful assert
	char1024 target; // Property to perform the assert upon
}

class double_assert {
	enumeration {ASSERT_NONE=3, ASSERT_FALSE=2, ASSERT_TRUE=1} status; // Conditions for the assert checks
	enumeration {ONCE_DONE=2, ONCE_TRUE=1, ONCE_FALSE=0} once; // Conditions for a single assert check
	enumeration {WITHIN_RATIO=1, WITHIN_VALUE=0} within_mode; // Method of applying tolerance
	double value; // Value to assert
	double within; // Tolerance for a successful assert
	char1024 target; // Property to perform the assert upon
}

class enum_assert {
	enumeration {ASSERT_NONE=3, ASSERT_FALSE=2, ASSERT_TRUE=1} status; // Conditions for the assert checks
	int32 value; // Value to assert
	char1024 target; // Property to perform the assert upon
}


text:
using System;

namespace Orleans.CodeGeneration
{
    /// <summary>
    /// Data object holding metadata associated with a grain Invoke request.
    /// </summary>
    [Serializable]
    public sealed class InvokeMethodRequest
    {
        /// <summary> InterfaceId for this Invoke request. </summary>
        public int InterfaceId { get; private set; }
        /// <summary> MethodId for this Invoke request. </summary>
        public int MethodId { get; private set; }
        /// <summary> Arguments for this Invoke request. </summary>
        public object[] Arguments { get; private set; }

        internal InvokeMethodRequest(int interfaceId, int methodId, object[] arguments)
        {
            InterfaceId = interfaceId;
            MethodId = methodId;
            Arguments = arguments;
        }

        /// <summary>
        /// String representation for this Invoke request.
        /// </summary>
        /// <remarks>
        /// Note: This is not the serialized wire form of this Invoke request.
        /// </remarks>
        public override string ToString()
        {
            return String.Format("InvokeMethodRequest {0}:{1}", InterfaceId, MethodId);
        }
    }

    /// <summary>
    /// Invoke options for an <c>InvokeMethodRequest</c>
    /// </summary>
    /// <remarks>
    /// These flag values are used in Orleans generated invoker code, and should not be altered. </remarks>
    [Flags]
    public enum InvokeMethodOptions
    {
        None = 0,

        OneWay = 0x04,
        ReadOnly = 0x08,
        Unordered = 0x10,
        DelayForConsistency = 0x20,
        AlwaysInterleave = 0x100, // AlwaysInterleave is a requst type that can interleave with any other request type, including write request.
    }
}


text:
<#
    .SYNOPSIS
    Deploy module to PowerShellGallery.
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "Success")]
[CmdletBinding(DefaultParameterSetName = 'ModuleName')]
Param
(
    # The name of the installed module to be deployed, if not provided the name of the .psm1 file in the parent folder is used.
    [Parameter(ParameterSetName = 'ModuleName')]
    [ValidateNotNullOrEmpty()]
    [String]$ModuleName,

    # Publish module from path (module folder), if not provided -ModuleName is used.
    [Parameter(Mandatory, ParameterSetName = 'Path')]
    [ValidateNotNullOrEmpty()]
    [String]$Path,

    # Key for PowerShellGallery deployment, if not provided $env:NugetApiKey is used.
    [ValidateNotNullOrEmpty()]
    [String]$NugetApiKey,

    # Skip Version verification for PowerShellGallery deployment, can be used for first release.
    [Switch]$Force
)
$ErrorActionPreference = 'Stop'

if ($Path) {
    $Path = Resolve-Path -Path $Path
    if ($Path.Count -ne 1) {
        throw ('Invalid Path, $Path.Count: {0}.' -f $Path.Count)
    }
    $Psd1Path = (Get-ChildItem -File -Filter *.psd1 -Path $Path -Recurse)[0].FullName
    $ModuleName = [System.IO.Path]::GetFileNameWithoutExtension($Psd1Path)
    $VersionLocal = (. ([Scriptblock]::Create((Get-Content -Path $Psd1Path | Out-String)))).ModuleVersion
}
else {
    # Get Script Root
    if ($PSScriptRoot) {
        $ScriptRoot = $PSScriptRoot
    }
    elseif ($psISE.CurrentFile.IsUntitled -eq $false) {
        $ScriptRoot = Split-Path -Path $psISE.CurrentFile.FullPath
    }
    elseif ($null -ne $psEditor.GetEditorContext().CurrentFile.Path -and $psEditor.GetEditorContext().CurrentFile.Path -notlike 'untitled:*') {
        $ScriptRoot = Split-Path -Path $psEditor.GetEditorContext().CurrentFile.Path
    }
    else {
        $ScriptRoot = '.'
    }

    # Get Module Info
    if (!$ModuleName) {
        $ModuleName = [System.IO.Path]::GetFileNameWithoutExtension((Get-ChildItem -File -Filter *.psm1 -Name -Path (Split-Path $ScriptRoot)))
    }
    $VersionLocal = ((Get-Module -Name $ModuleName -ListAvailable).Version | Measure-Object -Maximum).Maximum
}

"[Progress] Deploy Script Start for Module: $ModuleName, Version: $VersionLocal."

# Deploy to PowerShell Gallery if run locally OR from AppVeyor & GitHub master
if (!$env:APPVEYOR -or $env:APPVEYOR_REPO_BRANCH -eq 'master') {
    if ($env:APPVEYOR) {
        $Success = $true
        $AppVeyorProject = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG"
        $AppVeyorProject.build.jobs | ForEach-Object {
            '[Info] AppVeyor job name: "{0}", Id: {1}, Status: {2}.' -f $_.name, $_.jobId, $_.status
            if ($_.jobId -ne $env:APPVEYOR_JOB_ID -and $_.status -ne "success") {
                $Success = $false
            }
        }
        if (!$Success) {
            '[Info] There are filed jobs skipping PowerShell Gallery deploy.'
            break
        }
    }
    try {
        $VersionGallery = (Find-Module -Name $ModuleName -ErrorAction Stop).Version
    }
    catch {
        if ($_.Exception.Message -notlike 'No match was found for the specified search criteria*' -or !$Force) {
            throw $_
        }
    }

    "[Info] PowerShellGallery. $ModuleName, VersionGallery: $VersionGallery, VersionLocal: $VersionLocal."
    if ($VersionGallery -lt $VersionLocal -or $Force) {
        if (!$NugetApiKey) {
            $NugetApiKey = $env:NugetApiKey
        }
        "[Info] PowerShellGallery. Deploying $ModuleName version $VersionLocal."
        if ($Path) {
            Publish-Module -NuGetApiKey $NugetApiKey -Path $Path
        }
        else {
            Publish-Module -NuGetApiKey $NugetApiKey -Name $ModuleName  -RequiredVersion $VersionLocal
        }
    }
    else {
        '[Info] PowerShellGallery Deploy Skipped (Version Check).'
    }
}
else {
    '[Info] PowerShellGallery Deploy Skipped.'
}
'[Progress] Deploy Ended.'


text:
@**
* Yobi, Project Hosting SW
*
* Copyright 2014 NAVER Corp.
* http://yobi.io
*
* @Author Suwon Chae
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*   http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**@
@(title: String, currentPage: com.avaje.ebean.Page[Issue], param:models.support.SearchCondition, project:Project)

@import helper._
@import utils.TemplateHelper._
@import utils.AccessControl._
@import scala.collection.immutable.Map
@import scala.collection.mutable.ArrayBuffer
@import models.enumeration._
@import org.apache.commons.lang.StringUtils
@import utils.HttpUtil._

@urlToList = {@routes.IssueApp.issues(project.owner, project.name, param.state, "html", currentPage.getPageIndex + 1)}
@paramForEveryone = @{ param.clone().setState(param.state).setAssigneeId(null).setAuthorId(null) }
@paramForIssuesAssignedToMe = @{ param.clone().setState(param.state).setAssigneeId(UserApp.currentUser().id).setAuthorId(null) }
@paramForIssuesAuthoredByMe = @{ param.clone().setState(param.state).setAssigneeId(null).setAuthorId(UserApp.currentUser().id) }

@getPageListUrl(pageIndex:Integer) = {@routes.IssueApp.userIssues(param.state, "html", pageIndex + 1)}

@makeFilterLink(fieldName:String, orderBy:String, orderDir:String, fieldText:String) = {
	@if(orderBy.equals(fieldName)) {
		@fieldText
	} else {
	    @fieldText
	}
}

@getTabLinkByState(state:State) = {@routes.IssueApp.issues(project.owner, project.name, state.state)@if(param.assigneeId != null){?assigneeId=@param.assigneeId}@if(param.authorId != null){&authorId=@param.authorId}@if(param.milestoneId != null){&milestoneId=@param.milestoneId}}

                    @if(!UserApp.currentUser().isAnonymous()){

                        @Messages("issue.list.assignedToMe")

                        @Messages("issue.list.authoredByMe")

                        @Messages("issue.list.mentionedOfMe")

                    }

                @if(param.milestoneId != null){
                    @defining(Milestone.findById(param.milestoneId)){ milestone =>
                        @if(milestone != null){

                            @views.html.milestone.partial_status(milestone, project)
                        }
                    }
                }

                <form id="search" name="search" action="@routes.IssueApp.userIssues()" method="get">
                    <input type="hidden" name="orderBy" value="@param.orderBy">
                    <input type="hidden" name="orderDir" value="@param.orderDir">
                    <input type="hidden" name="state" value="@param.state">
                    <input type="hidden" name="authorId" value="@param.authorId">
                    <input type="hidden" name="assigneeId" value="@param.assigneeId">
                    <input type="hidden" name="mentionId" value="@param.mentionId">

                            <input name="filter" class="textbox full" type="text" value="@param.filter">
                            <button type="submit" class="search-btn"></button>

                </form>

            @for(state <- Array(State.OPEN, State.CLOSED)) {

                        @Messages("issue.state." + state.name.toLowerCase)
                        @Issue.countIssuesBy(param.clone.setState(state))

            }

        @if(currentPage.getList.size() > 0){

                @if(currentPage.getList.size() > 1){

				@makeFilterLink("updatedDate", param.orderBy, param.orderDir, Messages("common.order.updatedDate"))
				@makeFilterLink("createdDate", param.orderBy, param.orderDir, Messages("common.order.date"))
				@makeFilterLink("numOfComments", param.orderBy, param.orderDir, Messages("common.order.comments"))

			}

            @my_partial_list(currentPage.getList, param, currentPage.getPageIndex, currentPage.getTotalPageCount)

        } else {

@Messages("issue.is.empty")

        }


text:
import paddle.v2.dataset.imdb
import unittest
import re

TRAIN_POS_PATTERN = re.compile("aclImdb/train/pos/.*\.txt$")
TRAIN_NEG_PATTERN = re.compile("aclImdb/train/neg/.*\.txt$")
TRAIN_PATTERN = re.compile("aclImdb/train/.*\.txt$")

TEST_POS_PATTERN = re.compile("aclImdb/test/pos/.*\.txt$")
TEST_NEG_PATTERN = re.compile("aclImdb/test/neg/.*\.txt$")
TEST_PATTERN = re.compile("aclImdb/test/.*\.txt$")

class TestIMDB(unittest.TestCase):
    word_idx = None

    def test_build_dict(self):
        if self.word_idx == None:
            self.word_idx = paddle.v2.dataset.imdb.build_dict(TRAIN_PATTERN,
                                                              150)

        self.assertEqual(len(self.word_idx), 7036)

    def check_dataset(self, dataset, expected_size):
        if self.word_idx == None:
            self.word_idx = paddle.v2.dataset.imdb.build_dict(TRAIN_PATTERN,
                                                              150)

        sum = 0
        for l in dataset(self.word_idx):
            self.assertEqual(l[1], sum % 2)
            sum += 1
        self.assertEqual(sum, expected_size)

    def test_train(self):
        self.check_dataset(paddle.v2.dataset.imdb.train, 25000)

    def test_test(self):
        self.check_dataset(paddle.v2.dataset.imdb.test, 25000)

if __name__ == '__main__':
    unittest.main()


text: .wrapper { width: 960px; margin: 0 auto; }


text:
title: Counting Sundays
---
## Problem 19: Counting Sundays

This is a stub. Help our community expand it.

This quick style guide will help ensure your pull request gets accepted.


text:
#ifndef SIZECONSUMEDMODEL_H
#define SIZECONSUMEDMODEL_H

#include "filelistmodel.h"

class SizeConsumedModel : public FileListModel
{
    Q_OBJECT
public:
    explicit SizeConsumedModel(QObject *parent = 0);
};

#endif // SIZECONSUMEDMODEL_H


text:
package org.assertj.core.api.throwable;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.verify;

import org.assertj.core.api.ThrowableAssert;
import org.assertj.core.api.ThrowableAssertBaseTest;
import org.junit.jupiter.api.Test;

public class ThrowableAssert_hasSuppressedException_Test extends ThrowableAssertBaseTest {

  private Throwable npe = new NullPointerException();

  @Override
  protected ThrowableAssert invoke_api_method() {
    return assertions.hasSuppressedException(npe);
  }

  @Override
  protected void verify_internal_effects() {
    verify(throwables).assertHasSuppressedException(getInfo(assertions), getActual(assertions), npe);

  }

  @Test
  public void invoke_api_like_user() {
    // GIVEN
    Throwable actual = new Throwable();

    // WHEN
    actual.addSuppressed(npe);

    // THEN
    assertThat(actual).hasSuppressedException(npe);
  }
}


text:
package play.api.routing

import play.api.mvc.RequestHeader
import play.twirl.api.JavaScript

/**
 * A JavaScript reverse route
 */
case class JavaScriptReverseRoute(name: String, f: String)

object JavaScriptReverseRouter {

  /**
   * Generates a JavaScript router.
   *
   * For example:
   * {{{
   * JavaScriptReverseRouter("MyRouter")(
   *   controllers.routes.javascript.Application.index,
   *   controllers.routes.javascript.Application.list,
   *   controllers.routes.javascript.Application.create
   * )
   * }}}
   *
   * And then you can use the JavaScript router as:
   * {{{
   * var routeToHome = MyRouter.controllers.Application.index()
   * }}}
   *
   * @param name the JavaScript object name
   * @param routes the routes to include in this JavaScript router
   * @return the JavaScript code
   */
  def apply(name: String = "Router", ajaxMethod: Option[String] = Some("jQuery.ajax"))(
      routes: JavaScriptReverseRoute*
  )(implicit request: RequestHeader): JavaScript = {
    apply(name, ajaxMethod, request.host, routes: _*)
  }

  def apply(name: String, ajaxMethod: Option[String], host: String, routes: JavaScriptReverseRoute*): JavaScript =
    JavaScript {
      import play.twirl.api.utils.StringEscapeUtils.{ escapeEcmaScript => esc }
      val ajaxField = ajaxMethod.fold("")(m => s"ajax:function(c){c=c||{};c.url=r.url;c.type=r.method;return $m(c)},")
      val routesStr = routes
        .map { route =>
          val nameParts      = route.name.split('.')
          val controllerName = nameParts.dropRight(1).mkString(".")
          val prop           = "_root" + nameParts.map(p => s"['${esc(p)}']").mkString
          s"_nS('${esc(controllerName)}'); $prop = ${route.f};"
        }
        .mkString("\n")
      s"""
         |var $name = {}; (function(_root){
         |var _nS = function(c,f,b){var e=c.split(f||"."),g=b||_root,d,a;for(d=0,a=e.length;d<a;d++){g=g[e[d]]=g[e[d]]||{}}return g}
         |var _qS = function(items){var qs = ''; for(var i=0;i<items.length;i++) {if(items[i]) qs += (qs ? '&' : '') + items[i]}; return qs ? ('?' + qs) : ''}
         |var _s = function(p,s){return p+((s===true||(s&&s.secure))?'s':'')+'://'}
         |var _wA = function(r){return {$ajaxField method:r.method,type:r.method,url:r.url,absoluteURL: function(s){return _s('http',s)+'${esc(
           host
         )}'+r.url},webSocketURL: function(s){return _s('ws',s)+'${esc(host)}'+r.url}}}
         |$routesStr
         |})($name)
    """.stripMargin.trim
    }
}


text:
'use strict';

app.directive("owlCarousel", ['$http', '$compile', function ($http, $compile) {
    return {
        restrict: 'EA',
        templateUrl: "modules/owlCarousel/owlCarousel.html",
        scope: {
            imgUrls: '='
        },
        link: function (scope, element, attrs) {

        }
    };
}]).directive("carouselItem", ['$http', '$compile', function ($http, $compile) {
    return {
        restrict: 'EA',
        link: function (scope, element, attrs) {
            if (scope.$last) {
                $(element).parent().owlCarousel({
                    navigation: true, // Show next and prev buttons
                    slideSpeed: 300,
                    paginationSpeed: 400,
                    singleItem: true,
                    autoPlay: 3000,
                    items:1
                });
            }
        }
    };
}]);


text:
Nominate:

            <form role="form">

                    <input type="text" class="form-control" id="first-name" placeholder="Your First Name">

                    <input type="text" class="form-control" id="last-name" placeholder="Your Last Name">

                    <input type="email" class="form-control" id="email" placeholder="Your Email">

            </form>

PLEASE fill out ALL fields on this site (including picking an activity and writing in a food or dish) or you will not receive your confirmation email and directions!

Your confirmation will be sent to the email you provide. Your information will not be distributed to any corporate entities, government agencies, multidimensional beings, or sentient robots.

    <form>

    </form>


text:
package org.apache.kafka.streams.integration;

import kafka.server.KafkaConfig$;
import org.apache.kafka.streams.integration.utils.EmbeddedKafkaCluster;
import org.apache.kafka.test.IntegrationTest;

import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import java.util.Properties;

/**
 * Tests local state store and global application cleanup.
 */
@Ignore
@Category({IntegrationTest.class})
public class ResetIntegrationTest extends AbstractResetIntegrationTest {

    @ClassRule
    public static final EmbeddedKafkaCluster CLUSTER;

    private static final String TEST_ID = "reset-integration-test";

    static {
        final Properties brokerProps = new Properties();
        // we double the value passed to `time.sleep` in each iteration in one of the map functions, so we disable
        // expiration of connections by the brokers to avoid errors when `AdminClient` sends requests after potentially
        // very long sleep times
        brokerProps.put(KafkaConfig$.MODULE$.ConnectionsMaxIdleMsProp(), -1L);
        CLUSTER = new EmbeddedKafkaCluster(1, brokerProps);
    }

    @Before
    public void before() throws Exception {
        testId = TEST_ID;
        cluster = CLUSTER;
        prepareTest();
    }

    @After
    public void after() throws Exception {
        cleanupTest();
    }

    @Test
    public void testReprocessingFromScratchAfterResetWithoutIntermediateUserTopic() throws Exception {
        super.testReprocessingFromScratchAfterResetWithoutIntermediateUserTopic();
    }

    @Test
    public void testReprocessingFromScratchAfterResetWithIntermediateUserTopic() throws Exception {
        super.testReprocessingFromScratchAfterResetWithIntermediateUserTopic();
    }

    @Test
    public void testReprocessingFromFileAfterResetWithoutIntermediateUserTopic() throws Exception {
        super.testReprocessingFromFileAfterResetWithoutIntermediateUserTopic();
    }

    @Test
    public void testReprocessingFromDateTimeAfterResetWithoutIntermediateUserTopic() throws Exception {
        super.testReprocessingFromDateTimeAfterResetWithoutIntermediateUserTopic();
    }

    @Test
    public void testReprocessingByDurationAfterResetWithoutIntermediateUserTopic() throws Exception {
        super.testReprocessingByDurationAfterResetWithoutIntermediateUserTopic();
    }

    @Test
    public void shouldNotAllowToResetWhileStreamsRunning() throws Exception {
        super.shouldNotAllowToResetWhileStreamsIsRunning();
    }

    @Test
    public void shouldNotAllowToResetWhenInputTopicAbsent() throws Exception {
        super.shouldNotAllowToResetWhenInputTopicAbsent();
    }

    @Test
    public void shouldNotAllowToResetWhenIntermediateTopicAbsent() throws Exception {
        super.shouldNotAllowToResetWhenIntermediateTopicAbsent();
    }
}


text:
An experimental Windows builder for Cloud Build.

## Getting started

If you are new to Google Cloud Build, we recommend you start by visiting the [manage resources page](https://console.cloud.google.com/cloud-resource-manager) in the Cloud Console, [enable billing](https://cloud.google.com/billing/docs/how-to/modify-project), [enable the Cloud Build API](https://console.cloud.google.com/flows/enableapi?apiid=cloudbuild.googleapis.com), and [install the Cloud SDK](https://cloud.google.com/sdk/docs/).

Grant Compute Engine permissions to your Cloud Build service account:

```sh
gcloud services enable compute.googleapis.com
export PROJECT=$(gcloud info --format='value(config.project)')
export MEMBER=$(gcloud projects describe $PROJECT --format 'value(projectNumber)')@cloudbuild.gserviceaccount.com
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:$MEMBER --role='roles/compute.admin'
gcloud projects add-iam-policy-binding $PROJECT --member=serviceAccount:$MEMBER --role='roles/iam.serviceAccountUser'
```

Clone this repository and build the builder:
```sh
gcloud builds submit --config=builder/cloudbuild.yaml builder/
```

Then, refer to the builder in your project's `cloudbuild.yaml`.  To spin up an ephemeral `n1-standard-1` VM on Compute Engine, simply provide the command you wish to execute.  Your Cloud Build workspace is synchronized to `C:\workspace` at server startup.

```yaml
steps:
- name: 'gcr.io/$PROJECT_ID/windows-builder'
  args: [ '--command', '<command goes here>' ]
```

To use a custom Windows image, specify the image URL using the `--image` argument.

```yaml
steps:
- name: 'gcr.io/$PROJECT_ID/windows-builder'
  args: [ '--command', '<command goes here>',
          '--image', 'projects/$PROJECT_ID/global/images/my-windows-image']
```

The VM is configured by the builder and then deleted automatically at the end of the build.  Command is executed by `cmd.exe`; in most cases it will be a build script.

To use an existing Windows server instead, also provide the hostname, username and password:

```yaml
steps:
- name: 'gcr.io/$PROJECT_ID/windows-builder'
  args: [ '--hostname', 'host.domain.net',
          '--username', 'myuser',
          '--password', 's3cret',
          '--command', '<command goes here>' ]
```

You can also provide the VPC, Subnetwork, Region, and Zone parameters to specify where to create the VM:

```yaml
steps:
- name: 'gcr.io/$PROJECT_ID/windows-builder'
  args: [ '--network', '<network-name>',
          '--subnetwork', '<subnetwork-name>',
          '--region', '<region>',
          '--zone', '<zone>',
          '--command', '<command goes here>' ]
```

As the remote copy command provided is very slow if you have a number of files in your workspace, it is also possible to avoid copying the workspace (you can use GCS to copy the workspace instead):

```yaml
steps:
- name: 'gcr.io/$PROJECT_ID/windows-builder'
  args: [ '--network', '<network-name>',
          '--subnetwork', '<subnetwork-name>',
          '--region', '<region>',
          '--zone', '<zone>',
          '--not-copy-workspace',
          '--command', '<command goes here>' ]
```

Your server must support Basic Authentication (username and password) and your network must allow access from the internet on TCP port 5986.  Do not submit plaintext passwords in your build configuration: instead, use [encrypted credentials](https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-secrets-credentials) secured with Cloud KMS.  In addition, you must clear up your workspace directory after use, and take care to manage concurrent builds.

## Examples

Several example builds are provided:

* [images/example](images/example) prints "Hello World!" from Windows
* [images/go-windows](images/go-windows) builds a Windows Go builder container
  image
* [images/go-example](images/go-example) builds a very simple Go application
  into a deployable Windows container.  This relies on the Windows Go builder
  from the step above.
* [images/docker-windows](images/docker-windows) builds a Windows container with
  a Docker executable inside - useful for building containers within a
  Docker context itself.
* [images/multi-arch_1909_2019](images/multi-arch_1909_2019) builds a multi-arch Windows container from servercore 1909 & ltsc2019.

## Performance

Starting an ephemeral VM on Compute Engine takes about 3 min 31 sec, broken down as follows:

| Step | Duration | Elapsed | Fraction |
|------|----------|---------|----------|
| Create new Compute Engine instance | 7 sec | 7 sec | 3% |
| Wait for password reset | 37 sec | 45 sec | 21% |
| Wait for Windows to finish booting | 2 min 39 sec | 3 min 24 sec | 76% |

Frequent builds will benefit from creating a persistent Windows VM.  To do this, see `scripts/start_windows.sh`.

Downloading and expanding archives is a common build step.  While Powershell offers functionality to do this (the `Expand-Archive` cmdlet) there are known performance issues.  See [PowerShell Archive issue #32](https://github.com/PowerShell/Microsoft.PowerShell.Archive/issues/32).

## Security

`windows-builder` communicates with the remote server using WinRM over HTTPS.  Basic authentication using username and password is currently supported.

For ephemeral VMs on Compute Engine, the initial password reset is performed [using public key cryptography](https://cloud.google.com/compute/docs/instances/windows/automate-pw-generation).  The cleartext password is never sent over an unencrypted connection, and is stored in memory for the duration of the build.

The latest version of Windows Server 2019 DC Core for Containers (patched 2019-12-10) is currently used.

By default, windows-builder creates an ingress firewall rule to open tcp:5986.  This allows windows-builder to communicate
with windows GCE instance over WinRM.  It's possible to avoid an external access by using a [private worker pool](https://cloud.google.com/build/docs/private-pools/private-pools-overview) and peering
it with your private VPC network.  With such set up windows-builder can communicate with GCE instance(s) over an internal network.  To do that you will need to [set up](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) your GCP network, create a [private worker pool](https://cloud.google.com/build/docs/private-pools/create-manage-private-pools), configure [Private Google Access](https://cloud.google.com/vpc/docs/configure-private-google-access), [configure](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) your builder to use a private worker pool, and use --use-internal-network windows-builder option in your cloudbuild.yaml.

Using internal network option precludes windows-builder from creating an external ip address for windows GCE instance.
You can use --create-external-ip (can only be used in conjunction with --use-internal-network) which would override the
default behavior and create an external IP address.  This can be useful in case you want to be able to RDP to your
GCE instance(s).

## Docker builds

Windows supports [two different types](https://docs.microsoft.com/en-us/virtualization/windowscontainers/manage-containers/hyperv-container) of containers: "Windows Server containers", similar to the traditional Linux container, and "Hyper-V containers", which rely on Virtual Machines.  This code uses Windows Server containers, and as a result both the major and minor version of Windows must match between container and host.

The package manager in Windows Server 1803 provides Docker 17.06.  However to run a Docker executable inside a Docker container as Cloud Build typically does, version 17.09 or higher is required to bind-mount the named pipe: see [this pull request](https://github.com/StefanScherer/insider-docker-machine/pull/1).  e.g., `docker run -v '\.\pipe\docker_engine:\.\pipe\docker_engine' ...`

## Debugging WinRM

To debug issues with WinRM, Python users may find the [PyWinRM package](https://github.com/diyan/pywinrm) helpful, for example:

```python
from winrm.protocol import Protocol
p = Protocol(
    endpoint='https://<ip address>:5986/wsman',
    username=<username>,
    password=<password>,
    server_cert_validation='ignore')
shell_id = p.open_shell()
command_id = p.run_command(shell_id, 'ipconfig', ['/all'])
std_out, std_err, status_code = p.get_command_output(shell_id, command_id)
p.cleanup_command(shell_id, command_id)
p.close_shell(shell_id)
```


text:
package h2o.common.util.security;

import h2o.common.collection.ConcurrentBiMap;
import h2o.common.exception.ExceptionUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.*;

public class Base32Util {

    private static final Logger log = LoggerFactory.getLogger(Base32Util.class.getName());

    private static final String STD_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=";

    public final String CHARS;

    private final ConcurrentBiMap<Character, Character> bidi;

    public Base32Util() {
        CHARS = STD_CHARS;
        bidi = null;
    }

    public Base32Util(String s32) {

        if (s32 == null || s32.length() != 33) {
            throw new IllegalArgumentException();
        }

        CHARS = s32;

        bidi = new ConcurrentBiMap<Character, Character>();

        for (int i = 0; i < 33; i++) {
            bidi.put(CHARS.charAt(i), STD_CHARS.charAt(i));
        }
        bidi.readonlyMode();

    }

    private String m2s(String my32) {

        if (bidi == null) {
            return my32;
        }

        char[] s32 = new char[my32.length()];

        for (int i = 0; i < my32.length(); i++) {
            s32[i] = (Character) bidi.get(my32.charAt(i));
        }

        return new String(s32);

    }

    private String s2m(String s32) {

        if (bidi == null) {
            return s32;
        }

        char[] m32 = new char[s32.length()];

        for (int i = 0; i < s32.length(); i++) {
            m32[i] = (Character) bidi.getKey(s32.charAt(i));
        }

        return new String(m32);

    }

    public String encode(byte[] raw) {
        return s2m(Base32.encode(raw));
    }

    public byte[] decode(String base32) {
        return Base32.decode(m2s(base32));
    }

    public String encode(String s) {
        return encode(s, "UTF-8");
    }

    public String encode(String s, String charSet) {
        try {
            return encode(s.getBytes(charSet));
        } catch (UnsupportedEncodingException e) {
            log.debug("encode", e);
            throw ExceptionUtil.toRuntimeException(e);
        }

    }

    public String decode2s(String b32) {
        return decode2s(b32, "UTF-8");
    }

    public String decode2s(String b32, String charSet) {
        try {
            return new String(decode(b32), charSet);
        } catch (UnsupportedEncodingException e) {
            log.debug("decode2s", e);
            throw ExceptionUtil.toRuntimeException(e);
        }
    }

    public String objectToString(Object o) {
        if (o == null) {
            return null;
        }

        ByteArrayOutputStream bam = new ByteArrayOutputStream();

        try {
            ObjectOutputStream os = new ObjectOutputStream(new BufferedOutputStream(bam));

            os.flush();
            os.writeObject(o);
            os.flush();

            return encode(bam.toByteArray());
        } catch (IOException e) {
            log.debug("objectToString", e);
            throw ExceptionUtil.toRuntimeException(e);
        }

    }

    public Object stringToObject(String s) {
        if (s == null) {
            return null;
        }

        byte bytes[] = decode(s);

        ByteArrayInputStream bais = new ByteArrayInputStream(bytes);

        try {
            ObjectInputStream is = new ObjectInputStream(new BufferedInputStream(bais));

            return is.readObject();
        } catch (Exception e) {
            log.debug("stringToObject", e);
            throw ExceptionUtil.toRuntimeException(e);
        }

    }

}


text:
package org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.ddl;

import lombok.ToString;
import org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateViewStatement;
import org.apache.shardingsphere.sql.parser.sql.dialect.statement.opengauss.OpenGaussStatement;

/**
 * OpenGauss create view statement.
 */
@ToString
public final class OpenGaussCreateViewStatement extends CreateViewStatement implements OpenGaussStatement {
}


text:
/*
 * The Plaid API
 *
 * The Plaid REST API. Please see https://plaid.com/docs/api for more details.
 *
 * API version: 2020-09-14_1.205.3
 */

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package plaid

import (
	"encoding/json"
)

// InvestmentsTransactionsGetResponse InvestmentsTransactionsGetResponse defines the response schema for `/investments/transactions/get`
type InvestmentsTransactionsGetResponse struct {
	Item Item `json:"item"`
	// The accounts for which transaction history is being fetched.
	Accounts []AccountBase `json:"accounts"`
	// All securities for which there is a corresponding transaction being fetched.
	Securities []Security `json:"securities"`
	// The transactions being fetched
	InvestmentTransactions []InvestmentTransaction `json:"investment_transactions"`
	// The total number of transactions available within the date range specified. If `total_investment_transactions` is larger than the size of the `transactions` array, more transactions are available and can be fetched via manipulating the `offset` parameter.'
	TotalInvestmentTransactions int32 `json:"total_investment_transactions"`
	// A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.
	RequestId string `json:"request_id"`
	AdditionalProperties map[string]interface{}
}

type _InvestmentsTransactionsGetResponse InvestmentsTransactionsGetResponse

// NewInvestmentsTransactionsGetResponse instantiates a new InvestmentsTransactionsGetResponse object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewInvestmentsTransactionsGetResponse(item Item, accounts []AccountBase, securities []Security, investmentTransactions []InvestmentTransaction, totalInvestmentTransactions int32, requestId string) *InvestmentsTransactionsGetResponse {
	this := InvestmentsTransactionsGetResponse{}
	this.Item = item
	this.Accounts = accounts
	this.Securities = securities
	this.InvestmentTransactions = investmentTransactions
	this.TotalInvestmentTransactions = totalInvestmentTransactions
	this.RequestId = requestId
	return &this
}

// NewInvestmentsTransactionsGetResponseWithDefaults instantiates a new InvestmentsTransactionsGetResponse object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewInvestmentsTransactionsGetResponseWithDefaults() *InvestmentsTransactionsGetResponse {
	this := InvestmentsTransactionsGetResponse{}
	return &this
}

// GetItem returns the Item field value
func (o *InvestmentsTransactionsGetResponse) GetItem() Item {
	if o == nil {
		var ret Item
		return ret
	}

	return o.Item
}

// GetItemOk returns a tuple with the Item field value
// and a boolean to check if the value has been set.
func (o *InvestmentsTransactionsGetResponse) GetItemOk() (*Item, bool) {
	if o == nil  {
		return nil, false
	}
	return &o.Item, true
}

// SetItem sets field value
func (o *InvestmentsTransactionsGetResponse) SetItem(v Item) {
	o.Item = v
}

// GetAccounts returns the Accounts field value
func (o *InvestmentsTransactionsGetResponse) GetAccounts() []AccountBase {
	if o == nil {
		var ret []AccountBase
		return ret
	}

	return o.Accounts
}

// GetAccountsOk returns a tuple with the Accounts field value
// and a boolean to check if the value has been set.
func (o *InvestmentsTransactionsGetResponse) GetAccountsOk() (*[]AccountBase, bool) {
	if o == nil  {
		return nil, false
	}
	return &o.Accounts, true
}

// SetAccounts sets field value
func (o *InvestmentsTransactionsGetResponse) SetAccounts(v []AccountBase) {
	o.Accounts = v
}

// GetSecurities returns the Securities field value
func (o *InvestmentsTransactionsGetResponse) GetSecurities() []Security {
	if o == nil {
		var ret []Security
		return ret
	}

	return o.Securities
}

// GetSecuritiesOk returns a tuple with the Securities field value
// and a boolean to check if the value has been set.
func (o *InvestmentsTransactionsGetResponse) GetSecuritiesOk() (*[]Security, bool) {
	if o == nil  {
		return nil, false
	}
	return &o.Securities, true
}

// SetSecurities sets field value
func (o *InvestmentsTransactionsGetResponse) SetSecurities(v []Security) {
	o.Securities = v
}

// GetInvestmentTransactions returns the InvestmentTransactions field value
func (o *InvestmentsTransactionsGetResponse) GetInvestmentTransactions() []InvestmentTransaction {
	if o == nil {
		var ret []InvestmentTransaction
		return ret
	}

	return o.InvestmentTransactions
}

// GetInvestmentTransactionsOk returns a tuple with the InvestmentTransactions field value
// and a boolean to check if the value has been set.
func (o *InvestmentsTransactionsGetResponse) GetInvestmentTransactionsOk() (*[]InvestmentTransaction, bool) {
	if o == nil  {
		return nil, false
	}
	return &o.InvestmentTransactions, true
}

// SetInvestmentTransactions sets field value
func (o *InvestmentsTransactionsGetResponse) SetInvestmentTransactions(v []InvestmentTransaction) {
	o.InvestmentTransactions = v
}

// GetTotalInvestmentTransactions returns the TotalInvestmentTransactions field value
func (o *InvestmentsTransactionsGetResponse) GetTotalInvestmentTransactions() int32 {
	if o == nil {
		var ret int32
		return ret
	}

	return o.TotalInvestmentTransactions
}

// GetTotalInvestmentTransactionsOk returns a tuple with the TotalInvestmentTransactions field value
// and a boolean to check if the value has been set.
func (o *InvestmentsTransactionsGetResponse) GetTotalInvestmentTransactionsOk() (*int32, bool) {
	if o == nil  {
		return nil, false
	}
	return &o.TotalInvestmentTransactions, true
}

// SetTotalInvestmentTransactions sets field value
func (o *InvestmentsTransactionsGetResponse) SetTotalInvestmentTransactions(v int32) {
	o.TotalInvestmentTransactions = v
}

// GetRequestId returns the RequestId field value
func (o *InvestmentsTransactionsGetResponse) GetRequestId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.RequestId
}

// GetRequestIdOk returns a tuple with the RequestId field value
// and a boolean to check if the value has been set.
func (o *InvestmentsTransactionsGetResponse) GetRequestIdOk() (*string, bool) {
	if o == nil  {
		return nil, false
	}
	return &o.RequestId, true
}

// SetRequestId sets field value
func (o *InvestmentsTransactionsGetResponse) SetRequestId(v string) {
	o.RequestId = v
}

func (o InvestmentsTransactionsGetResponse) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if true {
		toSerialize["item"] = o.Item
	}
	if true {
		toSerialize["accounts"] = o.Accounts
	}
	if true {
		toSerialize["securities"] = o.Securities
	}
	if true {
		toSerialize["investment_transactions"] = o.InvestmentTransactions
	}
	if true {
		toSerialize["total_investment_transactions"] = o.TotalInvestmentTransactions
	}
	if true {
		toSerialize["request_id"] = o.RequestId
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return json.Marshal(toSerialize)
}

func (o *InvestmentsTransactionsGetResponse) UnmarshalJSON(bytes []byte) (err error) {
	varInvestmentsTransactionsGetResponse := _InvestmentsTransactionsGetResponse{}

	if err = json.Unmarshal(bytes, &varInvestmentsTransactionsGetResponse); err == nil {
		*o = InvestmentsTransactionsGetResponse(varInvestmentsTransactionsGetResponse)
	} else {
		return err
	}

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
		delete(additionalProperties, "item")
		delete(additionalProperties, "accounts")
		delete(additionalProperties, "securities")
		delete(additionalProperties, "investment_transactions")
		delete(additionalProperties, "total_investment_transactions")
		delete(additionalProperties, "request_id")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableInvestmentsTransactionsGetResponse struct {
	value *InvestmentsTransactionsGetResponse
	isSet bool
}

func (v NullableInvestmentsTransactionsGetResponse) Get() *InvestmentsTransactionsGetResponse {
	return v.value
}

func (v *NullableInvestmentsTransactionsGetResponse) Set(val *InvestmentsTransactionsGetResponse) {
	v.value = val
	v.isSet = true
}

func (v NullableInvestmentsTransactionsGetResponse) IsSet() bool {
	return v.isSet
}

func (v *NullableInvestmentsTransactionsGetResponse) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableInvestmentsTransactionsGetResponse(val *InvestmentsTransactionsGetResponse) *NullableInvestmentsTransactionsGetResponse {
	return &NullableInvestmentsTransactionsGetResponse{value: val, isSet: true}
}

func (v NullableInvestmentsTransactionsGetResponse) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableInvestmentsTransactionsGetResponse) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}


text: Using this Application


text:
namespace _04.Academy_Graduation
{
    using System;
    using System.Collections.Generic;
    using System.Linq;

    public class Startup
    {
        public static void Main()
        {
            int students = int.Parse(Console.ReadLine());
            SortedDictionary<string, double> studentRecord = new SortedDictionary<string, double>();

            for (int i = 0; i < students; i++)
            {
                string studentName = Console.ReadLine();

                string marksInput = Console.ReadLine();

                var studentMarks = marksInput.Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(double.Parse).ToList();

                studentRecord[studentName] = studentMarks.Average();
            }

            foreach (var pair in studentRecord)
            {
                Console.WriteLine($"{pair.Key} is graduated with {pair.Value}");
            }
        }
    }
}