text:
@implementation ClearCache

+(void)clearAllCache
{
	// Data
    [[TagsData sharedInstance] clearCache];
	[[CategoriesData sharedInstance] clearCache];

    // URL requests
    [[Model sharedInstance].imageCache removeAllCachedResponses];

    // Place names
    [[LocationsData sharedInstance] clearCache];
}

@end

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Monmiel\MonmielApiBundle\Tests\Services\FacilityService;

use Monmiel\MonmielApiBundle\Services\FacilityService\ComputeFacilityService;
use Monmiel\MonmielApiModelBundle\Model\Parc\ParcFinal;
use Monmiel\MonmielApiModelBundle\Model\Year;
use Monmiel\MonmielApiBundle\Tests\BaseTestCase;

class ComputeFacilityServiceTest extends BaseTestCase
{
    /**
     * @var $facilityService ComputeFacilityService
     */
    protected $facilityService;

    public function setup()
    {
        $this->facilityService = new ComputeFacilityService();
    }

    /**
     * @test
     */
    public function testMaxFlamme()
    {
        $array = array(5,3,1500,800,500);

        foreach($array as &$solde){
            $this->facilityService->submitQuarters($solde);
        }

        $year= new Year("1",50000000,25000000,25000000,0,0,0,100000000);

        $power= new Power(0,1000,0,10000,0,100,0,100);
//        $nuc->setTauxDisponibiliteNuclear(0.10);
//        echo $nuc->getTauxDisponibiliteNuclear()."\n";

        /**
         * @var $newParc ParcFinal
         */
        $newParc= $this->facilities->getSimulatedParc(null,$power);
        $PuisFlamme=$newParc->getPuisFlamme();

        assertEquals($PuisFlamme,1500);

    }

    /**
     * @test
     */
    public function testMachin()
    {
        $day = new \Monmiel\MonmielApiModelBundle\Model\Day();
        $repartionService = $this->getRepartionMock();
        $repartionService->expects($this->once())
                         ->will($this->returnValue($day));
    }

    public function getRepartionMock()
    {
        $mockedRepartionService = $this->getMockBuilder("Monmiel\MonmielApiBundle\Services\RepartitionService\RepartitionServiceV1")
                                       ->disableOriginalConstructor()
                                       ->getMock();
        return $mockedRepartionService;
    }
}


text:
title: "Performing actions on the AUT*"
weight: 4
---

You can set an element's text using the sendKeys method as follows:

{{< code-tab >}}
  {{< code-panel language="java" >}}
String name = "Charles";
driver.findElement(By.name("name")).sendKeys(name);
  {{< / code-panel >}}
  {{< code-panel language="python" >}}
name = "Charles"
driver.find_element_by_name("name").send_keys(name)
  {{< / code-panel >}}
  {{< code-panel language="csharp" >}}
string name = "Charles";
driver.FindElement(By.Name("name")).SendKeys(name);
  {{< / code-panel >}}
  {{< code-panel language="ruby" >}}
name = "Charles"
driver.find_element(name: "name").send_keys(name)
  {{< / code-panel >}}
  {{< code-panel language="javascript" >}}
const name = "Charles";
await driver.findElement(By.name('name')).sendKeys(name);
  {{< / code-panel >}}
  {{< code-panel language="kotlin" >}}
val name = "Charles"
driver.findElement(By.name("name")).sendKeys(name)
  {{< / code-panel >}}
{{< / code-tab >}}

Some web applications use JavaScript libraries to add drag-and-drop
functionality. The following is a basic example of dragging one
element onto another element:

{{< code-tab >}}
  {{< code-panel language="java" >}}
WebElement source = driver.findElement(By.id("source"));
WebElement target = driver.findElement(By.id("target"));
new Actions(driver).dragAndDrop(source, target).build().perform();
  {{< / code-panel >}}
  {{< code-panel language="python" >}}
source = driver.find_element_by_id("source")
target = driver.find_element_by_id("target")
ActionChains(driver).drag_and_drop(source, target).perform()
  {{< / code-panel >}}
  {{< code-panel language="csharp" >}}
IWebElement source = driver.FindElement(By.Id("source"));
IWebElement target = driver.FindElement(By.Id("target"));
new Actions(driver).DragAndDrop(source, target).Build().Perform();
  {{< / code-panel >}}
  {{< code-panel language="ruby" >}}
source = driver.find_element(id: "source")
target = driver.find_element(id: "target")
driver.action.drag_and_drop(source, target).perform
  {{< / code-panel >}}
  {{< code-panel language="javascript" >}}
const actions = driver.actions({bridge: true});
const source = await driver.findElement(By.id('source'));
const target = await driver.findElement(By.id('target'));
await actions.dragAndDrop(source, target).perform();
  {{< / code-panel >}}
  {{< code-panel language="kotlin" >}}
val source = driver.findElement(By.id("source"))
val target = driver.findElement(By.id("target"))
Actions(driver).dragAndDrop(source, target).build().perform()
  {{< / code-panel >}}
{{< / code-tab >}}

### Clicking on an element

You can click on an element using the click method:

{{< code-tab >}}
  {{< code-panel language="java" >}}
driver.findElement(By.cssSelector("input[type='submit']")).click();
  {{< / code-panel >}}
  {{< code-panel language="python" >}}
driver.find_element_by_css_selector("input[type='submit']").click()
  {{< / code-panel >}}
  {{< code-panel language="csharp" >}}
driver.FindElement(By.CssSelector("input[type='submit']")).Click();
  {{< / code-panel >}}
  {{< code-panel language="ruby" >}}
driver.find_element(css: "input[type='submit']").click
  {{< / code-panel >}}
  {{< code-panel language="javascript" >}}
await driver.findElement(By.css("input[type='submit']")).click();
  {{< / code-panel >}}
  {{< code-panel language="kotlin" >}}
driver.findElement(By.cssSelector("input[type='submit']")).click()
  {{< / code-panel >}}
{{< / code-tab >}}

***AUT**: Application under test


text:
package org.shadowice.flocke.andotp.Activities;

import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;

import org.shadowice.flocke.andotp.R;
import org.shadowice.flocke.andotp.Utilities.Settings;
import org.shadowice.flocke.andotp.Utilities.Tools;

import java.util.Locale;

public abstract class ThemedActivity extends AppCompatActivity {
    public Settings settings;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        settings = new Settings(this);

        setTheme(settings.getTheme());
        setLocale();

        //Set navigation bar color
        getWindow().setNavigationBarColor(Tools.getThemeColor(this,R.attr.navigationBarColor));

        super.onCreate(savedInstanceState);
    }

    @Override
    public void onResume() {
        setLocale();

        super.onResume();
    }

    public void setLocale() {
        Locale locale = settings.getLocale();
        Locale.setDefault(locale);

        Resources resources = getBaseContext().getResources();
        Configuration config = resources.getConfiguration();
        config.locale = locale;

        // TODO: updateConfiguration is marked as deprecated. Replace with android.content.Context.createConfigurationContext
        resources.updateConfiguration(config, resources.getDisplayMetrics());
    }
}


text:
import rpath_xmllib as xmllib

from catalogService.rest.models import instances
import xmlNode

class CloudType(xmlNode.BaseNode):
    tag = 'cloudType'
    __slots__ = [ 'id', 'description', 'cloudTypeName',
        'descriptorCredentials',
        'descriptorInstanceConfiguration',
        'cloudInstances' ]
    _slotAttributes = set(['id'])

class CloudTypes(xmlNode.BaseNodeCollection):
    tag = "cloudTypes"

class CloudInstances(xmlNode.BaseNode):
    tag = "cloudInstances"
    __slots__ = [ 'href' ]
    _slotAttributes = set(['href'])

class DescriptorCredentials(xmlNode.BaseNode):
    tag = "descriptorCredentials"
    __slots__ = [ 'href' ]
    _slotAttributes = set(['href'])

class DescriptorInstanceConfiguration(xmlNode.BaseNode):
    tag = "descriptorInstanceConfiguration"
    __slots__ = [ 'href' ]
    _slotAttributes = set(['href'])

class Handler(xmllib.DataBinder):
    cloudTypeClass = CloudType
    cloudTypesClass = CloudTypes
    cloudInstancesClass = CloudInstances
    descriptorCredentialsClass = DescriptorCredentials
    descriptorInstanceConfigurationClass = DescriptorInstanceConfiguration
    def __init__(self):
        xmllib.DataBinder.__init__(self)
        self.registerType(self.cloudTypeClass, self.cloudTypeClass.tag)
        self.registerType(self.cloudTypesClass, self.cloudTypesClass.tag)
        self.registerType(self.cloudInstancesClass, self.cloudInstancesClass.tag)
        self.registerType(self.descriptorCredentialsClass,
            self.descriptorCredentialsClass.tag)
        self.registerType(self.descriptorInstanceConfigurationClass,
            self.descriptorInstanceConfigurationClass.tag)


text:
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

#pragma once

/*! \file rx-skip_until.hpp

    \brief Make new observable with items skipped until on_next occurs on the trigger observable or until the specified time.
           skip_until takes (TriggerObservable, optional Coordination) or (TimePoint, optional Coordination)

    \tparam  TriggerSource  the type of the trigger observable.
    \tparam  Coordination   the type of the scheduler (optional).

    \param  t  an observable that has to emit an item before the source observable's elements begin to be mirrored by the resulting observable.
    \param  cn  the scheduler to use for scheduling the items (optional).

    \return  An observable that skips items from the source observable until the second observable emits an item or the time runs out, then emits the remaining items.

    \sample
    \snippet skip_until.cpp skip_until sample
    \snippet output.txt skip_until sample

    \sample
    \snippet skip_until.cpp threaded skip_until sample
    \snippet output.txt threaded skip_until sample
*/

#if !defined(RXCPP_OPERATORS_RX_SKIP_UNTIL_HPP)
#define RXCPP_OPERATORS_RX_SKIP_UNTIL_HPP

#include "../rx-includes.hpp"

namespace rxcpp {

namespace operators {

namespace detail {

template<class... AN>
struct skip_until_invalid_arguments {};

template<class... AN>
struct skip_until_invalid : public rxo::operator_base<skip_until_invalid_arguments<AN...>> {
    using type = observable<skip_until_invalid_arguments<AN...>, skip_until_invalid<AN...>>;
};
template<class... AN>
using skip_until_invalid_t = typename skip_until_invalid<AN...>::type;

template<class T, class Observable, class TriggerObservable, class Coordination>
struct skip_until : public operator_base<T>
{
    using source_type = rxu::decay_t<Observable>;
    using trigger_source_type = rxu::decay_t<TriggerObservable>;
    using coordination_type = rxu::decay_t<Coordination>;
    using coordinator_type = typename coordination_type::coordinator_type;
    struct values
    {
        values(source_type s, trigger_source_type t, coordination_type sf)
            : source(std::move(s))
            , trigger(std::move(t))
            , coordination(std::move(sf))
        {
        }
        source_type source;
        trigger_source_type trigger;
        coordination_type coordination;
    };
    values initial;

    skip_until(source_type s, trigger_source_type t, coordination_type sf)
        : initial(std::move(s), std::move(t), std::move(sf))
    {
    }

    struct mode
    {
        enum type {
            skipping,  // no messages from trigger
            clear,     // trigger completed
            triggered, // trigger sent on_next
            errored,   // error either on trigger or on observable
            stopped    // observable completed
        };
    };

    template<class Subscriber>
    void on_subscribe(Subscriber s) const {

        using output_type = Subscriber;
        struct state_type
            : public std::enable_shared_from_this<state_type>
            , public values
        {
            state_type(const values& i, coordinator_type coor, const output_type& oarg)
                : values(i)
                , mode_value(mode::skipping)
                , coordinator(std::move(coor))
                , out(oarg)
            {
                out.add(trigger_lifetime);
                out.add(source_lifetime);
            }
            typename mode::type mode_value;
            composite_subscription trigger_lifetime;
            composite_subscription source_lifetime;
            coordinator_type coordinator;
            output_type out;
        };

        auto coordinator = initial.coordination.create_coordinator();

        // take a copy of the values for each subscription
        auto state = std::make_shared<state_type>(initial, std::move(coordinator), std::move(s));

        auto trigger = on_exception(
            [&](){return state->coordinator.in(state->trigger);},
            state->out);
        if (trigger.empty()) {
            return;
        }

        auto source = on_exception(
            [&](){return state->coordinator.in(state->source);},
            state->out);
        if (source.empty()) {
            return;
        }

        auto sinkTrigger = make_subscriber<typename trigger_source_type::value_type>(
        // share parts of subscription
            state->out,
        // new lifetime
            state->trigger_lifetime,
        // on_next
            [state](const typename trigger_source_type::value_type&) {
                if (state->mode_value != mode::skipping) {
                    return;
                }
                state->mode_value = mode::triggered;
                state->trigger_lifetime.unsubscribe();
            },
        // on_error
            [state](rxu::error_ptr e) {
                if (state->mode_value != mode::skipping) {
                    return;
                }
                state->mode_value = mode::errored;
                state->out.on_error(e);
            },
        // on_completed
            [state]() {
                if (state->mode_value != mode::skipping) {
                    return;
                }
                state->mode_value = mode::clear;
                state->trigger_lifetime.unsubscribe();
            }
        );
        auto selectedSinkTrigger = on_exception(
            [&](){return state->coordinator.out(sinkTrigger);},
            state->out);
        if (selectedSinkTrigger.empty()) {
            return;
        }
        trigger->subscribe(std::move(selectedSinkTrigger.get()));

        source.get().subscribe(
        // split subscription lifetime
            state->source_lifetime,
        // on_next
            [state](auto&& t) {
                if (state->mode_value != mode::triggered) {
                    return;
                }
                state->out.on_next(std::forward<decltype(t)>(t));
            },
        // on_error
            [state](rxu::error_ptr e) {
                if (state->mode_value > mode::triggered) {
                    return;
                }
                state->mode_value = mode::errored;
                state->out.on_error(e);
            },
        // on_completed
            [state]() {
                if (state->mode_value != mode::triggered) {
                    return;
                }
                state->mode_value = mode::stopped;
                state->out.on_completed();
            }
        );
    }
};

}

/*! @copydoc rx-skip_until.hpp
*/
template<class... AN>
auto skip_until(AN&&... an)
    ->     operator_factory<skip_until_tag, AN...> {
    return operator_factory<skip_until_tag, AN...>(std::make_tuple(std::forward<AN>(an)...));
}

}

template<>
struct member_overload<skip_until_tag>
{
    template<class Observable, class TimePoint,
        class Enabled = rxu::enable_if_all_true_type_t<
            is_observable<Observable>,
            std::is_convertible<TimePoint, rxsc::scheduler::clock_type::time_point>>,
        class SourceValue = rxu::value_type_t<Observable>,
        class Timer = typename rxu::defer_type<rxs::detail::timer, identity_one_worker>::type,
        class TimerValue = rxu::value_type_t<Timer>,
        class TriggerObservable = observable<TimerValue, Timer>,
        class SkipUntil = rxo::detail::skip_until<SourceValue, rxu::decay_t<Observable>, TriggerObservable, identity_one_worker>,
        class Value = rxu::value_type_t<SkipUntil>,
        class Result = observable<Value, SkipUntil>>
    static Result member(Observable&& o, TimePoint&& when) {
        auto cn = identity_current_thread();
        return Result(SkipUntil(std::forward<Observable>(o), rxs::timer(std::forward<TimePoint>(when), cn), cn));
    }

    template<class Observable, class TimePoint, class Coordination,
        class Enabled = rxu::enable_if_all_true_type_t<
            is_observable<Observable>,
            is_coordination<Coordination>,
            std::is_convertible<TimePoint, rxsc::scheduler::clock_type::time_point>>,
        class SourceValue = rxu::value_type_t<Observable>,
        class Timer = typename rxu::defer_type<rxs::detail::timer, rxu::decay_t<Coordination>>::type,
        class TimerValue = rxu::value_type_t<Timer>,
        class TriggerObservable = observable<TimerValue, Timer>,
        class SkipUntil = rxo::detail::skip_until<SourceValue, rxu::decay_t<Observable>, TriggerObservable, rxu::decay_t<Coordination>>,
        class Value = rxu::value_type_t<SkipUntil>,
        class Result = observable<Value, SkipUntil>>
    static Result member(Observable&& o, TimePoint&& when, Coordination cn) {
        return Result(SkipUntil(std::forward<Observable>(o), rxs::timer(std::forward<TimePoint>(when), cn), cn));
    }

    template<class Observable, class TriggerObservable,
        class Enabled = rxu::enable_if_all_true_type_t<
            all_observables<Observable, TriggerObservable>>,
        class SourceValue = rxu::value_type_t<Observable>,
        class SkipUntil = rxo::detail::skip_until<SourceValue, rxu::decay_t<Observable>, rxu::decay_t<TriggerObservable>, identity_one_worker>,
        class Value = rxu::value_type_t<SkipUntil>,
        class Result = observable<Value, SkipUntil>>
    static Result member(Observable&& o, TriggerObservable&& t) {
        return Result(SkipUntil(std::forward<Observable>(o), std::forward<TriggerObservable>(t), identity_current_thread()));
    }

     template<class Observable, class TriggerObservable, class Coordination,
        class Enabled = rxu::enable_if_all_true_type_t<
            all_observables<Observable, TriggerObservable>,
            is_coordination<Coordination>>,
        class SourceValue = rxu::value_type_t<Observable>,
        class SkipUntil = rxo::detail::skip_until<SourceValue, rxu::decay_t<Observable>, rxu::decay_t<TriggerObservable>, rxu::decay_t<Coordination>>,
        class Value = rxu::value_type_t<SkipUntil>,
        class Result = observable<Value, SkipUntil>>
    static Result member(Observable&& o, TriggerObservable&& t, Coordination&& cn) {
        return Result(SkipUntil(std::forward<Observable>(o), std::forward<TriggerObservable>(t), std::forward<Coordination>(cn)));
    }

    template<class... AN>
    static operators::detail::skip_until_invalid_t<AN...> member(AN...) {
        std::terminate();
        return {};
        static_assert(sizeof...(AN) == 10000, "skip_until takes (TriggerObservable, optional Coordination) or (TimePoint, optional Coordination)");
    }
};

}

#endif


text:
/* @flow */
import React from 'react';
import { Animated, Easing, Image, StyleSheet, View } from 'react-native';

const styles = StyleSheet.create({
  row: {
    padding: 8,
    flexDirection: 'row',
    justifyContent: 'center',
    alignItems: 'center',
  },
  loading: {
    margin: 8,
  },
  semiCircle: {
    width: 32,
    height: 32,
    marginBottom: -28,
    alignSelf: 'center',
    borderColor: 'black',
    borderTopWidth: 1,
    borderLeftWidth: 1,
    borderRadius: 100,
  },
  logo: {
    width: 24,
    height: 24,
    alignSelf: 'center',
    overflow: 'hidden',
  },
  line: {
    flex: 1,
    height: 1,
    borderWidth: 1,
    borderColor: 'black',
  },
});

export default class LoadingIndicator extends React.Component {
  props: {
    active: boolean,
    caughtUp?: boolean,
  };

  rotation: Animated;

  constructor() {
    super();
    this.rotation = new Animated.Value(0);
  }

  componentDidMount() {
    this.rotate();
  }

  rotate() {
    this.rotation.setValue(0);
    Animated.timing(
      this.rotation,
      {
        toValue: 1,
        duration: 2000,
        easing: Easing.linear,
        useNativeDriver: true,
      }
    ).start(() => this.rotate());
  }

  render() {
    const { active, caughtUp } = this.props;
    const rotation = this.rotation.interpolate({
      inputRange: [0, 1],
      outputRange: ['0deg', '360deg'],
    });
    const animation = { transform: [{ rotate: rotation }] };

    return (
      <View style={styles.row}>
        {caughtUp && <View style={styles.line} />}
        <View style={styles.loading}>
          {active && <Animated.View style={[styles.semiCircle, animation]} />}
          <Image
            style={[styles.logo]}
            source={require('../../static/img/message-loading.png')}
            resizeMode="contain"
          />
        </View>
        {caughtUp && <View style={styles.line} />}
      </View>
    );
  }
}


text:
class RTIMUSettings;

class RTPressureLPS25H : public RTPressure
{
public:
    RTPressureLPS25H(RTIMUSettings *settings);
    ~RTPressureLPS25H();

    virtual const char *pressureName() { return "LPS25H"; }
    virtual int pressureType() { return RTPRESSURE_TYPE_LPS25H; }
    virtual bool pressureInit();
    virtual bool pressureRead(RTIMU_DATA& data);

private:
    unsigned char m_pressureAddr;                           // I2C address

    RTFLOAT m_pressure;                                     // the current pressure
    RTFLOAT m_temperature;                                  // the current temperature
    bool m_pressureValid;
    bool m_temperatureValid;

};

#endif // _RTPRESSURELPS25H_H_


text:
CREATE TABLE IF NOT EXISTS `users` (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `email` varchar(254) NOT NULL,
  `username` varchar(32) NOT NULL DEFAULT '',
  `password` varchar(64) NOT NULL,
  `logins` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `last_login` int(10) UNSIGNED,
  `facebook_uid` varchar(100),
  `twitter_uid` varchar(100),
  `last_login_ip` VARCHAR(40),
  PRIMARY KEY  (`id`),
  UNIQUE KEY `uniq_username` (`username`),
  UNIQUE KEY `uniq_email` (`email`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

INSERT INTO `users` (`id`, `email`, `username`)
VALUES
  (1,'test@example.com', 'username-example'),
  (2,'test-2@example.com', 'username2-example');


text:
#ifndef itkFrequencyImageRegionConstIteratorWithIndex_h
#define itkFrequencyImageRegionConstIteratorWithIndex_h

#include "itkImageRegionConstIteratorWithIndex.h"

namespace itk
{
/**
 *\class FrequencyImageRegionConstIteratorWithIndex
 * \brief A multi-dimensional iterator templated over image type that walks
 * pixels within a region and is specialized to keep track of its image index
 * location.
 *
 * This class is a specialization of ImageRegionConstIteratorWithIndex,
 * adding method GetFrequencyBins to give the frequency bins corresponding to image indices, and GetFrequency to get the
 * frequency of the bin.
 *
 * This iterator assumes that the image is already in the frequency domain, so GetFrequencyBin is a wrap around
 * GetIndex(), and GetFrequency is a wrap around Get().
 *
 * For a different layout, use other frequency iterator.
 *
 * Please see ImageRegionConstIteratorWithIndex for more information.
 * \sa ForwardFFTImageFilter
 *
 * \par MORE INFORMATION
 * For a complete description of the ITK Image Iterators and their API, please
 * see the Iterators chapter in the ITK Software Guide.  The ITK Software Guide
 * is available in print and as a free .pdf download from https://www.itk.org.
 *
 * \ingroup ImageIterators
 *
 * \sa ImageRegionIteratorWithIndex
 * \sa ImageConstIterator \sa ConditionalConstIterator
 * \sa ConstNeighborhoodIterator \sa ConstShapedNeighborhoodIterator
 * \sa ConstSliceIterator  \sa CorrespondenceDataStructureIterator
 * \sa FloodFilledFunctionConditionalConstIterator
 * \sa FloodFilledImageFunctionConditionalConstIterator
 * \sa FloodFilledImageFunctionConditionalIterator
 * \sa FloodFilledSpatialFunctionConditionalConstIterator
 * \sa FloodFilledSpatialFunctionConditionalIterator
 * \sa ImageConstIterator \sa ImageConstIteratorWithIndex
 * \sa ImageIterator \sa ImageIteratorWithIndex
 * \sa ImageLinearConstIteratorWithIndex  \sa ImageLinearIteratorWithIndex
 * \sa ImageRandomConstIteratorWithIndex  \sa ImageRandomIteratorWithIndex
 * \sa ImageRegionConstIterator \sa ImageRegionConstIteratorWithIndex
 * \sa ImageRegionExclusionConstIteratorWithIndex
 * \sa ImageRegionExclusionIteratorWithIndex
 * \sa ImageRegionIterator  \sa ImageRegionIteratorWithIndex
 * \sa ImageRegionReverseConstIterator  \sa ImageRegionReverseIterator
 * \sa ImageReverseConstIterator  \sa ImageReverseIterator
 * \sa ImageSliceConstIteratorWithIndex  \sa ImageSliceIteratorWithIndex
 * \sa NeighborhoodIterator \sa PathConstIterator  \sa PathIterator
 * \sa ShapedNeighborhoodIterator  \sa SliceIterator
 * \sa ImageConstIteratorWithIndex
 *
 * \ingroup ITKImageFrequency
 *
 */
template <typename TImage>
class FrequencyImageRegionConstIteratorWithIndex : public ImageRegionConstIteratorWithIndex<TImage>
{
public:
  /** Standard class type alias. */
  using Self = FrequencyImageRegionConstIteratorWithIndex;
  using Superclass = ImageRegionConstIteratorWithIndex<TImage>;

  /** Types inherited from the Superclass */
  using IndexType = typename Superclass::IndexType;
  using SizeType = typename Superclass::SizeType;
  using OffsetType = typename Superclass::OffsetType;
  using RegionType = typename Superclass::RegionType;
  using ImageType = typename Superclass::ImageType;
  using PixelContainer = typename Superclass::PixelContainer;
  using PixelContainerPointer = typename Superclass::PixelContainerPointer;
  using InternalPixelType = typename Superclass::InternalPixelType;
  using PixelType = typename Superclass::PixelType;
  using AccessorType = typename Superclass::AccessorType;

  using FrequencyType = typename ImageType::SpacingType;
  using FrequencyValueType = typename ImageType::SpacingValueType;
  /** Default constructor. Needed since we provide a cast constructor. */
  FrequencyImageRegionConstIteratorWithIndex()
    : ImageRegionConstIteratorWithIndex<TImage>()
  {
    this->Init();
  }

  /** Constructor establishes an iterator to walk a particular image and a
   * particular region of that image. */
  FrequencyImageRegionConstIteratorWithIndex(const TImage * ptr, const RegionType & region)
    : ImageRegionConstIteratorWithIndex<TImage>(ptr, region)
  {
    this->Init();
  }

  /** Constructor that can be used to cast from an ImageIterator to an
   * ImageRegionIteratorWithIndex. Many routines return an ImageIterator, but for a
   * particular task, you may want an ImageRegionIteratorWithIndex.  Rather than
   * provide overloaded APIs that return different types of Iterators, itk
   * returns ImageIterators and uses constructors to cast from an
   * ImageIterator to a ImageRegionIteratorWithIndex. */
  explicit FrequencyImageRegionConstIteratorWithIndex(const Superclass & it)
    : ImageRegionConstIteratorWithIndex<TImage>(it)
  {
    this->Init();
  }

  /*
   * The image is in the frequency domain already, return the index.
   */
  IndexType
  GetFrequencyBin() const
  {
    return this->GetIndex();
  }

  /* Similar to TransformIndexToPhysicalPoint on GetIndex(),
   * but the result is cast to FrequencyType. And direction is not taken into account.
   */
  FrequencyType
  GetFrequency() const
  {
    FrequencyType freq;
    IndexType     freqInd = this->GetFrequencyBin();
    // FrequencyType freq;
    for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++)
    {
      freq[dim] = this->m_FrequencyOrigin[dim] + this->m_FrequencySpacing[dim] * freqInd[dim];
    }
    return freq;
  }

  FrequencyValueType
  GetFrequencyModuloSquare() const
  {
    FrequencyValueType w2(0);
    FrequencyType      w(this->GetFrequency());

    for (unsigned int dim = 0; dim < TImage::ImageDimension; dim++)
    {
      w2 += w[dim] * w[dim];
    }
    return w2;
  }

  /** Origin of frequencies is set to be equal to m_Image->GetOrigin(). */
  itkGetConstReferenceMacro(FrequencyOrigin, FrequencyType);

  /** This is the pixel width, or the bin size of the frequency in physical or world coordinates.
   * In this case, frequency spacing is the same than the image spacing. */
  itkGetConstReferenceMacro(FrequencySpacing, FrequencyType);

private:
  /** Set the frequency metadata.
   * Called by constructors.  */
  void
  Init()
  {
    this->m_FrequencyOrigin = this->m_Image->GetOrigin();
    this->m_FrequencySpacing = this->m_Image->GetSpacing();
  }

  FrequencyType m_FrequencyOrigin;
  FrequencyType m_FrequencySpacing;
};
} // end namespace itk
#endif


text:
'use strict';

// fraction of some size to get to a named position
module.exports = {
    // from bottom left: this is the origin of our paper-reference
    // positioning system
    FROM_BL: {
        left: 0,
        center: 0.5,
        right: 1,
        bottom: 0,
        middle: 0.5,
        top: 1
    },
    // from top left: this is the screen pixel positioning origin
    FROM_TL: {
        left: 0,
        center: 0.5,
        right: 1,
        bottom: 1,
        middle: 0.5,
        top: 0
    },
    // multiple of fontSize to get the vertical offset between lines
    LINE_SPACING: 1.2,

    // multiple of fontSize to shift from the baseline to the midline
    // (to use when we don't calculate this shift from Drawing.bBox)
    // To be precise this should be half the cap height (capital letter)
    // of the font, and according to wikipedia:
    //   an "average" font might have a cap height of 70% of the em
    // https://en.wikipedia.org/wiki/Em_(typography)#History
    MID_SHIFT: 0.35,

    OPPOSITE_SIDE: {
        left: 'right',
        right: 'left',
        top: 'bottom',
        bottom: 'top'
    }
};


text:
package com.google.api.generator.gapic.composer.grpc;

import com.google.api.gax.grpc.GrpcCallSettings;
import com.google.api.gax.grpc.GrpcCallableFactory;
import com.google.api.gax.grpc.GrpcStubCallableFactory;
import com.google.api.gax.grpc.GrpcTransportChannel;
import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider;
import com.google.api.gax.grpc.ProtoOperationTransformers;
import com.google.api.generator.gapic.composer.common.TransportContext;
import com.google.api.generator.gapic.composer.utils.ClassNames;
import com.google.api.generator.gapic.model.Transport;
import com.google.common.collect.ImmutableList;
import com.google.longrunning.OperationsClient;
import com.google.longrunning.stub.GrpcOperationsStub;
import com.google.longrunning.stub.OperationsStub;
import io.grpc.MethodDescriptor;

public abstract class GrpcContext extends TransportContext {
  private static final TransportContext INSTANCE =
      GrpcContext.builder()
          .setClassNames(new ClassNames("Grpc"))
          .setTransport(Transport.GRPC)
          .setTransportNames(ImmutableList.of("gRPC"))
          // For grpc.GrpcServiceStubClassComposer
          .setCallSettingsClass(GrpcCallSettings.class)
          .setStubCallableFactoryType(classToType(GrpcStubCallableFactory.class))
          .setMethodDescriptorClass(MethodDescriptor.class)
          .setTransportOperationsStubTypes(ImmutableList.of(classToType(GrpcOperationsStub.class)))
          .setTransportOperationsStubNames(ImmutableList.of("operationsStub"))
          // For grpc.ServiceSettingsClassComposer
          .setInstantiatingChannelProviderClasses(
              ImmutableList.of(InstantiatingGrpcChannelProvider.class))
          .setInstantiatingChannelProviderBuilderClasses(
              ImmutableList.of(InstantiatingGrpcChannelProvider.Builder.class))
          .setDefaultTransportProviderBuilderNames(
              ImmutableList.of("defaultGrpcTransportProviderBuilder"))
          .setTransportApiClientHeaderProviderBuilderNames(
              ImmutableList.of("defaultGrpcApiClientHeaderProviderBuilder"))
          // For grpc.ServiceStubSettingsClassComposer
          .setTransportChannelTypes(ImmutableList.of(classToType(GrpcTransportChannel.class)))
          .setTransportGetterNames(ImmutableList.of("getGrpcTransportName"))
          // For grpc.GrpcServiceCallableFactoryClassComposer
          .setTransportCallSettingsType(classToType(GrpcCallSettings.class))
          .setTransportCallableFactoryType(classToType(GrpcCallableFactory.class))
          .setOperationsStubTypes(ImmutableList.of(classToType(OperationsStub.class)))
          .setTransportCallSettingsName("grpcCallSettings")
          // For RetrySettingsComposer
          .setOperationResponseTransformerType(
              classToType(ProtoOperationTransformers.ResponseTransformer.class))
          .setOperationMetadataTransformerType(
              classToType(ProtoOperationTransformers.MetadataTransformer.class))
          // For ServiceClientClassComposer
          .setOperationsClientTypes(ImmutableList.of(classToType(OperationsClient.class)))
          .setOperationsClientNames(ImmutableList.of("operationsClient"))
          .setUseValuePatterns(false)
          .build();

  public static TransportContext instance() {
    return INSTANCE;
  }
}


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUploadsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('uploads', function(Blueprint $table) {
			$table->increments('id')->unsigned();
			$table->integer('user_id')->unsigned();
			$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
			$table->integer('annonce_id')->unsigned();
			$table->foreign('annonce_id')->references('id')->on('annonces')->onDelete('cascade')->onUpdate('cascade');
			$table->string('nom', 255);
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('uploads');
	}

}


text:
@interface SQAESDE : NSObject

+ (NSString *)enCrypt:(NSString *)strContent key:(NSString *)strKey;
+ (NSString *)deCrypt:(NSString *)strContent key:(NSString *)strKey;

+ (NSString *)enCryptBase64:(NSString *)strContent key:(NSString *)strKey;
+ (NSString *)deCryptBase64:(NSString *)strContent key:(NSString *)strKey;

@end


text:
namespace gaps {

////////////////////////////////////////////////////////////////////////
// CLASS DEFINITION
////////////////////////////////////////////////////////////////////////

class GSVTapestry {
public:
  //////////////////////////////////////////
  //// CONSTRUCTOR/DESTRUCTOR FUNCTIONS ////
  //////////////////////////////////////////

  // Constructor/destructor functions
  GSVTapestry(void);
  virtual ~GSVTapestry(void);

  //////////////////////////
  //// ACCESS FUNCTIONS ////
  //////////////////////////

  // Scene access functions
  GSVScene *Scene(void) const;
  int SceneIndex(void) const;

  // Run access functions
  GSVRun *Run(void) const;
  int RunIndex(void) const;

  // Segment access functions
  GSVSegment *Segment(void) const;
  int SegmentIndex(void) const;

  // Camera access functions
  GSVCamera *Camera(void) const;
  int CameraIndex(void) const;

  // Image access functions
  int NImages(void) const;
  GSVImage *Image(int image_index) const;
  GSVImage *FindImageBeforeTimestamp(RNScalar timestamp) const;

  ///////////////////////////
  //// PROPERTY FUNCTIONS ////
  ///////////////////////////

  // Spatial property functions
  const R3Box& BBox(void) const;

  // Pose property functions
  GSVPose Pose(RNScalar timestamp) const;

  // Get user data
  void *Data(void) const;

  ////////////////////////////////
  //// MANIPULATION FUNCTIONS ////
  ////////////////////////////////

  // Image manipulation
  void InsertImage(GSVImage *image);
  void RemoveImage(GSVImage *image);

  // Spatial property manipulation
  void SetBBox(const R3Box& box);

  // Set user data
  void SetData(void *data);

  ///////////////////////////
  //// DISPLAY FUNCTIONS ////
  ///////////////////////////

  // Draw function
  virtual void Draw(RNFlags flags = GSV_DEFAULT_DRAW_FLAGS) const;

  // Print function
  virtual void Print(FILE *fp = NULL, const char *prefix = NULL, const char *suffix = NULL) const;

////////////////////////////////////////////////////////////////////////
// INTERNAL STUFF BELOW HERE
////////////////////////////////////////////////////////////////////////

public:
  // Update functions
  void UpdateBBox(void);
  void InvalidateBBox(void);

protected:
  // Internal support functions
  GSVImage *FindImageBeforeTimestamp(RNScalar timestamp, int imin, int imax) const;

protected:
  friend class GSVSegment;
  friend class GSVCamera;
  GSVSegment *segment;
  int segment_index;
  GSVCamera *camera;
  int camera_index;
  RNArray<GSVImage *> images;
  R3Box bbox;
  void *data;
};

////////////////////////////////////////////////////////////////////////
// INLINE FUNCTION DEFINITIONS
////////////////////////////////////////////////////////////////////////

inline GSVSegment *GSVTapestry::
Segment(void) const
{
  // Return segment
  return segment;
}

inline int GSVTapestry::
SegmentIndex(void) const
{
  // Return index of this tapestry in segment
  return segment_index;
}

inline GSVCamera *GSVTapestry::
Camera(void) const
{
  // Return camera
  return camera;
}

inline int GSVTapestry::
CameraIndex(void) const
{
  // Return index of this tapestry in camera
  return camera_index;
}

inline int GSVTapestry::
NImages(void) const
{
  // Return number of images
  return images.NEntries();
}

inline GSVImage *GSVTapestry::
Image(int image_index) const
{
  // Return kth image
  return images.Kth(image_index);
}

inline const R3Box& GSVTapestry::
BBox(void) const
{
  // Return bounding box
  if (bbox.XMin() == FLT_MAX)
    ((GSVTapestry *) this)->UpdateBBox();
  return bbox;
}

inline void *GSVTapestry::
Data(void) const
{
  // Return user data
  return data;
}

inline void GSVTapestry::
SetBBox(const R3Box& box)
{
  // Set bbox
  this->bbox = box;
}

inline void GSVTapestry::
SetData(void *data)
{
  // Set user data
  this->data = data;
}

// End namespace
}

// End include guard
#endif


text:
<?php

namespace OCP;

use OCP\AppFramework\Http;
use Sabre\DAV\Server;
use Symfony\Component\EventDispatcher\Event;

/**
 * @since 8.2.0
 */
class SabrePluginEvent extends Event {

	/** @var int */
	protected $statusCode;

	/** @var string */
	protected $message;

	/** @var Server */
	protected $server;

	/**
	 * @since 8.2.0
	 */
	public function __construct($server = null) {
		$this->message = '';
		$this->statusCode = Http::STATUS_OK;
		$this->server = $server;
	}

	/**
	 * @param int $statusCode
	 * @return self
	 * @since 8.2.0
	 */
	public function setStatusCode($statusCode) {
		$this->statusCode = (int) $statusCode;
		return $this;
	}

	/**
	 * @param string $message
	 * @return self
	 * @since 8.2.0
	 */
	public function setMessage($message) {
		$this->message = (string) $message;
		return $this;
	}

	/**
	 * @return int
	 * @since 8.2.0
	 */
	public function getStatusCode() {
		return $this->statusCode;
	}

	/**
	 * @return string
	 * @since 8.2.0
	 */
	public function getMessage() {
		return $this->message;
	}

	/**
	 * @return null|Server
	 * @since 9.0.0
	 */
	public function getServer() {
		return $this->server;
	}
}


text:
#include <kognac/hashtable.h>

#include <cstring>

Hashtable::Hashtable(const size_t size, int64_t (*hash)(const char*, const int size)) :
    size(size), hash(hash) {
    table = new int64_t[size];
    memset(table, 0, sizeof(int64_t) * size);
}


text:
<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.dtd">
<validators>
    <field name="baz">
        <field-validator type="required">
            <message>You must enter a value for baz.</message>
        </field-validator>
        <field-validator type="int">
            <param name="min">2</param>
            <param name="max">4</param>
            <message>baz out of range.</message>
        </field-validator>
    </field>
</validators>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MusicPickerApp.ViewModels;
using Xamarin.Forms;

namespace MusicPickerApp.Views.TabbedViews {
    public partial class TracksPage : ContentPage {
        public TracksPage() {
            InitializeComponent();
        }
        public AllTracksViewModel getViewModel() {
            return viewModel;
        }
    }
}


text:
<?php
App::uses('AppController', 'Controller');
/**
 * Users Controller
 *
 * @property User $User
 * @property PaginatorComponent $Paginator
 */
class UsersController extends AppController {

/**
 * Components
 *
 * @var array
 */
	public $components = array('Paginator');

	public function beforeFilter() {
		parent::beforeFilter();
		$this->Auth->allow('login', 'logout');
	}

	public function login() {
		if ($this->request->is('post')) {
			if ($this->Auth->login()) {
				return $this->redirect($this->Auth->redirect());
			}
			$this->Session->setFlash(__('Invalid username or password, try again'));
		}
	}

	public function admin_login() {
		if ($this->request->is('post')) {
			if ($this->Auth->login()) {
				return $this->redirect($this->Auth->redirect());
			}
			$this->Session->setFlash(__('Invalid username or password, try again'));
		}
		$this->render('login');
	}

	public function logout() {
		return $this->redirect($this->Auth->logout());
	}

/**
 * index method
 *
 * @return void
 */
	public function index() {
		$this->User->recursive = 0;
		$this->set('users', $this->Paginator->paginate());
	}

/**
 * view method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function view($id = null) {
		if (!$this->User->exists($id)) {
			throw new NotFoundException(__('Invalid user'));
		}
		$options = array('conditions' => array('User.' . $this->User->primaryKey => $id));
		$this->set('user', $this->User->find('first', $options));
	}

/**
 * add method
 *
 * @return void
 */
	public function add() {
		if ($this->request->is('post')) {
			$this->User->create();
			if ($this->User->save($this->request->data)) {
				$this->Session->setFlash(__('The user has been saved.'));
				return $this->redirect(array('action' => 'index'));
			} else {
				$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
			}
		}
	}

/**
 * edit method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function edit($id = null) {
		if (!$this->User->exists($id)) {
			throw new NotFoundException(__('Invalid user'));
		}
		if ($this->request->is(array('post', 'put'))) {
			if ($this->User->save($this->request->data)) {
				$this->Session->setFlash(__('The user has been saved.'));
				return $this->redirect(array('action' => 'index'));
			} else {
				$this->Session->setFlash(__('The user could not be saved. Please, try again.'));
			}
		} else {
			$options = array('conditions' => array('User.' . $this->User->primaryKey => $id));
			$this->request->data = $this->User->find('first', $options);
		}
	}

/**
 * delete method
 *
 * @throws NotFoundException
 * @param string $id
 * @return void
 */
	public function delete($id = null) {
		$this->User->id = $id;
		if (!$this->User->exists()) {
			throw new NotFoundException(__('Invalid user'));
		}
		$this->request->onlyAllow('post', 'delete');
		if ($this->User->delete()) {
			$this->Session->setFlash(__('The user has been deleted.'));
		} else {
			$this->Session->setFlash(__('The user could not be deleted. Please, try again.'));
		}
		return $this->redirect(array('action' => 'index'));
	}}


text:
layout: sidebar-right
title: "Listen to some classic books with Freegal"
date: 2019-05-02
author: lisa-brennan
category: articles
tag: elibrary
excerpt: "Have you been meaning to read an old classic for a while? Listen to it instead with our Freegal service."
featured-image: /images/featured/featured-freegal-classic-eaudio.jpg
featured-alt: "The Memoirs of Sherlock Holmes, Alice's Adventures in Wonderland"
breadcrumb: articles
---

Have you been meaning to read an old classic for a while? Listen to it instead with our Freegal service.

[Set up Freegal →](/elibrary/freegal/)

Dracula, by Bram Stoker, read by Christopher Lee

The Memoirs of Sherlock Holmes, by Arthur Conan Doyle, read by Bart Wolffe

Alice's Adventures in Wonderland, by Lewis Carroll, read by Roger Blake

Pride and Prejudice, by Jane Austen, read by Joanna Lumley

The Poetry of Emily Brontë, read by Eve Karpf, Ghizela Rowe, Sandi Toksvig & Richard Mitchley

A Room with a View, by E. M. Forster, produced by Wordscape

The Poetry of Lewis Carroll, read by Beatrice Lillie


text:
@interface YMLoggerConsoleOutput: NSObject<YMLoggerOutput>

- (NSArray<NSString *> *__nonnull)allLogEntries;

@end


text:
package com.twitter.finagle.tracing

import com.twitter.conversions.time._
import com.twitter.finagle.builder.{ClientBuilder, ServerBuilder}
import com.twitter.finagle.client._
import com.twitter.finagle.server._
import com.twitter.finagle.{param => fparam, _}
import com.twitter.util._
import java.net.{InetAddress, InetSocketAddress}
import org.junit.runner.RunWith
import org.scalatest.FunSuite
import org.scalatest.junit.JUnitRunner

private object StringServerCodec extends com.twitter.finagle.Codec[String, String] {
  val pipelineFactory = StringServerPipeline
}

private object StringClientCodec extends com.twitter.finagle.Codec[String, String] {
  val pipelineFactory = StringClientPipeline
}

@RunWith(classOf[JUnitRunner])
class DefaultTracingTest extends FunSuite with StringClient with StringServer {
  object Svc extends Service[String, String] {
    def apply(str: String): Future[String] = Future.value(str)
  }

  def assertAnnotationsInOrder(tracer: Seq[Record], annos: Seq[Annotation]) {
    assert(tracer.collect { case Record(_, _, ann, _) if annos.contains(ann) => ann } == annos)
  }

  /**
   * Ensure all annotations have the same TraceId (unique to server and client though)
   * Ensure core annotations are present and properly ordered
   *
   * @param f returns a [[Service]] and a [[Closable]] finalizer.
   *          The finalizer properly closes the services built by f,
   *          otherwise the tests here will prevent [[com.twitter.finagle.util.ExitGuard]] from exiting,
   *          and interfere with [[com.twitter.finagle.util.ExitGuardTest]]
   */
  def testCoreTraces(f: (Tracer, Tracer) => (Service[String, String], Closable)) {
    val combinedTracer = new BufferingTracer
    class MultiTracer extends BufferingTracer {
      override def record(rec: Record) {
        super.record(rec)
        combinedTracer.record(rec)
      }
    }
    val serverTracer = new MultiTracer
    val clientTracer = new MultiTracer

    val (svc, finalizer) = f(serverTracer, clientTracer)
    Await.result(svc("foo"), 1.second)

    assert(serverTracer.map(_.traceId).toSet.size == 1)
    assert(clientTracer.map(_.traceId).toSet.size == 1)

    assertAnnotationsInOrder(combinedTracer.toSeq, Seq(
      Annotation.ServiceName("theClient"),
      Annotation.ClientSend(),
      Annotation.ServiceName("theServer"),
      Annotation.ServerRecv(),
      Annotation.ServerSend(),
      Annotation.ClientRecv()))

    // need to call finalizer to properly close the client and the server
    Await.ready(finalizer.close(), 1.second)
  }

  test("core events are traced in the stack client/server") {
    testCoreTraces { (serverTracer, clientTracer) =>
      val svc = stringServer
        .configured(fparam.Tracer(serverTracer))
        .configured(fparam.Label("theServer"))
        .serve("localhost:*", Svc)

      val client = stringClient
        .configured(fparam.Tracer(clientTracer))
        .newService(
          Name.bound(Address(svc.boundAddress.asInstanceOf[InetSocketAddress])), "theClient")

      val finalizer = new Closable {
        override def close(deadline: Time): Future[Unit] =
          client.close(deadline) before svc.close(deadline)
      }

      (client, finalizer)
    }
  }

  test("core events are traced in the ClientBuilder/ServerBuilder") {
    testCoreTraces { (serverTracer, clientTracer) =>
      val svc = ServerBuilder()
        .name("theServer")
        .bindTo(new InetSocketAddress(InetAddress.getLoopbackAddress, 0))
        .stack(stringServer)
        .tracer(serverTracer)
        .build(Svc)

      val client = ClientBuilder()
        .name("theClient")
        .hosts(svc.boundAddress.asInstanceOf[InetSocketAddress])
        .stack(stringClient)
        .hostConnectionLimit(1)
        .tracer(clientTracer)
        .build()

      val finalizer = new Closable {
        override def close(deadline: Time): Future[Unit] =
          client.close(deadline) before svc.close(deadline)
      }

      (client, finalizer)
    }
  }
}


text:
  <!-- build:js(.tmp) index.js -->
  <script src="jspm_packages/system.js"></script>
  <script src="jspm.browser.js"></script>
  <script src="jspm.config.js"></script>

  <script>
    System.import('src/index.<%- extensions.js %>');
  </script>
  <!-- endbuild -->
</html>


text:
class CollectionFactory
  PREFIX = "fog-test".freeze

  def initialize(subject, example)
    @subject = subject
    @example = example
    @resource_counter = 0
  end

  # Cleans up all objects created by the factory in the current test suite.
  #
  # @param async [FalseClass or TrueClass] perform resource destruction asynchronously
  def cleanup(async = false)
    suit_name = @example.gsub(/\W/, "").tr("_", "-").downcase.split('-')[0]
    resources = @subject.all.select { |resource| resource.name.match(/#{PREFIX}-[0-9]*-#{suit_name}/) }
    if DEBUG
      p "Cleanup invoked in #{self} for example: #{@example}"
      p "Resources to be deleted: #{resources.map { |r| r.name }}"
      p "All subject resources: #{@subject.all.map { |s| s.name }}"
    end
    resources.each { |r| r.destroy(async) }
    resources.each { |r| Fog.wait_for { !@subject.all.map(&:identity).include? r.identity } }
  end

  # Creates a collection object instance e.g. Fog::Compute::Google::Server
  #
  # @param custom_params [Hash] override factory creation parameters or provide
  #   additional ones. Useful in tests where you need to create a slightly different
  #   resource than the default one but still want to take advantage of the factory's
  #   cleanup methods, etc.
  #
  # @example Create a custom factory
  #   @factory = ServersFactory.new(namespaced_name)
  #   server = @factory.create(:machine_type => "f1-micro")
  #
  # @return [Object] collection object instance
  def create(custom_params = {})
    @subject.create(params.merge(custom_params))
  end

  def get(identity)
    @subject.get(identity)
  end

  def resource_name(base = @example, prefix = PREFIX)
    index = @resource_counter += 1
    # In prefix, convert - to _ to make sure that it doesn't get stripped by the \W strip below.
    # Then, concatenate prefix, index, and base; strip all non-alphanumerics except _;
    # convert _ to -; downcase; truncate to 62 characters; delete trailing -
    [prefix.tr("-", "_"), index, base].join("_").gsub(/\W/, "").tr("_", "-").downcase[0..61].chomp("-")
  end
end


text:
'use strict';

/**
 * Module dependencies.
 */

var integration = require('@segment/analytics.js-integration');
var push = require('global-queue')('_tsq');
var slug = require('slug-component');

/**
 * Expose `Tapstream` integration.
 */

var Tapstream = module.exports = integration('Tapstream')
  .assumesPageview()
  .global('_tsq')
  .option('accountName', '')
  .option('trackAllPages', true)
  .option('trackNamedPages', true)
  .option('trackCategorizedPages', true)
  .tag('<script src="//cdn.tapstream.com/static/js/tapstream.js">');

/**
 * Initialize.
 *
 * @api public
 */

Tapstream.prototype.initialize = function() {
  window._tsq = window._tsq || [];
  push('setAccountName', this.options.accountName);
  this.load(this.ready);
};

/**
 * Loaded?
 *
 * @api private
 * @return {boolean}
 */

Tapstream.prototype.loaded = function() {
  return !!(window._tsq && window._tsq.push !== Array.prototype.push);
};

/**
 * Page.
 *
 * @api public
 * @param {Page} page
 */

Tapstream.prototype.page = function(page) {
  var category = page.category();
  var opts = this.options;
  var name = page.fullName();

  // all pages
  if (opts.trackAllPages) {
    this.track(page.track());
  }

  // named pages
  if (name && opts.trackNamedPages) {
    this.track(page.track(name));
  }

  // categorized pages
  if (category && opts.trackCategorizedPages) {
    this.track(page.track(category));
  }
};

/**
 * Track.
 *
 * @api public
 * @param {Track} track
 */

Tapstream.prototype.track = function(track) {
  var props = track.properties();
  // needs events as slugs
  push('fireHit', slug(track.event()), [props.url]);
};


text:
echo "========= Certificate Authority ========="
echo "Country Name: US"
echo "State or Province Name: Massachusetts"
echo "Locality Name: Boston"
echo "Organization Name: Example Authority Inc."
echo "Organizational Unit Name: "
echo "Common Name: Bruce Wayne"
echo "Email Address: bruce.wayne@example.com"
echo "========================================="
openssl genrsa -des3 -out certificate-authority.key 4096 > /dev/null
openssl req -new -x509 -days 365 -key certificate-authority.key -out certificate-authority.crt

# Generate an S/MIME certificate for testing
echo "======== S/MIME Test Certificate ========"
echo "Country Name: US"
echo "State or Province Name: Massachusetts"
echo "Locality Name: Boston"
echo "Organization Name: "
echo "Common Name: MimeKit UnitTests"
echo "Email Address: mimekit@example.com"
echo "========================================="
openssl genrsa -des3 -out smime.key 4096 > /dev/null
openssl req -new -key smime.key -out smime.csr
openssl x509 -req -days 365 -in smime.csr -CA certificate-authority.crt -CAkey certificate-authority.key -set_serial 1 -out smime.crt -setalias "mimekit@example.com" -addtrust emailProtection -addreject clientAuth -addreject serverAuth -trustout
openssl pkcs12 -export -in smime.crt -inkey smime.key -out smime.p12


text:
import "../../Reflect";
import * as assert from "assert";

export function ReflectDeleteMetadataInvalidTarget() {
    assert.throws(() => Reflect.deleteMetadata("key", undefined, undefined), TypeError);
}

export function ReflectDeleteMetadataWhenNotDefinedWithoutTargetKey() {
    let obj = {};
    let result = Reflect.deleteMetadata("key", obj, undefined);
    assert.equal(result, false);
}

export function ReflectDeleteMetadataWhenDefinedWithoutTargetKey() {
    let obj = {};
    Reflect.defineMetadata("key", "value", obj, undefined);
    let result = Reflect.deleteMetadata("key", obj, undefined);
    assert.equal(result, true);
}

export function ReflectDeleteMetadataWhenDefinedOnPrototypeWithoutTargetKey() {
    let prototype = {};
    Reflect.defineMetadata("key", "value", prototype, undefined);
    let obj = Object.create(prototype);
    let result = Reflect.deleteMetadata("key", obj, undefined);
    assert.equal(result, false);
}

export function ReflectHasOwnMetadataAfterDeleteMetadata() {
    let obj = {};
    Reflect.defineMetadata("key", "value", obj, undefined);
    Reflect.deleteMetadata("key", obj, undefined);
    let result = Reflect.hasOwnMetadata("key", obj, undefined);
    assert.equal(result, false);
}


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

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>OER Commons Knowledge Bank</title>
  <link rel="stylesheet" href="css/common.css" type="text/css" />
  <link type="text/css" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/ui.all.css" />
  <link type="text/css" href="css/ui.multiselect.css" rel="stylesheet" />

OER Commons Knowledge Bank

Filling the commons with awesome knowledge, yo!

<?php

// URL PROCESSING BLOCK.
// This block of PHP is called if there's a URL -- which means we presume
// that it's an attempted submission to OER-C.

if ($_GET['link'])
{
  // Fetch the link and parse it to prepopulate the PHP page.
  // Helpful notes at http://blog.unitedheroes.net/curl/

  $curl_handle=curl_init();
  curl_setopt($curl_handle,CURLOPT_URL,$_GET['link']);
  curl_setopt ($curl_handle, CURLOPT_RETURNTRANSFER, 1);
  $page_content = curl_exec($curl_handle);
  curl_close($curl_handle);

  // Match for TITLE.
  $regex='/<title>(.*?)<\/title>/';
  if (preg_match($regex,$page_content,$matches)) {
    $page_title = $matches[1];
  }

  // Match for CC LICENSE URL.
  // This doesn't work, but it's a start.
  $regex='//';
  if (preg_match($regex,$page_content,$matches)) {
    $page_license= $matches[1];
  }

?>

    <form action="index.php">

Link: <?php echo $_GET['link']; ?>

Title: <?php echo $page_title; ?>

License: <?php echo $page_license; ?>

Standards Alignment

      <select id="standards" class="multiselect" multiple="multiple" name="standards[]">
<?php include 'standards/CC-MATH.php'?>
      </select>

License

      <select id="license" name="license">
        <option>CC-BY</option>
        <option>CC-BY-SA</option>
        <option>CC-BY-SA-NC</option>
        <option>Strings Attached / Fair Use</option>
        <option selected> I don't know!</option>
      </select>

Your Rating

      Your rating is: <input readonly id="grade" class="text" name="grade" style="border:0" size="2" type="text">

      <input type="submit" value="Submit Form"/>
    </form>

<?php
}
else
{
?>

AWESOME!!!

Thanks for submitting that excellent resource.

You are an OER NINJA!

<?php
}
?>

An ISKME Joint...

...and an OER Commons production, ya dig?

Building the Educational Commons...

...By Any Means Necessary


text:
package org.nd4j.linalg.env.impl;

import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.nd4j.linalg.env.EnvironmentalAction;
import org.nd4j.linalg.factory.Nd4j;

@Slf4j
public class DebugAction implements EnvironmentalAction {
    @Override
    public String targetVariable() {
        return "ND4J_DEBUG";
    }

    @Override
    public void process(String value) {
        val v = Boolean.valueOf(value);

        Nd4j.getExecutioner().enableDebugMode(v);
    }
}


text:
require 'finacle_api/common/serializable_object'
module FinacleApi
  module TDAcctInq
    module ResponseEntity
      class PersonName < SerializableObject
        attr_accessor :last_name, :first_name, :middle_name, :name, :title_prefix

      end
    end
  end
end


text:
package org.apache.geode.internal.cache.partitioned;

import org.apache.geode.cache.partition.PartitionMemberInfo;

/**
 * Provides load and bucket level details for internal use. Extends
 * {@link org.apache.geode.cache.partition.PartitionMemberInfo}.
 *
 */
public interface InternalPartitionDetails
    extends PartitionMemberInfo, Comparable<InternalPartitionDetails> {

  /**
   * Returns the load for the partitioned region.
   *
   * @return the load for the partitioned region
   */
  public PRLoad getPRLoad();

  /**
   * Returns the size of the bucket in bytes.
   *
   * @param bucketId the identity of the bucket from 0 to number of buckets -1
   * @return the size of the bucket in bytes
   */
  public long getBucketSize(int bucketId);

}


text:
from hubcheck.pageobjects.basepagewidget import BasePageWidget
from hubcheck.pageobjects.basepageelement import Link
from hubcheck.pageobjects.basepageelement import TextReadOnly
from hubcheck.pageobjects.widgets.item_list_item import ItemListItem

class ToolsPipelineSearchResultRow(ItemListItem):
    def __init__(self, owner, locatordict={},row_number=0):

        super(ToolsPipelineSearchResultRow,self)\
            .__init__(owner,locatordict,row_number)

        # load hub's classes
        ToolsPipelineSearchResultRow_Locators = \
            self.load_class('ToolsPipelineSearchResultRow_Locators')

        # update this object's locator
        self.locators.update(ToolsPipelineSearchResultRow_Locators.locators)

        # update the locators with those from the owner
        self.update_locators_from_owner()

        # setup page object's components
        self.title        = Link(self,{'base':'title'})
        self.details      = TextReadOnly(self,{'base':'details'})
        self.alias        = Link(self,{'base':'alias'})
        self.status       = Link(self,{'base':'status'})
        self.time         = TextReadOnly(self,{'base':'time'})
        self.resource     = Link(self,{'base':'resource'})
        self.history      = Link(self,{'base':'history'})
        self.wiki         = Link(self,{'base':'wiki'})

        # update the component's locators with this objects overrides
        self._updateLocators()

    def _checkLocators(self,widgets=None,cltype=''):

        widgets = [self.title,self.details,self.alias,self.status,
                   self.time,self.resource,self.history,self.wiki]
        super(ToolsPipelineSearchResultRow,self)._checkLocators(widgets,cltype)

    def value(self):
        """return a dictionary of properties for this row"""

        properties = {
            'title'     : self.title.text(),
            'details'   : self.details.value,
            'alias'     : self.alias.text(),
            'status'    : self.status.text(),
            'time'      : self.time.value,
        }

        return properties

    def goto_title(self):

        self.title.click()

    def get_details(self):

        return self.details.value

    def goto_alias(self):

        self.alias.click()

    def goto_status(self):

        self.status.click()

    def get_time(self):

        return self.time.value

    def goto_resource(self):

        self.resource.click()

    def goto_history(self):

        self.history.click()

    def goto_wiki(self):

        self.wiki.click()

class ToolsPipelineSearchResultRow_Locators_Base(object):
    """locators for ToolsPipelineSearchResultRow object"""

    locators = {
        'base'           : "css=tr",
        'title'          : "css=.entry-title",
        'details'        : "css=.entry-details",
        'alias'          : "css=.entry-alias",
        'status'         : "css=.entry-status",
        'time'           : "css=.entry-time",
        'resource'       : "css=.entry-page",
        'history'        : "css=.entry-history",
        'wiki'           : "css=.entry-wiki",
    }


text:
Let Zoe manage your task lists.

## List structure

List files follow a very simple structure in which each line represents a task
and the tasks have a mark at the beginning on the line indicating whether the
task has been done or not. For instance:

```
[ ] Buy food
[ ] Dominate the world
[ ] Walk the dog
[X] Phone Mom
```

In this list, there are three tasks that are not checked/done (`Buy food`,
`Dominate the world` and `Walk the dog`), while one other task has been
checked/completed (`Phone Mom`).

Also note that tasks are automatically ordered alphabetically and that the
checked tasks are always below the unchecked ones.

## Where are my lists?

The agent stores lists inside directories in the path `etc/todo/USER`, where
`USER` is the user identification in the Zoe configuration file. This way,
a single user may have several lists in their directory and change between them
easily.


text:
import collections
import threading

from rally.common.i18n import _
from rally.common import log as logging

LOG = logging.getLogger(__name__)

def _consumer(consume, queue):
    """Infinity worker that consumes tasks from queue.

    :param consume: method that consumes an object removed from the queue
    :param queue: deque object to popleft() objects from
    """
    cache = {}
    while True:
        if not queue:
            break
        else:
            try:
                args = queue.popleft()
            except IndexError:
                # consumed by other thread
                continue
        try:
            consume(cache, args)
        except Exception as e:
            LOG.warning(_("Failed to consume a task from the queue: %s") % e)
            if logging.is_debug():
                LOG.exception(e)

def _publisher(publish, queue):
    """Calls a publish method that fills queue with jobs.

    :param publish: method that fills the queue
    :param queue: deque object to be filled by the publish() method
    """
    try:
        publish(queue)
    except Exception as e:
        LOG.warning(_("Failed to publish a task to the queue: %s") % e)
        if logging.is_debug():
            LOG.exception(e)

def run(publish, consume, consumers_count=1):
    """Run broker.

    publish() put to queue, consume() process one element from queue.

    When publish() is finished and elements from queue are processed process
    is finished all consumers threads are cleaned.

    :param publish: Function that puts values to the queue
    :param consume: Function that processes a single value from the queue
    :param consumers_count: Number of consumers
    """
    queue = collections.deque()
    _publisher(publish, queue)

    consumers = []
    for i in range(consumers_count):
        consumer = threading.Thread(target=_consumer, args=(consume, queue))
        consumer.start()
        consumers.append(consumer)

    for consumer in consumers:
        consumer.join()


text:
/**
 * Zavislosti modulu.
 */

var HttpResponseError = require(process.cwd() + '/lib/error').HttpResponseError;

/**
 * Middleware pro zpracovani chyb.
 *
 * @return {Function}
 */

module.exports = function() {
  return function(err, req, res, next){

    /**
     * Chyby z aplikace.
     */
    if (err instanceof HttpResponseError) {
      return res.send(err.status, {
        type: err.name,
        message: err.message
      });
    }

    /**
     * Chyby reportovane pouzivanymi moduly.
     */
    if (err instanceof Error) {
      if (err.name === 'ValidationError') {
        return res.send(400, {
          type: 'ValidationError',
          message: err.message,
          errors: err.errors
        });
      }
    }

    next(err);
  };
};


text:
<extend name="Base/common"/>

<block name="header">

			<include file="Public/bread" />

</block>

<block name="body">

	            <volist name="list" id="data">

{$data.title}

{$data.description}

			                         {$data.uid|get_username} |
			                         {$data.create_time|date='Y-m-d H:i',###} |

			                        {$data.category_id|get_category_title} |
			                         {$data.view}

			                    查看全文

	            </volist>

			<include file="Public/sidebar"/>

</block>


text:
namespace GoogleARCore.Examples.Common
{
    using System.Collections.Generic;
    using GoogleARCore;
    using UnityEngine;

    /// <summary>
    /// Manages the visualization of detected planes in the scene.
    /// </summary>
    public class DetectedPlaneGenerator : MonoBehaviour
    {
        /// <summary>
        /// A prefab for tracking and visualizing detected planes.
        /// </summary>
        public GameObject DetectedPlanePrefab;

        /// <summary>
        /// A list to hold new planes ARCore began tracking in the current frame. This object is used across
        /// the application to avoid per-frame allocations.
        /// </summary>
        private List<DetectedPlane> m_NewPlanes = new List<DetectedPlane>();

        /// <summary>
        /// The Unity Update method.
        /// </summary>
        public void Update()
        {
            // Check that motion tracking is tracking.
            if (Session.Status != SessionStatus.Tracking)
            {
                return;
            }

            // Iterate over planes found in this frame and instantiate corresponding GameObjects to visualize them.
            Session.GetTrackables<DetectedPlane>(m_NewPlanes, TrackableQueryFilter.New);
            for (int i = 0; i < m_NewPlanes.Count; i++)
            {
                // Instantiate a plane visualization prefab and set it to track the new plane. The transform is set to
                // the origin with an identity rotation since the mesh for our prefab is updated in Unity World
                // coordinates.
                GameObject planeObject = Instantiate(DetectedPlanePrefab, Vector3.zero, Quaternion.identity, transform);
                planeObject.GetComponent<DetectedPlaneVisualizer>().Initialize(m_NewPlanes[i]);
            }
        }
    }
}


text:
server() {
    require root
    OUTPUT_PATH=/etc/openvpn/server.conf
    [[ -f $OUTPUT_PATH ]] && {
	warn "$OUTPUT_PATH already exists"
	cp $OUTPUT_PATH $OUTPUT_PATH.bak
	warn "Created a backup: $OUTPUT_PATH.bak"
    }
    info "Writing $OUTPUT_PATH"
    cat > $OUTPUT_PATH <<EOF
;;; Written by Bosh on $(date -u)
port 1194
proto udp
dev tun
;;; ensure PKI files are copied and the following details are correct
ca ca.crt
cert $(hostname).crt
key $(hostname).key
dh dh1024.pem
;;; ensure the above lines are correct
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
EOF
    info "Now copy PKI files to /etc/openvpn and edit $OUTPUT_PATH"
}

client() {
    fail "Client configuraton is not implemented"
}


text:
from pandac.PandaModules import *
import SafeZoneLoader
import MMPlayground
from toontown.toonbase import ToontownGlobals

class MMSafeZoneLoader(SafeZoneLoader.SafeZoneLoader):

    def __init__(self, hood, parentFSM, doneEvent):
        SafeZoneLoader.SafeZoneLoader.__init__(self, hood, parentFSM, doneEvent)
        self.playgroundClass = MMPlayground.MMPlayground
        self.musicFile = 'phase_6/audio/bgm/MM_nbrhood.ogg'
        self.activityMusicFile = 'phase_6/audio/bgm/MM_SZ_activity.ogg'
        self.dnaFile = 'phase_6/dna/minnies_melody_land_sz.dna'
        self.safeZoneStorageDNAFile = 'phase_6/dna/storage_MM_sz.dna'

    def load(self):
        print 'loading MM safezone'
        SafeZoneLoader.SafeZoneLoader.load(self)
        self.piano = self.geom.find('**/center_icon')
        if self.piano.isEmpty():
            self.notify.error('Piano not found')
        else:
            hq = self.geom.find('**/*toon_landmark_hqMM_DNARoot')
            hq.wrtReparentTo(self.piano)

    def unload(self):
        SafeZoneLoader.SafeZoneLoader.unload(self)
        del self.piano


text:
import {html, LitElement, nothing} from "lit";
import UtilsNew from "../../core/utils-new.js";
import GridCommons from "../commons/grid-commons.js";
import VariantGridFormatter from "../variant/variant-grid-formatter.js";
import "../commons/opencb-grid-toolbar.js";

export default class DiseasePanelGeneView extends LitElement {

    constructor() {
        super();

        this.#init();
    }

    createRenderRoot() {
        return this;
    }

    static get properties() {
        return {
            genePanels: {
                type: Array
            },
            search: {
                type: Boolean,
            },
            opencgaSession: {
                type: Object
            },
        };
    }

    #init() {
        this.genePanels = {};
        this._prefix = UtilsNew.randomString(8);
        this.gridId = this._prefix + "GenePanelBrowserGrid";
        this.displayConfigDefault = {};
        this._config = this.getDefaultConfig();
        this.gridCommons = new GridCommons(this.gridId, this, this._config);
    }

    // connectedCallback() {
    //     super.connectedCallback();
    //     this._config = {...this.getDefaultConfig()};
    //     this.gridCommons = new GridCommons(this.gridId, this, this._config);
    // }

    updated(changedProperties) {
        if (changedProperties.has("opencgaSession") || changedProperties.has("config") || changedProperties.has("genePanels")) {
            this.propertyObserver();
        }
    }

    propertyObserver() {
        // With each property change we must update config and create the columns again. No extra checks are needed.
        this._config = this.getDefaultConfig();
        // Config for the grid toolbar
        this.toolbarConfig = {
            ...this.config?.toolbar,
            resource: "DISEASE_PANEL",
            buttons: ["columns", "download"],
            columns: this.getDefaultColumns()
        };
        this.renderTable();
    }

    renderTable() {
        this.table = $("#" + this.gridId);
        this.table.bootstrapTable("destroy");
        this.table.bootstrapTable({
            columns: this.getDefaultColumns(),
            data: this.genePanels,
            sidePagination: "local",
            iconsPrefix: GridCommons.GRID_ICONS_PREFIX,
            icons: GridCommons.GRID_ICONS,
            // Set table properties, these are read from config property
            uniqueId: "id",
            pagination: this._config.pagination,
            pageSize: this._config.pageSize,
            pageList: this._config.pageList,
            paginationVAlign: "both",
            formatShowingRows: this.gridCommons.formatShowingRows,
            showExport: this._config.showExport,
            detailView: this._config.detailView,
            detailFormatter: this.detailFormatter,
            formatLoadingMessage: () => "
<loading-spinner></loading-spinner>
",
            onClickRow: (row, selectedElement) => this.gridCommons.onClickRow(row.id, row, selectedElement),
            // onPageChange: (page, size) => {
            //     const result = this.gridCommons.onPageChange(page, size);
            //     this.from = result.from || this.from;
            //     this.to = result.to || this.to;
            // },
            onPostBody: data => {
                // We call onLoadSuccess to select first row
                this.gridCommons.onLoadSuccess({rows: data, total: data.length}, 1);
            }
        });
    }

    onColumnChange(e) {
        this.gridCommons.onColumnChange(e);
    }

    geneFormatter(row) {
        const geneLinks = [];

        const geneName = row.name || row.id;
        if (geneName) {
            const tooltipText = `
                ${VariantGridFormatter.getGeneTooltip(geneName, this.opencgaSession?.project?.organism?.assembly)}
            `;
            geneLinks.push(`

                    ${geneName}
                `);
        }

        // let resultHtml = "";
        // Second, the other genes
        // for (let i = 0; i < geneLinks.length; i++) {
        //     resultHtml += geneLinks[i];
        //     if (i + 1 !== geneLinks.length) {
        //         if (i === 0) {
        //             resultHtml += ",";
        //         } else if ((i + 1) % 2 !== 0) {
        //             resultHtml += ",";
        //         } else {
        //             resultHtml += "
";
        //         }
        //     }
        // }
        return geneLinks.join("");
    }

    generateList(arr, field) {
        return arr ? arr
            .map(item => `<li>${field ? item[field] : item}</li>`)
            .join("") : "";
    }

    getDefaultColumns() {
        // _columns = UtilsNew.mergeTable(_columns, this._config.columns || this._config.hiddenColumns, !!this._config.hiddenColumns);
        return [
            [
                {
                    id: "name",
                    title: "Gene",
                    field: "name",
                    formatter: (value, row) => this.geneFormatter(row, this.opencgaSession),
                    halign: this._config.header.horizontalAlign
                },
                {
                    id: "modeOfInheritance",
                    title: "Mode of Inheritance",
                    field: "modeOfInheritance",
                },
                {
                    id: "confidence",
                    title: "Confidence",
                    field: "confidence",
                    align: "center",
                    formatter: (value, row) => {
                        const statusConfidence = {
                            "HIGH": "label label-success",
                            "MEDIUM": "label label-warning",
                            "LOW": "label label-danger",
                        };
                        if (row.confidence) {
                            return `

                                    ${row.confidence}

`;
                        } else {
                            return "-";
                        }
                    },
                    halign: this._config.header.horizontalAlign
                },
                {
                    id: "phenotypes",
                    title: "Phenotypes",
                    field: "phenotypes",
                    formatter: (value, row) => {
                        const phenotypesContent = this.generateList(row.phenotypes, "name");
                        return String.raw`
                        ${phenotypesContent ? String.raw`

                                    ${phenotypesContent}

` : "-"}`;
                    }
                },
                {
                    id: "evidences",
                    title: "Evidences",
                    field: "evidences",
                    formatter: (value, row) => {
                        const evidencesContent = this.generateList(row.evidences, "");
                        return String.raw`
                        ${evidencesContent ? String.raw`

                                    ${evidencesContent}

` : "-"}`;
                    }
                }
            ],
        ];
    }

    render() {
        return html`
            ${this._config.showToolbar ?
                html`
                    <opencb-grid-toolbar
                        .config="${this.toolbarConfig}"
                        .query="${this.query}"
                        .opencgaSession="${this.opencgaSession}"
                        @columnChange="${this.onColumnChange}"
                        @download="${this.onDownload}"
                        @export="${this.onDownload}">
                    </opencb-grid-toolbar>` : nothing
            }

        `;
    }

    getDefaultConfig() {
        return {
            pagination: true,
            pageSize: 5,
            pageList: [5, 10, 25],
            showExport: false,
            detailView: false,
            detailFormatter: null, // function with the detail formatter
            multiSelection: false,
            showToolbar: false,
            header: {
                horizontalAlign: "center",
                verticalAlign: "bottom"
            }
        };
    }

}

customElements.define("disease-panel-gene-view", DiseasePanelGeneView);


text:
'use strict';

/**
 * @ngdoc function
 * @name formulaOneApp.controller:AboutCtrl
 * @description
 * # AboutCtrl
 * Controller of the formulaOneApp
 */
angular.module('formulaOneApp').controller('about',function ($scope,$sce){

    $scope.search = function(searchterm){

        var url = 'https://www.google.com/maps/embed/v1/search?key=AIzaSyCDf_kcMbACi1J5m8z_kaS4pVeZA68xcZ0&q='+searchterm+'+in+Cambridge+MA';
        $scope.mapUrl = $sce.trustAsResourceUrl(url);

    };

    var init = function(){
        $scope.mapUrl = $sce.trustAsResourceUrl('https://www.google.com/maps/embed/v1/search?key=AIzaSyCDf_kcMbACi1J5m8z_kaS4pVeZA68xcZ0&q= Cambridge+MA');
    };

    init();
});


text:
@echo off

REM ---------------------------------------------------------------------------
REM   Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
REM
REM   Licensed under the Apache License, Version 2.0 (the "License");
REM   you may not use this file except in compliance with the License.
REM   You may obtain a copy of the License at
REM
REM   http://www.apache.org/licenses/LICENSE-2.0
REM
REM   Unless required by applicable law or agreed to in writing, software
REM   distributed under the License is distributed on an "AS IS" BASIS,
REM   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM   See the License for the specific language governing permissions and
REM   limitations under the License.

rem ---------------------------------------------------------------------------
rem Main Script for Ballerina
rem
rem Environment Variable Prerequisites
rem
rem   BALLERINA_HOME  Home of BALLERINA installation. If not set I will  try
rem                   to figure it out.
rem
rem   JAVA_HOME       Must point at your Java Development Kit installation.
rem
rem   JAVA_OPTS       (Optional) Java runtime options used when the commands
rem                   is executed.
rem ---------------------------------------------------------------------------

rem ----- if JAVA_HOME is not set we're not happy ------------------------------

:checkJava

if "%JAVA_HOME%" == "" goto noJavaHome
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
goto checkServer

:noJavaHome
echo "You must set the JAVA_HOME variable before running Ballerina."
goto end

rem ----- set BALLERINA_HOME ----------------------------
:checkServer
rem %~sdp0 is expanded pathname of the current script under NT with spaces in the path removed
set BALLERINA_HOME=%~sdp0..
SET curDrive=%cd:~0,1%
SET ballerinaDrive=%BALLERINA_HOME:~0,1%
if not "%curDrive%" == "%ballerinaDrive%" %ballerinaDrive%:

goto updateClasspath

:noServerHome
echo BALLERINA_HOME is set incorrectly or BALLERINA could not be located. Please set BALLERINA_HOME.
goto end

rem ----- update classpath -----------------------------------------------------
:updateClasspath

setlocal EnableDelayedExpansion
set BALLERINA_CLASSPATH=
FOR %%C in ("%BALLERINA_HOME%\bre\lib\bootstrap\*.jar") DO set BALLERINA_CLASSPATH=!BALLERINA_CLASSPATH!;"%BALLERINA_HOME%\bre\lib\bootstrap\%%~nC%%~xC"

set BALLERINA_CLASSPATH="%JAVA_HOME%\lib\tools.jar";%BALLERINA_CLASSPATH%;

FOR %%D in ("%BALLERINA_HOME%\bre\lib\*.jar") DO set BALLERINA_CLASSPATH=!BALLERINA_CLASSPATH!;"%BALLERINA_HOME%\bre\lib\%%~nD%%~xD"

rem ----- Process the input command -------------------------------------------

rem Slurp the command line arguments. This loop allows for an unlimited number
rem of arguments (up to the command line limit, anyway).

:setupArgs
if ""%1""=="""" goto doneStart

if ""%1""==""debug""    goto commandDebug
if ""%1""==""-debug""   goto commandDebug
if ""%1""==""--debug""  goto commandDebug

shift
goto setupArgs

rem ----- commandDebug ---------------------------------------------------------
:commandDebug
shift
set DEBUG_PORT=%1
if "%DEBUG_PORT%"=="" goto noDebugPort
if not "%JAVA_OPTS%"=="" echo Warning !!!. User specified JAVA_OPTS will be ignored, once you give the --debug option.
set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%DEBUG_PORT%
echo Please start the remote debugging client to continue...
goto runServer

:noDebugPort
echo Please specify the debug port after the --debug option
goto end

:doneStart
if "%OS%"=="Windows_NT" @setlocal
if "%OS%"=="WINNT" @setlocal
goto runServer

rem ----------------- Execute The Requested Command ----------------------------

:runServer

set CMD=%*

rem ---------- Add jars to classpath ----------------

set BALLERINA_CLASSPATH=.\bre\lib\bootstrap;%BALLERINA_CLASSPATH%

set JAVA_ENDORSED=".\bre\lib\bootstrap\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed"

set CMD_LINE_ARGS=-Xbootclasspath/a:%BALLERINA_XBOOTCLASSPATH% -Xms256m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%BALLERINA_HOME%\heap-dump.hprof"  -Dcom.sun.management.jmxremote -classpath %BALLERINA_CLASSPATH% %JAVA_OPTS% -Djava.endorsed.dirs=%JAVA_ENDORSED%  -Dballerina.home="%BALLERINA_HOME%"  -Djava.command="%JAVA_HOME%\bin\java" -Djava.opts="%JAVA_OPTS%" -Djava.io.tmpdir="%BALLERINA_HOME%\tmp" -Denable.nonblocking=false -Dtransports.netty.conf="%BALLERINA_HOME%\bre\conf\netty-transports.yml" -Dfile.encoding=UTF8 -Dballerina.version=${project.version} -Djava.util.logging.config.file="%BALLERINA_HOME%\bre\conf\logging.properties" -Djava.util.logging.manager="org.ballerinalang.launcher.BLogManager"

:runJava
"%JAVA_HOME%\bin\java" %CMD_LINE_ARGS% org.ballerinalang.launcher.Main %CMD%
:end
goto endlocal

:endlocal

:END


text:
package com.google.android.libraries.remixer;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;

@RunWith(JUnit4.class)
public class StringVariableTest {

  @Mock
  Callback<String> mockCallback;
  private Variable<String> variableWithCallback;

  @Before
  public void setUp() {
    MockitoAnnotations.initMocks(this);
    variableWithCallback = new StringVariableBuilder()
        .setKey("key").setContext(this).setCallback(mockCallback).build();
  }

  @Test
  public void initCallsCallback() {
    Mockito.verify(mockCallback, Mockito.times(1)).onValueSet(variableWithCallback);
  }

  @Test
  public void setValueCallsCallback() {
    variableWithCallback.setValue("B");
    Mockito.verify(mockCallback, Mockito.times(2)).onValueSet(variableWithCallback);
  }

  @Test
  public void doesNotCrashOnNullCallback() {
    Variable<String> variable =
        new StringVariableBuilder().setKey("key").setContext(this).build();
    variable.init();
    variable.setValue("B");
  }
}


text:
START_ATF_NAMESPACE
    struct _bidioptions
    {
        unsigned int cbSize;
        unsigned __int16 wMask;
        unsigned __int16 wEffects;
    };
END_ATF_NAMESPACE


text:
"use strict";

/**
 * Webpack frontend test (w/ coverage) configuration.
 */
var _ = require("lodash");
var testCfg = require("./webpack.config.test");

module.exports = _.merge({}, testCfg, {
  module: {
    preLoaders: [
      // Manually instrument client code for code coverage.
      // https://github.com/deepsweet/isparta-loader handles ES6 + normal JS.
      {
        test: /(test|client)\/.*\.jsx?$/,
        exclude: /node_modules\//,
        loader: "isparta?{ babel: { stage: 1 } }"
      }
    ],
    loaders: testCfg.module.loaders
  }
});


text:
package de.sepe.tennis.remote;

import java.awt.*;
import java.awt.geom.*;

import de.sepe.tennis.remote.data.*;

/**
 * BallView.
 *
 * @author Sebastian Peters
 */
public class BallView {

    /** ball painting */
    protected Ellipse2D.Double delegate;

    /** color */
    protected Color color;

    public BallView() {
        this.delegate = new Ellipse2D.Double();
        this.color = Color.YELLOW;
    }

    /**
     * Constructor.
     *
     * @param x
     * @param y
     * @param width
     * @param height
     */
    public BallView(double x, double y, double width, double height) {
        this.delegate = new Ellipse2D.Double(x, y, width, height);
        this.color = Color.yellow;
    }

    /**
     * Draws the ball.
     *
     * @param g gc
     */
    public void draw(Graphics2D g) {
        Color oldColor = g.getColor();
        g.setColor(color);
        g.fill(delegate);
        g.setColor(oldColor);
    }

    @Override
    public String toString() {
        return "ball at (" + delegate.getCenterX() + ", " + delegate.getCenterY() + ")";
    }

    public synchronized BallData getData() {
        return new BallData(delegate.x, delegate.y, delegate.width, delegate.height);
    }

    public synchronized void setData(BallData data) {
        delegate.x = data.x;
        delegate.y = data.y;
        delegate.width = data.width;
        delegate.height = data.height;
    }
}


text:
package com.yang.dsl.java;

import com.google.common.collect.Lists;
import org.antlr.v4.runtime.tree.TerminalNode;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * Created by yangyongli on 08/02/2017.
 */
public class MyJavaVisitor extends JavaBaseVisitor<Object> {
    private static Logger logger = LoggerFactory.getLogger(MyJavaVisitor.class);

    /**
     * {@inheritDoc}
     *

     *
The default implementation returns the result of calling
     * {@link #visitChildren} on {@code ctx}.

     */

    public Object visitPackageDeclaration(JavaParser.PackageDeclarationContext ctx) {
        String packageName = ctx.qualifiedName().getText();
        logger.info("visitPackageDeclaration: {}",  packageName);
        logger.info(packageName);
        return visitChildren(ctx);
    }

    /**
     * {@inheritDoc}
     *

     *
The default implementation returns the result of calling
     * {@link #visitChildren} on {@code ctx}.

     */

    public Object visitTypeDeclaration(JavaParser.TypeDeclarationContext ctx) {
        JavaParser.ClassDeclarationContext classDeclarationContext = ctx.classDeclaration();
        JavaParser.InterfaceDeclarationContext interfaceDeclarationContext = ctx.interfaceDeclaration();
        if(null != classDeclarationContext){
            TerminalNode identifier = classDeclarationContext.Identifier();
            String className = identifier.getText();
            logger.info("visitTypeDeclaration: classDeclaration : className: {}",  className);

            JavaParser.TypeListContext implementInterfaceContext = classDeclarationContext.typeList();
            if(null != implementInterfaceContext) {
                List<String> interfaceList = Lists.newArrayList();
                List<JavaParser.TypeTypeContext> interfaceTypes = implementInterfaceContext.typeType();
                for (JavaParser.TypeTypeContext interfaceType : interfaceTypes) {
                    String type = interfaceType.getText();
                    interfaceList.add(type);
                }
                logger.info("        interfaces: {}",  className, StringUtils.join(interfaceList));
            }
            JavaParser.TypeTypeContext superClassContext = classDeclarationContext.typeType();
            if(null != superClassContext){
                String superClass = superClassContext.getText();
                logger.info("        superClass: {}",  className, superClass);
            }

        }else if(null != interfaceDeclarationContext){
            TerminalNode identifier = interfaceDeclarationContext.Identifier();
            String interfaceName = identifier.getText();
            logger.info("visitTypeDeclaration: interfaceDeclaration : interfaceName: {}",  interfaceName);
        }
        return visitChildren(ctx);
    }

    /**
     * {@inheritDoc}
     *

     *
The default implementation returns the result of calling
     * {@link #visitChildren} on {@code ctx}.

     */

    public Object visitMethodDeclaration(JavaParser.MethodDeclarationContext ctx) {
        String methodDeclaration = ctx.getText();
        String methodName = ctx.Identifier().getText();
        logger.info("visitMethodDeclaration: {}",  methodName);
        JavaParser.TypeTypeContext typeTypeContext = ctx.typeType();
        String returnType = "void";
        if(null != typeTypeContext){
            returnType = typeTypeContext.getText();
        }

        logger.info("         return type: {}", returnType);

        List<JavaParser.FormalParameterContext> parameterContextList = ctx.formalParameters().formalParameterList().formalParameter();

        for (JavaParser.FormalParameterContext formalParameterContext : parameterContextList) {
            String parameterType = formalParameterContext.typeType().getText();
            String parameterVar = formalParameterContext.variableDeclaratorId().getText();
            logger.info("         parameter: type: {} | var: {}", parameterType, parameterVar);
        }

        return visitChildren(ctx);
    }

    /**
     * {@inheritDoc}
     *

     *
The default implementation returns the result of calling
     * {@link #visitChildren} on {@code ctx}.

     */

    public Object visitFieldDeclaration(JavaParser.FieldDeclarationContext ctx) {
        String fieldDeclaration = ctx.getText();
        logger.info("visitFieldDeclaration: {}",  fieldDeclaration);
        return visitChildren(ctx);
    }

    /**
     * {@inheritDoc}
     *

     *
The default implementation returns the result of calling
     * {@link #visitChildren} on {@code ctx}.

     */

    public Object visitInterfaceMethodDeclaration(JavaParser.InterfaceMethodDeclarationContext ctx) {
        String methodDeclaration = ctx.getText();
        logger.info("visitInterfaceMethodDeclaration: {}", methodDeclaration);
        return visitChildren(ctx);
    }
}


text:
package io.javalin.core.event;

import java.util.function.Consumer;
import org.jetbrains.annotations.NotNull;

public class EventListener {

    private final EventManager eventManager;

    public EventListener(EventManager eventManager) {
        this.eventManager = eventManager;
    }

    // @formatter:off
    public void serverStarting(@NotNull EventHandler eventHandler)    {  addLifecycleEvent(JavalinEvent.SERVER_STARTING,     eventHandler); }
    public void serverStarted(@NotNull EventHandler eventHandler)     {  addLifecycleEvent(JavalinEvent.SERVER_STARTED,      eventHandler); }
    public void serverStartFailed(@NotNull EventHandler eventHandler) {  addLifecycleEvent(JavalinEvent.SERVER_START_FAILED, eventHandler); }
    public void serverStopFailed(@NotNull EventHandler eventHandler)  {  addLifecycleEvent(JavalinEvent.SERVER_STOP_FAILED, eventHandler); }
    public void serverStopping(@NotNull EventHandler eventHandler)    {  addLifecycleEvent(JavalinEvent.SERVER_STOPPING,     eventHandler); }
    public void serverStopped(@NotNull EventHandler eventHandler)     {  addLifecycleEvent(JavalinEvent.SERVER_STOPPED,      eventHandler); }
    // @formatter:on

    public void handlerAdded(@NotNull Consumer<HandlerMetaInfo> callback) {
        this.eventManager.getHandlerAddedHandlers().add(callback);
    }

    public void wsHandlerAdded(@NotNull Consumer<WsHandlerMetaInfo> callback) {
        eventManager.getWsHandlerAddedHandlers().add(callback);
    }

    private void addLifecycleEvent(@NotNull JavalinEvent event, @NotNull EventHandler eventHandler) {
        eventManager.getLifecycleHandlers().get(event).add(eventHandler);
    }

}


text:
using ::sealed::wasm::StatusOr;

namespace sealed::echo_secret::server {

StatusOr<std::string> EchoSecret(const std::string& secretMessage) {
  return secretMessage;
}

}  // namespace sealed::echo_secret::server

extern "C" int start() {
  sealed::wasm::Serve();
  return 0;
}


text:
layout: post
title: JavaLand Gutscheincode
date: 2015-01-31
categories: article
tags:
- news
- event
- javaland
author: jens
---
Ich wurde schong angesprochen, wie man als JUG Mitglied in den Genuss des Mitgliedstarifs kommt. Die Antwort findet ihr bei [Xing](https://www.xing.com/communities/posts/javaland-gutscheincode-1009211881), dort gibt es einen Gutscheincode für euch!


text:
import os
import sys
from distutils.core import setup

from setuptools import find_packages

sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'malmopy'))
from version import VERSION

extras = {
    'chainer': ['chainer>=1.21.0'],
    'gym': ['gym[atari]>=0.7.0'],
    'tensorflow': ['tensorflow'],
}

# Meta dependency groups.
all_deps = []
for group_name in extras:
    all_deps += extras[group_name]
extras['all'] = all_deps

setup(
    name='malmopy',
    version=VERSION,

    packages=[package for package in find_packages()
              if package.startswith('malmopy')],

    url='https://github.com/Microsoft/malmo-challenge',
    license='MIT',
    author='Microsoft Research Cambridge',
    author_email='',
    description='Malmo Collaborative AI Challenge task and example code',
    install_requires=['future', 'numpy>=1.11.0', 'six>=0.10.0', 'pandas', 'Pillow', 'tensorflow'],
    extras_require=extras
)


text:
using KitchenPC.Recipes;

namespace KitchenPC.Context
{
   /// <summary>
   /// Provides a KitchenPC database adapter with a way to search for recipes based on a query.
   /// </summary>
   public interface ISearchProvider
   {
      SearchResults Search(AuthIdentity identity, RecipeQuery query);
   }
}