text:
namespace Google.Analytics.Admin.V1Alpha.Snippets
{
    // [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_sync_flattened_resourceNames]
    using Google.Analytics.Admin.V1Alpha;

    public sealed partial class GeneratedAnalyticsAdminServiceClientSnippets
    {
        /// <summary>Snippet for GetUserLink</summary>
        /// <remarks>
        /// This snippet has been automatically generated and should be regarded as a code template only.
        /// It will require modifications to work:
        /// - It may require correct/in-range values for request initialization.
        /// - It may require specifying regional endpoints when creating the service client as shown in
        ///   https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
        /// </remarks>
        public void GetUserLinkResourceNames()
        {
            // Create client
            AnalyticsAdminServiceClient analyticsAdminServiceClient = AnalyticsAdminServiceClient.Create();
            // Initialize request argument(s)
            UserLinkName name = UserLinkName.FromAccountUserLink("[ACCOUNT]", "[USER_LINK]");
            // Make the request
            UserLink response = analyticsAdminServiceClient.GetUserLink(name);
        }
    }
    // [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_sync_flattened_resourceNames]
}


text:
<style type="text/css">

  .test {

    color: black !important;

  }

</style>

redpajama_set_name: RedPajamaGithub


text:
package com.heatonresearch.aifh.genetic.species;

import com.heatonresearch.aifh.AIFHError;
import com.heatonresearch.aifh.evolutionary.genome.Genome;
import com.heatonresearch.aifh.evolutionary.species.ThresholdSpeciation;
import com.heatonresearch.aifh.genetic.genome.ArrayGenome;
import com.heatonresearch.aifh.genetic.genome.DoubleArrayGenome;
import com.heatonresearch.aifh.genetic.genome.IntegerArrayGenome;

public class ArraySpeciation<T extends ArrayGenome> extends ThresholdSpeciation {
    @Override
    public double getCompatibilityScore(final Genome genome1, final Genome genome2) {
        if (genome1 instanceof DoubleArrayGenome) {
            return scoreDouble(genome1, genome2);
        } else if (genome1 instanceof IntegerArrayGenome) {
            return scoreInt(genome1, genome2);
        } else {
            throw new AIFHError("This speciation does not support: " + genome1.getClass().getName());
        }
    }

    private double scoreInt(final Genome genome1, final Genome genome2) {
        IntegerArrayGenome intGenome1 = (IntegerArrayGenome) genome1;
        IntegerArrayGenome intGenome2 = (IntegerArrayGenome) genome2;
        double sum = 0;
        for (int i = 0; i < intGenome1.size(); i++) {
            double diff = intGenome1.getData()[i] - intGenome2.getData()[i];
            sum += diff * diff;
        }
        return Math.sqrt(sum);
    }

    private double scoreDouble(final Genome genome1, final Genome genome2) {
        DoubleArrayGenome doubleGenome1 = (DoubleArrayGenome) genome1;
        DoubleArrayGenome doubleGenome2 = (DoubleArrayGenome) genome2;
        double sum = 0;
        for (int i = 0; i < doubleGenome1.size(); i++) {
            double diff = doubleGenome1.getData()[i] - doubleGenome2.getData()[i];
            sum += diff * diff;
        }
        return Math.sqrt(sum);
    }
}


text:
<?php

// No direct access
defined('_HZEXEC_') or die();

Toolbar::title(Lang::txt('Members') . ': ' . Lang::txt('Plugins'), 'members');

if ($this->html)
{
	echo $this->html;
} else {
	Toolbar::cancel();
?>
	<form action="<?php echo Route::url('index.php?option=' . $this->option); ?>" method="post" name="adminForm" id="item-form">

<?php echo Lang::txt('No management interface found for this plugin.'); ?>

		<input type="hidden" name="option" value="<?php echo $this->option; ?>" />
		<input type="hidden" name="controller" value="<?php echo $this->controller; ?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="action" value="" />

		<?php echo Html::input('token'); ?>
	</form>
<?php }


text:
module PathUtilities
  module CSV
    class FileReader
      attr_reader :file_path
      attr_accessor :text, :output

      def initialize(file_path)
        @file_path = file_path
      end

      def execute
        read
        self.output = file_to_ary
      end

      private

      def read
        self.text = File.read(file_path, encoding: 'iso-8859-1:utf-8')
      end

      def file_to_ary
        lines = []
        text.each_line do |line|
          lines << line.split(';')
        end
        lines
      end
    end
  end
end


text:
title: Weatherproofing
date: 2018-12-17 05:28:52 +0000
sub_heading: Hardware
banner_image: "/uploads/2018/12/17/pan001-snow.jpg"

---
The waterproofing is a process designed to shield the mount from the weather. As the unit sits outdoors, it is exposed to the conditions and the goal is prevent water entering the mount where it could damage the drive electronics and or the gear system. The following image shows one way to waterproof the mount. It consists of using thin aluminum sheets to protect various interfaces where water can enter the mount. The sheets are either screwed and/or silicon sealed to the mount as will be outlined.

These instructions represent one way to waterproof your mount and you're welcome to experiment and find other ways and/or modifications. You must take into consideration the conditions at the site you will install your unit at and make modifications and adjustments accordingly. The solution we offer may not be ideal for you.

[![A side view of the mount showing some of the installed weatherproofing.](https://projectpanoptes.org/images/weatherproofing/001.jpg)](https://projectpanoptes.org/images/weatherproofing/001.jpg)A side view of the mount showing some of the installed weatherproofing.

## Tools

* Screwn gun (cordless or powered)
* 4 mm drill bit
* Silicone gun
* Silicone sealant
* 1x 50cm long cable tie
* Scissors
* Box cutter
* Rags

Five (5) aluminum sheet panels are needed along with three plastic tube rings to protect the joints of the mount and electronics. These instructions step through the process of installing each of these in turn. The following image shows a complete unit. The various panels and rings are labelled for reference.

[![A view labelling the various parts to be installed.](https://projectpanoptes.org/images/weatherproofing/003.jpg)](https://projectpanoptes.org/images/weatherproofing/003.jpg)A view labelling the various parts to be installed.

## Declination axis tube

* The first step is to install the tube protectors around the joints for each of the bearings.
* Unlock the mount and rotate the Right Ascension bearing until the mount is horizontal (i.e. the counter weight is horizontal) and the lock it.
* Take the plastic tubing and wrap the tube around the declination bearing as shown in the image below.
* Cut the tube so it is long enough to make one complete loop around the neck of the bearing. You can use scissors or a box cutter.
* Use the silicone gun to dispense the silicone sealant in a continuous track around the neck of the bearing. Place the track on the head unit side of the bearing/joint and about 5 mm from the bearing as shown in the image below.
* Carefully wrap the pre-cut tube around the neck and press it into the silicone. It is important that it is close to the bearing but that no silicon gets in the bearing, it is relatively straight and it is well pressed so the silicon holds the tube with the highest possible strength.
* Wait for 30 minutes or longer until the silicone hardens to prevent damage.

**Note:** If there is any silicon on the joint make sure to clean it off as quickly as possible.

[![](https://projectpanoptes.org/images/weatherproofing/002.jpg)](https://projectpanoptes.org/images/weatherproofing/002.jpg)

## Right Ascension axis tube

* (Optional) If you like you can replace the locking screws for the right ascension axis with smaller cap head screws as shown in the image above. These are smaller and less likely to get in the way. These are M6x20 mm but double-check to make sure.
* Take the plastic tubing and wrap the tube around the right ascension bearing as shown in the image below.
* Cut the tube so it is long enough to make one complete loop around the neck of the bearing. You can use scissors or a box cutter.
* Use the silicone gun to dispense the silicone sealant in a continuous track around the neck of the bearing. Place the track on the rotating side of the bearing/joint and about 5 mm from the bearing as shown in the image below. Note this is the side that moves as opposed to the side which is fixed.
* Carefully wrap the pre-cut tube around the neck and press it into the silicone. It is important that it is close to the bearing but that no silicon gets in the bearing, it is relatively straight and it is well pressed so the silicon holds the tube with the highest possible strength.
* Wait for 30 minutes or longer until the silicone hardens to prevent damage.

**Note:** If there is any silicon on the joint make sure to clean it off as quickly as possible.

[![](https://projectpanoptes.org/images/weatherproofing/004.jpg)](https://projectpanoptes.org/images/weatherproofing/004.jpg)

## Counterweight tube

* Take the plastic tubing and wrap the tube around the counter weight rod.
* Cut the tube so it is long enough to make one complete loop around the neck of the bearing. You can use scissors or a box cutter.
* Use the silicone gun to dispense the silicone sealant in a continuous track around the counter weight rod. Place the track about 5 mm from the body of the mount.
* Carefully wrap the pre-cut tube around the rod and press it into the silicone. It is important that it is up against the body of the mount, it is relatively straight and it is well pressed so the silicon holds the tube with the highest possible strength.
* Wait for 30 minutes or longer until the silicone hardens to prevent damage. Make sure the silicone does not go into the mount or the rod will not be removable.

**WARNING:** The sheeting you will use is very thin and therefore the edges are extremely sharp. Please be very careful while handling these sheets and DO NOT run your finger along the edge of the sheet.

## Counterweight rod shield

The position of the shield can be seen in several images above. The unit will be parked with the headunit pointing down. This means the counter weight will be pointing a little upwards and so it is important to protect the joint where the counterweight is attached as water could enter the mount here.

* Cut a strip from an aluminum sheet to a width of about 60 mm.
* Wrap the sheet around the neck of the mount where the counter weight rod is attached (wider part of the mount with beige paint). Cut the sheet such that it overlaps by 30 mm or so.
* Put a thick track of silicone around the neck of the mount adjacent to the location where the counterweight is secured.
* Wrap the sheet around the silicone covered neck and press firmly to squeeze the silicone.
* While holding the sheet to the neck, get a friend to secure a long cable tie to hold the sheet around the neck. Cut the excess cable tie off.
* Put some silicone in between the overlapping region of the sheet. Gently squeeze the sheet together to get the best contact between the two sheets.
* Leave to dry for 30-60 minutes.

## Mount electronics shield

The position of the shield can be seen in several images above. This shield is designed to protect the mount electronics box, and cover the open hole from which cables can be routed through the mount. Currently there are no specific dimensions for this plate.

An image of the shield in question is shown in the below. The idea is that the shield is bonded to the electronics box with silicone and screws and has tabs that hang out to the side and the bottom to cover the electronics and the open cable port on the mount. Cut a sheet that could look like this and meet these requirements.

* Cut all sharp corners to prevent injury.
* Open the electronics lid. Lock for locations that screws could be inserted to hold the sheet down without touching the electronics board.
* Use tape to temporarily hold the sheet to the lid.
* Once the location of the screws has been determined, drill 2-3 holes about 4 mm in diameter carefully through the lid and sheet. Clean the edge so there are no burrs or pushed up regions.
* Take the sheet off the lid. Push short M4 screws (maybe 6-8 mm in length) through the lid from the bottom. Use tape to hold them to the lid. Resecure lid to the mount.
* Cover electronics lid surface with silicone.
* Press sheet onto the lid. Make sure the screws pass through the holes. Squeeze sheet so that silicone is firmly pressed and gives maximum hold.
* Place a washer and a nut on each of the screws. Lock each one down.
* Use the silicone to cover the washer and nut so water does not enter the electronics enclosure.
* Make sure to wipe off any excess silicone.
* Make sure the flaps on the sides and the end are folded down to minimize the electronics box and cable port on the mount getting wet.
* Leave to dry for 30-60 minutes.

[![](https://projectpanoptes.org/images/weatherproofing/007.jpg)](https://projectpanoptes.org/images/weatherproofing/007.jpg)

## Right Ascension bearing shield

The position of the shield can be seen in the image below. This shield is designed to protect the mount electronics box, and cover the right ascension bearing joint to prevent water getting in. Currently there are no specific dimensions for this plate.

* An image of the shield in question is shown in the below. The idea is that the shield is bonded to the curved surface of the mount with silicone, covers the joint of the right ascension bearing and also creates a cover for the top of the electronics box. Cut a sheet that could look like this and meet these requirements.
* Fold the lid to the appropriate shape to overlap with the electronics box, but be about 5-10 mm above it.
* Cut all sharp corners off to prevent injury.
* Cover the curved surface with silicone.
* Press sheet onto the curved surface. Squeeze out the excess silicone for the best possible hold.
* Make sure to wipe off any excess silicone.
* Make sure the flaps on the sides and the end are folded down to minimize the electronics box and mount joint getting wet.
* Leave to dry for 30-60 minutes.

[![](https://projectpanoptes.org/images/weatherproofing/008.jpg)](https://projectpanoptes.org/images/weatherproofing/008.jpg)

## Declination bearing shield

The position of the shield can be seen in the image above and below. This shield is designed to protect the second mount electronics box, and cover the declination bearing joint to prevent water getting in. Currently there are no specific dimensions for this plate.

* An image of the shield in question is shown in the below. The idea is that the shield is bonded to the black electronics box from the top and the side with silicone, covers the joint of the declination bearing and also creates a cover for the top of the electronics box. Cut a sheet that could look like this and meet these requirements. This may take several iterations.
* Fold the lid to the appropriate shape to overlap with the electronics box and the joint. Note the sheet must overlap the joint by 10-15 mm to prevent water getting access to the joint.
* Cut all sharp corners off to prevent injury.
* Cover the appropriate surfaces with silicone.
* Press the sheet onto the surfaces. Squeeze out the excess silicone for the best possible hold.
* Make sure to wipe off any excess silicone.
* Apply silicone to all cracks and crevices on the electronics box to stop water getting in.
* Leave to dry for 30-60 minutes.

[![](https://projectpanoptes.org/images/weatherproofing/009.jpg)](https://projectpanoptes.org/images/weatherproofing/009.jpg)

## Cable port shield

The position of the shield can be seen in the image below only. This shield is designed to protect the port for the mount. Currently there are no specific dimensions for this plate.

* Take the lid off the cable port hole.
* An image of the shield in question is shown in the below. The idea is that the shield is bonded to the curved part of the mount from the top and the side with silicone, and prevents water getting into the mount when a cable is routed through this port. Cut a sheet that could look like this and meet these requirements. This may take several iterations.
* Fold the lid to the appropriate shape to conform to the curved surface of the mount and butt up against the electronics box.
* Cut all sharp corners off to prevent injury.
* Cover the curved surface of the mount with silicone.
* Press the sheet onto the surface. Squeeze out the excess silicone for the best possible hold.
* Make sure to wipe off any excess silicone.
* Apply silicone to edge against the electronics box to ensure water can not get through here.
* Leave to dry for 30-60 minutes.


text:
<!doctype html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<html>
  <head>
    <title>async test</title>
    <script src="../../../platform/platform.js"></script>
    <link rel="import" href="../../polymer.html">
    <script src="../../../tools/test/htmltest.js"></script>
    <script src="../../../tools/test/chai/chai.js"></script>
  </head>
  <body>

    <x-foo>I am x-foo.</x-foo>

    <polymer-element name="x-foo">
      <script>
        Polymer('x-foo', {
          asyncCount: 0,
          totalAsyncs: 5,
          ready: function() {
            var c = 0, d, e;
            for (var i=0; i < this.totalAsyncs; i++) {
              this.cancelAsync(this.async('asyncHandler'));
              this.cancelAsync(this.async('asyncHandler', null, 1));
            }
            this.async('done');
          },
          asyncHandler: function() {
            this.asyncCount++;
          },
          done: function() {
            this.async('test', null, 50);
          },
          test: function() {
            chai.assert.equal(this.asyncCount, 0);
            done();
          }
        });
      </script>
    </polymer-element>
  </body>
</html>


text:
import {Component} from '@angular/core';
import {fakeAsync, TestBed, tick, waitForAsync} from '@angular/core/testing';
import {CachedResourceLoader} from '@angular/platform-browser-dynamic/src/resource_loader/resource_loader_cache';
import {setTemplateCache} from '@angular/platform-browser-dynamic/test/resource_loader/resource_loader_cache_setter';
import {expect} from '@angular/platform-browser/testing/src/matchers';

if (isBrowser) {
  // TODO(alxhub): Resource loading works very differently in Ivy.
  xdescribe('CachedResourceLoader', () => {
    let resourceLoader: CachedResourceLoader;

    function createCachedResourceLoader(): CachedResourceLoader {
      setTemplateCache({'test.html': '
Hello
'});
      return new CachedResourceLoader();
    }

    it('should throw exception if $templateCache is not found', () => {
      setTemplateCache(null);
      expect(() => {
        resourceLoader = new CachedResourceLoader();
      }).toThrowError('CachedResourceLoader: Template cache was not found in $templateCache.');
    });

    it('should resolve the Promise with the cached file content on success', waitForAsync(() => {
         resourceLoader = createCachedResourceLoader();
         resourceLoader.get('test.html').then((text) => {
           expect(text).toBe('
Hello
');
         });
       }));

    it('should reject the Promise on failure', waitForAsync(() => {
         resourceLoader = createCachedResourceLoader();
         resourceLoader.get('unknown.html').then(() => {
           throw new Error('Not expected to succeed.');
         }, () => {/* success */});
       }));

    it('should allow fakeAsync Tests to load components with templateUrl synchronously',
       fakeAsync(() => {
         const loader = createCachedResourceLoader();
         @Component({selector: 'test-cmp', templateUrl: 'test.html'})
         class TestComponent {
         }

         //  resolveComponentResources(url => loader.get(url));
         tick();

         TestBed.configureTestingModule({declarations: [TestComponent]});
         TestBed.compileComponents();
         tick();

         const fixture = TestBed.createComponent(TestComponent);

         // This should initialize the fixture.
         tick();

         expect(fixture.debugElement.children[0].nativeElement).toHaveText('Hello');
       }));
  });
}


text:
module Plivo
  module XML
    class Speak < Element
      @valid_attributes = %w[voice language loop]

      SUPPORTED_ENGINES=%w(Polly)
      SUPPORTED_VOICES=%w(Nicole Russell Vitoria Ricardo Chantal Naja Mads Lotte Ruben Lea Celine Mathieu Vicki Marlene Hans Aditi Dora Karl Raveena Aditi Carla Giorgio Mizuki Takumi Seoyeon Zhiyu Liv Ewa Maja Jacek Jan Ines Cristiano Carmen Tatyana Maxim Conchita Enrique Astrid Filiz Amy Emma Brian Joanna Matthew Salli Justin Kendra Joey Kimberly Ivy Penelope Miguel Gwyneth Geraint Zeina Mia)

      def initialize(body, attributes = {})
        if attributes.nil? || attributes[:voice].nil? || ['MAN', 'WOMAN'].include?(attributes[:voice])
          @nestables = []
        else
          engine = attributes[:voice].split('.')[0]
          voice = attributes[:voice].split('.')[1]
          if SUPPORTED_ENGINES.include?(engine) && SUPPORTED_VOICES.include?(voice)
            @nestables = %w(Break Cont Emphasis Lang P Phoneme Prosody S SayAs Sub W)
          else
            raise PlivoXMLError, "<Speak> voice #{attributes[:voice]} is not valid."
          end
        end
        if !body
          raise PlivoXMLError, 'No text set for Speak'
        end
        super(body, attributes, @nestables)
      end
    end
  end
end


text:
Simple jQuery plugin to allow you to convert HTML table to jQuery object.

### Demo

Check it the demo out by following link.

### Getting started

This plugin required font-awesome 4.1.0, bootstrap and jQuery, import it first.

```
<link href="http://mytest.no-ip.net/admin/plugins/bootstrap/bootstrap.css" rel="stylesheet">
<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
```

Then, import dataTable.js and dataTable.css

```
<script src="dataTable.js"></script>
<link href="dataTable.css" rel="stylesheet">
```

The setup is done, let's begin to coding. It is very simple just attach dataTable to the table. In this example, $("#myTable") is attached with dataTable and with myData.

```
$(function(){
	$("#myFIFATable").dataTable({
		data: [
				["Country"	,"GP"	,"Win"	,"Draw"	,"Lose"],
				["Brazil"	,"3"	,"2"	,1	,"0"],
				["Mexico"	,"3"	,"2"	,1	,"0"],
				["Croatia"	,"3"	,"1"	,0	,"2"],
				["Cameroon"	,"3"	,"0"	,0	,"3"]
			]
	});
});
```

### Features
* Able to coding with bootstrap
* some simple tools such as edit, remove
* onDataChanged event, this event fired when cell value is change
* Easy to reset data

### Sample code

```
<!DOCTYPE html>
<html lang="jp">
<head>
	<link href="http://mytest.no-ip.net/admin/plugins/bootstrap/bootstrap.css" rel="stylesheet">
	<link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
	<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
	<script src="dataTable.js"></script>
	<link href="dataTable.css" rel="stylesheet">
	<script>

$(function(){
	$("#myFIFATable").dataTable({
		data: [
				["Country"	,"GP"	,"Win"	,"Draw"	,"Lose"],
				["Brazil"	,"3"	,"2"	,1	,"0"],
				["Mexico"	,"3"	,"2"	,1	,"0"],
				["Croatia"	,"3"	,"1"	,0	,"2"],
				["Cameroon"	,"3"	,"0"	,0	,"3"]
			]
	});
});
</script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="span8">
				<table id="myFIFATable" class="table table-bordered table-striped table-heading"></table>
			</div>
		</div>
	</div>
</body>
</html>
```


text:
layout: page
title: Holt 50th Anniversary
date: 2016-05-24
author: Harry Andrews
tags: weekly links, java
status: published
summary: Ut ut malesuada dui, nec consectetur mauris. Phasellus.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 08/25/2017
  endDate: 08/27/2017
  ctyhocn: PHXSUHX
  groupCode: H5A
published: true
---
Proin rutrum, mi sed porttitor gravida, tellus orci dictum nisl, at malesuada ligula nulla id dui. In hac habitasse platea dictumst. Pellentesque molestie orci vel facilisis ornare. Etiam velit nisi, convallis ut turpis quis, porta porta quam. In tellus ipsum, mollis ac sollicitudin id, efficitur vitae lorem. Nullam imperdiet, sapien eget tempor vestibulum, purus mauris elementum neque, vel aliquam ipsum leo et tellus. Ut fringilla tincidunt ligula eget hendrerit. Sed tincidunt tristique mi.

* Duis in quam in diam commodo tincidunt
* Nulla at dolor congue, elementum eros eget, egestas erat
* Quisque sollicitudin erat id consectetur placerat
* Nullam consectetur arcu quis lectus egestas aliquam
* Cras vel erat lobortis, rhoncus turpis sed, feugiat neque.

Sed quis dolor id dui posuere imperdiet id cursus lorem. Vestibulum quis augue erat. In metus leo, egestas eu ornare iaculis, semper varius tortor. Donec quis pulvinar risus, quis sollicitudin arcu. Nam scelerisque quam id justo laoreet iaculis. Sed consequat posuere nisl, ut accumsan ante maximus vitae. Donec in odio sed dui iaculis pharetra.


text:
package com.amazonaws.services.devopsguru.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.devopsguru.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * PerformanceInsightsReferenceData JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PerformanceInsightsReferenceDataJsonUnmarshaller implements Unmarshaller<PerformanceInsightsReferenceData, JsonUnmarshallerContext> {

    public PerformanceInsightsReferenceData unmarshall(JsonUnmarshallerContext context) throws Exception {
        PerformanceInsightsReferenceData performanceInsightsReferenceData = new PerformanceInsightsReferenceData();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return null;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("Name", targetDepth)) {
                    context.nextToken();
                    performanceInsightsReferenceData.setName(context.getUnmarshaller(String.class).unmarshall(context));
                }
                if (context.testExpression("ComparisonValues", targetDepth)) {
                    context.nextToken();
                    performanceInsightsReferenceData.setComparisonValues(PerformanceInsightsReferenceComparisonValuesJsonUnmarshaller.getInstance().unmarshall(
                            context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return performanceInsightsReferenceData;
    }

    private static PerformanceInsightsReferenceDataJsonUnmarshaller instance;

    public static PerformanceInsightsReferenceDataJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new PerformanceInsightsReferenceDataJsonUnmarshaller();
        return instance;
    }
}


text:
package lingua.ui.gtk.main_window.menus;

import lingua.resources.StringResources;
import lingua.ui.gtk.main_window.actions.CopyAction;
import lingua.ui.gtk.main_window.actions.CutAction;
import lingua.ui.gtk.main_window.actions.DeleteAction;
import lingua.ui.gtk.main_window.actions.PasteAction;
import lingua.ui.gtk.main_window.actions.RedoAction;
import lingua.ui.gtk.main_window.actions.SelectAllAction;
import lingua.ui.gtk.main_window.actions.ShowPreferencesDialogAction;
import lingua.ui.gtk.main_window.actions.UndoAction;
import org.gnome.gtk.Menu;
import org.gnome.gtk.MenuItem;
import org.gnome.gtk.SeparatorMenuItem;

/**
 *
 * @author Georgios Migdos <cyberpython@gmail.com>
 */
public class EditMenu extends MenuItem {

    public EditMenu() {
        super(StringResources.getInstance().getString("edit"));
        Menu editMenu = new Menu();
        editMenu.append(UndoAction.getInstance().createMenuItem());
        editMenu.append(RedoAction.getInstance().createMenuItem());
        editMenu.append(new SeparatorMenuItem());
        editMenu.append(CutAction.getInstance().createMenuItem());
        editMenu.append(CopyAction.getInstance().createMenuItem());
        editMenu.append(PasteAction.getInstance().createMenuItem());
        editMenu.append(DeleteAction.getInstance().createMenuItem());
        editMenu.append(new SeparatorMenuItem());
        editMenu.append(SelectAllAction.getInstance().createMenuItem());
        editMenu.append(new SeparatorMenuItem());
        editMenu.append(ShowPreferencesDialogAction.getInstance().createMenuItem());
        this.setSubmenu(editMenu);
    }
}


text:
import React, {Component} from 'react';
import { Link } from 'react-router';
import './LoginHomePage.css';
import auth from '../auth';
const ENTER = 13;

export default class LoginHomePage extends Component {

  constructor(){
    super();
    this.state={}
  }

  _handleLogin = () => {
    // deep destructuring equivalent to (let email = this.refs.email.value;)
    let { email: {value: email}, password: {value: password} } = this.refs;
    if (email && password) {
      auth.login(email, password)
        .then(res => this.props.router.push('/play'))
        .catch( (error) => this.setState({theError : error+ " - Wrong username or password"}) )
    }
    else {
      this.setState({ theError: "Please enter an email and password"})
    }
  }

  _handleTyping = (e) => {
    if (this.state && this.state.error) {
      this.setState({ error: null })
    }
    if (e.keyCode===ENTER) {
      this._handleLogin()
    }
  }

  render() {
    return (

E-Mail

          <input type="text" ref="email" placeholder="login"
                 onKeyUp={this._handleTyping}
          />

Password

          <input type="password" ref="password" placeholder="password"
                 onKeyUp={this._handleTyping}
          />
          <button className="logonbutton" onClick={this._handleLogin}>Login</button>
          <Link to="/SignUp" className="signupbutton">Create an Account</Link>

{this.state.theError}

    )
  }
}


text:
/**
 */
package CIM.IEC61970.Informative.InfOperations;

import CIM.IEC61970.Informative.InfCommon.Role;

import CIM.IEC61970.Informative.InfERPSupport.ErpPerson;

/**
 *
 * A representation of the model object 'Erp Person Schedule Step Role'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link CIM.IEC61970.Informative.InfOperations.ErpPersonScheduleStepRole#getSwitchingStep Switching Step}

 *
{@link CIM.IEC61970.Informative.InfOperations.ErpPersonScheduleStepRole#getErpPerson Erp Person}

 *

 *
 * @see CIM.IEC61970.Informative.InfOperations.InfOperationsPackage#getErpPersonScheduleStepRole()
 * @model annotation="http://iec.ch/TC57/2009/CIM-schema-cim14 Documentation='Roles played between Persons and Schedule Steps.'"
 *        annotation="http://langdale.com.au/2005/UML Profile\040documentation='Roles played between Persons and Schedule Steps.'"
 *        annotation="http://www.eclipse.org/emf/2002/GenModel Documentation='Roles played between Persons and Schedule Steps.' Profile\040documentation='Roles played between Persons and Schedule Steps.'"
 * @generated
 */
public interface ErpPersonScheduleStepRole extends Role {
	/**
	 * Returns the value of the 'Switching Step' reference.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfOperations.SwitchingStep#getErpPersonRole Erp Person Role}'.
	 *
	 *

	 * If the meaning of the 'Switching Step' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Switching Step' reference.
	 * @see #setSwitchingStep(SwitchingStep)
	 * @see CIM.IEC61970.Informative.InfOperations.InfOperationsPackage#getErpPersonScheduleStepRole_SwitchingStep()
	 * @see CIM.IEC61970.Informative.InfOperations.SwitchingStep#getErpPersonRole
	 * @model opposite="ErpPersonRole"
	 * @generated
	 */
	SwitchingStep getSwitchingStep();

	/**
	 * Sets the value of the '{@link CIM.IEC61970.Informative.InfOperations.ErpPersonScheduleStepRole#getSwitchingStep Switching Step}' reference.
	 *
	 *
	 * @param value the new value of the 'Switching Step' reference.
	 * @see #getSwitchingStep()
	 * @generated
	 */
	void setSwitchingStep(SwitchingStep value);

	/**
	 * Returns the value of the 'Erp Person' reference.
	 * It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.InfERPSupport.ErpPerson#getSwitchingStepRoles Switching Step Roles}'.
	 *
	 *

	 * If the meaning of the 'Erp Person' reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Erp Person' reference.
	 * @see #setErpPerson(ErpPerson)
	 * @see CIM.IEC61970.Informative.InfOperations.InfOperationsPackage#getErpPersonScheduleStepRole_ErpPerson()
	 * @see CIM.IEC61970.Informative.InfERPSupport.ErpPerson#getSwitchingStepRoles
	 * @model opposite="SwitchingStepRoles"
	 * @generated
	 */
	ErpPerson getErpPerson();

	/**
	 * Sets the value of the '{@link CIM.IEC61970.Informative.InfOperations.ErpPersonScheduleStepRole#getErpPerson Erp Person}' reference.
	 *
	 *
	 * @param value the new value of the 'Erp Person' reference.
	 * @see #getErpPerson()
	 * @generated
	 */
	void setErpPerson(ErpPerson value);

} // ErpPersonScheduleStepRole


text:
title: Text Analysis with R - Code Study
text: Chapter 13
location: MITH, 0301 Hornbake Library
link: https://github.com/UMD-R-users/studyGroup/issues/32
date: 2016-05-03
---


text:
package net.ontrack.extension.github.model;

public enum GitHubState {

    open, closed

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
using SharpDX;
using SharpDX.D3DCompiler;
using SharpDX.Direct3D;
using SharpDX.Direct3D11;
using SharpDX.DXGI;
using SharpDX.Windows;
using System.Diagnostics;
using Buffer = SharpDX.Direct3D11.Buffer;
using Device = SharpDX.Direct3D11.Device;
using MapFlags = SharpDX.Direct3D11.MapFlags;

namespace Oggy
{
	static class Program
	{
		[STAThread]
		static void Main()
		{
            bool bStereoRendering = false;// change to 'false' due to non-stereo rendering for debug
			int multiThreadCount = 4;// 1 is single thread

            HmdDevice hmd = null;
            try
            {
                // init oculus rift hmd system
                HmdSystem.Initialize();
                var hmdSys = HmdSystem.GetInstance();
                hmd = hmdSys.DetectHmd();
            }
            catch (Exception)
            {
                // failed to detect hmd
                hmd = null;
            }

#if !DEBUG
            var configForm = new ConfigForm(hmd);
            Application.Run(configForm);
            if (configForm.HasResult())
            {
                bStereoRendering = configForm.GetResult().UseHmd;
            }
            else
            {
                // cancel
                return;
            }
#endif
            Size resolution = new Size();
            if (!bStereoRendering)
            {
                //resolution.Width = 1920;// Full HD
                //resolution.Height = 1080;
                resolution.Width = 1280;
                resolution.Height = 720;
            }
            else
            {
                hmd.ResetPose();
                resolution = hmd.Resolution;
            }

			var form = new MainForm();
			form.ClientSize = resolution;

			// Create Device & SwapChain
			var desc = new SwapChainDescription()
			{
				BufferCount = 2,
				ModeDescription =
					new ModeDescription(resolution.Width, resolution.Height, new Rational(0, 1), DrawSystem.GetRenderTargetFormat()),
				IsWindowed = true,
				OutputHandle = form.GetRenderTarget().Handle,
				SampleDescription = new SampleDescription(1, 0),
				SwapEffect = SwapEffect.Sequential,
				Usage = Usage.RenderTargetOutput,
				Flags = SwapChainFlags.AllowModeSwitch,
			};

			FeatureLevel[] levels =
			{
				FeatureLevel.Level_11_0
			};

			Device device;
			SwapChain swapChain;
#if DEBUG
			Device.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.Debug, levels, desc, out device, out swapChain);
#else
			Device.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.None, levels, desc, out device, out swapChain);
#endif

			// Ignore all windows events
			var factory = swapChain.GetParent<Factory>();
			factory.MakeWindowAssociation(form.Handle, WindowAssociationFlags.IgnoreAll);

			DrawSystem.Initialize(form.GetRenderTarget().Handle, device, swapChain, hmd, bStereoRendering, multiThreadCount);
            InputSystem.Initialize(form.GetRenderTarget());
            EntitySystem.Initialize();
			MapSystem.Initialize();
            ChrSystem.Initialize();
            CameraSystem.Initialize();
			CullingSystem.Initialize();
            GameSystem.Initialize();

			GameSystem.GetInstance().Config.IsUseHmd = bStereoRendering;
			var scene = new Scene(device, swapChain, form.GetRenderTarget(), hmd, bStereoRendering, multiThreadCount);
			RenderLoop.Run(form, () => { scene.RenderFrame(); });
            scene.Dispose();

			// Release
            GameSystem.Dispose();
			CullingSystem.Dispose();
            CameraSystem.Dispose();
            ChrSystem.Dispose();
			MapSystem.Dispose();
            EntitySystem.Dispose();
            InputSystem.Dispose();
			DrawSystem.Dispose();
			device.Dispose();
			swapChain.Dispose();
			HmdSystem.Dispose();
		}

	}
}


text:
<html>
   <head>
      <meta name='viewport' content='user-scalable=no initial-scale=1.0' />
      <title>Advertisement</title>
	  <script src="ormma_bridge.js" type="text/javascript"></script>
	  <script src="ormma.js" type="text/javascript"></script>
      <script src="mraid.js" type="text/javascript"></script>
      <script type="text/javascript">
          <!-- mark the state as loading -->
          ormmaview.fireChangeEvent({'state':'loading'});
		  var isADTECHLibraryLoaded = function () { if (ormma && ormma.info) { return "yes"; } else { return "no"; } };
      </script>
   </head>
   <body style="margin:0; padding:0; overflow:hidden; background-color:transparent;">
      <div align="center">
          <script type="text/javascript">
              <!-- NON-SCRIPT-CONTENT -->
          </script>
          <!-- SCRIPT-CONTENT -->
      </div>
   </body>
	<script type="text/javascript">
		ormmaview.notifyAdLoaded();
	</script>
</html>


text:
@implementation LiveView

- (void)addSubviews
{
    self.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.redBoxView];
    [self addSubview:self.blueBoxView];
}

- (void)defineLayout
{
    [self.redBoxView mas_updateConstraints:^(MASConstraintMaker* make){
        make.top.equalTo(@(self.redBoxView.cas_marginTop));
        make.left.equalTo(@(self.redBoxView.cas_marginLeft));
        make.width.equalTo(@(self.redBoxView.cas_sizeWidth));
        make.height.equalTo(@(self.redBoxView.cas_sizeHeight));
    }];
    [self.blueBoxView mas_updateConstraints:^(MASConstraintMaker *make){
        make.top.equalTo(@(self.blueBoxView.cas_marginTop));
        make.right.equalTo(@(self.blueBoxView.cas_marginRight));
        make.width.equalTo(@(self.blueBoxView.cas_sizeWidth));
        make.height.equalTo(@(self.blueBoxView.cas_sizeHeight));
    }];
}

- (UIView*)redBoxView
{
    if (!_redBoxView) {
        _redBoxView = [UIView new];
        _redBoxView.cas_styleClass = @"redBox";
        _redBoxView.backgroundColor = [UIColor redColor];
    }
    return _redBoxView;
}
- (UIView*)blueBoxView
{
    if (!_blueBoxView) {
        _blueBoxView = [UIView new];
        _blueBoxView.cas_styleClass = @"blueBox";
        _blueBoxView.backgroundColor = [UIColor blueColor];
    }
    return _blueBoxView;
}

@end


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

namespace DocaLabs.Http.Client.Utils
{
    public class CustomConcurrentDictionary<TKey, TValue> : ICustomConcurrentDictionary<TKey, TValue>
    {
        readonly Dictionary<TKey, TValue> _data = new Dictionary<TKey, TValue>();
        readonly ReaderWriterLockSlim _locker = new ReaderWriterLockSlim();

        public TValue this[TKey key]
        {
            get
            {
                _locker.EnterReadLock();

                try
                {
                    return _data[key];
                }
                finally
                {
                    _locker.ExitReadLock();
                }
            }

            set
            {
                _locker.EnterWriteLock();

                try
                {
                    _data[key] = value;
                }
                finally
                {
                    _locker.ExitWriteLock();
                }
            }
        }

        public TValue GetOrAdd(TKey key, Func<TKey, TValue> valueFactory)
        {
            _locker.EnterReadLock();

            try
            {
                TValue existingEntry;
                if (_data.TryGetValue(key, out existingEntry))
                    return existingEntry;
            }
            finally
            {
                _locker.ExitReadLock();
            }

            return TryAddInternal(key, valueFactory);
        }

        public bool Remove(TKey key)
        {
            _locker.EnterWriteLock();

            try
            {
                return _data.Remove(key);
            }
            finally
            {
                _locker.ExitWriteLock();
            }
        }

        public bool TryGetValue(TKey key, out TValue value)
        {
            _locker.EnterReadLock();

            try
            {
                return _data.TryGetValue(key, out value);
            }
            finally
            {
                _locker.ExitReadLock();
            }
        }

        TValue TryAddInternal(TKey key, Func<TKey, TValue> valueFactory)
        {
            _locker.EnterWriteLock();

            try
            {
                TValue existingEntry;
                if (_data.TryGetValue(key, out existingEntry))
                {
                    // another thread already inserted an item, so use that one
                    return existingEntry;
                }

                var newEntry = valueFactory(key);

                _data[key] = newEntry;

                return newEntry;
            }
            finally
            {
                _locker.ExitWriteLock();
            }
        }
    }
}


text:
PhoneFormat
-----------

A tel URI should be used to encode a telephone number, to ensure that the digits are understood as a telephone number.
Further, it is advisable to include prefixes that make the number accessible internationally. For example, to encode the
US phone number 212-555-1212, one should encode tel:+1-212-555-1212. This tel URI includes a "+1" prefix that will make
it usable outside the United States.

Readers should invoke the device's dialer, if applicable, and pre-fill it with the given number, but not automatically
initiate a call.

Usage
-----

```php

use Da\QrCode\QrCode;
use Da\QrCode\Format\PhoneFormat;

$format = new PhoneFormat(['phone' => 657657657]);

$qrCode = new QrCode($format);

header('Content-Type: ' . $qrCode->getContentType());

echo $qrCode->writeString();

```

© [2amigos](http://www.2amigos.us/) 2013-2017


text:
By Ross Smith

* `#include "rs-core/fixed-binary.hpp"`

## Contents ##

[TOC]

## Binary integer classes ##

* `template <size_t N> class` **`SmallBinary`**
* `template <size_t N> class` **`LargeBinary`**
* `template <size_t N> using` **`Binary`** `= std::conditional_t<N <= 64, SmallBinary<N>, LargeBinary<N>>`

All of these classes represent unsigned integers with `N` bits. `SmallBinary`
stores its value in a single native integer of an appropriate size,
`LargeBinary` in a suitably sized array of 32-bit integers, stored in little
endian order. Normally you should just use the `Binary` alias; all of the
functions described below are common to both templates (except that, where a
function is documented as taking a `Binary` argument by value, usually the
`LargeBinary` version actually takes its argument by reference).

* `static constexpr size_t Binary::`**`bits`**` = N`
* `static constexpr size_t Binary::`**`bytes`**` = [total bytes in representation]`
* `static constexpr size_t Binary::`**`hex_digits`**` = [maximum number of hex digits in value]`

Member constants.

* `constexpr Binary::`**`Binary`**`() noexcept`
* `Binary::`**`Binary`**`(uint64_t x) noexcept`
* `template <size_t M> explicit Binary::`**`Binary`**`(Binary<M> x) noexcept`
* `explicit Binary::`**`Binary`**`(std::initializer_list<uint64_t> init) noexcept`
* `explicit Binary::`**`Binary`**`(const Ustring& str, int base = 10) noexcept`
* `Binary::`**`~Binary`**`() noexcept`
* `Binary::`**`Binary`**`(const Binary& x) noexcept`
* `Binary::`**`Binary`**`(Binary&& x) noexcept`
* `Binary& Binary::`**`operator=`**`(const Binary& x) noexcept`
* `Binary& Binary::`**`operator=`**`(Binary&& x) noexcept`

Life cycle operations. The default constructor sets the value to zero. A
`Binary` can be constructed from a native unsigned integer, another `Binary`
of any size, a list of 64-bit integers (in big endian order), or a string. In
all cases, if the actual value supplied is too large to fit in `N` bits, the
excess bits are discarded. The string constructor calls `parse()` and follows
the same rules.

* `Ustring Binary::`**`as_binary`**`() const`
* `Ustring Binary::`**`as_decimal`**`() const`
* `Ustring Binary::`**`as_hex`**`() const`
* `std::ostream&` **`operator<<`**`(std::ostream& out, Binary x)`
* `Ustring` **`to_str`**`(Binary x)`

String formatting functions. The output operator and `to_str()` function call
`as_decimal()`. The `as_binary()` and `as_hex()` functions always return the
same number of digits (equal to `bits` and `hex_digits` respectively);
`as_decimal()` writes only the number of digits needed, with no leading zeros
(unless the value is zero).

* `double Binary::`**`as_double`**`() const noexcept`
* `static Binary Binary::`**`from_double`**`(double x) noexcept`

Conversions between `Binary` and `double`. Conversions to a `double` may
produce an approximation if `N>53`. Conversion from a `double` yields the
equivalent of converting the significand exactly and then shifting by a number
of bits based on the exponent; behaviour is undefined if the argument is
negative.

* `void Binary::`**`clear`**`() noexcept`

Sets the value to zero.

* `int Binary::`**`compare`**`(Binary y) const noexcept`

Compares the current value (`x`) to `y`, returning `-1` if `x<y`, `0` if
`x==y`, or `1` if `x>y`.

* `constexpr uint8_t* Binary::`**`data`**`() noexcept`
* `constexpr const uint8_t* Binary::`**`data`**`() const noexcept`

Pointers to the internal representation, which will consist of a number of
bytes equal to the `bytes` constant, in little endian order.

* `template <typename T> bool Binary::`**`fits_in`**`() const noexcept`

True if the current value of the `Binary` will fit in a `T` without loss of
information. Behaviour is undefined if `T` is not a primitive arithmetic type.

* `size_t Binary::`**`hash`**`() const noexcept`
* `struct` **`std::hash`**`<Binary>`

Hash function.

* `size_t Binary::`**`parse`**`(const Ustring& str, int base = 10) noexcept`

Attempts to parse a string as an unsigned integer, writing the value into the
current object. This will always update the value, setting it to zero if the
string does not contain a valid number. It will stop parsing when the first
character that cannot be a digit in the given base is encountered, if this
comes before the end of the string, and returns the number of characters
successfully parsed. Behaviour is undefined if the base is less than 2 or
greater than 35.

* `size_t Binary::`**`significant_bits`**`() const noexcept`

Returns the number of significant bits in the value.

* `explicit Binary::`**`operator bool`**`() const noexcept`

Returns true if the value is not zero.

* `template <typename T> explicit Binary::`**`operator T`**`() const noexcept`

Converts a `Binary` into a standard integer type. The usual arithmetic
overflow rules apply if the value is out of range for the result type.
Behaviour is undefined if `T` is not a primitive arithmetic type, or if `T` is
signed and `fits_in<T>()` is false.

* `Binary Binary::`**`operator+`**`() const noexcept`
* `Binary Binary::`**`operator-`**`() const noexcept`
* `Binary& Binary::`**`operator++`**`() noexcept`
* `Binary Binary::`**`operator++`**`(int) noexcept`
* `Binary& Binary::`**`operator--`**`() noexcept`
* `Binary Binary::`**`operator--`**`(int) noexcept`
* `Binary& Binary::`**`operator+=`**`(Binary y) noexcept`
* `Binary& Binary::`**`operator-=`**`(Binary y) noexcept`
* `Binary& Binary::`**`operator*=`**`(Binary y) noexcept`
* `Binary& Binary::`**`operator/=`**`(Binary y) noexcept`
* `Binary& Binary::`**`operator%=`**`(Binary y) noexcept`
* `Binary` **`operator+`**`(Binary x, Binary y) noexcept`
* `Binary` **`operator-`**`(Binary x, Binary y) noexcept`
* `Binary` **`operator*`**`(Binary x, Binary y) noexcept`
* `Binary` **`operator/`**`(Binary x, Binary y) noexcept`
* `Binary` **`operator%`**`(Binary x, Binary y) noexcept`
* `static void Binary::`**`divide`**`(Binary x, Binary y, Binary& q, Binary& r) noexcept`

Arithmetic operations. Most of these just have the obvious semantics, with the
usual wraparound behaviour on overflow or underflow. For all of the division
and remainder operations (including `divide()`), behaviour is undefined if the
divisor is zero.

* `Binary Binary::`**`operator~`**`() const noexcept`
* `Binary& Binary::`**`operator&=`**`(Binary y) noexcept`
* `Binary& Binary::`**`operator|=`**`(Binary y) noexcept`
* `Binary& Binary::`**`operator^=`**`(Binary y) noexcept`
* `Binary& Binary::`**`operator<<=`**`(int y) noexcept`
* `Binary& Binary::`**`operator>>=`**`(int y) noexcept`
* `Binary` **`operator&`**`(Binary x, Binary y) noexcept`
* `Binary` **`operator|`**`(Binary x, Binary y) noexcept`
* `Binary` **`operator^`**`(Binary x, Binary y) noexcept`
* `Binary` **`operator<<`**`(Binary x, int y) noexcept`
* `Binary` **`operator>>`**`(Binary x, int y) noexcept`
* `Binary` **`rotl`**`(Binary x, int y) noexcept`
* `Binary` **`rotr`**`(Binary x, int y) noexcept`

Bitwise operations. These have their usual semantics. The bit count argument
to the shift and rotate operations can be any value, including out of range or
negative values; a negative shift or rotate is interpreted as a positive one
in the opposite direction.

* `bool` **`operator==`**`(Binary x, Binary y) noexcept`
* `bool` **`operator!=`**`(Binary x, Binary y) noexcept`
* `bool` **`operator<`**`(Binary x, Binary y) noexcept`
* `bool` **`operator>`**`(Binary x, Binary y) noexcept`
* `bool` **`operator<=`**`(Binary x, Binary y) noexcept`
* `bool` **`operator>=`**`(Binary x, Binary y) noexcept`

Comparison operators.

* `static Binary Binary::`**`max`**`() noexcept`

Returns the maximum value of the type (the complement of zero).

* `template <typename RNG> static Binary Binary::`**`random`**`(RNG& rng)`
* `template <typename RNG> static Binary Binary::`**`random`**`(RNG& rng, Binary x)`
* `template <typename RNG> static Binary Binary::`**`random`**`(RNG& rng, Binary x, Binary y)`

Generate a random integer. The first version generates a random value from the
whole range of the type; the second generates a value from zero to `x-1` (this
will always return zero if `x<2`); the third returns a value from `x` to `y`
inclusive (the bounds can be supplied in either order).

* `class std::`**`numeric_limits`**`<Binary>`

Specializations of numeric limits.


text:
As you are using Linux, it is recommended that you use [Mozilla
Firefox][firefox] or [Google Chrome][chrome].

Please see [here][technical] for technical information on which browsers are
supported, or [here][versions] to check which version you are using.

[edge]: https://www.microsoft.com/en-us/windows/microsoft-edge
[ie]: https://www.microsoft.com/en-us/download/internet-explorer.aspx
[firefox]: https://www.mozilla.org/en-US/firefox/new/
[chrome]: https://www.google.com/chrome/
[opera]: https://www.opera.com
[safari]: http://www.apple.com/safari/
[technical]: /browsers/technical
[versions]: /browsers


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Leap Motion Java API Reference: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

Leap Motion Java API Reference
    1.0

com.leapmotion.leap.Pointable Member List

This is the complete list of members for com.leapmotion.leap.Pointable, including all inherited members.

direction()	com.leapmotion.leap.Pointable

equals(Pointable arg0)	com.leapmotion.leap.Pointable

frame()	com.leapmotion.leap.Pointable

hand()	com.leapmotion.leap.Pointable

id()	com.leapmotion.leap.Pointable

invalid()	com.leapmotion.leap.Pointable	static

isFinger()	com.leapmotion.leap.Pointable

isTool()	com.leapmotion.leap.Pointable

isValid()	com.leapmotion.leap.Pointable

length()	com.leapmotion.leap.Pointable

Pointable()	com.leapmotion.leap.Pointable

stabilizedTipPosition()	com.leapmotion.leap.Pointable

timeVisible()	com.leapmotion.leap.Pointable

tipPosition()	com.leapmotion.leap.Pointable

tipVelocity()	com.leapmotion.leap.Pointable

toString()	com.leapmotion.leap.Pointable

touchDistance()	com.leapmotion.leap.Pointable

touchZone()	com.leapmotion.leap.Pointable

width()	com.leapmotion.leap.Pointable

Generated on Fri Jul 19 2013 15:40:35 for Leap Motion Java API Reference by

     1.8.2


text:
var assert = require('assert'),
    utils = require('./utils');

describe('An array of image positions, dimensions, and names', function () {
  utils.setupImages();

  function assertValidJson() {
    it('is valid JSON', function () {
      var result = this.result;
      assert.doesNotThrow(function () {
        JSON.parse(result);
      });
    });
  }
  describe('processed by `json2css` into JSON', function () {
    before(function () {
      this.options = {'format': 'json'};
      this.filename = 'json.json';
    });
    utils.runJson2Css();

    utils.assertMatchesAsExpected();
    assertValidJson();
  });
  describe('processed by `json2css` into an array', function () {
    before(function () {
      this.options = {'format': 'jsonArray'};
      this.filename = 'jsonArray.json';
    });
    utils.runJson2Css();

    utils.assertMatchesAsExpected();
    assertValidJson();
  });

  describe('processed by `json2css` into CSS', function () {
    before(function () {
      this.options = null;
      this.filename = 'css.css';
    });
    utils.runJson2Css();

    utils.assertMatchesAsExpected();
    utils.runFakeJigsaw();
    it('is valid CSS', function (done) {
      var css = this.result;
      utils._assertValidCss(css, done);
    });
  });
});


text:
import sys
import test_cmake_build

assert test_cmake_build.add(1, 2) == 3
print("{} imports, runs, and adds: 1 + 2 = 3".format(sys.argv[1]))


text:
This plugin will send metrics to Amazon CloudWatch.

## Amazon Authentication

This plugin uses a credential chain for Authentication with the CloudWatch
API endpoint. In the following order the plugin will attempt to authenticate.
1. Web identity provider credentials via STS if `role_arn` and `web_identity_token_file` are specified
2. Assumed credentials via STS if `role_arn` attribute is specified (source credentials are evaluated from subsequent rules)
3. Explicit credentials from `access_key`, `secret_key`, and `token` attributes
4. Shared profile from `profile` attribute
5. [Environment Variables](https://github.com/aws/aws-sdk-go/wiki/configuring-sdk#environment-variables)
6. [Shared Credentials](https://github.com/aws/aws-sdk-go/wiki/configuring-sdk#shared-credentials-file)
7. [EC2 Instance Profile](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html)

If you are using credentials from a web identity provider, you can specify the session name using `role_session_name`. If
left empty, the current timestamp will be used.

The IAM user needs only the `cloudwatch:PutMetricData` permission.

## Config

For this output plugin to function correctly the following variables
must be configured.

* region
* namespace

### region

The region is the Amazon region that you wish to connect to.
Examples include but are not limited to:
* us-west-1
* us-west-2
* us-east-1
* ap-southeast-1
* ap-southeast-2

### namespace

The namespace used for AWS CloudWatch metrics.

### write_statistics

If you have a large amount of metrics, you should consider to send statistic
values instead of raw metrics which could not only improve performance but
also save AWS API cost. If enable this flag, this plugin would parse the required
[CloudWatch statistic fields](https://docs.aws.amazon.com/sdk-for-go/api/service/cloudwatch/#StatisticSet)
(count, min, max, and sum) and send them to CloudWatch. You could use `basicstats`
aggregator to calculate those fields. If not all statistic fields are available,
all fields would still be sent as raw metrics.

### high_resolution_metrics
Enable high resolution metrics (1 second precision) instead of standard ones (60 seconds precision)


text:
import { default as React } from "react";
import { RootElement, TheFold } from "react-server";
import Q from "q";
import { RootProvider, ReduxAdapter } from "react-server-redux";
import configureStore from "../stores";
import { Header, Footer, MeteorMap, MeteorTable } from "../components";
import { selectSort, fetchPostsIfNeeded } from "../stores/actions";

import "../styles/general.css";

export default class Homepage {
	handleRoute(next) {
		// Set up a fake promise for streaming out the footer
		const deferred = Q.defer();
		setTimeout(() => deferred.resolve(), 5000);
		this.promise = deferred.promise;

		// Figure out the sorting
		const request = this.getRequest();
		const params = request.getRouteParams();
		const sort = params.sort ? params.sort : "name";

		this.meteorStore = configureStore();
		this.storeAdapter = new ReduxAdapter(this.meteorStore);

		this.storePromise = this.meteorStore.dispatch(fetchPostsIfNeeded())
			.then(() => this.meteorStore.dispatch(selectSort(sort)));

		return this.storePromise.then(next());
	}

	getElements() {
		return [
			// A basic component
			,
			// More complex container components using redux
			<RootProvider key={2} store={this.meteorStore}>
				<RootElement when={this.storeAdapter.when(['meteors'])}>

							<MeteorMap />

							<MeteorTable />

				</RootElement>
			</RootProvider>,
			// Mark when we want our js/css to bind on the client side
			<TheFold key={3} />,
			// A delayed loaded component
			<RootElement key={4} when={this.promise}>

			</RootElement>,
		];
	}

	getTitle() {
		return "Earth Meteorite Landings";
	}

	getBodyClasses() {
		return ["container"];
	}

	getMetaTags() {
		return [
			{charset: "utf8"},
			{"http-equiv": "x-ua-compatible", "content": "ie=edge"},
			{name: "viewport", content: "width=device-width, initial-scale=1"},
			{name: "description", content: "Meteorite app, powered by React Server"},
			{name: "generator", content: "React Server"},
		]
	}
}


text:
module Furnace::AVM2::ABC
  class AS3AlchemyLoadInt32 < Opcode
    instruction 0x37
    read_barrier :memory

    consume 1
    produce 1
  end
end


text:
package br.ufrgs.inf.lattesParser.common;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name="INFORMACOES-ADICIONAIS")
public class InformacoesAdicionais {

	private String descricaoInformacoesAdicionais;
	private String descricaoInformacoesAdicionaisIngles;

	@XmlAttribute(name="DESCRICAO-INFORMACOES-ADICIONAIS")
	public String getDescricaoInformacoesAdicionais() {
		return descricaoInformacoesAdicionais;
	}
	public void setDescricaoInformacoesAdicionais(
			String descricaoInformacoesAdicionais) {
		this.descricaoInformacoesAdicionais = descricaoInformacoesAdicionais;
	}

	@XmlAttribute(name="DESCRICAO-INFORMACOES-ADICIONAIS-INGLES")
	public String getDescricaoInformacoesAdicionaisIngles() {
		return descricaoInformacoesAdicionaisIngles;
	}
	public void setDescricaoInformacoesAdicionaisIngles(
			String descricaoInformacoesAdicionaisIngles) {
		this.descricaoInformacoesAdicionaisIngles = descricaoInformacoesAdicionaisIngles;
	}
}


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

public class ComplimentBoxScript : MonoBehaviour {

	public CitizenScript citizen;

	// Use this for initialization
	void Start () {

	}

	// Update is called once per frame
	void Update () {

	}
}


text:
---
id: version-0.5.0-adding-spks
title: Adding New Script Types
original_id: adding-spks
---

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
<!-- END doctoc -->

- [Adding a New ScriptPubKey Type](#adding-a-new-scriptpubkey-type)
  - [Step 0: Design Philosophy](#step-0-design-philosophy)
  - [Step 1: Create a New ScriptPubKey Trait](#step-1-create-a-new-scriptpubkey-trait)
  - [Step 2: Create Companion Object](#step-2-create-companion-object)
  - [Step 3: Add to Relevant fromAsm Methods](#step-3-add-to-relevant-fromasm-methods)
  - [Step 4: Create a ScriptSignature If Necessary](#step-4-create-a-scriptsignature-if-necessary)
  - [Step 5: Add to ScriptSignature.fromAsm If Applicable](#step-5-add-to-scriptsignaturefromasm-if-applicable)
  - [Step 6: Create Relevant BitcoinUTXOSpendingInfo](#step-6-create-relevant-bitcoinutxospendinginfo)
    - [Non-Nested Single-Key Spending Info](#non-nested-single-key-spending-info)
    - [Non-Nested Multi-Key Spending Info](#non-nested-multi-key-spending-info)
    - [Nested Spending Info](#nested-spending-info)
  - [Step 7: Add to Relevant Apply Methods](#step-7-add-to-relevant-apply-methods)
  - [Step 8: Create a Signer](#step-8-create-a-signer)
    - [Non-Nested Single-Key Spending Info](#non-nested-single-key-spending-info-1)
    - [Non-Nested Multi-Key Spending Info](#non-nested-multi-key-spending-info-1)
    - [Nested Spending Info](#nested-spending-info-1)
  - [Step 9: Add to BitcoinSigner.sign](#step-9-add-to-bitcoinsignersign)
  - [Step 10: Add to ScriptGenerators](#step-10-add-to-scriptgenerators)
    - [ScriptPubKey Generator](#scriptpubkey-generator)
    - [ScriptSignature Generator](#scriptsignature-generator)
    - [ScriptPubKey with Paired ScriptSignature Generator](#scriptpubkey-with-paired-scriptsignature-generator)
  - [Step 11: Add to CreditingTxGen](#step-11-add-to-creditingtxgen)
  - [Step 12: Fix all Non-Exhaustive Matches](#step-12-fix-all-non-exhaustive-matches)
  - [Step 13: Run tests and debug](#step-13-run-tests-and-debug)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Adding a New ScriptPubKey Type

In this document, we will describe how to add new script implementations and types in Bitcoin-S. We will use the following script template example which we have called P2PK with Timeout to illustrate the process:

```
OP_IF
    <Public Key>
OP_ELSE
    <Timeout> OP_CHECKSEQUENCEVERIFY OP_DROP
    <Timeout Public Key>
OP_ENDIF
OP_CHECKSIG
```

Here is [the actual pull request](https://github.com/bitcoin-s/bitcoin-s/pull/967) in which a very similar `ScriptPubKey` is implemented in Bitcoin-S.

Please note that this document only explains how to add new `RawScriptPubKey`s which are the subset of `ScriptPubKey`s which are fully described by their raw scripts. This is to say that this guide will not help in implementing a new segwit version, but should be helpful for most anything else.

It is also important to note that all new scripts should be implemented as if they are to appear on-chain without any P2SH or P2WSH. Bitcoin-S already supports conversions from raw on-chain scripts to these formats in the constructors for the script hash schemes which does not require extra support for new script types.

## Step 0: Design Philosophy

Bitcoin-S strives to have script types defined in such a way that they can be easily composed and reused. Before going through this guide and implementing a really large script template type, try to decompose your script into smaller re-usable pieces.

Also remember to consider what existing pieces you can use. For example, `LockTimeScriptPubKey`s are implemented in such a way that any other `RawScriptPubKey` can be given a time lock by nesting it within a `LockTimeScriptPubKey` subtype. Likewise, `ConditionalScriptPubKey`s are built to allow any other `RawScriptPubKey` type to populate both the `OP_IF/OP_NOTIF` case and the `OP_ELSE` case.

## Step 1: Create a New ScriptPubKey Trait

Go to `ScriptPubKey.scala` and add a new trait:

```scala
sealed trait P2PKWithTimeoutScriptPubKey extends RawScriptPubKey
```

You will then want to add all of the relevant accessor methods. For our case of P2PKWithTimeout, this will mean giving access to the public key, timeout, and timeout public key. Lastly, you will want to add a scaladoc. In total, we get the following result:

```scala
/** The type for ScriptPubKeys of the form:
  * OP_IF
  *   <Public Key>
  * OP_ELSE
  *   <Timeout> OP_CHECKSEQUENCEVERIFY OP_DROP
  *   <Timeout Public Key>
  * OP_ENDIF
  * OP_CHECKSIG
  */
sealed trait P2PKWithTimeoutScriptPubKey extends RawScriptPubKey {

  lazy val pubKey: ECPublicKey =
    ECPublicKey.fromBytes(asm(2).bytes)

  lazy val lockTime: ScriptNumber = ScriptNumber.fromBytes(asm(5).bytes)

  lazy val timeoutPubKey: ECPublicKey =
    ECPublicKey.fromBytes(asm(9).bytes)
}
```

## Step 2: Create Companion Object

We now need a companion object which will fulfill four functionalities for us:

1. Contain a concrete `Impl` class for our SPK type
   - This simply means creating a `private case class` wrapping `asm: Vector[ScriptToken]`
2. Create a `fromAsm` constructor
   - This should be a simple call to `buildScript` which is inherited from `ScriptFactory`
3. Create a logical constructor from Bitcoin-S types
   - This means creating an `apply` method that takes in logical BItcoin-S types and constructs asm
   - Note that this may require the use of `BitcoinScriptUtil.calculatePushOp`
4. Create an ASM filter which will detect if a given `Vector[ScriptToken]` corresponds to our type

This looks like the following:

```scala
object P2PKWithTimeoutScriptPubKey
    extends ScriptFactory[P2PKWithTimeoutScriptPubKey] {
  private case class P2PKWithTimeoutScriptPubKeyImpl(asm: Vector[ScriptToken])
      extends P2PKWithTimeoutScriptPubKey

  override def fromAsm(asm: Seq[ScriptToken]): P2PKWithTimeoutScriptPubKey = {
    buildScript(
      asm = asm.toVector,
      constructor = P2PKWithTimeoutScriptPubKeyImpl.apply,
      errorMsg = s"Given asm was not a P2PKWithTimeoutScriptPubKey, got $asm"
    )
  }

  def apply(
      pubKey: ECPublicKey,
      lockTime: ScriptNumber,
      timeoutPubKey: ECPublicKey): P2PKWithTimeoutScriptPubKey = {
    val timeoutAsm = CSVScriptPubKey(lockTime, EmptyScriptPubKey).asm.toVector
    val pubKeyAsm = BitcoinScriptUtil
      .calculatePushOp(pubKey.bytes)
      .toVector ++ Vector(ScriptConstant(pubKey.bytes))
    val timeoutPubKeyAsm = BitcoinScriptUtil
      .calculatePushOp(timeoutPubKey.bytes)
      .toVector ++ Vector(ScriptConstant(timeoutPubKey.bytes))

    P2PKWithTimeoutScriptPubKeyImpl(
      Vector(Vector(OP_IF),
             pubKeyAsm,
             Vector(OP_ELSE),
             timeoutAsm,
             timeoutPubKeyAsm,
             Vector(OP_ENDIF, OP_CHECKSIG)).flatten
    )
  }

  override def isValidAsm(asm: Seq[ScriptToken]): Boolean = {
    if (asm.length == 12) {
      val pubKey = ECPublicKey.fromBytes(asm(2).bytes)
      val lockTimeTry = Try(ScriptNumber.fromBytes(asm(5).bytes))
      val timeoutPubKey = ECPublicKey.fromBytes(asm(9).bytes)

      lockTimeTry match {
        case Success(lockTime) =>
          asm == P2PKWithTimeoutScriptPubKey(pubKey, lockTime, timeoutPubKey).asm
        case Failure(_) => false
      }
    } else {
      false
    }
  }
}
```

## Step 3: Add to Relevant fromAsm Methods

We now need to ensure that `ScriptPubKey.fromAsm(p2pkWithTimeoutSPK.asm)` returns our type. Since `P2PKWithTimeoutScriptPubKey extends RawScriptPubKey`, this means we must add to `RawScriptPubKey.fromAsm`. Note that order in this function's `match` can matter. Since our type is more specific than any other currently existing type, we put our new `case` at the top:

```scala
asm match {
    case Nil => EmptyScriptPubKey
    case _ if P2PKWithTimeoutScriptPubKey.isValidAsm(asm) =>
      P2PKWithTimeoutScriptPubKey.fromAsm(asm)
    //...
}
```

## Step 4: Create a ScriptSignature If Necessary

Often times a new `ScriptSignature` type will be necessary when introducing a new `ScriptPubKey` type. When this is the case, the procedure for adding a new `ScriptSignature` is more or less identical to steps 1 and 2 above. Here is what this looks like for `P2PKScriptPubKey` (note, this is not `P2PKWithTimeoutScriptPubKey`):

```scala
/**
  * Represents a pay to public key script signature
  * https://bitcoin.org/en/developer-guide#pubkey
  * Signature script: <sig>
  */
sealed trait P2PKScriptSignature extends ScriptSignature {

  /** PubKey scriptSignatures only have one signature */
  def signature: ECDigitalSignature = signatures.head

  /** The digital signatures inside of the scriptSig */
  def signatures: Seq[ECDigitalSignature] = {
    Seq(ECDigitalSignature(BitcoinScriptUtil.filterPushOps(asm).head.hex))
  }

  override def toString = s"P2PKScriptSignature($signature)"
}

object P2PKScriptSignature extends ScriptFactory[P2PKScriptSignature] {
  private case class P2PKScriptSignatureImpl(
      override val asm: Vector[ScriptToken])
      extends P2PKScriptSignature

  def fromAsm(asm: Seq[ScriptToken]): P2PKScriptSignature = {
    buildScript(asm.toVector,
                P2PKScriptSignatureImpl(_),
                "The given asm tokens were not a p2pk script sig: " + asm)
  }

  def apply(signature: ECDigitalSignature): P2PKScriptSignature = {
    val pushOps = BitcoinScriptUtil.calculatePushOp(signature.bytes)
    val signatureConstant = ScriptConstant(signature.bytes)
    val asm = pushOps ++ Seq(signatureConstant)
    P2PKScriptSignature.fromAsm(asm)
  }

  /** P2PK scriptSigs always have the pattern [pushop, digitalSignature] */
  override def isValidAsm(asm: Seq[ScriptToken]): Boolean = asm match {
    case Seq(_: BytesToPushOntoStack, _: ScriptConstant) => true
    case _                                               => false
  }
}
```

However, it is sometimes not necessary to create a new `ScriptSignature` type for every new `ScriptPubKey`. This is because we want to maintain unique representations for every `ScriptSignature`, and it turns out that in our case of `P2PKWithTimeoutScriptPubKey`, script signatures are of the form

```
<boolean> <signautre>
```

which is already represented by `ConditionalScriptSignature`. When this happens, you only need to create an `object` for your new type, and then follow step 2 above, skipping the first part (adding an Impl `case class`):

```scala
object P2PKWithTimeoutScriptSignature
    extends ScriptFactory[ConditionalScriptSignature] {
  override def fromAsm(asm: Seq[ScriptToken]): ConditionalScriptSignature = {
    buildScript(
      asm.toVector,
      ConditionalScriptSignature.fromAsm,
      s"The given asm tokens were not a P2PKWithTimeoutScriptSignature, got $asm"
    )
  }

  def apply(
      beforeTimeout: Boolean,
      signature: ECDigitalSignature): ConditionalScriptSignature = {
    ConditionalScriptSignature(P2PKScriptSignature(signature), beforeTimeout)
  }

  override def isValidAsm(asm: Seq[ScriptToken]): Boolean = {
    P2PKScriptSignature.isValidAsm(asm.dropRight(1)) && ConditionalScriptSignature
      .isValidAsm(asm)
  }
}
```

Remember that in all of them above, `ScriptSignature`s are written as if they are to appear on-chain in transaction inputs rather than transaction witnesses, since Bitcoin-S supports turning any raw `ScriptSignature` into a `P2WSHWitness` without requiring explicit support for new script types.

## Step 5: Add to ScriptSignature.fromAsm If Applicable

If you added a new `ScriptSignature` type in the previous step, you must add a `case` to the `match` statement in `ScriptSignature.fromAsm` at the bottom of `ScriptSignature.scala`. For `P2PKScriptSignature` (note that this does not apply to `P2PKWithTimeoutScriptSignature` since there is no new unique type for this `ScriptSignature`), this looks like:

```scala
tokens match {
  //...
  case _ if P2PKScriptSignature.isValidAsm(tokens) =>
      P2PKScriptSignature.fromAsm(tokens)
  //...
}
```

## Step 6: Create Relevant InputInfo

`InputInfo` is the Bitcoin-S data structure for the information required to spend from a specific condition of a given `ScriptPubKey` other than private keys. Hence, when defining new script types, it is important to define how they are spent as well so that they can be useful.

There are two distinct kinds of scripts when it comes to signing in Bitcoin-S: scripts that have nesting (such as `ConditionalScriptPubKey`, `P2SHScriptPubKey`) and scripts without nesting (such as `MultiSignatureScriptPubKey`, `P2PKWithTimeoutScriptPubKey`, `P2PKHScriptPubKey`). We will cover each of these cases in turn, starting with the latter case as it applies to our example of `P2PKWithTimeout`. In both cases, please make sure to validate any parameter data using `require` statements when necessary, but make things correct by construction instead whenever possible. For example, if there is a redeem script and a `ScriptPubKey` which must wrap this redeem script, take as a parameter only the redeem script and construct the `ScriptPubKey` internally so that it is sure to be consistent.

### Non-Nesting Input Info

We create a new `case class` in `InputInfo.scala` which extends `RawInputInfo` and which contains in its parameters, all of the info required for spending a specific condition other than private keys and `HashType`. Here is what this looks like for `P2PKWithTimeout`:

```scala
case class P2PKWithTimeoutInputInfo(
    outPoint: TransactionOutPoint,
    amount: CurrencyUnit,
    scriptPubKey: P2PKWithTimeoutScriptPubKey,
    isBeforeTimeout: Boolean)
    extends RawInputInfo {
  override def conditionalPath: ConditionalPath = {
    if (isBeforeTimeout) {
      ConditionalPath.nonNestedTrue
    } else {
      ConditionalPath.nonNestedFalse
    }
  }

  override def pubKeys: Vector[ECPublicKey] =
    Vector(scriptPubKey.pubKey, scriptPubKey.timeoutPubKey)
}
```

### Nested Spending Info

The one new thing in the nested case is that we must create a `val nestedSpendingInfo: RawInputInfo` and make sure to pass on `hashPreImages: Vector[NetworkElement]` to the nested `InputInfo`, and pull public keys from the `nestedInputInfo`. For the case of spending `LockTimeScriptPubKey`s, this looks like the following:

```scala
case class LockTimeInputInfo(
    outPoint: TransactionOutPoint,
    amount: CurrencyUnit,
    scriptPubKey: LockTimeScriptPubKey,
    conditionalPath: ConditionalPath,
    hashPreImages: Vector[NetworkElement] = Vector.empty
) extends RawInputInfo {

  val nestedInputInfo: RawInputInfo = RawInputInfo(
    outPoint,
    amount,
    scriptPubKey.nestedScriptPubKey,
    conditionalPath,
    hashPreImages)

  override def pubKeys: Vector[ECPublicKey] = nestedInputInfo.pubKeys
}
```

## Step 7: Add to Relevant Apply Methods

Now that we have created our new `RawInputInfo`, we need to add them to the general-purpose input info constructors. This means adding a `case` to `RawInputInfo.apply` for your new `ScriptPubKey` type which constructs your relevant `RawInputInfo` from generic types (given as parameters in the `apply` methods). For `P2PKWithTimeout`, this looks like the following:

```scala
scriptPubKey match {
      //...
      case p2pkWithTimeout: P2PKWithTimeoutScriptPubKey =>
              conditionalPath.headOption match {
                case None =>
                  throw new IllegalArgumentException(
                    "ConditionalPath must be specified for P2PKWithTimeout")
                case Some(beforeTimeout) =>
                  P2PKWithTimeoutInputInfo(outPoint,
                                           amount,
                                           p2pkWithTimeout,
                                           beforeTimeout)
              }
      //...
    }
```

## Step 8: Create a Signer

We must now add signing functionality for our new script type within `Signer.scala`. This time, we have three different cases depending on your new script type.

### Non-Nested Single-Key Spending Info

For the non-nested case where only a single key is required, all we must do is create a new class which extends `RawSingleKeyBitcoinSigner` and implements `keyAndSigToScriptSig`. For `P2PKWithTimeout` this looks like the following:

```scala
sealed abstract class P2PKWithTimeoutSigner
    extends RawSingleKeyBitcoinSigner[P2PKWithTimeoutInputInfo] {

  override def keyAndSigToScriptSig(
      key: ECPublicKey,
      sig: ECDigitalSignature,
      spendingInfo: UTXOInfo[P2PKWithTimeoutInputInfo]): ScriptSignature = {
    P2PKWithTimeoutScriptSignature(spendingInfo.inputInfo.isBeforeTimeout, sig)
  }
}

object P2PKWithTimeoutSigner extends P2PKWithTimeoutSigner
```

### Non-Nested Multi-Key Spending Info

In the non-nested case where multiple keys are required, we must create a new `Signer`, which requires implementing the `sign` function. For `MultiSignature` this looks like the following:

```scala
sealed abstract class MultiSigSigner extends Signer[MultiSignatureInputInfo] {

  override def sign(
      spendingInfo: UTXOSatisfyingInfo[InputInfo],
      unsignedTx: Transaction,
      isDummySignature: Boolean,
      spendingInfoToSatisfy: UTXOSatisfyingInfo[MultiSignatureInputInfo])(
      implicit ec: ExecutionContext): Future[TxSigComponent] = {
    val (_, output, inputIndex, _) =
      relevantInfo(spendingInfo, unsignedTx)

    val keysAndSigsF = spendingInfo.toSingles.map { spendingInfoSingle =>
      signSingle(spendingInfoSingle, unsignedTx, isDummySignature)
    }

    val signaturesF = Future.sequence(keysAndSigsF).map(_.map(_.signature))

    val scriptSigF = signaturesF.map { sigs =>
      MultiSignatureScriptSignature(sigs)
    }

    updateScriptSigInSigComponent(unsignedTx,
                                  inputIndex.toInt,
                                  output,
                                  scriptSigF)
  }
}

object MultiSigSigner extends MultiSigSigner
```

### Nested Spending Info

When signing for a nested script structure, we must create a new `Signer`. You will need to make a delegating call with the `nestedSpendingInfo` to `BitcoinSigner.sign`, but you may also need to do whatever else is needed with the nested result to construct a correct `ScriptSignature`. For `ConditionalScriptSignature`, this all looks like:

```scala
/** Delegates to get a ScriptSignature for the case being
  * spent and then adds an OP_TRUE or OP_FALSE
  */
sealed abstract class ConditionalSigner extends Signer[ConditionalInputInfo] {

  override def sign(
      spendingInfo: UTXOSatisfyingInfo[InputInfo],
      unsignedTx: Transaction,
      isDummySignature: Boolean,
      spendingInfoToSatisfy: UTXOSatisfyingInfo[ConditionalInputInfo])(
      implicit ec: ExecutionContext): Future[TxSigComponent] = {
    val (_, output, inputIndex, _) = relevantInfo(spendingInfo, unsignedTx)

    val nestedSpendingInfo = spendingInfoToSatisfy.copy(
      inputInfo = spendingInfoToSatisfy.inputInfo.nestedInputInfo)

    val missingOpSigComponentF = BitcoinSigner.sign(spendingInfo,
                                                    unsignedTx,
                                                    isDummySignature,
                                                    nestedSpendingInfo)

    val scriptSigF = missingOpSigComponentF.map { sigComponent =>
      ConditionalScriptSignature(sigComponent.scriptSignature,
                                 spendingInfoToSatisfy.inputInfo.condition)
    }

    updateScriptSigInSigComponent(unsignedTx,
                                  inputIndex.toInt,
                                  output,
                                  scriptSigF)
  }
}
object ConditionalSigner extends ConditionalSigner
```

## Step 9: Add to BitcoinSigner.sign

We must now add the new signing functionality from the previous step to the general-purpose signing functions by adding a new `case` for your new `InputInfo` type in the `match` within `BitcoinSigner.sign`. In the case of `P2PKWithTimeout`, this looks like:

```scala
spendingInfoToSatisfy match {
      //...
      case p2pKWithTimeout: P2PKWithTimeoutInputInfo =>
              P2PKWithTimeoutSigner.sign(spendingInfo,
                                         unsignedTx,
                                         isDummySignature,
                                         spendingFrom(p2pKWithTimeout))
      //...
    }
```

We have now fully implemented the new script type! But have we done it correctly? We must now add the new script type to the Bitcoin-S test framework so that our scripts get added to existing Bitcoin-S property-based tests.

## Step 10: Add to ScriptGenerators

The first step to adding our new script type to Bitcoin-S property-based tests is creating generators for our new `ScriptPubKey` and `ScriptSignature` types in `ScriptGenerators.scala`.

It is important to note that in the current Bitcoin-S generator framework for `ScriptPubKey`s, all conditionals always spend only their `OP_TRUE` cases.

### ScriptPubKey Generator

Let's start by creating a generator for our `ScriptPubKey`, this generator should also return the private keys that were used to create the `ScriptPubKey`. To construct this `Gen`, you will likely need to use other generators for the internal structures in your script such as keys and lock times. For `P2PKWithTimeout` this looks like:

```scala
def p2pkWithTimeoutScriptPubKey: Gen[
    (P2PKWithTimeoutScriptPubKey, Seq[ECPrivateKey])] =
    for {
      privKey <- CryptoGenerators.privateKey
      timeoutPrivKey <- CryptoGenerators.privateKey
      lockTime <- NumberGenerator.timeLockScriptNumbers
    } yield {
      (P2PKWithTimeoutScriptPubKey(privKey.publicKey,
                                   lockTime,
                                   timeoutPrivKey.publicKey),
       Vector(privKey, timeoutPrivKey))
    }
```

Note that the private key used in the `OP_TRUE` case is the `head` of the `Seq[ECPrivateKey]` returned. This makes it possible for tests that only spend the `OP_TRUE` case to find the correct key, as it is expected to be the first one.

We must now add this `Gen` to all of the following `def`s in `ScriptGenerators.scala`: `randomNonP2SHScriptPubKey, scriptPubKey, nonWitnessScriptPubKey, nonConditionalRawScriptPubKey, rawScriptPubKey`, and if your `ScriptPubKey` has no lock times, you must also add the above `Gen` to `nonConditionalNonLocktimeRawScriptPubKey, nonLocktimeRawScriptPubKey` as well.

### ScriptSignature Generator

We must also create a generator for our `ScriptSignature` type, even if we did not introduce a new `ScriptSignature` type (in our example of `P2PKWithTimeout` we use a specific form of `ConditionalScriptSignature`). Once again you will likely need to use other existing generators. For `P2PKWithTimeoutScriptSignature`, this looks like:

```scala
def p2pkWithTimeoutScriptSignature: Gen[ConditionalScriptSignature] =
    for {
      privKey <- CryptoGenerators.privateKey
      hash <- CryptoGenerators.doubleSha256Digest
      hashType <- CryptoGenerators.hashType
      signature = ECDigitalSignature.fromBytes(
        privKey.sign(hash).bytes ++ ByteVector.fromByte(hashType.byte))
      beforeTimeout <- NumberGenerator.bool
    } yield P2PKWithTimeoutScriptSignature(beforeTimeout, signature)
```

We now add this `Gen` to `scriptSignature: Gen[ScriptSignature]` as well as adding a case for our new `ScriptPubKey` type in `pickCorrespondingScriptSignature` which should return our new `ScriptSignature` generator.  If our `ScriptPubKey` does not have any lock times, you should also add this script signature `Gen` to `nonLockTimeConditionalScriptSignature` and `randomNonLockTimeScriptSig`.

### ScriptPubKey with Paired ScriptSignature Generator

Lastly, we need to construct a generator that returns both a `ScriptPubKey` and a `ScriptSignature` signing that that `ScriptPubKey`. All keys used in signing should also be returned. This all should be done by using the above `ScriptPubKey` generator, then constructing an `ScriptSignature` for your type where all actual signatures are `EmptyDigitalSignature`s. A `UTXOSatisfyingInfo` should then be constructed for the generated `ScriptPubKey` (using the private keys generated in the same line). Finally, a `TxSignatureComponent` should be created by using the new `Signer` for our script type. From this `TxSignatureComponent`, a `ScriptSignature` is readily available. For `P2PKWithTimeout`, this generator looks like:

```scala
def signedP2PKWithTimeoutScriptSignature: Gen[
    (ConditionalScriptSignature, P2PKWithTimeoutScriptPubKey, ECPrivateKey)] =
    for {
      (spk, privKeys) <- p2pkWithTimeoutScriptPubKey
      hashType <- CryptoGenerators.hashType
    } yield {
      val emptyScriptSig = P2PKWithTimeoutScriptSignature(beforeTimeout = true,
                                                          EmptyDigitalSignature)
      val (creditingTx, outputIndex) =
        TransactionGenerators.buildCreditingTransaction(spk)
      val (spendingTx, inputIndex) = TransactionGenerators
        .buildSpendingTransaction(creditingTx, emptyScriptSig, outputIndex)
      val spendingInfo = UTXOSatisfyingInfo(
        P2PKWithTimeoutInputInfo(
          TransactionOutPoint(creditingTx.txIdBE, inputIndex),
          creditingTx.outputs(outputIndex.toInt).value,
          spk,
          isBeforeTimeout = true),
        privKeys.toVector,
        hashType
      )
      val txSigComponentF = P2PKWithTimeoutSigner.sign(spendingInfo,
                                                       spendingTx,
                                                       isDummySignature = false)
      val txSigComponent = Await.result(txSigComponentF, timeout)
      val signedScriptSig =
        txSigComponent.scriptSignature.asInstanceOf[ConditionalScriptSignature]

      (signedScriptSig, spk, privKeys.head)
    }
```

I strongly advise you also look at at least one other `Gen` of this kind before writing your own.

## Step 11: Add to CreditingTxGen

Now that we have generators constructed for `ScriptPubKey`s, `ScriptSignature`s and their pairings completed, we will create a generator for our type's `SpendingInfoFull`. This should usually be as simple as mapping on the `ScriptPubKey` generator in `ScriptGenerators` and calling `build` (within `CreditinTxGen.scala`). We then also create another generator which returns lists of `SpendingInfo`s generated by the previous `Gen`. For `P2PKWithTimeout`, this looks like:

```scala
def p2pkWithTimeoutOutput: Gen[UTXOSatisfyingInfo[InputInfo]] = {
    ScriptGenerators.p2pkWithTimeoutScriptPubKey.flatMap { p2pkWithTimeout =>
      build(p2pkWithTimeout._1, Seq(p2pkWithTimeout._2.head), None, None)
    }
  }

  def p2pkWithTimeoutOutputs: Gen[Seq[UTXOSatisfyingInfo[InputInfo]]] = {
    Gen.choose(min, max).flatMap(n => Gen.listOfN(n, p2pkWithTimeoutOutput))
  }
```

We must then add our output `Gen` to one of `cltvOutputGens` or `nonCLTVOutputGens` depending on whether the `ScriptPubKey` type has CLTVs (absolute lock times) or not. We must also add our output `Gen` to `nonP2SHOutput`, and also to `nonSHOutput` and `nonP2WSHOutput` in the case that your `ScriptPubKey` type has no CLTVs.

## Step 12: Fix all Non-Exhaustive Matches

All we have left is to clean up our code and make sure that nothing has been missed. Within an `sbt` terminal, you should run the following sequence of commands:

```bashrc
clean
project coreTest
test:compile
```

This should have quite a lengthy output but we are only interested in any compiler errors there may be, as well as non-exhaustive match compiler warnings. You should first fix any compiler errors you encounter, and then you can get the warnings again by running `clean` and then running `test:compile` again.

The warnings we're interested in should look something like this:

```
[warn] /home/nkohen/Desktop/SuredBits/bitcoin-s-core/testkit/src/main/scala/org/bitcoins/testkit/core/gen/ScriptGenerators.scala:524:59: match may not be exhaustive.
[warn] It would fail on the following input: P2PKWithTimeoutScriptPubKeyImpl(_)
[warn]       scriptPubKey: ScriptPubKey): Gen[ScriptSignature] = scriptPubKey match {
[warn]                                                           ^
[warn] one warning found
```

You may get these warnings for your new `ScriptSignature` type as well. These are places where the compiler expects there to be defined functionality in a pattern match where one of our new types is a possibility, but for which no functionality is defined. You must go to each of these warnings and add a `case` for the relevant new type, or add this new type to an existing case when applicable.

## Step 13: Run tests and debug

Lastly, once everything is compiling nicely, all that is left is to run tests and debug. While within an `sbt` terminal session, run the following two commands to run the relevant tests:

```
project coreTest
test
```

If all tests pass we are all done! If you encounter any test failures, you can re-run individual tests using the `testOnly` command which must be given the full name of the test you wish to run (these names should be at the bottom of the testing output and look something like `org.bitcoins.core.script.interpreter.ScriptInterpreterTest`).


text:
#ifndef INTERNAL_STATIC_ASSERT_H                         /*-*-C-*-vi:se ft=c:*/
#define INTERNAL_STATIC_ASSERT_H
/**
 * @author     Ruby developers <ruby-core@ruby-lang.org>
 * @copyright  This  file  is   a  part  of  the   programming  language  Ruby.
 *             Permission  is hereby  granted,  to  either redistribute  and/or
 *             modify this file, provided that  the conditions mentioned in the
 *             file COPYING are met.  Consult the file for details.
 * @brief      C11 shim for _Static_assert.
 */
#include "ruby/internal/static_assert.h"
#ifndef STATIC_ASSERT
# define STATIC_ASSERT RBIMPL_STATIC_ASSERT
#endif

#endif /* INTERNAL_STATIC_ASSERT_H */


text:
<?php

namespace Elcodi\Component\StateTransitionMachine\Exception;

use Exception;

/**
 * Class InconsistentTransitionConfigurationException.
 */
class InconsistentTransitionConfigurationException extends Exception
{
    /**
     * Exception constructor.
     *
     * @param string    $state      State name
     * @param string    $transition Transition name
     * @param int       $code       [optional] The Exception code.
     * @param Exception $previous   [optional] The previous exception used for the exception chaining. Since 5.3.0
     */
    public function __construct($state, $transition, $code = 0, Exception $previous = null)
    {
        $message = 'Given state "' . $state . '" only one transition with name "' . $transition . '" can be defined.';

        parent::__construct($message, $code, $previous);
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <title>Documentation / Protoplate</title>
    <link rel="icon" type="image/png" href="img/favicon.png">
    <link rel="stylesheet" type="text/css" href="/bower_components/flexboxgrid/dist/flexboxgrid.min.css">
    <link rel="stylesheet" type="text/css" href="/css/main.css">
    <link rel="stylesheet" href="demo/css/documentation.css">
    <link rel="stylesheet" href="demo/css/syntax-highlighting.css">

Flex
ColumnsAlignment

Col 01

Col 02

Col 03

Add as many

as you'd like..

Col 01

Col 02

Col 03

Col 01

Col 02

Col 03

Col 04

Col 05

Documentation

Thing's that I've probably spent too much time refactoring, and finally decided to record.

Columns

Just some basic flex-rows... The rest we'll roll on our own as needed

Without gutters

See the PenProtoplate - Columns / Without gutters by Tony Montemorano (@allusis) onCodePen

With gutters

See the PenProtoplate - Columns / With gutters by Tony Montemorano (@allusis) onCodePen

Wrap

Col 01

Col 02

Col 03

Col 04

Col 05

<!-- Typically in this scenario you'll probably want to add some
min or max width styles for the children unless the content is predictable. -->
<div class="flex wrap-all"></div>
<div class="flex wrap-sm"></div>
<div class="flex wrap-md"></div>
<div class="flex wrap-lg"></div>

Alignment

Alignment helpers get out of hand quickly for responsive design. All of these allignment options will require a size modifier in the class name to target all or minimum screen sizes. See examples below.

Space between

Col Left

Col Right

Space around

Col Left

Col Right

Copyright
             Protoplate

              <svg>
                <use xlink:href="demo/img/nav.svg#about"></use>
              </svg>About
              <svg>
                <use xlink:href="demo/img/nav.svg#documents"></use>
              </svg>Documentation


text:
'use strct'

const Error = require('../common/error');

class ObjectsValidator {
    constructor() { }

    static validateObjects(objectsToValidate) {
        objectsToValidate.forEach((element) => {
            if (typeof element !== 'object') {
                throw Error.INVALID_CACHE_OBJECT
            }
        });
    }
}

module.exports = ObjectsValidator


text:
from constants import *

def CreateKeyframe(parentframes, frame, variables):
	newframe = Keyframe(frame, variables)

	# Look for duplicate keyframes and copy other defined variables
	try:
		oldkey = (keyframe for keyframe in parentframes if keyframe.frame == frame).next()
	except StopIteration:
		oldkey = None

	if oldkey != None:
		for var in oldkey.variables.keys():  # For every variable defined by the old keyframe
			if (var not in newframe.variables or newframe.variables[var] == None) and (oldkey.variables[var] != None):  # If a variable is undefined, copy its value to the new keyframe
				newframe.variables[var] = oldkey.variables[var]

	# Remove the duplicate keyframe, if it existed
	for duplicate in (keyframe for keyframe in parentframes if keyframe.frame == frame):
		parentframes.remove(duplicate)
		break

	# Append the new keyframe then sort them all by frame
	parentframes.append(newframe)
	sortedframes = sorted(parentframes, key=lambda keyframe: keyframe.frame)
	parentframes[:] = sortedframes

	return newframe  # Return a reference to the new keyframe, in case it's needed

def ConsolidateKeyframes(parentframes, frame, variables):
	newframe = Keyframe(frame, variables)
	parentframes.append(newframe)

	finallist = []  # A truncated list of keyframes

	# Append all the frames which come after the current one to the final list
	for keyframe in parentframes:
		if keyframe.frame >= frame:
			finallist.append(keyframe)

	# Sort the keyframes and give them to the parent object
	sortedframes = sorted(finallist, key=lambda keyframe: keyframe.frame)
	parentframes[:] = sortedframes

class Keyframe:
	def __init__(self, frame = 0, variables = {}):
		self.frame = frame
		self.variables = variables

		if not ('interpolationtype' in self.variables):
			self.variables['interpolationtype'] = INTERPOLATIONTYPE_LINEAR


text:
title:  Toutes choses nouvelles
date:   24/12/2022
---

### Nous travaillons sur cette leçon.
Revenez plus tard, s'il vous plaît.


text: alias tf=terraform


text:
angular.module('app').factory('eventFact', function($http){
    var obj = {};
    obj.getEventList = function() {
        return $http.get("http://arcgis-CABHP-1819518128.us-west-1.elb.amazonaws.com:3000" + "/events");
    };

    return obj;
});