text:
using System.Threading;
using System.Threading.Tasks;

namespace System.Runtime.CompilerServices
{
    public struct ConfiguredTaskAwaitable
    {
        Task _t;
        bool _continueOnCapturedContext;

        internal ConfiguredTaskAwaitable(Task t, bool continueOnCapturedContext)
        {
            _t = t;
            _continueOnCapturedContext = continueOnCapturedContext;
        }

        public ConfiguredTaskAwaiter GetAwaiter() => new ConfiguredTaskAwaiter(_t, _continueOnCapturedContext);

        public struct ConfiguredTaskAwaiter : ICriticalNotifyCompletion, INotifyCompletion
        {
            Task _t;
            SynchronizationContext _capturedContext;

            internal ConfiguredTaskAwaiter(Task t, bool continueOnCapturedContext)
            {
                _t = t;
                _capturedContext = continueOnCapturedContext ? SynchronizationContext.Current : null;
            }

            public void OnCompleted(Action continuation) => TaskAwaiter.OnCompletedInternal(_t, continuation, _capturedContext);
            public void UnsafeOnCompleted(Action continuation) => OnCompleted(continuation);
            public bool IsCompleted => _t.IsCompleted;
            public void GetResult() => _t.GetResult();
        }
    }
}


text:
<?php

if (!function_exists('build_query_string')) {
    /**
     * Generate a query string.
     *
     * @param int $encoding
     */
    function build_query_string(array $params = [], $encoding = PHP_QUERY_RFC3986): string
    {
        if (empty($params)) {
            return '';
        }

        $query = '';
        foreach ($params as $key => $value) {
            if (empty($value)) {
                continue;
            }

            if (is_array($value)) {
                $query .= build_batch_query_string($key, $value, $encoding);

                continue;
            }

            $parameter = url_encode($key, $encoding);
            $propertyValue = is_bool($value) ? 'true' : url_encode($value, $encoding);
            $query .= "&{$parameter}={$propertyValue}";
        }

        return $query ?: '';
    }
}

if (!function_exists('build_batch_query_string')) {
    /**
     * Generate a query string for batch requests.
     *
     * @param string $key      the name of the query variable
     * @param array  $items    an array of item values for the variable
     * @param int    $encoding
     */
    function build_batch_query_string($key, array $items, $encoding = PHP_QUERY_RFC3986): string
    {
        return array_reduce($items, function ($query, $item) use ($key, $encoding) {
            return $query.'&'.url_encode($key, $encoding).'='.url_encode($item, $encoding);
        }, '');
    }
}

if (!function_exists('url_encode')) {
    /**
     * Url encode a string.
     *
     * @param string $value
     * @param int    $encoding
     *
     * @return string
     */
    function url_encode($value, $encoding = PHP_QUERY_RFC3986)
    {
        switch ($encoding) {
            case false:
                return $value;

            case PHP_QUERY_RFC3986:
                return rawurlencode($value);

            case PHP_QUERY_RFC1738:
                return urlencode($value);

            default:
                throw new \InvalidArgumentException('Invalid type');
        }
    }
}

if (!function_exists('ms_timestamp')) {
    /**
     * Get a millisecond timestamp from a date or time.
     *
     * @param mixed $time
     *
     * @return int
     */
    function ms_timestamp($time)
    {
        switch (true) {
            case $time instanceof \DateTime:
                return $time->getTimestamp() * 1000;

            case is_numeric($time) && 10 === strlen((string) $time):
                return $time * 1000;

            case is_string($time):
                return strtotime($time) * 1000;

            default:
                return $time;
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
  <form class="well well-sm" ng-submit="addNew()">

        Name:
        <input type="text" class="form-control input-sm" placeholder="Name" ng-model="newTeacher.name">

        Sex:

          Male
          Female

        Phone:
        <input type="tel" class="form-control input-sm" placeholder="Phone" ng-model="newTeacher.phone">

      <button class="btn btn-default btn-sm" type="submit"></button>

  </form>

Empty list!

Create new teacher

    <colgroup>
      <col width="1%">
      <col width="1%">
      <col width="48%">
      <col width="49%">
      <col width="1%">
    </colgroup>

        #

        Name
        Phone

            <button class="btn btn-default btn-sm" type="button" ng-click="showRelations(o)"> </button>
            <button class="btn btn-default btn-sm" type="button" ng-click="removeOld(o)"></button>


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

  <LinearLayout
      android:id="@id/dragview"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="@dimen/header_draggable_height"
      android:background="@color/white"
      android:gravity="center_vertical"
      >

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@string/description_image"
        android:src="@drawable/ic_draggable_vert_grey_600_24dp"
        />

    <TextView
        android:id="@+id/tag_top_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/label_tags"
        android:textAppearance="@style/TextAppearance.DragTitle"
        />

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/spacing_small"
        android:contentDescription="@string/description_image"
        android:src="@drawable/ic_tag_outline_black_24dp"
        />

  </LinearLayout>

  <com.ogaclejapan.smarttablayout.SmartTabLayout
      android:id="@+id/tag_top_viewpagertab"
      android:layout_width="match_parent"
      android:layout_height="@dimen/tag_tab_height"
      android:layout_below="@id/dragview"
      android:background="@color/white"
      app:stl_defaultTabTextAllCaps="false"
      app:stl_defaultTabTextColor="@color/text_secondary"
      app:stl_defaultTabTextHorizontalPadding="@dimen/spacing_large"
      app:stl_defaultTabTextSize="@dimen/text_size_medium"
      app:stl_dividerColor="@color/transparent"
      app:stl_indicatorColor="@color/accent"
      app:stl_indicatorCornerRadius="1dp"
      app:stl_indicatorInFront="true"
      app:stl_indicatorThickness="2dp"
      app:stl_underlineColor="@color/secondary"
      app:stl_underlineThickness="1dp"
      />

  <android.support.v4.view.ViewPager
      android:id="@+id/tag_top_viewpager"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@id/tag_top_viewpagertab"
      />

</RelativeLayout>


text:
 export const evaluate = (exp: string, data: any): any => {
  /* eslint-disable no-new-func */
  const fn = new Function('data', `with (data) { return ${exp} }`)
  try {
    return fn(data)
  } catch (err) {
    console.error(err.stack)
    console.error(`Error when evaluating filter condition: ${exp}`)
  }
}


text:
package org.slc.sli.ingestion.handler;

import java.util.List;

import org.slc.sli.ingestion.FileProcessStatus;
import org.slc.sli.ingestion.validation.DummyErrorReport;
import org.slc.sli.ingestion.validation.ErrorReport;
import org.slc.sli.ingestion.validation.ErrorReportSupport;
import org.slc.sli.ingestion.validation.Validator;

/**
 * Abstract class for all handlers.
 *
 * @author dduran
 *
 */
public abstract class AbstractIngestionHandler<T, O> implements Handler<T, O> {

    List<? extends Validator<T>> preValidators;

    List<? extends Validator<T>> postValidators;

    protected abstract O doHandling(T item, ErrorReport errorReport, FileProcessStatus fileProcessStatus);

    protected abstract List<O> doHandling(List<T> items, ErrorReport errorReport, FileProcessStatus fileProcessStatus);

    void pre(T item, ErrorReport errorReport) {
        if (preValidators != null) {
            for (Validator<T> validator : preValidators) {
                validator.isValid(item, errorReport);
            }
        }
    };

    void post(T item, ErrorReport errorReport) {
        if (postValidators != null) {
            for (Validator<T> validator : postValidators) {
                validator.isValid(item, errorReport);
            }
        }
    };

    @Override
    public O handle(T item) {

        ErrorReport errorReport = null;
        if (item instanceof ErrorReportSupport) {
            errorReport = ((ErrorReportSupport) item).getErrorReport();
        } else {
            errorReport = new DummyErrorReport();
        }

        return handle(item, errorReport);
    }

    @Override
    public O handle(T item, ErrorReport errorReport) {
        return handle(item, errorReport, new FileProcessStatus());
    }

    @Override
    public List<O> handle(List<T> items, ErrorReport errorReport) {
        return handle(items, errorReport, new FileProcessStatus());
    }

    public O handle(T item, ErrorReport errorReport, FileProcessStatus fileProcessStatus) {
        O o = null;
        pre(item, errorReport);
        if (!errorReport.hasErrors()) {
            o = doHandling(item, errorReport, fileProcessStatus);
            post(item, errorReport);
        }
        return o;
    }

    public List<O> handle(List<T> items, ErrorReport errorReport, FileProcessStatus fileProcessStatus) {
        // TODO: add pre and post validation that will iterate through the list and perform
        // appropriate validations
        if (!errorReport.hasErrors()) {
            return doHandling(items, errorReport, fileProcessStatus);
        }
        return null;
    }

    public void setPreValidators(List<Validator<T>> preValidators) {
        this.preValidators = preValidators;
    }

    public void setPostValidators(List<Validator<T>> postValidators) {
        this.postValidators = postValidators;
    }
}


text:
---
uid: SolidEdgeDraft.DrawingView.Defaults_SolidFillSectionWeldBeads
summary:
remarks:
---


text:
module Ruboty
  module Handlers
    class WorldClock < Base
      on /clock (?<zone>.+)\z/i, name: 'world_clock', description: 'Show world clock which you want to see'

      def world_clock(message)
        Ruboty::Actions::WorldClock.new(message).call
      end
    end
  end
end


text:
from pyjsdl.pyjsarray import BitSet
from pyjsdl.color import Color
import sys

if sys.version_info < (3,):
    from pyjsdl.util import _range as range

__docformat__ = 'restructuredtext'

def from_surface(surface, threshold=127):
    """
    **pyjsdl.mask.from_surface**

    Return Mask derived from surface using alpha transparency.
    Optional argument to set alpha threshold.
    """
    mask = Mask((surface.width, surface.height))
    if not mask.bit:
        return None
    pixels = surface.impl.getImageData(0, 0, surface.width, surface.height)
    width, height = surface.width*4, surface.height
    for y in range(0, height):
        xpix = 0
        i = (y*width)+3
        for x in range(0, width, 4):
            if surface._getPixel(pixels, i+x) > threshold:
                mask.set_at((xpix,y))
            xpix += 1
    return mask

def from_threshold(surface, color, threshold=(0,0,0,255)):
    """
    **pyjsdl.mask.from_threshold**

    Return Mask from surface using a given color.
    Optional threshold argument to set color range and alpha threshold.
    """
    mask = Mask((surface.width, surface.height))
    if not mask.bit:
        return None
    pixels = surface.impl.getImageData(0, 0, surface.width, surface.height)
    if threshold == (0,0,0,255):
        color = Color(color)
        color = (color.r,color.g,color.b)
        width, height = surface.width*4, surface.height
        for y in range(0, height):
            xpix = 0
            i = y*width
            for x in range(0, width, 4):
                ix = i+x
                if (surface._getPixel(pixels, ix) == color[0] and
                    surface._getPixel(pixels, ix+1) == color[1] and
                    surface._getPixel(pixels, ix+2) == color[2] and
                    surface._getPixel(pixels, ix+3) >= threshold[3]):
                    mask.set_at((xpix,y))
                xpix += 1
    else:
        color = Color(color)
        col = {}
        for i, c in enumerate(('r','g','b')):
            if threshold[i]:
                col[c+'1'] = color[i] - threshold[i] - 1
                col[c+'2'] = color[i] + threshold[i] + 1
            else:
                col[c+'1'] = color[i] - 1
                col[c+'2'] = color[i] + 1
        col['a'] = threshold[3] - 1
        width, height = surface.width*4, surface.height
        for y in range(0, height):
            xpix = 0
            i = y*width
            for x in range(0, width, 4):
                ix = i+x
                if ((col['r1'] < surface._getPixel(pixels, ix) < col['r2']) and
                    (col['g1'] < surface._getPixel(pixels, ix+1) < col['g2']) and
                    (col['b1'] < surface._getPixel(pixels, ix+2) < col['b2']) and
                    (surface._getPixel(pixels, ix+3) > col['a'])):
                    mask.set_at((xpix,y))
                xpix += 1
    return mask

class Mask(object):
    """
    **pyjsdl.mask.Mask**

    * Mask.get_size
    * Mask.get_at
    * Mask.set_at
    * Mask.fill
    * Mask.clear
    * Mask.invert
    * Mask.count
    * Mask.overlap
    * Mask.toString
    """

    def __init__(self, size):
        """
        Return a Mask object.
        The size argument is (width, height) of the mask.
        The mask is represented by a list of Bitset.
        """
        self.width = int(size[0])
        self.height = int(size[1])
        self.bit = []
        for bitset in range(self.height):
            self.bit.append(BitSet(self.width))

    def __str__(self):
        return self.toString()

    def __repr__(self):
        return "%s(%r)" % (self.__class__, self.__dict__)

    def get_size(self):
        """
        Return width, height of mask.
        """
        return (self.width, self.height)

    def get_at(self, pos):
        """
        Return bit setting for given pos.
        """
        return self.bit[pos[1]].get(pos[0])

    def set_at(self, pos, value=1):
        """
        Set bit for given pos.
        Optional value to set bit, eith 1 or 0, defaults to 1.
        """
        self.bit[pos[1]].set(pos[0], value)
        return None

    def fill(self):
        """
        Fill mask.
        """
        for bitset in self.bit:
            bitset.fill()
        return None

    def clear(self):
        """
        Clear mask.
        """
        for bitset in self.bit:
            bitset.clear()
        return None

    def invert(self):
        """
        Invert bit value in mask.
        """
        for bitset in self.bit:
            bitset.flip(0,self.width)
        return None

    def count(self):
        """
        Return count of true bits in mask.
        """
        true_bits = 0
        for bitset in self.bit:
            true_bits += bitset.cardinality()
        return true_bits

    def overlap(self, mask, offset):
        """
        Return True if mask at offset position overlap with this mask.
        """
        if offset[0] > 0:
            x1 = offset[0]
            x2 = 0
        else:
            x1 = 0
            x2 = -offset[0]
        if offset[1] > 0:
            y1 = offset[1]
            y2 = 0
        else:
            y1 = 0
            y2 = -offset[1]
        w = min(self.width-x1, mask.width-x2)
        h = min(self.height-y1, mask.height-y2)
        if w > 0 and h > 0:
            for y in range(h):
                if self.bit[y1+y].get(x1, x1+w).intersects(
                              mask.bit[y2+y].get(x2, x2+w)):
                    return True
        return None

    def toString(self, bit=('1','0')):
        """
        Return string representation of mask.
        Optional bit argument specify bit character.
        """
        cbit = {True:bit[0], False:bit[1]}
        cbitset = []
        for bitset in self.bit:
            cbitset.append('\n')
            cbitset.extend([cbit[bitset.get(i)]
                            for i in range(self.width)])
        bitstr = ''.join(cbitset)
        return bitstr


text:
<script>
  export default {
    data() {
      return {
        tags: [
          { key: 1, name: 'Tag one', type: '' },
          { key: 2, name: 'Tag Two', type: 'gray' },
          { key: 5, name: 'Tag Three', type: 'primary' },
          { key: 3, name: 'Tag Four', type: 'success' },
          { key: 4, name: 'Tag Five', type: 'warning' },
          { key: 6, name: 'Tag Six', type: 'danger' }
        ]
      };
    },
    methods: {
      handleClose(tag) {
        this.tags.splice(this.tags.indexOf(tag), 1);
      }
    }
  }
</script>

<style>
  .demo-box.demo-tag {
    .el-tag + .el-tag {
      margin-left: 10px;
    }
  }
</style>

## Tag

Used for marking and selection.

### Basic usage

::: demo Use the `type` attribute to define Tag's type. In addition, the `color` attribute can be used to set the background color of the Tag.

```html
<el-tag>Tag One</el-tag>
<el-tag type="gray">Tag Two</el-tag>
<el-tag type="primary">Tag Three</el-tag>
<el-tag type="success">Tag Four</el-tag>
<el-tag type="warning">Tag Five</el-tag>
<el-tag type="danger">Tag Six</el-tag>
```
:::

### Removable Tag

:::demo Set the `closable` attribute to define a removable tag. It accepts a `Boolean`. By default the removal of Tag has a fading animation. If you don't want to use it, you can set the `close-transition` attribute, which accepts a `Boolean`, to `true`. `close` event triggers when Tag is removed.

```html
<el-tag
  v-for="tag in tags"
  :closable="true"
  :type="tag.type"
  :key="tag"
  :close-transition="false"
  @close="handleClose(tag)"
>
{{tag.name}}
</el-tag>

<script>
  export default {
    data() {
      return {
        tags: [
          { key: 1, name: 'Tag One', type: '' },
          { key: 2, name: 'Tag Two', type: 'gray' },
          { key: 5, name: 'Tag Three', type: 'primary' },
          { key: 3, name: 'Tag Four', type: 'success' },
          { key: 4, name: 'Tag Five', type: 'warning' },
          { key: 6, name: 'Tag Six', type: 'danger' }
        ]
      };
    },
    methods: {
      handleClose(tag) {
        this.tags.splice(this.tags.indexOf(tag), 1);
      }
    }
  }
</script>
```
:::

### Attributes
| Attribute      | Description          | Type      | Accepted Values       | Default  |
|---------- |-------------- |---------- |--------------------------------  |-------- |
| type | theme | string | primary/gray/success/warning/danger | — |
| closable | whether Tab can be removed | boolean | — | false |
| close-transition | whether the removal animation is disabled | boolean | — | false |
| hit | whether Tag has a highlighted border | boolean | — | false |
| color | background color of the tag | string | — | — |

### Events
| Event Name | Description | Parameters |
|---------- |-------- |---------- |
| close | triggers when Tab is removed | — |


text:
package com.evolveum.midpoint.schrodinger.component.resource;

import com.codeborne.selenide.SelenideElement;
import com.evolveum.midpoint.schrodinger.component.Component;

/**
 * Created by matus on 3/28/2018.
 */
public class ResourceTimeoutsTab<T> extends Component<T> {
    public ResourceTimeoutsTab(T parent, SelenideElement parentElement) {
        super(parent, parentElement);
    }
}


text:
/**
 * Utilities to assist with testing.
 */
package dev.failsafe.testing;


text:
package com.willlee.leetcode.utils;

public class ListNode {
    public int val;
    public ListNode next;
    public ListNode pre;
    public ListNode child;
    public ListNode random;

    public ListNode(int val) {
        this.val = val;
    }

    public ListNode(int val, ListNode next) {
        this.val = val;
        this.next = next;
    }

    public ListNode(int val, ListNode next, ListNode random) {
        this.val = val;
        this.next = next;
        this.random = random;
    }

    public void printList() {
        String s = Integer.toString(this.val);
        ListNode p = next;
        while (p != null) {
            s += "-" + p.val;
            p = p.next;
        }
        System.out.println(s);
    }

    public static ListNode generate(int[] a) {
        ListNode head = new ListNode(-1);
        ListNode pre = null;
        ListNode cur = null;
        for (int i = 0; i < a.length; i++) {
            cur = new ListNode(a[i]);
            if (i == 0) {
                head.next = cur;
            } else {
                pre.next = cur;
            }
            pre = cur;
        }
        return head.next;
    }
}


text:
/*
 * reserved comment block
 * DO NOT REMOVE OR ALTER!
 */
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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.
 */

package com.sun.org.apache.bcel.internal.classfile;

import java.io.DataInput;
import java.io.DataOutputStream;
import java.io.IOException;

import com.sun.org.apache.bcel.internal.Const;

/**
 * This class is derived from Attribute and represents the list of packages that are exported or opened by the Module attribute.
 * There may be at most one ModulePackages attribute in a ClassFile structure.
 *
 * @see     Attribute
 */
public final class ModulePackages extends Attribute {

    private int[] packageIndexTable;

    /**
     * Initialize from another object. Note that both objects use the same
     * references (shallow copy). Use copy() for a physical copy.
     */
    public ModulePackages(final ModulePackages c) {
        this(c.getNameIndex(), c.getLength(), c.getPackageIndexTable(), c.getConstantPool());
    }

    /**
     * @param nameIndex Index in constant pool
     * @param length Content length in bytes
     * @param packageIndexTable Table of indices in constant pool
     * @param constantPool Array of constants
     */
    public ModulePackages(final int nameIndex, final int length, final int[] packageIndexTable,
            final ConstantPool constantPool) {
        super(Const.ATTR_MODULE_PACKAGES, nameIndex, length, constantPool);
        this.packageIndexTable = packageIndexTable != null ? packageIndexTable : new int[0];
    }

    /**
     * Construct object from input stream.
     * @param name_index Index in constant pool
     * @param length Content length in bytes
     * @param input Input stream
     * @param constant_pool Array of constants
     * @throws IOException
     */
    ModulePackages(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
        this(name_index, length, (int[]) null, constant_pool);
        final int number_of_packages = input.readUnsignedShort();
        packageIndexTable = new int[number_of_packages];
        for (int i = 0; i < number_of_packages; i++) {
            packageIndexTable[i] = input.readUnsignedShort();
        }
    }

    /**
     * Called by objects that are traversing the nodes of the tree implicitely
     * defined by the contents of a Java class. I.e., the hierarchy of methods,
     * fields, attributes, etc. spawns a tree of objects.
     *
     * @param v Visitor object
     */
    @Override
    public void accept( final Visitor v ) {
        v.visitModulePackages(this);
    }

    /**
     * Dump ModulePackages attribute to file stream in binary format.
     *
     * @param file Output file stream
     * @throws IOException
     */
    @Override
    public void dump( final DataOutputStream file ) throws IOException {
        super.dump(file);
        file.writeShort(packageIndexTable.length);
        for (final int index : packageIndexTable) {
            file.writeShort(index);
        }
    }

    /**
     * @return array of indices into constant pool of package names.
     */
    public int[] getPackageIndexTable() {
        return packageIndexTable;
    }

    /**
     * @return Length of package table.
     */
    public int getNumberOfPackages() {
        return packageIndexTable == null ? 0 : packageIndexTable.length;
    }

    /**
     * @return string array of package names
     */
    public String[] getPackageNames() {
        final String[] names = new String[packageIndexTable.length];
        for (int i = 0; i < packageIndexTable.length; i++) {
            names[i] = super.getConstantPool().getConstantString(packageIndexTable[i],
                    Const.CONSTANT_Package).replace('/', '.');
        }
        return names;
    }

    /**
     * @param packageIndexTable the list of package indexes
     * Also redefines number_of_packages according to table length.
     */
    public void setPackageIndexTable( final int[] packageIndexTable ) {
        this.packageIndexTable = packageIndexTable != null ? packageIndexTable : new int[0];
    }

    /**
     * @return String representation, i.e., a list of packages.
     */
    @Override
    public String toString() {
        final StringBuilder buf = new StringBuilder();
        buf.append("ModulePackages(");
        buf.append(packageIndexTable.length);
        buf.append("):\n");
        for (final int index : packageIndexTable) {
            final String package_name = super.getConstantPool().getConstantString(index, Const.CONSTANT_Package);
            buf.append("  ").append(Utility.compactClassName(package_name, false)).append("\n");
        }
        return buf.substring(0, buf.length()-1); // remove the last newline
    }

    /**
     * @return deep copy of this attribute
     */
    @Override
    public Attribute copy( final ConstantPool _constant_pool ) {
        final ModulePackages c = (ModulePackages) clone();
        if (packageIndexTable != null) {
            c.packageIndexTable = new int[packageIndexTable.length];
            System.arraycopy(packageIndexTable, 0, c.packageIndexTable, 0,
                    packageIndexTable.length);
        }
        c.setConstantPool(_constant_pool);
        return c;
    }
}


text:
var AppSpace = Class.create({
    initialize: function() {
        this.workSpaces = [];
        this.activeWorkSpaceId = null;

    },

});

var WorkSpace = Class.create({

});

var DataBundle = Class.create({

});

var ConceptSpace = Class.create({
    initialize: function() {
        this.facetTreeConfig;

    }
});


text:
{%- set footer_content = get_part('global footer') %}
{% extends 'flask_user/public_base.html' %}

{% block content %}
{% from "base_templates/form_macros.html" import render_submit_field %}

{{ title }}

{{ description }}

<form action="" method="POST" role="form" class="form">
  {{ form.hidden_tag() }}
  {{ render_submit_field(form.reconfigure, class="btn " + config['BUTTON_STYLE'] + "primary " + config['BUTTON_CLASS']) }}
{%- if allow_disable %}
  {{ render_submit_field(form.disable, class="btn " + config['BUTTON_STYLE'] + "danger " + config['BUTTON_CLASS']) }}
{%- endif %}
  {{ render_submit_field(form.cancel, class="btn " + config['BUTTON_STYLE'] + "secondary " + config['BUTTON_CLASS']) }}
</form>

{% endblock %}


text:
require 'faraday'
require 'json'

module FaradayMiddleware
  class RaiseHttpException < Faraday::Middleware
    def call(env)
      @app.call(env).on_complete do |response|
        case response[:status].to_i
        when 400
          raise QueueIt::Api::BadRequest.new(response.body, error_details(response))
        when 403
          raise QueueIt::Api::Forbidden.new(response.body, error_details(response))
        when 404
          raise QueueIt::Api::NotFound.new(response.body, error_details(response))
        when 500
          raise QueueIt::Api::InternalServerError.new(response.body, error_details(response))
        when 503
          raise QueueIt::Api::ServiceUnavailable.new(response.body, error_details(response))
        end
      end
    end

    private

    def error_response_body(code, text)
      { "ErrorCode" => code, "ErrorText" => text }
    end

    def acts_like_json?(response_body)
      !response_body.nil? && !response_body.empty? && response_body.kind_of?(String)
    end

    def parse_json(body)
      JSON.parse(body)
    rescue JSON::ParserError
      error_response_body(nil, body)
    end

    def parse_body(response_body)
      acts_like_json?(response_body) ? parse_json(response_body) : error_response_body(nil, nil)
    end

    def error_details(response)
      response_body = parse_body(response.body)
      { status: response[:status].to_i, code: response_body["ErrorCode"], text: response_body["ErrorText"] }
    end
  end
end


text:
/*
 * 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.
 */
package io.prestosql.plugin.hive.s3select;

import com.google.common.annotations.VisibleForTesting;
import io.prestosql.plugin.hive.GenericHiveRecordCursor;
import io.prestosql.plugin.hive.HiveColumnHandle;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.Writable;
import org.apache.hadoop.mapred.RecordReader;

import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import java.util.stream.Collectors;

import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Strings.isNullOrEmpty;
import static com.google.common.collect.ImmutableSet.toImmutableSet;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toList;
import static org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMNS;
import static org.apache.hadoop.hive.serde.serdeConstants.LIST_COLUMN_TYPES;
import static org.apache.hadoop.hive.serde.serdeConstants.SERIALIZATION_DDL;

class S3SelectRecordCursor<K, V extends Writable>
        extends GenericHiveRecordCursor<K, V>
{
    private static final String THRIFT_STRUCT = "struct";
    private static final String START_STRUCT = "{";
    private static final String END_STRUCT = "}";
    private static final String FIELD_SEPARATOR = ",";

    public S3SelectRecordCursor(
            Configuration configuration,
            Path path,
            RecordReader<K, V> recordReader,
            long totalBytes,
            Properties splitSchema,
            List<HiveColumnHandle> columns)
    {
        super(configuration, path, recordReader, totalBytes, updateSplitSchema(splitSchema, columns), columns);
    }

    // since s3select only returns the required column, not the whole columns
    // we need to update the split schema to include only the required columns
    // otherwise, Serde could not deserialize output from s3select to row data correctly
    @VisibleForTesting
    static Properties updateSplitSchema(Properties splitSchema, List<HiveColumnHandle> columns)
    {
        requireNonNull(splitSchema, "splitSchema is null");
        requireNonNull(columns, "columns is null");
        // clone split properties for update so as not to affect the original one
        Properties updatedSchema = new Properties();
        updatedSchema.putAll(splitSchema);
        updatedSchema.setProperty(LIST_COLUMNS, buildColumns(columns));
        updatedSchema.setProperty(LIST_COLUMN_TYPES, buildColumnTypes(columns));
        ThriftTable thriftTable = parseThriftDdl(splitSchema.getProperty(SERIALIZATION_DDL));
        updatedSchema.setProperty(SERIALIZATION_DDL,
                thriftTableToDdl(pruneThriftTable(thriftTable, columns)));
        return updatedSchema;
    }

    private static String buildColumns(List<HiveColumnHandle> columns)
    {
        if (columns == null || columns.isEmpty()) {
            return "";
        }
        return columns.stream()
                .map(HiveColumnHandle::getName)
                .collect(Collectors.joining(","));
    }

    private static String buildColumnTypes(List<HiveColumnHandle> columns)
    {
        if (columns == null || columns.isEmpty()) {
            return "";
        }
        return columns.stream()
                .map(column -> column.getHiveType().getTypeInfo().getTypeName())
                .collect(Collectors.joining(","));
    }

    /**
     * Parse Thrift description of a table schema. Examples:
     *

     *
struct article { varchar article varchar author date date_pub int quantity}

     *
struct article { varchar article, varchar author, date date_pub, int quantity }

     *
struct article { varchar article, varchar author, date date_pub, int quantity}

     *

     */
    private static ThriftTable parseThriftDdl(String ddl)
    {
        if (isNullOrEmpty(ddl)) {
            return null;
        }
        String[] parts = ddl.trim().split("\\s+");
        checkArgument(parts.length >= 5, "Invalid Thrift DDL %s", ddl);
        checkArgument(THRIFT_STRUCT.equals(parts[0]), "Thrift DDL should start with %s", THRIFT_STRUCT);
        ThriftTable thriftTable = new ThriftTable();
        thriftTable.setTableName(parts[1]);
        checkArgument(START_STRUCT.equals(parts[2]), "Invalid Thrift DDL %s", ddl);
        checkArgument(parts[parts.length - 1].endsWith(END_STRUCT), "Invalid Thrift DDL %s", ddl);
        String lastColumnNameWithEndStruct = parts[parts.length - 1];
        parts[parts.length - 1] = lastColumnNameWithEndStruct.substring(0, lastColumnNameWithEndStruct.length() - 1);
        List<ThriftField> fields = new ArrayList<>();
        for (int i = 3; i < parts.length - 1; i += 2) {
            ThriftField thriftField = new ThriftField();
            thriftField.setType(parts[i]);
            String columnNameWithFieldSeparator = parts[i + 1];
            if (columnNameWithFieldSeparator.endsWith(FIELD_SEPARATOR)) {
                parts[i + 1] = columnNameWithFieldSeparator.substring(0, columnNameWithFieldSeparator.length() - 1);
            }
            thriftField.setName(parts[i + 1]);
            fields.add(thriftField);
        }
        thriftTable.setFields(fields);

        return thriftTable;
    }

    private static ThriftTable pruneThriftTable(ThriftTable thriftTable, List<HiveColumnHandle> columns)
    {
        if (thriftTable == null) {
            return null;
        }
        List<ThriftField> fields = thriftTable.getFields();
        if (fields == null || fields.isEmpty()) {
            return thriftTable;
        }
        Set<String> columnNames = columns.stream()
                .map(HiveColumnHandle::getName)
                .collect(toImmutableSet());
        List<ThriftField> filteredFields = fields.stream()
                .filter(field -> columnNames.contains(field.getName()))
                .collect(toList());
        thriftTable.setFields(filteredFields);

        return thriftTable;
    }

    private static String thriftTableToDdl(ThriftTable thriftTable)
    {
        if (thriftTable == null) {
            return "";
        }
        List<ThriftField> fields = thriftTable.getFields();
        if (fields == null || fields.isEmpty()) {
            return "";
        }
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(THRIFT_STRUCT)
                .append(" ")
                .append(thriftTable.getTableName())
                .append(" ")
                .append(START_STRUCT);
        stringBuilder.append(fields.stream()
                .map(field -> " " + field.getType() + " " + field.getName())
                .collect(Collectors.joining(",")));
        stringBuilder.append(END_STRUCT);

        return stringBuilder.toString();
    }

    private static class ThriftField
    {
        private String type;
        private String name;

        private String getType()
        {
            return type;
        }

        private void setType(String type)
        {
            checkArgument(!isNullOrEmpty(type), "type is null or empty string");
            this.type = type;
        }

        private String getName()
        {
            return name;
        }

        private void setName(String name)
        {
            requireNonNull(name, "name is null");
            this.name = name;
        }
    }

    private static class ThriftTable
    {
        private String tableName;
        private List<ThriftField> fields;

        private String getTableName()
        {
            return tableName;
        }

        private void setTableName(String tableName)
        {
            checkArgument(!isNullOrEmpty(tableName), "tableName is null or empty string");
            this.tableName = tableName;
        }

        private List<ThriftField> getFields()
        {
            return fields;
        }

        private void setFields(List<ThriftField> fields)
        {
            requireNonNull(fields, "fields is null");
            this.fields = fields;
        }
    }
}


text:
'use strict';

let expect = require('chai').expect;
let Receipt  = require('../lib/Receipt');

describe('Receipt', () => {
  beforeEach(() => {
    this.stubId = '1234567890';
    this.stubResult = {
      'acknowledged':      true,
      'acknowledged_at':   1234,
      'acknowledged_by':   '1234567890',
      'last_delivered_at': 1234,
      'expired':           true,
      'expires_at':        12345678,
      'called_back':       true,
      'called_back_at':    23455678
    };

    this.receipt = new Receipt(this.stubId, this.stubResult);
  });

  describe('constructor', () => {
    it('should set id', () => {
      expect(this.receipt).to.have.property('id');
    });

    it('should set properties', () => {
      expect(this.receipt).to.have.property('properties');
    });

    it('should convert properties to camelCase', () => {
      expect(this.receipt.properties)
        .to.have.property('calledBackAt');

      expect(this.receipt.properties.calledBackAt)
        .to.equal(this.stubResult.called_back_at);
    });
  });

  describe('get id', () => {
    it('should equal initial value', () => {
      expect(this.receipt.id)
        .to.equal(this.stubId);
    });
  });

  describe('get isAcknowledged', () => {
    it('should equal initial value', () => {
      expect(this.receipt.isAcknowledged)
        .to.equal(this.stubResult.acknowledged);
    });
  });

  describe('set acknowledged', () => {
    it('should set acknowledged', () => {
      let isAcknowledged        = false;
      this.receipt.acknowledged = isAcknowledged;

      expect(this.receipt.isAcknowledged).to.equal(isAcknowledged);
    });
  });

  describe('get/set acknowledgedAt', () => {
    it('should set acknowledgedAt', () => {
      let acknowledgedAt          = 123456;
      this.receipt.acknowledgedAt = acknowledgedAt;

      expect(this.receipt.acknowledgedAt).to.equal(acknowledgedAt);
    });
  });

  describe('get/set acknowledgedBy', () => {
    it('should set acknowledgedBy', () => {
      let acknowledgedBy          = '67890';
      this.receipt.acknowledgedBy = acknowledgedBy;

      expect(this.receipt.acknowledgedBy).to.equal(acknowledgedBy);
    });
  });

  describe('get/set lastDeliveredAt', () => {
    it('should set lastDeliveredAt', () => {
      let lastDeliveredAt          = 123456;
      this.receipt.lastDeliveredAt = lastDeliveredAt;

      expect(this.receipt.lastDeliveredAt).to.equal(lastDeliveredAt);
    });
  });

  describe('get isExpired', () => {
    it('should equal initial value', () => {
      expect(this.receipt.isExpired)
        .to.equal(this.stubResult.expired);
    });
  });

  describe('set expired', () => {
    it('should set expired', () => {
      let isExpired        = false;
      this.receipt.expired = isExpired;

      expect(this.receipt.isExpired).to.equal(isExpired);
    });
  });

  describe('get/set expiresAt', () => {
    it('should set expiresAt', () => {
      let expiresAt          = 123456;
      this.receipt.expiresAt = expiresAt;

      expect(this.receipt.expiresAt).to.equal(expiresAt);
    });
  });

  describe('get hasCalledBack', () => {
    it('should equal initial value', () => {
      expect(this.receipt.hasCalledBack)
        .to.equal(this.stubResult.called_back);
    });
  });

  describe('set calledBack', () => {
    it('should set calledBack', () => {
      let hasCalledBack       = false;
      this.receipt.calledBack = hasCalledBack;

      expect(this.receipt.hasCalledBack).to.equal(hasCalledBack);
    });
  });

  describe('get/set calledBackAt', () => {
    it('should set calledBackAt', () => {
      let calledBackAt          = 123456;
      this.receipt.calledBackAt = calledBackAt;

      expect(this.receipt.calledBackAt).to.equal(calledBackAt);
    });
  });
});


text:
#pragma once
#include <aws/route53resolver/Route53Resolver_EXPORTS.h>
#include <aws/route53resolver/model/ResolverQueryLogConfig.h>
#include <utility>

namespace Aws
{
template<typename RESULT_TYPE>
class AmazonWebServiceResult;

namespace Utils
{
namespace Json
{
  class JsonValue;
} // namespace Json
} // namespace Utils
namespace Route53Resolver
{
namespace Model
{
  class AWS_ROUTE53RESOLVER_API DeleteResolverQueryLogConfigResult
  {
  public:
    DeleteResolverQueryLogConfigResult();
    DeleteResolverQueryLogConfigResult(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);
    DeleteResolverQueryLogConfigResult& operator=(const Aws::AmazonWebServiceResult<Aws::Utils::Json::JsonValue>& result);

    /**
     *
Information about the query logging configuration that you deleted, including
     * the status of the request.

     */
    inline const ResolverQueryLogConfig& GetResolverQueryLogConfig() const{ return m_resolverQueryLogConfig; }

    /**
     *
Information about the query logging configuration that you deleted, including
     * the status of the request.

     */
    inline void SetResolverQueryLogConfig(const ResolverQueryLogConfig& value) { m_resolverQueryLogConfig = value; }

    /**
     *
Information about the query logging configuration that you deleted, including
     * the status of the request.

     */
    inline void SetResolverQueryLogConfig(ResolverQueryLogConfig&& value) { m_resolverQueryLogConfig = std::move(value); }

    /**
     *
Information about the query logging configuration that you deleted, including
     * the status of the request.

     */
    inline DeleteResolverQueryLogConfigResult& WithResolverQueryLogConfig(const ResolverQueryLogConfig& value) { SetResolverQueryLogConfig(value); return *this;}

    /**
     *
Information about the query logging configuration that you deleted, including
     * the status of the request.

     */
    inline DeleteResolverQueryLogConfigResult& WithResolverQueryLogConfig(ResolverQueryLogConfig&& value) { SetResolverQueryLogConfig(std::move(value)); return *this;}

  private:

    ResolverQueryLogConfig m_resolverQueryLogConfig;
  };

} // namespace Model
} // namespace Route53Resolver
} // namespace Aws


text:
{-# LANGUAGE CPP, TemplateHaskell #-}
-----------------------------------------------------------------------------
--
-- Module      :  Main
-- Copyright   :
-- License     :  AllRightsReserved
--
-- Maintainer  :
-- Stability   :
-- Portability :
--
-- |
--
-----------------------------------------------------------------------------

module Main (
    main
) where

import Exercise

main = do
    putStrLn (show (toPalindrome [1,2,3]))
    {- exercise 8 -}
    let tree = Tree 1 (Exercise.Just(Tree 7 Exercise.Nothing (Exercise.Just(Tree 5 Exercise.Nothing Exercise.Nothing)))) Exercise.Nothing
    putStrLn ("Tree-Height: " ++ show(treeHeight(tree)))
    {- exercise 9 -}
    putStrLn ("Distance: " ++ show(distance (0,0) (2,2)))
    {- exercise 10 -}
    --slet dir = getDirection (0,0) (2,2) (3,3)
    --putStrLn ("Distance: " ++ show(distance (0,0) (2,2)))


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string-array name="drawer_rows">
        <item>Street level crimes</item>
        <item>Street level outcomes</item>
        <item>Crimes at a location</item>
    </string-array>
</resources>


text:
package org.kaazing.gateway.service.cluster;

import java.util.Collection;
import java.util.List;
import java.util.concurrent.locks.Lock;

import org.kaazing.gateway.service.collections.CollectionsFactory;

import com.hazelcast.core.ITopic;

public interface ClusterContext {

    // initialization
    void start();

    // for gateway shutdown
    void dispose();

    // cluster participation
    MemberId getLocalMember();
    String getInstanceKey(MemberId memberId);

    String getClusterName();

    // Return a list of the memberIds of all current cluster members
    Collection<MemberId> getMemberIds();

    List<MemberId> getAccepts();
    List<MemberId> getConnects();
    ClusterConnectOptionsContext getConnectOptions();

    // cluster collections
    Lock getLock(String name);

    // event listener
    void addMembershipEventListener(MembershipEventListener eventListener);
    void removeMembershipEventListener(MembershipEventListener eventListener);

    CollectionsFactory getCollectionsFactory();

    void logClusterState();
    void logClusterStateAtInfoLevel();

    <E> ITopic<E> getTopic(String name);
}


text:
using System;

namespace Taga.DynamicServices.Client
{
    public interface IDynamicParameter
    {
        Type Type { get; }
        string Name { get; }

        object Value { get; set; }
    }
}


text:
<?php

namespace Aws\Glacier\Exception;

/**
 * Returned if the specified resource, such as a vault, upload ID, or job ID, does not exist.
 */
class ResourceNotFoundException extends GlacierException {}


text:
#include "Window.h"

#include "Logger.h"
#include "GLState.h"
#include "FrameBuffer.h"
#include "ImGuiAdapter.h"

/*static*/ const Window *Window::currentWindow;

Window::Window(int width, int height, bool fullscreen, bool vSync)
	: fullscreen{ fullscreen }
	, vsyncEnabled{ vSync }
{
	static bool firstWindow = true;
	if (firstWindow)
	{
		if (!glfwInit())
		{
			Logger::Log("Error: could not initialize glfw! Application must terminate.");
		}

		// Set window related hints
		glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
		glfwWindowHint(GLFW_VISIBLE, GL_TRUE);
		glfwWindowHint(GLFW_FLOATING, GL_FALSE);

		// Set context related hints
		glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
		glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
		glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
		glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
		glfwWindowHint(GLFW_DOUBLEBUFFER, GL_TRUE);
		glfwWindowHint(GLFW_SRGB_CAPABLE, GL_TRUE);
		glfwWindowHint(GLFW_RED_BITS, 8);
		glfwWindowHint(GLFW_GREEN_BITS, 8);
		glfwWindowHint(GLFW_BLUE_BITS, 8);
		glfwWindowHint(GLFW_ALPHA_BITS, 8);
		glfwWindowHint(GLFW_DEPTH_BITS, 16);
		glfwWindowHint(GLFW_STENCIL_BITS, 8);

		firstWindow = false;
	}

	const char *title = "Rendeer";
	if (fullscreen)
	{
		GLFWmonitor *primaryMonitor = glfwGetPrimaryMonitor();
		if (primaryMonitor != nullptr)
		{
			const GLFWvidmode *currentVideoMode = glfwGetVideoMode(primaryMonitor);
			if (currentVideoMode != nullptr)
			{
				const int width = currentVideoMode->width;
				const int height = currentVideoMode->height;

				this->glfwWindow = glfwCreateWindow(width, height, title, primaryMonitor, nullptr);
			}
			else
			{
				Logger::Log("Error: primary video mode could not be accessed for primary monitor.");
			}
		}
		else
		{
			Logger::Log("Error: primary monitor could not be accessed.");
		}
	}
	else
	{
		this->glfwWindow = glfwCreateWindow(width, height, title, nullptr, nullptr);;
	}

	MakeCurrent();

	// Store a pointer to the Window instance in the user pointer of the GLFW window handle
	glfwSetWindowUserPointer(glfwWindow, static_cast<void *>(this));

	SetVsyncEnabled(vSync);
	SetCursorHidden(false);

	glfwSetKeyCallback(glfwWindow, Window::KeyEventCallback);
	glfwSetCharModsCallback(glfwWindow, Window::CharEventCallback);
	glfwSetMouseButtonCallback(glfwWindow, Window::MouseButtonEventCallback);
	glfwSetCursorPosCallback(glfwWindow, Window::MouseMovementEventCallback);
	glfwSetScrollCallback(glfwWindow, Window::MouseScrollEventCallback);
}

Window::~Window()
{
	glfwDestroyWindow(glfwWindow);

	// Destroy GLFW context if there are no more windows
	//glfwTerminate();
}

/*static*/ const Window *Window::CurrentWindow()
{
	return currentWindow;
}

void Window::PollEvents()
{
	// Reset keyboard pressed & released keys for this frame
	memset(wasKeyPressed, false, KEYBOARD_KEY_COUNT * sizeof(bool));
	memset(wasKeyReleased, false, KEYBOARD_KEY_COUNT * sizeof(bool));

	// Reset & update mouse
	memset(wasButtonPressed, false, MOUSE_BUTTON_COUNT * sizeof(bool));
	memset(wasButtonReleased, false, MOUSE_BUTTON_COUNT * sizeof(bool));
	lastXPosition = currentXPosition;
	lastYPosition = currentYPosition;
	lastScrollOffset = currentScollOffset;

	glfwPollEvents();
}

void Window::SwapBuffers() const
{
	glfwSwapBuffers(glfwWindow);
}

bool Window::IsCloseRequested() const
{
	return (glfwWindowShouldClose(glfwWindow) != 0);
}

void Window::MakeCurrent() const
{
	currentWindow = this;
	glfwMakeContextCurrent(glfwWindow);

	// Load GL functions after the first context is ready (and made current)
	static bool firstContextCreation = true;
	if (firstContextCreation)
	{
		gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
		firstContextCreation = false;
	}
}

void Window::BindAsDrawFrameBuffer(bool setViewport) const
{
	// Bind framebuffer 0, i.e. the window for this context. To be compatible with the FrameBuffer class, make sure to set
	// the last bound draw framebuffer to this one! This function is a friend function of the FrameBuffer class for this reason.
	glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
	FrameBuffer::lastBoundDraw = 0;

	if (setViewport)
	{
		int width, height;
		GetFramebufferSize(&width, &height);
		GL::SetViewport(0, 0, width, height);
	}

	// TODO: Should draw buffers reset to COLOR0 & DEPTH?
}

void Window::BindAsReadFrameBuffer() const
{
	// Bind framebuffer 0, i.e. the window for this context. To be compatible with the FrameBuffer class, make sure to set
	// the last bound read framebuffer to this one! This function is a friend function of the FrameBuffer class for this reason.
	glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
	FrameBuffer::lastBoundRead = 0;
}

bool Window::IsFullscreen() const
{
	return fullscreen;
}

void Window::GetFramebufferSize(int *width, int *height) const
{
	glfwGetFramebufferSize(glfwWindow, width, height);
}

int Window::GetFramebufferWidth() const
{
	int width;
	GetFramebufferSize(&width, nullptr);
	return width;
}

int Window::GetFramebufferHeight() const
{
	int height;
	GetFramebufferSize(nullptr, &height);
	return height;
}

float Window::GetAspectRatio() const
{
	int width, height;
	GetFramebufferSize(&width, &height);
	float ar = static_cast<float>(width) / static_cast<float>(height);
	return ar;
}

void Window::GetWindowSize(int *width, int *height) const
{
	glfwGetWindowSize(glfwWindow, width, height);
}

bool Window::IsVsyncEnabled() const
{
	return vsyncEnabled;
}

void Window::SetVsyncEnabled(bool enabled)
{
	int interval = (enabled) ? 1 : 0;
	glfwSwapInterval(interval);
	this->vsyncEnabled = enabled;
}

bool Window::IsCursorHidden() const
{
	int cursorMode = glfwGetInputMode(glfwWindow, GLFW_CURSOR);
	return (cursorMode == GLFW_CURSOR_DISABLED);
}

void Window::SetCursorHidden(bool hidden) const
{
	int mode = (hidden) ? GLFW_CURSOR_DISABLED : GLFW_CURSOR_NORMAL;
	glfwSetInputMode(glfwWindow, GLFW_CURSOR, mode);

	// Reset these so that there won't be a sudden jump in delta position
	glfwGetCursorPos(glfwWindow, &currentXPosition, &currentYPosition);
	lastXPosition = currentXPosition;
	lastYPosition = currentYPosition;
}

void Window::Focus() const
{
	glfwFocusWindow(glfwWindow);
}

bool Window::IsFocused() const
{

	return glfwGetWindowAttrib(glfwWindow, GLFW_FOCUSED);
}

const char *Window::GetClipboardText() const
{
	return glfwGetClipboardString(glfwWindow);
}

void Window::SetClipboardText(const std::string& text) const
{
	SetClipboardText(text.c_str());
}

void Window::SetClipboardText(const char *text) const
{
	glfwSetClipboardString(glfwWindow, text);
}

bool Window::IsKeyDown(int key) const
{
	return isKeyDown[key];
}

bool Window::WasKeyPressed(int key) const
{
	return wasKeyPressed[key];
}

bool Window::WasKeyReleased(int key) const
{
	return wasKeyPressed[key];
}

/*static*/ void Window::KeyEventCallback(GLFWwindow *glfwWindow, int key, int scancode, int action, int mods)
{
	void *windowUserPtr = glfwGetWindowUserPointer(glfwWindow);
	auto window = static_cast<Window *>(windowUserPtr);

	switch (action)
	{
		case GLFW_PRESS:
			window->wasKeyPressed[key] = true;
			window->isKeyDown[key] = true;
			break;

		case GLFW_RELEASE:
			window->wasKeyReleased[key] = true;
			window->isKeyDown[key] = false;
			break;

		case GLFW_REPEAT:
		default:
			break;
	}

	// Make sure the GUI gets key info
	if (!window->IsCursorHidden())
	{
		ImGuiAdapter::KeyCallback(key, action);
	}
}

/*static*/ void Window::CharEventCallback(GLFWwindow *glfwWindow, unsigned int codepoint, int mods)
{
	void *windowUserPtr = glfwGetWindowUserPointer(glfwWindow);
	auto window = static_cast<Window *>(windowUserPtr);

	if (!window->IsCursorHidden())
	{
		ImGuiAdapter::CharCallback(codepoint);
	}
}

bool Window::IsButtonDown(int button) const
{
	return isButtonDown[button];
}

bool Window::WasButtonPressed(int button) const
{
	return wasButtonPressed[button];
}

bool Window::WasButtonReleased(int button) const
{
	return wasButtonReleased[button];
}

glm::vec2 Window::GetMousePosition() const
{
	double x, y;
	glfwGetCursorPos(glfwWindow, &x, &y);
	return glm::vec2(static_cast<float>(x), static_cast<float>(y));
}

glm::vec2 Window::GetMouseDelta() const
{
	return glm::vec2(currentXPosition - lastXPosition, currentYPosition - lastYPosition);
}

float Window::GetScrollDelta() const
{
	return static_cast<float>(currentScollOffset - lastScrollOffset);
}

/*static*/ void Window::MouseButtonEventCallback(GLFWwindow *glfwWindow, int button, int action, int mods)
{
	void *windowUserPtr = glfwGetWindowUserPointer(glfwWindow);
	auto window = static_cast<Window *>(windowUserPtr);

	switch (action)
	{
		case GLFW_PRESS:
			window->wasButtonPressed[button] = true;
			window->isButtonDown[button] = true;
			break;

		case GLFW_RELEASE:
			window->wasButtonReleased[button] = true;
			window->isButtonDown[button] = false;
			break;

		case GLFW_REPEAT:
		default:
			break;
	}
}

/*static*/ void Window::MouseMovementEventCallback(GLFWwindow *glfwWindow, double xPos, double yPos)
{
	void *windowUserPtr = glfwGetWindowUserPointer(glfwWindow);
	auto window = static_cast<Window *>(windowUserPtr);

	window->currentXPosition = xPos;
	window->currentYPosition = yPos;
}

/*static*/ void Window::MouseScrollEventCallback(GLFWwindow *glfwWindow, double xOffset, double yOffset)
{
	void *windowUserPtr = glfwGetWindowUserPointer(glfwWindow);
	auto window = static_cast<Window *>(windowUserPtr);

	// Ignore x-offset for now...
	window->currentScollOffset += yOffset;
}


text:
<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>Vakeano</title>
    <base href="/">

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/x-icon" href="favicon.ico">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>

<body>
    <vakeano-app>Loading...</vakeano-app>

<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>

<script src="http://kendo.cdn.telerik.com/2017.1.118/js/jszip.min.js"></script>
<script src="http://kendo.cdn.telerik.com/2017.1.118/js/kendo.all.min.js"></script>

</body>

</html>


text:
import React from "react";
import gql from "graphql-tag.macro";
import {useMutation} from "react-apollo";
import {useLightingControlSubscription} from "generated/graphql";

const UPDATE_LIGHTING = gql`
  mutation UpdateLighting($id: ID!, $intensity: Float!) {
    lightingSetIntensity(simulatorId: $id, intensity: $intensity)
  }
`;

const LightingIntensity = ({simulatorId, value, setValue}) => {
  const valueSet = React.useRef(false);
  const {data} = useLightingControlSubscription({variables: {simulatorId}});
  const intensity = data?.simulators?.[0].lighting.intensity;

  const [updateLighting] = useMutation(UPDATE_LIGHTING, {
    variables: {id: simulatorId, intensity: value},
  });

  // Update the parent component
  React.useEffect(() => {
    valueSet.current = true;
    setTimeout(() => {
      valueSet.current = false;
    }, 1000 / 10);
    setValue(intensity);
  }, [intensity, setValue]);

  // Send updates when the value changes.
  React.useEffect(() => {
    if (value !== intensity && valueSet.current === false) {
      updateLighting();
    }
  }, [intensity, updateLighting, value]);
  return null;
};

LightingIntensity.actionModes = ["valueAssignment"];

export default LightingIntensity;


text:
//
//  MOS68kListingDictionary.m
//  Tricky68k
//
//  Created by Daniele Cattaneo on 04/03/16.
//  Copyright © 2016 Daniele Cattaneo. All rights reserved.
//

#import "MOS68kListingDictionary.h"

NSString * const MOSListingErrorDomain = @"MOSListingErrorDomain";

@implementation MOS68kListingDictionary

- (instancetype)initWithListingFile:(NSURL *)f error:(NSError **)e {
  NSFileHandle *fh;
  NSString *l;
  const char *lp;
  NSUInteger lastLine, tmp, addr;
  NSNumber *line;
  NSMutableDictionary *l2a, *a2l;
  NSMutableArray *lastUnmatchedLines;

  self = [super init];

  fh = [NSFileHandle fileHandleForReadingFromURL:f error:e];
  if (!fh)
    return nil;

  l2a = [NSMutableDictionary dictionary];
  a2l = [NSMutableDictionary dictionary];
  lastUnmatchedLines = [NSMutableArray array];

  l = [fh readLine];
  lastLine = addr = NSNotFound;
  while ([l length] > 0) {
    lp = [l UTF8String];

    if (lp[0] == 'F') {
      /* Each source line is preceded by Fxx:yyyy where xx is a sequential
       * number that identifies the file, and yyyy is the line number. */
      if ([l length] < 8)
        goto parseFail;

      /* Get the line number. Ignore the file number (it is always 1 in our
       * case */
      if (sscanf(lp+4, "%ld", &tmp) < 1)
        goto parseFail;
      if (lastLine == NSNotFound)
        firstSeenLine = tmp;
      lastLine = tmp;
      [lastUnmatchedLines addObject:@(lastLine)];

      addr = NSNotFound;

    } else if (lp[0] == ' ') {
      /* If a source line maps to some data in the output, it is followed
       * by a data line, made of 16 spaces, followed by Sxx:yyyyyyyy where
       * xx is a section number and yyyyyyyy is the starting address of the
       * data. */
      if (lastLine == NSNotFound || [l length] < 28)
        goto parseFail;
      if (lp[15] != 'S')
        goto parseFail;

      /* A source line may be followed by more than one data line. Ignore
       * all data lines except the first. */
      if (addr == NSNotFound) {
        /* Get the address. Ignore the section number. */
        if (sscanf(lp+19, "%lX", &addr) < 1)
          goto parseFail;

        /* Map all preceding lines to this address. */
        for (line in lastUnmatchedLines)
          [l2a setObject:@(addr) forKey:line];
        [lastUnmatchedLines removeAllObjects];

        /* Map only this address to the last source line. */
        [a2l setObject:@(lastLine) forKey:@(addr)];
        lastSeenLine = lastLine;
      }
    } else
      goto parseFail;

    l = [fh readLine];
  }

  addressToLine = a2l;
  lineToAddress = l2a;

  return self;
parseFail:
  if (e)
    *e = [MOSError errorWithDomain:MOSListingErrorDomain code:0 userInfo:nil];
  return nil;
}

- (NSNumber *)addressForSourceLine:(NSUInteger)l {
  if (l < firstSeenLine)
    return [lineToAddress objectForKey:@(firstSeenLine)];
  if (l > lastSeenLine)
    return [lineToAddress objectForKey:@(lastSeenLine)];
  return [lineToAddress objectForKey:@(l)];
}

- (NSUInteger)sourceLineForAddress:(NSNumber *)n {
  return [[addressToLine objectForKey:n] integerValue];
}

@end


text:
(function(){
	'use strict'
	angular.module('socialApp').config(function ($routeProvider) {
		$routeProvider
		.when('/', {
			templateUrl: 'views/funcionarios/index.html',
			controller: 'accaoSocialCtrl',
			controllerAs:'vm',

			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		}).when('/atendimento', {
			templateUrl: 'views/funcionarios/menu.html',
			controller: 'atendimentoCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		})
		/*.when('/assembleia', {
			templateUrl: 'views/funcionarios/index.html',
			controller: 'assembleiaCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isAssembleia());
				}
			}
		})*/.when('/criar ficha de atendimento', {
			templateUrl: 'views/funcionarios/accaoSocial/atendimento.html',
			controller: 'atendimentoCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		}).
		when('/lista de atendimentos', {
			templateUrl: 'views/funcionarios/accaoSocial/listar.html',
			controller: 'listarAtendimentoCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				},

				list : function(atendimentoService){
					return atendimentoService.listar();
				}
			}
		})	.when('/credencial', {
			templateUrl: 'views/funcionarios/menu.html',
			controller: 'credencialCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		})
		.when('/criar ficha de credencial', {
			templateUrl: 'views/funcionarios/accaoSocial/credencial.html',
			controller: 'credencialCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		})	.when('/pedido de pensao', {
			templateUrl: 'views/funcionarios/menu.html',
			controller: 'pensaoCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		}).when('/criar ficha de pedido de pensao', {
			templateUrl: 'views/funcionarios/accaoSocial/pensao.html',
			controller: 'pensaoCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		})

		.when('/inquerito para casos', {
			templateUrl: 'views/funcionarios/menu.html',
			controller: 'inqueritoCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		}).when('/criar ficha de inquerito de casos', {
			templateUrl: 'views/funcionarios/inqueritos_de_casos.html',
			controller: 'inqueritoCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		})

		.when('/prova de vida', {
			templateUrl: 'views/funcionarios/menu.html',
			controller: 'provaDeVidaCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		}).when('/criar ficha de prova de vida', {
			templateUrl: 'views/funcionarios/accaoSocial/prova_de_vida.html',
			controller: 'provaDeVidaCtrl',
			controllerAs:'vm',
			resolve: {
				checkRoles: function(routeAccessService, authUser) {
					return routeAccessService.checkRoles(authUser.isSocial());
				}
			}
		})

		.otherwise({ redirectTo: '/' })

	}).run(function ($rootScope,$location,authUser,$mdDialog,sessionControl,$route,$window) {
		var routesOpenToPublic = [];

		if(sessionControl.get('type')=='funcionario' && sessionControl.get('subNivel')!=='social'  )
			routesOpenToPublic = ['/Accao Social']

		angular.forEach($route.routes, function(route, path) {
        // push route onto routesOpenToPublic if it has a truthy publicAccess value
        route.publicAccess && (routesOpenToPublic.push(path));
    });

		$rootScope.$on('$routeChangeStart', function(event, nextLoc, currentLoc) {
			var closedToPublic = (-1 === routesOpenToPublic.indexOf($location.path()));

			if(closedToPublic && !authUser.isLoggedIn() || sessionControl.get('type')!=='funcionario' ) {

				$window.location.assign('http://kingoroot');
			}

		});

	/*	var rotasPrivada = ['/assembleia'];

		$rootScope.$on('$routeChangeStart',function(){
			if(($.inArray($location.path(), rotasPrivada)!==-1) && authUser.isLoggedIn()  || sessionControl.get('subNivel')!=='social'){

			//Materialize.toast('Error 401 - Acesso nao Autorizado por favor efectue login', 4000) ;
			$window.location.assign('http://kingoroot/error403');

		}
		/*if(($.inArray($location.path(), rotasPrivada)!==-1) && !authUser.isLoggedIn() ){

			//Materialize.toast('Error 401 - Acesso nao Autorizado por favor efectue login', 4000) ;
			$window.location.assign('http://kingoroot');

		}

	});

	/*$rootScope.$on('$routeChangeStart', function(event) {
		if (!sessionControl.get('name')=='kid') {
			$location.path( "/login" );
		}
	});*/

});

})();


text:
package com.facebook.buck.util.cache.impl;

import static org.junit.Assert.assertTrue;

import com.facebook.buck.io.ArchiveMemberPath;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.io.filesystem.TestProjectFilesystems;
import com.facebook.buck.io.filesystem.impl.FakeProjectFilesystem;
import com.facebook.buck.testutil.TemporaryPaths;
import com.facebook.buck.util.cache.FileHashCacheMode;
import com.facebook.buck.util.cache.ProjectFileHashCache;
import com.facebook.buck.util.config.Config;
import com.facebook.buck.util.config.ConfigBuilder;
import com.facebook.buck.util.zip.CustomJarOutputStream;
import com.facebook.buck.util.zip.ZipOutputStreams;
import com.google.common.collect.ImmutableList;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.EnumSet;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
public class StackedFileHashCacheTest {

  private static final String SOME_FILE_INSIDE_JAR = "SomeClass.class";
  private final FileHashCacheMode fileHashCacheMode;
  @Rule public TemporaryPaths tmp = new TemporaryPaths();

  @Rule public TemporaryPaths tmp2 = new TemporaryPaths();

  @Rule public ExpectedException expectedException = ExpectedException.none();

  @Parameterized.Parameters(name = "{0}")
  public static Collection<Object[]> data() {
    return EnumSet.allOf(FileHashCacheMode.class)
        .stream()
        .map(v -> new Object[] {v})
        .collect(ImmutableList.toImmutableList());
  }

  public StackedFileHashCacheTest(FileHashCacheMode fileHashCacheMode) {
    this.fileHashCacheMode = fileHashCacheMode;
  }

  @Test
  public void usesFirstCacheAbsolutePath() throws IOException {
    ProjectFilesystem filesystem = FakeProjectFilesystem.createJavaOnlyFilesystem();

    Path path = filesystem.getPath("world.txt");
    filesystem.touch(path);

    Path fullPath = filesystem.resolve(path);
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    cache.get(fullPath);
    assertTrue(innerCache.willGet(path));
  }

  @Test
  public void usesFirstCache() throws IOException {
    ProjectFilesystem filesystem = FakeProjectFilesystem.createJavaOnlyFilesystem();

    Path path = filesystem.getPath("world.txt");
    filesystem.touch(path);

    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    cache.get(filesystem, path);
    assertTrue(innerCache.willGet(path));
  }

  @Test
  public void usesFirstCacheForArchivePathAbsolutePath() throws IOException {
    ProjectFilesystem filesystem = new FakeProjectFilesystem();

    Path path = filesystem.getPath("world.jar");
    writeJarWithHashes(filesystem, path);

    ArchiveMemberPath archiveMemberPath =
        ArchiveMemberPath.of(path, Paths.get(SOME_FILE_INSIDE_JAR));
    ArchiveMemberPath fullArchiveMemberPath =
        archiveMemberPath.withArchivePath(filesystem.resolve(archiveMemberPath.getArchivePath()));

    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    cache.get(fullArchiveMemberPath);
    assertTrue(innerCache.willGet(archiveMemberPath));
  }

  @Test
  public void usesFirstCacheForArchivePath() throws IOException {
    ProjectFilesystem filesystem = new FakeProjectFilesystem();

    Path path = filesystem.getPath("world.jar");
    writeJarWithHashes(filesystem, path);

    ArchiveMemberPath archiveMemberPath =
        ArchiveMemberPath.of(path, Paths.get(SOME_FILE_INSIDE_JAR));

    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    cache.get(filesystem, archiveMemberPath);
    assertTrue(innerCache.willGet(archiveMemberPath));
  }

  @Test
  public void usesSecondCacheAbsolutePath() throws IOException {
    Path path = Paths.get("world.txt");
    Path fullPath = tmp2.getRoot().resolve(path);

    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(
            TestProjectFilesystems.createProjectFilesystem(tmp.getRoot()), fileHashCacheMode);

    // The second project filesystem has the file.
    ProjectFilesystem filesystem2 = TestProjectFilesystems.createProjectFilesystem(tmp2.getRoot());
    ProjectFileHashCache innerCache2 =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem2, fileHashCacheMode);
    filesystem2.touch(path);

    StackedFileHashCache cache =
        new StackedFileHashCache(ImmutableList.of(innerCache, innerCache2));
    cache.get(fullPath);
    assertTrue(innerCache2.willGet(path));
  }

  @Test
  public void usesSecondCache() throws IOException {
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(
            TestProjectFilesystems.createProjectFilesystem(tmp.getRoot()), fileHashCacheMode);

    // The second project filesystem has the file.
    ProjectFilesystem filesystem2 = TestProjectFilesystems.createProjectFilesystem(tmp2.getRoot());
    Path path = filesystem2.getPath("world.txt");
    ProjectFileHashCache innerCache2 =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem2, fileHashCacheMode);
    filesystem2.touch(path);

    StackedFileHashCache cache =
        new StackedFileHashCache(ImmutableList.of(innerCache, innerCache2));
    cache.get(filesystem2, path);
    assertTrue(innerCache2.willGet(path));
  }

  @Test
  public void usesSecondCacheForArchivePathAbsolutePath() throws IOException {
    Path path = Paths.get("world.jar");
    Path fullPath = tmp2.getRoot().resolve(path);

    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(
            TestProjectFilesystems.createProjectFilesystem(tmp.getRoot()), fileHashCacheMode);

    // The second project filesystem has the file.
    ProjectFilesystem filesystem2 = TestProjectFilesystems.createProjectFilesystem(tmp2.getRoot());
    ProjectFileHashCache innerCache2 =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem2, fileHashCacheMode);
    writeJarWithHashes(filesystem2, fullPath);

    ArchiveMemberPath archiveMemberPath =
        ArchiveMemberPath.of(path, Paths.get(SOME_FILE_INSIDE_JAR));
    ArchiveMemberPath fullArchiveMemberPath =
        archiveMemberPath.withArchivePath(filesystem2.resolve(archiveMemberPath.getArchivePath()));
    StackedFileHashCache cache =
        new StackedFileHashCache(ImmutableList.of(innerCache, innerCache2));
    cache.get(fullArchiveMemberPath);
    assertTrue(innerCache2.willGet(archiveMemberPath));
  }

  @Test
  public void usesSecondCacheForArchivePath() throws IOException {
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(
            TestProjectFilesystems.createProjectFilesystem(tmp.getRoot()), fileHashCacheMode);

    // The second project filesystem has the file.
    ProjectFilesystem filesystem2 = TestProjectFilesystems.createProjectFilesystem(tmp2.getRoot());
    Path path = filesystem2.getPath("world.jar");
    ProjectFileHashCache innerCache2 =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem2, fileHashCacheMode);
    writeJarWithHashes(filesystem2, path);

    ArchiveMemberPath archiveMemberPath =
        ArchiveMemberPath.of(path, Paths.get(SOME_FILE_INSIDE_JAR));
    StackedFileHashCache cache =
        new StackedFileHashCache(ImmutableList.of(innerCache, innerCache2));
    cache.get(filesystem2, archiveMemberPath);
    assertTrue(innerCache2.willGet(archiveMemberPath));
  }

  @Test
  public void skipsFirstCacheAbsolutePath() throws IOException {
    Path fullPath = Paths.get("some/path");
    ProjectFilesystem filesystem = new FakeProjectFilesystem(tmp.getRoot());
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    expectedException.expect(NoSuchFileException.class);
    cache.get(filesystem.resolve(fullPath));
  }

  @Test
  public void skipsFirstCache() throws IOException {
    ProjectFilesystem filesystem = new FakeProjectFilesystem(tmp.getRoot());
    Path path = filesystem.getPath("some/path");
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    expectedException.expect(NoSuchFileException.class);
    cache.get(filesystem, path);
  }

  @Test
  public void skipsFirstCacheForArchiveMemberPathAbsolutePath() throws IOException {
    Assume.assumeFalse(fileHashCacheMode == FileHashCacheMode.PARALLEL_COMPARISON);
    Assume.assumeFalse(fileHashCacheMode == FileHashCacheMode.LIMITED_PREFIX_TREE_PARALLEL);

    Path fullPath = Paths.get("world.jar");
    ProjectFilesystem filesystem = TestProjectFilesystems.createProjectFilesystem(tmp.getRoot());
    writeJarWithHashes(filesystem, filesystem.resolve(fullPath));
    ArchiveMemberPath archiveMemberPath =
        ArchiveMemberPath.of(filesystem.resolve(fullPath), Paths.get("Nonexistent.class"));
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    expectedException.expect(NoSuchFileException.class);
    cache.get(archiveMemberPath);
  }

  @Test
  public void skipsFirstCacheForArchiveMemberPath() throws IOException {
    Assume.assumeFalse(fileHashCacheMode == FileHashCacheMode.PARALLEL_COMPARISON);
    Assume.assumeFalse(fileHashCacheMode == FileHashCacheMode.LIMITED_PREFIX_TREE_PARALLEL);

    ProjectFilesystem filesystem = TestProjectFilesystems.createProjectFilesystem(tmp.getRoot());
    Path path = filesystem.getPath("world.jar");
    writeJarWithHashes(filesystem, path);
    ArchiveMemberPath archiveMemberPath =
        ArchiveMemberPath.of(path, filesystem.getPath("Nonexistent.class"));
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    expectedException.expect(NoSuchFileException.class);
    cache.get(filesystem, archiveMemberPath);
  }

  @Test
  public void skipsFirstCacheBecauseIgnoredAbsolutePath() throws IOException {
    Config config = ConfigBuilder.createFromText("[project]", "ignore = world.txt");
    Path path = Paths.get("world.txt");
    Path fullPath = tmp.getRoot().resolve(path);
    ProjectFilesystem filesystem =
        TestProjectFilesystems.createProjectFilesystem(tmp.getRoot(), config);
    filesystem.touch(path);
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    expectedException.expect(NoSuchFileException.class);
    cache.get(filesystem.resolve(fullPath));
  }

  @Test
  public void skipsFirstCacheBecauseIgnored() throws IOException {
    Config config = ConfigBuilder.createFromText("[project]", "ignore = world.txt");
    ProjectFilesystem filesystem =
        TestProjectFilesystems.createProjectFilesystem(tmp.getRoot(), config);
    Path path = filesystem.getPath("world.txt");
    filesystem.touch(path);
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    expectedException.expect(NoSuchFileException.class);
    cache.get(filesystem, path);
  }

  @Test
  public void skipsFirstCacheBecauseIgnoredForArchiveMemberPathAbsolutePath() throws IOException {
    Config config = ConfigBuilder.createFromText("[project]", "ignore = world.jar");
    Path fullPath = Paths.get("world.jar");
    ProjectFilesystem filesystem =
        TestProjectFilesystems.createProjectFilesystem(tmp.getRoot(), config);
    writeJarWithHashes(filesystem, filesystem.resolve(fullPath));
    ArchiveMemberPath archiveMemberPath =
        ArchiveMemberPath.of(filesystem.resolve(fullPath), Paths.get("Nonexistent.class"));
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    expectedException.expect(NoSuchFileException.class);
    cache.get(archiveMemberPath);
  }

  @Test
  public void skipsFirstCacheBecauseIgnoredForArchiveMemberPath() throws IOException {
    Config config = ConfigBuilder.createFromText("[project]", "ignore = world.jar");
    ProjectFilesystem filesystem =
        TestProjectFilesystems.createProjectFilesystem(tmp.getRoot(), config);
    Path path = filesystem.getPath("world.jar");
    writeJarWithHashes(filesystem, path);
    ArchiveMemberPath archiveMemberPath =
        ArchiveMemberPath.of(path, filesystem.getPath("Nonexistent.class"));
    ProjectFileHashCache innerCache =
        DefaultFileHashCache.createDefaultFileHashCache(filesystem, fileHashCacheMode);
    StackedFileHashCache cache = new StackedFileHashCache(ImmutableList.of(innerCache));
    expectedException.expect(NoSuchFileException.class);
    cache.get(filesystem, archiveMemberPath);
  }

  private void writeJarWithHashes(ProjectFilesystem filesystem, Path path) throws IOException {
    try (CustomJarOutputStream jar =
        ZipOutputStreams.newJarOutputStream(filesystem.newFileOutputStream(path))) {
      jar.setEntryHashingEnabled(true);
      jar.writeEntry(
          SOME_FILE_INSIDE_JAR,
          new ByteArrayInputStream("fake contents".getBytes(StandardCharsets.UTF_8)));
    }
  }
}


text: Blog Platform built with Meteor-React


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

  	<meta property="og:title" content=" Interface ·  ashtech" />
  	<meta property="og:site_name" content="ashtech" />
  	<meta property="og:url" content="https://ashyadav.github.com/ashtech/tags/interface/" />

    <meta property="og:type" content="website" />

  <title>
     Interface ·  ashtech
  </title>

    <meta name="description" content="Tech stuff you need to know" />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="https://ashyadav.github.com/ashtech/images/favicon.ico">
	  <link rel="apple-touch-icon" href="https://ashyadav.github.com/ashtech/images/apple-touch-icon.png" />

    <link rel="stylesheet" type="text/css" href="https://ashyadav.github.com/ashtech/css/screen.css" />
    <link rel="stylesheet" type="text/css" href="https://ashyadav.github.com/ashtech/css/nav.css" />
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:300,700,700italic,300italic|Open+Sans:700,400|Inconsolata" />

          <link href="https://ashyadav.github.com/ashtech/index.xml" rel="alternate" type="application/rss+xml" title="ashtech" />

        <link href="https://ashyadav.github.com/ashtech/tags/interface/index.xml" rel="alternate" type="application/rss+xml" title="Interface · ashtech" />

    <meta name="generator" content="Hugo 0.15" />

    <link rel="canonical" href="https://ashyadav.github.com/ashtech/tags/interface/" />

Menu

        Close

            	Blog

            	About me

            	AshTop5Tech #4 - Driverless Trucks

            	AshTop5Tech #5 Deepmind & Go

    Subscribe

          ☰Menu

Interface

	Page 1 of 1

AshTop5Tech #5 Deepmind & Go

Go - Deepmind, Skinterface, Email Habits, Doodling, HoverBike

 »

            Ash Yadav

        on

                #Technology,

                #go,

                #Deepmind,

                #applewatch,

                #interface,

                #email,

                #doodling,

                #hoverbike,

        <time class="post-date" datetime="2016-05-08T23:40:30-04:00">
            8 May 2016
        </time>

	Page 1 of 1

ashtech All rights reserved - 2016

Proudly generated by HUGO, with Casper theme


text:
<?php

namespace SMW\Tests\MediaWiki\Renderer;

use SMW\Tests\Utils\UtilityFactory;
use SMW\MediaWiki\Renderer\HtmlFormRenderer;

/**
 * @covers \SMW\MediaWiki\Renderer\HtmlFormRenderer
 *
 * @group semantic-mediawiki
 *
 * @license GNU GPL v2+
 * @since 2.1
 *
 * @author mwjames
 */
class HtmlFormRendererTest extends \PHPUnit_Framework_TestCase {

	private $stringValidator;

	protected function setUp() {
		parent::setUp();

		$this->stringValidator = UtilityFactory::getInstance()->newValidatorFactory()->newStringValidator();
	}

	public function testCanConstruct() {

		$title = $this->getMockBuilder( '\Title' )
			->disableOriginalConstructor()
			->getMock();

		$messageBuilder = $this->getMockBuilder( '\SMW\MediaWiki\MessageBuilder' )
			->disableOriginalConstructor()
			->getMock();

		$this->assertInstanceOf(
			'\SMW\MediaWiki\Renderer\HtmlFormRenderer',
			new HtmlFormRenderer( $title, $messageBuilder )
		);
	}

	public function testGetMessageBuilder() {

		$title = $this->getMockBuilder( '\Title' )
			->disableOriginalConstructor()
			->getMock();

		$messageBuilder = $this->getMockBuilder( '\SMW\MediaWiki\MessageBuilder' )
			->disableOriginalConstructor()
			->getMock();

		$instance = new HtmlFormRenderer( $title, $messageBuilder );

		$this->assertSame(
			$messageBuilder,
			$instance->getMessageBuilder()
		);
	}

	public function testGetForm() {

		$title = $this->getMockBuilder( '\Title' )
			->disableOriginalConstructor()
			->getMock();

		$message = $this->getMockBuilder( '\Message' )
			->disableOriginalConstructor()
			->getMock();

		$message->expects( $this->any() )
			->method( 'title' )
			->will( $this->returnSelf() );

		$message->expects( $this->any() )
			->method( 'numParams' )
			->will( $this->returnSelf() );

		$message->expects( $this->any() )
			->method( 'rawParams' )
			->will( $this->returnSelf() );

		$message->expects( $this->any() )
			->method( 'text' )
			->will( $this->returnValue( 'SomeText' ) );

		$messageBuilder = $this->getMockBuilder( '\SMW\MediaWiki\MessageBuilder' )
			->disableOriginalConstructor()
			->getMock();

		$messageBuilder->expects( $this->any() )
			->method( 'getMessage' )
			->will( $this->returnValue( $message ) );

		$instance = new HtmlFormRenderer( $title, $messageBuilder );

		$instance
			->setName( 'SomeForm' )
			->withFieldset()
			->addParagraph( 'SomeDescription' )
			->addQueryParameter( 'SomeQueryParameter', 'SomeQueryValue' )
			->addPaging( 10, 0, 5 )
			->addHorizontalRule()
			->addInputField( 'SomeInputFieldLabel', 'foo', 'Foo', 'FooId', 333 )
			->addLineBreak()
			->addNonBreakingSpace()
			->addInputField( 'AnotherInputFieldLabel', 'AnotherInputFieldName', 'AnotherInputFieldValue' )
			->addSubmitButton( 'FindFoo' );

		$expected = array(
			'form id="smw-form-SomeForm" name="SomeForm" method="get"',
			'
SomeDescription
',
			'input name="foo" size="333" value="Foo" id="FooId"',
			'input name="AnotherInputFieldName" size="20" value="AnotherInputFieldValue" id="AnotherInputFieldName"',
			'input type="submit" value="FindFoo"',
			'
 '
		);

		$this->stringValidator->assertThatStringContains(
			$expected,
			$instance->getForm()
		);
	}

	public function testOptionsSelecList() {

		$title = $this->getMockBuilder( '\Title' )
			->disableOriginalConstructor()
			->getMock();

		$message = $this->getMockBuilder( '\Message' )
			->disableOriginalConstructor()
			->getMock();

		$message->expects( $this->any() )
			->method( 'text' )
			->will( $this->returnValue( 'SomeText' ) );

		$messageBuilder = $this->getMockBuilder( '\SMW\MediaWiki\MessageBuilder' )
			->disableOriginalConstructor()
			->getMock();

		$messageBuilder->expects( $this->any() )
			->method( 'getMessage' )
			->will( $this->returnValue( $message ) );

		$instance = new HtmlFormRenderer( $title, $messageBuilder );

		$instance
			->setName( 'optionsSelecListForm' )
			->withFieldset()
			->setMethod( 'isNeithergetNorPostMethodUseDefaultInstead' )
			->addOptionSelectList(
				'optionlistLabel',
				'optionlistName',
				'b',
				array( 'f' => 'foo', 'b' =>'bar' ),
				'optionslistId');

		$expected = array(
			'form id="smw-form-optionsSelecListForm" name="optionsSelecListForm" method="get"',
			'<fieldset id="smw-form-fieldset-optionsSelecListForm">',
			'optionlistLabel ',
			'<select name="optionlistName" id="optionslistId" class="smw-form-select">',
			'<option value="b" selected="">bar</option>',
			'<option value="f">foo</option>'
		);

		$this->stringValidator->assertThatStringContains(
			$expected,
			$instance->getForm()
		);
	}

	public function testCheckbox() {

		$title = $this->getMockBuilder( '\Title' )
			->disableOriginalConstructor()
			->getMock();

		$message = $this->getMockBuilder( '\Message' )
			->disableOriginalConstructor()
			->getMock();

		$message->expects( $this->any() )
			->method( 'text' )
			->will( $this->returnValue( 'SomeText' ) );

		$messageBuilder = $this->getMockBuilder( '\SMW\MediaWiki\MessageBuilder' )
			->disableOriginalConstructor()
			->getMock();

		$messageBuilder->expects( $this->any() )
			->method( 'getMessage' )
			->will( $this->returnValue( $message ) );

		$instance = new HtmlFormRenderer( $title, $messageBuilder );

		$instance
			->setName( 'checkboxForm' )
			->addHeader( 'invalidLevel', 'someHeader' )
			->withFieldset()
			->setMethod( 'post' )
			->setActionUrl( 'http://example.org/foo' )
			->addCheckbox(
				'checkboxLabel',
				'checkboxName',
				true,
				'checkBoxId' );

		$expected = array(
			'<form id="smw-form-checkboxForm" name="checkboxForm" method="post" action="http://example.org/foo">',
			'
someHeader
',
			'<fieldset id="smw-form-fieldset-checkboxForm">',
			'<input name="checkboxName" type="checkbox" value="1" checked="checked" id="checkboxName" class="smw-form-checkbox" />',
			'checkboxLabel'
		);

		$this->stringValidator->assertThatStringContains(
			$expected,
			$instance->getForm()
		);
	}

}


text:
package com.universeCraft.main;

import com.universeCraft.blocks.ModBlocks;
import com.universeCraft.items.ModItems;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;

public class UniverseCraftTab extends CreativeTabs
{
	public UniverseCraftTab(int par1, String par2Str)
	{
		super(par1, par2Str);
	}

	@Override
	@SideOnly(Side.CLIENT)
	public Item getTabIconItem()
	{
		return Item.getItemFromBlock(ModBlocks.particleAccelerator);
	}
}


text:
namespace absl {

namespace {
void WritePadding(std::ostream& o, size_t pad) {
  char fill_buf[32];
  memset(fill_buf, o.fill(), sizeof(fill_buf));
  while (pad) {
    size_t n = std::min(pad, sizeof(fill_buf));
    o.write(fill_buf, n);
    pad -= n;
  }
}

class LookupTable {
 public:
  // For each character in wanted, sets the index corresponding
  // to the ASCII code of that character. This is used by
  // the find_.*_of methods below to tell whether or not a character is in
  // the lookup table in constant time.
  explicit LookupTable(string_view wanted) {
    for (char c : wanted) {
      table_[Index(c)] = true;
    }
  }
  bool operator[](char c) const { return table_[Index(c)]; }

 private:
  static unsigned char Index(char c) { return static_cast<unsigned char>(c); }
  bool table_[UCHAR_MAX + 1] = {};
};

}  // namespace

std::ostream& operator<<(std::ostream& o, string_view piece) {
  std::ostream::sentry sentry(o);
  if (sentry) {
    size_t lpad = 0;
    size_t rpad = 0;
    if (static_cast<size_t>(o.width()) > piece.size()) {
      size_t pad = o.width() - piece.size();
      if ((o.flags() & o.adjustfield) == o.left) {
        rpad = pad;
      } else {
        lpad = pad;
      }
    }
    if (lpad) WritePadding(o, lpad);
    o.write(piece.data(), piece.size());
    if (rpad) WritePadding(o, rpad);
    o.width(0);
  }
  return o;
}

string_view::size_type string_view::copy(char* buf, size_type n,
                                         size_type pos) const {
  size_type ulen = length_;
  assert(pos <= ulen);
  size_type rlen = std::min(ulen - pos, n);
  if (rlen > 0) {
    const char* start = ptr_ + pos;
    std::copy(start, start + rlen, buf);
  }
  return rlen;
}

string_view::size_type string_view::find(string_view s, size_type pos) const
    noexcept {
  if (empty() || pos > length_) {
    if (empty() && pos == 0 && s.empty()) return 0;
    return npos;
  }
  const char* result =
      strings_internal::memmatch(ptr_ + pos, length_ - pos, s.ptr_, s.length_);
  return result ? result - ptr_ : npos;
}

string_view::size_type string_view::find(char c, size_type pos) const noexcept {
  if (empty() || pos >= length_) {
    return npos;
  }
  const char* result =
      static_cast<const char*>(memchr(ptr_ + pos, c, length_ - pos));
  return result != nullptr ? result - ptr_ : npos;
}

string_view::size_type string_view::rfind(string_view s, size_type pos) const
    noexcept {
  if (length_ < s.length_) return npos;
  if (s.empty()) return std::min(length_, pos);
  const char* last = ptr_ + std::min(length_ - s.length_, pos) + s.length_;
  const char* result = std::find_end(ptr_, last, s.ptr_, s.ptr_ + s.length_);
  return result != last ? result - ptr_ : npos;
}

// Search range is [0..pos] inclusive.  If pos == npos, search everything.
string_view::size_type string_view::rfind(char c, size_type pos) const
    noexcept {
  // Note: memrchr() is not available on Windows.
  if (empty()) return npos;
  for (size_type i = std::min(pos, length_ - 1);; --i) {
    if (ptr_[i] == c) {
      return i;
    }
    if (i == 0) break;
  }
  return npos;
}

string_view::size_type string_view::find_first_of(string_view s,
                                                  size_type pos) const
    noexcept {
  if (empty() || s.empty()) {
    return npos;
  }
  // Avoid the cost of LookupTable() for a single-character search.
  if (s.length_ == 1) return find_first_of(s.ptr_[0], pos);
  LookupTable tbl(s);
  for (size_type i = pos; i < length_; ++i) {
    if (tbl[ptr_[i]]) {
      return i;
    }
  }
  return npos;
}

string_view::size_type string_view::find_first_not_of(string_view s,
                                                      size_type pos) const
    noexcept {
  if (empty()) return npos;
  // Avoid the cost of LookupTable() for a single-character search.
  if (s.length_ == 1) return find_first_not_of(s.ptr_[0], pos);
  LookupTable tbl(s);
  for (size_type i = pos; i < length_; ++i) {
    if (!tbl[ptr_[i]]) {
      return i;
    }
  }
  return npos;
}

string_view::size_type string_view::find_first_not_of(char c,
                                                      size_type pos) const
    noexcept {
  if (empty()) return npos;
  for (; pos < length_; ++pos) {
    if (ptr_[pos] != c) {
      return pos;
    }
  }
  return npos;
}

string_view::size_type string_view::find_last_of(string_view s,
                                                 size_type pos) const noexcept {
  if (empty() || s.empty()) return npos;
  // Avoid the cost of LookupTable() for a single-character search.
  if (s.length_ == 1) return find_last_of(s.ptr_[0], pos);
  LookupTable tbl(s);
  for (size_type i = std::min(pos, length_ - 1);; --i) {
    if (tbl[ptr_[i]]) {
      return i;
    }
    if (i == 0) break;
  }
  return npos;
}

string_view::size_type string_view::find_last_not_of(string_view s,
                                                     size_type pos) const
    noexcept {
  if (empty()) return npos;
  size_type i = std::min(pos, length_ - 1);
  if (s.empty()) return i;
  // Avoid the cost of LookupTable() for a single-character search.
  if (s.length_ == 1) return find_last_not_of(s.ptr_[0], pos);
  LookupTable tbl(s);
  for (;; --i) {
    if (!tbl[ptr_[i]]) {
      return i;
    }
    if (i == 0) break;
  }
  return npos;
}

string_view::size_type string_view::find_last_not_of(char c,
                                                     size_type pos) const
    noexcept {
  if (empty()) return npos;
  size_type i = std::min(pos, length_ - 1);
  for (;; --i) {
    if (ptr_[i] != c) {
      return i;
    }
    if (i == 0) break;
  }
  return npos;
}

// MSVC has non-standard behavior that implicitly creates definitions for static
// const members. These implicit definitions conflict with explicit out-of-class
// member definitions that are required by the C++ standard, resulting in
// LNK1169 "multiply defined" errors at link time. __declspec(selectany) asks
// MSVC to choose only one definition for the symbol it decorates. See details
// at https://msdn.microsoft.com/en-us/library/34h23df8(v=vs.100).aspx
#ifdef _MSC_VER
#define ABSL_STRING_VIEW_SELECTANY __declspec(selectany)
#else
#define ABSL_STRING_VIEW_SELECTANY
#endif

ABSL_STRING_VIEW_SELECTANY
constexpr string_view::size_type string_view::npos;
ABSL_STRING_VIEW_SELECTANY
constexpr string_view::size_type string_view::kMaxSize;

}  // namespace absl

#endif  // ABSL_HAVE_STD_STRING_VIEW


text:
package iaik.privlog;

import java.net.URL;

import org.junit.Before;

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.core.util.Loader;

public class PrivacyAwareAppenderJoranTest extends PrivacyAwareAppenderTest {

	@Override
	@Before
	public void before() {
		lc = new LoggerContext();
		JoranConfigurator jc = new JoranConfigurator();
		jc.setContext(lc);
		try {
			URL configFile = Loader.getResourceBySelfClassLoader("iaik/privlog/configAppender.xml");
			jc.doConfigure(configFile);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

		root = lc.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
		root.addAppender(getConsoleAppender(lc, rootMockOutputStream));

		logger = lc.getLogger(getClass());
		PrivacyAwareAppender appender = (PrivacyAwareAppender) logger.getAppender("privAppender");
		appender.addAppender(getConsoleAppender(lc, loggerMockOutputStream));
	}

}