/*
 * SonarLint for IntelliJ IDEA
 * Copyright (C) 2015-2020 SonarSource
 * sonarlint@sonarsource.com
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
 */
package org.sonarlint.intellij.editor;

import java.util.LinkedList;
import java.util.List;
import org.sonarsource.sonarlint.core.client.api.common.analysis.Issue;
import org.sonarsource.sonarlint.core.client.api.common.analysis.IssueListener;

public class AccumulatorIssueListener implements IssueListener {
  private final List<Issue> issues = new LinkedList<>();

  public List<Issue> getIssues() {
    return issues;
  }

  @Override
  public void handle(Issue issue) {
    issues.add(issue);
  }
}


############################################################
# Program is part of MintPy                                #
# Copyright (c) 2013, Zhang Yunjun, Heresh Fattahi         #
# Author: Zhang Yunjun, Heresh Fattahi, 2013               #
############################################################
# Recommend import:
#   from mintpy.utils import utils as ut

import os
import glob
import errno
import numpy as np
from scipy.ndimage import map_coordinates

from mintpy.objects import (
    geometryDatasetNames,
    geometry,
    ifgramStack,
    timeseries,
)

from mintpy.utils import ptime, readfile
from mintpy.utils.utils0 import *
from mintpy.utils.utils1 import *
from mintpy.objects.coord import coordinate

#################################################################################
def check_loaded_dataset(work_dir='./', print_msg=True):
    """Check the result of loading data for the following two rules:
        1. file existance
        2. file attribute readability

    Parameters: work_dir  : string, MintPy working directory
                print_msg : bool, print out message
    Returns:    True, if all required files and dataset exist; otherwise, ERROR
                    If True, PROCESS, SLC folder could be removed.
                stack_file  :
                geom_file   :
                lookup_file :
    Example:    work_dir = os.path.expandvars('./FernandinaSenDT128/mintpy')
                ut.check_loaded_dataset(work_dir)
    """
    load_complete = True

    if not work_dir:
        work_dir = os.getcwd()
    work_dir = os.path.abspath(work_dir)

    # 1. interferograms stack file: unwrapPhase, coherence
    flist = [os.path.join(work_dir, 'inputs/ifgramStack.h5')]
    stack_file = is_file_exist(flist, abspath=True)
    if stack_file is not None:
        obj = ifgramStack(stack_file)
        obj.open(print_msg=False)
        for dname in ['unwrapPhase', 'coherence']:
            if dname not in obj.datasetNames and 'azimuthOffset' not in obj.datasetNames:
                raise ValueError('required dataset "{}" is missing in file {}'.format(dname, stack_file))
    else:
        raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), './inputs/ifgramStack.h5')

    atr = readfile.read_attribute(stack_file)

    # 2. geom_file: height
    if 'X_FIRST' in atr.keys():
        flist = [os.path.join(work_dir, 'inputs/geometryGeo.h5')]
    else:
        flist = [os.path.join(work_dir, 'inputs/geometryRadar.h5')]
    geom_file = is_file_exist(flist, abspath=True)
    if geom_file is not None:
        obj = geometry(geom_file)
        obj.open(print_msg=False)
        dname = geometryDatasetNames[0]
        if dname not in obj.datasetNames:
            raise ValueError('required dataset "{}" is missing in file {}'.format(dname, geom_file))
    else:
        raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), './inputs/geometry*.h5')

    # 3. lookup_file: latitude,longitude or rangeCoord,azimuthCoord
    # could be different than geometry file in case of roipac and gamma
    flist = [os.path.join(work_dir, 'inputs/geometry*.h5')]
    lookup_file = get_lookup_file(flist, abspath=True, print_msg=print_msg)
    if 'X_FIRST' not in atr.keys():
        if lookup_file is not None:
            obj = geometry(lookup_file)
            obj.open(print_msg=False)

            if atr['PROCESSOR'] in ['isce', 'doris']:
                dnames = geometryDatasetNames[1:3]
            elif atr['PROCESSOR'] in ['gamma', 'roipac']:
                dnames = geometryDatasetNames[3:5]
            else:
                raise AttributeError('InSAR processor: {}'.format(atr['PROCESSOR']))

            for dname in dnames:
                if dname not in obj.datasetNames:
                    load_complete = False
                    raise Exception('required dataset "{}" is missing in file {}'.format(dname, lookup_file))
        else:
            raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), './inputs/geometry*.h5')
    else:
        print("Input data seems to be geocoded. Lookup file not needed.")

    # print message
    if print_msg:
        print(('Loaded dataset are processed by '
               'InSAR software: {}'.format(atr['PROCESSOR'])))
        if 'X_FIRST' in atr.keys():
            print('Loaded dataset is in GEO coordinates')
        else:
            print('Loaded dataset is in RADAR coordinates')
        print('Interferograms Stack: {}'.format(stack_file))
        print('Geometry File       : {}'.format(geom_file))
        print('Lookup Table File   : {}'.format(lookup_file))
        if load_complete:
            print('-'*50)
            print('All data needed found/loaded/copied. Processed 2-pass InSAR data can be removed.')
        print('-'*50)
    return load_complete, stack_file, geom_file, lookup_file

#################################################################################
def read_timeseries_lalo(lat, lon, ts_file, lookup_file=None, ref_lat=None, ref_lon=None,
                         win_size=1, unit='m', print_msg=True):
    """ Read time-series of one pixel with input lat/lon
    Parameters: lat/lon     : float, latitude/longitude
                ts_file     : string, filename of time-series HDF5 file
                lookup_file : string, filename of lookup table file
                ref_lat/lon : float, latitude/longitude of reference pixel
    Returns:    dates : 1D np.array of datetime.datetime objects, i.e. datetime.datetime(2010, 10, 20, 0, 0)
                dis   : 1D np.array of float in meter
    """
    atr = readfile.read_attribute(ts_file)
    coord = coordinate(atr, lookup_file=lookup_file)
    y, x = coord.geo2radar(lat, lon)[0:2]
    if print_msg:
        print('input lat / lon: {} / {}'.format(lat, lon))

    # reference pixel
    ref_y, ref_x = None, None
    if ref_lat is not None:
        ref_y, ref_x = coord.geo2radar(ref_lat, ref_lon)[0:2]

    # call read_timeseries_yx()
    dates, dis = read_timeseries_yx(y, x, ts_file,
                                    ref_y=ref_y,
                                    ref_x=ref_x,
                                    win_size=win_size,
                                    unit=unit,
                                    print_msg=False)
    return dates, dis

#################################################################################
def read_timeseries_yx(y, x, ts_file, ref_y=None, ref_x=None,
                       win_size=1, unit='m', print_msg=True):
    """ Read time-series of one pixel with input y/x
    Parameters: y/x         : int, row/column number of interest
                ts_file     : string, filename of time-series HDF5 file
                ref_y/x     : int, row/column number of reference pixel
    Returns:    dates : 1D np.array of datetime.datetime objects, i.e. datetime.datetime(2010, 10, 20, 0, 0)
                dis   : 1D np.array of float in meter
    """
    # read date
    obj = timeseries(ts_file)
    obj.open(print_msg=False)
    dates = ptime.date_list2vector(obj.dateList)[0]
    dates = np.array(dates)

    # read displacement
    if print_msg:
        print('input y / x: {} / {}'.format(y, x))
    box = (x, y, x+1, y+1)
    dis = readfile.read(ts_file, box=box)[0]
    if win_size != 1:
        buf = int(win_size / 2)
        box_win = (x-buf, y-buf, x+buf+1, y+buf+1)
        dis_win = readfile.read(ts_file, box=box_win)[0]
        dis = np.nanmean(dis_win.reshape((obj.numDate, -1)), axis=1)

    # reference pixel
    if ref_y is not None:
        ref_box = (ref_x, ref_y, ref_x+1, ref_y+1)
        dis -= readfile.read(ts_file, box=ref_box)[0]

    #start at zero
    dis -= dis[0]

    # custom output unit
    if unit == 'm':
        pass
    elif unit == 'cm':
        dis *= 100.
    elif unit == 'mm':
        dis *= 1000.
    else:
        raise ValueError('un-supported output unit: {}'.format(unit))

    return dates, dis

#####################################################################
def transect_yx(z, atr, start_yx, end_yx, interpolation='nearest'):
    """Extract 2D matrix (z) value along the line [x0,y0;x1,y1]
    Ref link: http://stackoverflow.com/questions/7878398/how-to-e
              xtract-an-arbitrary-line-of-values-from-a-numpy-array

    Parameters: z : (np.array) 2D data matrix
                atr : (dict) attribute
                start_yx : (list) y,x coordinate of start point
                end_yx : (list) y,x coordinate of end   point
                interpolation : str, sampling/interpolation method, including:
                    'nearest'  - nearest neighbour, by default
                    'cubic'    - cubic interpolation
                    'bilinear' - bilinear interpolation

    Returns:    transect: (dict) containing 1D matrix:
                    'X' - 1D np.array for X/column coordinates in float32
                    'Y' - 1D np.array for Y/row.   coordinates in float32
                    'value' - 1D np.array for z value in float32
                    'distance' - 1D np.array for distance in float32

    Example: transect = transect_yx(dem, demRsc, [10,15], [100,115])
    """
    [y0, x0] = start_yx
    [y1, x1] = end_yx

    # check
    length, width = int(atr['LENGTH']), int(atr['WIDTH'])
    if not all(0<= i < width and 0<= j < length for i,j in zip([x0,x1], [y0,y1])):
        msg = 'input start/end point is out of data coverage'
        msg += '\nstart_yx: {}'.format(start_yx)
        msg += '\nend_yx:{}'.format(end_yx)
        msg += '\ndata size: ({}, {})'.format(length, width)
        raise ValueError(msg)

    # Determine points coordinates along the line
    num_pts = int(np.hypot(x1-x0, y1-y0))
    ys = np.linspace(y0, y1, num_pts, dtype=np.float32)
    xs = np.linspace(x0, x1, num_pts, dtype=np.float32)

    # Extract z value along the line
    if interpolation.lower() == 'nearest':
        z_line = z[np.rint(ys).astype(np.int), np.rint(xs).astype(np.int)]
    elif interpolation.lower() == 'cubic':
        z_line = map_coordinates(z, np.vstack((ys, xs)), order=3)
    elif interpolation.lower() == 'bilinear':
        z_line = map_coordinates(z, np.vstack((ys, xs)), order=2)
    else:
        print('Un-recognized interpolation method: '+interpolation)
        print('Continue with nearest ...')
        z_line = z[np.rint(ys).astype(np.int), np.rint(xs).astype(np.int)]  # nearest neighbour

    # Calculate Distance along the line
    earth_radius = 6.3781e6    # in meter
    if 'Y_FIRST' in atr.keys():
        [lat0, lat1] = coordinate(atr).yx2lalo([y0, y1], coord_type='y')
        lat_c = (lat0 + lat1) / 2.
        x_step = float(atr['X_STEP']) * np.pi/180.0 * earth_radius * np.cos(lat_c * np.pi/180)
        y_step = float(atr['Y_STEP']) * np.pi/180.0 * earth_radius
    else:
        x_step = range_ground_resolution(atr)
        y_step = azimuth_ground_resolution(atr)
    dist_line = np.hypot((xs - x0) * x_step,
                         (ys - y0) * y_step)

    # remove points in masked out areas
    mask = ~np.isnan(z_line)
    mask *= z_line != 0.0

    # prepare output
    transect = {}
    transect['Y'] = ys[mask]
    transect['X'] = xs[mask]
    transect['value'] = z_line[mask]
    transect['distance'] = dist_line[mask]
    return transect

def transect_lalo(z, atr, start_lalo, end_lalo, interpolation='nearest'):
    """Extract 2D matrix (z) value along the line [start_lalo, end_lalo]"""
    coord = coordinate(atr)
    [y0, y1] = coord.lalo2yx([start_lalo[0], end_lalo[0]], coord_type='lat')
    [x0, x1] = coord.lalo2yx([start_lalo[1], end_lalo[1]], coord_type='lon')
    transect = transect_yx(z, atr, [y0, x0], [y1, x1], interpolation)
    return transect

def transect_lines(z, atr, lines):
    """Extract 2D matrix (z) value along multiple lines
    Parameters: z     : 2D np.ndarray in size of (l,w)
                atr   : dict, metadata of matrix z
                lines : list of lines with each line is defined as:
                    [[lat0, lon0], [lat1, lon1]] for geo coordinates
                    [[y0, x0], [y1, x1]] for radar coordinates
    Returns: transect : (dict) containing 1D matrix:
                    'X' - 1D np.array for X/column coordinates in float32
                    'Y' - 1D np.array for Y/row.   coordinates in float32
                    'value' - 1D np.array for z value in float32
                    'distance' - 1D np.array for distance in float32
    """
    transect = {}
    start_distance = 0
    transect['start_distance'] = []

    for i in range(len(lines)):
        # read segment data
        start_lalo, end_lalo = lines[i][0], lines[i][1]
        if 'Y_FIRST' in atr.keys():
            seg = transect_lalo(z, atr, start_lalo, end_lalo)
        else:
            seg = transect_yx(z, atr, start_lalo, end_lalo)
        seg['distance'] += start_distance

        # connect each segment
        if i == 0:
            # first segment
            for key, value in seg.items():
                transect[key] = np.array(value, dtype=np.float32)
        else:
            for key, value in seg.items():
                transect[key] = np.concatenate((transect[key], value))

        # update start_distance for the next segment
        transect['start_distance'].append(start_distance)
        start_distance = transect['distance'][-1]
    transect['start_distance'] = np.array(transect['start_distance'], dtype=np.float32)
    return transect

#################################################################################


export JAVA_HOME=/Program Files (x86)/Java/jdk1.7.0_21
cd /adt32/eclipse/workspace/AppTCPClientDemo1
jarsigner -verify -verbose -certs /adt32/eclipse/workspace/AppTCPClientDemo1/bin/AppTCPClientDemo1-release.apk


<!DOCTYPE html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">

	<title>Pondasee - Front-end Starter Kit</title>

	<link rel="shortcut icon" href="">

	<link rel="stylesheet" href="style.css">


"""transform implements a few common functions that are often used in multiple
applications.
"""

import numpy as np
from skimage import transform

def scale_and_extract(image, height, width=None):
    """This function scales the image and then extracts the center part of the
    image with the given height and width.

    Input:
        image: an ndarray or a skimage Image.
        height: the target height of the image.
        width: the target width of the image. If not provided, we will use
            width = height.
    output:
        image_out: an ndarray of (height * width), and of dtype float64.
    """
    if not width:
        width = height
    ratio = max(height / float(image.shape[0]), width / float(image.shape[1]))
    # we add 0.5 to the converted result to avoid numerical problems.
    image_reshape = transform.resize(
        image, (int(image.shape[0] * ratio + 0.5), int(image.shape[1] * ratio + 0.5)))
    h_offset = (image_reshape.shape[0] - height) / 2
    w_offset = (image_reshape.shape[1] - width) / 2
    return image_reshape[h_offset:h_offset+height, w_offset:w_offset+width]

def as_rgb(image):
    """Converts an image that could possibly be a grayscale or RGBA image to
    RGB.
    """
    if image.ndim == 2:
        return np.tile(image[:, :, np.newaxis], (1, 1, 3))
    elif image.shape[2] == 4:
        # An RGBA image. We will only use the first 3 channels.
        return image[:, :, :3]
    else:
        return image


name: CI

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - '*'

jobs:
  build:
    name: MacOS
    runs-on: macOS-latest
    steps:
    - uses: actions/checkout@v1
    - name: Run tests
      run: make test-swift

  ubuntu:
    name: Ubuntu
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Run tests
      run: make test-linux


{$producttotals.productinfo.name}
{$producttotals.productinfo.groupname}

    {$producttotals.productinfo.name}
    {$producttotals.pricing.baseprice}

{foreach $producttotals.configoptions as $configoption}
    {if $configoption}

             » {$configoption.name}: {$configoption.optionname}
            {$configoption.recurring}{if $configoption.setup} + {$configoption.setup} {$LANG.ordersetupfee}{/if}

    {/if}
{/foreach}

{foreach $producttotals.addons as $addon}

        + {$addon.name}
        {$addon.recurring}

{/foreach}

{if $producttotals.pricing.setup || $producttotals.pricing.recurring || $producttotals.pricing.addons}

        {if $producttotals.pricing.setup}

                {$LANG.cartsetupfees}:
                {$producttotals.pricing.setup}

        {/if}
        {foreach from=$producttotals.pricing.recurringexcltax key=cycle item=recurring}

                {$cycle}:
                {$recurring}

        {/foreach}
        {if $producttotals.pricing.tax1}

                {$carttotals.taxname} @ {$carttotals.taxrate}%:
                {$producttotals.pricing.tax1}

        {/if}
        {if $producttotals.pricing.tax2}

                {$carttotals.taxname2} @ {$carttotals.taxrate2}%:
                {$producttotals.pricing.tax2}

        {/if}

{/if}

    {$producttotals.pricing.totaltoday}
    {$LANG.ordertotalduetoday}


package com.java110.entity;

/**
 * Hello world!
 *
 */
public class App
{
    public static void main( String[] args )
    {
        System.out.println( "Hello World!" );
    }
}


/**
 * Detect Electron renderer process, which is node, but we should
 * treat as a browser.
 */

if (typeof process !== 'undefined' && process.type === 'renderer') {
  module.exports = require('./browser.js');
} else {
  module.exports = require('./node.js');
}


#include<iostream>
using namespace std;

bool linearSearch(int *a,int n,int val)
{
	for(int i=0;i<n;i++)
	{
		if(a[i]==val)
			return true;
	}
	return false;

}
int main()
{
	int n;
	cin>>n;      //size of array
	int *a=new int[n];

	for(int i=0;i<n;i++)
      	{
            cin>>a[i];
	    }

	int val;
	cin>>val;      //value to be searched

	int l=linearSearch(a,n,val);

	if(l)               //true
		cout<<"Yes";
	else
		cout<<"No";

}


/*
Copyright Rene Rivera 2012-2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/

#ifndef BOOST_PREDEF_OS_BSD_BSDI_H
#define BOOST_PREDEF_OS_BSD_BSDI_H

#include <boost/predef/os/bsd.h>

/*`
[heading `BOOST_OS_BSD_BSDI`]

[@http://en.wikipedia.org/wiki/BSD/OS BSDi BSD/OS] operating system.

[table
    [[__predef_symbol__] [__predef_version__]]

    [[`__bsdi__`] [__predef_detection__]]
    ]
 */

#define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_NOT_AVAILABLE

#if !defined(BOOST_PREDEF_DETAIL_OS_DETECTED) && ( \
    defined(__bsdi__) \
    )
#   ifndef BOOST_OS_BSD_AVAILABLE
#       define BOOST_OS_BSD BOOST_VERSION_NUMBER_AVAILABLE
#       define BOOST_OS_BSD_AVAILABLE
#   endif
#   undef BOOST_OS_BSD_BSDI
#   define BOOST_OS_BSD_BSDI BOOST_VERSION_NUMBER_AVAILABLE
#endif

#if BOOST_OS_BSD_BSDI
#   define BOOST_OS_BSD_BSDI_AVAILABLE
#   include <boost/predef/detail/os_detected.h>
#endif

#define BOOST_OS_BSD_BSDI_NAME "BSDi BSD/OS"

#endif

#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_OS_BSD_BSDI,BOOST_OS_BSD_BSDI_NAME)


syntax = "proto3";

package server;

option go_package = "github.com/weaveworks/common/server";

import "google/protobuf/empty.proto";

service FakeServer {
    rpc Succeed(google.protobuf.Empty) returns (google.protobuf.Empty) {};
    rpc FailWithError(google.protobuf.Empty) returns (google.protobuf.Empty) {};
    rpc FailWithHTTPError(FailWithHTTPErrorRequest) returns (google.protobuf.Empty) {};
    rpc Sleep(google.protobuf.Empty) returns (google.protobuf.Empty) {};
    rpc StreamSleep(google.protobuf.Empty) returns (stream google.protobuf.Empty) {};
}

message FailWithHTTPErrorRequest {
  int32 Code = 1;
}


library(hamcrest)

 expected <- c(-0x1.6392cb2b1708ap+0 + 0x0p+0i, -0x1.575ff82ba5b55p+0 + -0x1.f2e332fe84e54p-1i,
0x1.1853a6167209bp-2 + 0x1.ee937b46121edp-2i, 0x1.c42634d525c52p-4 + -0x1.3c9a209ff2635p-2i,
0x1.895e92ec83594p-2 + -0x1.4f37207c11e82p-2i, 0x1.1648b555e5752p-1 + -0x1.d163334116d46p-2i,
0x1.d03b1dc439678p-4 + 0x0p+0i, 0x1.1648b555e574ep-1 + 0x1.d163334116d49p-2i,
0x1.895e92ec83595p-2 + 0x1.4f37207c11e83p-2i, 0x1.c42634d525c5ep-4 + 0x1.3c9a209ff2633p-2i,
0x1.1853a6167209cp-2 + -0x1.ee937b46121eep-2i, -0x1.575ff82ba5b57p+0 + 0x1.f2e332fe84e53p-1i
)

assertThat(stats:::fft(z=c(-0.111216789501516, -0.25830268921249, -0.287927812295204,
0.0798221712227701, 0.115758229759969, 0.330726608108316, 0.117915429667883,
-0.0554041778298202, -0.26825269461433, -0.29340713679578, -0.20408687066938,
-0.554582910819099))
,  identicalTo( expected, tol = 1e-6 ) )


find_path(DUKGLUE_INCLUDE_DIR dukglue.h
  ${DUKGLUE_DIR}/dukglue
  ${DUKGLUE_DIR}
  $ENV{DUKGLUE_DIR}/dukglue
  $ENV{DUKGLUE_DIR}
  /usr/local/include/dukglue
  /usr/include/dukglue
  ${CMAKE_CURRENT_SOURCE_DIR}/../dukglue
)


/* @flow */

var execSync = require('child_process').execSync;

(execSync('ls'): Buffer); // returns Buffer
(execSync('ls', {encoding: 'buffer'}): Buffer); // returns Buffer
(execSync('ls', {encoding: 'utf8'}): string); // returns string
(execSync('ls', {timeout: '250'})); // error, no signatures match
(execSync('ls', {stdio: 'inherit'})); // error, no signatures match
(execSync('ls', {stdio: ['inherit']})); // error, no signatures match


/*
 * ResourceBindingIterator.cpp
 *
 * This file is part of the "LLGL" project (Copyright (c) 2015-2019 by Lukas Hermanns)
 * See "LICENSE.txt" for license information.
 */

#include "ResourceBindingIterator.h"
#include <algorithm>

namespace LLGL
{

ResourceBindingIterator::ResourceBindingIterator(
    const std::vector<ResourceViewDescriptor>&  resourceViews,
    const std::vector<BindingDescriptor>&       bindings,
    std::size_t                                 firstResourceIndex,
    bool                                        iterateAllSegments)
:
    resourceViews_ { resourceViews        },
    bindings_      { bindings             },
    offset_        { firstResourceIndex   },
    count_         { resourceViews.size() }
{
    if (!iterateAllSegments)
        count_ = std::min(count_, bindings.size());
}

void ResourceBindingIterator::Reset(const ResourceType typeOfInterest, long bindFlagsOfInterest, long stagesOfInterest)
{
    iterator_               = 0;
    typeOfInterest_         = typeOfInterest;
    bindFlagsOfInterest_    = bindFlagsOfInterest;
    stagesOfInterest_       = stagesOfInterest;
}

// Returns the specified resource type as string
static const char* ResourceTypeToString(const ResourceType t)
{
    switch (t)
    {
        case ResourceType::Buffer:  return "Buffer";
        case ResourceType::Texture: return "Texture";
        case ResourceType::Sampler: return "Sampler";
        default:                    return "Undefined";
    }
}

[[noreturn]]
static void ErrNullPointerResource(const ResourceType t)
{
    throw std::invalid_argument(
        "null pointer exception of resource object used as binding point for 'LLGL::ResourceType::"
        + std::string(ResourceTypeToString(t)) + "'"
    );
}

Resource* ResourceBindingIterator::Next(const BindingDescriptor** bindingDesc, const ResourceViewDescriptor** rvDesc)
{
    while (iterator_ < count_)
    {
        /* Search for resource type of interest */
        const auto& current = bindings_[iterator_ % bindings_.size()];
        if ( current.type == typeOfInterest_ &&
             ( bindFlagsOfInterest_ == 0 || (current.bindFlags  & bindFlagsOfInterest_) != 0 ) &&
             ( stagesOfInterest_    == 0 || (current.stageFlags & stagesOfInterest_   ) != 0 ) )
        {
            /* Check for null pointer exception */
            const auto& resourceViewDesc = resourceViews_[offset_ + iterator_];
            if (auto resource = resourceViewDesc.resource)
            {
                if (bindingDesc != nullptr)
                    *bindingDesc = &current;
                if (rvDesc != nullptr)
                    *rvDesc = &resourceViewDesc;
                ++iterator_;
                return resource;
            }
            else
                ErrNullPointerResource(current.type);
        }
        ++iterator_;
    }
    return nullptr;
}

} // /namespace LLGL

// ================================================================================


/// \file
// Range v3 library
//
//  Copyright Eric Niebler 2014-present
//
//  Use, modification and distribution is subject to the
//  Boost Software License, Version 1.0. (See accompanying
//  file LICENSE_1_0.txt or copy at
//  http://www.boost.org/LICENSE_1_0.txt)
//
// Project home: https://github.com/ericniebler/range-v3
//

#ifndef RANGES_V3_RANGE_FOR_HPP
#define RANGES_V3_RANGE_FOR_HPP

#include <range/v3/range_fwd.hpp>

#include <range/v3/range/access.hpp>

#if RANGES_CXX_RANGE_BASED_FOR < RANGES_CXX_RANGE_BASED_FOR_17
/// A range-based for macro, basically a hack until the built-in range-for can handle
/// Ranges that have a different type for begin and end. \ingroup range-core
#define RANGES_FOR(VAR_DECL, ...)                                              \
    if(bool CPP_PP_CAT(_range_v3_done, __LINE__) = false) {}                   \
    else                                                                       \
        for(auto && CPP_PP_CAT(_range_v3_rng, __LINE__) = (__VA_ARGS__);       \
            !CPP_PP_CAT(_range_v3_done, __LINE__);)                            \
            for(auto CPP_PP_CAT(_range_v3_begin, __LINE__) =                   \
                    ranges::begin(CPP_PP_CAT(_range_v3_rng, __LINE__));        \
                !CPP_PP_CAT(_range_v3_done, __LINE__);                         \
                CPP_PP_CAT(_range_v3_done, __LINE__) = true)                   \
                for(auto CPP_PP_CAT(_range_v3_end, __LINE__) =                 \
                        ranges::end(CPP_PP_CAT(_range_v3_rng, __LINE__));      \
                    !CPP_PP_CAT(_range_v3_done, __LINE__) &&                   \
                    CPP_PP_CAT(_range_v3_begin, __LINE__) !=                   \
                        CPP_PP_CAT(_range_v3_end, __LINE__);                   \
                    ++CPP_PP_CAT(_range_v3_begin, __LINE__))                   \
                    if(!(CPP_PP_CAT(_range_v3_done, __LINE__) = true)) {}      \
                    else                                                       \
                        for(VAR_DECL = *CPP_PP_CAT(_range_v3_begin, __LINE__); \
                            CPP_PP_CAT(_range_v3_done, __LINE__);              \
                            CPP_PP_CAT(_range_v3_done, __LINE__) = false)      \
    /**/

#else
#define RANGES_FOR(VAR_DECL, ...) for(VAR_DECL : (__VA_ARGS__))
#endif

#endif


<!doctype html>

<title>CodeMirror: JavaScript mode</title>
<meta charset="utf-8"/>
<link rel=stylesheet href="../../doc/docs.css">

<link rel="stylesheet" href="../../lib/codemirror.css">

CodeMirror

Home

Manual

Code

Language modes

JavaScript

JavaScript mode

<textarea id="code" name="code">
// Demo code (the actual new parser character stream implementation)

function StringStream(string) {
  this.pos = 0;
  this.string = string;
}

StringStream.prototype = {
  done: function() {return this.pos >= this.string.length;},
  peek: function() {return this.string.charAt(this.pos);},
  next: function() {
    if (this.pos < this.string.length)
      return this.string.charAt(this.pos++);
  },
  eat: function(match) {
    var ch = this.string.charAt(this.pos);
    if (typeof match == "string") var ok = ch == match;
    else var ok = ch && match.test ? match.test(ch) : match(ch);
    if (ok) {this.pos++; return ch;}
  },
  eatWhile: function(match) {
    var start = this.pos;
    while (this.eat(match));
    if (this.pos > start) return this.string.slice(start, this.pos);
  },
  backUp: function(n) {this.pos -= n;},
  column: function() {return this.pos;},
  eatSpace: function() {
    var start = this.pos;
    while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
    return this.pos - start;
  },
  match: function(pattern, consume, caseInsensitive) {
    if (typeof pattern == "string") {
      function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
      if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
        if (consume !== false) this.pos += str.length;
        return true;
      }
    }
    else {
      var match = this.string.slice(this.pos).match(pattern);
      if (match && consume !== false) this.pos += match[0].length;
      return match;
    }
  }
};
</textarea>

      JavaScript mode supports several configuration options:

json which will set the mode to expect JSON
        data rather than a JavaScript program.

jsonld which will set the mode to expect
        JSON-LD linked data rather
        than a JavaScript program (demo).

typescript which will activate additional
        syntax highlighting and some other things for TypeScript code
        (demo).

statementIndent which (given a number) will
        determine the amount of indentation to use for statements
        continued on a new line.

wordCharacters, a regexp that indicates which
        characters should be considered part of an identifier.
        Defaults to /[\w$]/, which does not handle
        non-ASCII identifiers. Can be set to something more elaborate
        to improve Unicode support.

MIME types defined: text/javascript, application/json, application/ld+json, text/typescript, application/typescript.


var
let
as
null
undefined
true
false
if
else
this


/*
 * Copyright 2014-2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.restdocs.mockmvc;

import java.net.URI;

import javax.servlet.ServletContext;

import org.junit.Test;

import org.springframework.http.HttpMethod;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockServletContext;
import org.springframework.restdocs.generate.RestDocumentationGenerator;
import org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder;

import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.delete;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.fileUpload;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.get;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.head;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.options;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.patch;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.post;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.put;
import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders.request;

/**
 * Tests for {@link RestDocumentationRequestBuilders}.
 *
 * @author Andy Wilkinson
 *
 */
public class RestDocumentationRequestBuildersTests {

	private final ServletContext servletContext = new MockServletContext();

	@Test
	public void getTemplate() {
		assertTemplate(get("/{template}", "t"), HttpMethod.GET);
	}

	@Test
	public void getUri() {
		assertUri(get(URI.create("/uri")), HttpMethod.GET);
	}

	@Test
	public void postTemplate() {
		assertTemplate(post("/{template}", "t"), HttpMethod.POST);
	}

	@Test
	public void postUri() {
		assertUri(post(URI.create("/uri")), HttpMethod.POST);
	}

	@Test
	public void putTemplate() {
		assertTemplate(put("/{template}", "t"), HttpMethod.PUT);
	}

	@Test
	public void putUri() {
		assertUri(put(URI.create("/uri")), HttpMethod.PUT);
	}

	@Test
	public void patchTemplate() {
		assertTemplate(patch("/{template}", "t"), HttpMethod.PATCH);
	}

	@Test
	public void patchUri() {
		assertUri(patch(URI.create("/uri")), HttpMethod.PATCH);
	}

	@Test
	public void deleteTemplate() {
		assertTemplate(delete("/{template}", "t"), HttpMethod.DELETE);
	}

	@Test
	public void deleteUri() {
		assertUri(delete(URI.create("/uri")), HttpMethod.DELETE);
	}

	@Test
	public void optionsTemplate() {
		assertTemplate(options("/{template}", "t"), HttpMethod.OPTIONS);
	}

	@Test
	public void optionsUri() {
		assertUri(options(URI.create("/uri")), HttpMethod.OPTIONS);
	}

	@Test
	public void headTemplate() {
		assertTemplate(head("/{template}", "t"), HttpMethod.HEAD);
	}

	@Test
	public void headUri() {
		assertUri(head(URI.create("/uri")), HttpMethod.HEAD);
	}

	@Test
	public void requestTemplate() {
		assertTemplate(request(HttpMethod.GET, "/{template}", "t"), HttpMethod.GET);
	}

	@Test
	public void requestUri() {
		assertUri(request(HttpMethod.GET, URI.create("/uri")), HttpMethod.GET);
	}

	@Test
	public void fileUploadTemplate() {
		assertTemplate(fileUpload("/{template}", "t"), HttpMethod.POST);
	}

	@Test
	public void fileUploadUri() {
		assertUri(fileUpload(URI.create("/uri")), HttpMethod.POST);
	}

	private void assertTemplate(MockHttpServletRequestBuilder builder, HttpMethod httpMethod) {
		MockHttpServletRequest request = builder.buildRequest(this.servletContext);
		assertThat((String) request.getAttribute(RestDocumentationGenerator.ATTRIBUTE_NAME_URL_TEMPLATE))
				.isEqualTo("/{template}");
		assertThat(request.getRequestURI()).isEqualTo("/t");
		assertThat(request.getMethod()).isEqualTo(httpMethod.name());
	}

	private void assertUri(MockHttpServletRequestBuilder builder, HttpMethod httpMethod) {
		MockHttpServletRequest request = builder.buildRequest(this.servletContext);
		assertThat(request.getRequestURI()).isEqualTo("/uri");
		assertThat(request.getMethod()).isEqualTo(httpMethod.name());
	}

}


%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%

:- module typeclass_test_12.
:- interface.
:- typeclass foo(T) where [pred p is semidet].
:- typeclass bar(T) where [].
:- typeclass baz(T) where [func q = int].


<!doctype html>

	<meta charset="utf-8">
	<title>An example from http://rwd.education</title>
	<meta name="description" content="An example from the book, 'Responsive Web Design with HTML5 and CSS3' by Ben Frain">
	<meta name="viewport" content="width=device-width">
	<meta name="theme-color" content="#ff9900">
	<link rel="stylesheet" href="styles.css">

Demonstration of CSS transforms

		scale(1.4)
		translate(-20px, -20px)
		rotate(30deg)
		skew(40deg, 12deg)
		matrix(1.178, -0.256, 1.122, 1.333, -41.533, -1.989)


<?php
/*
 * Copyright 2014 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

class Google_Service_CloudFunctions_CallFunctionResponse extends Google_Model
{
  public $error;
  public $executionId;
  public $result;

  public function setError($error)
  {
    $this->error = $error;
  }
  public function getError()
  {
    return $this->error;
  }
  public function setExecutionId($executionId)
  {
    $this->executionId = $executionId;
  }
  public function getExecutionId()
  {
    return $this->executionId;
  }
  public function setResult($result)
  {
    $this->result = $result;
  }
  public function getResult()
  {
    return $this->result;
  }
}