text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>HIRE A BEE - Innovative social recruitment</title>

    <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">

    <link href="https://fonts.googleapis.com/css?family=Raleway:400,700,800,300,500" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="font-awesome/css/font-awesome.min.css" type="text/css">

    <link rel="stylesheet" href="css/animate.min.css" type="text/css">

    <link rel="stylesheet" href="css/creative.css" type="text/css">

HIRE A BEE

Is an innovative social recruitment platform where you can refer a friend for a job position and get paid for it!

About us

                        We strongly believe that personal referrals from friends are of much greater value than a traditional job application. We also wish to give something back to the community with everything that we do, and this is why we offer monetary compensation for successful referrals: we would much rather pay you than an agency!
HireABee is mondora.com's usual unconventional way of working on recruitment.

mondora.com is an Italian software company and Certified B Corporation, founded in 2002. We currently have 35 employees, but we are growing fast. We have offices in Milano and Valtellina, as well as people working remotely from various locations around the world.

                    HIRE SOMEONE!

PROFILES

Senior Software Developer

                                                We are looking for a Full Stack Software Developer or Software Engineer with some previous experience and a passion for coding and learning new skills.
                                                You love challenges, solving problems and working with customers to provide the perfect solution to their needs.

                                                Some of the main job responsibilities include full stack web development, front end graphical user interface design, testing and quality assurance,
                                                system integration with commercial software such as salesforce, dropbox etc, R&D on rising technologies, Project Planning and Project Management.

                                                We offer a competitive salary, according to experience, a full time permanent contract with an initial trial period, flexible work hours and telecommuting.
                                                mondora is home to a young and dynamic environment where creativity and innovation are encouraged and a team of like-minded and dedicated colleagues is there to help. You will be part of a team in which you can always learn new skills and improve yourself.

You should be familiar with the following languages:

 GROOVY

 JAVASCRIPT

 HASKELL

 SCALA

 JAVA

Extra knowledge:

 FUNCTIONAL PROGRAMMING

 EVENT-DRIVEN ARCHITECTURES

 AGILE METHODOLOGIES

Mathematics Graduate or Mathematical Engineer

                                                We are looking for a Mathematics Graduate or Mathematical Engineer, with a passion for algorithms and some software development experience.

                                                Some of the main job responsibilities include: algorithm creation and testing,full stack web development, front end graphical user interface design,testing and quality assurance,system integration with commercial software such as salesforce and dropbox.

                                                We offer: competitive salary according to experience, full time permanent contract with an initial trial period, flexible work hours and telecommuting.

                                                mondora is home to a young and dynamic environment where creativity and innovation are encouraged and a team of like-minded and dedicated colleagues is there to help. You will be part of a team in which you can always learn new skills and improve yourself.

You should be familiar with the following languages:

 GROOVY

 JAVASCRIPT

 HASKELL

 SCALA

 JAVA

Extra knowledge:

 FUNCTIONAL PROGRAMMING

 EVENT-DRIVEN ARCHITECTURES

 AGILE METHODOLOGIES

                        Do you know someone who would make a great fit?
Let us know and earn €1.000 (yes, really!) for every candidate that we hire!

                    € 1000,00

Fill out the form on this page with your name and email address.

Look out for an email from us and follow the instructions we provide.

Let the hiring game begin!

CONTACT US TO HIRE SOMEONE

Do you have another friend who might fit the job description? Let us know!

                    <form data-toggle="validator" role="form" action="https://app.getresponse.com/add_subscriber.html" accept-charset="utf-8" method="post" id="contact-form" class="form-wrp">
                        <fieldset class="row">

                                First Name*:

                                <input type="text" name="first_name" class="form-control" id="first_name" required>

                                Last Name*:

                                <input type="text" name="last_name" class="form-control" id="last_name" required>

                                Your email Address*:

                                <input type="email" name="email" class="form-control" id="email" required>

                                Linkedin profile of your bee*:

                                <input type="url" placeholder="linkedin.com/namesurname" name="custom_linkedin_url" class="form-control" id="custom_linkedin_url" required>

                                Why should we hire this bee?*

                                <textarea type="text" name="custom_bee_note" class="form-control" id="custom_bee_note" required></textarea>

                                        <input type="checkbox" name="agree" value="agree" required>
                                        I have read and accepted the

                                            Rules

                                         and

                                            Privacy Policy *

                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                        ×
                                    </button>
                                    Please fill in all the required fields (indicated by *)

                                <button type="submit" class="btn-fullwidth">SEND </button>

                            <input type="hidden" name="campaign_token" value="pexl5" />
                        </fieldset>
                    </form>

RULES

In order to qualify for the monetary compensation of €1.000 you must fulfill these requirements:

                                    you are the first person to refer a specific candidate (we will let you know immediately if the candidate you refer is already in our list)

                                    your referred candidate comes for an interview

                                    your referred candidate is hired and successfully passes the trial period

                            You will be updated each time your candidate reaches a requirement, and will receive your compensation once he or she is confirmed by the company.

                                mondora - Sede operativa

                                Via Nazionale, 11

                                23013 - Cosio Valtellino (SO)

                                    Privacy Policy

                                Email. info@mondora.com

                                Tel: +39 0342 1856 264

© 2016 mondora srl - PIVA: 03680680968

            <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Rules

In order to qualify for the monetary compensation of €1.000 you must fulfill these requirements:

                          you are the first person to refer a specific candidate (we will let you know immediately if the candidate you refer is already in our list)

                          your referred candidate comes for an interview

                          your referred candidate is hired and successfully passes the trial period

                  You will be updated each time your candidate reaches a requirement, and will receive your compensation once he or she is confirmed by the company.

            <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>

            <button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>

Privacy Policy

HireABee collects and processes some information in order for you to use our services. Depending on your use of the Services, that may include:

                contact information (name, reference person, email and postal addresses, telephone, and country of residence) that you provide by filling the contact form and using our services
                your IP address and the type of device or browser you use
                communications you send to us (support, questions, comments, problems)

                Private Data

                We don't give your personal information to any third-party services, except when it's necessary to provide HireABee's Services (like when we partner with payment processors). We require that these third-party services protect your personal information to the same standards we do.
                We reserve the right to disclose personal information when we believe that doing so is reasonably necessary to comply with the law or law enforcement, to prevent fraud or abuse, or to protect HireABee's legal rights.

                How we use your personal information

                We will use the personal information you provide to:

                enable us to provide you with the Services;

                send you marketing communications we think you may find useful, but only in accordance with your email preferences;

                enable us to contact you regarding any question you make through the Services;

                analyze the use of the Services and the people visiting to improve our content and Services;

                and use for other purposes that we may disclose to you when we request your information.

                We take securing your data and preserving your privacy very seriously.

                Email

                We keep emails to a minimum and give you the ability to opt out of any marketing communications we send.

                We will send you email relating to your personal transactions. You will also receive certain marketing email communications, in accordance with your preferences, and from which you may opt out at any time.
                We may send you service-related announcements on the rare occasions when it is necessary to do so.

            <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>


text:
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Eurotrash.GrimDawn.WinFormsFrontEnd.Data
{
    public class State
    {
        public State()
        {
            this.RecentFiles = new List<string>();
        }

        public List<string> RecentFiles { get; set; }

        public void AddRecentFile(string recentFile)
        {
            if (RecentFiles.Contains(recentFile))
                RecentFiles.Remove(recentFile);

            RecentFiles.Insert(0, recentFile);

            const int maxFileCount = 10;

            if (RecentFiles.Count > maxFileCount)
                RecentFiles = RecentFiles.Take(maxFileCount).ToList();

            Save();
        }

        #region Load / Save

        public void Save(string file = "state.json")
        {
            string json = JsonConvert.SerializeObject(this, Formatting.Indented);

            File.WriteAllText(file, json);
        }

        public static State Load(string file = "state.json")
        {
            if (File.Exists(file))
            {
                try
                {
                    string json = File.ReadAllText(file);

                    return JsonConvert.DeserializeObject<State>(json);
                }
                catch
                {
                    return new State();
                }
            }

            return new State();
        }

        #endregion
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>
<html>
	<head>
		<title>Example Chart</title>
	</head>

	<body>
		<div class="chart-container">
			<canvas draggable="true" id="myChart" width="400" height="400"></canvas>
			<button id='entryBtn'>Add Entry</button>
			<input type="text" id='entryInput'></input>
		</div>

		<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
		<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script> -->
		<script src="js/Chart.min.js"></script>

		<!--<script src="js/Chart.HorizontalBar.js"></script>-->
		<script src="js/client.js"></script>
		<script>
			var canvas = $("#myChart").get(0);
			var btn = $("#entryBtn").get(0);
			var input = $("#entryInput").get(0);
			var client = new Client("ws://localhost:17772", canvas, btn, input);
		</script>
	</body>
</html>


text:
We want to control how many replicas exist for a given shard. To do this we'll create "replica sets" which is a
group of datasources which will be kept in-sync

## Replication
We can allow for replication to be done using dataman itself, specifically that we'd create some "log" of writes
that we can replay on other nodes (using this "log" format would let us then use the same entry for concensus
writes as we would for straight replication)

## TODO:
    - config for write options
        -- write to both
        -- rely on replication (write to just one)
        -- write to one, then async write to the rest (object written to primary, and the task to async persisted to metadata store?)


text:
import { Component, OnInit, Input, Output, ViewChild, EventEmitter } from '@angular/core';
import { NgForm } from '@angular/forms';

import { Category } from '../../../common/models/category';
import { Subject } from '../../../common/models/subject';

@Component({
  selector: 'llta-category-form',
  templateUrl: './categoryForm.component.html'
})
export class CategoryFormComponent implements OnInit {
  @ViewChild('categoryForm') categoryForm: NgForm;
  @Input() category: Category;
  @Input() subjects: Subject[];
  @Output() formEmitter: EventEmitter<NgForm> = new EventEmitter<NgForm>();

  ngOnInit() {
    this.formEmitter.emit(this.categoryForm);
  }
}


text:
namespace clsn::console
{
    void println(const std::string& str);
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>DemoUploadManager Tests</title>

    <link rel="Stylesheet" media="screen" href="../../../lib/qunit/css/testsuite.css" />

DemoUploadManager Tests


text:
<!DOCTYPE html>

		<meta charset="utf-8">
		<title>Padd Trek js</title>

		<link rel="stylesheet" href="paddtrek.css" type="text/css" media="screen" title="no title" charset="utf-8">

Your browser does not support running Padd Trek Js. Please upgrade to a more recent version.


text:
"""Tests for tensorflow_probability internal prefer_static."""

from absl.testing import parameterized
import numpy as np

import tensorflow.compat.v1 as tf1
import tensorflow.compat.v2 as tf

from tensorflow_probability.python.internal import dtype_util
from tensorflow_probability.python.internal import prefer_static as ps
from tensorflow_probability.python.internal import test_util

def raise_exception():
  raise RuntimeError('Did not expect to be called')

def raise_exception_in_eager_mode(value):
  def f():
    if tf.executing_eagerly():
      raise_exception()
    return value
  return f

@test_util.test_all_tf_execution_regimes
class GetStaticValueTest(test_util.TestCase):

  @parameterized.named_parameters(
      dict(testcase_name='_True',
           predicate_fn=lambda: True,
           expected_truth_value=True,
           expect_static_graph_evaluation=True),
      dict(testcase_name='_False',
           predicate_fn=lambda: False,
           expected_truth_value=False,
           expect_static_graph_evaluation=True),
      dict(testcase_name='_tf.constant(True)',
           predicate_fn=lambda: tf.constant(True),
           expected_truth_value=True,
           expect_static_graph_evaluation=True),
      dict(testcase_name='_tf.constant(1)',
           predicate_fn=lambda: tf.constant(1),
           expected_truth_value=True,
           expect_static_graph_evaluation=True),
      dict(testcase_name='_tf.constant(1)>0',
           predicate_fn=lambda: tf.constant(1) > 0,
           expected_truth_value=True,
           expect_static_graph_evaluation=True),
      )
  def testStaticEvaluation(self,
                           predicate_fn,
                           expected_truth_value,
                           expect_static_graph_evaluation):
    predicate = predicate_fn()
    static_predicate = ps._get_static_predicate(predicate)

    if tf.executing_eagerly() or expect_static_graph_evaluation:
      # If we are in eager mode, we always expect static evaluation.
      self.assertIsNotNone(static_predicate)
      self.assertEqual(expected_truth_value, static_predicate)
    else:
      self.assertIsNone(static_predicate)

@test_util.test_all_tf_execution_regimes
class PredicatesTest(test_util.TestCase):

  @parameterized.named_parameters(
      dict(testcase_name='_greater_true',
           predicate=ps.greater,
           args_fn=lambda: [tf.constant(1), tf.constant(0)],
           kwargs=dict(),
           expected=True),
      dict(testcase_name='_greater_false',
           predicate=ps.greater,
           args_fn=lambda: [tf.constant(-.1), tf.constant(0.)],
           kwargs=dict(),
           expected=False),
      dict(testcase_name='_greater_none',
           predicate=ps.greater,
           args_fn=lambda: [tf.constant(1) + tf.constant(0), tf.constant(0)],
           kwargs=dict(),
           expected=True),
      dict(testcase_name='_less_true',
           predicate=ps.less,
           args_fn=lambda: [tf.constant(-1), tf.constant(0)],
           kwargs=dict(),
           expected=True),
      dict(testcase_name='_log',
           predicate=ps.log,
           args_fn=lambda: [tf.constant(1.)],
           kwargs=dict(),
           expected=0.),
      dict(testcase_name='_equal_true',
           predicate=ps.equal,
           args_fn=lambda: [tf.constant(0), 0],
           kwargs=dict(),
           expected=True),
      dict(testcase_name='_equal_false',
           predicate=ps.equal,
           args_fn=lambda: [tf.constant(1), tf.constant(0)],
           kwargs=dict(),
           expected=False),
      dict(testcase_name='_and_true',
           predicate=ps.logical_and,
           args_fn=lambda: [True, tf.constant(True)],
           kwargs=dict(),
           expected=True),
      dict(testcase_name='_and_none',
           predicate=ps.logical_and,
           args_fn=lambda: [tf.constant(True), tf.equal(1, 1)],
           kwargs=dict(),
           expected=True),
      dict(testcase_name='_or_true',
           predicate=ps.logical_or,
           args_fn=lambda: [tf.constant(True), tf.constant(False)],
           kwargs=dict(),
           expected=True),
      dict(testcase_name='_all_true',
           predicate=ps.reduce_all,
           args_fn=lambda: [[tf.constant(True)] * 10],
           kwargs=dict(),
           expected=True),
      dict(testcase_name='_all_false',
           predicate=ps.reduce_all,
           args_fn=lambda: [[tf.constant(True),  # pylint: disable=g-long-lambda
                             True,
                             tf.constant(False)]],
           kwargs=dict(),
           expected=False),
      dict(testcase_name='_all_with_axis',
           predicate=ps.reduce_all,
           args_fn=lambda: ([[True, tf.constant(True)],  # pylint: disable=g-long-lambda
                             [False, True]],),
           kwargs=dict(axis=1),
           expected=[True, False]),
      dict(testcase_name='_all_with_name',
           predicate=ps.reduce_all,
           args_fn=lambda: ([[True, tf.constant(True)],  # pylint: disable=g-long-lambda
                             [False, True]],),
           kwargs=dict(axis=1, name='my_name'),
           expected=[True, False]),
      dict(testcase_name='_any_true',
           predicate=ps.reduce_any,
           args_fn=lambda: [[tf.constant(True),  # pylint: disable=g-long-lambda
                             tf.constant(False),
                             tf.constant(False)]],
           kwargs=dict(),
           expected=True),
      dict(testcase_name='_any_false',
           predicate=ps.reduce_any,
           args_fn=lambda: [[tf.constant(False)] * 23],
           kwargs=dict(),
           expected=False),
      dict(testcase_name='_any_keepdims',
           predicate=ps.reduce_any,
           args_fn=lambda: ([[True, tf.constant(True)],  # pylint: disable=g-long-lambda
                             [False, True]],),
           kwargs=dict(keepdims=True),
           expected=[[True]]),
      )
  def test_static_predicate(self, predicate, args_fn, kwargs, expected):
    actual = predicate(*args_fn(), **kwargs)
    self.assertAllCloseAccordingToType(expected, actual)

@test_util.test_all_tf_execution_regimes
class CondTest(test_util.TestCase):

  def test_true(self):
    x = tf.constant(2)
    y = tf.constant(5)
    z = ps.cond(True, lambda: tf.multiply(x, 16), lambda: tf.multiply(y, 5))
    self.assertEqual(self.evaluate(z), 32)

  def test_false(self):
    x = tf.constant(4)
    y = tf.constant(3)
    z = ps.cond(False, lambda: tf.multiply(x, 16), lambda: tf.multiply(y, 3))
    self.assertEqual(self.evaluate(z), 9)

  def test_missing_arg1(self):
    x = tf.constant(1)
    with self.assertRaises(TypeError):
      ps.cond(True, false_fn=lambda: x)

  def test_missing_arg2(self):
    x = tf.constant(1)
    with self.assertRaises(TypeError):
      ps.cond(True, lambda: x)

@test_util.test_all_tf_execution_regimes
class CaseTest(test_util.TestCase):

  def test_true(self):
    x = tf.constant(0)
    conditions = [(True, lambda: tf.constant(1)),
                  (tf.equal(x, 1), raise_exception)]
    y = ps.case(conditions, default=raise_exception, exclusive=False)
    z = ps.case(conditions, default=raise_exception, exclusive=True)

    self.assertEqual(self.evaluate(y), 1)
    self.assertEqual(self.evaluate(z), 1)

  def test_false(self):
    conditions = [(False, raise_exception)]
    y = ps.case(conditions,
                default=lambda: tf.constant(1),
                exclusive=False)
    z = ps.case(conditions,
                default=lambda: tf.constant(1),
                exclusive=True)
    self.assertEqual(self.evaluate(y), 1)
    self.assertEqual(self.evaluate(z), 1)

  def test_mix(self):
    x = tf.constant(0)
    y = tf.constant(10)
    conditions = [(x > 1, lambda: tf.constant(1)),
                  (y < 1, raise_exception_in_eager_mode(tf.constant(2))),
                  (tf.constant(False), raise_exception),
                  (tf.constant(True), lambda: tf.constant(3))]
    z = ps.case(conditions, default=lambda: raise_exception)
    self.assertEqual(self.evaluate(z), 3)

@test_util.test_all_tf_execution_regimes
class ShapeTest(test_util.TestCase):

  def test_shape(self):
    vector_value = [0., 1.]

    # case: numpy input
    self.assertAllEqual(ps.shape(np.array(vector_value)), [2])

    # case: tensor input with static shape
    self.assertAllEqual(ps.shape(tf.constant(vector_value)), [2])

    # case: tensor input with dynamic shape
    if not tf.executing_eagerly():
      shape = ps.shape(tf1.placeholder_with_default(vector_value, shape=None))
      self.assertAllEqual(self.evaluate(shape), [2])

  def test_rank_from_shape_scalar(self):
    self.assertEqual(1, ps.rank_from_shape(5))
    v = tf.Variable(4, shape=tf.TensorShape(None))
    self.evaluate(v.initializer)
    self.assertEqual(1, self.evaluate(ps.rank_from_shape(v)))

  def test_convert_dimension_to_tensor(self):
    v = ps.constant(tf1.Dimension(1))
    self.assertEqual(1, v)

  def test_dimension_size(self):
    shape = [3, 2, 1]
    idx = 1
    idx_tensor = tf.convert_to_tensor(idx)

    # case: numpy input.
    self.assertEqual(ps.dimension_size(np.zeros(shape), idx), shape[idx])
    self.assertEqual(ps.dimension_size(np.zeros(shape), idx_tensor),
                     shape[idx])

    # case: static-shape Tensor input.
    self.assertEqual(ps.dimension_size(tf.zeros(shape), idx), shape[idx])
    self.assertNotIsInstance(
        ps.dimension_size(tf.zeros(shape), idx), tf1.Dimension)
    self.assertEqual(ps.dimension_size(tf.zeros(shape), idx_tensor),
                     shape[idx])
    self.assertNotIsInstance(
        ps.dimension_size(tf.zeros(shape), idx_tensor), tf1.Dimension)

    if tf.executing_eagerly():
      return

    # Case: input is Tensor with fully unknown shape.
    zeros_pl = tf1.placeholder_with_default(tf.zeros(shape), shape=None)
    idx_pl = tf1.placeholder_with_default(idx, shape=[])
    self.assertAllEqual(ps.dimension_size(zeros_pl, idx), shape[idx])
    self.assertAllEqual(ps.dimension_size(zeros_pl, idx_tensor), shape[idx])
    self.assertAllEqual(ps.dimension_size(zeros_pl, idx_pl), shape[idx])

    # Case: input is Tensor with partially known shape.
    # The result should be static if idx is.
    zeros_partial_pl = tf1.placeholder_with_default(
        tf.zeros(shape),
        shape=tf.TensorShape([None, shape[idx], None]))
    self.assertEqual(ps.dimension_size(zeros_partial_pl, idx), shape[idx])
    self.assertEqual(ps.dimension_size(zeros_partial_pl, idx_tensor),
                     shape[idx])
    self.assertAllEqual(ps.dimension_size(zeros_partial_pl, idx_pl),
                        shape[idx])

  def test_shape_slice(self):
    shape = [3, 2, 1]
    slice_ = slice(1, 2)
    slice_tensor = slice(tf.constant(1), tf.constant(2))

    # case: numpy input.
    self.assertEqual(ps.shape_slice(np.zeros(shape), slice_), shape[slice_])
    self.assertEqual(
        ps.shape_slice(np.zeros(shape), slice_tensor), shape[slice_])

    # case: static-shape Tensor input.
    self.assertEqual(ps.shape_slice(tf.zeros(shape), slice_), shape[slice_])
    self.assertNotIsInstance(
        ps.shape_slice(tf.zeros(shape), slice_), tf.TensorShape)
    self.assertEqual(
        ps.shape_slice(tf.zeros(shape), slice_tensor), shape[slice_])
    self.assertNotIsInstance(
        ps.shape_slice(tf.zeros(shape), slice_tensor), tf1.Dimension)

    if tf.executing_eagerly():
      return

    # Case: input is Tensor with fully unknown shape.
    zeros_pl = tf1.placeholder_with_default(tf.zeros(shape), shape=None)
    slice_pl = slice(
        tf1.placeholder_with_default(1, shape=[]),
        tf1.placeholder_with_default(2, shape=[]))
    self.assertAllEqual(ps.shape_slice(zeros_pl, slice_), shape[slice_])
    self.assertAllEqual(
        ps.shape_slice(zeros_pl, slice_tensor), shape[slice_])
    self.assertAllEqual(ps.shape_slice(zeros_pl, slice_pl), shape[slice_])

    # Case: input is Tensor with partially known shape.
    # The result should be static if slice_ is.
    zeros_partial_pl = tf1.placeholder_with_default(
        tf.zeros(shape), shape=tf.TensorShape([None, 2, 1]))
    self.assertEqual(ps.shape_slice(zeros_partial_pl, slice_), shape[slice_])
    self.assertEqual(
        ps.shape_slice(zeros_partial_pl, slice_tensor), shape[slice_])
    self.assertAllEqual(
        ps.shape_slice(zeros_partial_pl, slice_pl), shape[slice_])

  def test_rank_from_shape(self):
    shape = [2, 4, 3]
    expected_rank = len(shape)
    v_ndarray = np.ones(shape)

    # case: shape_tensor is tuple
    rank = ps.rank_from_shape(shape_tensor_fn=v_ndarray.shape)
    self.assertEqual(rank, expected_rank)

    # case: shape_tensor is ndarray
    rank = ps.rank_from_shape(shape_tensor_fn=ps.shape(v_ndarray))
    self.assertEqual(rank, expected_rank)

    # case: tensorshape is fully defined
    v_tensor = tf.convert_to_tensor(v_ndarray)
    rank = ps.rank_from_shape(
        shape_tensor_fn=ps.shape(v_tensor),
        tensorshape=v_tensor.shape)
    self.assertEqual(rank, expected_rank)

    if not tf.executing_eagerly():
      # case: tensorshape is unknown, rank cannot be statically inferred
      v_dynamic = tf1.placeholder_with_default(v_ndarray, shape=None)
      rank = ps.rank_from_shape(
          shape_tensor_fn=lambda: ps.shape(v_dynamic),
          tensorshape=v_dynamic.shape)
      self.assertEqual(self.evaluate(rank), expected_rank)

      # case: tensorshape is not provided, rank cannot be statically inferred
      rank = ps.rank_from_shape(shape_tensor_fn=lambda: ps.shape(v_dynamic))
      self.assertEqual(self.evaluate(rank), expected_rank)

@test_util.test_all_tf_execution_regimes
class SetDiff1DTest(test_util.TestCase):

  def test_static(self):
    self.assertAllEqual(
        [0, 3, 4],
        ps.setdiff1d(np.arange(5), [1, 2]))
    self.assertAllEqual(
        [],
        ps.setdiff1d([], [1, 2]))
    self.assertAllEqual(
        [1, 2],
        ps.setdiff1d([1, 2], []))

  def test_dynamic(self):
    if tf.executing_eagerly(): return
    x = tf1.placeholder_with_default(np.arange(5), shape=None)
    self.assertAllEqual([0, 3, 4], self.evaluate(ps.setdiff1d(x, [1, 2])))
    x = tf1.placeholder_with_default(np.array([], np.int32), shape=None)
    self.assertAllEqual([], self.evaluate(ps.setdiff1d(x, [1, 2])))
    self.assertAllEqual([1, 2], self.evaluate(ps.setdiff1d([1, 2], x)))

@test_util.test_all_tf_execution_regimes
class SizeTest(test_util.TestCase):

  def test_static(self):
    self.assertAllEqual(
        3 * 4 * 5,
        ps.size(tf.random.normal([3, 4, 5], seed=test_util.test_seed())))

  def test_dynamic(self):
    if tf.executing_eagerly(): return
    x = tf1.placeholder_with_default(
        tf.random.normal([3, 4, 5], seed=test_util.test_seed()), shape=None)
    self.assertAllEqual(3 * 4 * 5, self.evaluate(ps.size(x)))

@test_util.test_all_tf_execution_regimes
class NonNegativeAxisTest(test_util.TestCase):

  def test_static_scalar_positive_index(self):
    positive_axis = ps.non_negative_axis(axis=2, rank=4)
    self.assertAllEqual(2, positive_axis)

  def test_static_scalar_negative_index(self):
    positive_axis = ps.non_negative_axis(axis=-1, rank=4)
    self.assertAllEqual(3, positive_axis)

  def test_static_vector_index(self):
    positive_axis = ps.non_negative_axis(axis=[0, -2], rank=4)
    self.assertAllEqual([0, 2], positive_axis)

  @test_util.jax_disable_variable_test
  def test_dynamic_vector_index(self):
    axis = tf.Variable([0, -2])
    positive_axis = ps.non_negative_axis(axis=axis, rank=4)
    self.evaluate(axis.initializer)
    self.assertAllEqual([0, 2], self.evaluate(positive_axis))

@test_util.test_all_tf_execution_regimes
class BroadcastShapeTest(test_util.TestCase):

  def test_static(self):
    self.assertAllEqual(
        (3, 4, 2, 5),
        ps.broadcast_shape((4, 1, 1), (3, 1, 2, 5)))

    self.assertAllEqual((3, 4, 2, 5),
                        ps.broadcast_shape(
                            tf.convert_to_tensor((4, 1, 1)),
                            tf.convert_to_tensor((3, 1, 2, 5))))

  def test_dynamic(self):
    if tf.executing_eagerly():
      return

    shape = ps.broadcast_shape(
        tf.convert_to_tensor([3, 2, 1]),
        tf.shape(
            tf1.placeholder_with_default(np.zeros((1, 5)), shape=(None, 5))))
    self.assertIsNone(tf.get_static_value(shape))
    self.assertAllEqual([3, 2, 5], self.evaluate(shape))

@test_util.test_all_tf_execution_regimes
class PadTest(test_util.TestCase):

  def test_num_paddings_dynamic(self):
    n = tf1.placeholder_with_default(2, shape=None)
    x = ps.pad([2, 3], paddings=[[0, n]], constant_values=1)
    if not ps.is_numpy(x):
      x = self.evaluate(x)
    self.assertAllEqual([2, 3, 1, 1], x)

  def test_num_paddings_static(self):
    n = 2
    x = ps.pad([2, 3], paddings=[[0, n]], constant_values=1)
    self.assertAllEqual([2, 3, 1, 1], x)

@test_util.test_all_tf_execution_regimes
class SmartWhereTest(test_util.TestCase):

  def test_static_scalar_condition(self):
    fn_calls = [0, 0]
    ones = tf.ones([10])
    zeros = tf.zeros([10])
    def fn1():
      fn_calls[0] += 1
      return ones
    def fn2():
      fn_calls[1] += 1
      return zeros

    self.assertAllEqual(zeros, ps.smart_where(False, fn1, fn2))
    self.assertEqual([0, 1], fn_calls)
    self.assertAllEqual(ones, ps.smart_where(True, fn1, fn2))
    self.assertEqual([1, 1], fn_calls)
    self.assertAllEqual(zeros, ps.smart_where(tf.constant(False), fn1, fn2))
    self.assertEqual([1, 2], fn_calls)
    self.assertAllEqual(ones, ps.smart_where(tf.constant(True), fn1, fn2))
    self.assertEqual([2, 2], fn_calls)
    self.assertAllEqual(zeros, ps.smart_where(np.array(False), fn1, fn2))
    self.assertEqual([2, 3], fn_calls)
    self.assertAllEqual(ones, ps.smart_where(np.array(True), fn1, fn2))
    self.assertEqual([3, 3], fn_calls)

    self.assertAllEqual(zeros, ps.smart_where(0, fn1, fn2))
    self.assertEqual([3, 4], fn_calls)
    self.assertAllEqual(ones, ps.smart_where(1, fn1, fn2))
    self.assertEqual([4, 4], fn_calls)
    self.assertAllEqual(zeros, ps.smart_where(tf.constant(0), fn1, fn2))
    self.assertEqual([4, 5], fn_calls)
    self.assertAllEqual(ones, ps.smart_where(tf.constant(1), fn1, fn2))
    self.assertEqual([5, 5], fn_calls)
    self.assertAllEqual(zeros, ps.smart_where(np.array(0), fn1, fn2))
    self.assertEqual([5, 6], fn_calls)
    self.assertAllEqual(ones, ps.smart_where(np.array(1), fn1, fn2))
    self.assertEqual([6, 6], fn_calls)

  def test_cond_x_broadcast_error(self):
    with self.assertRaisesOpError('Incompatible shapes'):
      self.evaluate(
          ps.smart_where(
              tf.constant([True, True]), lambda: tf.zeros([3]), lambda: None))

  def test_cond_y_broadcast_error(self):
    with self.assertRaisesOpError('Incompatible shapes'):
      self.evaluate(
          ps.smart_where(
              tf.constant([False, False]), lambda: None, lambda: tf.zeros([3])))

  def test_broadcast_success(self):
    self.assertAllEqual(
        tf.zeros([10, 2]),
        ps.smart_where(
            tf.constant([True, True]), lambda: tf.zeros([10, 1]), lambda: None))
    self.assertAllEqual(
        tf.ones([2, 10]),
        ps.smart_where(
            tf.constant([[False], [False]]),
            lambda: None, lambda: tf.ones([10])))

  def test_where_fallback(self):
    self.assertAllEqual([1., 0.],
                        ps.smart_where(
                            tf.constant([True, False]),
                            lambda: tf.ones([]),
                            lambda: tf.zeros([])))

@test_util.test_all_tf_execution_regimes
class DtypeTest(test_util.TestCase):

  def test_ones_like(self):
    x = tf1.placeholder_with_default(tf.ones([2], dtype=tf.float32),
                                     shape=None)
    self.assertEqual(dtype_util.convert_to_dtype(ps.ones_like(x)),
                     tf.float32)

JAX_MODE = False
if JAX_MODE:
  class JaxTest(test_util.TestCase):

    def testShape(self):

      @tf.function(jit_compile=True)
      def f(x):
        return tf.zeros(ps.shape(x))

      x = tf.zeros([3, 5])
      self.assertEqual((3, 5), f(x).shape)

    def testConcat(self):

      @tf.function(jit_compile=True)
      def f(x):
        return tf.zeros(ps.concat([ps.shape(x), [7]], 0))

      x = tf.zeros([3, 5])
      self.assertEqual((3, 5, 7), f(x).shape)

if __name__ == '__main__':
  test_util.main()


text:
@interface TSSTManagedBookmarkGroup : NSManagedObject
{

}

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mainContainerView"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

</androidx.constraintlayout.widget.ConstraintLayout>


text:
package nl.jqno.equalsverifier.internal.reflection.annotations;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * Contains all properties of an annotation necessary to to make decisions about that annotation.
 *
 * <p>Note that this object does not contain all possible properties; only the ones that are
 * actually used by EqualsVerifier.
 */
public class AnnotationProperties {

    private final String className;
    private Map<String, Set<String>> arrayValues = new HashMap<>();

    /**
     * Constructor.
     *
     * @param className The annotation's className string.
     */
    public AnnotationProperties(String className) {
        this.className = className;
    }

    /** @return the annotation's className string. */
    public String getClassName() {
        return className;
    }

    /**
     * Adds the content of an array value property.
     *
     * @param name The name of the array value property.
     * @param values The content of the array value property.
     */
    public void putArrayValues(String name, Set<String> values) {
        arrayValues.put(name, values);
    }

    /**
     * Retrieves the content of an array value property.
     *
     * @param name The name of the array value property.
     * @return The content of the array value property.
     */
    public Set<String> getArrayValues(String name) {
        return arrayValues.get(name);
    }
}


text:
import { createObjectCsvWriter } from 'csv-writer';
import os from 'os';
import path from 'path';
import config from '../config.json';
import Income from './Income';
import Gdp from './Gdp';

class App {
  constructor () {
    this.incomeUri = config.incomeUri;
    this.countries = [];
  }

  async process () {
    const income = new Income({
      uri: this.incomeUri,
      callback: this.processGdp
    });
    income.processIncome();
  }

  async processGdp (countries) {
    const gdp = new Gdp();
    const gdpInfo = await gdp.processGdp(countries);
    App.createCsv(countries, gdpInfo);
  }

  static createCsv (countries, gdpInfo) {
    const merged = countries;
    for (let i = 0; i < countries.length; i += 1) {
      merged[i].gdp = gdpInfo[countries[i].iso].value || 0;
    }
    const csv = new createObjectCsvWriter({
      path: os.tmpdir()
        .concat(path.sep)
        .concat('gdpInfo.csv'),
      header: [
        { id: 'iso', title: 'ISO' },
        { id: 'long', title: 'Longitude' },
        { id: 'lat', title: 'Latitude' },
        { id: 'gdp', title: 'GDP' }
      ]
    });

    csv.writeRecords(merged)
      .then(() => {
        console.log('Process complete, check the temp directory for gdpInfo.csv.');
      });
  }
}

const app = new App();
app.process();


text:
OBJ=ae.o
LIBNAME=libae
PKGCONFNAME=ae.pc

AE_MAJOR=$(shell grep AE_MAJOR ae.h | awk '{print $$3}')
AE_MINOR=$(shell grep AE_MINOR ae.h | awk '{print $$3}')
AE_PATCH=$(shell grep AE_PATCH ae.h | awk '{print $$3}')

# Installation related variables and target
PREFIX?=/usr/local
INCLUDE_PATH?=include/ae
LIBRARY_PATH?=lib
PKGCONF_PATH?=pkgconfig
INSTALL_INCLUDE_PATH= $(DESTDIR)$(PREFIX)/$(INCLUDE_PATH)
INSTALL_LIBRARY_PATH= $(DESTDIR)$(PREFIX)/$(LIBRARY_PATH)
INSTALL_PKGCONF_PATH= $(INSTALL_LIBRARY_PATH)/$(PKGCONF_PATH)

# Fallback to gcc when $CC is not in $PATH.
CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
OPTIMIZATION?=-O3
WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings
DEBUG?= -g -ggdb
REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG) $(ARCH)
REAL_LDFLAGS=$(LDFLAGS) $(ARCH)

DYLIBSUFFIX=so
STLIBSUFFIX=a
DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(AE_MAJOR).$(AE_MINOR)
DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(AE_MAJOR)
DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX)
DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
STLIBNAME=$(LIBNAME).$(STLIBSUFFIX)
STLIB_MAKE_CMD=ar rcs $(STLIBNAME)

# Platform-specific overrides
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifeq ($(uname_S),SunOS)
  REAL_LDFLAGS+= -ldl -lnsl -lsocket
  DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS)
  INSTALL= cp -r
endif
ifeq ($(uname_S),Darwin)
  DYLIBSUFFIX=dylib
  DYLIB_MINOR_NAME=$(LIBNAME).$(AE_MAJOR).$(AE_MINOR).$(DYLIBSUFFIX)
  DYLIB_MAJOR_NAME=$(LIBNAME).$(AE_MAJOR).$(DYLIBSUFFIX)
  DYLIB_MAKE_CMD=$(CC) -shared -Wl,-install_name,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
endif

all: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME)

# Deps (use make dep to generate this)
ae.o: ae.c ae.h

$(DYLIBNAME): $(OBJ)
	$(DYLIB_MAKE_CMD) $(OBJ)

$(STLIBNAME): $(OBJ)
	$(STLIB_MAKE_CMD) $(OBJ)

dynamic: $(DYLIBNAME)
static: $(STLIBNAME)

.c.o:
	$(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $<

clean:
	rm -rf $(DYLIBNAME) $(STLIBNAME) $(TESTS) $(PKGCONFNAME) *.o *.gcda *.gcno *.gcov

ifeq ($(uname_S),SunOS)
  INSTALL?= cp -r
endif

INSTALL?= cp -a

$(PKGCONFNAME): ae.h
	@echo "Generating $@ for pkgconfig..."
	@echo prefix=$(PREFIX) > $@
	@echo exec_prefix=$${prefix} >> $@
	@echo libdir=$(PREFIX)/$(INCLUDE_PATH) >> $@
	@echo includedir=$(PREFIX)/$(LIBRARY_PATH) >> $@
	@echo >> $@
	@echo Name: ae >> $@
	@echo Description: Minimalistic C client library for Redis. >> $@
	@echo Version: $(AE_MAJOR).$(AE_MINOR).$(AE_PATCH) >> $@
	@echo Libs: -L\$${libdir} -lae >> $@
	@echo Cflags: -I\$${includedir} -D_FILE_OFFSET_BITS=64 >> $@

install: $(DYLIBNAME) $(STLIBNAME)
	mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
	$(INSTALL) ae.h $(INSTALL_INCLUDE_PATH)
	$(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
	cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
	cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME)
	$(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
	mkdir -p $(INSTALL_PKGCONF_PATH)
	$(INSTALL) $(PKGCONFNAME) $(INSTALL_PKGCONF_PATH)

32bit:
	@echo ""
	@echo "WARNING: if this fails under Linux you probably need to install libc6-dev-i386"
	@echo ""
	$(MAKE) CFLAGS="-m32" LDFLAGS="-m32"

noopt:
	$(MAKE) OPTIMIZATION=""

.PHONY: all test check clean dep install 32bit gprof gcov noopt


text:
package org.optaplanner.core.impl.localsearch.decider.acceptor.simulatedannealing;

import org.optaplanner.core.api.score.Score;
import org.optaplanner.core.impl.localsearch.decider.acceptor.AbstractAcceptor;
import org.optaplanner.core.impl.localsearch.scope.LocalSearchMoveScope;
import org.optaplanner.core.impl.localsearch.scope.LocalSearchSolverPhaseScope;
import org.optaplanner.core.impl.localsearch.scope.LocalSearchStepScope;
import org.optaplanner.core.impl.score.ScoreUtils;

/**
 * The time gradient implementation of simulated annealing.
 */
public class SimulatedAnnealingAcceptor extends AbstractAcceptor {

    protected Score startingTemperature;

    protected int levelsLength = -1;
    protected double[] startingTemperatureLevels;
    // No protected Score temperature do avoid rounding errors when using Score.multiply(double)
    protected double[] temperatureLevels;

    protected double temperatureMinimum = 1.0E-100; // Double.MIN_NORMAL is E-308

    public void setStartingTemperature(Score startingTemperature) {
        this.startingTemperature = startingTemperature;
    }

    // ************************************************************************
    // Worker methods
    // ************************************************************************

    @Override
    public void phaseStarted(LocalSearchSolverPhaseScope phaseScope) {
        super.phaseStarted(phaseScope);
        for (double startingTemperatureLevel : ScoreUtils.extractLevelDoubles(startingTemperature)) {
            if (startingTemperatureLevel < 0.0) {
                throw new IllegalArgumentException("The startingTemperature (" + startingTemperature
                        + ") cannot have negative level (" + startingTemperatureLevel + ").");
            }
        }
        startingTemperatureLevels = ScoreUtils.extractLevelDoubles(startingTemperature);
        temperatureLevels = startingTemperatureLevels;
        levelsLength = startingTemperatureLevels.length;
    }

    @Override
    public void phaseEnded(LocalSearchSolverPhaseScope phaseScope) {
        super.phaseEnded(phaseScope);
        startingTemperatureLevels = null;
        temperatureLevels = null;
        levelsLength = -1;
    }

    public boolean isAccepted(LocalSearchMoveScope moveScope) {
        LocalSearchSolverPhaseScope phaseScope = moveScope.getStepScope().getPhaseScope();
        Score lastStepScore = phaseScope.getLastCompletedStepScope().getScore();
        Score moveScore = moveScope.getScore();
        if (moveScore.compareTo(lastStepScore) >= 0) {
            return true;
        }
        Score moveScoreDifference = lastStepScore.subtract(moveScore);
        double[] moveScoreDifferenceLevels = ScoreUtils.extractLevelDoubles(moveScoreDifference);
        double acceptChance = 1.0;
        for (int i = 0; i < levelsLength; i++) {
            double moveScoreDifferenceLevel = moveScoreDifferenceLevels[i];
            double temperatureLevel = temperatureLevels[i];
            double acceptChanceLevel;
            if (moveScoreDifferenceLevel <= 0.0) {
                // In this level, moveScore is better than the lastStepScore, so do not disrupt the acceptChance
                acceptChanceLevel = 1.0;
            } else {
                acceptChanceLevel = Math.exp(-moveScoreDifferenceLevel / temperatureLevel);
            }
            acceptChance *= acceptChanceLevel;
        }
        if (moveScope.getWorkingRandom().nextDouble() < acceptChance) {
            return true;
        } else {
            return false;
        }
    }

    @Override
    public void stepEnded(LocalSearchStepScope stepScope) {
        super.stepEnded(stepScope);
        double timeGradient = stepScope.getTimeGradient();
        double reverseTimeGradient = 1.0 - timeGradient;
        temperatureLevels = new double[levelsLength];
        for (int i = 0; i < levelsLength; i++) {
            temperatureLevels[i] = startingTemperatureLevels[i] * reverseTimeGradient;
            if (temperatureLevels[i] < temperatureMinimum) {
                temperatureLevels[i] = temperatureMinimum;
            }
        }
        // TODO implement reheating
    }

}


text:
FROM clojure:lein-2.8.1
WORKDIR /luminus
COPY env env
COPY resources resources
COPY src src
COPY test test
COPY Procfile Procfile
COPY project.clj project.clj
RUN lein uberjar
CMD ["java", "-server", "-jar", "target/hello.jar"]


text:
package com.foc.business.units;

import com.foc.desc.FocConstructor;
import com.foc.desc.FocObject;

public class Unit extends FocObject {
	public Unit(FocConstructor constr){
    super(constr);
 	  newFocProperties();
  }

	public void dispose(){
		super.dispose();
	}

	public void setName(String name){
		setPropertyString(UnitDesc.FLD_NAME, name);
	}

	public String getName(){
		return getPropertyString(UnitDesc.FLD_NAME);
	}

	public void setSymbol(String symbol){
		setPropertyString(UnitDesc.FLD_SYMBOL, symbol);
	}

	public String getSymbole(){
		return getPropertyString(UnitDesc.FLD_SYMBOL);
	}

  public double getFactor(){
    return getPropertyDouble(UnitDesc.FLD_FACTOR);
  }

  public void setFactor(double factor){
    setPropertyDouble(UnitDesc.FLD_FACTOR, factor);
  }

  public boolean isSecond(){
  	return getName().equals(UnitDesc.TIME_UNIT_SECOND);
  }

  public boolean isMinute(){
  	return getName().equals(UnitDesc.TIME_UNIT_MINUTE);
  }

  public boolean isHour(){
  	return getName().equals(UnitDesc.TIME_UNIT_HOUR);
  }

  public boolean isDay(){
  	return getName().equals(UnitDesc.TIME_UNIT_DAY);
  }

  public boolean isWeek(){
  	return getName().equals(UnitDesc.TIME_UNIT_WEEK);
  }

  public boolean isMonth(){
  	return getName().equals(UnitDesc.TIME_UNIT_MONTH);
  }

  public boolean isTimeRelevant(){
  	return isHour() || isMinute();
  }

  public Dimension getDimension(){
  	return (Dimension) getPropertyObject(UnitDesc.FLD_DIMENSION);
  }
}


text:
<?php

namespace GHOME\CoreBundle\Formatter;

/**
 * Handles two strings: one if the value is true, one other is it is false.
 */
class BooleanFormatter extends Formatter
{
    /**
	 * {@inheritdoc}
	 */
	public function format($value)
	{
		return (int) $value ? $this->options['yes'] : $this->options['no'];
	}

	/**
	 * {@inheritdoc}
	 */
	public function getCssClass($value)
	{
	    return (int) $value ? 'label-success' : 'label-important';
	}

	/**
	 * {@inheritdoc}
	 */
	public function isBoolean()
	{
	    return true;
	}

	/**
	 * {@inheritdoc}
	 */
	protected function getDefaultOptions()
	{
		return array('yes' => 'Actif', 'no' => 'Inactif');
	}
}


text:
package network::cyberoam::snmp::mode::cpu;

use base qw(centreon::plugins::mode);

use strict;
use warnings;

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options);
    bless $self, $class;

    $self->{version} = '1.0';
    $options{options}->add_options(arguments =>
                                {
                                  "warning:s"   => { name => 'warning' },
                                  "critical:s"  => { name => 'critical' },
                                });

    return $self;
}

sub check_options {
    my ($self, %options) = @_;
    $self->SUPER::init(%options);

    if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) {
        $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'.");
        $self->{output}->option_exit();
    }
    if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) {
        $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'.");
        $self->{output}->option_exit();
    }
}

sub run {
    my ($self, %options) = @_;
    $self->{snmp} = $options{snmp};

    my $oid_cpuPercentUsage = '.1.3.6.1.4.1.21067.2.1.2.2.1.0';
    my $result = $self->{snmp}->get_leef(oids => [$oid_cpuPercentUsage], nothing_quit => 1);

    my $exit = $self->{perfdata}->threshold_check(value => $result->{$oid_cpuPercentUsage},
                                                  threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
    $self->{output}->output_add(severity => $exit,
                                short_msg => sprintf("CPU Usage : %.2f %%", $result->{$oid_cpuPercentUsage}));
    $self->{output}->perfdata_add(label => "cpu", unit => '%',
                                  value => sprintf("%.2f", $result->{$oid_cpuPercentUsage}),
                                  warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),
                                  critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'),
                                  min => 0);

    $self->{output}->display();
    $self->{output}->exit();
}

1;

__END__

=head1 MODE

Check current processor usage.

=over 8

=item B<--warning>

Threshold warning.

=item B<--critical>

Threshold critical.

=back

=cut


text:
package org.cagrid.gaards.websso.exception;

import org.jasig.cas.authentication.handler.AuthenticationException;

public class AuthenticationConfigurationException extends AuthenticationException
{
	/**
	 * Default serial id
	 */
	private static final long serialVersionUID = 1L;

	public AuthenticationConfigurationException(String message)
	{
		super(message);
	}

	public AuthenticationConfigurationException(String message, Exception exception)
	{
		super (message, exception);
	}
}


text:
/**
 * @generated SignedSource<<310b4a6c1ef968a6216e86cc73104f47>>
 * @lightSyntaxTransform
 * @nogrep
 */

/* tslint:disable */
/* eslint-disable */
// @ts-nocheck

import { ConcreteRequest, Mutation } from 'relay-runtime';
export type RequestConditionReportInput = {
  clientMutationId?: string | null;
  saleArtworkID: string;
};
export type RequestConditionReportMutation$variables = {
  input: RequestConditionReportInput;
};
export type RequestConditionReportMutation$data = {
  readonly requestConditionReport: {
    readonly conditionReportRequest: {
      readonly internalID: string;
    };
  } | null;
};
export type RequestConditionReportMutation = {
  response: RequestConditionReportMutation$data;
  variables: RequestConditionReportMutation$variables;
};

const node: ConcreteRequest = (function(){
var v0 = [
  {
    "defaultValue": null,
    "kind": "LocalArgument",
    "name": "input"
  }
],
v1 = [
  {
    "alias": null,
    "args": [
      {
        "kind": "Variable",
        "name": "input",
        "variableName": "input"
      }
    ],
    "concreteType": "RequestConditionReportPayload",
    "kind": "LinkedField",
    "name": "requestConditionReport",
    "plural": false,
    "selections": [
      {
        "alias": null,
        "args": null,
        "concreteType": "ConditionReportRequest",
        "kind": "LinkedField",
        "name": "conditionReportRequest",
        "plural": false,
        "selections": [
          {
            "alias": null,
            "args": null,
            "kind": "ScalarField",
            "name": "internalID",
            "storageKey": null
          }
        ],
        "storageKey": null
      }
    ],
    "storageKey": null
  }
];
return {
  "fragment": {
    "argumentDefinitions": (v0/*: any*/),
    "kind": "Fragment",
    "metadata": null,
    "name": "RequestConditionReportMutation",
    "selections": (v1/*: any*/),
    "type": "Mutation",
    "abstractKey": null
  },
  "kind": "Request",
  "operation": {
    "argumentDefinitions": (v0/*: any*/),
    "kind": "Operation",
    "name": "RequestConditionReportMutation",
    "selections": (v1/*: any*/)
  },
  "params": {
    "cacheID": "6f7779c4698ec556295c193d58013649",
    "id": null,
    "metadata": {},
    "name": "RequestConditionReportMutation",
    "operationKind": "mutation",
    "text": "mutation RequestConditionReportMutation(\n  $input: RequestConditionReportInput!\n) {\n  requestConditionReport(input: $input) {\n    conditionReportRequest {\n      internalID\n    }\n  }\n}\n"
  }
};
})();

(node as any).hash = "99b29530296311d1183354c3082e3055";

export default node;


text:
package $package;
import ballerina.net.http;
import ballerina.lang.messages;
import ballerina.lang.errors;
import ballerina.lang.system;

@http:config {basePath:"$apiContext"}
service<http> $serviceName {
#foreach( $endpointEntry in $apiEndpoint.entrySet() )
	#if($endpointEntry.key == "production")
		#if($endpointEntry.value.applicableLevel == "API")
		#set( $endpointConfig = '#set( $endpointConfig = ' + $endpointEntry.value.endpointConfig + ' )' )
		#evaluate ($endpointConfig)
		http:ClientConnector productionEndpoint = create http:ClientConnector("$endpointConfig.get("serviceUrl")");
		#end
	#end
	#if($endpointEntry.key == "sandbox")
		#if($endpointEntry.value.applicableLevel == "API")
		#set( $endpointConfig = '#set( $endpointConfig = ' + $endpointEntry.value.endpointConfig + ' )' )
		#evaluate ($endpointConfig)
		http:ClientConnector sandBoxEndpoint = create http:ClientConnector("$endpointConfig.get("serviceUrl")");
		#end
	#end
#end
	string KEY_TYPE = "KEY_TYPE";
#foreach($apiResource in $apiResources)
		#set( $productionEndpoint = $apiEndpoint.get("production"))
		#set( $sandboxEndpoint = $apiEndpoint.get("sandbox"))
## https://wso2.org/jira/browse/APIMANAGER-5710
	#if(!$StringUtils.isEmpty($apiResource.httpVerb) && (($apiResource.httpVerb == "GET") || ($apiResource.httpVerb == "POST")))
    @http:$apiResource.httpVerb{}
    #if(!$StringUtils.isEmpty($apiResource.consumes))@Consumes ($apiResource.consumes)#end
    #if(!$StringUtils.isEmpty($apiResource.produces))@Produces ($apiResource.produces)#end
	@http:Path{value:"$apiResource.uriTemplate"}
    resource $apiResource.templateId (message m) {
		#if($apiResource.productionEndpoint)
		#set( $productionEndpoint = $apiResource.productionEndpoint)
		#if($apiResource.productionEndpoint.applicableLevel == "API")
		#set( $endpointConfig = '#set( $endpointConfig = ' + $apiResource.productionEndpoint.endpointConfig + ' )' )
		#evaluate ($endpointConfig)
		http:ClientConnector ${apiResource.templateId}ProductionEndpoint = create http:ClientConnector("$endpointConfig.get("serviceUrl")");
		#end
		#else
		#if($apiEndpoint.get("production") && $apiEndpoint.get("production").applicableLevel == "API")
		http:ClientConnector ${apiResource.templateId}ProductionEndpoint = productionEndpoint;
		#end
		#end
		#if($apiResource.sandBoxEndpoint)
		#set( $sandboxEndpoint = $apiResource.sandBoxEndpoint)
		#if($apiResource.sandBoxEndpoint.applicableLevel == "API")
		#set( $endpointConfig = '#set( $endpointConfig = ' + $apiResource.sandBoxEndpoint.endpointConfig + ' )' )
		#evaluate ($endpointConfig)
		http:ClientConnector ${apiResource.templateId}SandBoxEndpoint = create http:ClientConnector($endpointConfig.get("serviceUrl"));
		#end
		#else
		#if($apiEndpoint.get("sandbox") && $apiEndpoint.get("sandbox").applicableLevel == "API")
		http:ClientConnector ${apiResource.templateId}SandBoxEndpoint = sandBoxEndpoint;
		#end
		#end
        message response;
		string endpointType = messages:getProperty(m,KEY_TYPE);

	try{
		if (endpointType == "PRODUCTION") {
		#if($productionEndpoint.applicableLevel == "API")
		response = http:ClientConnector.execute(${apiResource.templateId}ProductionEndpoint, "$apiResource.httpVerb.toLowerCase()", "", m);
		#else
		response = execute_endpoint("${productionEndpoint.name}","$apiResource.httpVerb.toLowerCase()", "", m);
		#end
		} else {
		#if($sandboxEndpoint.applicableLevel == "API")
		response = http:ClientConnector.execute(${apiResource.templateId}SandBoxEndpoint, "$apiResource.httpVerb.toLowerCase()", "", m);
		#else
		response = execute_endpoint("${sandboxEndpoint.name}","$apiResource.httpVerb.toLowerCase()", "", m);
		#end
		}
	} catch (errors:Error e) {
			system:println(e.msg);
			//fault:mediate(m, e);
			response = {};
		    messages:setStringPayload(response, "Internal error occurred");
			http:setStatusCode (response, 500);
		    reply response;
	}

		reply response;
}
#end
#end
}


text:
extern "Java"
{
  namespace javax
  {
    namespace swing
    {
      namespace text
      {
          class View;
        namespace html
        {
            class ImageView;
            class ImageView$1;
        }
      }
    }
  }
}

class javax::swing::text::html::ImageView$1 : public ::java::lang::Object
{

public: // actually package-private
  ImageView$1(::javax::swing::text::html::ImageView *, ::javax::swing::text::View *, jboolean, jboolean);
public:
  virtual void run();
public: // actually package-private
  ::javax::swing::text::html::ImageView * __attribute__((aligned(__alignof__( ::java::lang::Object)))) this$0;
private:
  ::javax::swing::text::View * val$v;
  jboolean val$width;
  jboolean val$height;
public:
  static ::java::lang::Class class$;
};

#endif // __javax_swing_text_html_ImageView$1__


text:
<?php
namespace Altair\Tests\Structure\Sequence;

trait map
{
    public function mapDataProvider()
    {
        // values, callback
        return [
            // Test mapping an empty sequence produces an empty sequence.
            [[], function () {
            }],

            // Test mapping string values using a string callable.
            [['A', 'B'], 'strtolower'],

            // Test mapping a sequence containing an object (for refcount?)
            [[new \stdClass()], 'spl_object_hash'],

            // Test basic mapping where integers are doubled.
            [[1, 2, 3], function ($v) {
                return $v * 2;
            }],
        ];
    }

    /**
     * @dataProvider mapDataProvider
     */
    public function testMap(array $values, callable $callback)
    {
        $instance = $this->getInstance($values);

        $mapped = $instance->map($callback);
        $expected = array_map($callback, $values);

        $this->assertToArray($values, $instance);
        $this->assertEquals($expected, $mapped->toArray());
    }

    public function testMapCallbackThrowsException()
    {
        $instance = $this->getInstance([1, 2, 3]);
        $mapped = null;

        try {
            $mapped = $instance->map(function ($value) {
                throw new \Exception();
            });
        } catch (\Exception $e) {
            $this->assertToArray([1, 2, 3], $instance);
            $this->assertNull($mapped);

            return;
        }

        $this->fail('Exception should have been caught');
    }

    public function testMapCallbackThrowsExceptionLaterOn()
    {
        $instance = $this->getInstance([1, 2, 3]);
        $mapped = null;

        try {
            $mapped = $instance->map(function ($value) {
                if ($value === 3) {
                    throw new \Exception();
                }

                return $value;
            });
        } catch (\Exception $e) {
            $this->assertToArray([1, 2, 3], $instance);
            $this->assertNull($mapped);

            return;
        }

        $this->fail('Exception should have been caught');
    }

    public function testMapDoesNotLeakWhenCallbackFails()
    {
        $instance = $this->getInstance(['a', 'b', 'c']);

        try {
            $instance->map(function ($value) {
                if ($value === 'c') {
                    throw new \Exception('bang!');
                }

                return $value;
            });
        } catch (\Exception $e) {
            $this->assertEquals('bang!', $e->getMessage());
            return;
        }

        $this->fail('Exception should have been caught');
    }
}


text:
import { Loggable } from "../../logger"
import { Serveable } from "../../service"
import { CliCommand, CliOptions, defaults } from "../index"

export const DESC = "Starts a create-service-app service in the background"
export const COMMAND = "start"
export const SUCCESS = "create-service-app service started."
export const FAILURE = "Unable to start create-service-app service."

export default class Start {
  public service: Serveable
  public logger: Loggable

  constructor(givenOptions: Partial<CliOptions> = {}) {
    const options = { ...defaults, ...givenOptions }

    this.logger = options.logger
    this.service = options.service
  }

  toCommand(): CliCommand {
    return {
      command: COMMAND,
      desc: DESC,
      builder: () => {},
      handler: () => this.perform()
    }
  }

  async perform(): Promise<void> {
    try {
      await this.service.start()
      await this.logger.info(SUCCESS)
    } catch(error) {
      await this.logger.error(FAILURE)
    }
  }
}


text:
from numpy import sum as npsum
from numpy import zeros

from gwlfe.Output.Loading.StreamBankN_1 import StreamBankN_1
from gwlfe.Output.Loading.StreamBankN_1 import StreamBankN_1_f

def AvStreamBankNSum(NYrs, DaysMonth, Temp, InitSnow_0, Prec, NRur, NUrb, Area, CNI_0, AntMoist_0, Grow_0, CNP_0, Imper,
                     ISRR, ISRA, CN, UnsatStor_0, KV, PcntET, DayHrs, MaxWaterCap, SatStor_0, RecessionCoef, SeepCoef,
                     Qretention, PctAreaInfil, n25b, Landuse, TileDrainDensity, PointFlow, StreamWithdrawal,
                     GroundWithdrawal, NumAnimals, AvgAnimalWt, StreamFlowVolAdj, SedAFactor_0, AvKF, AvSlope,
                     SedAAdjust, StreamLength, n42b, n46c, n85d, AgLength, n42, n54, n85, UrbBankStab, SedNitr,
                     BankNFrac, n69c, n45, n69):
    AvStreamBankN = zeros(12)
    for Y in range(NYrs):
        for i in range(12):
            AvStreamBankN[i] += \
                StreamBankN_1(NYrs, DaysMonth, Temp, InitSnow_0, Prec, NRur, NUrb, Area,
                              CNI_0, AntMoist_0, Grow_0, CNP_0, Imper, ISRR, ISRA, CN,
                              UnsatStor_0, KV, PcntET, DayHrs, MaxWaterCap, SatStor_0,
                              RecessionCoef, SeepCoef, Qretention, PctAreaInfil, n25b, Landuse,
                              TileDrainDensity, PointFlow, StreamWithdrawal, GroundWithdrawal,
                              NumAnimals, AvgAnimalWt, StreamFlowVolAdj, SedAFactor_0, AvKF,
                              AvSlope, SedAAdjust, StreamLength, n42b, AgLength,
                              UrbBankStab, SedNitr, BankNFrac, n69c, n45, n69, n46c, n42)[Y][i] / NYrs
    return sum(AvStreamBankN)

def AvStreamBankNSum_f(NYrs, DaysMonth, Temp, InitSnow_0, Prec, NRur, NUrb, Area, CNI_0, AntMoist_0, Grow_0, CNP_0,
                       Imper, ISRR, ISRA, CN, UnsatStor_0, KV, PcntET, DayHrs, MaxWaterCap, SatStor_0, RecessionCoef,
                       SeepCoef, Qretention, PctAreaInfil, n25b, Landuse, TileDrainDensity, PointFlow, StreamWithdrawal,
                       GroundWithdrawal, NumAnimals, AvgAnimalWt, StreamFlowVolAdj, SedAFactor_0, AvKF, AvSlope,
                       SedAAdjust, StreamLength, n42b, n46c, n85d, AgLength, n42, n54, n85, UrbBankStab, SedNitr,
                       BankNFrac, n69c, n45, n69):
    return npsum(StreamBankN_1_f(NYrs, DaysMonth, Temp, InitSnow_0, Prec, NRur, NUrb, Area, CNI_0, AntMoist_0, Grow_0,
                                 CNP_0, Imper, ISRR, ISRA, CN, UnsatStor_0, KV, PcntET, DayHrs, MaxWaterCap, SatStor_0,
                                 RecessionCoef, SeepCoef, Qretention, PctAreaInfil, n25b, Landuse, TileDrainDensity,
                                 PointFlow, StreamWithdrawal, GroundWithdrawal, NumAnimals, AvgAnimalWt,
                                 StreamFlowVolAdj,
                                 SedAFactor_0, AvKF, AvSlope, SedAAdjust, StreamLength, n42b, AgLength,
                                 UrbBankStab, SedNitr, BankNFrac, n69c, n45, n69, n46c, n42)) / NYrs


text:
PACKER := $(shell command -v packer)
VBOXMANAGE := $(shell command -v VBoxManage)

ifndef PACKER
$(error "Required binary 'packer' is unavailable in PATH. Please install packer.")
endif

ifndef VBOXMANAGE
$(error "Required binary 'VBoxManage' is unavailable in PATH. Please install VirtualBox.")
endif

# CentOS-6-x86_64-minimal
C6DIR             := c6x64
C6TARGETS         := minimal kernel-ml-epel gui gui-dev-java
C6OVAS            := $(addprefix build/,$(addsuffix .ova,$(addprefix $(C6DIR)-,$(C6TARGETS))))

#C67TEMPLATES       := $(addsuffix .json,$(addprefix $(C67DIR)/,$(C67TARGETS)))
#$(info C67 OVAs: $(C67OVAS))
#$(info C67 Templates: $(C67TEMPLATES))

all: $(C6OVAS)

# This works mostly as expected.
# The problem is I'm not sure how to declare depdencies: gui depends on
# kernel-ml-epel depends on minimal
#
#build/$(C67DIR)-%.ova: $(C67DIR)/%.json build/out
#	packer build $<
#	mv $(subst build,build/out,$@) $@
#	rmdir build/out

build/$(C6DIR)-minimal.ova: $(C6DIR)/minimal.json | build
	packer build $<
	mv $(subst build,build/out,$@) $@
	rmdir build/out

build/$(C6DIR)-kernel-ml-epel.ova: $(C6DIR)/kernel-ml-epel.json build/c6x64-minimal.ova | build
	packer build $<
	mv $(subst build,build/out,$@) $@
	rmdir build/out

build/$(C6DIR)-gui.ova: $(C6DIR)/gui.json build/c6x64-kernel-ml-epel.ova | build
	packer build $<
	mv $(subst build,build/out,$@) $@
	rmdir build/out

build/$(C6DIR)-gui-dev-java.ova: $(C6DIR)/gui-dev-java.json build/c6x64-gui.ova | build
	packer build $<
	mv $(subst build,build/out,$@) $@
	rmdir build/out

clean:
	rm -rf build

build:
	mkdir build

.PHONY: all clean


text:
import { ServiceClientCredentials } from 'ms-rest';
import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure';
import * as models from "./models";
import * as operations from "./operations";

export default class EventHubManagementClient extends AzureServiceClient {
  /**
   * Initializes a new instance of the EventHubManagementClient class.
   * @constructor
   *
   * @class
   * @param {credentials} credentials - Credentials needed for the client to connect to Azure.
   *
   * @param {string} subscriptionId - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
   *
   * @param {string} [baseUri] - The base URI of the service.
   *
   * @param {object} [options] - The parameter options
   *
   * @param {Array} [options.filters] - Filters to be added to the request pipeline
   *
   * @param {object} [options.requestOptions] - Options for the underlying request object
   * {@link https://github.com/request/request#requestoptions-callback Options doc}
   *
   * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy
   *
   * @param {string} [options.acceptLanguage] - The preferred language for the response.
   *
   * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30.
   *
   * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
   *
   */
  constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions);

  credentials: ServiceClientCredentials;

  subscriptionId: string;

  apiVersion: string;

  acceptLanguage: string;

  longRunningOperationRetryTimeout: number;

  generateClientRequestId: boolean;

  // Operation groups
  operations: operations.Operations;
  namespaces: operations.Namespaces;
  disasterRecoveryConfigs: operations.DisasterRecoveryConfigs;
  eventHubs: operations.EventHubs;
  consumerGroups: operations.ConsumerGroups;
  regions: operations.Regions;
}

export { EventHubManagementClient, models as EventHubManagementModels };


text:
require "test_helper"

require "gds_api/test_helpers/locations_api"
require "gds_api/test_helpers/local_links_manager"

class LocalTransactionControllerTest < ActionController::TestCase
  include GdsApi::TestHelpers::LocationsApi
  include GdsApi::TestHelpers::LocalLinksManager
  include LocationHelpers

  test "Should not allow framing of local transaction pages" do
    content_store_has_random_item(base_path: "/a-slug", schema: "local_transaction")

    prevent_implicit_rendering
    get :search, params: { slug: "a-slug" }
    assert_equal "DENY", @response.headers["X-Frame-Options"]
  end

  test "should set expiry headers for an edition" do
    content_store_has_random_item(base_path: "/a-slug", schema: "local_transaction")

    get :search, params: { slug: "a-slug" }
    honours_content_store_ttl
  end

  context "given a local transaction exists in content store" do
    setup do
      @payload_bear = {
        analytics_identifier: nil,
        base_path: "/pay-bear-tax",
        content_id: "d6d6caaf-77db-47e1-8206-30cd4f3d0e3f",
        document_type: "local_transaction",
        first_published_at: "2016-02-29T09:24:10.000+00:00",
        format: "local_transaction",
        locale: "en",
        phase: "beta",
        public_updated_at: "2014-12-16T12:49:50.000+00:00",
        publishing_app: "publisher",
        rendering_app: "frontend",
        schema_name: "local_transaction",
        title: "Send a bear to your local council",
        updated_at: "2017-01-30T12:30:33.483Z",
        withdrawn_notice: {},
        links: {},
        description: "Descriptive bear text.",
        details: {
          lgsl_code: 8342,
          lgil_code: 8,
          service_tiers: %w[district unitary],
          introduction: "Infos about sending bears.",
          scotland_availability: { "type" => "devolved_administration_service", "alternative_url" => "https://www.scotland.gov/service" },
          wales_availability: { "type" => "unavailable" },

        },
        external_related_links: [],
      }

      @payload_electoral = {
        analytics_identifier: nil,
        base_path: "/get-on-electoral-register",
        content_id: "d6d6caaf-77db-47e1-8206-30cd4f3hwe78",
        document_type: "local_transaction",
        first_published_at: "2016-02-29T09:24:10.000+00:00",
        format: "local_transaction",
        locale: "en",
        phase: "beta",
        public_updated_at: "2014-12-16T12:49:50.000+00:00",
        publishing_app: "publisher",
        rendering_app: "frontend",
        schema_name: "local_transaction",
        title: "Get on electoral register",
        updated_at: "2017-01-30T12:30:33.483Z",
        withdrawn_notice: {},
        links: {},
        description: "Descriptive text.",
        details: {
          lgsl_code: 364,
          lgil_code: 8,
          service_tiers: %w[district unitary],
          introduction: "Infos about registering to vote.",
        },
        external_related_links: [],
      }

      stub_content_store_has_item("/send-a-bear-to-your-local-council", @payload_bear)
      stub_content_store_has_item("/get-on-electoral-register", @payload_electoral)
    end

    context "loading the local transaction edition without any location" do
      should "return the normal content for a page" do
        get :search, params: { slug: "send-a-bear-to-your-local-council" }

        assert_response :success
        assert_equal assigns(:publication).title, "Send a bear to your local council"
      end

      should "set correct expiry headers" do
        get :search, params: { slug: "send-a-bear-to-your-local-council" }

        honours_content_store_ttl
      end
    end

    context "loading the local transaction when posting a location" do
      context "for an English local authority" do
        setup do
          configure_locations_api_and_local_authority("ST10 4DB", %w[staffordshire staffordshire-moorlands], 3435)

          post :search, params: { slug: "send-a-bear-to-your-local-council", postcode: "ST10-4DB] " }
        end

        should "redirect to the local authority slug" do
          assert_redirected_to "/send-a-bear-to-your-local-council/staffordshire-moorlands"
        end
      end

      context "for a Northern Ireland local authority" do
        setup do
          configure_locations_api_and_local_authority("BT1 4QG", %w[belfast], 8132)

          post :search, params: { slug: "send-a-bear-to-your-local-council", postcode: "BT1-4QG] " }
        end

        should "redirect to the local authority slug" do
          assert_redirected_to "/send-a-bear-to-your-local-council/belfast"
        end
      end

      context "for electoral registration for an English local authority" do
        setup do
          configure_locations_api_and_local_authority("ST10 4DB", %w[staffordshire staffordshire-moorlands], 3435)

          post :search, params: { slug: "get-on-electoral-register", postcode: "ST10-4DB] " }
        end

        should "redirect to the local authority slug" do
          assert_redirected_to "/get-on-electoral-register/staffordshire-moorlands"
        end
      end

      context "for electoral registration for a Northern Ireland local authority" do
        setup do
          stub_locations_api_has_location("BT1 3QG", [{ "local_custodian_code" => 8132 }])
          stub_local_links_manager_has_a_local_authority("belfast", country_name: "Northern Ireland", local_custodian_code: 8132)

          post :search, params: { slug: "get-on-electoral-register", postcode: "BT1-3QG] " }
        end

        should "redirect to the local authority slug" do
          assert_redirected_to "/get-on-electoral-register/electoral-office-for-northern-ireland"
        end
      end
    end

    context "loading the local transaction when posting an invalid postcode" do
      setup do
        stub_locations_api_does_not_have_a_bad_postcode("BLAH")

        post :search, params: { slug: "send-a-bear-to-your-local-council", postcode: "BLAH" }
      end

      should "responds successfully with an error message" do
        assert response.ok?
        assert_match CGI.escapeHTML(I18n.t!("formats.local_transaction.invalid_postcode")), response.body
      end
    end

    context "loading the local transaction when posting a postcode with no matching areas" do
      setup do
        stub_locations_api_has_no_location("WC1E 9ZZ")

        post :search, params: { slug: "send-a-bear-to-your-local-council", postcode: "WC1E 9ZZ" }
      end

      should "responds successfully with an error message" do
        assert response.ok?
        assert_match CGI.escapeHTML(I18n.t!("formats.local_transaction.valid_postcode_no_match")), response.body
      end
    end

    context "loading the local transaction when posting a location that has no matching local authority" do
      setup do
        stub_locations_api_has_location("AB1 2CD", [{ "local_custodian_code" => 123 }])
        stub_local_links_manager_does_not_have_a_custodian_code(123)

        post :search, params: { slug: "send-a-bear-to-your-local-council", postcode: "AB1 2CD" }
      end

      should "responds successfully with an error message" do
        assert response.ok?
        assert_match CGI.escapeHTML(I18n.t!("formats.local_transaction.no_local_authority")), response.body
      end
    end

    context "loading the local transaction for an authority" do
      setup do
        configure_locations_api_and_local_authority("ST10 4DB", %w[staffordshire-moorlands], 3435)

        stub_local_links_manager_has_a_link(
          authority_slug: "staffordshire-moorlands",
          lgsl: 8342,
          lgil: 8,
          url: "http://www.staffsmoorlands.gov.uk/sm/council-services/parks-and-open-spaces/parks",
          country_name: "England",
          status: "pending",
        )
      end

      should "assign local transaction information" do
        get :results, params: { slug: "send-a-bear-to-your-local-council", local_authority_slug: "staffordshire-moorlands" }

        assert_equal "http://www.staffsmoorlands.gov.uk/sm/council-services/parks-and-open-spaces/parks", assigns(:interaction_details)["local_interaction"]["url"]
      end

      should "assign link status" do
        get :results, params: { slug: "send-a-bear-to-your-local-council", local_authority_slug: "staffordshire-moorlands" }

        assert_equal "pending", assigns(:interaction_details)["local_interaction"]["status"]
      end
    end

    should "return a 404 for an incorrect authority slug" do
      stub_local_links_manager_request_with_invalid_parameters(authority_slug: "this-slug-should-not-exist", lgsl: "8342", lgil: "8")

      get :results, params: { slug: "send-a-bear-to-your-local-council", local_authority_slug: "this-slug-should-not-exist" }

      assert_equal 404, response.status
    end
  end

  context "loading a local transaction without an interaction that exists in content store" do
    setup do
      @payload = {
        analytics_identifier: nil,
        base_path: "/report-a-bear-on-a-local-road",
        content_id: "d6d6caaf-77db-47e1-8206-30cd4f3d0e3f",
        document_type: "local_transaction",
        first_published_at: "2016-02-29T09:24:10.000+00:00",
        format: "local_transaction",
        locale: "en",
        phase: "beta",
        public_updated_at: "2014-12-16T12:49:50.000+00:00",
        publishing_app: "publisher",
        rendering_app: "frontend",
        schema_name: "local_transaction",
        title: "Send a bear to your local council",
        updated_at: "2017-01-30T12:30:33.483Z",
        withdrawn_notice: {},
        links: {},
        description: "Descriptive bear text.",
        details: {
          lgsl_code: 1234,
          lgil_code: 1,
          service_tiers: %w[district unitary],
          introduction: "Infos about sending bears.",
        },
        external_related_links: [],
      }

      configure_locations_api_and_local_authority("ST10 4DB", %w[staffordshire-moorlands], 3435)

      stub_local_links_manager_has_no_link(
        authority_slug: "staffordshire-moorlands",
        lgsl: 1234,
        lgil: 1,
        country_name: "England",
      )

      stub_content_store_has_item("/report-a-bear-on-a-local-road", @payload)
      get :results, params: { slug: "report-a-bear-on-a-local-road", local_authority_slug: "staffordshire-moorlands" }
    end

    should "responds successfully with an error message" do
      assert response.ok?
      assert_match "We do not know if they offer this service", response.body
    end
  end

  context "when visiting a local transaction which is in fact check" do
    setup do
      stub_locations_api_has_location(
        "SW1A 1AA",
        [
          {
            "latitude" => 51.5010096,
            "longitude" => -0.1415870,
            "local_custodian_code" => 5990,
          },
        ],
      )
      stub_local_links_manager_has_a_local_authority("westminster", local_custodian_code: 5990)

      stub_local_links_manager_has_a_link(
        authority_slug: "westminster",
        lgsl: 461,
        lgil: 8,
        url: "http://www.westminster.gov.uk/bear-the-cost-of-grizzly-ownership-2016-update",
        country_name: "England",
        status: "ok",
      )

      @payload = {
        base_path: "/pay-bear-tax",
        document_type: "local_transaction",
        format: "local_transaction",
        schema_name: "local_transaction",
        details: {
          lgsl_code: 461,
          lgil_code: 8,
          service_tiers: %w[county unitary],
          introduction: "Information about paying local tax on owning or looking after a bear.",
        },
      }

      stub_content_store_has_item("/pay-bear-tax", @payload)
    end

    should "redirect to the correct authority and pass cache and token as params" do
      post :search, params: { slug: "pay-bear-tax", postcode: "SW1A 1AA", token: "123", cache: "abc" }

      assert_redirected_to "/pay-bear-tax/westminster?cache=abc&token=123"
    end
  end
end


text:
![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0

To use the Snow Report for Canada Olympic Park skill, try saying...

* *Alexa, ask Canada Olympic Park for the snow report*

* *Alexa, open Canada Olympic Park*

* *Alexa, ask Canada Olympic Park for latest conditions*

The Canada Olympic Park Snow Report brought to you by SnoCountry brings you the latest snow fall, snow surface conditions,  base depth, trail, and lift operations information.

***

### Skill Details

* **Invocation Name:** canada olympic park
* **Category:** null
* **ID:** amzn1.ask.skill.a0b6cee0-1047-43c2-a058-a058a61af138
* **ASIN:** B01LZXWSIT
* **Author:** SnoCountry
* **Release Date:** October 20, 2016 @ 03:46:09
* **In-App Purchasing:** No


text:
//
//  Created by Objectsol on 16/06/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "otherGames.h"
#import "SimpleAudioEngine.h"

@implementation otherGames

+(id) scene
{

	CCScene *scene = [CCScene node];

    HUDsound *hud = [HUDsound node];
    [scene addChild:hud z:1];

    otherGames *layer = [[[otherGames alloc] initWithHUD:hud] autorelease];
    [scene addChild:layer];

    return scene;
}

- (id)initWithHUD:(HUDsound *)hud
{
    if ((self = [super init]))
	{
		[self startOfGame];
    }
    return self;
}

-(void) startOfGame
{

	//	[SHKTwitter logout];

	[[CCDirector sharedDirector] resume] ;
	[[SimpleAudioEngine sharedEngine]stopBackgroundMusic];
	[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationPortrait];
	CCSprite *backGround = [CCSprite spriteWithFile:@"mainmenuak.png"];
	backGround.position = ccp(240, 160);

	[self addChild:backGround  z:-2];

	CCMenuItem *starMenuItem11 = [CCMenuItemImage
								  itemFromNormalImage:@"StartButtonUp.png" selectedImage:@"StartButtonDown.png"
								  target:self selector:@selector(aCase)];
	starMenuItem11.position = ccp(60, 280);

	CCMenu *starMenu11 = [CCMenu menuWithItems:starMenuItem11, nil];
	starMenu11.position = CGPointZero;
	[self addChild:starMenu11 z:44];

	CCMenuItem *starMenuItem12 = [CCMenuItemImage
								  itemFromNormalImage:@"othergame75.png" selectedImage:@"othergamesak.png"
								  target:self selector:@selector(aCase)];
	starMenuItem12.position = ccp(70, 20);

	CCMenu *starMenu12 = [CCMenu menuWithItems:starMenuItem12, nil];
	starMenu12.position = CGPointZero;
	starMenu12.scale=1.04;
	[self addChild:starMenu12 z:44];

	CCMenuItem *starMenuItem14 = [CCMenuItemImage
								  itemFromNormalImage:@"tutorial75.png" selectedImage:@"tutorialak.png"
								  target:self selector:@selector(aCase)];
	starMenuItem14.position = ccp(256, 20);

	CCMenu *starMenu14 = [CCMenu menuWithItems:starMenuItem14, nil];
	starMenu14.position = CGPointZero;
	starMenu14.scale=1.04;
	[self addChild:starMenu14 z:44];

	/*CCMenuItem *starMenuItem121 = [CCMenuItemImage
	 itemFromNormalImage:@"leaderboard.png" selectedImage:@"leaderboardTap.png"
	 target:self selector:@selector(levelSelectionPage)];
	 starMenuItem121.position = ccp(320, 20);

	 CCMenu *starMenu121 = [CCMenu menuWithItems:starMenuItem121, nil];
	 starMenu121.position = CGPointZero;
	 [self addChild:starMenu121 z:44];*/

	CCMenuItem *starMenuItem141 = [CCMenuItemImage
								   itemFromNormalImage:@"about75.png" selectedImage:@"aboutak.png"
								   target:self selector:@selector(aCase)];
	starMenuItem141.position = ccp(430, 20);

	CCMenu *starMenu141 = [CCMenu menuWithItems:starMenuItem141, nil];
	starMenu141.position = CGPointZero;
	starMenu141.scale=1.04;
	[self addChild:starMenu141 z:44];

	[self otherGamesCase];

}
- (void)loadRequest:(NSURLRequest *)request
{
    [self retain];
    if ([vw_img1 isLoading])
        [vw_img1 stopLoading];
    [vw_img1 loadRequest:request];
    [self release];
}
- (void)webViewDidStartLoad:(UIWebView *)webView
{
    [self retain];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [self release];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    [self release];
}

- (void)viewWillDisappear
{
    if ([vw_img1 isLoading])
        [vw_img1 stopLoading];
}

-(void)aCase
{
}

-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType
{
	if (inType == UIWebViewNavigationTypeLinkClicked )
	{
		[[UIApplication sharedApplication] openURL:[inRequest URL]];
		return NO;
	}

	return YES;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    //return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

-(void)otherGamesCase
{
	if(vw_img1)
	{
		[vw_img1 removeFromSuperview];
		[vw_img1 release],vw_img1=nil;
	}

	[[NSUserDefaults standardUserDefaults]
     registerDefaults:[NSDictionary
                       dictionaryWithObject:@"some old phone or other"
                       forKey:@"UserAgent"]];
	vw_img1=[[UIWebView alloc]initWithFrame:CGRectMake(80,-80,320,480)];
    vw_img1.backgroundColor=[UIColor clearColor];
    vw_img1.delegate=self;
	[vw_img1 setBackgroundColor:[UIColor clearColor]];
    NSString *urlAddress = @"https://openspacestore.com/widget/openspacestore.html?FBRedirect=true";
    NSURL *url = [NSURL URLWithString:urlAddress];
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
    [vw_img1 loadRequest:requestObj];
    //[self.view addSubview:vw_img1];

	vw_img1.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS( -90.0f ));
	[[[CCDirector sharedDirector]openGLView] addSubview:vw_img1];

	UIButton *buttonForFood=[UIButton buttonWithType:UIButtonTypeCustom];
	[buttonForFood setImage:[UIImage imageNamed:@"x.png"] forState: UIControlStateNormal];
	[buttonForFood addTarget:self action:@selector(buttonPressed) forControlEvents:UIControlEventTouchUpInside];
	buttonForFood.frame = CGRectMake(280, 2, 38, 38);
	[vw_img1 addSubview:buttonForFood];

}

-(void)buttonPressed
{
	//[vw_img1 stopLoading];

	[vw_img1 setDelegate:nil];
    [vw_img1 stopLoading];
  //  [vw_img1 release];

	[vw_img1   removeFromSuperview];
	vw_img1=nil;
	[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft];
	[[CCDirector sharedDirector] pause] ;
	[[CCDirector sharedDirector] replaceScene:[menuPage scene]];

}

/*- (void)plusMinusButtonTapped:(id)sender {
 if ([[SimpleAudioEngine sharedEngine] mute])
 {
 // This will unmute the sound
 [[SimpleAudioEngine sharedEngine] setMute:0];
 [[SimpleAudioEngine sharedEngine]stopBackgroundMusic];
 [[SimpleAudioEngine sharedEngine] playBackgroundMusic:@"StoryMusic.mp3"];

 }

 else
 {
 //This will mute the sound
 [[SimpleAudioEngine sharedEngine] setMute:1];
 }

 }*/

-(void)levelSelectionPage
{
	//[[CCDirector sharedDirector] pause] ;
	//[[CCDirector sharedDirector] replaceScene:[labelSelection scene]];
}

-(void)needToStart2
{

	[[CCDirector sharedDirector] pause] ;
	[[CCDirector sharedDirector] replaceScene:[HelloWorld scene]];

}

- (void)viewWillUnload {
    [vw_img1 setDelegate:nil];
    [vw_img1 stopLoading];
}

- (void) dealloc
{

	[vw_img1 setDelegate:nil];
    [vw_img1 stopLoading];
    [vw_img1 release];

	// in case you have something to dealloc, do it in this method
	// in this particular example nothing needs to be released.
	// cocos2d will automatically release all the children (Label)

	// don't forget to call "super dealloc"
	[[CCDirector sharedDirector] purgeCachedData];
	[self unscheduleAllSelectors];
	[[CCSpriteFrameCache sharedSpriteFrameCache] removeUnusedSpriteFrames];
	[[CCTextureCache sharedTextureCache] removeAllTextures];
	[super dealloc];
}

@end


text:
  MongoDB session store for Connect

  [![Build Status](https://secure.travis-ci.org/kcbanner/connect-mongo.png?branch=master)](http://travis-ci.org/kcbanner/connect-mongo)

## Installation

connect-mongo supports only connect `>= 1.0.3`.

via npm:

    $ npm install connect-mongo

## Options

  - `db` Database name
  - `collection` Collection (optional, default: `sessions`)
  - `host` MongoDB server hostname (optional, default: `127.0.0.1`)
  - `port` MongoDB server port (optional, default: `27017`)
  - `username` Username (optional)
  - `password` Password (optional)
  - `auto_reconnect` This is passed directly to the MongoDB `Server` constructor as the auto_reconnect
                     option (optional, default: false).
  - `url` Connection url of the form: `mongodb://user:pass@host:port/database/collection`.
          If provided, information in the URL takes priority over the other options.
  - `mongoose_connection` in the form: `someMongooseDb.connections[0]` to use an existing mongoose connection. (optional)
  - `clear_interval` Interval in seconds to clear expired sessions (optional, default: `-1`).
          Values <= 0 disable expired session clearing.
  - `stringify` If true, connect-mongo will serialize sessions using `JSON.stringify` before
                setting them, and deserialize them with `JSON.parse` when getting them.
                (optional, default: true). This is useful if you are using types that
                MongoDB doesn't support.

The second parameter to the `MongoStore` constructor is a callback which will be called once the database connection is established.
This is mainly used for the tests, however you can use this callback if you want to wait until the store has connected before
starting your app.

## Example

With express:

    var express = require('express');
    var MongoStore = require('connect-mongo')(express);

    app.use(express.session({
        secret: settings.cookie_secret,
        store: new MongoStore({
          db: settings.db
        })
      }));

With connect:

    var connect = require('connect');
    var MongoStore = require('connect-mongo')(connect);

## Tests

You need `mocha`.

    make test

The tests use a database called `connect-mongo-test`.

## License

(The MIT License)

Copyright (c) 2011 Casey Banner <kcbanner@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
#region License

#endregion License

using System;

namespace Microsoft.Xna.Framework.Graphics
{
    public class GammaRamp : IDisposable
    {
        public GammaRamp() { throw new NotImplementedException(); }
        ~GammaRamp()
        {
        }

        public void Dispose()
        {
            throw new NotImplementedException();
        }

        protected virtual void Dispose(bool disposing)
        {
            throw new NotImplementedException();
        }

        public short[] GetBlue()
        {
            throw new NotImplementedException();
        }

        public short[] GetGreen()
        {
            throw new NotImplementedException();
        }

        public short[] GetRed()
        {
            throw new NotImplementedException();
        }

        public void SetBlue(short[] value)
        {
            throw new NotImplementedException();
        }

        public void SetGreen(short[] value)
        {
            throw new NotImplementedException();
        }

        public void SetRed(short[] value)
        {
            throw new NotImplementedException();
        }
    }
}


text:
<!doctype html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>jQuery UI Resizable - Maximum / minimum size</title>
	<link rel="stylesheet" href="../../themes/base/all.css">
	<link rel="stylesheet" href="../demos.css">

Resize larger / smaller

Limit the resizable element to a maximum or minimum height or width using the maxHeight, maxWidth, minHeight, and minWidth options.


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

namespace _23SeriesOfLetters
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("enter text");
            string text = Console.ReadLine();

            StringBuilder result = new StringBuilder();
            char pom = '\0';

            for (int i = 1; i < text.Length; i++)
            {

                if (text[i] != pom)
                {
                    result.Append(text[i]);
                }
                pom = text[i];

            }
            Console.WriteLine(result.ToString());
        }
    }
}


text:
package com.bulenkov.darcula;

import javax.swing.*;

/**
 * @author Konstantin Bulenkov
 */
public class DarculaLookAndFeelInfo extends UIManager.LookAndFeelInfo {
    public static final String CLASS_NAME = "idea.dark.laf.classname";
    public DarculaLookAndFeelInfo(){
      super("Darcula", CLASS_NAME);
    }

    public boolean equals(Object obj){
      return (obj instanceof DarculaLookAndFeelInfo);
    }

    public int hashCode(){
      return getName().hashCode();
    }
}