text:
get_upstream() {
  rm -rf upstream
  #cp -rf orig upstream
  svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk upstream
}

get_current_rev() {
  cd upstream
  svn info | grep Revision | grep -o '[0-9]*'
}

list_files() {
  (cd $1; ls *.{cc,h,inc} 2> /dev/null)

}

change_comment_headers() {
  for f in $(list_files $1); do
    changed=$(awk 'NR != 2 && NR != 3' < $1/$f)
    echo "$changed" > $1/$f
  done
}

# ARGUMENTS: upstream_path local_path
# This function merges changes from the directory upstream_path to
# the directory  local_path.
merge() {
  upstream_path=upstream/$1
  local_path=$2
  change_comment_headers $upstream_path
  echo MERGE: $upstream_path
  all=$( (list_files $upstream_path; list_files $local_path) | sort | uniq)
  #echo $all
  for f in $all; do
    if  [ -f $upstream_path/$f -a -f $local_path/$f ]; then
      echo "FOUND IN BOTH     :" $f
      # diff -u $local_path/$f $upstream_path/$f
      cp -v $upstream_path/$f $local_path
    elif [ -f $upstream_path/$f ]; then
      echo "FOUND IN UPSTREAM :" $f
      cp -v $upstream_path/$f $local_path
      svn add $local_path/$f
    elif [ -f $local_path/$f ]; then
      echo "FOUND IN LOCAL    :" $f
      svn remove $local_path/$f
    fi
  done

}

fatal() {
  echo "$1"
  exit 1;
}

pwd | grep 'libsanitizer$' || \
  fatal "Run this script from libsanitizer dir"
get_upstream
CUR_REV=$(get_current_rev)
echo Current upstream revision: $CUR_REV
merge include/sanitizer include/sanitizer
merge lib/asan asan
merge lib/tsan/rtl tsan
merge lib/sanitizer_common sanitizer_common
merge lib/interception interception

rm -rf upstream

# Update the MERGE file.
cat << EOF > MERGE
$CUR_REV

The first line of this file holds the svn revision number of the
last merge done from the master library sources.
EOF


text:
Expectations are a way of checking that the state of your code matches your
expectation, similar to an `assert`. If the expectation is met, then everything
proceeds as normal. Otherwise, it throws an exception and aborts the current
test.

## Declaring an expectation

Expectations are easy to write. Just call `mettle::expect` with the *actual*
value you'd like to test and a *matcher* object. We'll look at matchers in
detail [later](#matchers), but for now, let's just look at a simple matcher:
`mettle::equal_to(x)` creates a matcher that will return `true` when the actual
value passed to `expect` is equal to `x` (according to the definition of `==`
for the type(s) in question).  Here it is all put together:

```c++
mettle::expect(the_beast, mettle::equal_to(666));
```

If this expectation failed, you'd see something like the following logged to
your console (with the name of the failing [test case](writing-tests.md#tests)
preceding it):

```plain
/path/to/test_file.cpp:13
expected: 666
actual:   123
```

### Describing an expectation

You can also provide an description for an expectation to make it easier to
figure out what it was testing if you get a failure:

```c++
mettle::expect("is 'to mega therion'?", the_beast, mettle::equal_to(666));
```

If this expectation fails, you'll see a message like the previous failure, but
with the description shown as well:

```plain
is 'to mega therion'? (/path/to/test_file.cpp:13)
expected: 666
actual:   123
```

!!! note
    Currently, only GCC supports getting the filename and line number
    automatically for an expectation. However, as compilers add support for
    `std::experimental::source_location`, mettle will automatically switch to
    showing these values. However, in the meantime you can use the
    `METTLE_EXPECT` macro in place of `mettle::expect` if you need to see the
    filename and line number.

## Printing objects

In the examples above, the error output shows the expected and actual values.
This is easy for simple types, like integers, but what about complex
user-defined types? We could use the stream output operator `<<` (and indeed,
this option is supported), but there are times where you might want the debug
output to be different from the normal output. In addition, not every type has
(or should have) an overload of `<<`.

Instead, we use `mettle::to_printable` to ensure that our object will be
displayed appropriately if we need to print it. This function returns an object
(of unspecified type) that can be printed with the usual stream output operator.
You can also pass an iterator pair to `to_printable` to print the entire range.
Of course, feel free to overload `to_printable` for your own types to show
whatever information you need to help debug test failures.

!!! note
    Much like overloaded operators and standard library functions like
    `std::swap`, mettle uses argument-dependent lookup (ADL) to find the
    appropriate overload of `to_printable`. This is, of course, subject to all
    the usual concerns with ADL, so keep this in mind when using `to_printable`.

## What is a matcher?

[Above](#declaring-an-expectation), we talked briefly about matchers and
showed how to use the equality matcher: `mettle::equal_to(666)`. Before we
continue any further, we should define what exactly a matcher is. *Matchers* are
composable functions that let you declare what you expect a value to be. The
composability of matchers allows you to build complex expections from a
relatively small set of simple matchers. What's more, matchers automatically
produce human-readable descriptions of what exactly they're testing, freeing you
from having to manually describe every expectation!

In addition, mettle comes with a collection of [built-in
matchers](built-in-matchers.md) that can be used (or combined together) to
perform most common tests. However, if these don't suffice, you can always
[write your own](#writing-your-own-matchers).

### How matchers work

The internals of a matcher are actually pretty simple; they're just function
objects inheriting from `mettle::matcher_tag` and also providing a `desc()`
member function that returns a string describing the matcher. All matchers can
be called with a single argument (the *actual* value in the expectation) and
returns whether the match was successful or not. To illustrate this more
concretely, the following defines a very simple matcher that checks if an `int`
is 0:

```c++
struct int_zero : matcher_tag {
  bool operator ()(int actual) const {
    return actual == 0;
  }

  std::string desc() const {
    return "is 0";
  }
};
```

## Composing matchers

Many of the built-in matchers, such as the [combinatoric
matchers](built-in-matchers.md#combinatoric), are *higher-order matchers*. That
is, they are created by taking other matchers as arguments. This allows you to
build more complex matchers that test multiple aspects of an object at once. For
instance, you might want to check that a value is in the range \[2, 4\). With
the [`all`](built-in-matchers.md#all) matcher, this is easy:

```c++
using namespace mettle;
expect(x, all(greater_equal(2), less(4)));
```

Similarly, there are higher-order matchers that operate on
[collections](built-in-matchers.md#collection), allowing you, for example, to
test that all elements of a container meet a certain condition:

```c++
using namespace mettle;
expect(v, each(greater(0)));
```

By composing matchers together, you can express *all* the expected state of an
object in one place, making it clearer what exactly you're testing. Furthermore,
since all matchers provide a description of what they match, these higher-order
matchers can automatically tell you in human-readable form what they expect. For
instance, our test to check if a value is between 2 and 4 above might print
something like this if it fails:

```
expected: all(>=2, <4)
actual:   5
```

## Mismatch messages

As we saw above, for most simple expectations, a failure will cause the
matcher's description to be printed out along with the actual value supplied to
`expect`. However, for some matchers, just seeing the actual value isn't very
useful. For example, with the [`thrown`](built-in-matchers.md#exception)
matchers, you already know that the actual value is a function, so printing that
fact out doesn't help.

Instead, matchers can choose to return a mismatch message that provides a
morer useful, special-case description of the actual value (along with the usual
`bool` to indicate if the matcher succeeded). For the `thrown` matcher, we can
then return a description of the exception the function *actually* threw (if
any). In this case, the matcher returns a `mettle::match_result` object (a
`bool` and a `std::string` description) when called instead of a solitary
`bool`. This makes the output for a failed test much nicer in this case:

```
expected: threw std::runtime_error(what: "bad")
actual:   threw std::runtime_error(what: "worse")
```

A `match_result` is implicity convertible to and from a `bool`, so matchers that
return `match_result`s can easily be mixed with ones that return `bool`s. You
can also use the `!` operator to invert a `match_result` and preserve its
message.

!!! note
    Despite the name "mismatch message", it's useful to provide a message even
    on success, since a successful match can easily become a mismatch simply by
    using the `is_not` matcher.

redpajama_set_name: RedPajamaGithub


text:
.class final Landroid/support/v7/widget/helper/ItemTouchHelper$Callback$2;
.super Ljava/lang/Object;
.source "ItemTouchHelper.java"

# interfaces
.implements Landroid/view/animation/Interpolator;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/support/v7/widget/helper/ItemTouchHelper$Callback;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

# direct methods
.method constructor <init>()V
    .locals 0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public getInterpolation(F)F
    .locals 2

    const/high16 v1, 0x3f800000    # 1.0f

    sub-float/2addr p1, v1

    mul-float v0, p1, p1

    mul-float/2addr v0, p1

    mul-float/2addr v0, p1

    mul-float/2addr v0, p1

    add-float/2addr v0, v1

    return v0
.end method


text:
package io.druid.timeline.partition;

import org.junit.Assert;
import org.junit.Test;

public class NoneShardSpecTest
{
  @Test
  public void testEqualsAndHashCode()
  {
    final ShardSpec one = new NoneShardSpec();
    final ShardSpec two = new NoneShardSpec();
    Assert.assertEquals(one, two);
    Assert.assertEquals(one.hashCode(), two.hashCode());
  }
}


text:
namespace NArms.WonderPrint.TypePrinters
{
    public class BooleanTypePrinter : TypePrinterBase<bool>
    {
        protected override string Format(bool value)
        {
            return value.ToString();
        }
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>com.getgero.motionsdk.receiver</title>
<meta name="date" content="2014-02-10">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

com.getgero.motionsdk.receiver

Classes

BootReceiver


text:
import snakeCase from 'lodash/snakeCase';

/**
 *
 * @param {string} actionName camelCase name of the action (e.g. someAction)
 * @param {string} suffix string that is going to be added at the end of the created action type
 * @param {string} prefix string that is going to be added at the beginning of the created action type
 * @return {string} upperSnakeCase action type (e.g. SOME_ACTION or with example suffix SOME_ACTION_SUFFIX)
 */
const createActionType = (actionName, suffix = '', prefix = '') => {
  const upperSnakeCase = snakeCase(actionName).toUpperCase();
  return `${prefix ? `${prefix.toUpperCase()}_` : ''}${upperSnakeCase}${suffix ? `_${suffix.toUpperCase()}` : ''}`;
};

export default createActionType;


text:
package org.assertj.core.api.shortarray;

import static org.assertj.core.api.Assertions.catchThrowable;
import static org.assertj.core.api.BDDAssertions.then;
import static org.assertj.core.error.ShouldNotBeNull.shouldNotBeNull;
import static org.assertj.core.test.ShortArrays.arrayOf;
import static org.mockito.Mockito.verify;

import org.assertj.core.api.ShortArrayAssert;
import org.assertj.core.api.ShortArrayAssertBaseTest;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

/**
 * Tests for <code>{@link ShortArrayAssert#containsOnlyOnce(Short[])}</code>.
 *
 * @author Lucero Garcia
 */
@DisplayName("ShortArrayAssert containsOnlyOnce(Short[])")
class ShortArrayAssert_containsOnlyOnce_with_Short_array_Test extends ShortArrayAssertBaseTest {

  @Test
  void should_fail_if_values_is_null() {
    // GIVEN
    Short[] values = null;
    // WHEN
    Throwable thrown = catchThrowable(() -> assertions.containsOnlyOnce(values));
    // THEN
    then(thrown).isInstanceOf(NullPointerException.class)
                .hasMessage(shouldNotBeNull("values").create());
  }

  @Override
  protected ShortArrayAssert invoke_api_method() {
    return assertions.containsOnlyOnce(new Short[] { 1, 2 });
  }

  @Override
  protected void verify_internal_effects() {
    verify(arrays).assertContainsOnlyOnce(getInfo(assertions), getActual(assertions), arrayOf(1, 2));
  }

}


text:
'''
	analyze assortativity of the graph in terms of degree only
	also, go through different thresholds and find the map:
	threshold -> degree_assortativity
'''
from igraph import *
import os
import numpy as np
import matplotlib.pyplot as plt
#########################
X = "0.2"
"""
#for RANDOM v1
f_in_graph_SR = "random_v1_threshold_graphs/rnd_SR_" + str(X) #+ "_1K"
IN_DIR = "../../../DATA/SR_graphs/"
f_out_plot_res = "random_v1_threshold_graphs/plot_da_rnd_v1_0.2.txt"
img_out_plot = "random_v1_threshold_graphs/da_rnd_v1.png"
"""
"""
#for RANDOM v2
f_in_graph_SR = "random_v2_threshold_graphs/" + str(X) + "_rnd2_SR"
IN_DIR = "../../../DATA/SR_graphs/"
f_out_plot_res = "random_v2_threshold_graphs/plot_da_rnd_v2_0.2.txt"
img_out_plot = "random_v2_threshold_graphs/da_rnd_v2.png"
"""
"""
#for RANDOM v27s (v22)
f_in_graph_SR = "random_v2_threshold_graphs/" + str(X) + "_rnd27s_SR"
IN_DIR = "../../../DATA/SR_graphs/"
f_out_plot_res = "random_v2_threshold_graphs/plot_da_rnd_v27s_0.2.txt"
img_out_plot = "random_v2_threshold_graphs/da_rnd_v27s.png"
"""

# for ORIGINAL
f_in_graph_SR = "threshold_graphs/filter_IDs_SR_0.2"
IN_DIR = "../../../DATA/SR_graphs/"
f_out_plot_res = "threshold_graphs/plot_da_0.2_weighted.txt"
img_out_plot = "threshold_graphs/da_weighted_7s.png"

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

#########################
# read from a file that is an edge list with SR weights
#########################
def read_in_SR_graph():
	G = Graph.Read_Ncol(f_in_graph_SR, directed=False, weights=True)
	print f_in_graph_SR
	return G

#########################
# for a given threshold, remove the edges with smaller SR
# and operate on that network to find the degree assortativity
#########################
def degree_assortativity(G, threshold):
	print "stats for %.2f" % threshold
	summary(G)
	to_delete_edges = [e.index for e in G.es if float(e["weight"]) <= threshold]
	G.delete_edges(to_delete_edges)
	# just a check
	not_connected_nodes = G.vs(_degree_eq=0)
	print len(not_connected_nodes)
	summary(G)

	#f_out_SR = "random_v1_threshold_graphs/" + str(threshold) + "_da_rnd_v1.txt"
	#sys.stdout = open(f_out_SR, 'w')
	#summary(G)
	#r = G.assortativity_degree(directed=False)

	r = G.assortativity(directed=False,types1=G.strength(weights='weight'))

	print "Degree assortativity for threshold %2f is %f " % (threshold, r)
	print
	return r

def plot_DA(xaxis, da):
	x = np.array(xaxis)
	y = np.array(da)
	plt.plot(x, y, 'c')
	plt.grid(True)
	plt.title('SR network')
	#plt.legend(bbox_to_anchor=(0, 1), bbox_transform=plt.gcf().transFigure)
	plt.ylabel('degree assortativity')
	plt.xlabel('SR threshold')
	plt.savefig(img_out_plot,format='png',dpi=700)

def main():
	os.chdir(IN_DIR)
	da = []
	xaxis = []

	G = read_in_SR_graph()

	f = open(f_out_plot_res, "w")
	for threshold in np.arange(0.2, 0.9, 0.01):
		s = degree_assortativity(G, threshold)
		da.append(s)
		xaxis.append(threshold)
		f.write(str(threshold) + '\t'+ str(s) + '\n')
	plot_DA(xaxis, da)

main()


text:
"""access to verb modules (local and imported"""

import sys
import os
import glob
import imp
from collections import OrderedDict

from mod import log, util, dep

# dictionary of "name: module"
verbs = {}

# dictionary of "projname: name"
proj_verbs = OrderedDict()

#-------------------------------------------------------------------------------
def import_verbs_from(proj_name, proj_dir, verb_dir) :
    """import all verb modules from a directory, populates the
    verb and proj_verbs global variables

    :param proj_dir:    name of project that owns verb_dir
    :param verb_dir:    directory with verb python scripts
    """
    global verbs, proj_verbs

    # make sure project-verbs find their modules
    if not proj_dir in sys.path :
        sys.path.insert(0, proj_dir)

    if os.path.isdir(verb_dir) :

        # get all .py file in verb dir
        verb_paths = glob.glob(verb_dir + '/*.py')
        if verb_paths :
            for verb_path in verb_paths :
                verb_module_name = os.path.split(verb_path)[1]
                verb_module_name = os.path.splitext(verb_module_name)[0]
                if not verb_module_name.startswith('__') :
                    if not verb_module_name in verbs :
                        fp, pathname, desc = imp.find_module(verb_module_name, [verb_dir])
                        verb_module = imp.load_module(verb_module_name, fp, pathname, desc)
                        verbs[verb_module_name] = verb_module
                        if proj_name not in proj_verbs :
                            proj_verbs[proj_name] = []
                        proj_verbs[proj_name].append(verb_module_name)

#-------------------------------------------------------------------------------
def import_verbs(fips_dir, proj_dir) :
    """import verbs from local and imported projects, populates
    the 'verbs' and 'proj_verbs' dictionaries

    :param fipsdir:     absolute fips directory
    :param proj_dir:    absolute project directory
    """

    # first import verbs from fips directory
    import_verbs_from('fips', fips_dir, fips_dir + '/verbs')

    # now go through all imported projects
    if fips_dir != proj_dir :
        _, imported_projs = dep.get_all_imports_exports(fips_dir, proj_dir)
        for imported_proj_name in imported_projs :
            imported_proj_dir = util.get_project_dir(fips_dir, imported_proj_name)
            import_verbs_from(imported_proj_name, imported_proj_dir, imported_proj_dir + '/fips-verbs')


text:
dmg_package 'Google Chrome' do
  dmg_name 'googlechrome'
  source node['chrome']['dmg_source']
  checksum node['chrome']['dmg_checksum']
  action :nothing
end.run_action(:install)


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <note/>
    <predicate lemma="respire">
        <note/>
        <roleset framnet="Breathing" id="respire.01" name="Breath" vncls="47.2">
            <roles>
                <role descr="Breather" f="" n="0"/>
                <note/>
            </roles>
            <note>Roleset based on internet search. Added due to parallel expansion of verbnet, propbank, and sense groupings. Verbnet class entity_specific_modes_being-47.2. Framenet class Breathing. Framed by Katie.</note>
            <example name="Scientific use example (process of changing oxygen to carbon monoxide)" src="Scientific use example (process of changing oxygen to carbon monoxide)" type="Scientific use example (process of changing oxygen to carbon monoxide)">
                <inflection aspect="ns" form="ns" person="ns" tense="ns" voice="ns"/>
                <text>Human lungs require oxygen [PRO] to respire.</text>
                <note/>
                <arg f="" n="0">[PRO]</arg>
                <rel f="">respire.</rel>
            </example>
            <example name="breathing example" src="breathing example" type="breathing example">
                <inflection aspect="ns" form="ns" person="ns" tense="ns" voice="ns"/>
                <text>The patient with lung cancer respires with difficulty.</text>
                <note/>
                <arg f="" n="0">The patient with lung cancer</arg>
                <rel f="">respires</rel>
                <arg f="mnr" n="m">with difficulty.</arg>
            </example>
        </roleset>
    </predicate>
</frameset>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Source code</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

001package io.ebeanservice.docstore.api;
002
003import java.io.IOException;
004
005/**
006 * Update the document store using a Ebean ORM query.
007 * <p>
008 * Executes a forEach query and updates the document store with the bean object graph returned by the query.
009 * </p>
010 */
011public interface DocStoreQueryUpdate<T> {
012
013  /**
014   * Process the bean storing in the document store.
015   */
016  void store(Object idValue, T bean) throws IOException;
017
018  /**
019   * Flush the changes to the document store.
020   */
021  void flush() throws IOException;
022
023}


text:
require_relative "pager/basic"
require_relative "pager/null"
require_relative "pager/system"
require_relative "pager/version"

module TTY
  module Pager
    Error = Class.new(StandardError)

    # Raised when pager is closed
    PagerClosed = Class.new(Error)

    # Raised when user provides unnexpected argument
    InvalidArgument = Class.new(Error)

    module ClassMethods
      # Create a pager
      #
      # @param [Boolean] :enabled
      #   disable/enable text paging
      # @param [String] :command
      #   the paging command
      # @param [IO] :input
      #   the object to send input to
      # @param [IO] :output
      #   the object to send output to
      # @param [Proc] :prompt
      #   a proc object that accepts page number
      # @param [Integer] :width
      #   the terminal width
      # @param [Integer] :height
      #   the terminal height
      #
      # @api public
      def new(enabled: true, command: nil, **options)
        select_pager(enabled: enabled, command: command).new(
          enabled: enabled, command: command, **options)
      end

      # Paginate content through null, basic or system pager.
      #
      # @example
      #   TTY::Pager.page do |pager|
      #     pager.write "some text"
      #   end
      #
      # @param [String] :text
      #   an optional blob of content
      # @param [String] :path
      #   a path to a file
      # @param [Boolean] :enabled
      #   whether or not to use null pager
      # @param [String] :command
      #   the paging command
      # @param [IO] :input
      #   the object to send input to
      # @param [IO] :output
      #   the object to send output to
      #
      # @api public
      def page(text = nil, path: nil, enabled: true, command: nil,
               **options, &block)
        select_pager(enabled: enabled, command: command).
          page(text, path: path, enabled: enabled, command: command,
               **options, &block)
      end

      # Select an appriopriate pager
      #
      # If the user disabled paging then a NullPager is returned,
      # otherwise a check is performed to find native system
      # command to perform pagination with SystemPager. Finally,
      # if no system command is found, a BasicPager is used which
      # is a pure Ruby implementation known to work on any platform.
      #
      # @param [Boolean] enabled
      #   whether or not to allow paging
      # @param [String] command
      #   the command to run if available
      #
      # @api private
      def select_pager(enabled: true, command: nil)
        commands = Array(command)

        if !enabled
          NullPager
        elsif SystemPager.exec_available?(*commands)
          SystemPager
        else
          BasicPager
        end
      end
    end

    extend ClassMethods

    private_class_method :select_pager
  end # Pager
end # TTY


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="co.ronash.pushesampleeclipse.MainActivity" >

    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:showAsAction="never"
        android:title="@string/action_settings"/>

</menu>


text:
/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */
#pragma once
#include <vector>
#include <map>
#include <sstream>
#include <string>
#include "ifcpp/model/GlobalDefines.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingObject.h"
#include "IfcSolidModel.h"
namespace IFC4X3
{
	class IFCQUERY_EXPORT IfcCsgSelect;
	//ENTITY
	class IFCQUERY_EXPORT IfcCsgSolid : public IfcSolidModel
	{
	public:
		IfcCsgSolid() = default;
		IfcCsgSolid( int id );
		virtual shared_ptr<BuildingObject> getDeepCopy( BuildingCopyOptions& options );
		virtual void getStepLine( std::stringstream& stream ) const;
		virtual void getStepParameter( std::stringstream& stream, bool is_select_type = false ) const;
		virtual void readStepArguments( const std::vector<std::string>& args, const std::map<int,shared_ptr<BuildingEntity> >& map, std::stringstream& errorStream );
		virtual void setInverseCounterparts( shared_ptr<BuildingEntity> ptr_self );
		virtual uint8_t getNumAttributes() const { return 1; }
		virtual void getAttributes( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
		virtual void getAttributesInverse( std::vector<std::pair<std::string, shared_ptr<BuildingObject> > >& vec_attributes ) const;
		virtual void unlinkFromInverseCounterparts();
		virtual uint32_t classID() const { return 2147822146; }

		// IfcRepresentationItem -----------------------------------------------------------
		// inverse attributes:
		//  std::vector<weak_ptr<IfcPresentationLayerAssignment> >	m_LayerAssignment_inverse;
		//  std::vector<weak_ptr<IfcStyledItem> >					m_StyledByItem_inverse;

		// IfcGeometricRepresentationItem -----------------------------------------------------------

		// IfcSolidModel -----------------------------------------------------------

		// IfcCsgSolid -----------------------------------------------------------
		// attributes:
		shared_ptr<IfcCsgSelect>								m_TreeRootExpression;
	};
}


text:
'use strict';

const {
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
} = require('ReactDOM-fb');

module.exports =
  __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.EventPluginUtils;


text:
theme :
  name : bootstrap-3
---
{% include abtsetup.html %}


text:
<?php

/**
 * @category   Zend
 * @package    Zend_Service
 * @subpackage DeveloperGarden
 * @copyright  Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @author     Marco Kaiser
 * @license    http://framework.zend.com/license/new-bsd     New BSD License
 */
class Zend_Service_DeveloperGarden_ConferenceCall_ConferenceSchedule
{
    /**
     * @var integer
     */
    public $minute = null;

    /**
     * @var integer
     */
    public $hour = null;

    /**
     * @var integer
     */
    public $dayOfMonth = null;

    /**
     * @var integer
     */
    public $month = null;

    /**
     * @var integer
     */
    public $year = null;

    /**
     * @var integer
     */
    public $recurring = 0;

    /**
     * @var integer
     */
    public $notify = 0;

    /**
     * possible recurring values
     *
     * @var array
     */
    private $_recurringValues = array(
        0 => 'no recurring',
        1 => 'hourly',
        2 => 'daily',
        3 => 'weekly',
        4 => 'monthly',
    );

    /**
     * constructor for schedule object, all times are in UTC
     *
     * @param integer $minute
     * @param integer $hour
     * @param integer $dayOfMonth
     * @param integer $month
     * @param integer $year
     * @param integer $recurring
     * @param integer $notify
     */
    public function __construct($minute, $hour, $dayOfMonth, $month, $year, $recurring = 0, $notify = 0)
    {
        $this->setMinute($minute)
             ->setHour($hour)
             ->setDayOfMonth($dayOfMonth)
             ->setMonth($month)
             ->setYear($year)
             ->setRecurring($recurring)
             ->setNotify($notify);
    }

    /**
     * returns the value of $minute
     *
     * @return integer
     */
    public function getMinute()
    {
        return $this->minute;
    }

    /**
     * sets $minute
     *
     * @param integer $minute
     * @return Zend_Service_DeveloperGarden_ConferenceCall_ConferenceSchedule
     */
    public function setMinute($minute)
    {
        $this->minute = $minute;
        return $this;
    }

    /**
     * returns the value of $hour
     *
     * @return integer
     */
    public function getHour()
    {
        return $this->hour;
    }

    /**
     * sets $hour
     *
     * @param integer $hour
     * @return Zend_Service_DeveloperGarden_ConferenceCall_ConferenceSchedule
     */
    public function setHour($hour)
    {
        $this->hour = $hour;
        return $this;
    }

    /**
     * returns the value of $dayOfMonth
     *
     * @return integer
     */
    public function getDayOfMonth()
    {
        return $this->dayOfMonth;
    }

    /**
     * sets $dayOfMonth
     *
     * @param integer $dayOfMonth
     * @return Zend_Service_DeveloperGarden_ConferenceCall_ConferenceSchedule
     */
    public function setDayOfMonth($dayOfMonth)
    {
        $this->dayOfMonth = $dayOfMonth;
        return $this;
    }

    /**
     * returns the value of $month
     *
     * @return integer
     */
    public function getMonth()
    {
        return $this->month;
    }

    /**
     * sets $month
     *
     * @param integer $month
     * @return Zend_Service_DeveloperGarden_ConferenceCall_ConferenceSchedule
     */
    public function setMonth($month)
    {
        $this->month = $month;
        return $this;
    }

    /**
     * returns the value of $year
     *
     * @return integer
     */
    public function getYear()
    {
        return $this->year;
    }

    /**
     * sets $year
     *
     * @param integer $year
     * @return Zend_Service_DeveloperGarden_ConferenceCall_ConferenceSchedule
     */
    public function setYear($year)
    {
        $this->year = $year;
        return $this;
    }

    /**
     * returns the value of $recurring
     *
     * @return integer
     */
    public function getRecurring()
    {
        return $this->recurring;
    }

    /**
     * sets $recurring
     *
     * @param integer $recurring
     * @return Zend_Service_DeveloperGarden_ConferenceCall_ConferenceSchedule
     */
    public function setRecurring($recurring)
    {
        if (!array_key_exists($recurring, $this->_recurringValues)) {
            // require_once 'Zend/Service/DeveloperGarden/ConferenceCall/Exception.php';
            throw new Zend_Service_DeveloperGarden_ConferenceCall_Exception(
                'Unknown ConferenceCall recurring mode.'
            );
        }
        $this->recurring = $recurring;
        return $this;
    }

    /**
     * returns the value of $notify
     *
     * @return integer
     */
    public function getNotify()
    {
        return $this->notify;
    }

    /**
     * sets $notify
     *
     * @param integer $notify
     * @return Zend_Service_DeveloperGarden_ConferenceCall_ConferenceSchedule
     */
    public function setNotify($notify)
    {
        $this->notify = $notify;
        return $this;
    }
}


text: first try at a successful drivetrain code for the master of the 2017 season


text:
package org.jetbrains.plugins.gradle.execution.test.runner;

import com.intellij.execution.ExecutionException;
import com.intellij.execution.Executor;
import com.intellij.execution.actions.JavaRerunFailedTestsAction;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.execution.testframework.TestTreeView;
import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil;
import com.intellij.execution.testframework.sm.runner.SMTestProxy;
import com.intellij.execution.testframework.sm.runner.states.TestStateInfo;
import com.intellij.execution.testframework.sm.runner.ui.SMRootTestProxyFormatter;
import com.intellij.execution.testframework.sm.runner.ui.TestTreeRenderer;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.externalSystem.execution.ExternalSystemExecutionConsoleManager;
import com.intellij.openapi.externalSystem.model.DataNode;
import com.intellij.openapi.externalSystem.model.ExternalProjectInfo;
import com.intellij.openapi.externalSystem.model.ProjectSystemId;
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTask;
import com.intellij.openapi.externalSystem.model.task.TaskData;
import com.intellij.openapi.externalSystem.service.execution.ExternalSystemRunConfiguration;
import com.intellij.openapi.externalSystem.service.internal.ExternalSystemExecuteTaskTask;
import com.intellij.openapi.externalSystem.util.ExternalSystemUtil;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.ui.SimpleTextAttributes;
import com.intellij.util.ObjectUtils;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.gradle.action.GradleRerunFailedTestsAction;
import org.jetbrains.plugins.gradle.service.project.GradleProjectResolverUtil;
import org.jetbrains.plugins.gradle.service.resolve.GradleCommonClassNames;
import org.jetbrains.plugins.gradle.util.GradleBundle;
import org.jetbrains.plugins.gradle.util.GradleConstants;

/**
 * @author Vladislav.Soroka
 * @since 2/18/14
 */
public class GradleTestsExecutionConsoleManager
  implements ExternalSystemExecutionConsoleManager<ExternalSystemRunConfiguration, GradleTestsExecutionConsole, ProcessHandler> {

  @NotNull
  @Override
  public ProjectSystemId getExternalSystemId() {
    return GradleConstants.SYSTEM_ID;
  }

  @NotNull
  @Override
  public GradleTestsExecutionConsole attachExecutionConsole(@NotNull final ExternalSystemTask task,
                                                            @NotNull final Project project,
                                                            @NotNull final ExternalSystemRunConfiguration configuration,
                                                            @NotNull final Executor executor,
                                                            @NotNull final ExecutionEnvironment env,
                                                            @NotNull final ProcessHandler processHandler) throws ExecutionException {
    final GradleConsoleProperties consoleProperties = new GradleConsoleProperties(configuration, executor);
    String testFrameworkName = configuration.getSettings().getExternalSystemId().getReadableName();
    String splitterPropertyName = SMTestRunnerConnectionUtil.getSplitterPropertyName(testFrameworkName);
    final GradleTestsExecutionConsole consoleView = new GradleTestsExecutionConsole(consoleProperties, splitterPropertyName);
    consoleView.initTaskExecutionView(project, processHandler, task.getId());
    SMTestRunnerConnectionUtil.initConsoleView(consoleView, testFrameworkName);
    consoleView.attachToProcess(processHandler);

    final TestTreeView testTreeView = consoleView.getResultsViewer().getTreeView();
    if (testTreeView != null) {
      TestTreeRenderer originalRenderer = ObjectUtils.tryCast(testTreeView.getCellRenderer(), TestTreeRenderer.class);
      if (originalRenderer != null) {
        originalRenderer.setAdditionalRootFormatter(new SMRootTestProxyFormatter() {
          @Override
          public void format(@NotNull SMTestProxy.SMRootTestProxy testProxy, @NotNull TestTreeRenderer renderer) {
            final TestStateInfo.Magnitude magnitude = testProxy.getMagnitudeInfo();
            if (magnitude == TestStateInfo.Magnitude.RUNNING_INDEX) {
              renderer.clear();
              renderer.append(GradleBundle.message(
                "gradle.test.runner.ui.tests.tree.presentation.labels.waiting.tests"),
                              SimpleTextAttributes.REGULAR_ATTRIBUTES
              );
            }
            else if (!testProxy.isInProgress() && testProxy.isEmptySuite()) {
              renderer.clear();
              renderer.append(GradleBundle.message(
                "gradle.test.runner.ui.tests.tree.presentation.labels.no.tests.were.found"),
                              SimpleTextAttributes.REGULAR_ATTRIBUTES
              );
            }
          }
        });
      }
    }

    if (task instanceof ExternalSystemExecuteTaskTask) {
      final ExternalSystemExecuteTaskTask executeTask = (ExternalSystemExecuteTaskTask)task;
      if (executeTask.getArguments() == null || !StringUtil.contains(executeTask.getArguments(), "--tests")) {
        executeTask.appendArguments("--tests *");
      }
    }

    return consoleView;
  }

  @Override
  public void onOutput(@NotNull GradleTestsExecutionConsole executionConsole,
                       @NotNull ProcessHandler processHandler,
                       @NotNull String text,
                       @NotNull Key processOutputType) {
    GradleTestsExecutionConsoleOutputProcessor.onOutput(executionConsole, text, processOutputType);
  }

  @Override
  public boolean isApplicableFor(@NotNull ExternalSystemTask task) {
    if (task instanceof ExternalSystemExecuteTaskTask) {
      final ExternalSystemExecuteTaskTask taskTask = (ExternalSystemExecuteTaskTask)task;
      if (!StringUtil.equals(taskTask.getExternalSystemId().getId(), GradleConstants.SYSTEM_ID.getId())) return false;

      return ContainerUtil.find(taskTask.getTasksToExecute(), taskToExecute -> {
        final ExternalProjectInfo externalProjectInfo =
          ExternalSystemUtil.getExternalProjectInfo(taskTask.getIdeProject(), getExternalSystemId(), taskTask.getExternalProjectPath());
        if (externalProjectInfo == null) return false;

        final DataNode<TaskData> taskDataNode = GradleProjectResolverUtil.findTask(
          externalProjectInfo.getExternalProjectStructure(), taskTask.getExternalProjectPath(), taskToExecute);
        return taskDataNode != null &&
               (("check".equals(taskDataNode.getData().getName()) && "verification".equals(taskDataNode.getData().getGroup())
                 || GradleCommonClassNames.GRADLE_API_TASKS_TESTING_TEST.equals(taskDataNode.getData().getType())));
      }) != null;
    }
    return false;
  }

  @Override
  public AnAction[] getRestartActions(@NotNull final GradleTestsExecutionConsole consoleView) {
    JavaRerunFailedTestsAction rerunFailedTestsAction =
      new GradleRerunFailedTestsAction(consoleView);
    rerunFailedTestsAction.setModelProvider(() -> consoleView.getResultsViewer());
    return new AnAction[]{rerunFailedTestsAction};
  }
}


text:
package com.bgstation0.android.sample.patternviewholder_;

import android.widget.TextView;

// ƒrƒ…[ƒzƒ‹ƒ_[ƒNƒ‰ƒXViewHolder
public class ViewHolder {	// ViewHolder'Ì'è‹`.
	public TextView tvName;	// –¼'O.
	public TextView tvAddress;	// ZŠ.
}


text:
<html>
<head>
    <title>Hello there</title>
    <script src="./main.js"></script>
</head>
<body>
You are looking ugly...err...lovely..!
</body>
</html>


text:
package uk.ac.open.kmi.iserve.discovery.ranking.impl;

import com.google.common.base.Function;
import com.google.common.collect.Maps;
import com.google.inject.Inject;
import uk.ac.open.kmi.iserve.sal.manager.NfpManager;
import uk.ac.open.kmi.msm4j.vocabulary.MSM_NFP;
import uk.ac.open.kmi.msm4j.vocabulary.SCHEMA;

import java.net.URI;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * User: Luca Panziera
 * Date: 07/02/2014
 * Time: 17:27
 */
public class ProviderPopularityScorer extends PopularityScorer {

    @Inject
    public ProviderPopularityScorer(NfpManager nfpManager) {
        super(nfpManager);
    }

    @Override
    public Map<URI, Double> apply(Set<URI> resources) {
        Map<URI, Object> providerObjectMap = getNfpManager().getPropertyValueOfResources(resources, URI.create(SCHEMA.provider.getURI()), URI.class);
        Map<URI, URI> providerMap = Maps.transformValues(providerObjectMap, new Function<Object, URI>() {
            @Override
            public URI apply(Object input) {
                if (input instanceof Set) {
                    if (((Set) input).isEmpty()) {
                        return null;
                    } else {
                        return (URI) ((Set) input).iterator().next();
                    }
                } else {
                    return (URI) input;
                }
            }
        });

        Map<URI, Object> popObjectsMap = getNfpManager().getPropertyValueOfResources(new HashSet<URI>(providerMap.values()), URI.create(MSM_NFP.hasPopularity.getURI()), Double.class);
        Map<URI, Double> popMap = Maps.transformValues(popObjectsMap, new Function<Object, Double>() {
            @Override
            public Double apply(Object input) {
                Double r;
                if (input instanceof Set) {
                    if (((Set) input).isEmpty()) {
                        return new Double(0);
                    } else {
                        r = (Double) ((Set) input).iterator().next();
                    }
                } else {
                    r = (Double) input;
                }
                if (r != null && r > 0) {
                    return r / 100;
                }
                return Double.valueOf(0);
            }
        });
        Map<URI, Double> result = Maps.newHashMap();
        for (URI resource : resources) {
            if (providerMap.get(resource) == null) {
                result.put(resource, new Double(0));
            } else {
                result.put(resource, popMap.get(providerMap.get(resource)));
            }
        }

        return result;
    }

    @Override
    public Map<URI, Double> apply(Set<URI> resources, String parameters) {
        return apply(resources);
    }
}


text:
layout: default
title: MegaBank Intranet
permalink: /intranet-example/
---

# MegaBank Intranet

Imagine this is your intranet.

Now imagine that the video below contains instructions that employees need when they are near a specific printer.

## How to use follow-me printing

**Boom!**

## Work smarter
Wasn't that magical? Using the power of tech wizardry we just made your phone teach you how to use an imaginary printer. (Of course if you were using this app for reals then you could have made that link go to any page on your intranet or the internet.)

By creating a smart workplace you can provide instructions about how to use a printer, or anything really, at the right time and place (literally). Relevant information pushed to your phone in context (when and where you need it).

* No more searching through a sea of endless pages on the intranet for some basic information.
* No need to rely on training you did eight months ago when you started working here.

This concludes out demonstration for today. Please watch your step as you exit the ride.


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity repository-class="Wpug\PostBundle\Entity\PostRepository" name="Wpug\PostBundle\Entity\Post">
    <many-to-one field="category" target-entity="Category" inversed-by="posts">
      <cascade>
        <cascade-all/>
      </cascade>
      <lifecycle-callbacks>
        <lifecycle-callback type="preUpdate"
            method="setCreatedAtValue" />
      </lifecycle-callbacks>
    </many-to-one>
    <id name="id" type="guid" column="id">
      <generator strategy="UUID"/>
    </id>
    <field name="title" type="string" column="title" length="100"/>
    <field name="body" type="text" column="body"/>
    <field name="private" type="boolean" column="is_private" nullable="true" />
  </entity>
</doctrine-mapping>


text:
package udacity.uelordi.com.popularmovies.services;

import android.util.Log;

import com.firebase.jobdispatcher.JobParameters;
import com.firebase.jobdispatcher.JobService;

import udacity.uelordi.com.popularmovies.utils.NotificationUtils;

/**
 * Created by uelordi on 04/06/2017.
 */

public class MovieJobService extends JobService {
    private static final String LOG_TAG = "MovieJobService";
    @Override
    public boolean onStartJob(JobParameters job) {
        Log.v(LOG_TAG, "onStartJob");
        MovieListUtils.initialize(getApplicationContext());
        NotificationUtils.notifyToTheUsers(getApplicationContext());
        return true;
    }
    @Override
    public boolean onStopJob(JobParameters job) {
        Log.v(LOG_TAG, "onStopJob");
        return false;
    }
}


text:
package com.chengjf.jfinaldemo.controller;

import javax.servlet.http.HttpSession;

import com.chengjf.jfinaldemo.common.Constants;
import com.chengjf.jfinaldemo.interceptor.UserInterceptor;
import com.chengjf.jfinaldemo.model.User;
import com.jfinal.aop.Before;

public class IndexController extends CommonController {

	public void index() {

//		HttpSession session = getSession();
//		User user = (User) session.getAttribute(Constants.SESSION_USER);
//		String username = user.getStr(User.USERNAME);
//		setAttr("username", username);

		render("index.html");
	}

}


text:
Rellena el formulario y pulsa el botón Guardar.

    <fichas-form ficha="ficha">

        <button type="submit" class="btn btn-primary" ng-click="guardar()">Guardar</button>
        <button class="btn btn-default" ng-click="cancelar()">Cancelar</button>

    </fichas-form>


text:
function update(entity, day) {
$("#g-trendline").empty();

$.getJSON('data/raw/lda_topics/' + entity + '/' + day + '.json', function(lda_topics_response){
  $('#lda_topic')
         .html("");
  lda_topics_response.words.forEach(function(word){

    $('#lda_topic')
         .append($("

")
         .text(word));
  });
});

/**
 * Data
 */
var data = {};

$.getJSON('data/processed/topics/' + entity + '/' + day + '.json', function(topics_response){
  $("#no-results").hide();
  data.topics = topics_response;

  if(data.topics.length == 0) $("#no-results").show();

  // Topic index for a faster access
  data.topicIndex = {};
  data.topics.forEach(function(topic) { data.topicIndex[topic.id] = topic; });

  // Only topics shown as bubbles
  data.bubble_topics = data.topics.slice(0, 50);

  // The ids of comments containing the topics shown as bubbles
  data.bubble_topic_comment_ids = [];
  data.bubble_topics.forEach(function(topic) {
    topic.comment_ids.forEach(function(id) {
      if (data.bubble_topic_comment_ids.indexOf(id) == -1) {
        data.bubble_topic_comment_ids.push(id);
      }
    });
  });

  // All the comments
  $.getJSON('data/processed/comments/' + entity + '/' + day + '.json', function(comments_response){
    data.comments = comments_response;

    // Comment index for a faster access
    data.commentIndex = {};
    data.comments.forEach(function(comment) { data.commentIndex[comment.id] = comment; });

    $.getJSON('data/raw/trends/' + entity + '.json', function(trends_response){
      data.trends = trends_response;

      (function() {
        var width = 512,
            height = 512;

        var padding = 4, // collision padding
            maxRadius = 62, // collision search radius
            maxComments = 12, // limit displayed mentions
            activeTopic; // currently-displayed topic

        var r = d3.scale.sqrt()
            .domain([0, d3.max(data.bubble_topics, function(d) { return d.count; })])
            .range([0, maxRadius]);

        var force = d3.layout.force()
            .gravity(0)
            .charge(0)
            .size([width, height])
            .on("tick", tick);

        var node = d3.select(".g-nodes").selectAll(".g-node"),
            label = d3.select(".g-labels").selectAll(".g-label");

        d3.select(".g-nodes").append("rect")
            .attr("class", "g-overlay")
            .attr("width", width)
            .attr("height", height)
            .on("click", clear);

        d3.select(window)
            .on("hashchange", hashchange);

        updateTopics(data.bubble_topics);
        hashchange();

        // Update the known topics.
        function updateTopics(topics) {
          topics.forEach(function(d, i) { d.r = Math.max(12, r(d.count)); }); // min. collision
          force.nodes(data.bubble_topics = topics).start();
          updateNodes();
          updateLabels();
        }

        // Update the displayed nodes.
        function updateNodes() {
          node = node.data(data.bubble_topics, function(d) { return d.name; });

          node.exit().remove();

          node.enter().append("a")
              .attr("class", function(d) { return "g-node "+d.sentiment; })
              .attr("xlink:href", function(d) { return "#" + encodeURIComponent(d.name); })
              .call(force.drag)
              .call(linkTopic)
            .append("circle");

          node.select("circle")
              .attr("r", function(d) { return r(d.count); });
        }

        // Update the displayed node labels.
        function updateLabels() {
          label = label.data(data.bubble_topics, function(d) { return d.name; });

          label.exit().remove();

          var labelEnter = label.enter().append("a")
              .attr("class", "g-label")
              .attr("href", function(d) { return "#" + encodeURIComponent(d.name); })
              .call(force.drag)
              .call(linkTopic);

          labelEnter.append("div")
              .attr("class", "g-name")
              .text(function(d) { return d.name; });

          labelEnter.append("div")
              .attr("class", "g-value");

          label
              .style("font-size", function(d) { return Math.max(8, r(d.count) / 2) + "px"; })
              .style("width", function(d) { return r(d.count) * 2.5 + "px"; });

          // Create a temporary span to compute the true text width.
          label.append("span")
              .text(function(d) { return d.name; })
              .each(function(d) { d.dx = Math.max(2.5 * r(d.count), this.getBoundingClientRect().width); })
              .remove();

          label
              .style("width", function(d) { return d.dx + "px"; })
            .select(".g-value")
              .text(function(d) { return d.count + (d.r > 60 ? " menções" : ""); });

          // Compute the height of labels when wrapped.
          label.each(function(d) { d.dy = this.getBoundingClientRect().height; });
        }

        // Update the active topic.
        function updateActiveTopic(topic) {
          if (activeTopic = topic) {
            node.classed("g-selected", function(d) { return d === topic; });
            updateMentions(topic);
            // d3.select("#g-topic").text((topic.commentsCount > maxComments ? "Uma amostra dos " : topic.commentsCount || "Não há") + " comentários que utilizam a palavra "" + topic.name + """);
          } else {
            node.classed("g-selected", false);
            updateMentions()
            // d3.select("#g-topic").text("Uma amostra dos comentários");
          }
        }

        // Update displayed comments.
        function updateMentions(topic) {
          // Display all the comments containing topics shown on bubbles
          // if no topic is given or the comments containing the given topic otherwise.
          var comments = (topic ? topic.comment_ids : data.bubble_topic_comment_ids).map(function(id) { return data.commentIndex[id]; });

          // If too many comments, a random sample is used
          if (comments.length > maxComments) {
            comments = shuffle(comments).slice(0, maxComments);
          }

          // Rather than compute a data-join, just blow away the entire layout.
          // With wider support for multi-column layout, a data-join would work.
          var column = d3.selectAll(".g-mentions")
              .datum(0)
              .html(null);

          var heights = column.data(),
              indexes = d3.range(heights.length);

          // Incrementally add each new speaker to the shortest column untill filling the available space
          var overflow = false;
          comments.forEach(function(comment) {
            if (overflow) return;

            var index = d3.first(indexes, function(a, b) { return heights[a] - heights[b]; });

            var div = d3.select(column[0][index]).append("div")
                .attr("class", "g-mention");

            // div.append("p")
            //     .attr("class", "date")
            //     .text("YYYY-MM-DD");

            var p = div.append("p")
                .attr("class", "mention")
                .html(comment.text);

            p.selectAll("a")
              .data(comment.topic_ids.map(function(id) { return data.topicIndex[id]; }))
                .attr("href", function(d) { return "#" + encodeURIComponent(d.name); })
                .attr("class", function(d) { return d == topic ? d.sentiment+" active" : d.sentiment; })
                .call(linkTopic);

            heights[index] += div.node().getBoundingClientRect().height;

            if (heights[index] > 370) {
              div.remove();
              overflow = true;
            }
          });
        }

        // Assign event handlers to topic links.
        function linkTopic(a) {
          a   .on("click", click)
              .on("mouseover", mouseover)
              .on("mouseout", mouseout);
        }

        // Returns the topic matching the specified name, approximately.
        // If no matching topic is found, returns undefined.
        function findTopic(name) {
          for (var i = 0, n = data.topics.length, t; i < n; ++i) {
            if ((t = data.topics[i]).name === name) {
              return t;
            }
          }
        }

        // Simulate forces and update node and label positions on tick.
        function tick(e) {
          node
              .each(gravity(e.alpha * .1))
              .each(collide(.5))
              .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; });

          label
              .style("left", function(d) { return (d.x - d.dx / 2) + "px"; })
              .style("top", function(d) { return (d.y - d.dy / 2) + "px"; });
        }

        // Custom gravity to favor a non-square aspect ratio.
        function gravity(alpha) {
          var cx = width / 2,
              cy = height / 2,
              ax = alpha / 4,
              ay = alpha / 4;
          return function(d) {
            d.x += (cx - d.x) * ax;
            d.y += (cy - d.y) * ay;
          };
        }

        // Resolve collisions between nodes.
        function collide(alpha) {
          var q = d3.geom.quadtree(data.bubble_topics);
          return function(d) {
            var r = d.r + maxRadius + padding,
                nx1 = d.x - r,
                nx2 = d.x + r,
                ny1 = d.y - r,
                ny2 = d.y + r;
            q.visit(function(quad, x1, y1, x2, y2) {
              if (quad.point && (quad.point !== d) && d.other !== quad.point && d !== quad.point.other) {
                var x = d.x - quad.point.x,
                    y = d.y - quad.point.y,
                    l = Math.sqrt(x * x + y * y),
                    r = d.r + quad.point.r + padding;
                if (l < r) {
                  l = (l - r) / l * alpha;
                  d.x -= x *= l;
                  d.y -= y *= l;
                  quad.point.x += x;
                  quad.point.y += y;
                }
              }
              return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1;
            });
          };
        }

        // Fisher–Yates shuffle.
        function shuffle(array) {
          var m = array.length, t, i;
          while (m) {
            i = Math.floor(Math.random() * m--);
            t = array[m];
            array[m] = array[i];
            array[i] = t;
          }
          return array;
        }

        // Update the active topic on hashchange, perhaps creating a new topic.
        function hashchange() {
          var name = decodeURIComponent(location.hash.substring(1)).trim();
          updateActiveTopic(name && name != "!" ? findTopic(name) : null);
        }

        // Clear the active topic when clicking on the chart background.
        function clear() {
          location.replace("#!");
        }

        // Rather than flood the browser history, use location.replace.
        function click(d) {
          location.replace("#" + encodeURIComponent(d === activeTopic ? "!" : d.name));
          d3.event.preventDefault();
        }

        // When hovering the label, highlight the associated node and vice versa.
        // When no topic is active, also cross-highlight with any mentions in excerpts.
        function mouseover(d) {
          node.classed("g-hover", function(p) { return p === d; });
          d3.selectAll(".g-mention a").classed("g-hover", function(a) { return a === d; });
        }

        // When hovering the label, highlight the associated node and vice versa.
        // When no topic is active, also cross-highlight with any mentions in excerpts.
        function mouseout(d) {
          node.classed("g-hover", false);
          d3.selectAll(".g-mention a").classed("g-hover", false);
        }

        })();

        /**
         * Trendline visualization
         */
        (function() {

        var settings = {
          animatinoDuration: 1000,
          eventTextHeight: 0,
          eventIconSize: 0,
          eventMargin: 2,
          markerColor: "#444",
          fillColor: "#FECEA8",
          strokeColor: "#E5BA94",
          strokeWidth: 2
        };

        function drawTrendline(svg, width, height, granularity, trends, options) {
          trends.forEach(function(trend) {
            if (typeof(trend.timestamp) == "string") {
              trend.timestamp = new Date(trend.timestamp);
            }
          });

          var xMin = d3.first(trends).timestamp;
          var xMax = d3.last(trends).timestamp;
          var yMin = 0;
          var yMax = d3.max(trends, function(d) { return d.value; });
          var xScale = d3.time.scale().domain([xMin, xMax]).range([0, width]);
          var yScale = d3.scale.linear().domain([yMin, yMax]).range([0, height-settings.eventTextHeight-settings.eventIconSize-2*settings.eventMargin]);
          var innerSvg = svg.append("svg:g").attr("class", "trendline").attr("transform", "translate(0,"+height+")");

          // Events
          innerSvg.selectAll(".event").remove();

          var prevEventX = 0;
          var prevEventY = 0;

          trends.forEach(function(trend) {
            var x = xScale(trend.timestamp);
            var y;

            if (trend.event) {
              y = x-prevEventX < settings.eventIconSize ? prevEventY-settings.eventIconSize : height;

              var eventSvg = innerSvg.append("svg:g")
              .attr("class", "event up "+trend.event.type)
              .attr("data-timestamp", trend.timestamp);

              eventSvg.append("svg:line")
              .attr("x1", x)
              .attr("x2", x)
              .attr("y1", 0)
              .attr("y2", -(y-settings.eventTextHeight-settings.eventIconSize-2*settings.eventMargin));

              eventSvg.append("svg:image")
              .attr("x", x-settings.eventIconSize/2)
              .attr("y", -(y-settings.eventTextHeight-settings.eventMargin))
              .attr("width", settings.eventIconSize+"px")
              .attr("height", settings.eventIconSize+"px")
              .attr("xlink:href", "img/trendline-event-icons/"+trend.event.type+".png")
              .on("mouseover", function() {
                highlightEvent(d3.event.target.parentNode);
              })
              .on("mouseout", function() {
                highlightEvent();
              })
              .on("click", function() {
                if (trend.event.type === "Match") {
                  switch (currentPage.type) {
                    case "home":
                    window.location.hash = "home&match="+trend.event.id;
                    break;
                    case "team":
                    case "player":
                    window.location.hash = currentPage.type+"="+currentPage.id+"&match="+trend.event.id;
                    break;
                  }
                }
              });

              eventSvg.append("svg:text")
              .attr("x", x)
              .attr("y", -height)
              .attr("text-anchor", "middle")
              .attr("alignment-baseline", "baseline")
              .text(trend.event.text);

              prevEventX = x;
              prevEventY = y;
            }

          });

          // Adjust text x position to be always visible
          innerSvg.selectAll("text")[0].forEach(function(text) {
            var bbox = text.getBBox();
            if (bbox.x < 0) {
              d3.select(text).attr("x", bbox.width/2);
            } else if (bbox.x + bbox.width > width) {
              d3.select(text).attr("x", width-bbox.width/2);
            }
          });

          //// Generators
          var areaGenerator = d3.svg.area()
          .x(function(d) { return xScale(d.timestamp); })
          .y1(function(d) { return -yScale(d.value); })
          .interpolate("linear");

          var lineGenerator = d3.svg.line()
          .x(function(d) { return xScale(d.timestamp); })
          .y(function(d) { return -yScale(d.value); })
          .interpolate("linear");

          var hitAreaGenerator = d3.svg.area()
          .x(function(d) { return xScale(d.timestamp); })
          .y1(function(d) { return -yScale(d.value)-20; })
          .interpolate("linear");

          //// Area/line
          var area = innerSvg.selectAll("path.area").data([trends]);
          updatePath(area, areaGenerator);

          var line = innerSvg.selectAll("path.line").data([trends]);
          updatePath(line, lineGenerator);

          var hitArea = innerSvg.selectAll("path.hit-area").data([trends]);
          updatePath(area, hitAreaGenerator);

          // Enter
          var newArea = area.enter()
          .append("svg:path")
          .attr("class", "area")
          .attr("fill", settings.fillColor);
          updatePath(newArea, areaGenerator);

          var newLine = line.enter()
          .append("svg:path")
          .attr("class", "line")
          .attr("fill", "transparent")
          .attr("stroke", settings.strokeColor)
          .attr("stroke-width", settings.strokeWidth);
          updatePath(newLine, lineGenerator);

          var marker = innerSvg.append("svg:circle")
          .attr("class", "marker")
          .attr("r", "4")
          .attr("fill", settings.markerColor);

          var newHitArea = hitArea.enter()
          .append("svg:path")
          .attr("class", "hit-area")
          .attr("fill", "transparent");
          updatePath(newHitArea, hitAreaGenerator);

          // Exit
          area.exit().remove(); // TODO check this
          line.exit().remove(); // TODO check this
          hitArea.exit().remove(); // TODO check this

          // Interactivity
          var trendsDict = {};
          trends.forEach(function(trend) {
            var timestamp = getDateRoundedToGranularity(trend.timestamp, granularity);
            trendsDict[timestamp] = trend;
          });

          var timeFormat = d3.time.format("%e %b %y")
          var maxTrend = trends.reduce(function(prevTrend, currentTrend) {
            return !prevTrend || currentTrend.value > prevTrend.value ? currentTrend : prevTrend;
          });

          function setMarker(timestamp) {
            var value = trendsDict[timestamp].value,
                tooltipText = value+" tweets, "+timeFormat(timestamp);
            marker.attr("cx", xScale(timestamp)).attr("cy", -yScale(value));
            d3.select("#trendline-tooltip").html(tooltipText);
            highlightEvent(".event[data-timestamp='"+timestamp+"']");
          }

          newHitArea
          .on("mouseout", function() {
            setMarker(maxTrend.timestamp);
          })
          .on("mousemove", function() {
            var timestamp = getDateRoundedToGranularity(xScale.invert(d3.mouse(d3.event.target)[0]), granularity);
            setMarker(timestamp);
          });

          setMarker(maxTrend.timestamp);
        }

        function updatePath(area, generator) {
          area.transition()
          .duration(settings.animatinoDuration)
          .attr("d", generator);
        }

        function highlightEvent(selector) {
          d3.selectAll(".event").classed("highlighted", false);
          if (selector) {
            d3.select(selector).classed("highlighted", true);
          }
        }

        function getDateRoundedToGranularity(date, granularity) {
          return new Date(Math.round(date.getTime()/granularity)*granularity);
        }

        drawTrendline(d3.select("#g-trendline"), 512, 80, 3600e3, data.trends);

        })();

    });

  });

});

}

function noResultsFound(){
  $("#no-results").show()
};

$(document).ready(function(){
  var entity = 'paulo_bento';
  var day = '2015-01-01';

  $.getJSON('data/entities.json', function(entities_response){
    entities_response.forEach(function(entity){
      $('#entity_select')
         .append($("<option></option>")
         .attr("value", entity['code'])
         .text(entity['name']));
    });

    $('#day').val(day);
    $('#entity_select').val(entity).change();
  });

  $('#entity_select').on('change', function() {
    entity = this.value
    update(entity, day);
  });

  $('#day').on('change', function() {
    day = this.value
    update(entity, day);
  });
});


text:
using System;
using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;

namespace VGAudio.Utilities
{
    public static class ArrayUnpacker
    {
        public static Array[] UnpackArrays(byte[] packedArrays)
        {
            packedArrays = TryDecompress(packedArrays);

            using (var stream = new MemoryStream(packedArrays))
            using (var reader = new BinaryReader(stream))
            {
                int compressed = reader.ReadByte();
                int version = reader.ReadByte();
                if (compressed != 0 || version != 0) throw new InvalidDataException();

                int count = reader.ReadUInt16();
                var arrays = new Array[count];

                for (int i = 0; i < count; i++)
                {
                    byte id = reader.ReadByte();
                    byte type = reader.ReadByte();
                    Type outType = TypeLookup[Helpers.GetHighNibble(type)];
                    byte rank = Helpers.GetLowNibble(type);
                    arrays[id] = UnpackArray(reader, outType, rank);
                }

                return arrays;
            }
        }

        private static Array UnpackArray(BinaryReader reader, Type outType, int rank)
        {
            byte modeType = reader.ReadByte();
            if (modeType == byte.MaxValue) return null;

            byte mode = Helpers.GetHighNibble(modeType);
            Type storedType = TypeLookup[Helpers.GetLowNibble(modeType)];
            Type elementType = Arrays.MakeJaggedArrayType(outType, rank - 1);

            switch (mode)
            {
                case 0:
                    {
                        int length = reader.ReadUInt16();

                        if (rank == 1)
                        {
                            return ReadArray(reader, storedType, elementType, length);
                        }

                        Array array = Array.CreateInstance(elementType, length);

                        for (int i = 0; i < length; i++)
                        {
                            array.SetValue(UnpackArray(reader, outType, rank - 1), i);
                        }

                        return array;
                    }
                case 1:
                    {
                        var dimensions = new int[rank];

                        for (int d = 0; d < dimensions.Length; d++)
                        {
                            dimensions[d] = reader.ReadUInt16();
                        }

                        return UnpackInternal(elementType, storedType, reader, 0, dimensions);
                    }
                case 2:
                    {
                        int length = reader.ReadUInt16();
                        var lengths = new int[length];

                        for (int i = 0; i < length; i++)
                        {
                            lengths[i] = reader.ReadUInt16();
                        }

                        Array array = Array.CreateInstance(elementType, length);

                        for (int i = 0; i < length; i++)
                        {
                            array.SetValue(ReadArray(reader, storedType, outType, lengths[i]), i);
                        }

                        return array;
                    }

                default:
                    throw new InvalidDataException();
            }
        }

        private static Array ReadArray(BinaryReader reader, Type storedType, Type outType, int length)
        {
            if (length == ushort.MaxValue) return null;

            int lengthBytes = length * Marshal.SizeOf(storedType);
            Array array = Array.CreateInstance(storedType, length);
            byte[] bytes = reader.ReadBytes(lengthBytes);
            Buffer.BlockCopy(bytes, 0, array, 0, lengthBytes);

            return storedType == outType ? array : CastArray(array, outType);
        }

        private static Array CastArray(Array inArray, Type outType)
        {
            Array outArray = Array.CreateInstance(outType, inArray.Length);

            for (int i = 0; i < inArray.Length; i++)
            {
                object inValue = inArray.GetValue(i);
                object outValue = Convert.ChangeType(inValue, outType);
                outArray.SetValue(outValue, i);
            }
            return outArray;
        }

        private static byte[] TryDecompress(byte[] data)
        {
            bool compressed = data[0] == 1;
            if (compressed)
            {
                int decompressedLength = BitConverter.ToInt32(data, 1);
                data = Inflate(data, 5, decompressedLength);
            }
            return data;
        }

        private static byte[] Inflate(byte[] compressed, int startIndex, int length)
        {
            var inflatedBytes = new byte[length];
            using (var stream = new MemoryStream(compressed))
            {
                stream.Position = startIndex;
                using (var deflate = new DeflateStream(stream, CompressionMode.Decompress))
                {
                    deflate.Read(inflatedBytes, 0, length);
                }
            }

            return inflatedBytes;
        }

        private static Array UnpackInternal(Type outType, Type storedType, BinaryReader reader, int depth, int[] dimensions)
        {
            if (depth >= dimensions.Length) return null;
            if (depth == dimensions.Length - 1)
            {
                return ReadArray(reader, storedType, outType, dimensions[depth]);
            }

            Array array = Array.CreateInstance(outType, dimensions[depth]);

            for (int i = 0; i < dimensions[depth]; i++)
            {
                array.SetValue(UnpackInternal(outType.GetElementType(), storedType, reader, depth + 1, dimensions), i);
            }

            return array;
        }

        private static readonly Type[] TypeLookup =
        {
            typeof(byte),
            typeof(sbyte),
            typeof(char),
            typeof(short),
            typeof(ushort),
            typeof(int),
            typeof(uint),
            typeof(long),
            typeof(ulong),
            typeof(float),
            typeof(double)
        };
    }
}


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

import org.junit.Test;

import java.util.BitSet;
import java.util.Set;
import java.util.TreeSet;

import static org.junit.Assert.assertTrue;

public class AuditLogTypeTest {

    private static final int bitsetSize = 12000;

    @Test
    public void testAuditLogTypeValueUniqueness() {
        BitSet bitset = new BitSet(bitsetSize);
        Set<Integer> nonUniqueValues = new TreeSet<Integer>();

        for (AuditLogType alt : AuditLogType.values()) {
            if (bitset.get(alt.getValue())) {
                nonUniqueValues.add(alt.getValue());
            }
            else {
                bitset.set(alt.getValue());
            }
        }
        assertTrue("AuditLogType contains the following non unique values: " + nonUniqueValues, nonUniqueValues.isEmpty());
    }
}


text:
[![Build Status](https://ci.appveyor.com/api/projects/status/github/DaveSenn/Extend?svg=true)](https://ci.appveyor.com/project/DaveSenn/Extend/branch/dev)

[![NuGet](https://img.shields.io/nuget/v/Extend.svg)](https://www.nuget.org/packages/Extend)
[![NuGet](https://img.shields.io/nuget/dt/Extend.svg)](https://www.nuget.org/packages/Extend)
[![GitHub issues](https://img.shields.io/github/issues/DaveSenn/Extend.svg)](https://github.com/DaveSenn/Extend/issues)

[![License](http://img.shields.io/:license-mit-blue.svg)](https://raw.githubusercontent.com/DaveSenn/Extend/dev/License.txt)

### What is this?

Extend is a set of .Net extension methods build as .NET Standard 1.1 library.
Extend enhance the .Net framework by adding a bunch of methods to increase developer's productivity.
Currently it contains 417 unique extension methods (657 overloads included).
### Where can I use it?
You can use it in every .Net application or library targeting one of the following profiles:
* .NET Standard 1.1
* .NET Core 1.1
* .NET 4.5

See ["Microsoft documentation"](https://docs.microsoft.com/en-us/dotnet/standard/net-standard) for a full list of all compatible frameworks.

### How do I use it?
1. Install ["Extend"](http://www.nuget.org/packages/Extend/) via [NuGet](http://nuget.org)
__Install-Package PortableExtensions__
2. Add using ```using Extend; ```
3. Done!

### Testing
To guarantee its stability Extend contains over 2400 unit tests.
Each method has test with different input parameters, including invalid values to test the exception handling.

### Example

Array to list using a selector:
```csharp
var myArray = new[] {"1", "2", "3"};
var intValues = myArray.ToList(x => x.ToInt32());
```

Action executing based on boolean values:
```csharp
var successful = SaveData();
successful.IfTrue(() => DisplaySuccess(), () => DisplayFailure());
successful.IfFalse(() => DisplayFailure(), () => DisplaySuccess());
```

Add to collection:
```csharp
var list = new List<String>();
list.AddIf(x => new Random().Next(0, 10) % 2 == 0, "Value");
list.AddIfNotContains( "Value #1");
list.AddRange("Value #1", "Value #2", "Value #3");
list.AddRangeIfNotContains("Value #1", "Value #2", "Value #3");
list.AddRangeIf(x => new Random().Next(0, 10) % 2 == 0, "Value", "Value #2", "Value #3");
```

Working with dictionaries
```csharp
var dictionary = new Dictionary<String, String>();
dictionary.AddOrUpdate("Key", "Value");
dictionary.AddRange(new Dictionary<String, String>
{
	{ "Key1", "Value1" },
	{ "Key2", "Value2" }
});
dictionary.GetOrAdd("Key", () => "Value");
var keyValueCsv = dictionary.StringJoin("=", ", ");
```
Working with IEnumerable<T>:
```csharp
var list = new List<String>();
var containsNotNullValues = list.AnyAndNotNull();
var distinctValues = list.Distinct(x => x.Substring(0, 2));
list.ForEach(x => { });
list.ForEachReverse(x => list.Remove(x));
```
Working with DateTime:
```csharp
var dateTime = DateTime.Now;
var stringValue = dateTime.ToLongDateShortTimeString();
var elapsed = dateTime.Elapsed();
var isFuture = dateTime.IsFuture();
var weekend = dateTime.IsWeekendDay();
```

String templates:
```csharp
"Today is the: {Today}".FormatWithObject( new { Today = DateTime.Now } );

"Today is the: {Today}".FormatWithObject( new Dictionary<String, Object> { { "Today", DateTime.Now } } );
```

### License
Licensed under the [MIT License](https://raw.githubusercontent.com/DaveSenn/Extend/dev/License.txt).


text:
namespace MassTransit.KafkaIntegration.Middleware
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using Confluent.Kafka;
    using Confluent.Kafka.Admin;
    using Logging;

    public class ConfigureKafkaTopologyFilter<TKey, TValue> :
        IFilter<ConsumerContext<TKey, TValue>>
        where TValue : class
    {
        readonly AdminClientConfig _config;
        readonly KafkaTopicOptions _options;
        readonly TopicSpecification _specification;

        public ConfigureKafkaTopologyFilter(IReadOnlyDictionary<string, string> clientConfig, KafkaTopicOptions options)
        {
            _options = options;
            _specification = _options.ToSpecification();
            _config = new AdminClientConfig(clientConfig.ToDictionary(x => x.Key, x => x.Value));
        }

        public async Task Send(ConsumerContext<TKey, TValue> context, IPipe<ConsumerContext<TKey, TValue>> next)
        {
            await context.OneTimeSetup<ConfigureTopologyContext<TKey, TValue>>(_ => CreateTopic(), () => new Context()).ConfigureAwait(false);

            await next.Send(context).ConfigureAwait(false);
        }

        public void Probe(ProbeContext context)
        {
            var scope = context.CreateFilterScope("configureTopology");
            scope.Add("specifications", _options);
        }

        async Task CreateTopic()
        {
            var client = new AdminClientBuilder(_config).Build();
            try
            {
                var options = new CreateTopicsOptions { RequestTimeout = _options.RequestTimeout };
                LogContext.Debug?.Log("Creating topic: {Topic}", _specification.Name);
                await client.CreateTopicsAsync(new[] { _specification }, options).ConfigureAwait(false);
            }
            catch (CreateTopicsException e)
            {
                if (!e.Results.All(x => x.Error.Reason.EndsWith("already exists.", StringComparison.OrdinalIgnoreCase)))
                {
                    EnabledLogger? logger = e.Error.IsFatal ? LogContext.Error : LogContext.Debug;
                    logger?.Log("An error occured creating topics. {Errors}", string.Join(", ", e.Results.Select(x => $"{x.Topic}:{x.Error.Reason}")));
                }
            }
            finally
            {
                client.Dispose();
            }
        }

        class Context :
            ConfigureTopologyContext<TKey, TValue>
        {
        }
    }
}


text:
// Copyright 2020 The Tilt Brush Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      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.

namespace TiltBrush {

public class ControllerBehaviorWand : BaseControllerBehavior {
  private bool m_QuickLoadHintRequested;
  // Fist time the promo appears for this sketch loading
  // (Promo is hidden if user presses the grip button, and we don't want to play the audio again
  // when the promo comes back)
  private bool m_QuickLoadHintFirstAppearance;

  void Start() {
    m_QuickLoadHintRequested = false;
  }

  public void EnableQuickLoadHintObject(bool bEnable) {
    m_QuickLoadHintFirstAppearance = true;
    m_QuickLoadHintRequested = bEnable;
  }

  public void EnableSketchbookPanelActivateHint(bool bEnable) {
    ControllerGeometry.MenuPanelHintObject.Activate(bEnable);
  }

  override protected void OnUpdate() {
    //update quick load hint
    var quickLoadHintObject = ControllerGeometry.QuickLoadHintObject;
    if (m_QuickLoadHintRequested) {
      //if we're supposed to show, make sure we can and update accordingly
      bool bCanShow = !SketchControlsScript.m_Instance.IsUserInteractingWithAnyWidget() &&
          !SketchControlsScript.m_Instance.IsUserGrabbingWorld() &&
          (VideoRecorderUtils.ActiveVideoRecording == null);
      if (bCanShow && !quickLoadHintObject.gameObject.activeSelf
          && m_QuickLoadHintFirstAppearance) {
        AudioManager.m_Instance.PlayHintAnimateSound(quickLoadHintObject.transform.position);
      }
      quickLoadHintObject.Activate(bCanShow);
      m_QuickLoadHintFirstAppearance = false;
    } else if (quickLoadHintObject.gameObject.activeSelf) {
      //if we're not supposed to show, turn us off if we're on
      quickLoadHintObject.gameObject.SetActive(false);
    }
  }

  override public void ActivateHint(bool bActivate) {
    ControllerGeometry.SwipeHintObject.Activate(bActivate);
  }

}
}  // namespace TiltBrush


text:
namespace Problem_1.School_classes.Interfaces
{
    public interface IName
    {
        string Name { get; }
    }
}


text:
@interface RNDeviceInfo : NSObject <RCTBridgeModule>

@end


text:
package org.kitesdk.data;

import org.kitesdk.data.spi.filesystem.DatasetTestUtilities;
import com.google.common.collect.ImmutableMultiset;
import com.google.common.io.Files;
import java.io.IOException;
import org.apache.avro.Schema;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import java.net.URI;
import java.util.Arrays;
import java.util.Collection;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.kitesdk.data.spi.DatasetRepository;
import org.kitesdk.data.spi.MemoryMetadataProvider;
import org.kitesdk.data.spi.MetadataProvider;

@RunWith(Parameterized.class)
public abstract class TestDatasetRepositories extends MiniDFSTest {

  protected static final String NAMESPACE = "ns1";
  protected static final String NAME = "test1";

  @Parameterized.Parameters
  public static Collection<Object[]> data() {
    Object[][] data = new Object[][] {
        { false },  // default to local FS
        { true } }; // default to distributed FS
    return Arrays.asList(data);
  }

  // whether this should use the DFS provided by MiniDFSTest
  private boolean distributed;

  protected Configuration conf;
  protected FileSystem fileSystem;
  protected Path testDirectory;
  protected DatasetDescriptor testDescriptor;
  protected MetadataProvider testProvider;
  protected Schema testSchema;

  // from subclasses
  protected DatasetRepository repo;

  abstract public DatasetRepository newRepo(MetadataProvider provider);

  public MetadataProvider newProvider(Configuration conf) {
    return new MemoryMetadataProvider(conf) {
      @Override
      protected URI newLocation(String name) {
        // not used, but make sure its in the testDirectory to keep clean
        return new Path(testDirectory, name).toUri();
      }
    };
  }

  public TestDatasetRepositories(boolean distributed) {
    this.distributed = distributed;
  }

  @Before
  public void setUp() throws IOException {
    this.testSchema = DatasetTestUtilities.USER_SCHEMA;

    Configuration tempConfig = new Configuration();
    tempConfig.setLong("fs.trash.interval", 1);

    this.conf = (distributed ?
        MiniDFSTest.getConfiguration() : tempConfig);

    this.fileSystem = FileSystem.get(conf);
    this.testDirectory = fileSystem.makeQualified(
        new Path(Files.createTempDir().getAbsolutePath()));
    this.testDescriptor = new DatasetDescriptor.Builder()
        .schema(testSchema)
        .build();

    this.testProvider = newProvider(conf);
    this.repo = newRepo(testProvider);
  }

  @After
  public void tearDown() throws IOException {
    fileSystem.delete(testDirectory, true);
  }

  @Test
  public void testCreate() {
    Assert.assertFalse("Sanity check", testProvider.exists(NAMESPACE, NAME));

    Dataset dataset = repo.create(NAMESPACE, NAME, testDescriptor);
    Assert.assertNotNull("Dataset should be returned", dataset);
    Assert.assertTrue("Dataset should exist", repo.exists(NAMESPACE, NAME));

    DatasetDescriptor saved = testProvider.load(NAMESPACE, NAME);
    Assert.assertNotNull("Dataset metadata is stored under name", saved);
    Assert.assertEquals("Saved metadata is returned",
        saved, dataset.getDescriptor());

    // TODO: Add test for namespace accessor
    Assert.assertEquals("Dataset name is propagated",
        NAME, dataset.getName());
    Assert.assertEquals("Dataset schema is propagated",
        testDescriptor.getSchema(), saved.getSchema());
    Assert.assertNotNull("Dataset should have a URI location",
        saved.getLocation());
    Assert.assertNotNull("Dataset location should have a scheme",
        saved.getLocation().getScheme());
  }

  public void ensureCreated() {
    // invoke the creation test so we have a dataset to test with.
    testCreate();
    Assert.assertTrue("Sanity check", testProvider.exists(NAMESPACE, NAME));
  }

  @Test(expected=NullPointerException.class)
  public void testCreateNullNamespace() {
    repo.create(null, NAME, testDescriptor);
  }

  @Test(expected=NullPointerException.class)
  public void testCreateNullName() {
    repo.create(NAMESPACE, null, testDescriptor);
  }

  @Test(expected=NullPointerException.class)
  public void testCreateNullDescriptor() {
    repo.create(NAMESPACE, NAME, null);
  }

  @Test
  public void testCreatePartitioned() throws IOException {
    DatasetDescriptor requested = new DatasetDescriptor.Builder(testDescriptor)
        .partitionStrategy(
            new PartitionStrategy.Builder().hash("username", 3).build())
        .build();
    Assert.assertFalse("Sanity check", testProvider.exists(NAMESPACE, "test2"));

    Dataset dataset = repo.create(NAMESPACE, "test2", requested);

    DatasetDescriptor saved = testProvider.load(NAMESPACE, "test2");
    Assert.assertNotNull("Dataset metadata is stored under name", saved);
    Assert.assertEquals("Saved metadata is returned",
        saved, dataset.getDescriptor());

    Assert.assertEquals("Dataset name is propagated",
        "test2", dataset.getName());
    Assert.assertEquals("Dataset schema is propagated",
        requested.getSchema(), saved.getSchema());
    Assert.assertEquals("Dataset partition strategy propagated",
        requested.getPartitionStrategy(), saved.getPartitionStrategy());
  }

  @Test(expected = DatasetExistsException.class)
  public void testCreateAlreadyExists() {
    ensureCreated();

    // create the same dataset again, this time it should fail
    repo.create(NAMESPACE, NAME, new DatasetDescriptor.Builder()
        .schema(testSchema).build());
  }

  @Test
  public void testUpdateSuccessWithoutChanges() {
    ensureCreated();
    repo.update(NAMESPACE, NAME, testProvider.load(NAMESPACE, NAME));
  }

  @Test(expected=DatasetNotFoundException.class)
  public void testUpdateNoDataset() {
    Assert.assertFalse("Sanity check", testProvider.exists(NAMESPACE, NAME));

    repo.update(NAMESPACE, NAME, testDescriptor);
  }

  @Test(expected=NullPointerException.class)
  public void testUpdateNullNamespace() {
    ensureCreated();

    repo.update(null, NAME, testDescriptor);
  }

  @Test(expected=NullPointerException.class)
  public void testUpdateNullName() {
    ensureCreated();

    repo.update(NAMESPACE, null, testDescriptor);
  }

  @Test(expected=NullPointerException.class)
  public void testUpdateNullDescriptor() {
    ensureCreated();

    repo.update(NAMESPACE, NAME, null);
  }

  @Test
  public void testListDatasets() {
    Assert.assertEquals(ImmutableMultiset.<String>of(),
        ImmutableMultiset.copyOf(repo.datasets(NAMESPACE)));

    repo.create(NAMESPACE, "test1", testDescriptor);
    Assert.assertEquals(ImmutableMultiset.of("test1"),
        ImmutableMultiset.copyOf(repo.datasets(NAMESPACE)));

    repo.create(NAMESPACE, "test2", testDescriptor);
    Assert.assertEquals(ImmutableMultiset.of("test1", "test2"),
        ImmutableMultiset.copyOf(repo.datasets(NAMESPACE)));

    repo.create(NAMESPACE, "test3", testDescriptor);
    Assert.assertEquals(ImmutableMultiset.of("test1", "test2", "test3"),
        ImmutableMultiset.copyOf(repo.datasets(NAMESPACE)));

    repo.delete(NAMESPACE, "test2");
    Assert.assertEquals(ImmutableMultiset.of("test1", "test3"),
        ImmutableMultiset.copyOf(repo.datasets(NAMESPACE)));

    repo.delete(NAMESPACE, "test3");
    Assert.assertEquals(ImmutableMultiset.of("test1"),
        ImmutableMultiset.copyOf(repo.datasets(NAMESPACE)));

    repo.delete(NAMESPACE, "test1");
    Assert.assertEquals(ImmutableMultiset.<String>of(),
        ImmutableMultiset.copyOf(repo.datasets(NAMESPACE)));
  }

  @Test
  public void testListNamespaces() {
    DatasetDescriptor anotherDescriptor = new DatasetDescriptor
        .Builder(testDescriptor)
        .property("prop", "value")
        .build();

    Assert.assertEquals(ImmutableMultiset.<String>of(),
        ImmutableMultiset.copyOf(repo.namespaces()));

    repo.create("test1", "d1", testDescriptor);
    repo.create("test1", "d2", anotherDescriptor);
    Assert.assertEquals(ImmutableMultiset.of("test1"),
        ImmutableMultiset.copyOf(repo.namespaces()));

    repo.create("test2", "d1", testDescriptor);
    repo.create("test2", "d2", anotherDescriptor);
    Assert.assertEquals(ImmutableMultiset.of("test1", "test2"),
        ImmutableMultiset.copyOf(repo.namespaces()));

    repo.create("test3", "d1", testDescriptor);
    repo.create("test3", "d2", anotherDescriptor);
    Assert.assertEquals(ImmutableMultiset.of("test1", "test2", "test3"),
        ImmutableMultiset.copyOf(repo.namespaces()));

    repo.delete("test2", "d2");
    Assert.assertEquals(ImmutableMultiset.of("test1", "test2", "test3"),
        ImmutableMultiset.copyOf(repo.namespaces()));

    repo.delete("test2", "d1");
    Assert.assertEquals(ImmutableMultiset.of("test1", "test3"),
        ImmutableMultiset.copyOf(repo.namespaces()));

    repo.delete("test3", "d2");
    Assert.assertEquals(ImmutableMultiset.of("test1", "test3"),
        ImmutableMultiset.copyOf(repo.namespaces()));

    repo.delete("test3", "d1");
    Assert.assertEquals(ImmutableMultiset.of("test1"),
        ImmutableMultiset.copyOf(repo.namespaces()));

    repo.delete("test1", "d1");
    Assert.assertEquals(ImmutableMultiset.of("test1"),
        ImmutableMultiset.copyOf(repo.namespaces()));

    repo.delete("test1", "d2");
    Assert.assertEquals(ImmutableMultiset.<String>of(),
        ImmutableMultiset.copyOf(repo.namespaces()));
  }

  @Test
  public void testExists() {
    Assert.assertFalse(repo.exists(NAMESPACE, "test1"));

    repo.create(NAMESPACE, "test1", new DatasetDescriptor.Builder()
        .schema(testSchema).build());
    Assert.assertTrue(repo.exists(NAMESPACE, "test1"));

    repo.delete(NAMESPACE, "test1");
    Assert.assertFalse(repo.exists(NAMESPACE, "test1"));
  }

  @Test(expected=NullPointerException.class)
  public void testExistsNullNamespace() {
    repo.exists(null, NAME);
  }

  @Test(expected=NullPointerException.class)
  public void testExistsNullName() {
    repo.exists(NAMESPACE, null);
  }

  @Test
  public void testLoad() {
    ensureCreated();

    Dataset dataset = repo.load(NAMESPACE, NAME);

    Assert.assertNotNull("Dataset is loaded and produced", dataset);
    Assert.assertEquals("Dataset name is propagated",
        NAME, dataset.getName());
    Assert.assertEquals("Dataset schema is loaded",
        testSchema, dataset.getDescriptor().getSchema());
  }

  @Test(expected=DatasetNotFoundException.class)
  public void testLoadNoDataset() {
    Assert.assertFalse("Santity check", testProvider.exists(NAMESPACE, NAME));

    Dataset dataset = repo.load(NAMESPACE, NAME);
  }

  @Test(expected=NullPointerException.class)
  public void testLoadNullNamespace() {
    repo.load(null, NAME);
  }

  @Test(expected=NullPointerException.class)
  public void testLoadNullName() {
    repo.load(NAMESPACE, (String) null);
  }

  @Test
  public void testDelete() {
    ensureCreated();

    boolean result = repo.delete(NAMESPACE, NAME);
    Assert.assertTrue("Delete dataset should return true", result);

    result = repo.delete(NAMESPACE, NAME);
    Assert.assertFalse("Delete nonexistent dataset should return false", result);
  }

  @Test
  public void testMoveToTrash() {
    ensureCreated();

    boolean result = repo.moveToTrash(NAMESPACE, NAME);
    Assert.assertTrue("Delete dataset should return true", result);

    result = repo.moveToTrash(NAMESPACE, NAME);
    Assert.assertFalse("Delete nonexistent dataset should return false", result);
  }
}


text:
package logging

import (
	"encoding/json"
)

const (
	EMERGENCY Level = iota
	ALERT
	CRITICAL
	ERROR
	WARNING
	NOTICE
	INFO
	DEBUG
)

const (
	stopped uint8 = iota
	paused
	running
)

type Level int8

func (level Level) String() string {
	switch level {
	case EMERGENCY:
		return "EMERGENCY"
	case ALERT:
		return "ALERT"
	case CRITICAL:
		return "CRITICAL"
	case ERROR:
		return "ERROR"
	case WARNING:
		return "WARNING"
	case NOTICE:
		return "NOTICE"
	case INFO:
		return "INFO"
	default:
		return "DEBUG"
	}
}

func (level Level) MarshalJSON() ([]byte, error) {
	return json.Marshal(level.String())
}


text:
package io.evanwong.oss.hipchat.v2.emoticons;

import io.evanwong.oss.hipchat.v2.commons.GetRequest;
import org.apache.http.client.HttpClient;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;

public class GetAllEmoticonsRequest extends GetRequest<Emoticons> {

    private final Integer startIndex;
    private final Integer maxResults;
    private final EmoticonType type;

    GetAllEmoticonsRequest(Integer startIndex, Integer maxResults, EmoticonType type, String accessToken, String baseUrl, HttpClient httpClient, ExecutorService executorService) {
        super(accessToken, baseUrl, httpClient, executorService);
        this.startIndex = startIndex;
        this.maxResults = maxResults;
        this.type = type;
    }

    public Integer getStartIndex() {
        return startIndex;
    }

    public Integer getMaxResults() {
        return maxResults;
    }

    public EmoticonType getType() {
        return type;
    }

    @Override
    protected Map<String, Object> toQueryMap() {
        Map<String, Object> params = new HashMap<>();
        if (startIndex != null) {
            params.put("start-index", startIndex);
        }
        if (maxResults != null) {
            params.put("max-results", maxResults);
        }
        if (type != null) {
            params.put("type", type.name().toLowerCase());
        }
        return params;
    }

    @Override
    protected String getPath() {
        return "/emoticon";
    }
}


text:
#ifndef _DMA_STREAM_HANDLERS_
#define _DMA_STREAM_HANDLERS_

#ifdef __cplusplus
 extern "C" {
#endif

#include "def.h"
#include "bsp.h"
typedef void (*DMALoseStreamHandlerCallbackFunction_t)(uint8_t iStream);
extern bool SetDMA1StreamHandlerHandle(uint8_t iStream, DMA_HandleTypeDef *hdma,
        bool fOverwrite, DMALoseStreamHandlerCallbackFunction_t loseCB);
extern bool SetDMA2StreamHandlerHandle(uint8_t iStream, DMA_HandleTypeDef *hdma,
        bool fOverwrite, DMALoseStreamHandlerCallbackFunction_t loseCB);
#ifdef __cplusplus
}
#endif

#endif  // _DMA_STREAM_HANDLERS_


text:
<!DOCTYPE html>

<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Closure Unit Tests - goog.ui.CookieEditor</title>


text:
#ifndef __SKELETONDOCUMENT_H__
#define __SKELETONDOCUMENT_H__

// INCLUDES
#include <akndoc.h>

// FORWARD DECLARATIONS
class CskeletonAppUi;
class CEikApplication;

// CLASS DECLARATION

/**
* CskeletonDocument application class.
* An instance of class CskeletonDocument is the Document part of the
* AVKON application framework for the skeleton example application.
*/
class CskeletonDocument : public CAknDocument
    {
    public: // Constructors and destructor

        /**
        * NewL.
        * Two-phased constructor.
        * Construct a CskeletonDocument for the AVKON application aApp
        * using two phase construction, and return a pointer
        * to the created object.
        * @param aApp Application creating this document.
        * @return A pointer to the created instance of CskeletonDocument.
        */
        static CskeletonDocument* NewL( CEikApplication& aApp );

        /**
        * NewLC.
        * Two-phased constructor.
        * Construct a CskeletonDocument for the AVKON application aApp
        * using two phase construction, and return a pointer
        * to the created object.
        * @param aApp Application creating this document.
        * @return A pointer to the created instance of CskeletonDocument.
        */
        static CskeletonDocument* NewLC( CEikApplication& aApp );

        /**
        * ~CskeletonDocument
        * Virtual Destructor.
        */
        virtual ~CskeletonDocument();

    public: // Functions from base classes

        /**
        * CreateAppUiL
        * From CEikDocument, CreateAppUiL.
        * Create a CskeletonAppUi object and return a pointer to it.
        * The object returned is owned by the Uikon framework.
        * @return Pointer to created instance of AppUi.
        */
        CEikAppUi* CreateAppUiL();

    private: // Constructors

        /**
        * ConstructL
        * 2nd phase constructor.
        */
        void ConstructL();

        /**
        * CskeletonDocument.
        * C++ default constructor.
        * @param aApp Application creating this document.
        */
        CskeletonDocument( CEikApplication& aApp );

    };

#endif // __SKELETONDOCUMENT_H__

// End of File