text:
import { expect } from "chai";

import Fakerator from "lib";

describe("Default internet", () => {

	let fakerator;

	beforeEach( () => {
		fakerator = new Fakerator();
		fakerator.seed(8080);
	});

	it("check internet.avatar", () => {
		expect(fakerator.populate("#{internet.avatar}")).to.be.equal("https://s3.amazonaws.com/uifaces/faces/twitter/snowwrite/128.jpg");
		expect(fakerator.internet.avatar()).to.be.equal("https://s3.amazonaws.com/uifaces/faces/twitter/charliecwaite/128.jpg");
	});

	it("check internet.tld", () => {
		expect(fakerator.populate("#{internet.tld}")).to.be.equal("eu");
		expect(fakerator.internet.tld()).to.be.equal("com");
	});

	it("check internet.userName", () => {
		expect(fakerator.populate("#{internet.userName}")).to.be.equal("kelly.moore14");
		expect(fakerator.internet.userName()).to.be.equal("marshall_orn");
	});

	it("check internet.userName with name parameters", () => {
		expect(fakerator.populate("#{internet.userName}", "John", "Doe")).to.be.equal("johndoe19");
		expect(fakerator.internet.userName("Jane", "Doe")).to.be.equal("jane_doe21");
	});

	it("check password", () => {
		expect(fakerator.populate("#{internet.password}")).to.be.an("String");
		expect(fakerator.internet.password()).to.be.an("String");
		expect(fakerator.internet.password(12)).to.be.length(12);
	});

	it("check internet.domain", () => {
		expect(fakerator.populate("#{internet.domain}")).to.be.equal("merle-gleichner.net");
		expect(fakerator.internet.domain()).to.be.equal("marshallorn.biz");
	});

	it("check internet.url", () => {
		expect(fakerator.populate("#{internet.url}")).to.be.equal("http://juanita-kertzmann.org");
		expect(fakerator.internet.url()).to.be.equal("http://ella-parisian.com");
		expect(fakerator.internet.url(true, true)).to.be.equal("https://www.arthurmacgyver.net");
	});

	it("check internet.emailDomain", () => {
		expect(fakerator.populate("#{internet.emailDomain}")).to.be.equal("hotmail.com");
		expect(fakerator.internet.emailDomain()).to.be.equal("gmail.com");
	});

	it("check internet.email", () => {
		expect(fakerator.populate("#{internet.email}")).to.be.equal("kelly.moore@gmail.com");
		expect(fakerator.internet.email()).to.be.equal("vernonheidenreich43@hotmail.com");
	});

	it("check internet.email with name parameters", () => {
		expect(fakerator.populate("#{internet.email}", "John", "Doe")).to.be.equal("john.doe@hotmail.com");
		expect(fakerator.internet.email("Jane", "Doe")).to.be.equal("janedoe21@hotmail.com");
		expect(fakerator.internet.email(null, null, "company.org")).to.be.equal("vernonheidenreich54@company.org");
	});

	it("check internet.imageCategories", () => {
		expect(fakerator.populate("#{internet.imageCategories}")).to.be.equal("nature");
		expect(fakerator.internet.imageCategories()).to.be.equal("animals");
	});

	it("check internet.image", () => {
		expect(fakerator.populate("#{internet.image}")).to.be.equal("http://lorempixel.com/640/480");
		expect(fakerator.internet.image(1920, 1080, "animals")).to.be.equal("http://lorempixel.com/1920/1080/animals");
	});

	it("check internet.mac", () => {
		expect(fakerator.populate("#{internet.mac}")).to.be.equal("b2:e9:42:75:95:a9");
		expect(fakerator.internet.mac()).to.be.equal("65:a1:a6:18:94:0b");
	});

	it("check internet.ip", () => {
		expect(fakerator.populate("#{internet.ip}")).to.be.equal("185.34.238.156");
		expect(fakerator.internet.ip()).to.be.equal("69.45.112.94");
	});

	it("check internet.color", () => {
		expect(fakerator.populate("#{internet.color}")).to.be.equal("5d1178");
		expect(fakerator.internet.color()).to.be.equal("4e2216");
		expect(fakerator.internet.color(255, 128)).to.be.equal("b76f49");
	});

	it("check internet.gravatar", () => {
		expect(fakerator.populate("#{internet.gravatar}")).to.be.equal("https://www.gravatar.com/avatar/a91004b566f80271f0a3577f71d43cd4");
		expect(fakerator.internet.gravatar()).to.be.equal("https://www.gravatar.com/avatar/06ba08b465e85247620b410fbb26dacf");
		expect(fakerator.internet.gravatar("john.doe@gmail.com")).to.be.equal("https://www.gravatar.com/avatar/e13743a7f1db7f4246badd6fd6ff54ff");
	});

	it("check internet.ipv6", () => {
		expect(fakerator.populate("#{internet.ipv6}")).to.be.equal("b2e9:4275:95a9:65a1:a618:940b:a6ce:adb6");
		expect(fakerator.internet.ipv6()).to.be.equal("8807:58c0:6a36:4afe:b1ce:2347:2438:78be");
	});

});


text:
public class ListNode {
    int val;
    ListNode next;
    ListNode(int x) { val = x; }
}

class Solution {
    public ListNode reverseList(ListNode head) {

        ListNode pre = null;
        ListNode cur = head;

        while (cur != null) {
            ListNode next = cur.next;

            cur.next = pre;
            pre = cur;
            cur = next;
        }

        return pre;
    }
}

redpajama_set_name: RedPajamaGithub


text:
//
// Self-organizing map in TBB flow::graph
//
//   This is an example of the use of cancellation in a graph.  After a point in searching for
//   the best match for an example, two examples are looked for simultaneously.  When the
//   earlier example is found and the update radius is determined, the affected searches
//   for the subsequent example are cancelled, and after the update they are restarted.
//   As the update radius shrinks fewer searches are cancelled, and by the last iterations
//   virtually all the work done for the speculating example is useful.
//
// first, a simple implementation with only one example vector
// at a time.
//
// we will do a color map (the simple example.)
//
//  graph algorithm
//
//       for some number of iterations
//           update radius r, weight of change L
//           for each example V
//               use graph to find BMU
//               for each part of map within radius of BMU W
//                   update vector:  W(t+1) = W(t) + w(dist)*L*(V - W(t))

#define _MAIN_C_ 1
#include "som.h"

#include "tbb/task_scheduler_init.h"
#include "tbb/flow_graph.h"
#include "tbb/blocked_range2d.h"
#include "tbb/tick_count.h"
#include "../../common/utility/utility.h"

#define RED 0
#define GREEN 1
#define BLUE 2

static int xranges = 1;
static int yranges = 1;
static int xsize = -1;
static int ysize = -1;

static int global_i = 0;
static int speculation_start;
std::vector<int> function_node_execs;
static int xRangeMax = 3;
static int yRangeMax = 3;
static bool dont_speculate = false;
static search_result_type last_update;

class BMU_search_body {
    SOMap &my_map;
    subsquare_type my_square;
    int &fn_tally;
public:
    BMU_search_body(SOMap &_m, subsquare_type &_sq, int &fnt) : my_map(_m), my_square(_sq), fn_tally(fnt) { }
    BMU_search_body( const BMU_search_body &other) : my_map(other.my_map), my_square(other.my_square), fn_tally(other.fn_tally) { }
    search_result_type operator()(const SOM_element s) {
        int my_x;
        int my_y;
        double min_dist = my_map.BMU_range(s, my_x, my_y, my_square);
        ++fn_tally;  // count how many times this function_node executed
        return search_result_type(min_dist, my_x, my_y);
    }
};

typedef function_node<SOM_element, search_result_type> search_node;
typedef broadcast_node<SOM_element> b_node;
typedef std::vector< search_node *> search_node_vector_type;
typedef std::vector< search_node_vector_type > search_node_array_type;
typedef std::vector< graph *> graph_vector_type;
typedef std::vector< graph_vector_type > graph_array_type;

#define SPECULATION_CNT 2

graph *g[SPECULATION_CNT];  // main graph; there should only be one per epoch
b_node *send_to[SPECULATION_CNT];      // broadcast node to send exemplar to all function_nodes
queue_node<search_result_type> *q[SPECULATION_CNT];  // queue for function nodes to put their results in
// each function_node should have its own graph
search_node_array_type* s_array[SPECULATION_CNT];  // 2d array of function nodes
graph_array_type* g_array[SPECULATION_CNT];        // 2d array of graphs

// build a set of SPECULATION_CNT graphs, each of which consists of a broadcast_node,
//    xranges x yranges function_nodes, and one queue_node for output.
//    once speculation starts, if i % SPECULATION_CNT is the current graph, (i+1) % SPECULATION_CNT
//    is the first speculation, and so on.
void
build_BMU_graph(SOMap &map1) {
    // build current graph
    xsize = ((int)map1.size() + xranges - 1) / xranges;
    ysize = ((int)map1[0].size() + yranges - 1) / yranges;
    function_node_execs.clear();
    function_node_execs.reserve(xranges*yranges+1);
    for(int ii = 0; ii < xranges*yranges+1;++ii) function_node_execs.push_back(0);

    for(int scnt = 0; scnt < SPECULATION_CNT; ++scnt) {
        g[scnt] = new graph;
        send_to[scnt] = new b_node(*(g[scnt]));  // broadcast node to the function_nodes
        q[scnt] = new queue_node<search_result_type>(*(g[scnt]));  // output queue

        // create the function_nodes, tie to the graph
        s_array[scnt] = new search_node_array_type;
        s_array[scnt]->reserve(xranges);
        g_array[scnt] = new graph_array_type;
        g_array[scnt]->reserve(xranges);
        for(int i = 0; i < (int)map1.size(); i += xsize) {
            int xindex = i / xsize;
            s_array[scnt]->push_back(search_node_vector_type());
            (*s_array[scnt])[xindex].reserve(yranges);
            g_array[scnt]->push_back(graph_vector_type());
            (*g_array[scnt])[xindex].reserve(yranges);
            for( int j = 0; j < (int)map1[0].size(); j += ysize) {
                int offset = (i/xsize)*yranges + (j / ysize);
                int xmax = (i + xsize) > (int)map1.size() ? (int)map1.size() : i + xsize;
                int ymax = (j + ysize) > (int)map1[0].size() ? (int)map1[0].size() : j + ysize;
                subsquare_type sst(i,xmax,1,j,ymax,1);
                BMU_search_body bb(map1,sst,function_node_execs[offset]);
                graph *g_local = new graph;
                search_node *s = new search_node(*g_local, serial, bb); // copies Body
                (*g_array[scnt])[xindex].push_back(g_local);
                (*s_array[scnt])[xindex].push_back(s);
                make_edge(*(send_to[scnt]), *s);  // broadcast_node -> function_node
                make_edge(*s, *(q[scnt]));   // function_node -> queue_node
            }
        }
    }
}

// Wait for the 2D array of flow::graphs.
void wait_for_all_graphs(int cIndex) {  // cIndex ranges over [0 .. SPECULATION_CNT - 1]
    for(int x = 0; x < xranges; ++x) {
        for(int y = 0; y < yranges; ++y) {
            (*g_array[cIndex])[x][y]->wait_for_all();
        }
    }
}

void
destroy_BMU_graph() {
    for(int scnt = 0; scnt < SPECULATION_CNT; ++scnt) {
        for( int i = 0; i < (int)(*s_array[scnt]).size(); ++i ) {
            for(int j = 0; j < (int)(*s_array[scnt])[i].size(); ++j) {
                delete (*s_array[scnt])[i][j];
                delete (*g_array[scnt])[i][j];
            }
        }
        (*s_array[scnt]).clear();
        delete s_array[scnt];
        (*g_array[scnt]).clear();
        delete g_array[scnt];
        delete q[scnt];
        delete send_to[scnt];
        delete g[scnt];
    }
}

void find_subrange_overlap(int const &xval, int const &yval, double const &radius, int &xlow, int &xhigh, int &ylow, int &yhigh) {
    xlow = int((xval-radius)/xsize);
    xhigh = int((xval+radius)/xsize);
    ylow = int((yval-radius)/ysize);
    yhigh = int((yval+radius)/ysize);
    // circle may fall partly outside map
    if(xlow < 0) xlow = 0;
    if(xhigh >= xranges) xhigh = xranges - 1;
    if(ylow < 0) ylow = 0;
    if(yhigh >= yranges) yhigh = yranges - 1;
}

bool overlap( int &xval, int &yval, search_result_type &sr) {
    int xlow, xhigh, ylow, yhigh;
    find_subrange_overlap(get<XV>(sr), get<YV>(sr), get<RADIUS>(sr), xlow, xhigh, ylow, yhigh);
    return xval >= xlow && xval <= xhigh && yval >= ylow && yval <= yhigh;
}

void
cancel_submaps(int &xval, int &yval, double &radius, int indx) {
    int xlow;
    int xhigh;
    int ylow;
    int yhigh;
    find_subrange_overlap(xval, yval, radius, xlow, xhigh, ylow, yhigh);
    for(int x = xlow; x <= xhigh; ++x) {
        for(int y = ylow; y <= yhigh; ++y) {
            (*g_array[indx])[x][y]->root_task()->cancel_group_execution();
        }
    }
}

void
restart_submaps(int &xval, int &yval, double &radius, int indx, SOM_element &vector) {
    int xlow;
    int xhigh;
    int ylow;
    int yhigh;
    find_subrange_overlap(xval, yval, radius, xlow, xhigh, ylow, yhigh);
    for(int x = xlow; x <= xhigh; ++x) {
        for(int y = ylow; y <= yhigh; ++y) {
            // have to reset the graph
            (*g_array[indx])[x][y]->root_task()->context()->reset();
            // and re-submit the exemplar for search.
            (*s_array[indx])[x][y]->try_put(vector);
        }
    }
}

search_result_type
graph_BMU( int indx ) {  // indx ranges over [0 .. SPECULATION_CNT -1]
    wait_for_all_graphs(indx);  // wait for the array of subgraphs
    (g[indx])->wait_for_all();
    std::vector<search_result_type> all_srs(xRangeMax*yRangeMax,search_result_type(DBL_MAX,-1,-1));
    search_result_type sr;
    search_result_type min_sr;
    get<RADIUS>(min_sr) = DBL_MAX;
    int result_count = 0;
    while((q[indx])->try_get(sr)) {
        ++result_count;
        // figure which submap this came from
        int x = get<XV>(sr) / xsize;
        int y = get<YV>(sr) / ysize;
        int offset = x*yranges+y;  // linearized subscript
        all_srs[offset] = sr;
        if(get<RADIUS>(sr) < get<RADIUS>(min_sr))
            min_sr = sr;
        else if(get<RADIUS>(sr) == get<RADIUS>(min_sr)) {
            if(get<XV>(sr) < get<XV>(min_sr)) {
                min_sr = sr;
            }
            else if((get<XV>(sr) == get<XV>(min_sr) &&
                  get<YV>(sr) < get<YV>(min_sr)))
            {
                min_sr = sr;
            }
        }
    }
    return min_sr;
    // end of one epoch
}

void graph_teach(SOMap &map1, teaching_vector_type &in) {
    build_BMU_graph(map1);
    // normally the training would pick random exemplars to teach the SOM.  We need
    // the process to be reproducible, so we will pick the exemplars in order, [0, in.size())
    int next_j = 0;
    for(int epoch = 0; epoch < nPasses; ++epoch) {
        global_i = epoch;
        bool canceled_submaps = false;
        int j = next_j;  // try to make reproducible
        next_j = (epoch+1) % in.size();
        search_result_type min_sr;
        if(epoch < speculation_start) {
            (send_to[epoch%SPECULATION_CNT])->try_put(in[j]);
        }
        else if(epoch == speculation_start) {
            (send_to[epoch%SPECULATION_CNT])->try_put(in[j]);
            if(epoch < nPasses-1) {
                (send_to[(epoch+1)%SPECULATION_CNT])->try_put(in[next_j]);
            }
        }
        else if(epoch < nPasses - 1) {
            (send_to[(epoch+1)%SPECULATION_CNT])->try_put(in[next_j]);
        }
        min_sr = graph_BMU(epoch % SPECULATION_CNT);  //calls wait_for_all()
        double min_distance = get<0>(min_sr);
        double radius = max_radius * exp(-(double)epoch*radius_decay_rate);
        double learning_rate = max_learning_rate * exp(-(double)epoch * learning_decay_rate);
        if(epoch >= speculation_start && epoch < (nPasses - 1)) {
            // have to cancel the affected submaps
            cancel_submaps(get<XV>(min_sr), get<YV>(min_sr), radius, (epoch+1)%SPECULATION_CNT);
            canceled_submaps = true;
        }
        map1.epoch_update(in[j], epoch, get<1>(min_sr), get<2>(min_sr), radius, learning_rate);
        ++global_i;
        if(canceled_submaps) {
            // do I have to wait for all the non-canceled speculative graph to complete first?
            // yes, in case a canceled task was already executing.
            wait_for_all_graphs((epoch+1) % SPECULATION_CNT);  // wait for the array of subgraphs
            restart_submaps(get<1>(min_sr), get<2>(min_sr), radius, (epoch+1)%SPECULATION_CNT, in[next_j]);
        }

        last_update = min_sr;
        get<RADIUS>(last_update) = radius;  // not smallest value, but range of effect
    }
    destroy_BMU_graph();
}

static const double serial_time_adjust = 1.25;
static double radius_fraction = 3.0;

int
main(int argc, char** argv) {
    int l_speculation_start;
    utility::thread_number_range threads(
            task_scheduler_init::default_num_threads,
            task_scheduler_init::default_num_threads()  // run only the default number of threads if none specified
    );

    utility::parse_cli_arguments(argc,argv,
            utility::cli_argument_pack()
            //"-h" option for for displaying help is present implicitly
            .positional_arg(threads,"n-of-threads","number of threads to use; a range of the form low[:high], where low and optional high are non-negative integers or 'auto' for the TBB default.")
            // .positional_arg(InputFileName,"input-file","input file name")
            // .positional_arg(OutputFileName,"output-file","output file name")
            .positional_arg(radius_fraction, "radius-fraction","size of radius at which to start speculating")
            .positional_arg(nPasses, "number-of-epochs","number of examples used in learning phase")
            .arg(cancel_test, "cancel-test", "test for cancel signal while finding BMU")
            .arg(extra_debug, "debug", "additional output")
            .arg(dont_speculate,"nospeculate","don't speculate in SOM map teaching")
         );

    readInputData();
    max_radius = (xMax < yMax) ? yMax / 2 : xMax / 2;
    // need this value for the 1x1 timing below
    radius_decay_rate = -(log(1.0/(double)max_radius) / (double)nPasses);
    find_data_ranges(my_teaching, max_range, min_range );
    if(extra_debug) {
        printf( "Data range: ");
        remark_SOM_element(min_range);
        printf( " to ");
        remark_SOM_element(max_range);
        printf( "\n");
    }

    // find how much time is taken for the single function_node case.
    // adjust nPasses so the 1x1 time is somewhere around serial_time_adjust seconds.
   // make sure the example test runs for at least 0.5 second.
    for(;;) {
        task_scheduler_init init(1);
        SOMap map1(xMax,yMax);
        speculation_start = nPasses + 1;  // Don't speculate

        xranges = 1;
        yranges = 1;
        map1.initialize(InitializeGradient, max_range, min_range);
        tick_count t0 = tick_count::now();
        graph_teach(map1, my_teaching);
        tick_count t1 = tick_count::now();
        double nSeconds = (t1-t0).seconds();
        if(nSeconds < 0.5) {
            xMax *= 2;
            yMax *= 2;
            continue;
        }
        double size_adjust = sqrt(serial_time_adjust / nSeconds);
        xMax = (int)((double)xMax * size_adjust);
        yMax = (int)((double)yMax * size_adjust);
        max_radius = (xMax < yMax) ? yMax / 2 : xMax / 2;
        radius_decay_rate = log((double)max_radius) / (double)nPasses;

        if(extra_debug) {
            printf("original 1x1 case ran in %g seconds\n", nSeconds);
            printf("   Size of table == %d x %d\n", xMax, yMax);
            printf("   radius_decay_rate == %g\n", radius_decay_rate);
        }
        break;
    }

    // the "max_radius" starts at 1/2*radius_fraction the table size.  To start the speculation when the radius is
    // 1 / n * the table size, the constant in the log below should be n / 2.  so 2 == 1/4, 3 == 1/6th,
    // et c.
    if(dont_speculate) {
        l_speculation_start = nPasses + 1;
        if ( extra_debug )printf("speculation will not be done\n");
    }
    else {
        if(radius_fraction < 1.0 ) {
            if ( extra_debug )printf("Warning: radius_fraction should be >= 1.  Setting to 1.\n");
            radius_fraction = 1.0;
        }
        l_speculation_start = (int)((double)nPasses * log(radius_fraction) / log((double)nPasses));
        if ( extra_debug )printf( "We will start speculation at iteration %d\n", l_speculation_start );
    }
    double single_time;  // for speedup calculations
    for(int p = threads.first; p <= threads.last; ++p) {
        task_scheduler_init init(p);
        if ( extra_debug )printf( " -------------- Running with %d threads. ------------\n", p);
       // run the SOM build for a series of subranges
        for(xranges = 1; xranges <= xRangeMax; ++xranges) {
            for(yranges = xranges; yranges <= yRangeMax; ++yranges) {
                if(xranges == 1 && yranges == 1) {
                    // don't pointlessly speculate if we're only running one subrange.
                    speculation_start = nPasses + 1;
                }
                else {
                    speculation_start = l_speculation_start;
                }
                SOMap map1(xMax, yMax);
                map1.initialize(InitializeGradient, max_range, min_range);

                if(extra_debug) printf( "Start learning for [%d,%d] ----------- \n", xranges,yranges);
                tick_count t0 = tick_count::now();
                graph_teach(map1, my_teaching);
                tick_count t1 = tick_count::now();

                if ( extra_debug )printf( "Done learning for [%d,%d], which took %g seconds ", xranges,yranges, (t1-t0).seconds());
                if(xranges == 1 && yranges == 1) single_time = (t1-t0).seconds();
                if ( extra_debug )printf( ": speedup == %g\n", single_time / (t1-t0).seconds());

            }  // yranges
        }  // xranges
    }  // #threads p
    printf("done\n");
    return 0;
}


text:
<?php
$cs = Yii::app()->getClientScript();
$cssAnsScriptFilesModule = array(
		'/plugins/jsonview/jquery.jsonview.js',
		'/plugins/jsonview/jquery.jsonview.css',
);
HtmlHelper::registerCssAndScriptsFiles($cssAnsScriptFilesModule,Yii::app()->request->baseUrl);

$userId = Yii::app()->session["userId"] ;

$layoutPath = 'webroot.themes.'.Yii::app()->theme->name.'.views.layouts.';
//header + menu
$this->renderPartial($layoutPath.'header',
                    array(  "layoutPath"=>$layoutPath ,
                            "page" => "admin") );
?>

			URL de la source de données
			User ID
			Description
			Status

<?php

	$collection = "proposeOpenDataSource";
	$all_proposition = PHDB::find($collection);

?>


text:
package Google::Ads::AdWords::v201809::TemplateElement;
use strict;
use warnings;

__PACKAGE__->_set_element_form_qualified(1);

sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201809' };

our $XML_ATTRIBUTE_CLASS;
undef $XML_ATTRIBUTE_CLASS;

sub __get_attr_class {
    return $XML_ATTRIBUTE_CLASS;
}

use Class::Std::Fast::Storable constructor => 'none';
use base qw(Google::Ads::SOAP::Typelib::ComplexType);

{ # BLOCK to scope variables

my %uniqueName_of :ATTR(:get<uniqueName>);
my %fields_of :ATTR(:get<fields>);

__PACKAGE__->_factory(
    [ qw(        uniqueName
        fields

    ) ],
    {
        'uniqueName' => \%uniqueName_of,
        'fields' => \%fields_of,
    },
    {
        'uniqueName' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
        'fields' => 'Google::Ads::AdWords::v201809::TemplateElementField',
    },
    {

        'uniqueName' => 'uniqueName',
        'fields' => 'fields',
    }
);

} # end BLOCK

1;

=pod

=head1 NAME

Google::Ads::AdWords::v201809::TemplateElement

=head1 DESCRIPTION

Perl data type class for the XML Schema defined complexType
TemplateElement from the namespace https://adwords.google.com/api/adwords/cm/v201809.

Represents an element in a template. Each template element is composed of a list of fields (actual value data).

=head2 PROPERTIES

The following properties may be accessed using get_PROPERTY / set_PROPERTY
methods:

=over

=item * uniqueName

=item * fields

=back

=head1 METHODS

=head2 new

Constructor. The following data structure may be passed to new():

=head1 AUTHOR

Generated by SOAP::WSDL

=cut


text:
<?
$MESS["SBB_DESC_YES"] = "Yes";
$MESS["SBB_DESC_NO"] = "No";
$MESS["SBB_PATH_TO_ORDER"] = "Order page";
$MESS["SBB_HIDE_COUPON"] = "Hide upon entering coupon";
$MESS["SBB_COLUMNS_LIST"] = "Columns";
$MESS["SBB_BNAME"] = "Product name";
$MESS["SBB_BPROPS"] = "Product Item Properties";
$MESS["SBB_BPRICE"] = "Price";
$MESS["SBB_BSUM"] = "Total";
$MESS["SBB_BTYPE"] = "Price type";
$MESS["SBB_BQUANTITY"] = "Quantity";
$MESS["SBB_BDELETE"] = "Delete";
$MESS["SBB_BDELAY"] = "Hold";
$MESS["SBB_BWEIGHT"] = "Weight";
$MESS["SBB_BDISCOUNT"] = "Discount";
$MESS["SBB_WEIGHT_UNIT"] = "Weight unit";
$MESS["SBB_WEIGHT_UNIT_G"] = "g";
$MESS["SBB_WEIGHT_KOEF"] = "Grams in the unit of weight";
$MESS["SBB_VAT_SHOW_VALUE"] = "Show tax rate value";
$MESS["SBB_VAT_INCLUDE"] = "Include tax in price";
$MESS["SBB_USE_PREPAYMENT"] = "Use PayPal Express Checkout";
$MESS["SBB_QUANTITY_FLOAT"] = "Use fractional quantities";
$MESS["SBB_CORRECT_RATIO"] = "Automatically recalculate amount using fold coefficient";
$MESS["SBB_ACTION_VARIABLE"] = "Name of action variable";
$MESS["SBB_OFFERS_PROPS"] = "SKU Parameters";
$MESS["SBB_GIFTS"] = "\"Gifts\" Preferences";
$MESS["SBB_GIFTS_USE_GIFTS"] = "Show \"Gifts\" block";
$MESS["CVP_PAGE_ELEMENT_COUNT"] = "Items per page";
$MESS["CVP_PRODUCT_QUANTITY_VARIABLE"] = "Variable containing the product quantity";
$MESS["CVP_PRODUCT_PROPS_VARIABLE"] = "Variable containing the product properties";
$MESS["CVP_CONVERT_CURRENCY"] = "Use only one currency to show prices";
$MESS["CVP_HIDE_NOT_AVAILABLE"] = "Hide items not in stock";
$MESS["CVP_SHOW_NAME"] = "Show name";
$MESS["CVP_SHOW_IMAGE"] = "Show image";
$MESS["CVP_ADDITIONAL_IMAGE"] = "Additional image";
$MESS["CVP_SHOW_OLD_PRICE"] = "Show previous price";
$MESS["CVP_SHOW_DISCOUNT_PERCENT"] = "Show discount percent";
$MESS["CVP_MESS_BTN_BUY_GIFT"] = "\"Select\" button text";
$MESS["CVP_MESS_BTN_ADD_TO_BASKET"] = "\"Add to cart\" button text";
$MESS["CVP_MESS_BTN_DETAIL"] = "\"Details\" button text";
$MESS["CVP_MESS_NOT_AVAILABLE"] = "Product unavailable message";
$MESS["CVP_MESS_BTN_BUY_GIFT_DEFAULT"] = "Select";
$MESS["CVP_MESS_BTN_ADD_TO_BASKET_DEFAULT"] = "Add to cart";
$MESS["CVP_MESS_BTN_DETAIL_DEFAULT"] = "Details";
$MESS["CVP_MESS_NOT_AVAILABLE_DEFAULT"] = "Out of stock";
$MESS["SGB_PARAMS_BLOCK_TITLE"] = "Text for \"Gift\" title";
$MESS["SGB_PARAMS_BLOCK_TITLE_DEFAULT"] = "Select a gift";
$MESS["SGB_PARAMS_HIDE_BLOCK_TITLE"] = "Hide \"Gifts\" title";
$MESS["SGB_PAGE_ELEMENT_COUNT"] = "Number of items per row";
$MESS["SGB_PARAMS_TEXT_LABEL_GIFT"] = "Text for \"Gift\" label";
$MESS["SGB_PARAMS_TEXT_LABEL_GIFT_DEFAULT"] = "Gift";
$MESS["SBB_AUTO_CALCULATION"] = "Cart auto recalculation";
$MESS["SGB_PARAMS_PLACE_GIFT"] = "Show \"Gifts\" block";
$MESS["SGB_PARAMS_PLACE_GIFT_TOP"] = "above shopping cart";
$MESS["SGB_PARAMS_PLACE_GIFT_BOTTOM"] = "below shopping cart";
$MESS["PATH_TO_ORDER_TIP"] = "The path name of the order completion page. You can specify only the file name if the page is in the current directory.";
$MESS["HIDE_COUPON_TIP"] = "Select \"Yes\" to hide the coupon code input field in the basket page.";
$MESS["COLUMNS_LIST_TIP"] = "Selected fields will be used as columns titles in a basket contents table.";
$MESS["SET_TITLE_TIP"] = "Checking this option will set the page title to \"My Shopping Cart\".";
$MESS["PRICE_VAT_INCLUDE_TIP"] = "Checking this option specifies to include tax in the display prices.";
$MESS["PRICE_VAT_SHOW_VALUE_TIP"] = "Specifies to show the tax value.";
$MESS["SBB_PREVIEW_PICTURE"] = "Image";
$MESS["SBB_DETAIL_PICTURE"] = "Detailed image";
$MESS["SBB_PREVIEW_TEXT"] = "Short description";
$MESS["SBB_COMPATIBLE_MODE"] = "Enable compatibility mode";
$MESS["SBB_IMAGE_SETTINGS"] = "Image settings";
$MESS["SBB_ADDITIONAL_IMAGE"] = "Additional image";
$MESS["SBB_BASKET_IMAGES_SCALING"] = "Product image view mode";
$MESS["SBB_ADAPTIVE"] = "Adaptive";
$MESS["SBB_STANDARD"] = "Standard";
$MESS["SBB_NO_SCALE"] = "Don't resize";
$MESS["SBB_DEFAULT"] = "Default";
$MESS["SBB_ANALYTICS_SETTINGS"] = "Analytics Preferences";
?>


text:
class NaiveBayesClassifier : public Classifier
{
public:

	NaiveBayesClassifier(std::shared_ptr<DiscretizerFactory> disc);

	class Builder : public Classifier::Builder
	{
	public:
		Builder(DiscretizerFactory::Creator discretizer, std::size_t defaultClassCount);

		virtual NaiveBayesClassifier* build();
		virtual NaiveBayesClassifier* build(const std::string&);
		virtual NaiveBayesClassifier* build(const XMLNode&);
		virtual std::unique_ptr<XMLNode> dismantleToXML(std::shared_ptr<Classifier>);
		virtual std::string dismantleToText(std::shared_ptr<Classifier>);

	private:
		std::shared_ptr<DiscretizerFactory> factory;
	};

	virtual void accept(ClassifierVisitor* visitor);

private:
	virtual Builder* doMakeBuilder();
	virtual ClassName doClassification(const ClassifierResults&) const;
	virtual ClassifierResults doCalculation(const ObjectDescription&) const;
	virtual void doRun();
	virtual void doStop();

	double probablilityFor(const ClassName&, const DiscretizedObjectDescription&) const;

	void teach();
	void discretizeAll();

	std::shared_ptr<DiscretizerFactory> discretizerFactory;

	DiscretizedObjectDescription discretizeSingleObject(const ObjectDescription&) const;

	DiscretizedClassDescriptionBase discretizedBase;
	std::vector<std::unique_ptr<Discretizer> > discretizers;

	std::vector<std::map<Discretized, std::map<ClassName, double> > > probabilities;
	double minProbability;
};

#endif


text:
/**
 * \file thread_id.h
 * \brief Header for Mutex functions
 */
#ifndef YAZ_THREAD_ID_H
#define YAZ_THREAD_ID_H

#include <stddef.h>
#include <yaz/yconfig.h>

YAZ_BEGIN_CDECL

/** \brief format current thread as printable C-string
    \param buf buffer for string
    \param buf_max maximum number of bytes (including trailing \\0)
 */

YAZ_EXPORT
void yaz_thread_id_cstr(char *buf, size_t buf_max);

YAZ_END_CDECL

#endif
/*
 * Local variables:
 * c-basic-offset: 4
 * c-file-style: "Stroustrup"
 * indent-tabs-mode: nil
 * End:
 * vim: shiftwidth=4 tabstop=8 expandtab
 */


text:
package simpledb;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
 * TableStats represents statistics (e.g., histograms) about base tables in a
 * query.
 *
 * This class is not needed in implementing lab1 and lab2.
 */
public class TableStats {
    private static final ConcurrentHashMap<String, TableStats> statsMap = new ConcurrentHashMap<String, TableStats>();

    static final int IOCOSTPERPAGE = 1000;
    static final double IMPUTE_COST_FUDGE_FACTOR = 1.0;

    public static TableStats getTableStats(String tablename) {
        TableStats stats = statsMap.get(tablename);
        if (stats == null) {
        	throw new RuntimeException("No table stats for " + tablename);
        }
        return stats;
    }

    public static void setTableStats(String tablename, TableStats stats) {
        statsMap.put(tablename, stats);
    }

    public static void setStatsMap(HashMap<String,TableStats> s)
    {
        try {
            java.lang.reflect.Field statsMapF = TableStats.class.getDeclaredField("statsMap");
            statsMapF.setAccessible(true);
            statsMapF.set(null, s);
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (SecurityException e) {
            e.printStackTrace();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }

    }

    public static Map<String, TableStats> getStatsMap() {
        return statsMap;
    }

    public static void computeStatistics() {
        Iterator<Integer> tableIt = Database.getCatalog().tableIdIterator();

        System.err.print("Computing table stats.");
        while (tableIt.hasNext()) {
            int tableid = tableIt.next();
            TableStats s = new TableStats(tableid, IOCOSTPERPAGE);
            setTableStats(Database.getCatalog().getTableName(tableid), s);
            System.err.print('.');
        }
        System.err.println(" done.");
    }

    /**
     * Number of bins for the histogram. Feel free to increase this value over
     * 100, though our tests assume that you have at least 100 bins in your
     * histograms.
     */
    static final int NUM_HIST_BINS = 100;

    private final IntHistogram[] intStats;
    private final StringHistogram[] stringStats;
    private final int ioCostPerPage;
    private final TupleDesc schema;
    private int numTuples;
    private final int[] nullStats;

    /**
     * Create a new TableStats object, that keeps track of statistics on each
     * column of a table
     *
     * @param tableid
     *            The table over which to compute statistics
     * @param ioCostPerPage
     *            The cost per page of IO. This doesn't differentiate between
     *            sequential-scan IO and disk seeks.
     */
    public TableStats(int tableid, int ioCostPerPage) {
    	this.ioCostPerPage = ioCostPerPage;

    	DbFile file = Database.getCatalog().getDatabaseFile(tableid);
    	schema = file.getTupleDesc();
    	final int numFields = schema.numFields();

    	intStats = new IntHistogram[numFields];
    	stringStats = new StringHistogram[numFields];
    	nullStats = new int[numFields];

		final int[] min = new int[numFields], max = new int[numFields];
		int nt = 0;
		Arrays.fill(min, Integer.MAX_VALUE);
		Arrays.fill(max, Integer.MIN_VALUE);
    	DbFileIterator iter = file.iterator(new TransactionId());
    	try {
    		iter.open();

    		// Get min/max values for integer columns.
			while (iter.hasNext()) {
				Tuple tup = iter.next();
				for (int i = 0; i < numFields; i++) {
					if (tup.getTupleDesc().getFieldType(i) == Type.INT_TYPE && !tup.getField(i).isMissing()) {
						int value = ((IntField)tup.getField(i)).getValue();
						min[i] = Math.min(min[i], value);
						max[i] = Math.max(max[i], value);
					}
				}
				nt++;
			}

	    	iter.rewind();

	    	// Fill in histograms.
			while (iter.hasNext()) {
				Tuple tup = iter.next();
				for (int i = 0; i < tup.getTupleDesc().numFields(); i++) {
					if (tup.getField(i).isMissing()) {
						nullStats[i]++;
					} else {
						switch (tup.getTupleDesc().getFieldType(i)) {
						case INT_TYPE:
							if (intStats[i] == null) {
								intStats[i] = new IntHistogram(NUM_HIST_BINS, min[i], max[i]);
							}
							intStats[i].addValue(tup, i);
							break;
						case STRING_TYPE:
							if (stringStats[i] == null) {
								stringStats[i] = new StringHistogram(NUM_HIST_BINS);
							}
							stringStats[i].addValue(tup, i);
							break;
						case DOUBLE_TYPE:
							break;
						default:
							throw new RuntimeException("Unexpected type.");
						}
					}
				}
			}
		} catch (NoSuchElementException | DbException | TransactionAbortedException e) {
			e.printStackTrace();
		} finally {
			this.numTuples = nt;
			iter.close();
		}
    }

	/**
	 * Meant to create copies of histogram information for imputation. Only works on integer columns.
	 *
	 * Solely to be used for copies, as sets ioCostPerPage and stringStats to null/dummy values
	 * @param intStats
	 * @param nullStats
	 */
	private TableStats(TupleDesc schema, IntHistogram[] intStats, int[] nullStats) {
		this.schema = schema;
		this.intStats = intStats;
		this.nullStats = nullStats;
		// we should be able to use any of the columns to count
		this.numTuples = computeTotalTuples();

		// unused
		stringStats = null;
		ioCostPerPage = -1;
	}

	public TableStats setNullStats(int[] nullStats) {
		TableStats copy = copyTableStats();
		assert(nullStats.length == copy.nullStats.length);
		System.arraycopy(nullStats, 0, copy.nullStats, 0, nullStats.length);
		copy.numTuples = copy.computeTotalTuples();
		return copy;
	}

    /**
     * Estimates the cost of sequentially scanning the file, given that the cost
     * to read a page is costPerPageIO. You can assume that there are no seeks
     * and that no pages are in the buffer pool.
     *
     * Also, assume that your hard drive can only read entire pages at once, so
     * if the last page of the table only has one tuple on it, it's just as
     * expensive to read as a full page. (Most real hard drives can't
     * efficiently address regions smaller than a page at a time.)
     *
     * @return The estimated cost of scanning the table.
     */
    public double estimateScanCost() {
		return ((double)totalTuples() / BufferPool.getPageSize()) * ioCostPerPage;
    }

    /**
     * This method returns the number of tuples in the relation, given that a
     * predicate with selectivity selectivityFactor is applied.
     *
     * @param selectivityFactor
     *            The selectivity of any predicates over the table
     * @return The estimated cardinality of the scan with the specified
     *         selectivityFactor
     */
    public int estimateTableCardinality(double selectivityFactor) {
        return (int) Math.round(totalTuples() * selectivityFactor);
    }

    /**
     * The average selectivity of the field under op.
     * @param field
     *        the index of the field
     * @param op
     *        the operator in the predicate
     * The semantic of the method is that, given the table, and then given a
     * tuple, of which we do not know the value of the field, return the
     * expected selectivity. You may estimate this value from the histograms.
     * */
    public double avgSelectivity(int field, Predicate.Op op) {
        // some code goes here
        return 1.0;
    }

    /**
     * Estimate the selectivity of predicate <tt>field op constant</tt> on the
     * table.
     *
     * @param field
     *            The field over which the predicate ranges
     * @param op
     *            The logical operation in the predicate
     * @param constant
     *            The value against which the field is compared
     * @return The estimated selectivity (fraction of tuples that satisfy) the
     *         predicate
     */
    public double estimateSelectivity(int field, Predicate.Op op, Field constant) {
    	boolean isNullConstant = constant.isMissing();
    	switch (schema.getFieldType(field)) {
    	case INT_TYPE:
    		if (isNullConstant) {
    			return intStats[field].estimateSelectivityNull(op);
    		} else {
    			return intStats[field].estimateSelectivity(op, ((IntField)constant).getValue());
    		}
    	case STRING_TYPE:
    		if (isNullConstant) {
    			return stringStats[field].estimateSelectivityNull(op);
    		} else {
    			return stringStats[field].estimateSelectivity(op, ((StringField)constant).getValue());
    		}
    	case DOUBLE_TYPE:
    		// TODO: Real selectivity estimation.
    		return 1.0;
    	default:
    		throw new RuntimeException("Unexpected type.");
    	}
    }

	/**
	 * Convenience wrapper for selectivity estimation
	 * @param pred
	 * @return
	 */
	public double estimateSelectivity(Predicate pred) {
		return estimateSelectivity(pred.getField(), pred.getOp(), pred.getOperand());
	}

    public double estimateTotalNull(Collection<Integer> fields) {
    	double ret = 0.0;
    	for (int field : fields) {
    		ret += nullStats[field];
    	}
    	return ret;
    }

    public double estimateTotalNull() {
    	double ret = 0.0;
    	for (int n : nullStats) {
    		ret += n;
    	}
    	return ret;
    }

    public double estimateVariance(int field){
    	return this.intStats[field].variance();
    }

    public double estimateMean(int field){
        return this.intStats[field].mean();
    }

    /**
     * return the total number of tuples in this table
     * */
    public int totalTuples() {
        return numTuples;
    }

	/**
	 * Actually calculate the total number of tuples (Rather than return the stored field)
	 * @return
	 */
	private int computeTotalTuples(){
		return (int) (intStats[0].countTuples() + nullStats[0]);
	}

	public Set<String> dirtyAttrs() {
		Set<String> ret = new HashSet<String>();
		for (int i = 0; i < schema.numFields(); i++) {
			if (nullStats[i] > 0) {
				ret.add(schema.getFieldName(i));
			}
		}
		return ret;
	}

	/**
	 * Create a copy of table stats instance
	 * @return
	 */
	public TableStats copyTableStats() {
		IntHistogram[] copyIntStats = new IntHistogram[intStats.length];
		int[] copyNullStats = new int[nullStats.length];

		assert(nullStats.length == intStats.length);
		for(int i = 0 ; i < intStats.length; i++) {
			// create copies of histograms
			copyIntStats[i] = intStats[i].copyHistogram();
			// copy over null counts
			copyNullStats[i] = nullStats[i];
		}

		return new TableStats(schema, copyIntStats, copyNullStats);
	}

	public void printValues(IntHistogram[] stats, int[] nulls) {
		System.out.println("Tuple estimates by attribute");
		for(int i = 0; i < stats.length; i++) {
			int ctNonNulls = (int) stats[i].countTuples();
			int ctNulls = nulls[i];
			System.out.print("Attribute " + i + ": ");
			System.out.print(" Non-null: " + ctNonNulls);
			System.out.print(" Null: " + ctNulls);
			System.out.print("\tTotal: " + (ctNonNulls + ctNulls) + "\n");
		}
	}

	/**
	 * Adjust tablestats to reflect imputation on indices using operation imp. The null count associated
	 * with these indices goes down to zero in all cases.
	 *
	 * For drop, we take the attribute that had the largest number of nulls, this provides a single-attribute-based
	 * conservative estimate of the smallest cardinality (i.e. we may have dropped even more tuples).
	 * After setting all other necessary columns' nulls to zero, scale the entire histogram to the new count.
	 *
	 * For imputations,
	 * the null counts are redistributed to the histogram according to the existing distribution, and then
	 * the null counts are set to zero.
	 *
	 * Creates a new instance
	 * @param imp imputation operation
	 * @param indices indices affected
	 * @return
	 */
	public TableStats adjustForImpute(ImputationType imp, Collection<Integer> indices) {
		TableStats copy = copyTableStats();
		switch(imp) {
			case DROP:
				int minCardinality = Integer.MAX_VALUE;
				for(int ix : indices) {
					copy.nullStats[ix] = 0;
					int estimate = (int) copy.intStats[ix].countTuples();
					minCardinality = (estimate < minCardinality) ? estimate : minCardinality;
				}
				// scale all buckets (including those not involved in imputation) to new cardinality estimate
				copy = copy.adjustToTotal(minCardinality);
				break;
			case MINIMAL:
				// intentional fall through
			case MAXIMAL:
				for(int ix : indices) {
					copy.intStats[ix].addToDistribution(copy.nullStats[ix]);
					copy.nullStats[ix] = 0;
				}
				break;
		}
		copy.numTuples = copy.computeTotalTuples();
		return copy;
	}

	/**
	 * Adjust the counts in all histograms based on the selectivity provided. Also adjusts null counts similarly.
	 *
	 * Creates a new instance.
	 * @param selectivity
	 * @return
	 */
	public TableStats adjustForSelectivity(double selectivity) {
		TableStats copy = copyTableStats();
		assert(intStats.length == nullStats.length);
		for(int i = 0; i < copy.intStats.length; i++) {
			copy.intStats[i].scaleBy(selectivity);
			copy.nullStats[i] = (int) (copy.nullStats[i] * selectivity);
		}
		// update number of tuples
		copy.numTuples = copy.computeTotalTuples();
		return copy;
	}

	/**
	 * Adjust counts such that the total number of tuples is equal to countTuples. It assigns values to buckets
	 * in each histogram according to existing distribution. Accounts for nulls.
	 *
	 * Creates a new instance
	 * @param totalCount new total count of tuples
	 * @return
	 */
	public TableStats adjustToTotal(double totalCount) {
		TableStats copy = copyTableStats();
		for(int i = 0; i < copy.intStats.length; i++) {
			// make sure to account for missing values
			double denom = copy.intStats[i].countTuples() + copy.nullStats[i];
			// with some floating point smudge
			double dirtyNull = (copy.nullStats[i] / denom) * totalCount;
			// integral value
			int cleanNull = (int) dirtyNull;
			// assign new null count
			copy.nullStats[i] = cleanNull;
			// scaleTo remainder amongst non-nulls, based on existing histogram
			copy.intStats[i].scaleTo(totalCount - cleanNull);
		}
		// update number of tuples
		copy.numTuples = copy.computeTotalTuples();
		return copy;
	}

	/**
	 * Combine two table stats instances
	 *
	 * Creates new instance
	 * @param other table stats to append
	 * @return
	 */
	public TableStats merge(TableStats other) {
		// create new instances to avoid modifying existing references
		TableStats copy1 = copyTableStats();
		IntHistogram[] intStats1 = copy1.intStats;
		int[] nullStats1 = copy1.nullStats;

		TableStats copy2 = other.copyTableStats();
		IntHistogram[] intStats2 = copy2.intStats;
		int[] nullStats2 = copy2.nullStats;

		// combine histograms
		IntHistogram[] combinedIntStats = new IntHistogram[intStats1.length + intStats2.length];
		System.arraycopy(intStats1, 0, combinedIntStats, 0, intStats1.length);
		System.arraycopy(intStats2, 0, combinedIntStats, intStats1.length, intStats2.length);

		// combine null stats
		int[] combinedNullStats = new int[nullStats1.length + nullStats2.length];
		System.arraycopy(nullStats1, 0, combinedNullStats, 0, nullStats1.length);
		System.arraycopy(nullStats2, 0, combinedNullStats, nullStats1.length, nullStats2.length);

		// combine schemas
		TupleDesc combinedSchema = TupleDesc.merge(schema, other.schema);

		return new TableStats(combinedSchema, combinedIntStats, combinedNullStats);
	}

	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer();
		for(int i = 0; i < intStats.length; i++) {
			sb.append("col ");
			sb.append(i);
			sb.append(": not null[");
			sb.append(intStats[i].countTuples());
			sb.append("], null[");
			sb.append(nullStats[i]);
			sb.append("]\n");
		}
		return sb.toString();
	}
}


text:
<mods xmlns="http://www.loc.gov/mods/v3" xmlns:exslt="http://exslt.org/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-3.xsd" version="3.3" ID="P0b002ee18c2219f4">
<name type="corporate">
 <namePart>United States Government Publishing Office</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">publisher</roleTerm>
  <roleTerm type="code" authority="marcrelator">pbl</roleTerm>
</role>
 <role>
  <roleTerm type="text" authority="marcrelator">distributor</roleTerm>
  <roleTerm type="code" authority="marcrelator">dst</roleTerm>
</role>
</name>
<name type="corporate">
 <namePart>United States</namePart>
 <namePart>United States District Court Eastern District of California</namePart>
 <role>
  <roleTerm type="text" authority="marcrelator">author</roleTerm>
  <roleTerm type="code" authority="marcrelator">aut</roleTerm>
</role>
 <description>Government Organization</description>
</name>
<typeOfResource>text</typeOfResource>
<genre authority="marcgt">government publication</genre>
<language>
 <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</language>
<extension>
 <collectionCode>USCOURTS</collectionCode>
 <category>Judicial Publications</category>
 <branch>judicial</branch>
 <dateIngested>2015-04-27</dateIngested>
</extension>
<originInfo>
 <publisher>Administrative Office of the United States Courts</publisher>
 <dateIssued encoding="w3cdtf">2015-04-24</dateIssued>
 <issuance>monographic</issuance>
</originInfo>
<physicalDescription>
 <note type="source content type">deposited</note>
 <digitalOrigin>born digital</digitalOrigin>
</physicalDescription>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="uri">http://www.gpo.gov/fdsys/pkg/USCOURTS-caed-1_14-cv-00932</identifier>
<identifier type="local">P0b002ee18c2219f4</identifier>
<recordInfo>
 <recordContentSource authority="marcorg">DGPO</recordContentSource>
 <recordCreationDate encoding="w3cdtf">2015-04-27</recordCreationDate>
 <recordChangeDate encoding="w3cdtf">2015-04-27</recordChangeDate>
 <recordIdentifier source="DGPO">USCOURTS-caed-1_14-cv-00932</recordIdentifier>
 <recordOrigin>machine generated</recordOrigin>
 <languageOfCataloging>
  <languageTerm authority="iso639-2b" type="code">eng</languageTerm>
</languageOfCataloging>
</recordInfo>
<accessCondition type="GPO scope determination">fdlp</accessCondition>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-caed-1_14-cv-00932</accessId>
 <courtType>District</courtType>
 <courtCode>caed</courtCode>
 <courtCircuit>9th</courtCircuit>
 <courtState>California</courtState>
 <courtSortOrder>2061</courtSortOrder>
 <caseNumber>1:14-cv-00932</caseNumber>
 <caseOffice>Fresno</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>550</natureSuitCode>
 <natureSuit>Prisoner - Civil Rights (U.S. defendant)</natureSuit>
 <cause>42:1983 Prisoner Civil Rights</cause>
 <party firstName="C." fullName="C. K. Chen" lastName="Chen" middleName="K." role="Defendant"></party>
 <party firstName="George" fullName="George McClure" lastName="McClure" role="Plaintiff"></party>
 <party firstName="L." fullName="L. D. Zamora" lastName="Zamora" middleName="D." role="Defendant"></party>
</extension>
<titleInfo>
 <title>(PC) McClure v. Chen, et al.</title>
 <partNumber>1:14-cv-00932</partNumber>
</titleInfo>
<location>
 <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/pkg/USCOURTS-caed-1_14-cv-00932/content-detail.html</url>
</location>
<classification authority="sudocs">JU 4.15</classification>
<identifier type="preferred citation">1:14-cv-00932;14-932</identifier>
<name type="corporate">
 <namePart>United States District Court Eastern District of California</namePart>
 <namePart>9th Circuit</namePart>
 <namePart>Fresno</namePart>
 <affiliation>U.S. Courts</affiliation>
 <role>
  <roleTerm authority="marcrelator" type="text">author</roleTerm>
  <roleTerm authority="marcrelator" type="code">aut</roleTerm>
</role>
</name>
<name type="personal">
 <displayForm>C. K. Chen</displayForm>
 <namePart type="family">Chen</namePart>
 <namePart type="given">C.</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<name type="personal">
 <displayForm>George McClure</displayForm>
 <namePart type="family">McClure</namePart>
 <namePart type="given">George</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Plaintiff</description>
</name>
<name type="personal">
 <displayForm>L. D. Zamora</displayForm>
 <namePart type="family">Zamora</namePart>
 <namePart type="given">L.</namePart>
 <namePart type="termsOfAddress"></namePart>
 <description>Defendant</description>
</name>
<extension>
 <docClass>USCOURTS</docClass>
 <accessId>USCOURTS-caed-1_14-cv-00932</accessId>
 <courtType>District</courtType>
 <courtCode>caed</courtCode>
 <courtCircuit>9th</courtCircuit>
 <courtState>California</courtState>
 <courtSortOrder>2061</courtSortOrder>
 <caseNumber>1:14-cv-00932</caseNumber>
 <caseOffice>Fresno</caseOffice>
 <caseType>civil</caseType>
 <natureSuitCode>550</natureSuitCode>
 <natureSuit>Prisoner - Civil Rights (U.S. defendant)</natureSuit>
 <cause>42:1983 Prisoner Civil Rights</cause>
 <party firstName="C." fullName="C. K. Chen" lastName="Chen" middleName="K." role="Defendant"></party>
 <party firstName="George" fullName="George McClure" lastName="McClure" role="Plaintiff"></party>
 <party firstName="L." fullName="L. D. Zamora" lastName="Zamora" middleName="D." role="Defendant"></party>
 <state>California</state>
</extension>
<relatedItem type="constituent" ID="id-USCOURTS-caed-1_14-cv-00932-0" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-caed-1_14-cv-00932/USCOURTS-caed-1_14-cv-00932-0/mods.xml">
 <titleInfo>
  <title>(PC) McClure v. Chen, et al.</title>
  <subTitle>ORDER of INTRADISTRICT TRANSFER from Sacramento (2:14-cv-1355 CMK PC) to Fresno (1:14-cv-0932 SKO PC) signed by Magistrate Judge Craig M. Kellison on 6/17/2014. (Yin, K)</subTitle>
  <partNumber>0</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2014-06-17</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-caed-1_14-cv-00932/pdf/USCOURTS-caed-1_14-cv-00932-0.pdf">
  <identifier type="FDsys Unique ID">D09002ee18c23b448</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-caed-1_14-cv-00932/USCOURTS-caed-1_14-cv-00932-0</identifier>
 <identifier type="former granule identifier">caed-1_14-cv-00932_0.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-caed-1_14-cv-00932/USCOURTS-caed-1_14-cv-00932-0/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-caed-1_14-cv-00932/pdf/USCOURTS-caed-1_14-cv-00932-0.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 1:14-cv-00932; (PC) McClure v. Chen, et al.; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-1_14-cv-00932-0</accessId>
  <sequenceNumber>0</sequenceNumber>
  <dateIssued>2014-06-17</dateIssued>
  <docketText>ORDER of INTRADISTRICT TRANSFER from Sacramento (2:14-cv-1355 CMK PC) to Fresno (1:14-cv-0932 SKO PC) signed by Magistrate Judge Craig M. Kellison on 6/17/2014. (Yin, K)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-caed-1_14-cv-00932-1" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-caed-1_14-cv-00932/USCOURTS-caed-1_14-cv-00932-1/mods.xml">
 <titleInfo>
  <title>(PC) McClure v. Chen, et al.</title>
  <subTitle>ORDER DISMISSING CASE WITH LEAVE TO AMEND signed by Magistrate Judge Sheila K. Oberto on 1/5/2015. First Amended Complaint due within thirty (30) days. (Attachments: # (1) Amended Complaint Form). (Jessen, A)</subTitle>
  <partNumber>1</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2015-01-06</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-caed-1_14-cv-00932/pdf/USCOURTS-caed-1_14-cv-00932-1.pdf">
  <identifier type="FDsys Unique ID">D09002ee18c23b445</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-caed-1_14-cv-00932/USCOURTS-caed-1_14-cv-00932-1</identifier>
 <identifier type="former granule identifier">caed-1_14-cv-00932_1.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-caed-1_14-cv-00932/USCOURTS-caed-1_14-cv-00932-1/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-caed-1_14-cv-00932/pdf/USCOURTS-caed-1_14-cv-00932-1.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 1:14-cv-00932; (PC) McClure v. Chen, et al.; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-1_14-cv-00932-1</accessId>
  <sequenceNumber>1</sequenceNumber>
  <dateIssued>2015-01-06</dateIssued>
  <docketText>ORDER DISMISSING CASE WITH LEAVE TO AMEND signed by Magistrate Judge Sheila K. Oberto on 1/5/2015. First Amended Complaint due within thirty (30) days. (Attachments: # (1) Amended Complaint Form). (Jessen, A)</docketText>
</extension>
</relatedItem>
<relatedItem type="constituent" ID="id-USCOURTS-caed-1_14-cv-00932-2" xlink:href="http://www.gpo.gov/fdsys/granule/USCOURTS-caed-1_14-cv-00932/USCOURTS-caed-1_14-cv-00932-2/mods.xml">
 <titleInfo>
  <title>(PC) McClure v. Chen, et al.</title>
  <subTitle>ORDER DENYING Motion for Appointment of Counsel 13, signed by Magistrate Judge Sheila K. Oberto on 4/24/15: Motion is DENIED without prejudice. (Hellings, J)</subTitle>
  <partNumber>2</partNumber>
</titleInfo>
 <originInfo>
  <dateIssued>2015-04-24</dateIssued>
</originInfo>
 <relatedItem type="otherFormat" xlink:href="http://www.gpo.gov/fdsys/pkg/USCOURTS-caed-1_14-cv-00932/pdf/USCOURTS-caed-1_14-cv-00932-2.pdf">
  <identifier type="FDsys Unique ID">D09002ee18c23b447</identifier>
</relatedItem>
 <identifier type="uri">http://www.gpo.gov/fdsys/granule/USCOURTS-caed-1_14-cv-00932/USCOURTS-caed-1_14-cv-00932-2</identifier>
 <identifier type="former granule identifier">caed-1_14-cv-00932_2.pdf</identifier>
 <location>
  <url access="object in context" displayLabel="Content Detail">http://www.gpo.gov/fdsys/granule/USCOURTS-caed-1_14-cv-00932/USCOURTS-caed-1_14-cv-00932-2/content-detail.html</url>
  <url access="raw object" displayLabel="PDF rendition">http://www.gpo.gov/fdsys/pkg/USCOURTS-caed-1_14-cv-00932/pdf/USCOURTS-caed-1_14-cv-00932-2.pdf</url>
</location>
 <extension>
  <searchTitle>USCOURTS 1:14-cv-00932; (PC) McClure v. Chen, et al.; </searchTitle>
  <courtName>United States District Court Eastern District of California</courtName>
  <state>California</state>
  <accessId>USCOURTS-caed-1_14-cv-00932-2</accessId>
  <sequenceNumber>2</sequenceNumber>
  <dateIssued>2015-04-24</dateIssued>
  <docketText>ORDER DENYING Motion for Appointment of Counsel 13, signed by Magistrate Judge Sheila K. Oberto on 4/24/15: Motion is DENIED without prejudice. (Hellings, J)</docketText>
</extension>
</relatedItem>
</mods>


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Runtime.InteropServices;

namespace Microsoft.VisualStudio.LanguageServices.Implementation.EditAndContinue.Interop
{
    [StructLayout(LayoutKind.Sequential)]
    internal struct ENCPROG_ACTIVE_STATEMENT_REMAP
    {
        public Guid ThreadId;
        public int MethodToken;
        public int OldMethodVersion;
        public int OldILOffset;
        public int NewStartLine;
        public int NewStartCol;
        public int NewEndLine;
        public int NewEndCol;
    }
}


text:
class CameraMMAL : public ICamera
{
public:
    CameraMMAL(const std::string path, const bool light_enable);
    virtual ~CameraMMAL();

    // icamera
    bool read_frame(cv::Mat &frame);

private:
    class CameraMMALImpl;
    typedef boost::shared_ptr < CameraMMALImpl > CameraMMALImplPtr;
    CameraMMALImplPtr impl_;
};


text:
<tool id="gemini_@BINARY@" name="GEMINI @BINARY@" version="@VERSION@.0">
    <description>List the gemini database tables and columns</description>
    <macros>
        <import>gemini_macros.xml</import>
        <token name="@BINARY@">db_info</token>
    </macros>
    <expand macro="requirements" />
    <expand macro="stdio" />
    <expand macro="version_command" />
    <command>
<![CDATA[
        gemini @BINARY@
            "${ infile }" | tr -s ' ' '\t'
            > "${ outfile }"
]]>
    </command>
    <inputs>
        <expand macro="infile" />
    </inputs>
    <outputs>
        <data name="outfile" format="tabular" />
    </outputs>
    <tests>
        <test>
            <param name="infile" value="gemini_comphets_input.db" ftype="gemini.sqlite" />
            <output name="outfile" file="gemini_dbinfo_result.tabular" />
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Because of the sheer number of annotations that are stored in gemini, there are admittedly too many columns to remember by rote.
If you can't recall the name of particular column, just use the db_info tool.
It will report all of the tables and all of the columns / types in each table::

 table_name          column_name                   type
 variants            chrom                         text
 variants            start                         integer
 variants            end                           integer
 variants            variant_id                    integer
 variants            anno_id                       integer
 variants            ref                           text
 variants            alt                           text
 variants            qual                          float
 variants            filter                        text
 variants            type                          text
 variants            sub_type                      text
 variants            gts                           blob
 variants            gt_types                      blob
 variants            gt_phases                     blob
 variants            gt_depths                     blob
 variants            call_rate                     float
 variants            in_dbsnp                      bool
 variants            rs_ids                        text
 variants            in_omim                       bool
 variants            clin_sigs                     text
 variants            cyto_band                     text
 variants            rmsk                          text
 variants            in_cpg_island                 bool
 variants            in_segdup                     bool
 variants            is_conserved                  bool
 variants            num_hom_ref                   integer
 variants            num_het                       integer
 variants            num_hom_alt                   integer
 variants            num_unknown                   integer
 variants            aaf                           float
 variants            hwe                           float
 variants            inbreeding_coeff              float
 variants            pi                            float
 variants            recomb_rate                   float
 variants            gene                          text
 variants            transcript                    text
 variants            is_exonic                     bool
 variants            is_coding                     bool
 variants            is_lof                        bool
 variants            exon                          text
 variants            codon_change                  text
 variants            aa_change                     text
 ...                 ...                           ...

For more columns see https://gemini.readthedocs.org/en/latest/content/tools.html#db-info-list-the-gemini-database-tables-and-columns

    ]]></help>
    <expand macro="citations"/>
</tool>


text:
<!DOCTYPE html>

	@include('views.parts.head')

		@include('views.parts.ga')

			@include('views.parts.menu')

			@yield('main')

		@include('views.parts.footer')

	@include('views.parts.scripts')


text:
(function() {
    'use strict';

    angular
        .module('assessoriaTorrellesApp')
        .controller('DashboardFooterController', DashboardFooterController);

    DashboardFooterController.$inject = ['Company'];

    function DashboardFooterController (Company) {
        var vm = this;

        vm.company = [];

        loadAll();

        function loadAll() {

            Company.get(function (result) {
                vm.company = result;
            });
        }

    }
})();


text:
package com.hazelcast.multimap.impl.txn;

import com.hazelcast.core.EntryEventType;
import com.hazelcast.multimap.impl.MultiMapContainer;
import com.hazelcast.multimap.impl.MultiMapDataSerializerHook;
import com.hazelcast.multimap.impl.MultiMapRecord;
import com.hazelcast.multimap.impl.MultiMapService;
import com.hazelcast.multimap.impl.MultiMapValue;
import com.hazelcast.multimap.impl.operations.MultiMapKeyBasedOperation;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.Data;
import com.hazelcast.spi.BackupAwareOperation;
import com.hazelcast.spi.Operation;

import java.io.IOException;
import java.util.Collection;
import java.util.Iterator;

public class TxnRemoveOperation extends MultiMapKeyBasedOperation implements BackupAwareOperation {

    long recordId;
    Data value;
    long startTimeNanos = -1;

    public TxnRemoveOperation() {
    }

    public TxnRemoveOperation(String name, Data dataKey, long recordId, Data value) {
        super(name, dataKey);
        this.recordId = recordId;
        this.value = value;
    }

    @Override
    public void run() throws Exception {
        startTimeNanos = System.nanoTime();
        MultiMapContainer container = getOrCreateContainer();
        MultiMapValue multiMapValue = container.getMultiMapValueOrNull(dataKey);
        response = true;
        if (multiMapValue == null || !multiMapValue.containsRecordId(recordId)) {
            response = false;
            return;
        }
        Collection<MultiMapRecord> coll = multiMapValue.getCollection(false);
        Iterator<MultiMapRecord> iter = coll.iterator();
        while (iter.hasNext()) {
            if (iter.next().getRecordId() == recordId) {
                iter.remove();
                break;
            }
        }
        if (coll.isEmpty()) {
            delete();
        }
    }

    @Override
    public void afterRun() throws Exception {
        long elapsed = Math.max(0, System.nanoTime() - startTimeNanos);
        final MultiMapService service = getService();
        service.getLocalMultiMapStatsImpl(name).incrementRemoveLatencyNanos(elapsed);
        if (Boolean.TRUE.equals(response)) {
            getOrCreateContainer().update();
            publishEvent(EntryEventType.REMOVED, dataKey, null, value);
        }
    }

    @Override
    public boolean shouldBackup() {
        return Boolean.TRUE.equals(response);
    }

    @Override
    public Operation getBackupOperation() {
        return new TxnRemoveBackupOperation(name, dataKey, recordId, value);
    }

    public long getRecordId() {
        return recordId;
    }

    @Override
    protected void writeInternal(ObjectDataOutput out) throws IOException {
        super.writeInternal(out);
        out.writeLong(recordId);
        out.writeData(value);
    }

    @Override
    protected void readInternal(ObjectDataInput in) throws IOException {
        super.readInternal(in);
        recordId = in.readLong();
        value = in.readData();
    }

    @Override
    public int getId() {
        return MultiMapDataSerializerHook.TXN_REMOVE;
    }

}


text:
User Federation

{{instance.displayName|capitalize}}

Add User Federation Provider

{{instance.providerName|capitalize}} User Federation Provider {{instance.displayName|capitalize}}

Add {{instance.providerName|capitalize}} User Federation Provider

Settings

Mappers

    <form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageRealm">
        <fieldset>
            <legend>Required Settings</legend>

                Provider ID

                    <input class="form-control" id="providerId" type="text" ng-model="instance.id" readonly>

                Console display name

                    <input class="form-control" id="consoleDisplayName" type="text" ng-model="instance.displayName" placeholder="defaults to id">

                <kc-tooltip>Display name of provider when linked in admin console.</kc-tooltip>

                Priority

                    <input class="form-control" id="priority" type="text" ng-model="instance.priority">

                <kc-tooltip>Priority of provider when doing a user lookup.  Lowest first.</kc-tooltip>

                {{option|capitalize}}

                    <input class="form-control" type="text" data-ng-model="instance.config[ option ]" >

        </fieldset>

        <fieldset>
            <legend>Sync settings</legend>

                Periodic full sync

                    <input ng-model="fullSyncEnabled" name="fullSyncEnabled" id="fullSyncEnabled" onoffswitch />

                <kc-tooltip>Does periodic full synchronization of provider users to Keycloak should be enabled or not</kc-tooltip>

                Full sync period

                    <input class="form-control" type="number" ng-model="instance.fullSyncPeriod" id="fullSyncPeriod" />

                <kc-tooltip>Period for full synchronization in seconds</kc-tooltip>

                Periodic changed users sync

                    <input ng-model="changedSyncEnabled" name="changedSyncEnabled" id="changedSyncEnabled" onoffswitch />

                <kc-tooltip>Does periodic synchronization of changed or newly created provider users to Keycloak should be enabled or not</kc-tooltip>

                Changed users sync period

                    <input class="form-control" type="number" ng-model="instance.changedSyncPeriod" id="changedSyncPeriod" />

                <kc-tooltip>Period for synchronization of changed or newly created provider users in seconds</kc-tooltip>

        </fieldset>

                <button kc-save>Save</button>
                <button kc-cancel data-ng-click="cancel()">Cancel</button>

                <button kc-save  data-ng-show="changed">Save</button>
                <button kc-reset data-ng-show="changed">Cancel</button>
                <button class="btn btn-primary" data-ng-click="triggerChangedUsersSync()" data-ng-hide="changed">Synchronize changed users</button>
                <button class="btn btn-primary" data-ng-click="triggerFullSync()" data-ng-hide="changed">Synchronize all users</button>
                <button class="btn btn-danger" data-ng-click="remove()" data-ng-hide="changed">Delete</button>

    </form>

<kc-menu></kc-menu>


text:
#include "queue.h"
#include <unistd.h>

typedef void* (*pfunc)(void*);
typedef struct {
	char root_path[128];
	que fd_que;
	pthread_cond_t cond;
	pthread_t *pth;
	int thread_num;
	pfunc thread_func;
	int start_flag;
	pthread_mutex_t path_mutex;
} factory, *p_fac;

void factory_init(p_fac, int, int, pfunc);
void factory_start(p_fac);

#endif


text:
cask "blockbench" do
  arch = Hardware::CPU.intel? ? "x64" : "arm64"

  version "4.1.3"

  if Hardware::CPU.intel?
    sha256 "e1bc36b9e394275eda57b33749f8305524fb675f2d52c8fd27f70b92a97fe641"
  else
    sha256 "cbbc1d63e518c8e344945650192df7161f23dfb91fd655f3ad2efc387407efdd"
  end

  url "https://github.com/JannisX11/blockbench/releases/download/v#{version}/Blockbench_#{arch}_#{version}.dmg",
      verified: "github.com/JannisX11/blockbench/"
  name "Blockbench"
  desc "3D model editor for boxy models and pixel art textures"
  homepage "https://www.blockbench.net/"

  livecheck do
    url :url
    strategy :github_latest
  end

  app "Blockbench.app"

  zap trash: "~/Library/Application Support/Blockbench"
end


text:
'use strict';

/**
 * distinct_projection.js
 *
 * Runs distinct, with a projection on an indexed field, and verifies the result.
 * The indexed field contains unique values.
 * Each thread operates on a separate collection.
 */
load('jstests/concurrency/fsm_libs/extend_workload.js');  // for extendWorkload
load('jstests/concurrency/fsm_workloads/distinct.js');    // for $config

var $config = extendWorkload($config, function($config, $super) {
    $config.data.prefix = 'distinct_projection_fsm';

    $config.states.distinct = function distinct(db, collName) {
        var query = {i: {$lt: this.numDocs / 2}};
        assertWhenOwnColl.eq(this.numDocs / 2, db[this.threadCollName].distinct('i', query).length);
    };

    return $config;
});


text:
namespace SharpArch.Domain.DomainModel
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Reflection;

    using Newtonsoft.Json;

    /// <summary>
    ///     Provides a standard base class for facilitating comparison of objects.
    /// </summary>
    /// <remarks>
    ///     For a discussion of the implementation of Equals/GetHashCode, see
    ///     http://devlicio.us/blogs/billy_mccafferty/archive/2007/04/25/using-equals-gethashcode-effectively.aspx
    ///     and http://groups.google.com/group/sharp-architecture/browse_thread/thread/f76d1678e68e3ece?hl=en for
    ///     an in depth and conclusive resolution.
    /// </remarks>
    [Serializable]
    public abstract class BaseObject
    {
        /// <summary>
        ///     To help ensure hash code uniqueness, a carefully selected random number multiplier
        ///     is used within the calculation. Goodrich and Tamassia's Data Structures and
        ///     Algorithms in Java asserts that 31, 33, 37, 39 and 41 will produce the fewest number
        ///     of collissions. See http://computinglife.wordpress.com/2008/11/20/why-do-hash-functions-use-prime-numbers/
        ///     for more information.
        /// </summary>
        private const int HashMultiplier = 31;

        /// <summary>
        ///     This static member caches the domain signature properties to avoid looking them up for
        ///     each instance of the same type.
        /// </summary>
        /// <remarks>
        ///     A description of the very slick ThreadStatic attribute may be found at
        ///     http://www.dotnetjunkies.com/WebLog/chris.taylor/archive/2005/08/18/132026.aspx
        /// </remarks>
        [ThreadStatic]
        private static Dictionary<Type, IEnumerable<PropertyInfo>> signaturePropertiesDictionary;

        /// <summary>
        ///     Determines whether the specified <see cref="System.Object" /> is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="Object" /> to compare with the current <see cref="Object" />.</param>
        /// <returns><c>true</c> if the specified <see cref="Object" /> is equal to this instance; otherwise, <c>false</c>.</returns>
        public override bool Equals(object obj)
        {
            var compareTo = obj as BaseObject;

            if (ReferenceEquals(this, compareTo))
            {
                return true;
            }

            return compareTo != null && this.GetType().Equals(compareTo.GetTypeUnproxied()) &&
                   this.HasSameObjectSignatureAs(compareTo);
        }

        /// <summary>
        ///     Returns a hash code for this instance.
        /// </summary>
        /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns>
        /// <remarks>
        ///     This is used to provide the hash code identifier of an object using the signature
        ///     properties of the object; although it's necessary for NHibernate's use, this can
        ///     also be useful for business logic purposes and has been included in this base
        ///     class, accordingly. Since it is recommended that GetHashCode change infrequently,
        ///     if at all, in an object's lifetime, it's important that properties are carefully
        ///     selected which truly represent the signature of an object.
        /// </remarks>
        public override int GetHashCode()
        {
            unchecked
            {
                var signatureProperties = this.GetSignatureProperties();

                // It's possible for two objects to return the same hash code based on
                // identically valued properties, even if they're of two different types,
                // so we include the object's type in the hash calculation
                var hashCode = this.GetType().GetHashCode();

                hashCode = signatureProperties.Select(property => property.GetValue(this, null))
                                              .Where(value => value != null)
                                              .Aggregate(hashCode, (current, value) => (current * HashMultiplier) ^ value.GetHashCode());

                if (signatureProperties.Any())
                {
                    return hashCode;
                }

                // If no properties were flagged as being part of the signature of the object,
                // then simply return the hash code of the base object as the hash code.
                return base.GetHashCode();
            }
        }

        /// <summary>
        ///     Returns the properties of the current object that make up the object's signature.
        /// </summary>
        /// <returns>A collection of <see cref="PropertyInfo"/> instances.</returns>
        public virtual IEnumerable<PropertyInfo> GetSignatureProperties()
        {
            IEnumerable<PropertyInfo> properties;

            // Init the signaturePropertiesDictionary here due to reasons described at
            // http://blogs.msdn.com/jfoscoding/archive/2006/07/18/670497.aspx
            if (signaturePropertiesDictionary == null)
            {
                signaturePropertiesDictionary = new Dictionary<Type, IEnumerable<PropertyInfo>>();
            }

            if (signaturePropertiesDictionary.TryGetValue(this.GetType(), out properties))
            {
                return properties;
            }

            return signaturePropertiesDictionary[this.GetType()] = this.GetTypeSpecificSignatureProperties();
        }

        /// <summary>
        ///     Determines whether the current object has the same object signature as the specified object.
        /// </summary>
        /// <param name="compareTo">The object to compare to.</param>
        /// <returns><c>true</c> if the current object has the same object signature as the specified object; otherwise, <c>false</c>.</returns>
        /// <remarks>You may override this method to provide your own comparison routine.</remarks>
        public virtual bool HasSameObjectSignatureAs(BaseObject compareTo)
        {
            var signatureProperties = this.GetSignatureProperties();

            if ((from property in signatureProperties
                 let valueOfThisObject = property.GetValue(this, null)
                 let valueToCompareTo = property.GetValue(compareTo, null)
                 where valueOfThisObject != null || valueToCompareTo != null
                 where (valueOfThisObject == null ^ valueToCompareTo == null) || (!valueOfThisObject.Equals(valueToCompareTo))
                 select valueOfThisObject).Any())
            {
                return false;
            }

            // If we've gotten this far and signature properties were found, then we can
            // assume that everything matched; otherwise, if there were no signature
            // properties, then simply return the default behavior of Equals.
            return signatureProperties.Any() || base.Equals(compareTo);
        }

        /// <summary>
        ///     Enforces the template method pattern to have child objects determine which specific
        ///     properties should and should not be included in the object signature comparison.
        /// </summary>
        /// <remarks>
        ///     Note that the the BaseObject already takes care of performance caching, so this
        ///     method shouldn't worry about caching...just return the goods man!
        /// </remarks>
        protected abstract IEnumerable<PropertyInfo> GetTypeSpecificSignatureProperties();

        /// <summary>
        ///     Returns the unproxied type of the current object.
        /// </summary>
        /// <remarks>
        ///     <para>
        ///         When NHibernate proxies objects, it masks the type of the actual entity object.
        ///         This wrapper burrows into the proxied object to get its actual type.
        ///     </para>
        ///     <para>
        ///         Although this assumes NHibernate is being used, it doesn't require any NHibernate
        ///         related dependencies and has no bad side effects if NHibernate isn't being used.
        ///     </para>
        ///     <para>
        ///         Related discussion is at http://groups.google.com/group/sharp-architecture/browse_thread/thread/ddd05f9baede023a ...thanks Jay Oliver!
        ///     </para>
        /// </remarks>
        protected virtual Type GetTypeUnproxied()
        {
            return this.GetType();
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>About Debugging </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="About Debugging ">
    <meta name="generator" content="docfx 2.15.5.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

                Contributors

Debugging

If you want to debug into the Bifrost source code from Visual Studio you need the symbols downloaded locally
In most situations, you'd typically want to just grab the debug-symbols, step into the code and figure out whatever it is you're interested in.

Using debug symbols

All official releases of Bifrost after v1.0.0.8 have the symbols available on SymbolSource.

Enable source server

To enable symbol server support within Visual Studio do the following:

Tools > Options > Debugging > General

Check "Enable source server support"

Tools > Options > Debugging > Symbols

Click the "new"-icon

Enter the following server: http://srv.symbolsource.org/pdb/Public

More resources:

SymbolSource.org

SymbolSource.org - Configuring Visual Studio

If you're using the pre release - continuously generated NuGet packages on MyGet, you can read more about how to configure
MyGets symbol server.

Source + PDB in the packages

All NuGet packages also include a src/ folder and the PDB files. We build all packages in release mode, but use the dotnet CLI option of generating
PDB files in addition. For some tooling, like ReSharper, it should then use this directly.

Get the source code

If you may want to get a bit more involved, and actually head over to the Bifrost GitHub repository
to get a given version of the code. The differnt versions are marked with tags, which should allow you to navigate between releases.

                    Improve this Doc

              Back to top

            Copyright © 2008-2017 Dolittle


text:
package com.lolay.logging;

import java.util.logging.LogManager;

public class LogConfiguration {
	public LogConfiguration() {
		String fileName = System.getProperty("java.util.logging.config.file");
		if (fileName == null) {
			fileName = "logging.properties";
		}

		try {
			LogManager.getLogManager().readConfiguration(Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName));
		} catch (Exception e) {
			System.out.println(String.format("Could not initialize java.util.logging from configuration file %s", fileName));
			e.printStackTrace();
		}

		System.out.println(String.format("Initialized java.util.logging from configuration file %s", fileName));
	}
}


text:
import { Component } from '@angular/core';
import { NgForm } from '@angular/forms';
import { Router } from '@angular/router';

import { AuthService } from './auth.service';

@Component({
  templateUrl: './login.component.html'
})
export class LoginComponent {
  errorMessage: string;
  pageTitle = 'Log In';

  constructor(private authService: AuthService,
              private router: Router) { }

  login(loginForm: NgForm): void {
    if (loginForm && loginForm.valid) {
      const userName = loginForm.form.value.userName;
      const password = loginForm.form.value.password;
      this.authService.login(userName, password);

      // Navigate to the Product List page after log in.
      if (this.authService.redirectUrl) {
        this.router.navigateByUrl(this.authService.redirectUrl);
      } else {
        this.router.navigate(['/products']);
      }
    } else {
      this.errorMessage = 'Please enter a user name and password.';
    }
  }
}


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.healthcare.v1beta1.model;

/**
 * Model definition for Finding.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Cloud Healthcare API. For a detailed explanation see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class Finding extends com.google.api.client.json.GenericJson {

  /**
   * Zero-based ending index of the found text, exclusively.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long end;

  /**
   * The type of information stored in this text range. For example, HumanName, BirthDate, or
   * Address.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String infoType;

  /**
   * The snippet of the sensitive text. This field is only populated during deidentification if
   * `store_quote` is set to true in DeidentifyConfig.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.String quote;

  /**
   * Zero-based starting index of the found text, inclusively.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key @com.google.api.client.json.JsonString
  private java.lang.Long start;

  /**
   * Zero-based ending index of the found text, exclusively.
   * @return value or {@code null} for none
   */
  public java.lang.Long getEnd() {
    return end;
  }

  /**
   * Zero-based ending index of the found text, exclusively.
   * @param end end or {@code null} for none
   */
  public Finding setEnd(java.lang.Long end) {
    this.end = end;
    return this;
  }

  /**
   * The type of information stored in this text range. For example, HumanName, BirthDate, or
   * Address.
   * @return value or {@code null} for none
   */
  public java.lang.String getInfoType() {
    return infoType;
  }

  /**
   * The type of information stored in this text range. For example, HumanName, BirthDate, or
   * Address.
   * @param infoType infoType or {@code null} for none
   */
  public Finding setInfoType(java.lang.String infoType) {
    this.infoType = infoType;
    return this;
  }

  /**
   * The snippet of the sensitive text. This field is only populated during deidentification if
   * `store_quote` is set to true in DeidentifyConfig.
   * @return value or {@code null} for none
   */
  public java.lang.String getQuote() {
    return quote;
  }

  /**
   * The snippet of the sensitive text. This field is only populated during deidentification if
   * `store_quote` is set to true in DeidentifyConfig.
   * @param quote quote or {@code null} for none
   */
  public Finding setQuote(java.lang.String quote) {
    this.quote = quote;
    return this;
  }

  /**
   * Zero-based starting index of the found text, inclusively.
   * @return value or {@code null} for none
   */
  public java.lang.Long getStart() {
    return start;
  }

  /**
   * Zero-based starting index of the found text, inclusively.
   * @param start start or {@code null} for none
   */
  public Finding setStart(java.lang.Long start) {
    this.start = start;
    return this;
  }

  @Override
  public Finding set(String fieldName, Object value) {
    return (Finding) super.set(fieldName, value);
  }

  @Override
  public Finding clone() {
    return (Finding) super.clone();
  }

}


text:
module Query
module Expression
class Equal
  def initialize(left, right)
    @left = left
    @right = right
  end

  def produce
    if @left.cpp_type == 'char*' || @right.cpp_type == 'char*'
      "strcmp(#{@left.value}, #{@right.value}) == 0"
    else
      "#{@left.value} == #{@right.value}"
    end
  end
end
end
end


text:
package gov.nih.nci.caintegrator.web.action.study.management;

import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import gov.nih.nci.caintegrator.domain.AbstractCaIntegrator2Object;
import gov.nih.nci.caintegrator.web.action.AbstractSessionBasedTest;
import gov.nih.nci.caintegrator.web.action.study.management.ViewExternalLinksAction;

import org.junit.Before;
import org.junit.Test;

import com.opensymphony.xwork2.Action;

public class ViewExternalLinksActionTest extends AbstractSessionBasedTest {

    private ViewExternalLinksAction action;

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();
        action = new ViewExternalLinksAction();
        action.setWorkspaceService(workspaceService);
    }

    @Test
    public void testPrepare() {
        action.prepare();
        verify(workspaceService, never()).getRefreshedEntity(any(AbstractCaIntegrator2Object.class));
        action.getExternalLinkList().setId(1l);
        action.prepare();
        verify(workspaceService, times(1)).getRefreshedEntity(any(AbstractCaIntegrator2Object.class));
    }

    @Test
    public void testExecute() {
        assertEquals(Action.SUCCESS, action.execute());

    }

}


text: SUnit tests for bags


text:
// -----------------------------------------------------------------------
//  <copyright file="LoggingEntryConfig.cs" company="">
//      Copyright (c) 2014-2015 OSky. All rights reserved.
//  </copyright>
//  <last-editor>Lmf</last-editor>
//  <last-date>2015-07-01 12:12</last-date>
// -----------------------------------------------------------------------

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

using OSky.Core.Configs.ConfigFile;
using OSky.Utility.Logging;

namespace OSky.Core.Configs
{
    /// <summary>
    /// 日志记录入口配置
    /// </summary>
    public class LoggingEntryConfig
    {
        /// <summary>
        /// 初始化一个<see cref="LoggingEntryConfig"/>类型的新实例
        /// </summary>
        public LoggingEntryConfig()
        {
            Enabled = true;
            EntryLogLevel = LogLevel.All;
        }

        /// <summary>
        /// 初始化一个<see cref="LoggingEntryConfig"/>类型的新实例
        /// </summary>
        internal LoggingEntryConfig(LoggingEntryElement element)
        {
            Enabled = element.Enabled;
            EntryLogLevel = element.EntryLogLevel;
        }

        /// <summary>
        /// 获取或设置 从入口控制是否允许记录日志
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// 获取或设置 入口允许记录的日志等级
        /// </summary>
        public LogLevel EntryLogLevel { get; set; }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Wang & Bai, FEMS Yeast Res. 8(5): 805 (2008)

#### Original name
Bullera pseudoschimicola F.Y. Bai, M. Takash. & Nakase

### Remarks
null


text:
package com.twu.biblioteca.util;

import org.junit.Before;
import org.junit.Test;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

import static org.junit.Assert.assertEquals;

public class UserInputTest {

    private final ByteArrayOutputStream out = new ByteArrayOutputStream();

    @Before
    public void setUp() throws Exception {
        System.setOut(new PrintStream(out));
    }

    @Test
    public void shouldObtainUserInput() throws Exception {
        ByteArrayInputStream in = new ByteArrayInputStream("hi".getBytes());
        System.setIn(in);
        assertEquals("hi", UserInput.obtainInput("Write the product name: "));
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
  PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<topic id="topic1" xml:lang="en">
  <title id="gj143896">pg_db_role_setting</title>

The <codeph>pg_db_role_setting</codeph> system catalog table records the default
      values of server configuration settings for each role and database combination.

There is a single copy of <codeph>pg_db_role_settings</codeph> per Greenplum
      Database cluster. This system catalog table is shared across all databases.

You can view the server configuration settings for your Greenplum Database
      cluster with <codeph>psql</codeph>'s <codeph>\drds</codeph> meta-command.

      <title>pg_catalog.pg_db_role_setting</title>
      <tgroup cols="4">
        <colspec colnum="1" colname="col1" colwidth="131pt"/>
        <colspec colnum="2" colname="col2" colwidth="86pt"/>
        <colspec colnum="3" colname="col3" colwidth="85pt"/>
        <colspec colnum="4" colname="col4" colwidth="147pt"/>

          <row>
            <entry colname="col1">column</entry>
            <entry colname="col2">type</entry>
            <entry colname="col3">references</entry>
            <entry colname="col4">description</entry>
          </row>

          <row>
            <entry colname="col1">
              <codeph>setdatabase</codeph>
            </entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3">pg_database.oid</entry>
            <entry colname="col4">The database to which the setting is applicable, or
              zero if the setting is not database-specific.</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>setrole</codeph>
            </entry>
            <entry colname="col2">oid</entry>
            <entry colname="col3">pg_authid.oid</entry>
            <entry colname="col4">The role to which the setting is applicable, or
              zero if the setting is not role-specific.</entry>
          </row>
          <row>
            <entry colname="col1">
              <codeph>setconfig</codeph>
            </entry>
            <entry colname="col2">text[]</entry>
            <entry colname="col3"/>
            <entry colname="col4">Per-database- and per-role-specific defaults for
              user-settable server configuration parameters.</entry>
          </row>

      </tgroup>

</topic>


text:
thirdparty_module_name='GoogleTest'

upstream_git_url='https://github.com/google/googletest.git'
upstream_git_branch='master'

github_compare=true

snapshot_author_name='GoogleTest Upstream'
snapshot_author_email='googletestframework@googlegroups.com'

snapshot_redact_cmd=''
snapshot_relative_path='src/itkgoogletest'
snapshot_paths='
CMakeLists.txt
googletest/CMakeLists.txt
googletest/cmake
googletest/src
googletest/include
'

source "${BASH_SOURCE%/*}/../../../Utilities/Maintenance/UpdateThirdPartyFromUpstream.sh"
update_from_upstream