text:
"""Handles builtins and other special functions."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import gast

from tensorflow.contrib.autograph.pyct import templates
from tensorflow.contrib.autograph.pyct import transformer

class BuiltinFunctionTransformer(transformer.Base):
  """Handles builtin functions.

  This transformer only covers functions that are translated into a
  TF equivalent, like `len`.
  """

  def __init__(self, context):
    super(BuiltinFunctionTransformer, self).__init__(context)

  # pylint:disable=invalid-name

  def _convert_builtin(self, node):
    template = """
      autograph_utils.dynamic_builtin(func, args)
    """
    return templates.replace(template, func=node.func, args=node.args)[0].value

  def _convert_print(self, node):
    template = """
      autograph_utils.dynamic_print(args)
    """
    return templates.replace(template, args=node.args)[0].value

  def visit_Call(self, node):
    self.generic_visit(node)
    # TODO(mdan): This won't work if the function was hidden.
    if isinstance(node.func, gast.Name) and node.func.id in ('len', 'range'):
      return self._convert_builtin(node)
    # Print needs to be handled separately because it can be read as statement.
    if isinstance(node.func, gast.Name) and node.func.id == 'print':
      return self._convert_print(node)
    return node

  def visit_Print(self, node):
    self.generic_visit(node)
    args = node.values
    # Following is the case when calling print(a, b)
    if len(args) == 1 and isinstance(args[0], gast.Tuple):
      args = args[0].elts
    template = """
      fname(args)
    """
    function_call = templates.replace(template, fname='print', args=args)[0]
    return self.visit(function_call)

  # pylint:enable=invalid-name

def transform(node, context):
  return BuiltinFunctionTransformer(context).visit(node)


text:
using System;
using Eto.Forms;
using Eto.Drawing;

#if XAMMAC2
using AppKit;
using Foundation;
using CoreGraphics;
using ObjCRuntime;
using CoreAnimation;
#elif OSX
using MonoMac.AppKit;
using MonoMac.Foundation;
using MonoMac.CoreGraphics;
using MonoMac.ObjCRuntime;
using MonoMac.CoreAnimation;
#if Mac64
using CGSize = MonoMac.Foundation.NSSize;
using CGRect = MonoMac.Foundation.NSRect;
using CGPoint = MonoMac.Foundation.NSPoint;
using nfloat = System.Double;
using nint = System.Int64;
using nuint = System.UInt64;
#else
using CGSize = System.Drawing.SizeF;
using CGRect = System.Drawing.RectangleF;
using CGPoint = System.Drawing.PointF;
using nfloat = System.Single;
using nint = System.Int32;
using nuint = System.UInt32;
#endif
#endif

#if IOS
using NSResponder = UIKit.UIResponder;
using NSView = UIKit.UIView;
using Eto.iOS.Forms;
using UIKit;
using Foundation;
using CoreGraphics;
#elif OSX
using Eto.Mac.Forms.Menu;
#endif

namespace Eto.Mac.Forms
{

	public abstract class MacPanel<TControl, TWidget, TCallback> : MacContainer<TControl, TWidget, TCallback>, Panel.IHandler
		where TControl: NSObject
		where TWidget: Panel
		where TCallback: Panel.ICallback
	{
		Control content;
		Padding padding;

		public Padding Padding
		{
			get { return padding; }
			set
			{
				padding = value;
				LayoutParent();
			}
		}

		#if OSX
		protected virtual NSViewResizingMask ContentResizingMask()
		{
			return NSViewResizingMask.HeightSizable | NSViewResizingMask.WidthSizable;
		}
		#endif

		public Control Content
		{
			get { return content; }
			set
			{
				if (content != null)
				{
					var oldContent = content.GetContainerView();
					oldContent.RemoveFromSuperview();
				}

				content = value;
				var control = value.GetContainerView();
				if (control != null)
				{
					var container = ContentControl;
#if OSX
					control.AutoresizingMask = ContentResizingMask();
					control.Frame = new CGRect(ContentControl.Bounds.X, ContentControl.Bounds.Y, ContentControl.Bounds.Width, ContentControl.Bounds.Height);
					container.AddSubview(control); // default
#elif IOS
					control.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
					control.Frame = new CGRect(0, 0, ContentControl.Bounds.Width, ContentControl.Bounds.Height);
					this.AddChild(value);
#endif
				}

				if (Widget.Loaded)
				{
					LayoutParent();
				}
			}
		}

#if OSX
		ContextMenu contextMenu;
		public ContextMenu ContextMenu
		{
			get { return contextMenu; }
			set
			{
				contextMenu = value;
				EventControl.Menu = contextMenu != null ? ((ContextMenuHandler)contextMenu.Handler).Control : null;
			}
		}
#else
		public virtual ContextMenu ContextMenu
		{
			get
			{
				throw new NotImplementedException();
			}
			set
			{
				throw new NotImplementedException();
			}
		}
#endif
		protected override SizeF GetNaturalSize(SizeF availableSize)
		{
			if (content == null || !content.Visible)
				return Padding.Size;

			var contentControl = content.GetMacControl();
			if (contentControl != null)
				return contentControl.GetPreferredSize(availableSize) + Padding.Size;
			return Padding.Size;
		}

		protected virtual CGRect GetContentBounds()
		{
			return ContentControl.Bounds;
		}

		protected virtual CGRect AdjustContent(CGRect rect)
		{
			return rect;
		}

		public override void LayoutChildren()
		{
			base.LayoutChildren();

			if (content == null)
				return;

			NSView childControl = content.GetContainerView();
			var frame = GetContentBounds();

			if (frame.Width > padding.Horizontal && frame.Height > padding.Vertical)
			{
				frame.X += padding.Left;
				frame.Width -= padding.Horizontal;
				frame.Y += padding.Bottom;
				frame.Height -= padding.Vertical;
			}
			else
			{
				frame.X = 0;
				frame.Y = 0;
			}
			frame = AdjustContent(frame);

			if (childControl.Frame != frame)
				childControl.Frame = frame;
		}

		public override void SetContentSize(CGSize contentSize)
		{
			base.SetContentSize(contentSize);
			if (MinimumSize != Size.Empty)
			{
				contentSize.Width = (nfloat)Math.Max(contentSize.Width, MinimumSize.Width);
				contentSize.Height = (nfloat)Math.Max(contentSize.Height, MinimumSize.Height);
			}
			if (Widget.Content != null)
			{
				var child = Widget.Content.Handler as IMacContainer;
				if (child != null)
				{
					child.SetContentSize(contentSize);
				}
			}
		}

		bool isResizing;

		void HandleSizeChanged(object sender, EventArgs e)
		{
			if (!isResizing)
			{
				isResizing = true;
				LayoutChildren();
				isResizing = false;
			}
		}

		public override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);
			LayoutChildren();
			Widget.SizeChanged += HandleSizeChanged;
		}

		public override void OnUnLoad(EventArgs e)
		{
			base.OnUnLoad(e);
			Widget.SizeChanged -= HandleSizeChanged;
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper.rb'

describe Task do
    it 'starts off with no tasks' do
        Task.all.should eq []
    end

    it 'is initialized with a name and a list ID' do
        task = Task.new('learn SQL', 1)
        task.should be_an_instance_of Task
    end

    it 'tells you its name' do
        task = Task.new('learn SQL', 1)
        task.name.should eq 'learn SQL'
    end

    it 'lets you save tasks to the database' do
        task = Task.new('learn SQL', 1)
        task.save
        Task.all.should eq [task]
    end

    it 'is the same task if it has the same name and ID' do
        task1 = Task.new('learn SQL', 1)
        task2 = Task.new('learn SQL', 1)
        task1.should eq task2
    end
end


text:
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';

export default createSvgIcon(
  <path d="M21 7H3v10h18V7zm-2 8H5V9h14v6z" />
, 'Crop75Sharp');


text:
package com.kigo.examsys.bean;

public class userBean {
	private static final long serialVersionUID = 1L;
	private int id;
	private String username;
	private String name;

	public userBean(){}
	public userBean(int id, String username, String name){
		this.id = id;
		this.username = username;
		this.name = name;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

}


text:
layout: post
title:  "hushaw"
date:   2014-01-23 01:42:00
homepage: https://github.com/hushaw/hushaw.github.com
download: https://github.com/hushaw/hushaw.github.com/archive/master.zip
demo: http://hushaw.github.io
author: signifox
thumbnail: hushaw.png
license: MIT License
license_link: https://github.com/hushaw/hushaw.github.com/blob/master/LICENCE
---

I just want to develop a minimal jekyll theme, and now i figure it out. It 's free, just for fun.

This demo containes some chinese characters.


text:
<?php

namespace Amadeus\Client\Struct\PointOfRef\Search;

/**
 * GeoCode
 *
 * @package Amadeus\Client\Struct\PointOfRef\Search
 * @author Dieter Devlieghere <dermikagh@gmail.com>
 */
class GeoCode
{
    /**
     * Number of 1/100000 degrees east of Greenwich (positive values) or west of Greenwich (negative values).
     *
     * @var double
     */
    public $longitude;

    /**
     * Number of 1/100000 degrees north of Equator (positive values) or south of Equator (negative values).
     *
     * @var double
     */
    public $latitude;

    /**
     * GeoCode constructor.
     *
     * @param double|null $longitude
     * @param double|null $latitude
     */
    public function __construct($longitude = null, $latitude = null)
    {
        $this->longitude = $longitude;
        $this->latitude = $latitude;
    }
}


text:
package com.tom.thirdparty.jei;

import java.awt.Rectangle;
import java.util.List;

import com.tom.storage.tileentity.gui.GuiTerminalBase;

import mezz.jei.api.gui.IAdvancedGuiHandler;

public class GuiTerminalHandler implements IAdvancedGuiHandler<GuiTerminalBase> {

	@Override
	public Class<GuiTerminalBase> getGuiContainerClass() {
		return GuiTerminalBase.class;
	}

	@Override
	public List<Rectangle> getGuiExtraAreas(GuiTerminalBase guiContainer) {
		return null;
	}

	@Override
	public Object getIngredientUnderMouse(GuiTerminalBase gui, int mouseX, int mouseY) {
		return gui.getStackUnderMouse(mouseX, mouseY);
	}

}


text:
from cinder.api import common
from cinder.api import extensions
from cinder.api import microversions as mv
from cinder.api.openstack import wsgi
from cinder import exception
from cinder.i18n import _

class ManageResource(object):
    """Mixin class for v3 of ManageVolume and ManageSnapshot.

    It requires that any class inheriting from this one has `volume_api` and
    `_list_manageable_view` attributes.
    """
    VALID_SORT_KEYS = {'reference', 'size'}
    VALID_SORT_DIRS = {'asc', 'desc'}

    def _set_resource_type(self, resource):
        self._authorizer = extensions.extension_authorizer(resource,
                                                           'list_manageable')
        self.get_manageable = getattr(self.volume_api,
                                      'get_manageable_%ss' % resource)

    def _ensure_min_version(self, req, allowed_version):
        version = req.api_version_request
        if not version.matches(allowed_version, None):
            raise exception.VersionNotFoundForAPIMethod(version=version)

    def _get_resources(self, req, is_detail):
        self._ensure_min_version(req, mv.MANAGE_EXISTING_LIST)

        context = req.environ['cinder.context']
        self._authorizer(context)

        params = req.params.copy()
        cluster_name, host = common.get_cluster_host(
            req, params, mv.MANAGE_EXISTING_CLUSTER)
        marker, limit, offset = common.get_pagination_params(params)
        sort_keys, sort_dirs = common.get_sort_params(params,
                                                      default_key='reference')

        # These parameters are generally validated at the DB layer, but in this
        # case sorting is not done by the DB
        invalid_keys = set(sort_keys).difference(self.VALID_SORT_KEYS)
        if invalid_keys:
            msg = _("Invalid sort keys passed: %s") % ', '.join(invalid_keys)
            raise exception.InvalidParameterValue(err=msg)

        invalid_dirs = set(sort_dirs).difference(self.VALID_SORT_DIRS)
        if invalid_dirs:
            msg = _("Invalid sort dirs passed: %s") % ', '.join(invalid_dirs)
            raise exception.InvalidParameterValue(err=msg)

        resources = self.get_manageable(context, host, cluster_name,
                                        marker=marker, limit=limit,
                                        offset=offset, sort_keys=sort_keys,
                                        sort_dirs=sort_dirs)
        view_builder = getattr(self._list_manageable_view,
                               'detail_list' if is_detail else 'summary_list')
        return view_builder(req, resources, len(resources))

    @wsgi.extends
    def index(self, req):
        """Returns a summary list of volumes available to manage."""
        return self._get_resources(req, False)

    @wsgi.extends
    def detail(self, req):
        """Returns a detailed list of volumes available to manage."""
        return self._get_resources(req, True)


text:
module BackwardChaining (
  resolve
  ) where

import Control.Monad.Trans.State.Lazy as S (
  get,
  modify,
  runState
  )

import Control.Monad.Trans.Reader (
  ask,
  runReaderT
  )

import Control.Monad.Except (
  throwError,
  runExceptT
  )

import Control.Monad.Trans.Class (lift)

import Types as T

import Inference

import Logic

import Prelude hiding(lookup, filter)

import Data.Map(insert, lookup, toList, fromList)

resolveRules :: Expr -> Resolution T.State
resolveRules goal = do
  rules <- lift ask
  let concernedRules = inferRules rules goal
  let evalRule state relation = do
        s <- state
        s' <- eval relation
        return (s @| s')
  foldl evalRule (return (Unsolved goal)) concernedRules

eval :: Relation -> Resolution T.State
eval (lhs `Imply` rhs) = do
  s <- evalExpr resolveFact lhs
  return (evalImplication rhs s)
eval _ = error "Unreachable Code"

evalGoal :: Expr -> Resolution T.State
evalGoal goal@(Fact c) = do
    (lift . lift . modify) (insert c (Unsolved goal))
    s <- resolveRules goal
    ns <- resolveRules (Not goal)
    let resultState = s `combineGoalAndOposite` ns
    either (throwError) (\s -> do {lift $ lift $ modify (insert c s) ; return s}) resultState

resolveFact :: Expr -> Resolution T.State
resolveFact fact@(Fact c) = do
  knowledge <- lift $ lift $ get
  maybe (evalGoal fact) (return) (lookup c knowledge)

getStateOfQueries :: [Expr] -> Resolution [(String, State)]
getStateOfQueries queries = do
  mapM_ resolveFact queries
  knowledge <- lift $ lift get
  return $ [ x | x@(f, s) <- toList knowledge, elem (Fact f) queries]
  --filterWithKey (\fact _ -> elem fact queries) (collectedKnowledge)

resolve :: ([Relation], [(String, State)], [Expr]) -> Either String [(String, State)]
resolve (rules, init, queries) =
  let knowledge = fromList init in
  fst $ runState (runReaderT (runExceptT (getStateOfQueries queries)) rules) knowledge


text:
pub fn main() {
    let s = "\u{lol}";
     //~^ ERROR invalid character in unicode escape: l
     //~^^ ERROR invalid character in unicode escape: o
     //~^^^ ERROR invalid character in unicode escape: l
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.thanapol.example;

import java.util.Scanner;

/**
 *
 * @author Muhammad
 */
public class For0perationDiv3
{
     public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter size  n : ");

        int size = scanner.nextInt();
        int count = 0;

        for(int i=1;i<=size;i++){
            if(i%3 == 0){
                count++;
            }
        }

        System.out.println("Result is "+count);
    }

}


text:
namespace ShortBus.Tests.Example
{
    using System;

    public class ConsoleWriter : IRequestHandler<PrintText, UnitType>
    {
        public UnitType Handle(PrintText request)
        {
            Console.WriteLine(request.Format, request.Args);

            return UnitType.Default;
        }
    }

    public class CommandWithResultHandler : IRequestHandler<CommandWithResult, string>
    {
        public string Handle(CommandWithResult command)
        {
            return "foo";
        }
    }
}


text:
package datadog

import (
	"encoding/json"
	"io/ioutil"
	"net/http"
	"os"
	"sync"
	"time"
)

// Client is the object that handles talking to the Datadog API. This maintains
// state information for a particular application connection.
type Client struct {
	apiKey, appKey, baseUrl string

	//The Http Client that is used to make requests
	HttpClient   *http.Client
	RetryTimeout time.Duration

	//Option to specify extra headers like User-Agent
	ExtraHeader map[string]string

	// rateLimiting is used to store the rate limitting stats.
	// More information in the official documentation: https://docs.datadoghq.com/api/?lang=bash#rate-limiting
	rateLimitingStats map[string]RateLimit
	// Mutex to protect the rate limiting map.
	m sync.Mutex
}

type RateLimit struct {
	Limit     string
	Period    string
	Reset     string
	Remaining string
}

// valid is the struct to unmarshal validation endpoint responses into.
type valid struct {
	Errors  []string `json:"errors"`
	IsValid bool     `json:"valid"`
}

// NewClient returns a new datadog.Client which can be used to access the API
// methods. The expected argument is the API key.
func NewClient(apiKey, appKey string) *Client {
	baseUrl := os.Getenv("DATADOG_HOST")
	if baseUrl == "" {
		baseUrl = "https://api.datadoghq.com"
	}

	return &Client{
		apiKey:            apiKey,
		appKey:            appKey,
		baseUrl:           baseUrl,
		HttpClient:        http.DefaultClient,
		RetryTimeout:      time.Duration(60 * time.Second),
		rateLimitingStats: make(map[string]RateLimit),
		ExtraHeader:       make(map[string]string),
	}
}

// SetKeys changes the value of apiKey and appKey.
func (c *Client) SetKeys(apiKey, appKey string) {
	c.apiKey = apiKey
	c.appKey = appKey
}

// SetBaseUrl changes the value of baseUrl.
func (c *Client) SetBaseUrl(baseUrl string) {
	c.baseUrl = baseUrl
}

// GetBaseUrl returns the baseUrl.
func (c *Client) GetBaseUrl() string {
	return c.baseUrl
}

// Validate checks if the API key (not the APP key) is valid.
func (client *Client) Validate() (bool, error) {
	var out valid
	var resp *http.Response

	uri, err := client.uriForAPI("/v1/validate")
	if err != nil {
		return false, err
	}

	req, err := http.NewRequest("GET", uri, nil)
	if err != nil {
		return false, err
	}
	req.Header.Set("DD-API-KEY", client.apiKey)
	if (client.appKey != "") {
		req.Header.Set("DD-APPLICATION-KEY", client.appKey)
	}

	resp, err = client.doRequestWithRetries(req, client.RetryTimeout)
	if err != nil {
		return false, err
	}

	defer resp.Body.Close()

	if resp.StatusCode == http.StatusForbidden {
		return false, nil
	}

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return false, err
	}

	if err = json.Unmarshal(body, &out); err != nil {
		return false, err
	}

	return out.IsValid, nil
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>R: Monthly Deaths from Lung Diseases in the UK</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="R.css">

deaths	R Documentation

Monthly Deaths from Lung Diseases in the UK

Description

A time series giving the monthly deaths from bronchitis,
emphysema and asthma in the UK, 1974-1979, both sexes (deaths),

Usage

deaths

Source

P. J. Diggle (1990)
Time Series: A Biostatistical Introduction.
Oxford, table A.3

References

Venables, W. N. and Ripley, B. D. (2002)
Modern Applied Statistics with S. Fourth edition.  Springer.

See Also

This the same as dataset ldeaths in R's datasets package.


text:
<!DOCTYPE html >

          <title>StreamlinedXmlEquality - ScalaTest 3.0.0 - org.scalatest.StreamlinedXmlEquality</title>
          <meta name="description" content="StreamlinedXmlEquality - ScalaTest 3.0.0 - org.scalatest.StreamlinedXmlEquality" />
          <meta name="keywords" content="StreamlinedXmlEquality ScalaTest 3.0.0 org.scalatest.StreamlinedXmlEquality" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
      <link href="../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />

org.scalatest

StreamlinedXmlEquality

            Related Docs:
            object StreamlinedXmlEquality
            | package scalatest

        trait

        StreamlinedXmlEquality extends AnyRef

Trait providing an implicit Equality[T] for subtypes
of scala.xml.NodeSeq that before testing for equality, will normalize left and right sides
by removing empty XML text nodes and trimming non-empty text nodes.

Here's an example of some unnormalized XML:

<summer>
  <day></day>
  <night>
    with lots of stars
  </night>
</summer>

Prior to testing it for equality, the implicit Equality[T] provided by this trait would transform
the above XML to:

<summer><day></day><night>with lots of stars</night></summer>

The goal of this trait is to provide an implicit Equality for XML that makes it easier to write tests involving XML.
White space is significant in XML, and is taken into account by the default equality for XML, accessed
by invoking the == method on an XML NodeSeq. Here's an example:

scala> val xmlElem = <summer><day></day><night>with lots of stars</night></summer>
xmlElem: scala.xml.Elem = <summer><day></day><night>with lots of stars</night></summer>

scala> import org.scalatest.Assertions._
import org.scalatest.Assertions._

scala> assert(xmlElem === <summer>
     |   <day></day>
     |     <night>
     |       with lots of stars
     |     </night>
     |   </summer>)
org.scalatest.exceptions.TestFailedException: <summer><day></day><night>with lots of stars</night></summer> did not equal <summer>
  <day></day>
    <night>
      with lots of stars
    </night>
  </summer>
  at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:500)
  at org.scalatest.Assertions$.newAssertionFailedException(Assertions.scala:1538)
  at org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:466)
  ... 53 elided

The above assertion fails because of whitespace differences in the XML.
When such whitespace differences are unimportant to the actual application, it can make it
easier to write readable test code if you can compare XML for equality without taking
into account empty text nodes, or leading and trailing whitespace in nonempty text nodes.
This trait provides an Equality[T]
instance that does just that:

scala> import org.scalatest.StreamlinedXmlEquality._
import org.scalatest.StreamlinedXmlEquality._

scala> assert(xmlElem === <summer>
     |   <day></day>
     |   <night>
     |     with lots of stars
     |   </night>
     | </summer>)

Source

StreamlinedXmlEquality.scala

          Linear Supertypes

AnyRef, Any

            Known Subclasses

StreamlinedXmlEquality

<input id="mbrsel-input" type="text" accesskey="/" />

              Ordering

Alphabetic

By Inheritance

                Inherited

StreamlinedXmlEquality

AnyRef

Any

Hide All

Show All

            Visibility

Public

All

Value Members

        final
        def

        !=(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        ##(): Int

Definition Classes

AnyRef → Any

        final
        def

        ==(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        final
        def

        asInstanceOf[T0]: T0

Definition Classes

Any

        def

        clone(): AnyRef

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        eq(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        def

        equals(arg0: Any): Boolean

Definition Classes

AnyRef → Any

        def

        finalize(): Unit

Attributes

protected[java.lang]

Definition Classes

AnyRef

Annotations

                @throws(

      classOf[java.lang.Throwable]
    )

        final
        def

        getClass(): Class[_]

Definition Classes

AnyRef → Any

        def

        hashCode(): Int

Definition Classes

AnyRef → Any

        final
        def

        isInstanceOf[T0]: Boolean

Definition Classes

Any

        final
        def

        ne(arg0: AnyRef): Boolean

Definition Classes

AnyRef

        final
        def

        notify(): Unit

Definition Classes

AnyRef

        final
        def

        notifyAll(): Unit

Definition Classes

AnyRef

        implicit
        def

        streamlinedXmlEquality[T <: NodeSeq]: Equality[T]

Provides an implicit Equality[T]
instance for any subtype of scala.xml.NodeSeq that, prior for testing
for equality, will normalize the XML by removing empty text nodes and trimming
non-empty text nodes.

Provides an implicit Equality[T]
instance for any subtype of scala.xml.NodeSeq that, prior for testing
for equality, will normalize the XML by removing empty text nodes and trimming
non-empty text nodes.

See the main documentation for this trait for more details and examples.

returns

an Equality[T] instance that normalizes XML before testing for equality

        final
        def

        synchronized[T0](arg0: ⇒ T0): T0

Definition Classes

AnyRef

        def

        toString(): String

Definition Classes

AnyRef → Any

        final
        def

        wait(): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long, arg1: Int): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

        final
        def

        wait(arg0: Long): Unit

Definition Classes

AnyRef

Annotations

                @throws(

      ...
    )

Inherited from AnyRef

Inherited from Any

Ungrouped


text:
using System.Threading.Tasks;
using Nethereum.JsonRpc.Client;

namespace Nethereum.RPC.Personal
{
    public interface IPersonalLockAccount
    {
        RpcRequest BuildRequest(string account, object id = null);
        Task<bool> SendRequestAsync(string account, object id = null);
    }
}


text:
/*
Theme Name: 	Monolith
Description: 	A lightweight but powerful starter theme.
Version: 		  2.0.6 Chipotle
License: 		  The MIT License (MIT)
License URI:	http://opensource.org/licenses/MIT
Author:       BigSpring
Author URI: 	http://www.bigspring.co.uk
Tags:			    starter, reponsive, plain
*/


text:
package com.xjeffrose.xio.core;

import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelOption;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.InetSocketAddress;

/**
 * Handler implementation for the tcp proxy server.
 */
public class TcpProxyCodec extends ChannelInboundHandlerAdapter {

  public class BackendProxyCodec extends ChannelInboundHandlerAdapter {

    private final Channel inboundChannel;

    public BackendProxyCodec(Channel inboundChannel) {
      this.inboundChannel = inboundChannel;
    }

    @Override
    public void channelActive(ChannelHandlerContext ctx) {
      ctx.read();
    }

    @Override
    public void channelRead(final ChannelHandlerContext ctx, Object msg) {
      inboundChannel.writeAndFlush(msg).addListener(new ChannelFutureListener() {
        @Override
        public void operationComplete(ChannelFuture future) {
          if (future.isSuccess()) {
            ctx.channel().read();
          } else {
            future.channel().close();
          }
        }
      });
    }

    @Override
    public void channelInactive(ChannelHandlerContext ctx) {
      closeOnFlush(inboundChannel);
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
      log.error("Error: ", cause);
      closeOnFlush(ctx.channel());
    }

    void closeOnFlush(Channel ch) {
      if (ch.isActive()) {
        ch.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
      }
    }
  }

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

  private final InetSocketAddress proxyEndpoint;

  public TcpProxyCodec(InetSocketAddress proxyEndpoint) {
    this.proxyEndpoint = proxyEndpoint;
  }

  private volatile Channel outboundChannel;

  @Override
  public void channelActive(ChannelHandlerContext ctx) {
    final Channel inboundChannel = ctx.channel();
    inboundChannel.config().setAutoRead(false);

    // Start the connection attempt.
    Bootstrap b = new Bootstrap();
    b.group(inboundChannel.eventLoop())
      .channel(ctx.channel().getClass())
      .handler(new BackendProxyCodec(inboundChannel))
      .option(ChannelOption.AUTO_READ, false);
    ChannelFuture f = b.connect(proxyEndpoint);
    outboundChannel = f.channel();
    f.addListener(new ChannelFutureListener() {
      @Override
      public void operationComplete(ChannelFuture future) {
        if (future.isSuccess()) {
          // connection complete start to read first data
          inboundChannel.read();
        } else {
          // Close the connection if the connection attempt has failed.
          inboundChannel.close();
        }
      }
    });
  }

  @Override
  public void channelRead(final ChannelHandlerContext ctx, Object msg) {
    if (outboundChannel.isOpen()) {
      outboundChannel.writeAndFlush(msg).addListener(new ChannelFutureListener() {
        @Override
        public void operationComplete(ChannelFuture future) {
          if (future.isSuccess()) {
            // was able to flush out data, start to read the next chunk
            ctx.channel().read();
          } else {
            future.channel().close();
          }
        }
      });
    }
  }

  @Override
  public void channelInactive(ChannelHandlerContext ctx) {
    if (outboundChannel != null) {
      closeOnFlush(outboundChannel);
    }
  }

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
    log.error("Error: ", cause);
    closeOnFlush(ctx.channel());
  }

  /**
   * Closes the specified channel after all queued write requests are flushed.
   */
  void closeOnFlush(Channel ch) {
    if (ch.isActive()) {
      ch.writeAndFlush(Unpooled.EMPTY_BUFFER).addListener(ChannelFutureListener.CLOSE);
    }
  }

}


text:
#pragma once
#include <ssn_types.h>
#include <ssn_vnf.h>

/**
 * @brief vnf catalog class
 * @details
 *   This class provides vnf-allocationing to dynamic vnf using.
 */
class ssn_vnf_catalog final {

  struct catalog_ele {
    std::string name;
    ssn_vnfallocfunc_t allocator;
    catalog_ele(std::string n, ssn_vnfallocfunc_t f) : name(n), allocator(f) {}
  }; /* struct catalog_ele */

  std::vector<catalog_ele> catalog;

 public:

  /**
   * @brief get catalog elements size
   * @return number of elements
   */
  size_t size() const { return catalog.size(); }

  /**
   * @brief get element reference for debugging
   * @param [in] num catalog index
   * @return catalog-element
   * @details
   *    if num is invalid, this operation is undefined
   */
  const catalog_ele& operator[](size_t num) const { return catalog[num]; }

  /**
   * @brief get element reference for debugging with range-check
   * @param [in] num catalog index
   * @return catalog-element
   * @details
   *    if num is invalid, this operation throw exception.
   */
  const catalog_ele& at(size_t num) const
  {
    if (num >= size()) throw slankdev::exception("range error");
    return catalog[num];
  }

  /**
   * @brief Allocate new VNF
   * @param [in] cname catalog-name
   * @param [in] iname instance-name
   * @return valid-pointer success allocation
   * @return nullptr unsuccess, maybe invalid cname or iname
   */
  ssn_vnf* alloc_vnf(const char* cname, const char* iname)
  {
    size_t n_cat = catalog.size();
    for (size_t i=0; i<n_cat; i++) {
      if (catalog[i].name == cname)
        return catalog[i].allocator(iname);
    }
    return nullptr;
  }

  /**
   * @brief Register new VNF-catalog
   * @param [in] cname catalog-name
   * @param [in] allocator allocator function
   * @return 0 success
   * @return -1 cname is already registered
   */
  int register_vnf(const char* cname, ssn_vnfallocfunc_t allocator)
  {
    /* Check if cname is already registered */
    const size_t n_ele = catalog.size();
    for (size_t i=0; i<n_ele; i++) {
      if (catalog[i].name == cname)
        return -1;
    }
    catalog.emplace_back(cname, allocator);
    return 0;
  }

  /**
   * @brief Unregister VNF catalog
   * @param cname catalog-name
   * @return 0 success
   * @return -1 cname is invalid
   */
  int unregister_vnf(const char* cname)
  {
    const size_t n_ele = catalog.size();
    for (size_t i=0; i<n_ele; i++) {
      if (catalog[i].name == cname) {
        catalog.erase(catalog.begin() + i);
        return 0;
      }
    }
    return -1;
  }

}; /* class ssn_vnf_catalog */


text:
#pragma once

#include <mrpt/core/bits_math.h>  // .0_deg
#include <mrpt/core/exceptions.h>
#include <mrpt/system/string_utils.h>  // tokenize

#include <string>
#include <type_traits>
#include <vector>

namespace mrpt
{
// Frd decl:
namespace typemeta
{
template <typename ENUMTYPE>
struct TEnumType;
}
namespace config
{
// Frwd. decl:
class CConfigFilePrefixer;

/** Default padding sizes for macros MRPT_SAVE_CONFIG_VAR_COMMENT(), etc. */
int MRPT_SAVE_NAME_PADDING();
int MRPT_SAVE_VALUE_PADDING();

/** This class allows loading and storing values and vectors of different types
 * from a configuration text, which can be implemented as a ".ini" file, a
 * memory-stored string, etc...
 *   This is a virtual class, use only as a pointer to an implementation of one
 * of the derived classes.
 *
 * See: \ref config_file_format
 * \ingroup mrpt_config_grp
 */
class CConfigFileBase
{
	friend class CConfigFilePrefixer;

   protected:
	/** A virtual method to write a generic string.
	 */
	virtual void writeString(
		const std::string& section, const std::string& name,
		const std::string& str) = 0;

	/** Write a generic string with optional padding and a comment field ("//
	 * ...") at the end of the line. */
	void writeString(
		const std::string& section, const std::string& name,
		const std::string& str, const int name_padding_width,
		const int value_padding_width, const std::string& comment);

	/** A virtual method to read a generic string.
	 * \exception std::exception If the key name is not found and
	 * "failIfNotFound" is true. Otherwise the "defaultValue" is returned. */
	virtual std::string readString(
		const std::string& section, const std::string& name,
		const std::string& defaultStr, bool failIfNotFound = false) const = 0;

   public:
	/** dtor */
	virtual ~CConfigFileBase();

	/** Returns a list with all the section names. */
	virtual void getAllSections(std::vector<std::string>& sections) const = 0;

	/** Returs a list with all the keys into a section */
	virtual void getAllKeys(
		const std::string& section, std::vector<std::string>& keys) const = 0;

	/** Checks if a given section exists (name is case insensitive)
	 * \sa keyExists() */
	bool sectionExists(const std::string& section_name) const;

	/** Checks if a given key exists inside a section (case insensitive)
	 * \sa sectionExists() */
	bool keyExists(const std::string& section, const std::string& key) const;

	/** Changes the contents of the virtual "config file" from a text block
	 * containing a YAML configuration text. Refer to unit test
	 * yaml2config_unittest.cpp for examples of use.
	 * \sa getContentAsYAML()
	 */
	void setContentFromYAML(const std::string& yaml_block);

	/** Returns a text block representing the contents of the config file in
	 * YAML format.
	 * \sa setContentFromYAML()
	 */
	std::string getContentAsYAML() const;

	/** Empties the "config file" */
	virtual void clear() = 0;

	template <
		typename enum_t,
		typename = std::enable_if_t<std::is_enum<enum_t>::value>>
	void write(
		const std::string& section, const std::string& name, enum_t value,
		const int name_padding_width = -1, const int value_padding_width = -1,
		const std::string& comment = std::string())
	{
		this->write(
			section, name, mrpt::typemeta::TEnumType<enum_t>::value2name(value),
			name_padding_width, value_padding_width, comment);
	}
	/** @name Save a configuration parameter. Optionally pads with spaces up to
	 * the desired width in number of characters (-1: no fill), and add a final
	 * comment field at the end of the line (a "// " prefix is automatically
	 * inserted).
	 * @{ */
	template <
		typename data_t,
		typename = std::enable_if_t<!std::is_enum<data_t>::value>>
	void write(
		const std::string& section, const std::string& name,
		const data_t& value, const int name_padding_width = -1,
		const int value_padding_width = -1,
		const std::string& comment = std::string())
	{
		writeString(
			section, name, mrpt::to_string(value), name_padding_width,
			value_padding_width, comment);
	}
	template <typename data_t>
	void write(
		const std::string& section, const std::string& name,
		const std::vector<data_t>& value, const int name_padding_width = -1,
		const int value_padding_width = -1,
		const std::string& comment = std::string())
	{
		std::string s;
		for (typename std::vector<data_t>::const_iterator it = value.begin();
			 it != value.end(); ++it)
		{
			s += mrpt::to_string(*it);
			s += " ";
		}
		writeString(
			section, name, s, name_padding_width, value_padding_width, comment);
	}
	void write(
		const std::string& section, const std::string& name, double value,
		const int name_padding_width = -1, const int value_padding_width = -1,
		const std::string& comment = std::string());
	void write(
		const std::string& section, const std::string& name, float value,
		const int name_padding_width = -1, const int value_padding_width = -1,
		const std::string& comment = std::string());

	/** @} */

	/** @name Read a configuration parameter, launching exception if key name is
	 * not found and `failIfNotFound`=true
	 * @{ */
	double read_double(
		const std::string& section, const std::string& name,
		double defaultValue, bool failIfNotFound = false) const;
	float read_float(
		const std::string& section, const std::string& name, float defaultValue,
		bool failIfNotFound = false) const;
	bool read_bool(
		const std::string& section, const std::string& name, bool defaultValue,
		bool failIfNotFound = false) const;
	int read_int(
		const std::string& section, const std::string& name, int defaultValue,
		bool failIfNotFound = false) const;
	uint64_t read_uint64_t(
		const std::string& section, const std::string& name,
		uint64_t defaultValue, bool failIfNotFound = false) const;
	std::string read_string(
		const std::string& section, const std::string& name,
		const std::string& defaultValue, bool failIfNotFound = false) const;
	/** Reads a configuration parameter of type "string", and keeps only the
	 * first word (this can be used to eliminate possible comments at the end of
	 * the line) */
	std::string read_string_first_word(
		const std::string& section, const std::string& name,
		const std::string& defaultValue, bool failIfNotFound = false) const;
	/** Reads a configuration parameter of type vector, stored in the file as a
	 * string: "[v1 v2 v3 ... ]", where spaces could also be commas. \exception
	 * std::exception If the key name is not found and "failIfNotFound" is true.
	 * Otherwise the "defaultValue" is returned. */
	template <class VECTOR_TYPE>
	void read_vector(
		const std::string& section, const std::string& name,
		const VECTOR_TYPE& defaultValue, VECTOR_TYPE& outValues,
		bool failIfNotFound = false) const
	{
		std::string aux(readString(section, name, "", failIfNotFound));
		// Parse the text into a vector:
		std::vector<std::string> tokens;
		mrpt::system::tokenize(aux, "[], \t", tokens);

		if (tokens.size() == 0) { outValues = defaultValue; }
		else
		{
			// Parse to numeric type:
			const size_t N = tokens.size();
			outValues.resize(N);
			for (size_t i = 0; i < N; i++)
			{
				double val = std::stod(tokens[i]);
				outValues[i] =
					static_cast<typename VECTOR_TYPE::value_type>(val);
			}
		}
	}

	/** Reads a configuration parameter as a matrix written in a matlab-like
	 * format - for example: "[2 3 4 ; 7 8 9]".
	 * This template method can be instantiated for matrices of the types: int,
	 * long, unsinged int, unsigned long, float, double, long double
	 * \exception std::exception If the key name is not found and
	 * "failIfNotFound" is true. Otherwise the "defaultValue" is returned.
	 */
	template <class MATRIX_TYPE>
	void read_matrix(
		const std::string& section, const std::string& name,
		MATRIX_TYPE& outMatrix,
		const MATRIX_TYPE& defaultMatrix = MATRIX_TYPE(),
		bool failIfNotFound = false) const
	{
		std::string aux = readString(section, name, "", failIfNotFound);
		if (aux.empty()) outMatrix = defaultMatrix;
		else
		{
			// Parse the text into a vector:
			if (!outMatrix.fromMatlabStringFormat(aux))
				THROW_EXCEPTION_FMT("Error parsing matrix: '%s'", aux.c_str());
		}
	}

	/** Reads an "enum" value, where the value in the config file can be either
	 * a numerical value or the symbolic name, for example:
	 *   In the code:
	 *  \code
	 *    enum my_type_t { type_foo=0, type_bar };
	 *  \endcode
	 *  In the config file:
	 *  \code
	 *    [section]
	 *    type   = type_bar   // Use the symbolic name, or
	 *    type   = 1          // use the numerical value (both lines will be
	 * equivalent)
	 *  \endcode
	 *  Which can be loaded with:
	 *  \code
	 *    cfgfile.read_enum<my_type_t>("section","type", type_foo );
	 *  \endcode
	 *
	 *  \note For an enum type to work with this template it is required that
	 * it defines a specialization of mrpt::typemeta::TEnumType
	 */
	template <typename ENUMTYPE>
	ENUMTYPE read_enum(
		const std::string& section, const std::string& name,
		const ENUMTYPE& defaultValue, bool failIfNotFound = false) const
	{
		MRPT_START
		const std::string sVal =
			read_string_first_word(section, name, "", failIfNotFound);
		if (sVal.empty()) return defaultValue;
		// Text or numeric value?
		if (::isdigit(sVal[0]))
		{  // Seems a number:
			return static_cast<ENUMTYPE>(::atoi(&sVal[0]));
		}
		else
		{  // Name look-up:
			try
			{
				return mrpt::typemeta::TEnumType<ENUMTYPE>::name2value(sVal);
			}
			catch (std::exception&)
			{
				THROW_EXCEPTION_FMT(
					"Invalid value '%s' for enum type while reading key='%s'.",
					sVal.c_str(), name.c_str());
			}
		}
		MRPT_END
	}
	/** @} */
};	// End of class def.

/** An useful macro for loading variables stored in a INI-like file under a key
 * with the same name that the variable, and assigning the variable the current
 * value if not found in the config file.
 *  The variableType must be the suffix of "read_XXX" functions, i.e. int,
 * bool,...
 */
#define MRPT_LOAD_CONFIG_VAR(                                                  \
	variableName, variableType, configFileObject, sectionNameStr)              \
	{                                                                          \
		variableName = configFileObject.read_##variableType(                   \
			sectionNameStr, #variableName, variableName);                      \
	}

/** Shortcut for MRPT_LOAD_CONFIG_VAR() for config file object named `c` and
 * section string named `s` */
#define MRPT_LOAD_CONFIG_VAR_CS(variableName, variableType)                    \
	MRPT_LOAD_CONFIG_VAR(variableName, variableType, c, s)

/** Loads a double variable, stored as radians but entered in the INI-file as
 * degrees */
#define MRPT_LOAD_CONFIG_VAR_DEGREES(                                          \
	variableName, configFileObject, sectionNameStr)                            \
	{                                                                          \
		variableName = mrpt::DEG2RAD(configFileObject.read_double(             \
			sectionNameStr, #variableName, mrpt::RAD2DEG(variableName)));      \
	}
#define MRPT_LOAD_CONFIG_VAR_DEGREESf(                                         \
	variableName, configFileObject, sectionNameStr)                            \
	{                                                                          \
		variableName = mrpt::DEG2RAD(configFileObject.read_float(              \
			sectionNameStr, #variableName, mrpt::RAD2DEG(variableName)));      \
	}

/** Loads a double, required, variable, stored as radians but entered in the
 * INI-file as degrees */
#define MRPT_LOAD_CONFIG_VAR_DEGREES_NO_DEFAULT(                               \
	variableName, configFileObject, sectionNameStr)                            \
	{                                                                          \
		variableName = mrpt::DEG2RAD(configFileObject.read_double(             \
			sectionNameStr, #variableName, mrpt::RAD2DEG(variableName),        \
			true));                                                            \
	}

#define MRPT_LOAD_CONFIG_VAR_CAST(                                             \
	variableName, variableType, variableTypeCast, configFileObject,            \
	sectionNameStr)                                                            \
	{                                                                          \
		variableName = static_cast<variableTypeCast>(                          \
			configFileObject.read_##variableType(                              \
				sectionNameStr, #variableName, variableName));                 \
	}

#define MRPT_LOAD_HERE_CONFIG_VAR(                                             \
	variableName, variableType, targetVariable, configFileObject,              \
	sectionNameStr)                                                            \
	targetVariable = configFileObject.read_##variableType(                     \
		sectionNameStr, #variableName, targetVariable, false);

#define MRPT_LOAD_HERE_CONFIG_VAR_NO_DEFAULT(                                  \
	variableName, variableType, targetVariable, configFileObject,              \
	sectionNameStr)                                                            \
	{                                                                          \
		try                                                                    \
		{                                                                      \
			targetVariable = configFileObject.read_##variableType(             \
				sectionNameStr, #variableName, targetVariable, true);          \
		}                                                                      \
		catch (std::exception&)                                                \
		{                                                                      \
			THROW_EXCEPTION(mrpt::format(                                      \
				"Value for '%s' not found in config file in section '%s'",     \
				static_cast<const char*>(#variableName),                       \
				std::string(sectionNameStr).c_str()));                         \
		}                                                                      \
	}

#define MRPT_LOAD_HERE_CONFIG_VAR_DEGREES(                                     \
	variableName, variableType, targetVariable, configFileObject,              \
	sectionNameStr)                                                            \
	targetVariable = mrpt::DEG2RAD(configFileObject.read_##variableType(       \
		sectionNameStr, #variableName, mrpt::RAD2DEG(targetVariable), false));

#define MRPT_LOAD_HERE_CONFIG_VAR_DEGREES_NO_DEFAULT(                          \
	variableName, variableType, targetVariable, configFileObject,              \
	sectionNameStr)                                                            \
	{                                                                          \
		try                                                                    \
		{                                                                      \
			targetVariable =                                                   \
				mrpt::DEG2RAD(configFileObject.read_##variableType(            \
					sectionNameStr, #variableName, targetVariable, true));     \
		}                                                                      \
		catch (std::exception&)                                                \
		{                                                                      \
			THROW_EXCEPTION(mrpt::format(                                      \
				"Value for '%s' not found in config file in section '%s'",     \
				static_cast<const char*>(#variableName),                       \
				std::string(sectionNameStr).c_str()));                         \
		}                                                                      \
	}

#define MRPT_LOAD_CONFIG_VAR_NO_DEFAULT(                                       \
	variableName, variableType, configFileObject, sectionNameStr)              \
	{                                                                          \
		try                                                                    \
		{                                                                      \
			variableName = configFileObject.read_##variableType(               \
				sectionNameStr, #variableName, variableName, true);            \
		}                                                                      \
		catch (std::exception&)                                                \
		{                                                                      \
			THROW_EXCEPTION(mrpt::format(                                      \
				"Value for '%s' not found in config file in section '%s'",     \
				static_cast<const char*>(#variableName),                       \
				std::string(sectionNameStr).c_str()));                         \
		}                                                                      \
	}

/** Shortcut for MRPT_LOAD_CONFIG_VAR_NO_DEFAULT() for REQUIRED variables config
 * file object named `c` and section string named `s` */
#define MRPT_LOAD_CONFIG_VAR_REQUIRED_CS(variableName, variableType)           \
	MRPT_LOAD_CONFIG_VAR_NO_DEFAULT(variableName, variableType, c, s)

#define MRPT_LOAD_CONFIG_VAR_CAST_NO_DEFAULT(                                  \
	variableName, variableType, variableTypeCast, configFileObject,            \
	sectionNameStr)                                                            \
	{                                                                          \
		try                                                                    \
		{                                                                      \
			variableName = static_cast<variableTypeCast>(                      \
				configFileObject.read_##variableType(                          \
					sectionNameStr, #variableName, variableName, true));       \
		}                                                                      \
		catch (std::exception&)                                                \
		{                                                                      \
			THROW_EXCEPTION(mrpt::format(                                      \
				"Value for '%s' not found in config file in section '%s'",     \
				static_cast<const char*>(#variableName),                       \
				std::string(sectionNameStr).c_str()));                         \
		}                                                                      \
	}

#define MRPT_LOAD_HERE_CONFIG_VAR_CAST(                                        \
	variableName, variableType, variableTypeCast, targetVariable,              \
	configFileObject, sectionNameStr)                                          \
	targetVariable =                                                           \
		static_cast<variableTypeCast>(configFileObject.read_##variableType(    \
			sectionNameStr, #variableName, targetVariable));

#define MRPT_LOAD_HERE_CONFIG_VAR_CAST_NO_DEFAULT(                             \
	variableName, variableType, variableTypeCast, targetVariable,              \
	configFileObject, sectionNameStr)                                          \
	{                                                                          \
		try                                                                    \
		{                                                                      \
			targetVariable = static_cast<variableTypeCast>(                    \
				configFileObject.read_##variableType(                          \
					sectionNameStr, #variableName, targetVariable, true));     \
		}                                                                      \
		catch (std::exception&)                                                \
		{                                                                      \
			THROW_EXCEPTION(mrpt::format(                                      \
				"Value for '%s' not found in config file in section '%s'",     \
				static_cast<const char*>(#variableName),                       \
				std::string(sectionNameStr).c_str()));                         \
		}                                                                      \
	}

#define MRPT_SAVE_CONFIG_VAR(variableName, configFileObject, sectionNameStr)   \
	{                                                                          \
		configFileObject.write(sectionNameStr, #variableName, variableName);   \
	}

#define MRPT_SAVE_CONFIG_VAR_DEGREES(                                          \
	variableName, configFileObject, sectionNameStr)                            \
	{                                                                          \
		configFileObject.write(                                                \
			sectionNameStr, #variableName, mrpt::RAD2DEG(variableName));       \
	}

#define MRPT_SAVE_CONFIG_VAR_COMMENT(variableName, __comment)                  \
	{                                                                          \
		c.write(                                                               \
			s, #variableName, variableName,                                    \
			mrpt::config::MRPT_SAVE_NAME_PADDING(),                            \
			mrpt::config::MRPT_SAVE_VALUE_PADDING(), __comment);               \
	}
#define MRPT_SAVE_CONFIG_VAR_DEGREES_COMMENT(                                  \
	__entryName, __variable, __comment)                                        \
	{                                                                          \
		c.write(                                                               \
			s, __entryName, mrpt::RAD2DEG(__variable),                         \
			mrpt::config::MRPT_SAVE_NAME_PADDING(),                            \
			mrpt::config::MRPT_SAVE_VALUE_PADDING(), __comment);               \
	}

}  // namespace config
}  // namespace mrpt


text:
package com.chapter05.forceoffline.demo.utils;

import android.app.Activity;

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

/**
 * Created by Archer on 2017/10/31.
 */

public class ActivityCollector {
    private static List<Activity> activities = new ArrayList<>();

    public static void addActivity(Activity activity) {
        activities.add(activity);
    }

    public static void removeActivity(Activity activity) {
        activities.remove(activity);
    }

    public static void finishAll() {
        for (Activity activity : activities) {
            if (!activity.isFinishing()) {
                activity.finish();
            }
        }
    }
}


text:
package focus.conclusions.logic;

import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Predicate;

import static java.util.Collections.unmodifiableMap;

public class ContextImpl<T> implements Context {

    private final T data;
    private final Map<Object, Boolean> values = new HashMap<>();
    private final Map<Object, Predicate<? super T>> functions;
    private final Map<Object, Boolean> results = new HashMap<>();

    public ContextImpl(T data, Map<Object, Predicate<? super T>> functions) {
        this.data = data;
        this.functions = unmodifiableMap(functions);
    }

    @Override
    public Boolean get(Object identifier) {
        return values.get(identifier);
    }

    @Override
    public void set(Object identifier, boolean value) {
        values.put(identifier, value);
    }

    @Override
    public void call(Object function) {
        set(function, functions.get(function).test(data));
    }

}


text:
select * from Reminiscence_Sessions rs order by rs.narrator_user_id,rs.week;

# Get sessions of families
select * from Reminiscence_Sessions
where narrator_name in ('Pia Pedergnana','Giulio Flessati','Carla Bevilacqua')
order by narrator_name;

select session_id,narrator_name, narrator2_user_id, narrator2_name,listener_user_id, listener_age,listener_name, week, total_weeks, cumulative_weeks
from Reminiscence_Sessions
order by narrator_name, week;

# GET number of weeks of the trio
select narrator_user_id, narrator2_user_id, listener_user_id, count(*)
from Reminiscence_Sessions
where done='SI'
group by narrator_user_id, narrator2_user_id, listener_user_id;

# UPDATES

# Families in the study
update Reminiscence_Sessions set family = 0;
update Reminiscence_Sessions set family = 1
where narrator_name in
('Pia Pedergnana','Giulio Flessati','Carla Bevilacqua');

# Add narrator2 to reminiscence sessions
# 1. cleanup narrator2
update Reminiscence_Sessions rs
set rs.narrator2_user_id = null,
rs.narrator2_name = null,
rs.narrator2_age = null,
rs.narrator2_gender = null,
rs.narrator2_birthdate = null;

# Link sessions and second narrators (narrator2)
update Reminiscence_Sessions rs, User u, User narrator
set rs.narrator2_user_id = u.user_id,
rs.narrator2_name = u.fullname,
rs.narrator2_age = u.age,
rs.narrator2_gender = u.gender,
rs.narrator2_birthdate = u.birthdate
where narrator.user_id = rs.narrator_user_id
and u.person_id = narrator.person_id
and u.user_id <> narrator.user_id
and u.conf_type = 'narrator2';

# Link listener to reminiscence sessions (when no info about the listener is available in the session)
update Reminiscence_Sessions rs, User u, User narrator
set rs.listener_user_id = u.user_id,
rs.listener_name = u.fullname,
rs.listener_age = u.age,
rs.listener_gender = u.gender,
rs.listener_birthdate = u.birthdate
where narrator.user_id = rs.narrator_user_id
and u.person_id = narrator.person_id
and u.user_id <> narrator.user_id
and u.conf_type = 'listener';

# Add listener to reminiscence sessions (when the listener user id is available in session)
update Reminiscence_Sessions rs, User u
set
	rs.listener_name = u.fullname,
	rs.listener_age = u.age,
	rs.listener_gender = u.gender,
	rs.listener_birthdate = u.birthdate
where u.user_id = rs.listener_user_id
and u.conf_type = 'listener'
and rs.listener_age is null;

# Add age, gender, birthdate to narrator in reminiscence sessions
update Reminiscence_Sessions rs, User narrator
set rs.narrator_name = narrator.fullname,
rs.narrator_age = narrator.age,
rs.narrator_gender = narrator.gender,
rs.narrator_birthdate = narrator.birthdate
where narrator.user_id = rs.narrator_user_id
and narrator.conf_type = 'narrator';

# Update number of weeks of the trio

update Reminiscence_Sessions set narrator2_user_id = 0 where narrator2_user_id is null;

update Reminiscence_Sessions as rs
	left join (
		select count(t.narrator_user_id) as tot_weeks, t.narrator_user_id as a, t.narrator2_user_id as b, t.listener_user_id as c
		from  Reminiscence_Sessions t
		where t.done='SI'
		group by t.narrator_user_id, t.narrator2_user_id, t.listener_user_id
	) as rs1
		on rs.narrator_user_id = rs1.a
		and rs.narrator2_user_id = rs1.b
		and rs.listener_user_id = rs1.c
set rs.total_weeks = rs1.tot_weeks;

select appversion,count(*) from Reminiscence_Sessions where done = 'SI' group by appversion;

# Update
update Reminiscence_Sessions set appversion = 'Tutto 2' where appversion = 'Tutto v2';

update Reminiscence_Sessions
set appversion_number = 1, appversion_number2 = 1
where appversion = 'Personale';

update Reminiscence_Sessions
set appversion_number = 2, appversion_number2 = 2
where appversion = 'Senza Contesto';

update Reminiscence_Sessions
set appversion_number = 3, appversion_number2 = 3
where appversion = 'Senza Domande';

update Reminiscence_Sessions
set appversion_number = 3, appversion_number2 = 5
where appversion = 'Senza Domande 2';

update Reminiscence_Sessions
set appversion_number = 4, appversion_number2 = 4
where appversion = 'Tutto';

update Reminiscence_Sessions
set appversion_number = 4, appversion_number2 = 6
where appversion = 'Tutto 2';

# Get sessions ordered by week
select rs.session_id, rs.listener_user_id,rs.week,rs.date,rs.listener_name from Reminiscence_Sessions rs order by rs.session_id,rs.narrator_user_id, rs.week;

select count(*),creation_date from Life_Event group by creation_date;

select * from Reminiscence_Sessions;

select * from Life_Event where creation_date is null;


text:
import * as cheerio from "cheerio";
import {IMangaRequest} from "../interface";

export class MangaRequestResult implements IMangaRequest {
    private _$: CheerioStatic;

    get uri() {
        return this._uri;
    }

    get html() {
        return this._html;
    }

    get $() {
        return this._$ || (this._$ = cheerio.load(this.html));
    }

    constructor(private _uri: string, private _html: string) {
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<wfs:WFS_Capabilities xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:ms="http://mapserver.gis.umn.edu/mapserver" xmlns="http://www.opengis.net/wfs/2.0" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd">
  <ows:ServiceIdentification>
    <ows:Title>NASA Global Imagery Browse Services for EOSDIS WFS (Geographic - EPSG:4326)</ows:Title>
    <ows:Abstract>The Global Imagery Browse Services (GIBS) system is a core EOSDIS component which provides a scalable, responsive, highly available, and community standards based set of imagery services.  These services are designed with the goal of advancing user interactions with EOSDIS' inter-disciplinary data through enhanced visual representation and discovery.</ows:Abstract>
    <ows:Keywords>
      <ows:Keyword>GIBS</ows:Keyword>
      <ows:Keyword>NASA</ows:Keyword>
      <ows:Keyword>WFS</ows:Keyword>
      <ows:Keyword>Earth</ows:Keyword>
    </ows:Keywords>
    <ows:ServiceType codeSpace="OGC">WFS</ows:ServiceType>
    <ows:ServiceTypeVersion>2.0.0</ows:ServiceTypeVersion>
    <ows:Fees>NONE</ows:Fees>
    <ows:AccessConstraints>NONE</ows:AccessConstraints>
  </ows:ServiceIdentification>
  <ows:ServiceProvider>
    <ows:ProviderName>GIBS User Support</ows:ProviderName>
    <ows:ProviderSite xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv"/>
    <ows:ServiceContact>
      <ows:IndividualName>GIBS User Support</ows:IndividualName>
      <ows:PositionName>GIBS User Support</ows:PositionName>
      <ows:ContactInfo>
        <ows:Phone>
          <ows:Voice/>
          <!--WARNING: Optional metadata "ows_contactvoicetelephone" was missing for ows:Voice-->
          <ows:Facsimile/>
          <!--WARNING: Optional metadata "ows_contactfacsimiletelephone" was missing for ows:Facsimile-->
        </ows:Phone>
        <ows:Address>
          <ows:DeliveryPoint/>
          <!--WARNING: Optional metadata "ows_address" was missing for ows:DeliveryPoint-->
          <ows:City/>
          <!--WARNING: Optional metadata "ows_city" was missing for ows:City-->
          <ows:AdministrativeArea/>
          <!--WARNING: Optional metadata "ows_stateorprovince" was missing for ows:AdministrativeArea-->
          <ows:PostalCode/>
          <!--WARNING: Optional metadata "ows_postcode" was missing for ows:PostalCode-->
          <ows:Country/>
          <!--WARNING: Optional metadata "ows_country" was missing for ows:Country-->
          <ows:ElectronicMailAddress>support@earthdata.nasa.gov</ows:ElectronicMailAddress>
        </ows:Address>
        <ows:OnlineResource xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv"/>
        <ows:HoursOfService/>
        <!--WARNING: Optional metadata "ows_hoursofservice" was missing for ows:HoursOfService-->
        <ows:ContactInstructions/>
        <!--WARNING: Optional metadata "ows_contactinstructions" was missing for ows:ContactInstructions-->
      </ows:ContactInfo>
      <ows:Role/>
      <!--WARNING: Optional metadata "ows_role" was missing for ows:Role-->
    </ows:ServiceContact>
  </ows:ServiceProvider>
  <ows:OperationsMetadata>
    <ows:Operation name="GetCapabilities">
      <ows:DCP>
        <ows:HTTP>
          <ows:Get xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
          <ows:Post xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
        </ows:HTTP>
      </ows:DCP>
      <ows:Parameter name="AcceptVersions">
        <ows:AllowedValues>
          <ows:Value>2.0.0</ows:Value>
          <ows:Value>1.1.0</ows:Value>
          <ows:Value>1.0.0</ows:Value>
        </ows:AllowedValues>
      </ows:Parameter>
      <ows:Parameter name="AcceptFormats">
        <ows:AllowedValues>
          <ows:Value>text/xml</ows:Value>
        </ows:AllowedValues>
      </ows:Parameter>
      <ows:Parameter name="Sections">
        <ows:AllowedValues>
          <ows:Value>ServiceIdentification</ows:Value>
          <ows:Value>ServiceProvider</ows:Value>
          <ows:Value>OperationsMetadata</ows:Value>
          <ows:Value>FeatureTypeList</ows:Value>
          <ows:Value>Filter_Capabilities</ows:Value>
        </ows:AllowedValues>
      </ows:Parameter>
    </ows:Operation>
    <ows:Operation name="DescribeFeatureType">
      <ows:DCP>
        <ows:HTTP>
          <ows:Get xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
          <ows:Post xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
        </ows:HTTP>
      </ows:DCP>
      <ows:Parameter name="outputFormat">
        <ows:AllowedValues>
          <ows:Value>application/gml+xml; version=3.2</ows:Value>
          <ows:Value>text/xml; subtype=gml/3.2.1</ows:Value>
          <ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
          <ows:Value>text/xml; subtype=gml/2.1.2</ows:Value>
        </ows:AllowedValues>
      </ows:Parameter>
    </ows:Operation>
    <ows:Operation name="GetFeature">
      <ows:DCP>
        <ows:HTTP>
          <ows:Get xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
          <ows:Post xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
        </ows:HTTP>
      </ows:DCP>
      <ows:Parameter name="outputFormat">
        <ows:AllowedValues>
          <ows:Value>application/gml+xml; version=3.2</ows:Value>
          <ows:Value>text/xml; subtype=gml/3.2.1</ows:Value>
          <ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
          <ows:Value>text/xml; subtype=gml/2.1.2</ows:Value>
          <ows:Value>application/json; subtype=geojson</ows:Value>
          <ows:Value>text/csv</ows:Value>
        </ows:AllowedValues>
      </ows:Parameter>
    </ows:Operation>
    <ows:Operation name="GetPropertyValue">
      <ows:DCP>
        <ows:HTTP>
          <ows:Get xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
          <ows:Post xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
        </ows:HTTP>
      </ows:DCP>
      <ows:Parameter name="outputFormat">
        <ows:AllowedValues>
          <ows:Value>application/gml+xml; version=3.2</ows:Value>
          <ows:Value>text/xml; subtype=gml/3.2.1</ows:Value>
          <ows:Value>text/xml; subtype=gml/3.1.1</ows:Value>
          <ows:Value>text/xml; subtype=gml/2.1.2</ows:Value>
        </ows:AllowedValues>
      </ows:Parameter>
    </ows:Operation>
    <ows:Operation name="ListStoredQueries">
      <ows:DCP>
        <ows:HTTP>
          <ows:Get xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
          <ows:Post xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
        </ows:HTTP>
      </ows:DCP>
    </ows:Operation>
    <ows:Operation name="DescribeStoredQueries">
      <ows:DCP>
        <ows:HTTP>
          <ows:Get xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
          <ows:Post xlink:type="simple" xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?"/>
        </ows:HTTP>
      </ows:DCP>
    </ows:Operation>
    <ows:Parameter name="version">
      <ows:AllowedValues>
        <ows:Value>2.0.0</ows:Value>
        <ows:Value>1.1.0</ows:Value>
        <ows:Value>1.0.0</ows:Value>
      </ows:AllowedValues>
    </ows:Parameter>
    <ows:Constraint name="ImplementsBasicWFS">
      <ows:NoValues/>
      <ows:DefaultValue>TRUE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ImplementsTransactionalWFS">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ImplementsLockingWFS">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="KVPEncoding">
      <ows:NoValues/>
      <ows:DefaultValue>TRUE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="XMLEncoding">
      <ows:NoValues/>
      <ows:DefaultValue>TRUE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="SOAPEncoding">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ImplementsInheritance">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ImplementsRemoteResolve">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ImplementsResultPaging">
      <ows:NoValues/>
      <ows:DefaultValue>TRUE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ImplementsStandardJoins">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ImplementsSpatialJoins">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ImplementsTemporalJoins">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ImplementsFeatureVersioning">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="ManageStoredQueries">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="PagingIsTransactionSafe">
      <ows:NoValues/>
      <ows:DefaultValue>FALSE</ows:DefaultValue>
    </ows:Constraint>
    <ows:Constraint name="QueryExpressions">
      <ows:AllowedValues>
        <ows:Value>wfs:Query</ows:Value>
        <ows:Value>wfs:StoredQuery</ows:Value>
      </ows:AllowedValues>
    </ows:Constraint>
  </ows:OperationsMetadata>
  <FeatureTypeList>
    <FeatureType>
      <Name>ms:Terra_Orbit_Dsc_Dots</Name>
      <Title>Terra_Orbit_Dsc_Dots</Title>
      <DefaultCRS>urn:ogc:def:crs:EPSG::4326</DefaultCRS>
      <OutputFormats>
        <Format>application/gml+xml; version=3.2</Format>
        <Format>text/xml; subtype=gml/3.2.1</Format>
        <Format>text/xml; subtype=gml/3.1.1</Format>
        <Format>text/xml; subtype=gml/2.1.2</Format>
        <Format>application/json; subtype=geojson</Format>
        <Format>text/csv</Format>
      </OutputFormats>
      <ows:WGS84BoundingBox dimensions="2">
        <ows:LowerCorner>-179.925 -81.847</ows:LowerCorner>
        <ows:UpperCorner>179.94 81.846</ows:UpperCorner>
      </ows:WGS84BoundingBox>
      <MetadataURL xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?request=GetMetadata&layer=Terra_Orbit_Dsc_Dots"/>
    </FeatureType>
    <FeatureType>
      <Name>ms:OrbitTracks_Aqua_Descending_Lines</Name>
      <Title>OrbitTracks_Aqua_Descending_Lines</Title>
      <DefaultCRS>urn:ogc:def:crs:EPSG::4326</DefaultCRS>
      <OutputFormats>
        <Format>application/gml+xml; version=3.2</Format>
        <Format>text/xml; subtype=gml/3.2.1</Format>
        <Format>text/xml; subtype=gml/3.1.1</Format>
        <Format>text/xml; subtype=gml/2.1.2</Format>
        <Format>application/json; subtype=geojson</Format>
        <Format>text/csv</Format>
      </OutputFormats>
      <ows:WGS84BoundingBox dimensions="2">
        <ows:LowerCorner>-179.957 -81.833</ows:LowerCorner>
        <ows:UpperCorner>179.904 81.833</ows:UpperCorner>
      </ows:WGS84BoundingBox>
      <MetadataURL xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?request=GetMetadata&layer=OrbitTracks_Aqua_Descending_Lines"/>
    </FeatureType>
    <FeatureType>
      <Name>ms:OrbitTracks_Aqua_Descending_Points</Name>
      <Title>OrbitTracks_Aqua_Descending_Points</Title>
      <DefaultCRS>urn:ogc:def:crs:EPSG::4326</DefaultCRS>
      <OutputFormats>
        <Format>application/gml+xml; version=3.2</Format>
        <Format>text/xml; subtype=gml/3.2.1</Format>
        <Format>text/xml; subtype=gml/3.1.1</Format>
        <Format>text/xml; subtype=gml/2.1.2</Format>
        <Format>application/json; subtype=geojson</Format>
        <Format>text/csv</Format>
      </OutputFormats>
      <ows:WGS84BoundingBox dimensions="2">
        <ows:LowerCorner>-179.957 -81.833</ows:LowerCorner>
        <ows:UpperCorner>179.904 81.833</ows:UpperCorner>
      </ows:WGS84BoundingBox>
      <MetadataURL xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?request=GetMetadata&layer=OrbitTracks_Aqua_Descending_Points"/>
    </FeatureType>
    <FeatureType>
      <Name>ms:Layer_Missing_Shapefile</Name>
      <Title>Layer_Missing_Shapefile</Title>
      <DefaultCRS>urn:ogc:def:crs:EPSG::4326</DefaultCRS>
      <OutputFormats>
        <Format>application/gml+xml; version=3.2</Format>
        <Format>text/xml; subtype=gml/3.2.1</Format>
        <Format>text/xml; subtype=gml/3.1.1</Format>
        <Format>text/xml; subtype=gml/2.1.2</Format>
        <Format>application/json; subtype=geojson</Format>
        <Format>text/csv</Format>
      </OutputFormats>
      <ows:WGS84BoundingBox/>
      <!--WARNING: Optional WGS84BoundingBox could not be established for this layer.  Consider setting the EXTENT in the LAYER object, or wfs_extent metadata. Also check that your data exists in the DATA statement-->
      <MetadataURL xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?request=GetMetadata&layer=Layer_Missing_Shapefile"/>
    </FeatureType>
    <FeatureType>
      <Name>ms:Vector_Status</Name>
      <Title>Vector_Status</Title>
      <DefaultCRS>urn:ogc:def:crs:EPSG::4326</DefaultCRS>
      <OutputFormats>
        <Format>application/gml+xml; version=3.2</Format>
        <Format>text/xml; subtype=gml/3.2.1</Format>
        <Format>text/xml; subtype=gml/3.1.1</Format>
        <Format>text/xml; subtype=gml/2.1.2</Format>
      </OutputFormats>
      <ows:WGS84BoundingBox dimensions="2">
        <ows:LowerCorner>-175.068 -42.912</ows:LowerCorner>
        <ows:UpperCorner>176.326 75.494</ows:UpperCorner>
      </ows:WGS84BoundingBox>
      <MetadataURL xlink:href="http://gibs.earthdata.nasa.gov/wfs/mapserv?request=GetMetadata&layer=Vector_Status"/>
    </FeatureType>
  </FeatureTypeList>
  <fes:Filter_Capabilities>
    <fes:Conformance>
      <fes:Constraint name="ImplementsQuery">
        <ows:NoValues/>
        <ows:DefaultValue>TRUE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsAdHocQuery">
        <ows:NoValues/>
        <ows:DefaultValue>TRUE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsFunctions">
        <ows:NoValues/>
        <ows:DefaultValue>FALSE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsResourceId">
        <ows:NoValues/>
        <ows:DefaultValue>TRUE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsMinStandardFilter">
        <ows:NoValues/>
        <ows:DefaultValue>TRUE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsStandardFilter">
        <ows:NoValues/>
        <ows:DefaultValue>TRUE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsMinSpatialFilter">
        <ows:NoValues/>
        <ows:DefaultValue>TRUE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsSpatialFilter">
        <ows:NoValues/>
        <ows:DefaultValue>FALSE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsMinTemporalFilter">
        <ows:NoValues/>
        <ows:DefaultValue>TRUE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsTemporalFilter">
        <ows:NoValues/>
        <ows:DefaultValue>FALSE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsVersionNav">
        <ows:NoValues/>
        <ows:DefaultValue>FALSE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsSorting">
        <ows:NoValues/>
        <ows:DefaultValue>FALSE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsExtendedOperators">
        <ows:NoValues/>
        <ows:DefaultValue>FALSE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsMinimumXPath">
        <ows:NoValues/>
        <ows:DefaultValue>TRUE</ows:DefaultValue>
      </fes:Constraint>
      <fes:Constraint name="ImplementsSchemaElementFunc">
        <ows:NoValues/>
        <ows:DefaultValue>FALSE</ows:DefaultValue>
      </fes:Constraint>
    </fes:Conformance>
    <fes:Id_Capabilities>
      <fes:ResourceIdentifier name="fes:ResourceId"/>
    </fes:Id_Capabilities>
    <fes:Scalar_Capabilities>
      <fes:LogicalOperators/>
      <fes:ComparisonOperators>
        <fes:ComparisonOperator name="PropertyIsEqualTo"/>
        <fes:ComparisonOperator name="PropertyIsNotEqualTo"/>
        <fes:ComparisonOperator name="PropertyIsLessThan"/>
        <fes:ComparisonOperator name="PropertyIsGreaterThan"/>
        <fes:ComparisonOperator name="PropertyIsLessThanOrEqualTo"/>
        <fes:ComparisonOperator name="PropertyIsGreaterThanOrEqualTo"/>
        <fes:ComparisonOperator name="PropertyIsLike"/>
        <fes:ComparisonOperator name="PropertyIsBetween"/>
      </fes:ComparisonOperators>
    </fes:Scalar_Capabilities>
    <fes:Spatial_Capabilities>
      <fes:GeometryOperands>
        <fes:GeometryOperand name="gml:Point"/>
        <fes:GeometryOperand name="gml:MultiPoint"/>
        <fes:GeometryOperand name="gml:LineString"/>
        <fes:GeometryOperand name="gml:MultiLineString"/>
        <fes:GeometryOperand name="gml:Curve"/>
        <fes:GeometryOperand name="gml:MultiCurve"/>
        <fes:GeometryOperand name="gml:Polygon"/>
        <fes:GeometryOperand name="gml:MultiPolygon"/>
        <fes:GeometryOperand name="gml:Surface"/>
        <fes:GeometryOperand name="gml:MultiSurface"/>
        <fes:GeometryOperand name="gml:Box"/>
        <fes:GeometryOperand name="gml:Envelope"/>
      </fes:GeometryOperands>
      <fes:SpatialOperators>
        <fes:SpatialOperator name="Equals"/>
        <fes:SpatialOperator name="Disjoint"/>
        <fes:SpatialOperator name="Touches"/>
        <fes:SpatialOperator name="Within"/>
        <fes:SpatialOperator name="Overlaps"/>
        <fes:SpatialOperator name="Crosses"/>
        <fes:SpatialOperator name="Intersects"/>
        <fes:SpatialOperator name="Contains"/>
        <fes:SpatialOperator name="DWithin"/>
        <fes:SpatialOperator name="Beyond"/>
        <fes:SpatialOperator name="BBOX"/>
      </fes:SpatialOperators>
    </fes:Spatial_Capabilities>
    <fes:Temporal_Capabilities>
      <fes:TemporalOperands>
        <fes:TemporalOperand name="gml:TimePeriod"/>
        <fes:TemporalOperand name="gml:TimeInstant"/>
      </fes:TemporalOperands>
      <fes:TemporalOperators>
        <fes:TemporalOperator name="During"/>
      </fes:TemporalOperators>
    </fes:Temporal_Capabilities>
  </fes:Filter_Capabilities>
</wfs:WFS_Capabilities>