text:
#include "config.h"

#include <glib.h>
#include <string.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/dissectors/packet-rpc.h>
#include "packet-gmetric.h"

static int proto_gmetric = -1;
static int hf_gmetric_pdu_type = -1;
static int hf_gmetric_hostname = -1;
static int hf_gmetric_metric_name = -1;
static int hf_gmetric_spoofed = -1;
static int hf_gmetric_metric_type = -1;
static int hf_gmetric_metric_name2 = -1;
static int hf_gmetric_metric_units = -1;
static int hf_gmetric_slope = -1;
static int hf_gmetric_tmax = -1;
static int hf_gmetric_dmax = -1;
static int hf_gmetric_xd_key = -1;
static int hf_gmetric_xd_value = -1;
static int hf_gmetric_format = -1;
static int hf_gmetric_data_float = -1;
static int hf_gmetric_data_double = -1;
static int hf_gmetric_data_int = -1;
static int hf_gmetric_data_uint = -1;
static int hf_gmetric_data_str = -1;

static gint ett_gmetric = -1;
static gint ett_gmetric_xd = -1;

static const value_string packettypenames[] = {
    { 128,   "Metadata full" },
    { 128+1, "Metric (ushort)" },
    { 128+2, "Metric (short)" },
    { 128+3, "Metric (int)" },
    { 128+4, "Metric (uint)" },
    { 128+5, "Metric (string)" },
    { 128+6, "Metric (float)" },
    { 128+7, "Metric (double)" },
    { 128+8, "Metadata request" },
    { 0, NULL }
};

static const value_string slopetypenames[] = {
    { 0, "Zero"},
    { 1, "Positive"},
    { 2, "Negative"},
    { 3, "Both"},
    { 4, "Unspecified"}
};

static int
gmetric_dissect_xd(tvbuff_t *tvb, int offset, packet_info *pinfo,
        proto_tree *tree)
{
    //proto_item *xd_item;
    //proto_tree *xd_tree;
    //int start_offset = offset;

    //xd_item = proto_tree_add_text(tree, tvb, offset, -1, "Extra data");
    //xd_tree = proto_item_add_subtree(xd_item, ett_gmetric_xd);

    offset = dissect_rpc_string(tvb, tree, hf_gmetric_xd_key, offset, NULL);
    offset = dissect_rpc_string(tvb, tree, hf_gmetric_xd_value, offset, NULL);

    //proto_item_set_len(xd_item, offset - start_offset);

    return offset;
}

static int
dissect_gmetric_metric_id(tvbuff_t *tvb, proto_tree *gmetric_tree, int offset)
{
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_hostname,
            offset, NULL);
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_metric_name,
            offset, NULL);
    offset = dissect_rpc_bool(tvb, gmetric_tree, hf_gmetric_spoofed, offset);

    return offset;
}

static int
dissect_gmetric_metadata_message(tvbuff_t *tvb, packet_info *pinfo,
        proto_tree *gmetric_tree, int offset)
{
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_metric_type,
            offset, NULL);
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_metric_name2,
            offset, NULL);
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_metric_units,
            offset, NULL);
    offset = dissect_rpc_uint32(tvb, gmetric_tree, hf_gmetric_slope, offset);
    offset = dissect_rpc_uint32(tvb, gmetric_tree, hf_gmetric_tmax, offset);
    offset = dissect_rpc_uint32(tvb, gmetric_tree, hf_gmetric_dmax, offset);

    //guint32 extra_data = tvb_get_ntohl(tvb, offset);
    //offset = dissect_rpc_uint32(tvb, gmetric_tree, hf_gmetric_extra_data,
    //      offset);
    offset =  dissect_rpc_list(tvb, pinfo, gmetric_tree, offset,
            gmetric_dissect_xd);

    return offset;
}

static int
dissect_gmetric_metric_ushort(tvbuff_t *tvb, proto_tree *gmetric_tree,
        int offset)
{
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_format, offset,
            NULL);
    offset = dissect_rpc_uint32(tvb, gmetric_tree, hf_gmetric_data_uint,
            offset);

    return offset;
}

static int
dissect_gmetric_metric_short(tvbuff_t *tvb, proto_tree *gmetric_tree,
        int offset)
{
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_format, offset,
            NULL);
    offset = dissect_rpc_uint32(tvb, gmetric_tree, hf_gmetric_data_int,
            offset);

    return offset;
}

static int
dissect_gmetric_metric_int(tvbuff_t *tvb, proto_tree *gmetric_tree,
        int offset)
{
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_format, offset,
            NULL);
    offset = dissect_rpc_uint32(tvb, gmetric_tree, hf_gmetric_data_int,
            offset);

    return offset;
}

static int
dissect_gmetric_metric_uint(tvbuff_t *tvb, proto_tree *gmetric_tree,
        int offset)
{
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_format, offset,
            NULL);
    offset = dissect_rpc_uint32(tvb, gmetric_tree, hf_gmetric_data_uint,
            offset);

    return offset;
}

static int
dissect_gmetric_metric_string(tvbuff_t *tvb, proto_tree *gmetric_tree,
        int offset)
{
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_format, offset,
            NULL);
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_data_str,
            offset, NULL);

    return offset;
}

static int
dissect_gmetric_metric_float(tvbuff_t *tvb, proto_tree *gmetric_tree,
        int offset)
{
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_format, offset,
            NULL);
    proto_tree_add_item(gmetric_tree, hf_gmetric_data_float, tvb, offset, 4,
            ENC_BIG_ENDIAN);
    offset += 4;

    return offset;
}

static int
dissect_gmetric_metric_double(tvbuff_t *tvb, proto_tree *gmetric_tree,
        int offset)
{
    offset = dissect_rpc_string(tvb, gmetric_tree, hf_gmetric_format, offset,
            NULL);
    proto_tree_add_item(gmetric_tree, hf_gmetric_data_double, tvb, offset, 8,
            ENC_BIG_ENDIAN);
    offset += 8;

    return offset;
}

static void
dissect_gmetric(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
    guint32 packet_type = tvb_get_ntohl(tvb, 0);

    col_set_str(pinfo->cinfo, COL_PROTOCOL, "gmetric");
    /* Clear out stuff in the info column */
    col_clear(pinfo->cinfo,COL_INFO);

    col_add_fstr(pinfo->cinfo, COL_INFO, "Type %s",
             val_to_str(packet_type, packettypenames, "Unknown (0x%02x)"));

    if (tree) { /* we are being asked for details */
        proto_item *ti = NULL;
        proto_tree *gmetric_tree = NULL;
        gint offset = 0;

        ti = proto_tree_add_item(tree, proto_gmetric, tvb, 0, -1, ENC_NA);

        proto_item_append_text(ti, ", Type %s",
            val_to_str(packet_type, packettypenames, "Unknown (0x%02x)"));

        gmetric_tree = proto_item_add_subtree(ti, ett_gmetric);

        offset = dissect_rpc_uint32(tvb, gmetric_tree, hf_gmetric_pdu_type,
                offset);

        if (packet_type == 128) {
            offset = dissect_gmetric_metric_id(tvb, gmetric_tree, offset);
            offset = dissect_gmetric_metadata_message(tvb, pinfo,
                    gmetric_tree, offset);
        }
        else if (packet_type == 128+1) {
            offset = dissect_gmetric_metric_id(tvb, gmetric_tree, offset);
            offset = dissect_gmetric_metric_ushort(tvb, gmetric_tree, offset);
        }
        else if (packet_type == 128+2) {
            offset = dissect_gmetric_metric_id(tvb, gmetric_tree, offset);
            offset = dissect_gmetric_metric_short(tvb, gmetric_tree, offset);
        }
        else if (packet_type == 128+3) {
            offset = dissect_gmetric_metric_id(tvb, gmetric_tree, offset);
            offset = dissect_gmetric_metric_int(tvb, gmetric_tree, offset);
        }
        else if (packet_type == 128+4) {
            offset = dissect_gmetric_metric_id(tvb, gmetric_tree, offset);
            offset = dissect_gmetric_metric_uint(tvb, gmetric_tree, offset);
        }
        else if (packet_type == 128+5) {
            offset = dissect_gmetric_metric_id(tvb, gmetric_tree, offset);
            offset = dissect_gmetric_metric_string(tvb, gmetric_tree, offset);
        }
        else if (packet_type == 128+6) {
            offset = dissect_gmetric_metric_id(tvb, gmetric_tree, offset);
            offset = dissect_gmetric_metric_float(tvb, gmetric_tree, offset);
        }
        else if (packet_type == 128+7) {
            offset = dissect_gmetric_metric_id(tvb, gmetric_tree, offset);
            offset = dissect_gmetric_metric_double(tvb, gmetric_tree, offset);
        }
        else if (packet_type == 128+8)
            offset = dissect_gmetric_metric_id(tvb, gmetric_tree, offset);
    }
}

void
proto_register_gmetric(void)
{
    /* Setup list of header fields  See Section 1.6.1 for details */
    static hf_register_info hf[] = {
        { &hf_gmetric_pdu_type,
            { "gmetric PDU Type", "gmetric.type",
            FT_UINT32, BASE_DEC,
            VALS(packettypenames), 0x0,
            NULL, HFILL }
        },
        { &hf_gmetric_hostname,
            { "Hostname", "gmetric.hostname",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_metric_name,
            { "Metric name", "gmetric.metric_name",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_spoofed,
            { "Spoofed", "gmetric.spoofed",
                FT_BOOLEAN, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        /* Metadata packet specific */
        { &hf_gmetric_metric_type,
            { "Metric type", "gmetric.metric_type",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_metric_name2,
            { "Metric name 2", "gmetric.metric_name2",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_metric_units,
            { "Metric units", "gmetric.metric_units",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_slope,
            { "Slope", "gmetric.slope",
                FT_UINT32, BASE_DEC,
                VALS(slopetypenames), 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_tmax,
            { "TMAX", "gmetric.tmax",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_dmax,
            { "DMAX", "gmetric.dmax",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_xd_key,
            { "Extra data key", "gmetric.xd_key",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_xd_value,
            { "Extra data value", "gmetric.xd_value",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        /* Data packet specific */
        { &hf_gmetric_format,
            { "Format", "gmetric.format",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_data_float,
            { "Data", "gmetric.data",
                FT_FLOAT, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_data_double,
            { "Data", "gmetric.data",
                FT_DOUBLE, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_data_int,
            { "Data", "gmetric.data",
                FT_INT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_data_uint,
            { "Data", "gmetric.data",
                FT_UINT32, BASE_DEC,
                NULL, 0x0,
                NULL, HFILL }
        },
        { &hf_gmetric_data_str,
            { "Data", "gmetric.data",
                FT_STRING, BASE_NONE,
                NULL, 0x0,
                NULL, HFILL }
        },
    };

    /* Setup protocol subtree array */
    static gint *ett[] = {
        &ett_gmetric,
        &ett_gmetric_xd
    };

    /* Register the protocol name and description */
    proto_gmetric = proto_register_protocol (
        "Ganglia Metric Protocol", /* name       */
        "gmetric",                  /* short name */
        "gmetric"                   /* abbrev     */
        );

    proto_register_field_array(proto_gmetric, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
}

void
proto_reg_handoff_gmetric(void)
{
    static dissector_handle_t gmetric_handle;

    gmetric_handle = create_dissector_handle(dissect_gmetric, proto_gmetric);
    dissector_add_uint("udp.port", GMETRIC_PORT, gmetric_handle);
}


text: export * from './frame-extraction.service';

redpajama_set_name: RedPajamaGithub


text:
using AkkaPingPong.AkkaTestBase;
using AkkaPingPong.ASLTestKit.Mocks;
using AkkaPingPong.Common;
using AkkaPingPong.Core.Actors;
using AkkaPingPong.Core.Messages;
using Autofac;
using System;
using Xunit;

namespace AkkaPingPong.Tests
{
    public class when_it_gets_a_ping : TestKitTestBase
    {
        [Fact]
        public void it_should_do_a_pong()
        {
            //Arrange
            MockFactory.UpdateContainer((builder) =>
            {
                builder.Register<IPingPongService>(b => new FakePingPongService());
            });
            MockFactory.CreateActor<PingPongActor<MockActor>>();

            //Act
            MockFactory.LocateActor(typeof(PingPongActor<>)).Tell(new PingMessage());

            //Assert
            AwaitAssert(() => ExpectMsg<PingMessageCompleted>(), TimeSpan.FromSeconds(5));
        }

        [Fact]
        public void it_should_do_a_pong_integration()
        {
            //Arrange
            //var container = new ContainerBuilder().Build();
            // mockFactory = new AkkaMockFactory(container, Sys);
            MockFactory.UpdateContainer((builder) =>
            {
                builder.Register<IPingPongService>(b => new FakePingPongService());
            });
            MockFactory.CreateActor<PingPongActor<PingCoordinatorActor<PingActor, PingBlockingActor>>>();

            //Act
            for (var i = 0; i < 10; i++)
            {
                System.Threading.Thread.Sleep(1000);
                MockFactory.LocateActor(typeof(PingPongActor<>)).Tell(new PingMessage());
            }

            //Assert
            AwaitAssert(() => ExpectMsg<PongMessage>(), TimeSpan.FromSeconds(20));
        }

        [Fact]
        public void it_should_do_a_pong_unit1()
        {
            // var container = new ContainerBuilder().Build();
            //  mockFactory = new AkkaMockFactory(container, Sys);
            MockFactory.UpdateContainer((builder) =>
            {
                builder.Register<IPingPongService>(b => new FakePingPongService());
            });
            //Arrange
            MockFactory.CreateActor<PingPongActor<MockActor>>();

            //Act
            for (var i = 0; i < 10; i++)
            {
                System.Threading.Thread.Sleep(1000);

                MockFactory.LocateActor(typeof(PingPongActor<>)).Tell(new PingMessage());
            }

            //Assert
            AwaitAssert(() => ExpectMsg<PingMessageCompleted>(), TimeSpan.FromSeconds(20));
        }

        [Fact]
        public void it_should_do_a_pong_unit2()
        {
            // var container = new ContainerBuilder().Build();
            //  mockFactory = new AkkaMockFactory(container, Sys);
            MockFactory.UpdateContainer((builder) =>
            {
                builder.Register<IPingPongService>(b => new FakePingPongService());
            });
            //Arrange
            MockFactory.CreateActor<PingCoordinatorActor<MockActor1, MockActor2>>();

            //Act
            MockFactory.LocateActor(typeof(PingCoordinatorActor<,>)).Tell(new PingMessage());

            //Assert
            AwaitAssert(() => ExpectMsg<SorryImStashing>(), TimeSpan.FromSeconds(20));
        }
    }
}


text:
<?php
require_once("base.php");

class HumidityHandler extends Base_Controller
{
	function get() {
		$arduigrow = new ArduiGrow_Model;
		/* render view  */
		$this->render('humidity',
			array('humidity' => $arduigrow->series('humidity')));
	}
}


text:
require 'spec_helper'

describe "Model create" do
  it "should record a create event" do
    parent = Parent.new({name: "First Create Test"})
    parent.save

    parent.versions.count.should eq 1
    parent.versions.last.event.should eq "create"
  end
end


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

    <ImageView
        android:id="@+id/iv_ml"
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:adjustViewBounds="true"
        android:scaleType="fitCenter"
        android:src="@android:drawable/ic_menu_gallery" />

    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <TableRow
            android:id="@+id/tableRow1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center" >

            <TextView
                android:id="@+id/tv_ml_descripcion"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/editarlugar_descripcion" />

        </TableRow>
    </TableLayout>

    <TableLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

        <TableRow
            android:id="@+id/tableRow2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center" >

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content" >

                <TextView
                    android:id="@+id/textView1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/at"
                    android:textAppearance="?android:attr/textAppearanceMedium" />

                <TextView
                    android:id="@+id/tv_ml_nombre"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/editarlugar_localizacion" />
            </LinearLayout>
        </TableRow>

    </TableLayout>

    <Button
        android:id="@+id/bt_ml_editar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/crudname_edit" />

</LinearLayout>


text: ActiveRecord::Base.send :include, ActiveRecord::Acts::NestedSet


text:
from django.shortcuts import get_object_or_404, render_to_response
from django.contrib.auth.decorators import login_required, permission_required
from django.http import HttpResponseRedirect, Http404
from django.core.urlresolvers import reverse
from django.db import connection
from django.template import RequestContext

from wallet import models as wallet

@permission_required('wallet.can_view_wallet_report')
def wallet_report(request):
    cursor = connection.cursor()
    context = {}
    cursor.execute("SELECT SUM(value) FROM wallet_transaction")
    context['totals'] = []
    context['totals'].append(('Total', cursor.fetchone()[0]))
    cursor.execute("SELECT SUM(value) FROM wallet_transaction WHERE VALUE > 0.0")
    context['totals'].append(('Deposit Total', cursor.fetchone()[0]))
    cursor.execute("SELECT SUM(value) FROM wallet_transaction WHERE VALUE < 0.0")
    context['totals'].append(('Withdraw Total', cursor.fetchone()[0]))
    cursor.execute("""SELECT u.username, SUM(t.value) as sum
    FROM wallet_transaction t
    JOIN wallet_wallet w ON (w.id = t.wallet_id)
    JOIN auth_user u ON (u.id = w.user_id)
    GROUP BY u.username
    ORDER BY sum DESC""")
    context['users'] = cursor.fetchall()
    return render_to_response(
        'wallet/report.html',
        context,
        context_instance=RequestContext(request),
    )

@login_required
def deposit_return(request, option_id, invoice_id):
    option = get_object_or_404(wallet.PaymentOption, pk=option_id)
    try:
        invoice = request.user.wallet_invoices.get(
            id=invoice_id,
            option=option,
        )
    except wallet.Invoice.DoesNotExist:
        raise Http404
    request.user.message_set.create(message='Thank you for your payment!')
    if 'next' in request.GET:
        return HttpResponseRedirect(request.GET['next'])
    return HttpResponseRedirect('/')

@login_required
def deposit_cancel(request, option_id, invoice_id):
    option = get_object_or_404(wallet.PaymentOption, pk=option_id)
    try:
        invoice = request.user.wallet_invoices.get(
            id=invoice_id,
            option=option,
        )
    except wallet.Invoice.DoesNotExist:
        raise Http404
    request.user.message_set.create(message='Payment cancelled')
    return HttpResponseRedirect('/')


text:
#ifndef __SpringCat_Common_SmallObject__
#define __SpringCat_Common_SmallObject__

#include <BaseCat/System.h>

namespace SpringCat
{
    namespace Common
    {
        template<typename T>
        class SmallObject : private BaseCat::System::TL::NonCopyable
        {
        public:
            static void *operator new(size_t size)
            {
                if (size == 0)
                {
                    size = 1;
                }

                void *result = NULL;

#pragma warning(disable:4127)
                while (true)
#pragma warning(default:4127)
                {
                    result = BaseCat::System::MPHeap::Alloc(NULL, size);
                    if (result != NULL)
                    {
                        break;
                    }

                    std::new_handler newHandler = std::set_new_handler(0);
                    std::set_new_handler(newHandler);

                    if (newHandler != NULL)
                    {
                        (*newHandler)();
                    }
                    else
                    {
                        throw std::bad_alloc();
                    }
                }

                return result;
            }
            static void operator delete(void *p) throw()
            {
                if (p == NULL)
                {
                    return;
                }

                BaseCat::System::MPHeap::Free(NULL, p);
                p = NULL;
            }
        };
    }
}

#endif


text:
/* Fuzzed by practicalswift-fuzz.py */
@implementation a(b)+i{(<@){slf.d


text:
.. _reference-index:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The Varnish Reference Manual
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

.. toctree::

	vcl.rst
	varnish-cli.rst
	varnishadm.rst
	varnishd.rst
	varnishhist.rst
	varnishlog.rst
	varnishncsa.rst
	varnishreplay.rst
	varnishsizes.rst
	varnishstat.rst
	varnishtest.rst
	varnishtop.rst
	vsm.rst
	vmod.rst
	vmod_std.rst
	vsl.rst

.. todo::
        The programs:
        . varnishd manual page
        . varnishstat
        . - counters explained
        . common filtering options for shmlog tools
        . varnishlog ..
        . varnsihtop ..
        . varnsihncsa ..
        . varnsihhist ..
        The CLI:
        . connections: -T -S -M
        . varnishadm
        . CLI commands and what they do
        . - vcl.load
        . - stop
        . - start
        . - ...
        VCL language
        . The functions:
        . - vcl_recv
        . - vcl_miss
        . ---
        . The things you can do
        . - set
        . - unset
        . - esi
        . - rollback
        Varnishtest
        . syntax etc.
	Shared Memory
	. internals
	. Log records
	Libvarnishapi
	. function descriptions


text:
namespace Microsoft.Azure.Synapse
{
    using Microsoft.Rest;
    using Microsoft.Rest.Azure;
    using Models;
    using System.Threading;
    using System.Threading.Tasks;

    /// <summary>
    /// Extension methods for SparkSessionOperations.
    /// </summary>
    public static partial class SparkSessionOperationsExtensions
    {
            /// <summary>
            /// List all spark sessions which are running under a particular spark pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='fromParameter'>
            /// Optional param specifying which index the list should begin from.
            /// </param>
            /// <param name='size'>
            /// Optional param specifying the size of the returned list.
            /// By default it is 20 and that is the maximum.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            public static ExtendedLivyListSessionResponse List(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int? fromParameter = default(int?), int? size = default(int?), bool? detailed = default(bool?))
            {
                return operations.ListAsync(workspaceName, sparkPoolName, fromParameter, size, detailed).GetAwaiter().GetResult();
            }

            /// <summary>
            /// List all spark sessions which are running under a particular spark pool.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='fromParameter'>
            /// Optional param specifying which index the list should begin from.
            /// </param>
            /// <param name='size'>
            /// Optional param specifying the size of the returned list.
            /// By default it is 20 and that is the maximum.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ExtendedLivyListSessionResponse> ListAsync(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int? fromParameter = default(int?), int? size = default(int?), bool? detailed = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListWithHttpMessagesAsync(workspaceName, sparkPoolName, fromParameter, size, detailed, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Create new spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='livyRequest'>
            /// Livy compatible batch job request payload.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            public static ExtendedLivySessionResponse Create(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, ExtendedLivySessionRequest livyRequest, bool? detailed = default(bool?))
            {
                return operations.CreateAsync(workspaceName, sparkPoolName, livyRequest, detailed).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Create new spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='livyRequest'>
            /// Livy compatible batch job request payload.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ExtendedLivySessionResponse> CreateAsync(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, ExtendedLivySessionRequest livyRequest, bool? detailed = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateWithHttpMessagesAsync(workspaceName, sparkPoolName, livyRequest, detailed, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Gets a single spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            public static ExtendedLivySessionResponse Get(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, bool? detailed = default(bool?))
            {
                return operations.GetAsync(workspaceName, sparkPoolName, sessionId, detailed).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets a single spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='detailed'>
            /// Optional query param specifying whether detailed response is returned
            /// beyond plain livy.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<ExtendedLivySessionResponse> GetAsync(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, bool? detailed = default(bool?), CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetWithHttpMessagesAsync(workspaceName, sparkPoolName, sessionId, detailed, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Cancels a running spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand"
            /// targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            public static void Delete(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId)
            {
                operations.DeleteAsync(workspaceName, sparkPoolName, sessionId).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Cancels a running spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand"
            /// targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task DeleteAsync(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.DeleteWithHttpMessagesAsync(workspaceName, sparkPoolName, sessionId, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Sends a keep alive call to the current session to reset the session
            /// timeout.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand"
            /// targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            public static void ResetTimeout(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId)
            {
                operations.ResetTimeoutAsync(workspaceName, sparkPoolName, sessionId).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Sends a keep alive call to the current session to reset the session
            /// timeout.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand"
            /// targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task ResetTimeoutAsync(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, CancellationToken cancellationToken = default(CancellationToken))
            {
                (await operations.ResetTimeoutWithHttpMessagesAsync(workspaceName, sparkPoolName, sessionId, null, cancellationToken).ConfigureAwait(false)).Dispose();
            }

            /// <summary>
            /// Gets a list of statements within a spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            public static LivyStatementsResponseBody ListStatements(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId)
            {
                return operations.ListStatementsAsync(workspaceName, sparkPoolName, sessionId).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets a list of statements within a spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<LivyStatementsResponseBody> ListStatementsAsync(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.ListStatementsWithHttpMessagesAsync(workspaceName, sparkPoolName, sessionId, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Create statement within a spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='livyRequest'>
            /// Livy compatible batch job request payload.
            /// </param>
            public static LivyStatementResponseBody CreateStatement(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, LivyStatementRequestBody livyRequest)
            {
                return operations.CreateStatementAsync(workspaceName, sparkPoolName, sessionId, livyRequest).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Create statement within a spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='livyRequest'>
            /// Livy compatible batch job request payload.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<LivyStatementResponseBody> CreateStatementAsync(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, LivyStatementRequestBody livyRequest, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.CreateStatementWithHttpMessagesAsync(workspaceName, sparkPoolName, sessionId, livyRequest, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Gets a single statement within a spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='statementId'>
            /// Identifier for the statement.
            /// </param>
            public static LivyStatementResponseBody GetStatement(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, int statementId)
            {
                return operations.GetStatementAsync(workspaceName, sparkPoolName, sessionId, statementId).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Gets a single statement within a spark session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='statementId'>
            /// Identifier for the statement.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<LivyStatementResponseBody> GetStatementAsync(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, int statementId, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.GetStatementWithHttpMessagesAsync(workspaceName, sparkPoolName, sessionId, statementId, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

            /// <summary>
            /// Kill a statement within a session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='statementId'>
            /// Identifier for the statement.
            /// </param>
            public static LivyStatementCancellationResponse DeleteStatement(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, int statementId)
            {
                return operations.DeleteStatementAsync(workspaceName, sparkPoolName, sessionId, statementId).GetAwaiter().GetResult();
            }

            /// <summary>
            /// Kill a statement within a session.
            /// </summary>
            /// <param name='operations'>
            /// The operations group for this extension method.
            /// </param>
            /// <param name='workspaceName'>
            /// The name of the workspace to execute operations on.
            /// </param>
            /// <param name='sparkPoolName'>
            /// Name of the spark pool. "ondemand" targets the ondemand pool.
            /// </param>
            /// <param name='sessionId'>
            /// Identifier for the session.
            /// </param>
            /// <param name='statementId'>
            /// Identifier for the statement.
            /// </param>
            /// <param name='cancellationToken'>
            /// The cancellation token.
            /// </param>
            public static async Task<LivyStatementCancellationResponse> DeleteStatementAsync(this ISparkSessionOperations operations, string workspaceName, string sparkPoolName, int sessionId, int statementId, CancellationToken cancellationToken = default(CancellationToken))
            {
                using (var _result = await operations.DeleteStatementWithHttpMessagesAsync(workspaceName, sparkPoolName, sessionId, statementId, null, cancellationToken).ConfigureAwait(false))
                {
                    return _result.Body;
                }
            }

    }
}


text:
<TITLE>Review for From Russia with Love (1963)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

From Russia with Love (1963)

reviewed by
Steve Rhodes

                          FROM RUSSIA WITH LOVE
                     A film review by Steve Rhodes
                      Copyright 1998 Steve Rhodes

RATING (0 TO ****):  ***

     SPECTRE, up to its old tricks again in the second installment of
the Bond series, has its sights set on getting a Russian decoder called
a Lektor.  Their plan will require the demise of Mr. Bond, which is
just fine by their number 1.  (We never see number 1's face, only a
hand stroking a snow-white cat that perpetually sits in his lap.  The
credits list him as Ernst Blofeld, but put a "?" where the actor's name
should go.)

     In 1963's FROM RUSSIA WITH LOVE, SPECTRE lures Bond to Turkey
under the ruse that a beautiful young Russian woman named Tatiana
Romanova, played fetchingly by Daniela Bianchi, has possession of a
Lektor and is willing to turn it over to the West with one proviso.
The Western agent accepting it must be James Bond, played this time by
an even more confident Sean Connery than in DR. NO.  SPECTRE figures
Bond will smell a trap but that he will not be able to resist coming,
what with the chance of bedding a beautiful lass and getting a decoder
as a bonus prize.

     Tatiana, being a loyal Russian is similarly duped by former KGB
agent Rosa Klebb (Lotte Lenya) into thinking the operation is a Russian
one to trap Bond.  Actually Rosa is number 3 in the SPECTRE hierarchy.

     This is the first Bond film in which he gets his now normal
assortment of gadgets before his mission.  This time it's a relatively
simple briefcase with a tear gas canister, extra ammo, a rifle with an
infrared sight, a bunch of gold coins and a hidden knife.  The tear gas
canister, for example, explodes in the face of someone attempting to
break into the briefcase.  Although he does not get fancy cars this
time, he does get to have a big adventure on the famous Orient Express.

     Featured attractions of the Bond films are the exotic locales --
Istanbul and Venice are prominently featured this time, especially the
spires of their skylines which seem to reach for the heavens.  Along
with the images comes more great Bond music by composer John Barry.

     FROM RUSSIA WITH LOVE contains easily one of the hokiest scenes of
any Bond film.  Two gypsy girls -- they'd probably be referred to as
young women today -- engage in an incredibly fake wrestling match to
see who will win the honor of marrying the chief's son.  Fortuitously,
Robert Shaw, playing SPECTRE's chief hunk Red Grant, and his fellow
goons show up to shoot up the place in the hope of taking out Bond.
Surprise, Bond lives, but at least the wrestling farce is broken up.

     Unlike the first movie, DR. NO, which rarely flagged, this one has
too many slow parts that fail to keep the viewers' attention.  But any
Bond film starring Connery remains a delight to watch.

     In my favorite small scene, we learn of one of the few times that
Bond missed a clue.  "'Red wine with fish' that should have told me
something," Bond laments.  Clearly a character who orders red wine with
his fish should have been suspected right away.

     FROM RUSSIA WITH LOVE runs 1:50.  It is rated PG for violence and
sexual innuendo and would be fine for kids around nine and up.

     My son Jeffrey, almost 9, thought FROM RUSSIA WITH LOVE was a
really good movie but liked DR. NO, the only other Bond film he has
seen, much better.  And again, his only complaint was that it had too
much kissing.

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package in.testpress.testpress.ui;

import android.view.LayoutInflater;

import com.github.kevinsawicki.wishlist.SingleTypeAdapter;

import java.util.List;

import in.testpress.testpress.R;
import in.testpress.testpress.models.Exam;
import in.testpress.testpress.models.Notes;

public class NotesListAdapter extends SingleTypeAdapter<Notes> {
    /**
     * @param inflater
     * @param items
     */
    public NotesListAdapter(final LayoutInflater inflater, final List<Notes> items, int layout) {
        super(inflater, layout);
        setItems(items);
    }

    @Override
    protected int[] getChildViewIds() {
        return new int[]{R.id.title, R.id.description};
    }

    @Override
    protected void update(final int position, final Notes item) {
        setText(0, item.getTitle());
        if (item.getDescription().isEmpty()) {
            setText(1, "No description available");
        } else {
            setText(1, item.getDescription());
        }
    }
}


text:
// .NAME vtkLookupTable - map scalar values into colors via a lookup table
// .SECTION Description
// vtkLookupTable is an object that is used by mapper objects to map scalar
// values into RGBA (red-green-blue-alpha transparency) color specification,
// or RGBA into scalar values. The color table can be created by direct
// insertion of color values, or by specifying a hue, saturation, value, and
// alpha range and generating a table.
//
// A special color for NaN values in the data can be specified via
// SetNanColor(). In addition, a color for data values below the
// lookup table range minimum can be specified with
// SetBelowRangeColor(), and that color will be used for values below
// the range minimum when UseBelowRangeColor is on.  Likewise, a color
// for data values above the lookup table range maximum can be
// specified with SetAboveRangeColor(), and it is used when
// UseAboveRangeColor is on.
//
// This class behaves differently depending on how \a IndexedLookup is set.
// When true, vtkLookupTable enters a mode for representing categorical color maps.
// By setting \a IndexedLookup to true, you indicate that the annotated
// values are the only valid values for which entries in the color table
// should be returned. The colors in the lookup \a Table are assigned
// to annotated values by taking the modulus of their index in the list
// of annotations. \a IndexedLookup changes the behavior of \a GetIndex,
// which in turn changes the way \a MapScalarsThroughTable2 behaves;
// when \a IndexedLookup is true, \a MapScalarsThroughTable2 will search for
// scalar values in \a AnnotatedValues and use the resulting index to
// determine the color. If a scalar value is not present in \a AnnotatedValues,
// then \a NanColor will be used.
//
// .SECTION Caveats
// You need to explicitly call Build() when constructing the LUT by hand.
//
// .SECTION See Also
// vtkLogLookupTable vtkWindowLevelLookupTable

#ifndef vtkLookupTable_h
#define vtkLookupTable_h

#include "vtkCommonCoreModule.h" // For export macro
#include "vtkScalarsToColors.h"

#include "vtkUnsignedCharArray.h" // Needed for inline method

#define VTK_RAMP_LINEAR 0
#define VTK_RAMP_SCURVE 1
#define VTK_RAMP_SQRT 2
#define VTK_SCALE_LINEAR 0
#define VTK_SCALE_LOG10 1

class VTKCOMMONCORE_EXPORT vtkLookupTable : public vtkScalarsToColors
{
public:
  // Description:
  // Constants for offsets of special colors (e.g., NanColor, BelowRangeColor,
  // AboveRangeColor) from the maximum index in the lookup table.
  const static vtkIdType BELOW_RANGE_COLOR_INDEX;
  const static vtkIdType ABOVE_RANGE_COLOR_INDEX;
  const static vtkIdType NAN_COLOR_INDEX;
  const static vtkIdType NUMBER_OF_SPECIAL_COLORS;

  // Description:
  // Construct with range=[0,1]; and hsv ranges set up for rainbow color table
  // (from red to blue).
  static vtkLookupTable *New();

  vtkTypeMacro(vtkLookupTable,vtkScalarsToColors);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Return true if all of the values defining the mapping have an opacity
  // equal to 1.
  virtual int IsOpaque();

  // Description:
  // Allocate a color table of specified size.
  int Allocate(int sz=256, int ext=256);

  // Description:
  // Generate lookup table from hue, saturation, value, alpha min/max values.
  // Table is built from linear ramp of each value.
  virtual void Build();

  // Description:
  // Force the lookup table to regenerate from hue, saturation, value,
  // and alpha min/max values.  Table is built from a linear ramp of
  // each value.  ForceBuild() is useful if a lookup table has been
  // defined manually (using SetTableValue) and then an application
  // decides to rebuild the lookup table using the implicit process.
  virtual void ForceBuild();

  // Description:
  // Set the shape of the table ramp to either linear or S-curve.
  // The default is S-curve, which tails off gradually at either end.
  // The equation used for the S-curve is y = (sin((x - 1/2)*pi) + 1)/2,
  // while the equation for the linear ramp is simply y = x.  For an
  // S-curve greyscale ramp, you should set NumberOfTableValues to 402
  // (which is 256*pi/2) to provide room for the tails of the ramp.
  // The equation for the SQRT is y = sqrt(x).
  vtkSetMacro(Ramp,int);
  void SetRampToLinear() { this->SetRamp(VTK_RAMP_LINEAR); };
  void SetRampToSCurve() { this->SetRamp(VTK_RAMP_SCURVE); };
  void SetRampToSQRT() { this->SetRamp(VTK_RAMP_SQRT); };
  vtkGetMacro(Ramp,int);

  // Description:
  // Set the type of scale to use, linear or logarithmic.  The default
  // is linear.  If the scale is logarithmic, then the TableRange must not
  // cross the value zero.
  void SetScale(int scale);
  void SetScaleToLinear() { this->SetScale(VTK_SCALE_LINEAR); };
  void SetScaleToLog10() { this->SetScale(VTK_SCALE_LOG10); };
  vtkGetMacro(Scale,int);

  // Description:
  // Set/Get the minimum/maximum scalar values for scalar mapping. Scalar
  // values less than minimum range value are clamped to minimum range value.
  // Scalar values greater than maximum range value are clamped to maximum
  // range value.
  //
  // The \a TableRange values are only used when \a IndexedLookup is false.
  void SetTableRange(double r[2]);
  virtual void SetTableRange(double min, double max);
  vtkGetVectorMacro(TableRange,double,2);

  // Description:
  // Set the range in hue (using automatic generation). Hue ranges
  // between [0,1].
  vtkSetVector2Macro(HueRange,double);
  vtkGetVector2Macro(HueRange,double);

  // Description:
  // Set the range in saturation (using automatic generation). Saturation
  // ranges between [0,1].
  vtkSetVector2Macro(SaturationRange,double);
  vtkGetVector2Macro(SaturationRange,double);

  // Description:
  // Set the range in value (using automatic generation). Value ranges
  // between [0,1].
  vtkSetVector2Macro(ValueRange,double);
  vtkGetVector2Macro(ValueRange,double);

  // Description:
  // Set the range in alpha (using automatic generation). Alpha ranges from
  // [0,1].
  vtkSetVector2Macro(AlphaRange,double);
  vtkGetVector2Macro(AlphaRange,double);

  // Description:
  // Set the color to use when a NaN (not a number) is encountered.  This is an
  // RGBA 4-tuple of doubles in the range [0,1].
  vtkSetVector4Macro(NanColor, double);
  vtkGetVector4Macro(NanColor, double);

  // Description:
  // Return the \a NanColor as a pointer to 4 unsigned chars. This
  // will overwrite any data returned by previous calls to MapValue.
  unsigned char* GetNanColorAsUnsignedChars();

  // Description:
  // Cast a double color in a type T color. colorIn and colorOut are
  // expected to be RGBA[4] and colorIn to be in [0.0, 1.0]
  static void GetColorAsUnsignedChars(const double colorIn[4],
                                      unsigned char colorOut[4]);

  // Description:
  // Set the color to use when a value below the range is
  // encountered. This is an RGBA 4-tuple of doubles in the range [0, 1].
  vtkSetVector4Macro(BelowRangeColor, double);
  vtkGetVector4Macro(BelowRangeColor, double);

  // Description:
  // Set whether the below range color should be used.
  vtkSetMacro(UseBelowRangeColor, int);
  vtkGetMacro(UseBelowRangeColor, int);
  vtkBooleanMacro(UseBelowRangeColor, int);

  // Description:
  // Set the color to use when a value above the range is
  // encountered. This is an RGBA 4-tuple of doubles in the range [0, 1].
  vtkSetVector4Macro(AboveRangeColor, double);
  vtkGetVector4Macro(AboveRangeColor, double);

  // Description:
  // Set whether the below range color should be used.
  vtkSetMacro(UseAboveRangeColor, int);
  vtkGetMacro(UseAboveRangeColor, int);
  vtkBooleanMacro(UseAboveRangeColor, int);

  // Description:
  // Map one value through the lookup table.
  unsigned char* MapValue(double v);

  // Description:
  // Map one value through the lookup table and return the color as
  // an RGB array of doubles between 0 and 1.
  void GetColor(double x, double rgb[3]);

  // Description:
  // Map one value through the lookup table and return the alpha value
  // (the opacity) as a double between 0 and 1.
  double GetOpacity(double v);

  // Description:
  // Return the table index associated with a particular value.
  //
  // Do not use this function when \a IndexedLookup is true:
  // in that case, the set of values \a v may take on is exactly the integers
  // from 0 to \a GetNumberOfTableValues() - 1;
  // and \a v serves directly as an index into \a TableValues.
  virtual vtkIdType GetIndex(double v);

  // Description:
  // Specify the number of values (i.e., colors) in the lookup
  // table.
  void SetNumberOfTableValues(vtkIdType number);
  vtkIdType GetNumberOfTableValues() { return this->NumberOfColors; };

  // Description:
  // Directly load color into lookup table. Use [0,1] double values for color
  // component specification. Make sure that you've either used the
  // Build() method or used SetNumberOfTableValues() prior to using this
  // method.
  virtual void SetTableValue(vtkIdType indx, double rgba[4]);

  // Description:
  // Directly load color into lookup table. Use [0,1] double values for color
  // component specification.
  virtual void SetTableValue(vtkIdType indx,
                              double r, double g, double b, double a=1.0);

  // Description:
  // Return a rgba color value for the given index into the lookup table. Color
  // components are expressed as [0,1] double values.
  double *GetTableValue(vtkIdType id);

  // Description:
  // Return a rgba color value for the given index into the lookup table. Color
  // components are expressed as [0,1] double values.
  void GetTableValue(vtkIdType id, double rgba[4]);

  // Description:
  // Get pointer to color table data. Format is array of unsigned char
  // r-g-b-a-r-g-b-a...
  unsigned char *GetPointer(const vtkIdType id) {
    return this->Table->GetPointer(4*id); };

  // Description:
  // Get pointer to data. Useful for direct writes into object. MaxId is bumped
  // by number (and memory allocated if necessary). Id is the location you
  // wish to write into; number is the number of rgba values to write.
  unsigned char *WritePointer(const vtkIdType id, const int number);

  // Description:
  // Sets/Gets the range of scalars which will be mapped.  This is a duplicate
  // of Get/SetTableRange.
  double *GetRange() { return this->GetTableRange(); };
  void SetRange(double min, double max) { this->SetTableRange(min, max); };
  void SetRange(double rng[2]) { this->SetRange(rng[0], rng[1]); };

  //BTX
  // Description:
  // Returns the log of \c range in \c log_range.
  // There is a little more to this than simply taking the log10 of the
  // two range values: we do conversion of negative ranges to positive
  // ranges, and conversion of zero to a 'very small number'.
  static void GetLogRange(const double range[2], double log_range[2]);

  // Description:
  // Apply log to value, with appropriate constraints.
  static double ApplyLogScale(double v, const double range[2],
    const double log_range[2]);
  //ETX

  // Description:
  // Set the number of colors in the lookup table.  Use
  // SetNumberOfTableValues() instead, it can be used both before and
  // after the table has been built whereas SetNumberOfColors() has no
  // effect after the table has been built.
  vtkSetClampMacro(NumberOfColors,vtkIdType,2,VTK_ID_MAX);
  vtkGetMacro(NumberOfColors,vtkIdType);

  // Description:
  // Set/Get the internal table array that is used to map the scalars
  // to colors.  The table array is an unsigned char array with 4
  // components representing RGBA.
  void SetTable(vtkUnsignedCharArray *);
  vtkGetObjectMacro(Table,vtkUnsignedCharArray);

  // Description:
  // map a set of scalars through the lookup table
  void MapScalarsThroughTable2(void *input, unsigned char *output,
                               int inputDataType, int numberOfValues,
                               int inputIncrement, int outputIncrement);

  // Description:
  // Copy the contents from another LookupTable
  void DeepCopy(vtkScalarsToColors *lut);

  // Description:
  // This should return 1 is the subclass is using log scale for mapping scalars
  // to colors. Returns 1 is scale == VTK_SCALE_LOG10.
  virtual int UsingLogScale()
    {
    return (this->GetScale() == VTK_SCALE_LOG10)? 1 : 0;
    }

  // Description:
  // Get the number of available colors for mapping to.
  virtual vtkIdType GetNumberOfAvailableColors();

  // Description:
  // Return a color given an integer index.
  //
  // This is used to assign colors to annotations (given an offset into the
  // list of annotations).
  // If the table is empty or \a idx < 0, then NanColor is returned.
  virtual void GetIndexedColor(vtkIdType idx, double rgba[4]);

protected:
  vtkLookupTable(int sze=256, int ext=256);
  ~vtkLookupTable();

  vtkIdType NumberOfColors;
  vtkUnsignedCharArray *Table;
  double TableRange[2];
  double HueRange[2];
  double SaturationRange[2];
  double ValueRange[2];
  double AlphaRange[2];
  double NanColor[4];
  double BelowRangeColor[4];
  int    UseBelowRangeColor;
  double AboveRangeColor[4];
  int    UseAboveRangeColor;

  int Scale;
  int Ramp;
  vtkTimeStamp InsertTime;
  vtkTimeStamp BuildTime;
  double RGBA[4]; //used during conversion process
  unsigned char NanColorChar[4];

  int OpaqueFlag;
  vtkTimeStamp OpaqueFlagBuildTime;

  // Description:
  // Resize the LookupTable to have enough room for the out-of-range colors
  void ResizeTableForSpecialColors();

private:
  vtkLookupTable(const vtkLookupTable&);  // Not implemented.
  void operator=(const vtkLookupTable&);  // Not implemented.
};

//----------------------------------------------------------------------------
inline unsigned char *vtkLookupTable::WritePointer(const vtkIdType id,
                                                   const int number)
{
  this->InsertTime.Modified();
  return this->Table->WritePointer(4*id,4*number);
}

#endif


text:
ACCEPTED

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

#### Published in
Bryologist 102(1): 7 (1999)

#### Original name
Heterodermia linearis Moberg & T. H. Nash

### Remarks
null


text:
import Ember from 'ember';
import config from './config/environment';

const Router = Ember.Router.extend({
  location: config.locationType,
  rootURL: config.rootURL
});

Router.map(function() {
  this.route('inventories');
  this.route('products');
  this.route('new-product');
  this.route('new-component');
});

export default Router;


text:
<?php

namespace Phlexible\Component\ImageAnalyzer;

use Phlexible\Component\ImageAnalyzer\Driver\DriverInterface;

/**
 * Image analyzer
 *
 * @author Stephan Wentz <stephan@wentz.it>
 */
class ImageAnalyzer
{
    /**
     * @var DriverInterface
     */
    private $driver;

    /**
     * @param DriverInterface $driver
     */
    public function __construct(DriverInterface $driver)
    {
        $this->driver = $driver;
    }

    /**
     * @parm string $filename
     *
     * @return ImageInfo
     */
    public function analyze($filename)
    {
        return $this->driver->analyze($filename);
    }
}


text:
package io.ifar.skidroad.upload;

import com.amazonaws.AmazonClientException;
import io.ifar.skidroad.LogFile;
import io.ifar.skidroad.awssdk.S3Storage;
import io.ifar.skidroad.tracking.LogFileTracker;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.DateTimeFormatterBuilder;

import java.net.URI;
import java.net.URISyntaxException;

/**
 * A variation of {@link AwsS3ClientUploadWorker} which uploads into a directory structure that reflects the local parent
 * directory of the {@link LogFile}.
 *
 * Log files are uploaded into a /<parent>/yyyy/MM/dd (implemented in {@link #determineArchiveURI(io.ifar.skidroad.LogFile)}). In
 * the local tracker database they are assigned a <parent> group (implemented in {@link #determineArchiveGroup(io.ifar.skidroad.LogFile)}).
 *
 * For use in environments where multiple {@link io.ifar.skidroad.writing.WritingWorkerManager} and multiple
 * {@link LogFileTracker}s are in use, sharing a single database and S3 configuration.
 */
public class AwsS3ClientUploadByDirectoryWorker extends AbstractUploadWorker {
    private final static DateTimeFormatter URI_FORMATTER = new DateTimeFormatterBuilder()
            .appendYear(4,4)
            .appendLiteral('/')
            .appendMonthOfYear(2)
            .appendLiteral('/')
            .appendDayOfMonth(2)
            .toFormatter();

    private final URI uploadBasePath;
    private final S3Storage storage;

    public AwsS3ClientUploadByDirectoryWorker(LogFile logFile, LogFileTracker tracker, URI uploadBaseURI, S3Storage storage) {
        super(logFile, tracker);
        this.uploadBasePath = uploadBaseURI;
        this.storage = storage;
    }

    /**
     * Returns name of immediate parent directory of the logFile (on the local file system)
     */
    private String getParent(LogFile logFile) {
        return logFile.getPrepPath().getParent().getFileName().toString();
    }

    @Override
    String determineArchiveGroup(LogFile logFile) {
        return getParent(logFile);
    }

    @Override
    URI determineArchiveURI(LogFile logFile) throws URISyntaxException {
        StringBuilder stringBuilder = new StringBuilder(uploadBasePath.toString());
        if (stringBuilder.charAt(stringBuilder.length()-1) != '/')
            stringBuilder.append('/');
        stringBuilder.append(getParent(logFile));
        stringBuilder.append('/');
        stringBuilder.append(URI_FORMATTER.print(logFile.getStartTime()));
        stringBuilder.append('/');
        stringBuilder.append(logFile.getPrepPath().getFileName().toString());
        return new URI(stringBuilder.toString());
    }

    @Override
    void push(LogFile logFile) throws AmazonClientException {
        storage.put(logFile.getArchiveURI().toString(), logFile.getPrepPath().toFile());
    }
}


text:
#include "stdafx.h"

#include <d3d9.h>
#include <d3dx9.h>

#include "ResourceStats.h"

using namespace System;

namespace SlimDX
{
namespace Direct3D9
{
	bool ResourceStats::operator == ( ResourceStats left, ResourceStats right )
	{
		return ResourceStats::Equals( left, right );
	}

	bool ResourceStats::operator != ( ResourceStats left, ResourceStats right )
	{
		return !ResourceStats::Equals( left, right );
	}

	int ResourceStats::GetHashCode()
	{
		return Thrashing.GetHashCode() + ApproximateBytesDownloaded.GetHashCode() + NumberEvicted.GetHashCode()
			 + NumberVideoCreated.GetHashCode() + LastPriority.GetHashCode() + NumberUsed.GetHashCode()
			 + NumberUsedInVideoMemory.GetHashCode() + WorkingSet.GetHashCode() + WorkingSetBytes.GetHashCode()
			 + TotalManaged.GetHashCode() + TotalBytes.GetHashCode();
	}

	bool ResourceStats::Equals( Object^ value )
	{
		if( value == nullptr )
			return false;

		if( value->GetType() != GetType() )
			return false;

		return Equals( safe_cast<ResourceStats>( value ) );
	}

	bool ResourceStats::Equals( ResourceStats value )
	{
		return ( Thrashing == value.Thrashing && ApproximateBytesDownloaded == value.ApproximateBytesDownloaded && NumberEvicted == value.NumberEvicted
			 && NumberVideoCreated == value.NumberVideoCreated && LastPriority == value.LastPriority && NumberUsed == value.NumberUsed
			 && NumberUsedInVideoMemory == value.NumberUsedInVideoMemory && WorkingSet == value.WorkingSet && WorkingSetBytes == value.WorkingSetBytes
			 && TotalManaged == value.TotalManaged && TotalBytes == value.TotalBytes );
	}

	bool ResourceStats::Equals( ResourceStats% value1, ResourceStats% value2 )
	{
		return ( value1.Thrashing == value2.Thrashing && value1.ApproximateBytesDownloaded == value2.ApproximateBytesDownloaded && value1.NumberEvicted == value2.NumberEvicted
			 && value1.NumberVideoCreated == value2.NumberVideoCreated && value1.LastPriority == value2.LastPriority && value1.NumberUsed == value2.NumberUsed
			 && value1.NumberUsedInVideoMemory == value2.NumberUsedInVideoMemory && value1.WorkingSet == value2.WorkingSet && value1.WorkingSetBytes == value2.WorkingSetBytes
			 && value1.TotalManaged == value2.TotalManaged && value1.TotalBytes == value2.TotalBytes );
	}
}
}


text:
package com.ksyun.media.shortvideo.multicanvasdemo.view;

import com.ksyun.media.shortvideo.multicanvasdemo.MultiCanvasRecordActivity;
import com.ksyun.media.shortvideo.multicanvasdemo.R;

import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.os.Handler;
import android.util.AttributeSet;
import android.view.View;

import java.util.LinkedList;

/**
 * record progress on 17/5/12.
 */

public class RecordProgressView extends View implements RecordProgressController.RecordingStateChanged {
    private static final String TAG = "RecordProgressView";

    private int paddingTop = 4;
    private int paddingBottom = 4;
    private Paint mPaint;
    private Paint mMinPaint;
    private Paint mPausedPaint;
    private int mMinPoint;
    private Handler mHandler;
    private boolean mFlag;
    private Bitmap mCursorBitmap;

    private LinkedList<RecordClipModel> mProgressClipList;
    public int mTotalWidth;
    private Paint mPendingPaint;
    public int mScreenWidth;

    private boolean mIsRecording;

    public RecordProgressView(Context context) {
        super(context);
        instantiate(context);
    }

    public RecordProgressView(Context context, AttributeSet attributeset) {
        super(context, attributeset);
        instantiate(context);
    }

    public RecordProgressView(Context context, AttributeSet attributeset, int i) {
        super(context, attributeset, i);
        instantiate(context);
    }

    private void instantiate(Context context) {
        mPaint = new Paint();
        mMinPaint = new Paint();
        mPausedPaint = new Paint();
        mPendingPaint = new Paint();
        mTotalWidth = 0;
        mProgressClipList = null;
        mHandler = new Handler();
        mFlag = false;
        Resources res = context.getResources();
        mCursorBitmap = BitmapFactory.decodeResource(res,
                R.drawable.record_progressbar_front);
        mPaint.setStyle(Paint.Style.FILL);
        mPaint.setColor(getResources().getColor(R.color.record_progress_blue));
        mPausedPaint.setStyle(Paint.Style.FILL);
        mPausedPaint.setColor(getResources().getColor(
                R.color.record_progress_pause));
        mMinPaint.setStyle(Paint.Style.FILL);
        mMinPaint.setColor(getResources().getColor(
                R.color.record_progress_pause));
        mPendingPaint.setStyle(Paint.Style.FILL);
        mPendingPaint.setColor(getResources().getColor(
                R.color.record_progress_red));
        mScreenWidth = getScreenWidthPixels(getContext());
        mMinPoint = mScreenWidth
                * MultiCanvasRecordActivity.MIN_DURATION
                / MultiCanvasRecordActivity.MAX_DURATION;
        mHandler.postDelayed(mCursorRunnable, 500);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        boolean pendingDelete = false;
        if (mProgressClipList != null && !mProgressClipList.isEmpty()) {
            int totalWidth = 0;
            for (RecordClipModel clip : mProgressClipList) {
                long newWidth = totalWidth + (clip.timeInterval * mScreenWidth)
                        / MultiCanvasRecordActivity.MAX_DURATION;
                switch (clip.state) {
                    case 0: // recording
                        canvas.drawRect(totalWidth, paddingTop, newWidth,
                                getMeasuredHeight() - paddingBottom, mPaint);
                        break;
                    case 1: // recorded
                        canvas.drawRect(totalWidth, paddingTop, newWidth,
                                getMeasuredHeight() - paddingBottom, mPaint);
                        canvas.drawRect(newWidth - 2, paddingTop, newWidth,
                                getMeasuredHeight() - paddingBottom, mPausedPaint);
                        break;
                    case 2: // pending fro delete
                        canvas.drawRect(totalWidth, paddingTop, newWidth,
                                getMeasuredHeight() - paddingBottom, mPendingPaint);
                        pendingDelete = true;
                        break;
                    default:
                        break;
                }
                totalWidth = (int) newWidth;
            }
            mTotalWidth = totalWidth;
        } else {
            mTotalWidth = 0;
        }
        if (mTotalWidth < mMinPoint) {
            canvas.drawRect(mMinPoint, paddingTop, mMinPoint + 3,
                    getMeasuredHeight() - paddingBottom, mMinPaint);
        }
        if ((mFlag && !pendingDelete) || mIsRecording) {
            canvas.drawBitmap(mCursorBitmap, null, new Rect(mTotalWidth - 20,
                    paddingTop, mTotalWidth + 12, getMeasuredHeight() - paddingBottom), null);
        }
    }

    @Override
    public void recordingStart(long startTime) {
        mIsRecording = true;
    }

    @Override
    public void recordingStop() {
        mIsRecording = false;
    }

    public void release() {
        if (mHandler != null) {
            mHandler.removeCallbacksAndMessages(null);
            mHandler = null;
        }
        mProgressClipList.clear();
    }

    public void setProgressClipList(
            LinkedList<RecordClipModel> clips) {
        mProgressClipList = clips;
    }

    public boolean isPassMinPointQuick() {
        if (mProgressClipList != null && !mProgressClipList.isEmpty()) {
            int totalWidth = 0;
            for (RecordClipModel clip : mProgressClipList) {
                long newWidth = totalWidth + (clip.timeInterval * mScreenWidth)
                        / MultiCanvasRecordActivity.MAX_DURATION;
                totalWidth = (int) newWidth;
            }
            if (totalWidth >= mMinPoint) {
                return true;
            }
        }
        return false;
    }

    public boolean isPassMinPoint() {
        if (mTotalWidth >= mMinPoint) {
            return true;
        }
        return false;
    }

    public boolean isPassMaxPoint() {
        if (mTotalWidth >= mScreenWidth) {
            return true;
        }
        return false;
    }

    private Runnable mCursorRunnable = new Runnable() {
        @Override
        public void run() {
            mFlag = !mFlag;
            mHandler.postDelayed(mCursorRunnable, 500);
            invalidate();
        }
    };

    private int getScreenWidthPixels(Context context) {
        return context.getResources().getDisplayMetrics().widthPixels;
    }
}


text:
package com.june.dto.back.system.base;

import com.june.common.PageDTO;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 权限设计分配菜单使用
 * MenuInfoDto <br>
 *
 * @author 王俊伟 wjw.happy.love@163.com
 * @blog https://www.github.com/junehappylove
 * @date 2017年2月16日 下午7:40:20
 * @version 1.0.0
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class MenuInfoDto extends PageDTO<MenuInfoDto> {

	private static final long serialVersionUID = 1000L;
	private String id;// 菜单id
	private String text;// 菜单名
	private String roleId;// 角色id
	private String authorityMenusId;// 页面上传过来的需要赋权限的id
	private String roleName;// 角色名
	private String buttonId;// 按钮id
	/** 一级菜单id. */
	private String firstMenuId;
	/** 二级菜单id. */
	private String secondMenuId;
	/** 三级菜单id. */
	private String thirdMenuId;

	@Override
	protected String getDtoName() {
		return "菜单";
	}

}


text:
package arimocks

import mock "github.com/stretchr/testify/mock"

// TextMessage is an autogenerated mock type for the TextMessage type
type TextMessage struct {
	mock.Mock
}

// Send provides a mock function with given fields: from, tech, resource, body, vars
func (_m *TextMessage) Send(from string, tech string, resource string, body string, vars map[string]string) error {
	ret := _m.Called(from, tech, resource, body, vars)

	var r0 error
	if rf, ok := ret.Get(0).(func(string, string, string, string, map[string]string) error); ok {
		r0 = rf(from, tech, resource, body, vars)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}

// SendByURI provides a mock function with given fields: from, to, body, vars
func (_m *TextMessage) SendByURI(from string, to string, body string, vars map[string]string) error {
	ret := _m.Called(from, to, body, vars)

	var r0 error
	if rf, ok := ret.Get(0).(func(string, string, string, map[string]string) error); ok {
		r0 = rf(from, to, body, vars)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}


text:
package org.cruise.utils;

import android.app.Activity;
import android.util.DisplayMetrics;
import android.view.View;

/**
 * Created by zhiqiang on 8/24/15.
 */
public class DisplayUtil extends BaseUtil {
    public static final int UNIT_PX = 0;
    public static final int UNIT_DIP = 1;
    public static final int UNIT_SP = 2;
    public static final int UNIT_PT = 3;
    public static final int UNIT_IN = 4;
    public static final int UNIT_MM = 5;
    private static DisplayMetrics dm;

    private DisplayUtil() {
        super();
    }

    /**
     * dip 2 px
     *
     * @param activity
     * @param dip
     * @return px value
     */
    public static float getDip2Px(Activity activity, float dip) {
        initDm(activity);
        return applyDimension(UNIT_DIP, dip, dm);
    }

    /**
     * px 2 dip
     *
     * @param activity
     * @param px
     * @return
     */
    public static float getPx2Dip(Activity activity, float px) {
        initDm(activity);
        return px / dm.density;
    }

    private static void initDm(Activity activity) {
        if (dm == null) {
            dm = new DisplayMetrics();
            activity.getWindowManager().getDefaultDisplay().getMetrics(dm);
        }
    }

    public static float applyDimension(int unit, float value, DisplayMetrics metrics) {
        switch (unit) {
            case UNIT_PX:
                return value;
            case UNIT_DIP:
                return value * metrics.density;
            case UNIT_SP:
                return value * metrics.scaledDensity;
            case UNIT_PT:
                return value * metrics.xdpi * (1.0f / 72);
            case UNIT_IN:
                return value * metrics.xdpi;
            case UNIT_MM:
                return value * metrics.xdpi * (1.0f / 25.4f);
        }
        return 0;
    }

    /**
     * Returns the visibility for this view.
     *
     * @param v
     * @return
     */
    public static boolean isViewShow(View v) {
        return v.getVisibility() == View.VISIBLE;
    }
}


text:
<!doctype html>

            <input type="text" ng-model="yourName" placeholder="Enter a name here">

Hello, {{yourName}}!

            {{ person.name }}

                <input type="text" ng-model="person.name" placeholder="Name"></input>
                Say Hello

            {{ person }}


text:
ALTER TABLE `t_log_accountlogin`
ADD INDEX `Index_AccountCreateTime` (`AccountCreateTime`) ;


text:
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using Newtonsoft.Json;
using OutlookMatters.Core.Chat;
using OutlookMatters.Core.Error;
using OutlookMatters.Core.Mail;
using OutlookMatters.Core.Mattermost.v1.Interface;
using OutlookMatters.Core.Reply;
using OutlookMatters.Core.Session;
using OutlookMatters.Core.Settings;
using OutlookMatters.Core.Utils;
using Office = Microsoft.Office.Core;

namespace OutlookMatters.Core.ContextMenu
{
    [ComVisible(true)]
    public class MailItemContextMenuEntry : Office.IRibbonExtensibility
    {
        private const string CHANNEL_BUTTON_ID_PREFIX = "channel_id-";

        private readonly IErrorDisplay _errorDisplay;
        private readonly IMailExplorer _explorer;
        private readonly IStringProvider _rootPostIdProvider;
        private readonly ISessionRepository _sessionRepository;
        private readonly ISettingsLoadService _settingsLoadService;
        private readonly ISettingsSaveService _settingsSaveService;
        private readonly ISettingsUserInterface _settingsUi;

        public MailItemContextMenuEntry(IMailExplorer explorer,
            ISettingsLoadService settingsLoadService,
            ISettingsSaveService settingsSaveService,
            IErrorDisplay errorDisplay,
            ISettingsUserInterface settingsUi,
            ISessionRepository sessionRepository,
            IStringProvider rootPostIdProvider)
        {
            _explorer = explorer;
            _settingsLoadService = settingsLoadService;
            _settingsSaveService = settingsSaveService;
            _errorDisplay = errorDisplay;
            _settingsUi = settingsUi;
            _sessionRepository = sessionRepository;
            _rootPostIdProvider = rootPostIdProvider;
        }

        public string GetCustomUI(string ribbonId)
        {
            if (ribbonId != "Microsoft.Outlook.Explorer")
            {
                return null;
            }
            return GetResourceText("OutlookMatters.Core.ContextMenu.MailItemContextMenuEntry.xml");
        }

        public string GetDynamicMenu(Office.IRibbonControl control)
        {
            var xmlString = @"<menu xmlns=""http://schemas.microsoft.com/office/2009/07/customui"">";
            var settings = _settingsLoadService.Load();
            var channelList = JsonConvert.DeserializeObject<ChannelListSetting>(settings.ChannelsMap);
            if (channelList != null)
            {
                for (int index = 0; index < channelList.Channels.Count; index++)
                {
                    if (channelList.Channels[index].Type == ChannelTypeSetting.Public)
                    {
                        xmlString += CreateChannelButton(channelList.Channels[index].ChannelId,
                            channelList.Channels[index].ChannelName);
                    }
                }
            }

            xmlString += @"  <menuSeparator id=""specialSectionSeparator""/>";
            xmlString +=
                @"  <button id=""ReplyButton"" label=""As Reply..."" onAction=""OnReplyClick"" imageMso=""Reply"" />";
            xmlString += @"  <menuSeparator id=""settingsSectionSeparator""/>";
            xmlString +=
                @"  <button id=""SettingsButton"" imageMso=""ComAddInsDialog"" label=""Settings..."" onAction=""OnSettingsClick"" />";
            xmlString +=
                @"  <button id=""GetChannels"" label=""Refresh Channels"" onAction=""OnRefreshChannelListClick"" imageMso=""AccessRefreshAllLists"" />";
            xmlString += @"</menu>";
            return xmlString;
        }

        private string CreateChannelButton(string buttonId, string channelName)
        {
            var button = @"<button id=""" + CHANNEL_BUTTON_ID_PREFIX + buttonId + @""" label=""" + channelName +
                         @""" onAction=""OnPostIntoChannelClick"" imageMso=""Forward"" />";
            return button;
        }

        public void OnSettingsClick(Office.IRibbonControl control)
        {
            _settingsUi.OpenSettings();
        }

        public async Task OnPostIntoChannelClick(Office.IRibbonControl control)
        {
            var channelId = control.Id.Substring(CHANNEL_BUTTON_ID_PREFIX.Length);
            var message = FormatMessage();
            try
            {
                var session = await _sessionRepository.RestoreSession();
                var channel = session.GetChannel(channelId);
                await Task.Run(() => channel.CreatePost(message));
            }
            catch (MattermostException mex)
            {
                _errorDisplay.Display(mex);
            }
            catch (Exception exception)
            {
                _errorDisplay.Display(exception);
            }
        }

        public async Task OnRefreshChannelListClick(Office.IRibbonControl control)
        {
            try
            {
                var session = await _sessionRepository.RestoreSession();
                var channelList = await Task.Run(() => session.GetChannels());
                var channelSettings = new ChannelListSetting
                {
                    Channels = channelList.Select(x => x.ToSetting()).ToList()
                };
                var channelMap = JsonConvert.SerializeObject(channelSettings);
                await Task.Run(() => _settingsSaveService.SaveChannels(channelMap));
            }
            catch (MattermostException mex)
            {
                _errorDisplay.Display(mex);
            }
            catch (Exception exception)
            {
                _errorDisplay.Display(exception);
            }
        }

        public async Task OnReplyClick(Office.IRibbonControl control)
        {
            var message = FormatMessage();
            try
            {
                var postId = _rootPostIdProvider.Get();
                var session = await _sessionRepository.RestoreSession();
                var post = await Task.Run(() => session.GetPost(postId));
                await Task.Run(() => post.Reply(message));
            }
            catch (UserAbortException)
            {
            }
            catch (MattermostException mex)
            {
                _errorDisplay.Display(mex);
            }
            catch (Exception exception)
            {
                _errorDisplay.Display(exception);
            }
        }

        private string FormatMessage()
        {
            var mail = _explorer.QuerySelectedMailItem();
            var message = ":email: From: " + mail.SenderName + "\n";
            message += ":email: Subject: " + mail.Subject + "\n";
            message += mail.Body;
            return message;
        }

        private static string GetResourceText(string resourceName)
        {
            var asm = Assembly.GetExecutingAssembly();
            var resourceNames = asm.GetManifestResourceNames();
            foreach (var name in resourceNames)
            {
                if (string.Compare(resourceName, name, StringComparison.OrdinalIgnoreCase) == 0)
                {
                    using (var manifestStream = asm.GetManifestResourceStream(name))
                    {
                        if (manifestStream == null)
                        {
                            return null;
                        }
                        using (var resourceReader = new StreamReader(manifestStream))
                        {
                            return resourceReader.ReadToEnd();
                        }
                    }
                }
            }
            return null;
        }
    }
}


text:
package com.ait.lienzo.client.core.event;

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;

public final class FinallyAttributesChangedBatcher extends AbstractAccumulatingAttributesChangedBatcher
{
    private final ScheduledCommand m_action;

    private boolean                m_refire = true;

    public FinallyAttributesChangedBatcher()
    {
        m_action = new ScheduledCommand()
        {
            @Override
            public void execute()
            {
                dispatch();

                m_refire = true;

                tock();
            }
        };
    }

    @Override
    protected final void tick()
    {
        if (m_refire)
        {
            m_refire = false;

            Scheduler.get().scheduleFinally(m_action);
        }
    }

    @Override
    public final IAttributesChangedBatcher copy()
    {
        return new FinallyAttributesChangedBatcher();
    }

    @Override
    public final String getName()
    {
        return "FinallyAttributesChangedBatcher()";
    }
}


text:
class Rack::Authentication::Config
	def realm(str=nil)
		@realm ||= str
	end

	def adapter(obj=nil)
		@adapter ||= obj
	end
end


text:
ES5Harness.registerTest({
    id: "15.3.4.5.1-4-4",

    path: "TestCases/chapter15/15.3/15.3.4/15.3.4.5.1/15.3.4.5.1-4-4.js",

    description: "[[Call]] - length of parameters of 'target' is 0, length of 'boundArgs' is 0, length of 'ExtraArgs' is 0, and without 'boundThis'",

    test: function testcase() {
        var func = function () {
            return arguments.length === 0;
        };

        var newFunc = Function.prototype.bind.call(func);

        return newFunc();
    },

    precondition: function prereq() {
        return fnExists(Function.prototype.bind);
    }
});