text:
layout: docs
title: Colors
group: utilities
---

Convey meaning through color with a handful of emphasis utility classes. These may also be applied to links and will darken on hover just like our default link styles.

{% example html %}

Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.

Nullam id dolor id nibh ultricies vehicula ut id elit.

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

Maecenas sed diam eget risus varius blandit sit amet non magna.

Etiam porta sem malesuada magna mollis euismod.

Donec ullamcorper nulla non metus auctor fringilla.

Eget risus varius blandit sit ultricies vehicula amet non magna.

Etiam porta sem malesuada ultricies vehicula.

{% endexample %}

Contextual text classes also work well on anchors with the provided hover and focus states. **Note that the `.text-white` class has no link styling.**

{% example html %}
Muted link
Primary link
Success link
Info link
Warning link
Danger link
{% endexample %}

Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. Background utilities **do not set `color`**, so in some cases you'll want to use `.text-*` utilities.

{% example html %}

Nullam id dolor id nibh ultricies vehicula ut id elit.

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

Maecenas sed diam eget risus varius blandit sit amet non magna.

Etiam porta sem malesuada magna mollis euismod.

Donec ullamcorper nulla non metus auctor fringilla.

Cras mattis consectetur purus sit amet fermentum.

Cras mattis consectetur purus sit amet fermentum.

{% endexample %}

{% callout info %}
#### Dealing with specificity

Sometimes contextual classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a `<div>` with the class.
{% endcallout %}

{% capture callout-include %}{% include callout-warning-color-assistive-technologies.md %}{% endcapture %}
{{ callout-include | markdownify }}

redpajama_set_name: RedPajamaGithub


text:
const SET_TITLE = 'SET_TITLE';

const initialState = {
};

export default function appBar(state = initialState, action = {}) {
  switch (action.type) {
    case SET_TITLE:
      return {
        ...state,
        title: action.title
      };
    default:
      return state;
  }
}

export function setTitle(title) {
  return { type: SET_TITLE, title };
}


text:
;(function(){
	var tpl = QNML.TPL.VOICE;
	qnml.addLanguage({
		nodeName:"qnml:voice",
		parse:function(match,attr,text,option){
			var div = document.createElement("div");
			div.innerHTML = "<span "+attr+">";
			var el = div.getElementsByTagName('span')[0];

			var src = el.getAttribute('src');
			var filesize = el.getAttribute("filesize");
			var seconds = el.getAttribute("seconds");
			var m = Math.floor(seconds / 60);
            var s = seconds % 60;
            seconds = (m>9?m:"0"+m).toString()+":"+(s>9?s:"0"+s).toString();
            filesize = (parseFloat(filesize)/1000).toFixed(2)+"KB";

			return qnml.lib.tmpl(tpl,{src:src,filesize:filesize,seconds:seconds});
		},
		style:QNML.STYLE.VOICE
	});
})();


text:
/* @test
   @summary Test ModelByteBufferWavetable open method */

import java.io.ByteArrayOutputStream;

import javax.sound.sampled.*;

import com.sun.media.sound.*;

public class Open {

    static float[] testarray;
    static byte[] test_byte_array;
    static byte[] test_byte_array_8ext;
    static AudioFormat format = new AudioFormat(44100, 16, 1, true, false);
    static AudioFormat format24 = new AudioFormat(44100, 24, 1, true, false);
    static ModelByteBuffer buffer;
    static ModelByteBuffer buffer_wave;
    static ModelByteBuffer buffer8;
    static ModelByteBuffer buffer16_8;
    static ModelByteBuffer buffer24;

    static void setUp() throws Exception {
        testarray = new float[1024];
        for (int i = 0; i < 1024; i++) {
            double ii = i / 1024.0;
            ii = ii * ii;
            testarray[i] = (float)Math.sin(10*ii*2*Math.PI);
            testarray[i] += (float)Math.sin(1.731 + 2*ii*2*Math.PI);
            testarray[i] += (float)Math.sin(0.231 + 6.3*ii*2*Math.PI);
            testarray[i] *= 0.3;
        }
        test_byte_array = new byte[testarray.length*2];
        AudioFloatConverter.getConverter(format).toByteArray(testarray, test_byte_array);
        buffer = new ModelByteBuffer(test_byte_array);

        byte[] test_byte_array2 = new byte[testarray.length*3];
        buffer24 = new ModelByteBuffer(test_byte_array2);
        test_byte_array_8ext = new byte[testarray.length];
        byte[] test_byte_array_8_16 = new byte[testarray.length*2];
        AudioFloatConverter.getConverter(format24).toByteArray(testarray, test_byte_array2);
        int ix = 0;
        int x = 0;
        for (int i = 0; i < test_byte_array_8ext.length; i++) {
            test_byte_array_8ext[i] = test_byte_array2[ix++];
            test_byte_array_8_16[x++] = test_byte_array2[ix++];
            test_byte_array_8_16[x++] = test_byte_array2[ix++];
        }
        buffer16_8 = new ModelByteBuffer(test_byte_array_8_16);
        buffer8 = new ModelByteBuffer(test_byte_array_8ext);

        AudioInputStream ais = new AudioInputStream(buffer.getInputStream(), format, testarray.length);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        AudioSystem.write(ais, AudioFileFormat.Type.WAVE, baos);
        buffer_wave = new ModelByteBuffer(baos.toByteArray());
    }

    public static void main(String[] args) throws Exception {

        setUp();

        ModelByteBufferWavetable wavetable = new ModelByteBufferWavetable(buffer,format);
        if(wavetable.open(44100) != null)
            throw new RuntimeException("wavetable.open(44100) doesn't return null!");
    }

}


text:
package org.deeplearning4j.nn.conf.serde;

import org.deeplearning4j.nn.conf.ComputationGraphConfiguration;
import org.deeplearning4j.nn.conf.NeuralNetConfiguration;
import org.deeplearning4j.nn.conf.dropout.Dropout;
import org.deeplearning4j.nn.conf.graph.GraphVertex;
import org.deeplearning4j.nn.conf.graph.LayerVertex;
import org.deeplearning4j.nn.conf.layers.BaseLayer;
import org.deeplearning4j.nn.conf.layers.Layer;
import org.deeplearning4j.nn.conf.weightnoise.DropConnect;
import org.nd4j.shade.jackson.core.JsonLocation;
import org.nd4j.shade.jackson.core.JsonParser;
import org.nd4j.shade.jackson.databind.DeserializationContext;
import org.nd4j.shade.jackson.databind.JsonDeserializer;
import org.nd4j.shade.jackson.databind.JsonNode;
import org.nd4j.shade.jackson.databind.ObjectMapper;
import org.nd4j.shade.jackson.databind.node.ObjectNode;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

public class ComputationGraphConfigurationDeserializer
                extends BaseNetConfigDeserializer<ComputationGraphConfiguration> {

    public ComputationGraphConfigurationDeserializer(JsonDeserializer<?> defaultDeserializer) {
        super(defaultDeserializer, ComputationGraphConfiguration.class);
    }

    @Override
    public ComputationGraphConfiguration deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException {
        long charOffsetStart = jp.getCurrentLocation().getCharOffset();
        ComputationGraphConfiguration conf = (ComputationGraphConfiguration) defaultDeserializer.deserialize(jp, ctxt);

        //Updater configuration changed after 0.8.0 release
        //Previously: enumerations and fields. Now: classes
        //Here, we manually create the appropriate Updater instances, if the IUpdater field is empty

        List<Layer> layerList = new ArrayList<>();
        Map<String, GraphVertex> vertices = conf.getVertices();
        for (Map.Entry<String, GraphVertex> entry : vertices.entrySet()) {
            if (entry.getValue() instanceof LayerVertex) {
                LayerVertex lv = (LayerVertex) entry.getValue();
                layerList.add(lv.getLayerConf().getLayer());
            }
        }

        Layer[] layers = layerList.toArray(new Layer[layerList.size()]);
        //Now, check if we need to manually handle IUpdater deserialization from legacy format
        boolean attemptIUpdaterFromLegacy = requiresIUpdaterFromLegacy(layers);

        if(attemptIUpdaterFromLegacy) {
            JsonLocation endLocation = jp.getCurrentLocation();
            long charOffsetEnd = endLocation.getCharOffset();
            String jsonSubString = endLocation.getSourceRef().toString().substring((int) charOffsetStart - 1, (int) charOffsetEnd);

            ObjectMapper om = NeuralNetConfiguration.mapper();
            JsonNode rootNode = om.readTree(jsonSubString);

            ObjectNode verticesNode = (ObjectNode) rootNode.get("vertices");
            Iterator<JsonNode> iter = verticesNode.elements();
            int layerIdx = 0;
            while(iter.hasNext()){
                JsonNode next = iter.next();
                ObjectNode confNode = null;
                if(next.has("LayerVertex")){
                    next = next.get("LayerVertex");
                    if(next.has("layerConf")){
                        confNode = (ObjectNode) next.get("layerConf");
                        next = confNode.get("layer").elements().next();
                    } else {
                        continue;
                    }

                    if(layers[layerIdx] instanceof BaseLayer && ((BaseLayer)layers[layerIdx]).getIUpdater() == null){
                        handleUpdaterBackwardCompatibility((BaseLayer)layers[layerIdx], (ObjectNode)next);
                    }

                    if(layers[layerIdx].getIDropout() == null){
                        //Check for legacy dropout
                        if(next.has("dropOut")){
                            double d = next.get("dropOut").asDouble();
                            if(!Double.isNaN(d)){
                                //Might be dropout or dropconnect...
                                if(layers[layerIdx] instanceof BaseLayer && confNode.has("useDropConnect")
                                        && confNode.get("useDropConnect").asBoolean(false)){
                                    ((BaseLayer)layers[layerIdx]).setWeightNoise(new DropConnect(d));
                                } else {
                                    layers[layerIdx].setIDropout(new Dropout(d));
                                }
                            }
                        }
                    }

                    layerIdx++;
                }
            }
        }

        return conf;
    }
}


text:
package io.undertow.servlet.test.path;

import io.undertow.servlet.api.ServletInfo;
import io.undertow.servlet.test.util.DeploymentUtils;
import io.undertow.testutils.DefaultServer;
import io.undertow.testutils.HttpClientUtils;
import io.undertow.testutils.TestHttpClient;
import io.undertow.util.StatusCodes;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.servlet.ServletException;
import javax.servlet.http.MappingMatch;
import java.io.IOException;

/**
 * Test cases for the servlet mapping examples in section 12.2.2 of the
 * Servlet 4.0 specification.
 *
 * @author Carter Kozak
 */
@RunWith(DefaultServer.class)
public class ServletSpecExampleTestCase {

    @BeforeClass
    public static void setup() throws ServletException {
        // Servlet 4.0 table 12-1 Example Set of Maps
        DeploymentUtils.setupServlet(
                new ServletInfo("servlet1", GetMappingServlet.class)
                        .addMapping("/foo/bar/*"),
                new ServletInfo("servlet2", GetMappingServlet.class)
                        .addMapping("/baz/*"),
                new ServletInfo("servlet3", GetMappingServlet.class)
                        .addMapping("/catalog"),
                new ServletInfo("servlet4", GetMappingServlet.class)
                        .addMapping("*.bop"),
                new ServletInfo("default", GetMappingServlet.class));

    }

    @Test
    public void testOne() {
        doTest("/foo/bar/index.html", MappingMatch.PATH, "index.html", "/foo/bar/*", "servlet1");
    }

    @Test
    public void testTwo() {
        doTest("/foo/bar/index.bop", MappingMatch.PATH, "index.bop", "/foo/bar/*", "servlet1");
    }

    @Test
    public void testThree() {
        doTest("/baz", MappingMatch.PATH, "", "/baz/*", "servlet2");
    }

    @Test
    public void testFour() {
        doTest("/baz/index.html", MappingMatch.PATH, "index.html", "/baz/*", "servlet2");
    }

    @Test
    public void testFive() {
        doTest("/catalog", MappingMatch.EXACT, "catalog", "/catalog", "servlet3");
    }

    @Test
    public void testSix() {
        doTest("/catalog/index.html", MappingMatch.DEFAULT, "", "/", "default");
    }

    @Test
    public void testSeven() {
        doTest("/catalog/racecar.bop", MappingMatch.EXTENSION, "catalog/racecar", "*.bop", "servlet4");
    }

    @Test
    public void testEight() {
        doTest("/index.bop", MappingMatch.EXTENSION, "index", "*.bop", "servlet4");
    }

    private static void doTest(
            // Input request path excluding the servlet context path
            String path,
            // Expected HttpServletMapping result values
            MappingMatch mappingMatch,
            String matchValue,
            String pattern,
            String servletName) {
        TestHttpClient client = new TestHttpClient();
        try {
            HttpGet get = new HttpGet(DefaultServer.getDefaultServerURL() + "/servletContext" + path);
            HttpResponse result = client.execute(get);
            Assert.assertEquals(StatusCodes.OK, result.getStatusLine().getStatusCode());
            String response = HttpClientUtils.readResponse(result);
            String expected = String.format("Mapping match:%s\nMatch value:%s\nPattern:%s\nServlet:%s",
                    mappingMatch.name(), matchValue, pattern, servletName);
            Assert.assertEquals(expected, response);
        } catch (IOException e) {
            throw new AssertionError(e);
        } finally {
            client.getConnectionManager().shutdown();
        }
    }
}


text:
import express from 'express';
import path from 'path';
import bodyParser from 'body-parser';
import favicon from 'serve-favicon';
import logger from 'morgan';

import winston from './winston';
import routes from './routes/routes';

const rootDir = process.env.NODE_ENV === 'development' ? 'build' : 'dist';
const staticPath =  path.join(__dirname, rootDir);
const app = express();

app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(favicon(path.join(__dirname, rootDir + '/img/favicon.png')));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.use(express.static(staticPath));
app.use('/', routes);

app.use((req, res, next) => {
  let err = new Error('Not Found');
  err.status = 404;
  next(err);
});

app.use((err, req, res, next) => {
  res.status(err.status || 500);
  winston.log('error', err.message);

  res.render('error', {
    message: err.message,
    error: app.get('env') === 'development' ? err : {}
  });
});

export default app;


text:
require_relative '../clearance'

module JustChew::Spec::Clearance::Password; end


text:
package com.smartdevicelink.test.rpc.datatypes;

import java.util.Iterator;

import junit.framework.TestCase;

import org.json.JSONException;
import org.json.JSONObject;

import com.smartdevicelink.proxy.rpc.Image;
import com.smartdevicelink.proxy.rpc.enums.ImageType;
import com.smartdevicelink.test.JsonUtils;
import com.smartdevicelink.test.Test;

/**
 * This is a unit test class for the SmartDeviceLink library project class :
 * {@link com.smartdevicelink.rpc.Image}
 */
public class ImageTests extends TestCase{

    private Image msg;

    @Override
    public void setUp(){
        msg = new Image();

        msg.setImageType(Test.GENERAL_IMAGETYPE);
        msg.setValue(Test.GENERAL_STRING);
    }

    /**
	 * Tests the expected values of the RPC message.
	 */
    public void testRpcValues () {
    	// Test Values
        ImageType imageType = msg.getImageType();
        String value = msg.getValue();

        // Valid Tests
        assertEquals(Test.MATCH, Test.GENERAL_IMAGETYPE, imageType);
        assertEquals(Test.MATCH, Test.GENERAL_STRING, value);

        // Invalid/Null Tests
        Image msg = new Image();
        assertNotNull(Test.NOT_NULL, msg);

        assertNull(Test.NULL, msg.getImageType());
        assertNull(Test.NULL, msg.getValue());
        assertNull(Test.NULL, msg.getBulkData());
    }

    public void testJson(){
        JSONObject reference = new JSONObject();

        try{
            reference.put(Image.KEY_IMAGE_TYPE, Test.GENERAL_IMAGETYPE);
            reference.put(Image.KEY_VALUE, Test.GENERAL_STRING);

            JSONObject underTest = msg.serializeJSON();
            assertEquals(Test.MATCH, reference.length(), underTest.length());

            Iterator<?> iterator = reference.keys();
            while(iterator.hasNext()){
                String key = (String) iterator.next();
                assertEquals(Test.MATCH, JsonUtils.readObjectFromJsonObject(reference, key), JsonUtils.readObjectFromJsonObject(underTest, key));
            }
        }catch(JSONException e){
        	fail(Test.JSON_FAIL);
        }
    }
}


text:
export const OverlayList = {
  emptyList: 'Empty List',
};


text:
<Type Name="CCSequenceState" FullName="CocosSharp.CCSequenceState">
  <TypeSignature Language="C#" Value="public class CCSequenceState : CocosSharp.CCActionIntervalState" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit CCSequenceState extends CocosSharp.CCActionIntervalState" />
  <AssemblyInfo>
    <AssemblyName>CocosSharp</AssemblyName>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>CocosSharp.CCActionIntervalState</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    To be added.
    <remarks>To be added.</remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="public CCSequenceState (CocosSharp.CCSequence action, CocosSharp.CCNode target);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class CocosSharp.CCSequence action, class CocosSharp.CCNode target) cil managed" />
      <MemberType>Constructor</MemberType>
      <Parameters>
        <Parameter Name="action" Type="CocosSharp.CCSequence" />
        <Parameter Name="target" Type="CocosSharp.CCNode" />
      </Parameters>
      <Docs>
        <param name="action">To be added.</param>
        <param name="target">To be added.</param>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="actionSequences">
      <MemberSignature Language="C#" Value="protected CocosSharp.CCFiniteTimeAction[] actionSequences;" />
      <MemberSignature Language="ILAsm" Value=".field family class CocosSharp.CCFiniteTimeAction[] actionSequences" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>CocosSharp.CCFiniteTimeAction[]</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="actionStates">
      <MemberSignature Language="C#" Value="protected CocosSharp.CCFiniteTimeActionState[] actionStates;" />
      <MemberSignature Language="ILAsm" Value=".field family class CocosSharp.CCFiniteTimeActionState[] actionStates" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>CocosSharp.CCFiniteTimeActionState[]</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="IsDone">
      <MemberSignature Language="C#" Value="public override bool IsDone { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance bool IsDone" />
      <MemberType>Property</MemberType>
      <ReturnValue>
        <ReturnType>System.Boolean</ReturnType>
      </ReturnValue>
      <Docs>

          <para kind="tool">Determines if this action has run to completion</para>

        <value>
        </value>
        <remarks>
          <para kind="tool">True if this particular action has completed execution.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="last">
      <MemberSignature Language="C#" Value="protected int last;" />
      <MemberSignature Language="ILAsm" Value=".field family int32 last" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Int32</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="split">
      <MemberSignature Language="C#" Value="protected float split;" />
      <MemberSignature Language="ILAsm" Value=".field family float32 split" />
      <MemberType>Field</MemberType>
      <ReturnValue>
        <ReturnType>System.Single</ReturnType>
      </ReturnValue>
      <Docs>
        To be added.
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Step">
      <MemberSignature Language="C#" Value="protected override void Step (float dt);" />
      <MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance void Step(float32 dt) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="dt" Type="System.Single" />
      </Parameters>
      <Docs>
        <param name="dt">
          <para kind="tool">Delta time since the last invocation</para>
        </param>

          <para kind="tool">Called every frame with it's delta time.</para>

        <remarks>
          <para kind="tool">In general, you do not need to override this method, you are better off just overriding Update.</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Stop">
      <MemberSignature Language="C#" Value="protected override void Stop ();" />
      <MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance void Stop() cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters />
      <Docs>

          <para kind="tool">Called when the action has completed.</para>

        <remarks>
          <para kind="tool">This will set the <see cref="P:CocosSharp.ActionState.Target" /> to null</para>
          <para kind="tool">Developers do not need to call this method directly, they should instead call <see cref="M:CocosSharp.CCNode.StopAction" /> instead</para>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Update">
      <MemberSignature Language="C#" Value="public override void Update (float time);" />
      <MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Update(float32 time) cil managed" />
      <MemberType>Method</MemberType>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="time" Type="System.Single" />
      </Parameters>
      <Docs>
        <param name="time">
          <para kind="tool">A value between 0 and 1 representing the state of the action (0 is the start, 0.5 is the middle, 1 is the end).</para>
        </param>

          <para kind="tool">This method is invoked once per frame</para>

        <remarks>
        </remarks>
      </Docs>
    </Member>
  </Members>
</Type>


text:
package org.ovirt.engine.core.dao;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.junit.Test;
import org.ovirt.engine.core.common.businessentities.Disk;
import org.ovirt.engine.core.compat.Guid;

public class DiskDaoTest extends BaseReadDaoTestCase<Guid, Disk, DiskDao> {

    private static final int TOTAL_DISK_IMAGES = 6;

    @Override
    protected Guid getExistingEntityId() {
        return FixturesTool.DISK_ID;
    }

    @Override
    protected DiskDao prepareDao() {
        return dbFacade.getDiskDao();
    }

    @Override
    protected Guid generateNonExistingId() {
        return new Guid();
    }

    @Override
    protected int getEneitiesTotalCount() {
        return TOTAL_DISK_IMAGES + DiskLunMapDaoTest.TOTAL_DISK_LUN_MAPS;
    }

    @Test
    public void testGetAllForVm() {
        List<Disk> result = dao.getAllForVm(FixturesTool.VM_TEMPLATE_RHEL5);

        assertNotNull(result);
        assertFalse(result.isEmpty());
    }

    @Test
    public void testGetAllForVMFilteredWithPermissions() {
        // test user 3 - has permissions
        List<Disk> disks = dao.getAllForVm(FixturesTool.VM_RHEL5_POOL_57, PRIVILEGED_USER_ID, true);
        assertFullGetAllForVMResult(disks);
    }

    @Test
    public void testGetAllForVMFilteredWithPermissionsNoPermissions() {
        // test user 2 - hasn't got permissions
        List<Disk> disks = dao.getAllForVm(FixturesTool.VM_RHEL5_POOL_57, UNPRIVILEGED_USER_ID, true);
        assertTrue("VM should have no disks viewable to the user", disks.isEmpty());
    }

    @Test
    public void testGetAllForVMFilteredWithPermissionsNoPermissionsAndNoFilter() {
        // test user 2 - hasn't got permissions, but no filtering was requested
        List<Disk> disks = dao.getAllForVm(FixturesTool.VM_RHEL5_POOL_57, UNPRIVILEGED_USER_ID, false);
        assertFullGetAllForVMResult(disks);
    }

    @Test
    public void testGetAllForVM() {
        List<Disk> disks = dao.getAllForVm(FixturesTool.VM_RHEL5_POOL_57);
        assertFullGetAllForVMResult(disks);
    }

    @Test
    public void testGetAllAttachableDisksByPoolIdNoDisks() {
        List<Disk> result =
                dao.getAllAttachableDisksByPoolId(FixturesTool.STORAGE_POOL_NFS,
                        null,
                        null,
                        false);

        assertTrue(result.isEmpty());
    }

    @Test
    public void testGetAllAttachableDisksByPoolIdNull() {
        List<Disk> result =
                dao.getAllAttachableDisksByPoolId(null, null, null, false);

        assertFullGetAllAttachableDisksByPoolId(result);
    }

    @Test
    public void testGetAllAttachableDisksByPoolWithPermissions() {
        List<Disk> result =
                dao.getAllAttachableDisksByPoolId(null, null, PRIVILEGED_USER_ID, true);

        assertFullGetAllAttachableDisksByPoolId(result);
    }

    @Test
    public void testGetAllAttachableDisksByPoolWithNoPermissions() {
        List<Disk> result =
                dao.getAllAttachableDisksByPoolId(null, null, UNPRIVILEGED_USER_ID, true);

        assertTrue(result.isEmpty());
    }

    @Test
    public void testGetAllAttachableDisksByPoolWithNoPermissionsFilterDisabled() {
        List<Disk> result =
                dao.getAllAttachableDisksByPoolId(null, null, UNPRIVILEGED_USER_ID, false);

        assertFullGetAllAttachableDisksByPoolId(result);
    }

    /**
     * Asserts the result of {@link DiskImageDAO#getAllForVm(Guid)} contains the correct disks.
     * @param disks
     *            The result to check
     */
    private static void assertFullGetAllForVMResult(List<Disk> disks) {
        assertEquals("VM should have three disks", 3, disks.size());
    }

    /**
     * Asserts the result of {@link DiskDAO#getAllAttachableDisksByPoolId} contains the floating disk.
     * @param disks
     *            The result to check
     */
    private static void assertFullGetAllAttachableDisksByPoolId(List<Disk> disks) {
        assertEquals("There should be only three attachable disks", 3, disks.size());
        Set<Guid> expectedFloatingDiskIds =
                new HashSet<Guid>(Arrays.asList(FixturesTool.FLOATING_DISK_ID, FixturesTool.FLOATING_LUN_ID));
        Set<Guid> actualFloatingDiskIds = new HashSet<Guid>();
        for (Disk disk : disks) {
            actualFloatingDiskIds.add(disk.getId());
        }
        assertEquals("Wrong attachable disks", expectedFloatingDiskIds, actualFloatingDiskIds);
    }
}


text:
using System;
using Microsoft.PythonTools.Debugger.DebugEngine;

namespace Microsoft.PythonTools.Debugger {
    enum FrameKind {
        None,
        Python,
        Django
    }

    internal static class FrameKindExtensions {
        internal static void GetLanguageInfo(this FrameKind self, ref string pbstrLanguage, ref Guid pguidLanguage) {
            switch (self) {
                case FrameKind.Django:
                    pbstrLanguage = "Django Templates";
                    pguidLanguage = Guid.Empty;
                    break;
                case FrameKind.Python:
                    pbstrLanguage = "Python";
                    pguidLanguage = DebuggerConstants.guidLanguagePython;
                    break;
                default:
                    throw new InvalidOperationException();
            }
        }

    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BeaconGenerator.Models.Services
{
    public interface IBeaconController
    {
        void Start(string uuid, ushort major, ushort minor, byte power);
        void Stop();

        event EventHandler Stopped;
    }
}


text:
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [5.0.2] 2022-03-04
- merged [#28](https://github.com/berkowski/mio-serial/pull/28)
- update dependencies

## [5.0.1] 2021-08-08
Minor update to README.md

### Changed
- Updated README.md example to use current release version of mio-serial

## [5.0.0] 2021-08-08

Final release of version 5.0.  No code changes since the previous 4.0.0-beta4.

### Added
- [ColinFinck](https://github.com/ColinFinck) added as maintainer for `mio-serial`
- [estokes](https://github.com/estokes) added as maintainer for `mio-serial`

## [4.0.0] SKIPPED

A final release of version 4.0 is skipped due to version scheme (see [this comment](https://github.com/berkowski/tokio-serial/pull/42#issuecomment-881898536)).  This entry is just here for some clarifcation.

## [4.0.0-beta4] 2021-07-23

### Added
- Check in CI tests for building against the MSRV (currently `1.41.0`)

### Changed
- Error returned from `SerialPort::try_clone` changed back to `std::io::ErrorKind::Other`
  (had switched to `std::io::ErrorKind::Unsupported`).  `Unsupported` requires MSRV of `1.53`
  which is too high. (fix [#27](https://github.com/berkowski/mio-serial/issues/27))

## [4.0.0-beta3] 2021-07-22

### Added
- Some logging hooks for debugging

### Changed
- Renamed `SerialPortBuilderExt::open_async` to `SerialPortBuilderExt::open_native_async` to reflect the original
  intention

## [4.0.0-beta2] 2021-07-16

### Added
- AsRawHandle, FromRawHandle, and IntoRawHandle impls for SerialStream on Windows

### Fixed
- Potential double Drop issue on Windows between NamedPipe and COMPort

## [4.0.0-beta1] 2021-07-13
This is a major update crossing two API-breaking dependency version jumps in `mio` and
`serialport-rs`.

### BREAKING CHANGES
This release contains multiple API breaking changes with the move to [serialport-rs](https://gitlab.com/sussurrrus/serialport-rs) v4.
Additional breaking changes were made to make the API more like mio/tokio where platform-specific
implimentation details are provided with `#cfg[]` guards instead of discrete structures like in `serialport-rs`

Specifically:

* Removed platform-specific `mio_serial::windows::Serial` and `mio_serial::unix::Serial`
* Added `mio_serial::SerialStream` with platform specific requirements at compile time with `#[cfg()]`
* Removed `COMPort::from_path`, use `SerialStream::open`
* Removed `TTYPort::from_path`, use `SerialStream::open`
* Removed `TTYPort::from_serial`.  Replaced with impl of `std::convert::TryFrom<serialport::TTYPort>`
* Removed `SerialPortSettings`, `serialport-rs` now uses the builder pattern

### Changed
* Removed "libudev" from the default features.  Still available for use when desired.
* Bumped [nix](https://github.com/nix-rust/nix) to 0.22
* Bumped [mio](https://github.com/tokio-rs/mio) to 0.7
* Bumped [serialport-rs](https://gitlab.com/sussurrrus/serialport-rs) to 4.0.0
* Changed CHANGELOG from asciidoc to markdown

### Added
* `SerialStream` structure as the common entry point for serial port IO.
* `SerialPortBuilderExt` extension trait to add `open_async` method
  to `serialport::SerialPortBuilder` much like the already existing `open` method.

### Other
* Switched CI to appveyor for Windows, OSX, and Linux.  It doesn't test as many targets, but some checks are better
  than none now that travis-ci is no longer an option.

## [3.3.1] 2020-03-15
### Added
* @flosse added #derive Debug support for the Serial struct in [#20](https://github.com/berkowski/mio-serial/pull/20)
* @vleesvlieg added automatic retrying for EINTR returns to file descriptors in [#21](https://github.com/berkowski/mio-serial/pull/21)

### Changed
* Bumped [nix](https://github.com/nix-rust/nix) to 0.17

## [3.3.0] 2019-08-23
* Bumped [serialport-rs](https://gitlab.com/susurrus/serialport-rs) to 3.3

## [3.2.14] 2019-06-01
### Changed
* Bumped [nix](https://github.com/nix-rust/nix) to 0.14 to address [#17](https://github.com/berkowski/mio-serial/issues/17)

## [3.2] 2019-01-12
### Changed
* Bumped [serialport-rs](https://gitlab.com/susurrus/serialport-rs) to 3.2

## [3.1.1] 2019-01-12
### Changed
* Merged [#16](https://github/berkowski/mio-serial/pull/16) @yuja fixed feature flags

## [3.1] 2018-11-10
### Added
* Added "libudev" feature.  Enabled by default, can be disabled for targets without udev support.

### Changed
* Bumped [serialport-rs](https://gitlab.com/susurrus/serialport-rs) to 3.1
* Merged [#13](https://github.com/berkowski/mio-serial/pull/13) @dvtomas added some clarity to the example.

## [3.0.1] - 2018-11-06
### Changed
* Restricted [serialport-rs](https://gitlab.com/susurrus/serialport-rs) to 3.0
  serialport-rs 3.1 contains API breaking changes.

## [3.0.0] - 2018-10-06
### Changed
* Bumped [serialport-rs](https://gitlab.com/susurrus/serialport-rs) to 3.0
  serialport-rs 3.0 contains breaking changes.
* Bumped [nix](https://github.com/nix-rust/nix) to 0.11
* `mio-serial` version number will now track upstream serialport-rs.  mio-serial
  is mostly feature complete at this point (at least for *nix) and this should
  help reduce confusion.

### Fixed
* Merged [#10](https://github.com/berkowski/mio-serial/pull/10) (thanks @yuja!).  Addresses some
  windows timeout settings.

## [0.8.0] - 2018-03-31
### Changed
* Bumped [serialport-rs](https://gitlab.com/susurrus/serialport-rs) to 2.3

### Added
* Merged[#5](https://github.com/berkowski/mio-serial/pull/5) @ndusart added `try_clone` implementations as requred
  by the serialport trait as of 2.3
* Closed[#6](https://github.com/berkowski/mio-serial/pull/6) @snorp also drew attention to the `try_clone` addition

## [0.7.0] - 2018-02-25
### Changed
* Bumped [serialport-rs](https://gitlab.com/susurrus/serialport-rs) to 2.1

### Added
* Merged[#4](https://github.com/berkowski/mio-serial/pull/4) @ndusart added windows support!
* Added appveyor config to support new windows impl.

## [0.6.0] - 2017-11-28
### Added
* Closed [#3](https://github.com/berkowski/mio-serial/pull/3) Reexport serialport::Error for error handling without importing serialport crate.
  Thanks @Idanko

## [0.5.0] - 2017-04-15
### Added
* Added [trust](https://github.com/japaric/trust) based ci

### Changed
* Changed license back to MIT now that `serialport-rs` is MPL-2.0
* Bumped `serialport-rs` dependency to 1.0

## [0.4.0] - 2017-02-13
### Changed
* Changed to LGPL-3 for compliance with `serialport` dependency.

## [0.3.0] - 2017-02-13 [YANKED]
### Added
* Bumped `serialport` dependency to 0.9


text:
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/autofill/autofill_context_menu_manager.h"

#include <string>

#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/ui/autofill/chrome_autofill_client.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "components/autofill/content/browser/content_autofill_driver.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/common/autofill_features.h"

namespace autofill {

namespace {

// The range of command IDs reserved for autofill's custom menus.
static constexpr int kAutofillContextCustomFirst =
    IDC_CONTENT_CONTEXT_AUTOFILL_CUSTOM_FIRST;
static constexpr int kAutofillContextCustomLast =
    IDC_CONTENT_CONTEXT_AUTOFILL_CUSTOM_LAST;

// Field types that are supposed to be shown in the menu. |UNKNOWN_TYPE|
// denotes a separator needs to be added.
static constexpr std::array kAddressFieldTypesToShow = {
    NAME_FULL,
    UNKNOWN_TYPE,
    ADDRESS_HOME_STREET_ADDRESS,
    ADDRESS_HOME_CITY,
    ADDRESS_HOME_ZIP,
    UNKNOWN_TYPE,
    PHONE_HOME_WHOLE_NUMBER,
    EMAIL_ADDRESS};

// Field types that are supposed to be shown in the menu. |UNKNOWN_TYPE|
// denotes a separator needs to be added.
static constexpr std::array kCardFieldTypesToShow = {
    CREDIT_CARD_NAME_FULL, CREDIT_CARD_NUMBER, UNKNOWN_TYPE,
    CREDIT_CARD_EXP_MONTH, CREDIT_CARD_EXP_2_DIGIT_YEAR};

}  // namespace

// static
AutofillContextMenuManager::CommandId
AutofillContextMenuManager::ConvertToAutofillCustomCommandId(int offset) {
  return AutofillContextMenuManager::CommandId(
      kAutofillContextCustomFirst + SubMenuType::NUM_SUBMENU_TYPES + offset);
}

// static
bool AutofillContextMenuManager::IsAutofillCustomCommandId(
    CommandId command_id) {
  return command_id.value() >= kAutofillContextCustomFirst &&
         command_id.value() <= kAutofillContextCustomLast;
}

AutofillContextMenuManager::AutofillContextMenuManager(
    PersonalDataManager* personal_data_manager,
    RenderViewContextMenuBase* delegate,
    ui::SimpleMenuModel* menu_model,
    Browser* browser,
    content::RenderFrameHost* render_frame_host)
    : personal_data_manager_(personal_data_manager),
      menu_model_(menu_model),
      delegate_(delegate),
      browser_(browser),
      render_frame_host_(render_frame_host) {
  DCHECK(render_frame_host_);
  content_autofill_driver_ =
      ContentAutofillDriver::GetForRenderFrameHost(render_frame_host_);
  if (delegate_)
    params_ = delegate_->params();
}

AutofillContextMenuManager::~AutofillContextMenuManager() {
  cached_menu_models_.clear();
  command_id_to_menu_item_value_mapper_.clear();
}

void AutofillContextMenuManager::AppendItems() {
  if (!base::FeatureList::IsEnabled(
          features::kAutofillShowManualFallbackInContextMenu)) {
    return;
  }

  DCHECK(personal_data_manager_);
  DCHECK(menu_model_);

  AutofillClient* autofill_client =
      autofill::ChromeAutofillClient::FromWebContents(
          content::WebContents::FromRenderFrameHost(render_frame_host_));
  // If the autofill popup is shown and the user double clicks from within the
  // bounds of the initiating field, it is assumed that the context menu would
  // overlap with the autofill popup. In that case, hide the autofill popup.
  if (autofill_client) {
    autofill_client->HideAutofillPopup(
        PopupHidingReason::kOverlappingWithAutofillContextMenu);
  }

  // Stores all the profile values added to the content menu alongwith the
  // command id of the row.
  std::vector<std::pair<CommandId, ContextMenuItem>>
      detail_items_added_to_context_menu;

  AppendAddressItems(detail_items_added_to_context_menu);
  AppendCreditCardItems(detail_items_added_to_context_menu);

  command_id_to_menu_item_value_mapper_ =
      base::flat_map<CommandId, ContextMenuItem>(
          std::move(detail_items_added_to_context_menu));
}

bool AutofillContextMenuManager::IsCommandIdChecked(
    CommandId command_id) const {
  return false;
}

bool AutofillContextMenuManager::IsCommandIdVisible(
    CommandId command_id) const {
  return true;
}

bool AutofillContextMenuManager::IsCommandIdEnabled(
    CommandId command_id) const {
  return true;
}

void AutofillContextMenuManager::ExecuteCommand(CommandId command_id) {
  if (!content_autofill_driver_)
    return;

  auto it = command_id_to_menu_item_value_mapper_.find(command_id);
  if (it == command_id_to_menu_item_value_mapper_.end())
    return;

  DCHECK(IsAutofillCustomCommandId(command_id));

  // Field Renderer id should be present because the context menu is triggered
  // on a input field. Otherwise, Autofill context menu models would not have
  // been added to the context menu.
  if (!params_.field_renderer_id)
    return;

  if (it->second.is_manage_item) {
    DCHECK(browser_);
    switch (it->second.sub_menu_type) {
      case SubMenuType::SUB_MENU_TYPE_ADDRESS:
        chrome::ShowAddresses(browser_);
        break;
      case SubMenuType::SUB_MENU_TYPE_CREDIT_CARD:
        chrome::ShowPaymentMethods(browser_);
        break;
      case SubMenuType::SUB_MENU_TYPE_PASSWORD:
        chrome::ShowPasswordManager(browser_);
        break;
      case SubMenuType::NUM_SUBMENU_TYPES:
        [[fallthrough]];
      default:
        NOTREACHED();
    }
    return;
  }

  content_autofill_driver_->browser_events().RendererShouldFillFieldWithValue(
      {LocalFrameToken(render_frame_host_->GetFrameToken().value()),
       FieldRendererId(params_.field_renderer_id.value())},
      it->second.fill_value);

  // TODO(crbug.com/1325811): Use `it->second.sub_menu_type` to record the usage
  // of the context menu based on the type.
}

void AutofillContextMenuManager::AppendAddressItems(
    std::vector<std::pair<CommandId, ContextMenuItem>>&
        detail_items_added_to_context_menu) {
  std::vector<AutofillProfile*> address_profiles =
      personal_data_manager_->GetProfiles();
  if (address_profiles.empty()) {
    return;
  }

  // Used to create menu model for storing address description. Would be
  // attached to the top level "Fill Address Info" item in the context menu.
  cached_menu_models_.push_back(
      std::make_unique<ui::SimpleMenuModel>(delegate_));
  ui::SimpleMenuModel* profile_menu = cached_menu_models_.back().get();

  // True if a row is added in the address section.
  bool address_added = false;

  for (const AutofillProfile* profile : address_profiles) {
    // Creates a menu model for storing address details. Would be attached
    // to the address description menu item.
    cached_menu_models_.push_back(
        std::make_unique<ui::SimpleMenuModel>(delegate_));
    ui::SimpleMenuModel* address_details_submenu =
        cached_menu_models_.back().get();

    // Create a submenu for each address profile with their details.
    bool submenu_items_added = CreateSubMenuWithData(
        profile, kAddressFieldTypesToShow, address_details_submenu,
        detail_items_added_to_context_menu, SubMenuType::SUB_MENU_TYPE_ADDRESS);

    if (!submenu_items_added) {
      break;
    }

    // Add a menu item showing address profile description. Hovering over it
    // opens a submenu with the address details.
    absl::optional<CommandId> profile_menu_id =
        GetNextAvailableAutofillCommandId();
    if (profile_menu_id) {
      address_added = true;
      profile_menu->AddSubMenu(profile_menu_id->value(),
                               GetProfileDescription(*profile),
                               address_details_submenu);
    }
  }

  if (!address_added)
    return;

  profile_menu->AddSeparator(ui::NORMAL_SEPARATOR);
  absl::optional<CommandId> manage_item_command_id =
      GetNextAvailableAutofillCommandId();
  DCHECK(manage_item_command_id);
  // TODO(crbug.com/1325811): Use i18n string.
  profile_menu->AddItem(manage_item_command_id->value(), u"Manage addresses");
  detail_items_added_to_context_menu.emplace_back(
      *manage_item_command_id,
      ContextMenuItem{u"", SubMenuType::SUB_MENU_TYPE_ADDRESS, true});

  // Add a menu option to suggest filling address in the context menu.
  // Hovering over it opens a submenu suggesting all the address profiles
  // stored in the profile.
  // TODO(crbug.com/1325811): Use i18n string.
  menu_model_->AddSubMenu(
      kAutofillContextCustomFirst + SubMenuType::SUB_MENU_TYPE_ADDRESS,
      u"Fill Address Info", profile_menu);
}

void AutofillContextMenuManager::AppendCreditCardItems(
    std::vector<std::pair<CommandId, ContextMenuItem>>&
        detail_items_added_to_context_menu) {
  std::vector<CreditCard*> cards = personal_data_manager_->GetCreditCards();
  if (cards.empty()) {
    return;
  }

  // Used to create menu model for storing credit card description. Would be
  // attached to the top level "Fill Payment" item in the context menu.
  cached_menu_models_.push_back(
      std::make_unique<ui::SimpleMenuModel>(delegate_));
  ui::SimpleMenuModel* card_submenu = cached_menu_models_.back().get();

  // True if a row is added in the credit card section.
  bool card_added = false;

  for (const CreditCard* card : cards) {
    // Creates a menu model for storing credit card details. Would be attached
    // to the credit card description menu item.
    cached_menu_models_.push_back(
        std::make_unique<ui::SimpleMenuModel>(delegate_));
    ui::SimpleMenuModel* card_details_submenu =
        cached_menu_models_.back().get();

    // Create a submenu for each credit card with their details.
    bool submenu_items_added =
        CreateSubMenuWithData(card, kCardFieldTypesToShow, card_details_submenu,
                              detail_items_added_to_context_menu,
                              SubMenuType::SUB_MENU_TYPE_CREDIT_CARD);

    if (!submenu_items_added)
      break;

    // Add a menu item showing credit card  description. Hovering over it
    // opens a submenu with the credit card details.
    absl::optional<CommandId> submenu_id = GetNextAvailableAutofillCommandId();
    if (submenu_id) {
      card_added = true;
      card_submenu->AddSubMenu(submenu_id->value(),
                               card->CardIdentifierStringForAutofillDisplay(),
                               card_details_submenu);
    }
  }

  if (!card_added)
    return;

  card_submenu->AddSeparator(ui::NORMAL_SEPARATOR);
  absl::optional<CommandId> manage_item_command_id =
      GetNextAvailableAutofillCommandId();
  DCHECK(manage_item_command_id);
  // TODO(crbug.com/1325811): Use i18n string.
  card_submenu->AddItem(manage_item_command_id->value(),
                        u"Manage payment methods");
  detail_items_added_to_context_menu.emplace_back(
      *manage_item_command_id,
      ContextMenuItem{u"", SubMenuType::SUB_MENU_TYPE_CREDIT_CARD, true});

  // Add a menu option to suggest filling a credit card in the context menu.
  // Hovering over it opens a submenu suggesting all the credit cards
  // stored in the profile.
  // TODO(crbug.com/1325811): Use i18n string.
  menu_model_->AddSubMenu(
      kAutofillContextCustomFirst + SubMenuType::SUB_MENU_TYPE_CREDIT_CARD,
      u"Fill Payment", card_submenu);
}

bool AutofillContextMenuManager::CreateSubMenuWithData(
    absl::variant<const AutofillProfile*, const CreditCard*>
        profile_or_credit_card,
    base::span<const ServerFieldType> field_types_to_show,
    ui::SimpleMenuModel* menu_model,
    std::vector<std::pair<CommandId, ContextMenuItem>>&
        detail_items_added_to_context_menu,
    SubMenuType sub_menu_type) {
  // Count of items to be added to the context menu. Empty values are not
  // considered.
  int count_of_items_to_be_added = base::ranges::count_if(
      field_types_to_show, [&](ServerFieldType field_type) {
        return field_type != UNKNOWN_TYPE &&
               !absl::visit(
                    [field_type](const auto& alternative) {
                      return alternative->GetRawInfo(field_type);
                    },
                    profile_or_credit_card)
                    .empty();
      });

  // Check if there are enough command ids for adding all the items to the
  // context menu.
  // 1 is added to count for the address/credit card description.
  // Another 1 is added to account for the manage addresses/payment methods
  // option.
  if (!IsAutofillCustomCommandId(CommandId(
          kAutofillContextCustomFirst + SubMenuType::NUM_SUBMENU_TYPES +
          count_of_items_added_to_menu_model_ + count_of_items_to_be_added + 1 +
          1))) {
    return false;
  }

  // True when an item is added to the context menu which is not a separator.
  bool is_separator_required = false;

  // True when a `UNKNOWN_TYPE` is seen in `field_types_to_show`.
  bool was_prev_unknown = false;

  for (const ServerFieldType type : field_types_to_show) {
    if (type == UNKNOWN_TYPE) {
      was_prev_unknown = true;
      continue;
    }

    std::u16string value = absl::visit(
        [type](const auto& alternative) {
          return alternative->GetRawInfo(type);
        },
        profile_or_credit_card);

    if (value.empty())
      continue;

    absl::optional<CommandId> value_menu_id =
        GetNextAvailableAutofillCommandId();

    DCHECK(value_menu_id);

    if (was_prev_unknown && is_separator_required) {
      menu_model->AddSeparator(ui::NORMAL_SEPARATOR);
      is_separator_required = false;
    }

    // Create a menu item with the address/credit card details and attach
    // to the model.
    menu_model->AddItem(value_menu_id->value(), value);
    detail_items_added_to_context_menu.emplace_back(
        *value_menu_id, ContextMenuItem{value, sub_menu_type});
    was_prev_unknown = false;
    is_separator_required = true;
  }

  return true;
}

absl::optional<AutofillContextMenuManager::CommandId>
AutofillContextMenuManager::GetNextAvailableAutofillCommandId() {
  int max_index = kAutofillContextCustomLast - kAutofillContextCustomFirst;

  if (count_of_items_added_to_menu_model_ >= max_index)
    return absl::nullopt;

  return ConvertToAutofillCustomCommandId(
      count_of_items_added_to_menu_model_++);
}

std::u16string AutofillContextMenuManager::GetProfileDescription(
    const AutofillProfile& profile) {
  // All user-visible fields.
  static constexpr ServerFieldType kDetailsFields[] = {
      NAME_FULL,
      ADDRESS_HOME_LINE1,
      ADDRESS_HOME_LINE2,
      ADDRESS_HOME_DEPENDENT_LOCALITY,
      ADDRESS_HOME_CITY,
      ADDRESS_HOME_STATE,
      ADDRESS_HOME_ZIP,
      EMAIL_ADDRESS,
      PHONE_HOME_WHOLE_NUMBER,
      COMPANY_NAME,
      ADDRESS_HOME_COUNTRY};

  return profile.ConstructInferredLabel(
      kDetailsFields, std::size(kDetailsFields),
      /*num_fields_to_include=*/2, personal_data_manager_->app_locale());
}

}  // namespace autofill


text:
package azure

import (
	"bytes"
	"io"
	"io/ioutil"
	"math/rand"
	"reflect"
	"strings"
	"testing"

	azure "github.com/Azure/azure-sdk-for-go/storage"
)

func TestRandomWriter_writeChunkToBlocks(t *testing.T) {
	s := NewStorageSimulator()
	rw := newRandomBlobWriter(&s, 3)
	rand := newBlockIDGenerator()
	c := []byte("AAABBBCCCD")

	if err := rw.bs.CreateBlockBlob("a", "b"); err != nil {
		t.Fatal(err)
	}
	bw, nn, err := rw.writeChunkToBlocks("a", "b", bytes.NewReader(c), rand)
	if err != nil {
		t.Fatal(err)
	}
	if expected := int64(len(c)); nn != expected {
		t.Fatalf("wrong nn:%v, expected:%v", nn, expected)
	}
	if expected := 4; len(bw) != expected {
		t.Fatal("unexpected written block count")
	}

	bx, err := s.GetBlockList("a", "b", azure.BlockListTypeAll)
	if err != nil {
		t.Fatal(err)
	}
	if expected := 0; len(bx.CommittedBlocks) != expected {
		t.Fatal("unexpected committed block count")
	}
	if expected := 4; len(bx.UncommittedBlocks) != expected {
		t.Fatalf("unexpected uncommitted block count: %d -- %#v", len(bx.UncommittedBlocks), bx)
	}

	if err := rw.bs.PutBlockList("a", "b", bw); err != nil {
		t.Fatal(err)
	}

	r, err := rw.bs.GetBlob("a", "b")
	if err != nil {
		t.Fatal(err)
	}
	assertBlobContents(t, r, c)
}

func TestRandomWriter_blocksLeftSide(t *testing.T) {
	blob := "AAAAABBBBBCCC"
	cases := []struct {
		offset          int64
		expectedBlob    string
		expectedPattern []azure.BlockStatus
	}{
		{0, "", []azure.BlockStatus{}},                                                                                // write to beginning, discard all
		{13, blob, []azure.BlockStatus{azure.BlockStatusCommitted, azure.BlockStatusCommitted, azure.BlockStatusCommitted}}, // write to end, no change
		{1, "A", []azure.BlockStatus{azure.BlockStatusUncommitted}},                                                         // write at 1
		{5, "AAAAA", []azure.BlockStatus{azure.BlockStatusCommitted}},                                                       // write just after first block
		{6, "AAAAAB", []azure.BlockStatus{azure.BlockStatusCommitted, azure.BlockStatusUncommitted}},                        // split the second block
		{9, "AAAAABBBB", []azure.BlockStatus{azure.BlockStatusCommitted, azure.BlockStatusUncommitted}},                     // write just after first block
	}

	for _, c := range cases {
		s := NewStorageSimulator()
		rw := newRandomBlobWriter(&s, 5)
		rand := newBlockIDGenerator()

		if err := rw.bs.CreateBlockBlob("a", "b"); err != nil {
			t.Fatal(err)
		}
		bw, _, err := rw.writeChunkToBlocks("a", "b", strings.NewReader(blob), rand)
		if err != nil {
			t.Fatal(err)
		}
		if err := rw.bs.PutBlockList("a", "b", bw); err != nil {
			t.Fatal(err)
		}
		bx, err := rw.blocksLeftSide("a", "b", c.offset, rand)
		if err != nil {
			t.Fatal(err)
		}

		bs := []azure.BlockStatus{}
		for _, v := range bx {
			bs = append(bs, v.Status)
		}

		if !reflect.DeepEqual(bs, c.expectedPattern) {
			t.Logf("Committed blocks %v", bw)
			t.Fatalf("For offset %v: Expected pattern: %v, Got: %v\n(Returned: %v)", c.offset, c.expectedPattern, bs, bx)
		}
		if rw.bs.PutBlockList("a", "b", bx); err != nil {
			t.Fatal(err)
		}
		r, err := rw.bs.GetBlob("a", "b")
		if err != nil {
			t.Fatal(err)
		}
		cout, err := ioutil.ReadAll(r)
		if err != nil {
			t.Fatal(err)
		}
		outBlob := string(cout)
		if outBlob != c.expectedBlob {
			t.Fatalf("wrong blob contents: %v, expected: %v", outBlob, c.expectedBlob)
		}
	}
}

func TestRandomWriter_blocksRightSide(t *testing.T) {
	blob := "AAAAABBBBBCCC"
	cases := []struct {
		offset          int64
		size            int64
		expectedBlob    string
		expectedPattern []azure.BlockStatus
	}{
		{0, 100, "", []azure.BlockStatus{}},                                                                                // overwrite the entire blob
		{0, 3, "AABBBBBCCC", []azure.BlockStatus{azure.BlockStatusUncommitted, azure.BlockStatusCommitted, azure.BlockStatusCommitted}}, // split first block
		{4, 1, "BBBBBCCC", []azure.BlockStatus{azure.BlockStatusCommitted, azure.BlockStatusCommitted}},                                 // write to last char of first block
		{1, 6, "BBBCCC", []azure.BlockStatus{azure.BlockStatusUncommitted, azure.BlockStatusCommitted}},                                 // overwrite splits first and second block, last block remains
		{3, 8, "CC", []azure.BlockStatus{azure.BlockStatusUncommitted}},                                                                 // overwrite a block in middle block, split end block
		{10, 1, "CC", []azure.BlockStatus{azure.BlockStatusUncommitted}},                                                                // overwrite first byte of rightmost block
		{11, 2, "", []azure.BlockStatus{}},                                                                                // overwrite the rightmost index
		{13, 20, "", []azure.BlockStatus{}},                                                                                // append to the end
	}

	for _, c := range cases {
		s := NewStorageSimulator()
		rw := newRandomBlobWriter(&s, 5)
		rand := newBlockIDGenerator()

		if err := rw.bs.CreateBlockBlob("a", "b"); err != nil {
			t.Fatal(err)
		}
		bw, _, err := rw.writeChunkToBlocks("a", "b", strings.NewReader(blob), rand)
		if err != nil {
			t.Fatal(err)
		}
		if err := rw.bs.PutBlockList("a", "b", bw); err != nil {
			t.Fatal(err)
		}
		bx, err := rw.blocksRightSide("a", "b", c.offset, c.size, rand)
		if err != nil {
			t.Fatal(err)
		}

		bs := []azure.BlockStatus{}
		for _, v := range bx {
			bs = append(bs, v.Status)
		}

		if !reflect.DeepEqual(bs, c.expectedPattern) {
			t.Logf("Committed blocks %v", bw)
			t.Fatalf("For offset %v-size:%v: Expected pattern: %v, Got: %v\n(Returned: %v)", c.offset, c.size, c.expectedPattern, bs, bx)
		}
		if rw.bs.PutBlockList("a", "b", bx); err != nil {
			t.Fatal(err)
		}
		r, err := rw.bs.GetBlob("a", "b")
		if err != nil {
			t.Fatal(err)
		}
		cout, err := ioutil.ReadAll(r)
		if err != nil {
			t.Fatal(err)
		}
		outBlob := string(cout)
		if outBlob != c.expectedBlob {
			t.Fatalf("For offset %v-size:%v: wrong blob contents: %v, expected: %v", c.offset, c.size, outBlob, c.expectedBlob)
		}
	}
}

func TestRandomWriter_Write_NewBlob(t *testing.T) {
	var (
		s    = NewStorageSimulator()
		rw   = newRandomBlobWriter(&s, 1024*3) // 3 KB blocks
		blob = randomContents(1024 * 7)        // 7 KB blob
	)
	if err := rw.bs.CreateBlockBlob("a", "b"); err != nil {
		t.Fatal(err)
	}

	if _, err := rw.WriteBlobAt("a", "b", 10, bytes.NewReader(blob)); err == nil {
		t.Fatal("expected error, got nil")
	}
	if _, err := rw.WriteBlobAt("a", "b", 100000, bytes.NewReader(blob)); err == nil {
		t.Fatal("expected error, got nil")
	}
	if nn, err := rw.WriteBlobAt("a", "b", 0, bytes.NewReader(blob)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(blob)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := rw.bs.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, blob)
	}
	if bx, err := rw.bs.GetBlockList("a", "b", azure.BlockListTypeCommitted); err != nil {
		t.Fatal(err)
	} else if len(bx.CommittedBlocks) != 3 {
		t.Fatalf("got wrong number of committed blocks: %v", len(bx.CommittedBlocks))
	}

	// Replace first 512 bytes
	leftChunk := randomContents(512)
	blob = append(leftChunk, blob[512:]...)
	if nn, err := rw.WriteBlobAt("a", "b", 0, bytes.NewReader(leftChunk)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(leftChunk)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := rw.bs.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, blob)
	}
	if bx, err := rw.bs.GetBlockList("a", "b", azure.BlockListTypeCommitted); err != nil {
		t.Fatal(err)
	} else if expected := 4; len(bx.CommittedBlocks) != expected {
		t.Fatalf("got wrong number of committed blocks: %v, expected: %v", len(bx.CommittedBlocks), expected)
	}

	// Replace last 512 bytes with 1024 bytes
	rightChunk := randomContents(1024)
	offset := int64(len(blob) - 512)
	blob = append(blob[:offset], rightChunk...)
	if nn, err := rw.WriteBlobAt("a", "b", offset, bytes.NewReader(rightChunk)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(rightChunk)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := rw.bs.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, blob)
	}
	if bx, err := rw.bs.GetBlockList("a", "b", azure.BlockListTypeCommitted); err != nil {
		t.Fatal(err)
	} else if expected := 5; len(bx.CommittedBlocks) != expected {
		t.Fatalf("got wrong number of committed blocks: %v, expected: %v", len(bx.CommittedBlocks), expected)
	}

	// Replace 2K-4K (overlaps 2 blocks from L/R)
	newChunk := randomContents(1024 * 2)
	offset = 1024 * 2
	blob = append(append(blob[:offset], newChunk...), blob[offset+int64(len(newChunk)):]...)
	if nn, err := rw.WriteBlobAt("a", "b", offset, bytes.NewReader(newChunk)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(newChunk)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := rw.bs.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, blob)
	}
	if bx, err := rw.bs.GetBlockList("a", "b", azure.BlockListTypeCommitted); err != nil {
		t.Fatal(err)
	} else if expected := 6; len(bx.CommittedBlocks) != expected {
		t.Fatalf("got wrong number of committed blocks: %v, expected: %v\n%v", len(bx.CommittedBlocks), expected, bx.CommittedBlocks)
	}

	// Replace the entire blob
	newBlob := randomContents(1024 * 30)
	if nn, err := rw.WriteBlobAt("a", "b", 0, bytes.NewReader(newBlob)); err != nil {
		t.Fatal(err)
	} else if expected := int64(len(newBlob)); expected != nn {
		t.Fatalf("wrong written bytes count: %v, expected: %v", nn, expected)
	}
	if out, err := rw.bs.GetBlob("a", "b"); err != nil {
		t.Fatal(err)
	} else {
		assertBlobContents(t, out, newBlob)
	}
	if bx, err := rw.bs.GetBlockList("a", "b", azure.BlockListTypeCommitted); err != nil {
		t.Fatal(err)
	} else if expected := 10; len(bx.CommittedBlocks) != expected {
		t.Fatalf("got wrong number of committed blocks: %v, expected: %v\n%v", len(bx.CommittedBlocks), expected, bx.CommittedBlocks)
	} else if expected, size := int64(1024*30), getBlobSize(bx); size != expected {
		t.Fatalf("committed block size does not indicate blob size")
	}
}

func Test_getBlobSize(t *testing.T) {
	// with some committed blocks
	if expected, size := int64(151), getBlobSize(azure.BlockListResponse{
		CommittedBlocks: []azure.BlockResponse{
			{"A", 100},
			{"B", 50},
			{"C", 1},
		},
		UncommittedBlocks: []azure.BlockResponse{
			{"D", 200},
		}}); expected != size {
		t.Fatalf("wrong blob size: %v, expected: %v", size, expected)
	}

	// with no committed blocks
	if expected, size := int64(0), getBlobSize(azure.BlockListResponse{
		UncommittedBlocks: []azure.BlockResponse{
			{"A", 100},
			{"B", 50},
			{"C", 1},
			{"D", 200},
		}}); expected != size {
		t.Fatalf("wrong blob size: %v, expected: %v", size, expected)
	}
}

func assertBlobContents(t *testing.T, r io.Reader, expected []byte) {
	out, err := ioutil.ReadAll(r)
	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(out, expected) {
		t.Fatalf("wrong blob contents. size: %v, expected: %v", len(out), len(expected))
	}
}

func randomContents(length int64) []byte {
	b := make([]byte, length)
	for i := range b {
		b[i] = byte(rand.Intn(2 << 8))
	}
	return b
}


text:
#include "config.h"

#include <gtest/gtest.h>
#include "core/platform/graphics/GraphicsLayer.h"
#include "core/platform/graphics/Image.h"
#include "core/platform/graphics/skia/NativeImageSkia.h"
#include "public/platform/WebImageLayer.h"
#include "wtf/PassOwnPtr.h"

using namespace WebCore;

namespace {

class MockGraphicsLayerClient : public GraphicsLayerClient {
  public:
    virtual void notifyAnimationStarted(const GraphicsLayer*, double time) OVERRIDE { }
    virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const IntRect& inClip) OVERRIDE { }
};

class TestImage : public Image {
public:

    static PassRefPtr<TestImage> create(const IntSize& size, bool opaque)
    {
        return adoptRef(new TestImage(size, opaque));
    }

    explicit TestImage(const IntSize& size, bool opaque)
        : Image(0)
        , m_size(size)
    {
        m_nativeImage = NativeImageSkia::create();
        m_nativeImage->bitmap().setConfig(SkBitmap::kARGB_8888_Config,
                                          size.width(), size.height(), 0);
        m_nativeImage->bitmap().allocPixels();
        m_nativeImage->bitmap().setIsOpaque(opaque);
    }

    virtual bool isBitmapImage() const OVERRIDE
    {
        return true;
    }

    virtual bool currentFrameKnownToBeOpaque() OVERRIDE
    {
        return m_nativeImage->bitmap().isOpaque();
    }

    virtual IntSize size() const OVERRIDE
    {
        return m_size;
    }

    virtual PassRefPtr<NativeImageSkia> nativeImageForCurrentFrame() OVERRIDE
    {
        if (m_size.isZero())
            return 0;

        return m_nativeImage;
    }

    // Stub implementations of pure virtual Image functions.
    virtual void destroyDecodedData(bool) OVERRIDE
    {
    }

    virtual unsigned decodedSize() const OVERRIDE
    {
        return 0u;
    }

    virtual void draw(GraphicsContext*, const FloatRect&, const FloatRect&, CompositeOperator, BlendMode) OVERRIDE
    {
    }

private:

    IntSize m_size;

    RefPtr<NativeImageSkia> m_nativeImage;
};

class GraphicsLayerForTesting : public GraphicsLayer {
public:
    explicit GraphicsLayerForTesting(GraphicsLayerClient* client)
        : GraphicsLayer(client) { };
};

TEST(ImageLayerChromiumTest, opaqueImages)
{
    MockGraphicsLayerClient client;
    OwnPtr<GraphicsLayerForTesting> graphicsLayer = adoptPtr(new GraphicsLayerForTesting(&client));
    ASSERT_TRUE(graphicsLayer.get());

    RefPtr<Image> opaqueImage = TestImage::create(IntSize(100, 100), true);
    ASSERT_TRUE(opaqueImage.get());
    RefPtr<Image> nonOpaqueImage = TestImage::create(IntSize(100, 100), false);
    ASSERT_TRUE(nonOpaqueImage.get());

    ASSERT_FALSE(graphicsLayer->contentsLayer());

    graphicsLayer->setContentsToImage(opaqueImage.get());
    ASSERT_TRUE(graphicsLayer->contentsLayer()->opaque());

    graphicsLayer->setContentsToImage(nonOpaqueImage.get());
    ASSERT_FALSE(graphicsLayer->contentsLayer()->opaque());
}

} // namespace


text:
import os

import pytest
from requests import Session

from RequestsLibrary import RequestsLibrary
from RequestsLibrary.utils import is_file_descriptor, merge_headers
from utests import SCRIPT_DIR
from utests import mock

def test_none():
    assert is_file_descriptor(None) is False

def test_is_not_file_descriptor():
    nf = 'a string'
    assert is_file_descriptor(nf) is False

def test_is_file_descriptor():
    with open(os.path.join(SCRIPT_DIR, './test_utils.py')) as fd:
        assert is_file_descriptor(fd) is True

def test_merge_headers_with_session_headers_only():
    session = Session()
    merged = merge_headers(session, None)
    assert merged == session.headers

def test_merge_headers_with_all_none():
    session = Session()
    session.headers = None
    merged = merge_headers(session, None)
    assert merged == {}

def test_merge_headers_with_all():
    session = Session()
    headers = {'Content-Type': 'test'}
    merged = merge_headers(session, headers)
    session.headers.update(headers)
    assert merged == session.headers

@pytest.fixture(scope='function')
def mocked_keywords():
    keywords = RequestsLibrary()
    keywords._cache = mock.MagicMock()
    keywords._common_request = mock.MagicMock()
    keywords._check_status = mock.MagicMock()
    return keywords

@mock.patch('RequestsLibrary.utils.logger')
def test_no_warn_if_url_passed_as_named(mocked_logger, mocked_keywords):
    mocked_keywords.get_on_session('alias', url='http://this.is.an.url')
    mocked_logger.warn.assert_not_called()

@mock.patch('RequestsLibrary.utils.logger')
def test_no_warn_if_url_passed_as_positional(mocked_logger, mocked_keywords):
    mocked_keywords.get_on_session('alias', 'http://this.is.an.url')
    mocked_logger.warn.assert_not_called()

@mock.patch('RequestsLibrary.utils.logger')
def test_warn_that_url_is_missing(mocked_logger, mocked_keywords):
    try:
        mocked_keywords.get_on_session(alias=None)
    except TypeError:
        pass
    mocked_logger.warn.assert_called()


text:
package com.zimbra.soap.account.message;

import javax.xml.bind.annotation.XmlRootElement;

import com.zimbra.common.soap.AccountConstants;

/**
 * @zm-api-command-auth-required true
 * @zm-api-command-admin-auth-required false
 * @zm-api-command-description Get the anti-spam WhiteList and BlackList addresses
 */
@XmlRootElement(name=AccountConstants.E_GET_WHITE_BLACK_LIST_REQUEST)
public class GetWhiteBlackListRequest {
}


text:
var socket = io();
var UID = "";

// SETUP

socket.on("connect", function(){
	console.log("connected");

	if(!localStorage.getItem('gameUniqueId')){
		UID = Math.random().toString(36).substring(3,16) + +new Date;
		localStorage.setItem('gameUniqueId', UID);
	} else {
		UID = localStorage.getItem('gameUniqueId');
	}

	socket.emit('register', { id: localStorage.getItem('gameUniqueId'), lang: $.cookie("lang") });
	console.log("sent: " + localStorage.getItem('gameUniqueId'));
});

socket.on("ReplacePage", function(data) {
	$("body").html(data);
});

socket.on("Login-error", function(data) {
	$("#loginError").show();
	$("#loginError").html(data);
});

// Game setup

socket.on("loadStyles", function(data){
	console.log(data);

	for(var i = 0; i < data.length; i++){
		var styles = document.createElement('link');
	    styles.type="text/css";
	    styles.rel="stylesheet";
	    styles.href="./"+ data[i];
	    document.head.appendChild(styles);
   }
});

socket.on("removeStyles", function(data){
	console.log(data);
	for(var i = 0; i < data.length; i++){
		$('link[rel=stylesheet][href~="./'+ data[i] +'"]').remove();
   }
});

// Stats

socket.on("Count-players", function(data){
	$("#activeplayers").html(data);
});

socket.on("Count-rooms", function(data){
	$("#activerooms").html(data);
});

// Sounds

var soundEffects = [];
var music;

socket.on("music-play", function(data){
	music = new Audio(data.clip);
	music.play();
});

socket.on("music-stop", function(){
	music.stop();
	music = null;
});

socket.on("music-pausePlay", function(data){
	if(data.pause){
		music.pause();
	}
	else {
		music.play();
	}
});

socket.on("soundEfct-play", function(data){

	console.log("Effect: " + data.key);

	for(var i = 0; i < soundEffects.length; i++){
		if(soundEffects[i].key === data.id){
			soundEffects[i].clip.currentTime=0;
			soundEffects[i].clip.play();

			return;
		}
	}

	soundEffects.push({
		key: data.id,
		clip: new Audio(data.clip)
	});

	soundEffects[soundEffects.length - 1].clip.play();

});

socket.on("soundEfct-stop", function(data){

	if(data.id != null){
		for(var i = 0; i < soundEffects.length; i++){
			if(soundEffects[i].key === data.id){
				soundEffects[i].clip.stop();

				return;
			}
		}
	}
	else
	{
		for(var i = 0; i < soundEffects.length; i++){
			soundEffects[i].clip.stop();
		}
	}

});

socket.on("end-game", function(){
	music = null;
	soundEffects = [];
});

// Joining

function createRoom(){
	socket.emit('create', $('input[name="name"]').val());
}

function joinRoom(){
	socket.emit('join', {name: $('input[name="name"]').val(), code: $('input[name="code"]').val()});
}

// Lobby

socket.on("room-lobby-update", function(data){
	console.log(data.message);

	var players = "";

	for(var i = 0; i < data.players.length; i++){
		players += "
" +
					"" + data.players[i].name +
					"" + data.players[i].score +
					" Wins"+
					""+ numberSuffix(i+1) +"
"+
					"

";
	}

	$('#lobby-players').html(players);
	$('#playerCount').html(data.players.length + "/" + data.maxPlayers + " Players:");

	if(data.players.length >= data.minPlayers){
		$("#ready").html("Start Game");
		$("#ready").prop("disabled", false);
	} else {
		$("#ready").html("Start game: "+ data.players.length + "/" + data.minPlayers + " players required");
		$("#ready").prop("disabled", true);
	}

	if(data.ready){
		$('#ready').hide();
		$('#cancel').show();
	} else {
		$('#ready').show();
		$('#cancel').hide();
	}

	$('#selectedGame .mdc-card__media').css("background-image","url('"+data.game.headerimg+"')");
	$('#selectedGame .mdc-card__title').html(data.game.name);
	$('#selectedGame .mdc-card__subtitle').html(data.game.author);
	$('#selectedGame .mdc-card__supporting-text').html(data.game.summary);
	$('#selectedGame a').attr("href", data.game.link);
});

$(document).ready(function(){

	// COOKIES

	console.log("cookies");

	if(!$.cookie("lang")){
		console.log("cookie not found");
		var CookieSet = $.cookie("lang", "en", {
		   expires : 365,
		   path    : '/'
		   });
	}

	//

	window.onbeforeunload = confirmExit;

	function confirmExit()
	{
	  socket.emit("Disconnectme", UID);
	}

	mdc.autoInit();

	$(document).on("click", "#ready", function(){
		socket.emit("lobby-ready", UID);
		$('#ready').hide();
		$('#cancle').show();
	});

	$(document).on("click", "#cancel", function(){
		socket.emit("lobby-cancleReady", UID);
		$('#ready').show();
		$('#cancle').hide();
	});

	$(document).on("click", ".answer button", function(){
		socket.emit("game-answer", {uid: UID, answer: $(this).attr("value"), messageType: "answer"});
	});

	$(document).on("click", "#sendPicture", function(){
		console.log(document.getElementById("drawCanvas").toDataURL());
		socket.emit("game-answer", {
			uid: UID,
			answer: document.getElementById("drawCanvas").toDataURL(),
			messageType: "draw"
		});
	});

	$(document).on("click", "#drawAnswerSend", function(){

		if($('#drawAnswer').val() == "")
			return false;

		socket.emit("game-answer", {
			uid: UID,
			answer: $('#drawAnswer').val(),
			messageType: "suggestion"
		});
	});

	$(document).on("click", "#drawAnswer button", function(){
		console.log("sent: " + $(this).attr("val"));
		socket.emit("game-answer", {
			uid: UID,
			answer: $(this).attr("val"),
			messageType: "answer"
		});
	});

	$(document).on("click", "#gameChoice button", function(){
		console.log("sent");
		socket.emit("lobby-changeGame", {
			uid: UID,
			game: $(this).val()
		});

		$("button:disabled").html("Select game");
		$("button:disabled").prop('disabled', false);

		$(this).prop('disabled', true);
		$(this).html("Selected");
	});

	$(document).on("click", "#leaveroom", function(){

		location.reload();

		return false;

		console.log("sent");
		socket.emit("leaveroom", {
			uid: UID
		});

		$('#countdown-bar-bg').hide();
	});

	$(document).on("click", "#lang", function(){
		$('#langbox').show();
	});

	$(document).on("click", "#langbox li", function(){
		var CookieSet = $.cookie("lang", $(this).attr("val"), {
		   expires : 365,
		   path    : '/'
		   });

		   location.reload();
	});

});

// game

socket.on("game-timerbar", function(data) {
	$("#countdown-bar-bg").show();

	$("#countdown-bar").css({width: data.width + "%"});
	$("#countdown-bar-bg p").html(data.text);

	if(data.width <= 0){
		$("#countdown-bar-bg").hide();
	}
});

socket.on("trivia-panswer", function(data){
	console.log("Got answer: " + data);
	$("li[value='"+ data +"']").removeClass("no");
	$("li[value='"+ data +"']").addClass("yes");
});

// helpers

function numberSuffix(i) {
    var j = i % 10, k = i % 100;
    if (j == 1 && k != 11) {
        return i + "st";
    }
    if (j == 2 && k != 12) {
        return i + "nd";
    }
    if (j == 3 && k != 13) {
        return i + "rd";
    }
    return i + "th";
}


text:
class Tag < ApplicationRecord
  has_many :taggings, dependent: :destroy
  has_many :tasks, through: :taggings
  has_many :time_entries, through: :tasks
  belongs_to :user

  validates_presence_of :user_id, :name
end


text:
begin
  require 'midilib'
rescue Exception
end

module ChordieHow
  module Midi
    class MidiException < ChordieHowException; end
    class MidilibMissing < MidiException; end

    MIDI_SCALE = 0
    MIDI_CHORD = 1

    def to_midi options = {}
      if defined? MIDI
        options = {
          :notes => nil,
          :instrument => 'Acoustic Grand Piano',
          :strum => false,
          :key => nil
        }.merge options

        midi_type = case self.class.to_s
          when /::Scale$/
            MIDI_SCALE
          when /::Chord$/
            MIDI_CHORD
          else
            raise MidiException, "not really sure what to do at this point"
        end

        if !MIDI::GM_PATCH_NAMES.index(options[:instrument])
          raise MidiException, "can't find instrument '#{options[:instrument]}' in GM_PATCH_NAMES"
        end

        start = find_note_from_char(options[:key] || @key)

        if options[:notes]
          midi_notes = options[:notes]
        else
          midi_notes = case midi_type
            when MIDI_SCALE
              find_scale_intervals(@pattern)
            when MIDI_CHORD
              find_chord_type(@type)
          end
        end

        seq = MIDI::Sequence.new

        # The first track sets up the tempo and such.
        track = MIDI::Track.new seq
        seq.tracks << track
        track.events << MIDI::Tempo.new(MIDI::Tempo.bpm_to_mpq(120))
        track.events << MIDI::MetaEvent.new(MIDI::META_SEQ_NAME, 'Sequence Name')

        # This next track will hold our notes.
        track = MIDI::Track.new(seq)
        seq.tracks << track
        track.name = 'My New Track'
        track.instrument = options[:instrument]
        track.events << MIDI::Controller.new(0, MIDI::CC_VOLUME, 127)

        # Change to a piano bank.
        track.events << MIDI::ProgramChange.new(0, MIDI::GM_PATCH_NAMES.index(options[:instrument]), 0)

        # Quarter note length.
        qn = seq.note_to_delta('quarter')

        # This first little section plays each note individually.
        current_time = qn
        midi_notes.each do |offset|
          offset = start + offset
          e1 = MIDI::NoteOnEvent.new(0, 45 + offset, 127, 0)
          e2 = MIDI::NoteOffEvent.new(0, 45 + offset, 127, qn)
          e1.time_from_start = current_time
          e2.time_from_start = current_time + qn
          track.events << e1
          track.events << e2
          current_time += qn
        end

        if midi_type == MIDI_CHORD
          # This section plays the notes together. If options[:strum]
          # is set then we include a little delay between each note
          # in the chord to simulate the strumming action.
          if options[:strum]
            strum = 80
          else
            strum = 0
          end

          midi_notes.each_with_index do |offset, i|
            offset = start + offset
            e1 = MIDI::NoteOnEvent.new(0, 45 + offset, 127, 0)
            e2 = MIDI::NoteOffEvent.new(0, 45 + offset, 127, qn)
            e1.time_from_start = current_time + qn  + (strum * i)
            e2.time_from_start = current_time + (2 * qn)  + (strum * i)
            track.events << e1
            track.events << e2
          end
        end

        track.recalc_delta_from_times

        # We'll return the entire sequence as a MIDI::Seq object.
        return seq
      else
        raise MidilibMissing, "Can't find midilib extension"
      end
    end
  end
end


text:
package ru.job4j.max;

import org.junit.Test;

import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;
/**
 * Тест для класса Max.
 *
 * @author Alexander Eremeev (mailto:eremeev@gmail.com)
 * @version 1.1
 * @since 26.08.2017
 */
public class MaxTest {
    /**
     * Тест 2 > 1 = true.
     */
    @Test
    public void whenFirstLessSecond() {
        Max maxim = new Max();
        int result = maxim.max(1, 2);
        assertThat(result, is(2));
    }
    /**
     * Тест для проверки метода на числа.
     */
    @Test
    public void comparionsOfThreeNumbers() {
        Max maxim = new Max();
        int result = maxim.max(0, -5, 2);
        assertThat(result, is(2));
    }
}


text:
package org.apache.bsf.util;

import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;

import junit.framework.TestCase;

/**
 * This is testcase for the org.apache.bsf.util.IOUtils
 */

public class IOUtilsTest extends TestCase {

    static private final String lineSeparator =
        System.getProperty("line.separator","/n");

    public IOUtilsTest(final String name) {
        super(name);
    }

    public void testGetStringFromReader() throws IOException {
        String result;
        final StringWriter sw = new StringWriter();
        final PrintWriter pw = new PrintWriter(sw);

        pw.println("IOUtilsTest");
        pw.flush();

        final StringReader sr = new StringReader(sw.toString());
        result = IOUtils.getStringFromReader(sr);

        assertTrue(result.equals(("IOUtilsTest" + lineSeparator)));

        final File myFile = File.createTempFile("Test", "txt");

        final FileWriter fw = new FileWriter(myFile);
        final PrintWriter npw = new PrintWriter(fw);
        npw.println("file name : Test.txt");
        npw.flush();

        final FileReader fr = new FileReader(myFile);
        result = IOUtils.getStringFromReader(fr);

        assertTrue(result.equals(("file name : Test.txt" +
                                            lineSeparator)));
    }
}


text:
"""
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.

"""
import os
from ambari_commons import OSConst
from resource_management.core.resources.system import Directory, Execute, File
from resource_management.libraries.resources.xml_config import XmlConfig
from resource_management.libraries.resources.template_config import TemplateConfig
from resource_management.libraries.functions.format import format
from resource_management.core.source import Template, InlineTemplate
from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl

@OsFamilyFuncImpl(os_family=OSConst.WINSRV_FAMILY)
def hbase(name=None, action = None):
  import params
  Directory(params.hbase_conf_dir,
            owner = params.hadoop_user,
            create_parents = True
  )
  Directory(params.hbase_tmp_dir,
             create_parents = True,
             owner = params.hadoop_user
  )

  Directory (os.path.join(params.local_dir, "jars"),
             owner = params.hadoop_user,
             create_parents = True
  )

  XmlConfig("hbase-site.xml",
            conf_dir = params.hbase_conf_dir,
            configurations = params.config['configurations']['ams-hbase-site'],
            configuration_attributes=params.config['configuration_attributes']['ams-hbase-site'],
            owner = params.hadoop_user
  )

  if 'ams-hbase-policy' in params.config['configurations']:
    XmlConfig("hbase-policy.xml",
              conf_dir = params.hbase_conf_dir,
              configurations = params.config['configurations']['ams-hbase-policy'],
              configuration_attributes=params.config['configuration_attributes']['ams-hbase-policy'],
              owner = params.hadoop_user
    )
  # Manually overriding ownership of file installed by hadoop package
  else:
    File(os.path.join(params.hbase_conf_dir, "hbase-policy.xml"),
          owner = params.hadoop_user
    )

  # Metrics properties
  File(os.path.join(params.hbase_conf_dir, "hadoop-metrics2-hbase.properties"),
       owner = params.hbase_user,
       content=Template("hadoop-metrics2-hbase.properties.j2")
  )

  hbase_TemplateConfig('regionservers', user=params.hadoop_user)

  if params.security_enabled:
    hbase_TemplateConfig(format("hbase_{name}_jaas.conf"), user=params.hadoop_user)

  if name != "client":
    Directory (params.hbase_log_dir,
               owner = params.hadoop_user,
               create_parents = True
    )

  if (params.hbase_log4j_props != None):
    File(os.path.join(params.hbase_conf_dir, "log4j.properties"),
         owner=params.hadoop_user,
         content=params.hbase_log4j_props
    )
  elif (os.path.exists(os.path.join(params.hbase_conf_dir,"log4j.properties"))):
    File(os.path.join(params.hbase_conf_dir,"log4j.properties"),
         owner=params.hadoop_user
    )

@OsFamilyFuncImpl(os_family=OsFamilyImpl.DEFAULT)
def hbase(name=None # 'master' or 'regionserver' or 'client'
          , action=None):
  import params

  Directory(params.hbase_conf_dir,
      owner = params.hbase_user,
      group = params.user_group,
      create_parents = True,
      recursive_ownership = True,
  )

  Directory (params.hbase_tmp_dir,
             owner = params.hbase_user,
             cd_access="a",
             create_parents = True,
             recursive_ownership = True,
  )

  Directory (os.path.join(params.local_dir, "jars"),
             owner = params.hbase_user,
             group = params.user_group,
             cd_access="a",
             mode=0775,
             create_parents = True
  )

  if params.hbase_wal_dir:
    Directory(params.hbase_wal_dir,
              owner=params.hbase_user,
              group = params.user_group,
              cd_access="a",
              create_parents = True,
              recursive_ownership = True,
              )

  merged_ams_hbase_site = {}
  merged_ams_hbase_site.update(params.config['configurations']['ams-hbase-site'])
  if params.security_enabled:
    merged_ams_hbase_site.update(params.config['configurations']['ams-hbase-security-site'])

  if not params.is_hbase_distributed:
    File(format("{hbase_conf_dir}/core-site.xml"),
         action='delete',
         owner=params.hbase_user)

    File(format("{hbase_conf_dir}/hdfs-site.xml"),
         action='delete',
         owner=params.hbase_user)

  XmlConfig("hbase-site.xml",
            conf_dir = params.hbase_conf_dir,
            configurations = merged_ams_hbase_site,
            configuration_attributes=params.config['configuration_attributes']['ams-hbase-site'],
            owner = params.hbase_user,
            group = params.user_group
  )

  # Phoenix spool file dir if not /tmp
  if not os.path.exists(params.phoenix_server_spool_dir):
    Directory(params.phoenix_server_spool_dir,
              owner=params.ams_user,
              mode = 0755,
              group=params.user_group,
              cd_access="a",
              create_parents = True
    )
  pass

  if 'ams-hbase-policy' in params.config['configurations']:
    XmlConfig("hbase-policy.xml",
            conf_dir = params.hbase_conf_dir,
            configurations = params.config['configurations']['ams-hbase-policy'],
            configuration_attributes=params.config['configuration_attributes']['ams-hbase-policy'],
            owner = params.hbase_user,
            group = params.user_group
    )
  # Manually overriding ownership of file installed by hadoop package
  else:
    File( format("{params.hbase_conf_dir}/hbase-policy.xml"),
      owner = params.hbase_user,
      group = params.user_group
    )

  File(format("{hbase_conf_dir}/hbase-env.sh"),
       owner = params.hbase_user,
       content=InlineTemplate(params.hbase_env_sh_template)
  )

  # Metrics properties
  File(os.path.join(params.hbase_conf_dir, "hadoop-metrics2-hbase.properties"),
         owner = params.hbase_user,
         group = params.user_group,
         content=Template("hadoop-metrics2-hbase.properties.j2")
    )

  # hbase_TemplateConfig( params.metric_prop_file_name,
  #   tag = 'GANGLIA-MASTER' if name == 'master' else 'GANGLIA-RS'
  # )

  hbase_TemplateConfig('regionservers', user=params.hbase_user)

  if params.security_enabled:
    hbase_TemplateConfig( format("hbase_{name}_jaas.conf"), user=params.hbase_user)
    hbase_TemplateConfig( format("hbase_client_jaas.conf"), user=params.hbase_user)
    hbase_TemplateConfig( format("ams_zookeeper_jaas.conf"), user=params.hbase_user)

  if name != "client":
    Directory( params.hbase_pid_dir,
               owner = params.hbase_user,
               create_parents = True,
               cd_access = "a",
               mode = 0755,
    )

    Directory (params.hbase_log_dir,
               owner = params.hbase_user,
               create_parents = True,
               cd_access = "a",
               mode = 0755,
    )

  if name == "master":

    if not params.is_local_fs_rootdir:
      # If executing Stop All, HDFS is probably down
      if action != 'stop' and not params.skip_create_hbase_root_dir:

        params.HdfsResource(params.hbase_root_dir,
                             type="directory",
                             action="create_on_execute",
                             owner=params.hbase_user,
                             mode=0775,
                             dfs_type=params.dfs_type
        )

        params.HdfsResource(params.hbase_staging_dir,
                             type="directory",
                             action="create_on_execute",
                             owner=params.hbase_user,
                             mode=0711,
                             dfs_type=params.dfs_type
        )

        params.HdfsResource(None, action="execute")

      if params.is_hbase_distributed:
        #Workaround for status commands not aware of operating mode
        File(format("{params.hbase_pid_dir}/distributed_mode"), action="create", mode=0644, owner=params.hbase_user)

      pass

    else:

      local_root_dir = params.hbase_root_dir
      #cut protocol name
      if local_root_dir.startswith("file://"):
        local_root_dir = local_root_dir[7:]
        #otherwise assume dir name is provided as is

      Directory(local_root_dir,
                owner = params.hbase_user,
                cd_access="a",
                create_parents = True,
                recursive_ownership = True
      )

      File(format("{params.hbase_pid_dir}/distributed_mode"), action="delete", owner=params.hbase_user)

  if params.hbase_log4j_props is not None:
    File(format("{params.hbase_conf_dir}/log4j.properties"),
         mode=0644,
         group=params.user_group,
         owner=params.hbase_user,
         content=InlineTemplate(params.hbase_log4j_props)
    )
  elif os.path.exists(format("{params.hbase_conf_dir}/log4j.properties")):
    File(format("{params.hbase_conf_dir}/log4j.properties"),
      mode=0644,
      group=params.user_group,
      owner=params.hbase_user
    )

def hbase_TemplateConfig(name, tag=None, user=None):
  import params

  TemplateConfig( os.path.join(params.hbase_conf_dir, name),
      owner = user,
      template_tag = tag
  )


text:
001
018
019    package org.apache.hadoop.mapreduce.lib.db;
020
021    import java.sql.ResultSet;
022    import java.sql.SQLException;
023    import java.util.ArrayList;
024    import java.util.List;
025
026    import org.apache.hadoop.classification.InterfaceAudience;
027    import org.apache.hadoop.classification.InterfaceStability;
028    import org.apache.hadoop.conf.Configuration;
029    import org.apache.hadoop.mapreduce.InputSplit;
030
031    /**
032     * Implement DBSplitter over boolean values.
033     */
034    @InterfaceAudience.Public
035    @InterfaceStability.Evolving
036    public class BooleanSplitter implements DBSplitter {
037      public List<InputSplit> split(Configuration conf, ResultSet results, String colName)
038          throws SQLException {
039
040        List<InputSplit> splits = new ArrayList<InputSplit>();
041
042        if (results.getString(1) == null && results.getString(2) == null) {
043          // Range is null to null. Return a null split accordingly.
044          splits.add(new DataDrivenDBInputFormat.DataDrivenDBInputSplit(
045              colName + " IS NULL", colName + " IS NULL"));
046          return splits;
047        }
048
049        boolean minVal = results.getBoolean(1);
050        boolean maxVal = results.getBoolean(2);
051
052        // Use one or two splits.
053        if (!minVal) {
054          splits.add(new DataDrivenDBInputFormat.DataDrivenDBInputSplit(
055              colName + " = FALSE", colName + " = FALSE"));
056        }
057
058        if (maxVal) {
059          splits.add(new DataDrivenDBInputFormat.DataDrivenDBInputSplit(
060              colName + " = TRUE", colName + " = TRUE"));
061        }
062
063        if (results.getString(1) == null || results.getString(2) == null) {
064          // Include a null value.
065          splits.add(new DataDrivenDBInputFormat.DataDrivenDBInputSplit(
066              colName + " IS NULL", colName + " IS NULL"));
067        }
068
069        return splits;
070      }
071    }


text:
/**
// ==UserScript==
// @name WoW Board Helpers (Injector Helper)
// @description UserScript for the official WoW forum
// @match http://eu.battle.net/wow/fr/forum/*
// @match http://eu.battle.net/wow/en/forum/*
// @match http://us.battle.net/wow/en/forum/*
// @author Tel
// @version 0.0.1
// @run-at document-end
// ==/UserScript==
*
* This file is an injector for Wow Board Helpers.
* Basically, Chrome 27+ forbids us to mess with
* real window "because security" (crbug.com/222652).
* Which is stupid since FF/Grease got no problems.
* Anyway, this is a pain for me (Tel) because I
* need to paste the script into my dropbox
* everytime I edit it (symlinks won't work).
*/

setTimeout(function () {
	// not sure if I should be using salt.
	// Kinda breaks caching, eh.
	var salt = Math.round(Math.random() * 1000000)

	var script = document.createElement('script')
	script.src = "http://localhost/wowboardhelpers/wowboardhelpers.user.js?"+salt

	document.head.insertBefore(script, document.head.firstChild)
}, 100);


text:
package org.hl7.rim;

import org.hl7.rim.Act;
import org.hl7.types.PQ;
import org.hl7.types.IVL;
import org.hl7.types.TS;

import /*org.hl7.rim.AssociationSet*/java.util.List;

/**
An act that involves provision of a material by one entity to another.

Discussion: The product is associated with the Supply Act via Participation.typeCode="product". With general Supply Acts, the precise
   identification of the Material (manufacturer, serial numbers, etc.) is important. Most of the detailed information about the
   Supply should be represented using the Material class. If delivery needs to be scheduled, tracked, and billed separately,
   one can associate a Transportation Act with the Supply Act. Pharmacy dispense services are represented as Supply Acts, associated
   with a SubstanceAdministration Act. The SubstanceAdministration class represents the administration of medication, while dispensing
   is supply.

Examples: Ordering bed sheets; Dispensing of a drug; Issuing medical supplies from storage

*/
public interface Supply extends org.hl7.rim.Act {

  /**
The amount that was or is to be supplied (depending on the moodCode)

Discussion: This attribute may be used as an alternative to expectedUseTime or both may be used. If both are specified, then the specified
   quantity is the amount expected to be consumed within the expectedUseTime.

The unit of measure is restricted to a measured unit such as milliliter and milligram. Non-measured, but countable units such
   as tablet and capsule must not be specified using the unit component of the PQ data type, except as an annotation, marked
   by {xxx}. Refer to Data Types Part II Unabridged Specification, Appendix A: Unified Code for Units of Measure. The type of
   'countable' information is determined by information in the 'product' entity.

  */
  PQ getQuantity();
  /** Sets the property quantity.
      @see #getQuantity
  */
  void setQuantity(PQ quantity);

  /**
Identifies the period time over which the supplied product is expected to be used, or the length of time the supply is expected
   to last.

In some situations, this attribute may be used instead of Supply.quantity to identify the amount supplied by how long it is
   expected to last, rather than the physical quantity issued. E.g. 90 days supply of medication (based on an ordered dosage),
   10 hours of jet fuel, etc. NOTE: When possible, it is always better to specify Supply.quantity, as this tends to be more precise.
   Supply.expectedUseTime will always be an estimate that can be influenced by external factors.

  */
  IVL<TS> getExpectedUseTime();
  /** Sets the property expectedUseTime.
      @see #getExpectedUseTime
  */
  void setExpectedUseTime(IVL<TS> expectedUseTime);
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Docums Mycol. 31(no. 121): 55 (2001)

#### Original name
Cantharellus cibarius var. defibulatus Heinem., 1966

### Remarks
null


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Catillaria subnitida Hellb.

### Remarks
null


text:
package org.jetbrains.plugins.scala.util

import java.io.File

object JarUtil {

  case class JarFileWithName(file: File, name: String)

  final val JarExtension = ".jar"

  def collectJars(files: Seq[File]): Seq[JarFileWithName] =
    for {
      file <- files
      name = file.getName
      if name.endsWith(JarExtension)
    } yield JarFileWithName(file, name)
}


text:
permalink: /de/kapital.html
redirect: /de/
layout: redirect
sitemap: false
---


text:
#ifndef BOOST_PHOENIX_SCOPE_HPP
#define BOOST_PHOENIX_SCOPE_HPP

#include <boost/phoenix/version.hpp>
#include <boost/phoenix/scope/scoped_environment.hpp>
#include <boost/phoenix/scope/lambda.hpp>
#include <boost/phoenix/scope/let.hpp>
#include <boost/phoenix/scope/local_variable.hpp>

#endif