text:
package net.firejack.platform.web.security.spring.filter;

import net.firejack.platform.web.security.spring.token.AuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.util.TextEscapeUtils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class AuthenticationProcessingFilter extends UsernamePasswordAuthenticationFilter {

    @Override
    public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response)
            throws AuthenticationException {
        String username = obtainUsername(request);
        String password = obtainPassword(request);

        if (username == null) {
            username = "";
        }

        if (password == null) {
            password = "";
        }

        username = username.trim();

        AuthenticationToken authRequest = new AuthenticationToken(username, password);

        // Place the last username attempted into HttpSession for views
        HttpSession session = request.getSession(false);
        authRequest.setSession(session);
        if (session != null || getAllowSessionCreation()) {
            request.getSession().setAttribute(SPRING_SECURITY_LAST_USERNAME_KEY, TextEscapeUtils.escapeEntities(username));
        }

        // Allow subclasses to set the "details" property
        setDetails(request, authRequest);

        return this.getAuthenticationManager().authenticate(authRequest);
    }
}


text:
  Agudelle est
       un village
       géographiquement positionné dans le département de Charente-Maritime en Poitou-Charentes. On dénombrait 114 habitants en 2008.

Le parc d'habitations, à Agudelle, se décomposait en 2011 en deux appartements et 67 maisons soit
 un marché plutôt équilibré.

Si vous envisagez de emmenager à Agudelle, vous pourrez aisément trouver une maison à vendre.

À proximité de Agudelle sont positionnées géographiquement les communes de
Courpignac localisée à 6 km, 400 habitants,
Allas-Bocage localisée à 1 km, 175 habitants,
Saint-Simon-de-Bordes à 1 km, 658 habitants,
Guitinières à 6 km, 400 habitants,
Saint-Hilaire-du-Bois à 4 km, 271 habitants,
Tugéras-Saint-Maurice localisée à 5 km, 327 habitants,
 entre autres. De plus, Agudelle est située à seulement 29 km de Pauillac.

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * UFund theme
 *
 * @package ufund-wp
 */

/**
 * Required WordPress variable.
 */
if (!isset($content_width)) {
    $content_width = 1170;
}

if (!function_exists('bootstrapBasicSetup')) {
    /**
     * Setup theme and register support wp features.
     */
    function bootstrapBasicSetup()
    {
        /**
         * Make theme available for translation
         * Translations can be filed in the /languages/ directory
         *
         * copy from underscores theme
         */
        load_theme_textdomain('bootstrap-basic', get_template_directory() . '/languages');

        // add theme support title-tag
        add_theme_support('title-tag');

        // add theme support post and comment automatic feed links
        add_theme_support('automatic-feed-links');

        // enable support for post thumbnail or feature image on posts and pages
        add_theme_support('post-thumbnails');

        // allow the use of html5 markup
        // @link https://codex.wordpress.org/Theme_Markup
        add_theme_support('html5', array('caption', 'comment-form', 'comment-list', 'gallery', 'search-form'));

        // add support menu
        register_nav_menus(array(
            'primary' => __('Primary Menu', 'bootstrap-basic'),
        ));

        // add post formats support
        add_theme_support('post-formats', array('aside', 'image', 'video', 'quote', 'link'));

        // add support custom background
        add_theme_support(
            'custom-background',
            apply_filters(
                'bootstrap_basic_custom_background_args',
                array(
                    'default-color' => 'ffffff',
                    'default-image' => ''
                )
            )
        );
    }// bootstrapBasicSetup
}
add_action('after_setup_theme', 'bootstrapBasicSetup');

if (!function_exists('bootstrapBasicWidgetsInit')) {
    /**
     * Register widget areas
     */
    function bootstrapBasicWidgetsInit()
    {
        register_sidebar(array(
            'name' => __('Sidebar right', 'bootstrap-basic'),
            'id' => 'sidebar-right',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '
',
            'after_title' => '
',
        ));

        register_sidebar(array(
            'name' => __('Sidebar left', 'bootstrap-basic'),
            'id' => 'sidebar-left',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '
',
            'after_title' => '
',
        ));

        register_sidebar(array(
            'name' => __('Header right', 'bootstrap-basic'),
            'id' => 'header-right',
            'description' => __('Header widget area on the right side next to site title.', 'bootstrap-basic'),
            'before_widget' => '
',
            'after_widget' => '
',
            'before_title' => '
',
            'after_title' => '
',
        ));

        register_sidebar(array(
            'name' => __('Navigation bar right', 'bootstrap-basic'),
            'id' => 'navbar-right',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '',
            'after_title' => '',
        ));

        register_sidebar(array(
            'name' => __('Footer left', 'bootstrap-basic'),
            'id' => 'footer-left',
            'before_widget' => '
',
            'after_widget' => '
',
            'before_title' => '
',
            'after_title' => '
',
        ));

        register_sidebar(array(
            'name' => __('Footer right', 'bootstrap-basic'),
            'id' => 'footer-right',
            'before_widget' => '
',
            'after_widget' => '
',
            'before_title' => '
',
            'after_title' => '
',
        ));
    }// bootstrapBasicWidgetsInit
}
add_action('widgets_init', 'bootstrapBasicWidgetsInit');

if (!function_exists('bootstrapBasicEnqueueScripts')) {
    /**
     * Enqueue scripts & styles
     */
    function bootstrapBasicEnqueueScripts()
    {
        global $wp_scripts;

        wp_enqueue_style('bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '3.3.7');
        wp_enqueue_style('bootstrap-theme-style', get_template_directory_uri() . '/css/bootstrap-theme.min.css', array(), '3.3.7');
        wp_enqueue_style('fontawesome-style', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.7.0');
        wp_enqueue_style('main-style', get_template_directory_uri() . '/css/main.css');

        wp_enqueue_script('modernizr-script', get_template_directory_uri() . '/js/vendor/modernizr.min.js', array(), '3.3.1');
        wp_register_script('respond-script', get_template_directory_uri() . '/js/vendor/respond.min.js', array(), '1.4.2');
        $wp_scripts->add_data('respond-script', 'conditional', 'lt IE 9');
        wp_enqueue_script('respond-script');
        wp_register_script('html5-shiv-script', get_template_directory_uri() . '/js/vendor/html5shiv.min.js', array(), '3.7.3');
        $wp_scripts->add_data('html5-shiv-script', 'conditional', 'lte IE 9');
        wp_enqueue_script('html5-shiv-script');
        wp_enqueue_script('jquery');
        wp_enqueue_script('bootstrap-script', get_template_directory_uri() . '/js/vendor/bootstrap.min.js', array(), '3.3.7', true);
        wp_enqueue_script('main-script', get_template_directory_uri() . '/js/main.js', array(), false, true);
        wp_enqueue_style('bootstrap-basic-style', get_stylesheet_uri());
    }// bootstrapBasicEnqueueScripts
}
add_action('wp_enqueue_scripts', 'bootstrapBasicEnqueueScripts');

/**
 * admin page displaying help.
 */
if (is_admin()) {
    require get_template_directory() . '/inc/BootstrapBasicAdminHelp.php';
    $bbsc_adminhelp = new BootstrapBasicAdminHelp();
    add_action('admin_menu', array($bbsc_adminhelp, 'themeHelpMenu'));
    unset($bbsc_adminhelp);
}

/**
 * Custom template tags for this theme.
 */
require get_template_directory() . '/inc/template-tags.php';

/**
 * Custom functions that act independently of the theme templates.
 */
require get_template_directory() . '/inc/extras.php';

/**
 * Custom dropdown menu and navbar in walker class
 */
require get_template_directory() . '/inc/BootstrapBasicMyWalkerNavMenu.php';

/**
 * Template functions
 */
require get_template_directory() . '/inc/template-functions.php';

/**
 * --------------------------------------------------------------
 * Theme widget & widget hooks
 * --------------------------------------------------------------
 */
require get_template_directory() . '/inc/widgets/BootstrapBasicSearchWidget.php';
require get_template_directory() . '/inc/template-widgets-hook.php';

/* -------------------------------------------------------------------------------- */
/* CUSTOM TYPES */

// moved to plugin


text:
MogulCSS
---

MogulCSS is a Sass based CSS library.

Install
----
To install you can download from GitHub or use Bower.

`bower install mogul-css`

Demo
---

Visit MogulMVC to see a list of MogulCSS's styles.

[Demo](http://mogulmvc.com/css/)

Author
---
Alan James: [alanjames1987@gmail.com](mailto:alanjames1987@gmail.com)

License
---
Licensed under [MIT](http://mogulmvc.com/general/license).


text:
namespace gpopt
{
// fwd declarations
class CTableDescriptor;
class CName;
class CPartConstraint;

//---------------------------------------------------------------------------
//	@class:
//		CPhysicalDynamicBitmapTableScan
//
//	@doc:
//		Dynamic bitmap table scan physical operator
//
//---------------------------------------------------------------------------
class CPhysicalDynamicBitmapTableScan : public CPhysicalDynamicScan
{
private:
	// disable copy ctor
	CPhysicalDynamicBitmapTableScan(const CPhysicalDynamicBitmapTableScan &);

public:
	// ctor
	CPhysicalDynamicBitmapTableScan(CMemoryPool *mp, BOOL is_partial,
									CTableDescriptor *ptabdesc,
									ULONG ulOriginOpId, const CName *pnameAlias,
									ULONG scan_id, CColRefArray *pdrgpcrOutput,
									CColRef2dArray *pdrgpdrgpcrParts,
									ULONG ulSecondaryScanId,
									CPartConstraint *ppartcnstr,
									CPartConstraint *ppartcnstrRel);

	// ident accessors
	virtual EOperatorId
	Eopid() const
	{
		return EopPhysicalDynamicBitmapTableScan;
	}

	// return a string for operator name
	virtual const CHAR *
	SzId() const
	{
		return "CPhysicalDynamicBitmapTableScan";
	}

	// match function
	virtual BOOL Matches(COperator *) const;

	// statistics derivation during costing
	virtual IStatistics *PstatsDerive(CMemoryPool *mp,
									  CExpressionHandle &exprhdl,
									  CReqdPropPlan *prpplan,
									  IStatisticsArray *stats_ctxt) const;

	// conversion function
	static CPhysicalDynamicBitmapTableScan *
	PopConvert(COperator *pop)
	{
		GPOS_ASSERT(NULL != pop);
		GPOS_ASSERT(EopPhysicalDynamicBitmapTableScan == pop->Eopid());

		return dynamic_cast<CPhysicalDynamicBitmapTableScan *>(pop);
	}
};
}  // namespace gpopt

#endif	// !GPOPT_CPhysicalDynamicBitmapTableScan_H

// EOF


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Macros</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

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

MTB CAT1 Peripheral driver library

API Reference |
Macros

Macros
CAN FD       (CAN with Flexible Data-Rate)

General Description

This section describes the CAN FD Macros.

These Macros can be used to check the interrupt and status flags. Detailed information about the macros is available in each macro description.

API Reference

 	RX Interrupt masks

 	This section contains interrupt bit masks to be used with:

 	TX Interrupt masks

 	This section contains interrupt bit masks to use with:

 	Error Interrupt masks

 	This section contains interrupt bit masks to be used with:

 	Interrupt line selection masks

 	Interrupt line selection masks.

 	Protocol Status Register (PSR) masks

 	Masks and bit positions of the Protocol Status Register (PSR) fields.

Macros

#define 	CY_CANFD_DRV_VERSION_MAJOR   1U

 	Driver major version.

#define 	CY_CANFD_DRV_VERSION_MINOR   30U

 	Driver minor version.

#define 	CY_CANFD_ID   CY_PDL_DRV_ID(0x45U)

 	CAN FD driver ID.

#define 	CY_CANFD_MESSAGE_DATA_BUFFER_SIZE   (16U)

 	Size of word data bytes in a receive or transmit operation (16word = 64byte)

#define 	CY_CANFD_RX_FIFO0   (0U)

 	FIFO number 0.

#define 	CY_CANFD_RX_FIFO1   (1U)

 	FIFO number 1.


text:
package com.sksamuel.elastic4s.searches.aggs

import com.sksamuel.elastic4s.ScriptBuilder
import com.sksamuel.elastic4s.searches.aggs.pipeline.PipelineAggregationBuilderFn
import org.elasticsearch.search.aggregations.AggregationBuilders
import org.elasticsearch.search.aggregations.metrics.percentiles.PercentilesAggregationBuilder

import scala.collection.JavaConverters._

object PercentilesAggregationBuilder {

  def apply(agg: PercentilesAggregationDefinition): PercentilesAggregationBuilder = {
    val builder = AggregationBuilders.percentiles(agg.name)
    agg.field.foreach(builder.field)
    agg.missing.foreach(builder.missing)
    agg.format.foreach(builder.format)
    agg.script.map(ScriptBuilder.apply).foreach(builder.script)
    agg.subaggs.map(AggregationBuilder.apply).foreach(builder.subAggregation)
    agg.pipelines.map(PipelineAggregationBuilderFn.apply).foreach(builder.subAggregation)
    if (agg.metadata.nonEmpty) builder.setMetaData(agg.metadata.asJava)
    builder
  }
}


text:
<?php

namespace App\Http\Controllers;

use App\Models\Program;
use App\Models\Student;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Http\Request;

use App\Http\Requests;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Validation\Validator;
use Symfony\Component\HttpFoundation\Session\Session;

class LoginController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function loginPage()
    {
        if(Auth::check())
        {
            return redirect()->intended('/dash');
        }

        return view('user/loginPage');
    }

    public function loginAttempt(Request $request)
    {
        $auth = Auth::attempt([
              'username' => Input::get('username'),
              'password' => Input::get('password')
        ]);

        if($auth)
        {
            return redirect()->intended('/dash');
        }
        else{
            echo "Invalid Username or Password";
        }
    }

    public function logout()
    {
        Auth::logout();
        return redirect()->intended('/login');
    }
}


text:
"""
person.urls
-----------
"""
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from mock import Mock
from nose.tools import eq_
from waffle.models import Switch

from amo.authentication import  AMOAuthentication
from django_browserid import auth
from person.models import Profile

class ProfileTest(TestCase):

    def setUp(self):
        self.user = User(
            username='jdoe',
            first_name='John',
            last_name='Doe'
        )
        self.user.save()

        self.profile = Profile()
        self.profile.user = self.user
        self.profile.nickname = 'doer'

        self.profile.save()

    def tearDown(self):
        self.profile.delete()
        self.user.delete()

    def test_get_fullname(self):
        self.assertEqual(self.user.get_profile().get_fullname(), 'John Doe')

    def test_public_profile_url(self):
        x_url = reverse('person_public_profile', args=['xxx'])
        with_dash_url = reverse('person_public_profile', args=['abc-cde'])
        eq_(with_dash_url, x_url.replace('xxx', 'abc-cde'))
        with_underscore_url = reverse('person_public_profile', args=['abc_de'])
        eq_(with_underscore_url, x_url.replace('xxx', 'abc_de'))

    def test_public_utf_profile_url(self):
        user = User.objects.create(username='12345')
        profile = Profile.objects.create(user=user, nickname='ąbc')
        response = self.client.get('/user/ąbc/')
        eq_(response.status_code, 200)

    def test_dashboard_utf(self):
        user = User.objects.create(username='12345')
        profile = Profile.objects.create(user=user, nickname='ąbc')
        user.set_password('secure')
        user.save()
        self.client.login(username=user.username, password='secure')
        response = self.client.get(reverse('person_dashboard'))
        eq_(response.status_code, 200)

    def test_user_with_question_mark(self):
        user = User.objects.create(username='12345')
        profile = Profile.objects.create(user=user, nickname='b?c')
        # profile
        response = self.client.get(profile.get_addons_url())
        eq_(response.status_code, 200)
        # dashboard
        user.set_password('secure')
        user.save()
        self.client.login(username=user.username, password='secure')
        response = self.client.get(reverse('person_dashboard'))
        eq_(response.status_code, 200)
        eq_(profile.get_profile_url(), '/user/%s/' % user.username)

    def test_fake_profile(self):
        resp = self.client.get(reverse('person_public_profile', args=['xxx']))
        eq_(404, resp.status_code)

class BrowserIDLoginTest(TestCase):

    TESTEMAIL = 'jdoe@example.com'

    def setUp(self):
        Switch.objects.create(
                name='browserid-login',
                active=True)
        self.user = User.objects.create(
                username='123', email=self.TESTEMAIL)
        Profile.objects.create(user=self.user, nickname='jdoe')

        # Mocking BrowserIDBackend
        class BIDBackend():
            def verify(self, assertion, site):
                return {'email': assertion}
        self.BIDBackend = auth.BrowserIDBackend
        auth.BrowserIDBackend = BIDBackend

    def tearDown(self):
        auth.BrowserIDBackend = self.BIDBackend

    def test_existing_user_login(self):
        AMOAuthentication.auth_browserid_authenticate = Mock(
                return_value={'id': '123'})
        response = self.client.post(reverse('browserid_login'),
                        {'assertion': self.TESTEMAIL})
        eq_(response.status_code, 200)
        assert self.user.is_authenticated()

    def test_user_changed_email_on_AMO(self):
        auth.BrowserIDBackend.verify = Mock(return_value={'email': 'some@example.com'})
        AMOAuthentication.auth_browserid_authenticate = Mock(
                return_value={'id': '123', 'email': 'some@example.com'})
        response = self.client.post(reverse('browserid_login'),
                        {'assertion': 'some-assertion'})
        eq_(response.status_code, 200)
        assert self.user.is_authenticated()
        assert User.objects.filter(email='some@example.com')
        self.assertRaises(User.DoesNotExist,
                User.objects.get, email=self.TESTEMAIL)


text:
package org.mifos.security.login.util.helpers;

public interface LoginConstants {

    public String FIRSTLOGIN = "login_success_first";
    public String REGULARLOGIN = "login_success_regular";
    public String LOGINPAGE = "login_failure";
    public String SETTINGSPAGE = "success_settings";
    public String LOGIN = "login";
    public String LOGOUT = "logout";
    // User Context for storing in session
    public String USERCONTEXT = "UserContext";
    public String ACTIVITYCONTEXT = "ActivityContext";
    public String LOGINPASSCHANGE = "LoginChangePW";
    public String SETTINGSPASSCHANE = "SettingsChangePW";
    public String LOGOUTFORWARD = "/loginAction.do?method=logout";
    public String LOGINPAGEURI = "/loginAction.do?method=load";
    public Short FIRSTTIMEUSER = 0;
    public Short PASSWORDCHANGEDFLAG = 1;
    public final Short MAXTRIES = 5;

    public static final String LOGIN_PASSWORD_UPDATE_FAILURE = "login_update_failure";
    public static final String SETTINGS_PASSWORD_UPDATE_FAILURE = "settings_update_failure";
    public static final String LOGINACTION = "loginAction.do";

    public static final String KEYUSERINACTIVE = "errors.inactiveuser";
    public static final String KEYUSERLOCKED = "errors.lockeduser";
    public static final String KEYINVALIDUSER = "errors.invaliduser";

    public static final String IllEGALSTATE = "errors.IllegalState";
    public static final String SESSIONTIMEOUT = "errors.sessiontimeout";
    public static final String INVALIDOLDPASSWORD = "errors.invalidoldpassword";
    public static final String SAME_OLD_AND_NEW_PASSWORD = "errors.sameoldandnewpassword";
    public static final String LOGOUTOUT = "errors.logoutout";
    public static final String BATCH_JOB_RUNNING = "errors.batchjobrunning";
    public static final String SHUTDOWN = "errors.shutdown";
    public String METHODCALLED = "methodCalled";
    public String LOGINACTIONFORM = "loginActionForm";

}


text:
import { Component, Output, EventEmitter, ChangeDetectionStrategy, Input } from '@angular/core';

@Component({
  selector: 'app-empty-message',
  templateUrl: './empty-message.component.html',
  styleUrls: ['./empty-message.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class EmptyMessageComponent {
  @Input() type: 'horizontal' | 'vertical' = 'horizontal';

  @Input() headerImg!: string;
  @Input() header!: string;
  @Input() description!: string;
  @Input() actionName!: string;
  @Input() actionIcon!: string;

  @Output() action = new EventEmitter<void>();

  onActionClick() {
    this.action.emit();
  }
}


text:
void compile_and_link_test()
{
   check_result<int>(boost::math::fpclassify BOOST_NO_MACRO_EXPAND<float>(f));
   check_result<int>(boost::math::fpclassify BOOST_NO_MACRO_EXPAND<double>(d));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
   check_result<int>(boost::math::fpclassify BOOST_NO_MACRO_EXPAND<long double>(l));
#endif

   check_result<bool>(boost::math::isfinite BOOST_NO_MACRO_EXPAND<float>(f));
   check_result<bool>(boost::math::isfinite BOOST_NO_MACRO_EXPAND<double>(d));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
   check_result<bool>(boost::math::isfinite BOOST_NO_MACRO_EXPAND<long double>(l));
#endif

   check_result<bool>(boost::math::isinf BOOST_NO_MACRO_EXPAND<float>(f));
   check_result<bool>(boost::math::isinf BOOST_NO_MACRO_EXPAND<double>(d));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
   check_result<bool>(boost::math::isinf BOOST_NO_MACRO_EXPAND<long double>(l));
#endif

   check_result<bool>(boost::math::isnormal BOOST_NO_MACRO_EXPAND<float>(f));
   check_result<bool>(boost::math::isnormal BOOST_NO_MACRO_EXPAND<double>(d));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
   check_result<bool>(boost::math::isnormal BOOST_NO_MACRO_EXPAND<long double>(l));
#endif
}


text:
namespace SlotSupportModuleDetails
{
class SlotSupportData : public DAVA::TArcDataNode
{
public:
    std::unique_ptr<DAVA::EditorSlotSystem> system = nullptr;

    DAVA_VIRTUAL_REFLECTION_IN_PLACE(SlotSupportData, DAVA::TArcDataNode)
    {
        DAVA::ReflectionRegistrator<SlotSupportData>::Begin()
        .End();
    }
};

class SlotPropertyPanelExtensions : public DAVA::TArcDataNode
{
public:
    std::shared_ptr<DAVA::ChildCreatorExtension> childCreator;
    std::shared_ptr<DAVA::EditorComponentExtension> editorCreator;

    DAVA_VIRTUAL_REFLECTION_IN_PLACE(SlotPropertyPanelExtensions, DAVA::TArcDataNode)
    {
        DAVA::ReflectionRegistrator<SlotPropertyPanelExtensions>::Begin()
        .End();
    }
};
}

DAVA_VIRTUAL_REFLECTION_IMPL(SlotSupportModule)
{
    DAVA::ReflectionRegistrator<SlotSupportModule>::Begin()
    .ConstructorByPointer()
    .End();
}

SlotSupportModule::SlotSupportModule()
{
    DAVA_REFLECTION_REGISTER_PERMANENT_NAME(DAVA::SlotSystemSettings);
    DAVA_REFLECTION_REGISTER_CUSTOM_PERMANENT_NAME(DAVA::LoadedSlotItemComponent, "LoadedSlotItemComponent");
}

void SlotSupportModule::OnContextCreated(DAVA::DataContext* context)
{
    using namespace DAVA;

    SceneData* data = context->GetData<SceneData>();
    RefPtr<SceneEditor2> scene = data->GetScene();

    SlotSupportModuleDetails::SlotSupportData* slotSupportData = new SlotSupportModuleDetails::SlotSupportData();
    context->CreateData(std::unique_ptr<DAVA::TArcDataNode>(slotSupportData));
    slotSupportData->system.reset(new EditorSlotSystem(scene.Get(), GetAccessor()));

    scene->AddSystem(slotSupportData->system.get(), ComponentUtils::MakeMask<SlotComponent>(), Scene::SCENE_SYSTEM_REQUIRE_PROCESS, scene->slotSystem);
    scene->slotSystem->SetExternalEntityLoader(std::shared_ptr<SlotSystem::ExternalEntityLoader>(new EntityForSlotLoader(GetAccessor())));
}

void SlotSupportModule::OnContextDeleted(DAVA::DataContext* context)
{
    using namespace DAVA;

    {
        SceneData* data = context->GetData<SceneData>();
        RefPtr<SceneEditor2> scene = data->GetScene();

        SlotSupportModuleDetails::SlotSupportData* slotSupportData = context->GetData<SlotSupportModuleDetails::SlotSupportData>();
        scene->RemoveSystem(slotSupportData->system.get());
    }

    context->DeleteData<SlotSupportModuleDetails::SlotSupportData>();
}

void SlotSupportModule::OnInterfaceRegistered(const DAVA::Type* interfaceType)
{
    if (interfaceType == DAVA::Type::Instance<DAVA::PropertyPanelInterface>())
    {
        DAVA::PropertyPanelInterface* propertyPanel = QueryInterface<DAVA::PropertyPanelInterface>();
        using namespace SlotSupportModuleDetails;
        SlotPropertyPanelExtensions* data = GetAccessor()->GetGlobalContext()->GetData<SlotPropertyPanelExtensions>();
        propertyPanel->RegisterExtension(data->childCreator);
        propertyPanel->RegisterExtension(data->editorCreator);
    }
}

void SlotSupportModule::OnBeforeInterfaceUnregistered(const DAVA::Type* interfaceType)
{
    if (interfaceType == DAVA::Type::Instance<DAVA::PropertyPanelInterface>())
    {
        DAVA::PropertyPanelInterface* propertyPanel = QueryInterface<DAVA::PropertyPanelInterface>();
        using namespace SlotSupportModuleDetails;
        SlotPropertyPanelExtensions* data = GetAccessor()->GetGlobalContext()->GetData<SlotPropertyPanelExtensions>();
        propertyPanel->UnregisterExtension(data->childCreator);
        propertyPanel->UnregisterExtension(data->editorCreator);
    }
}

void SlotSupportModule::ReloadConfig() const
{
    DAVA::ProjectManagerData* data = GetAccessor()->GetGlobalContext()->GetData<DAVA::ProjectManagerData>();
    ParseConfig(data->GetProjectPath());
}

void SlotSupportModule::ParseConfig(const DAVA::Any& v) const
{
    DAVA::SlotTemplatesData* slotTemplates = GetAccessor()->GetGlobalContext()->GetData<DAVA::SlotTemplatesData>();
    slotTemplates->Clear();
    if (v.IsEmpty() == false)
    {
        DAVA::FilePath projectPath = v.Cast<DAVA::FilePath>();
        slotTemplates->ParseConfig(projectPath + "/SlotTemplates.yaml");
    }
}

void SlotSupportModule::PostInit()
{
    using namespace SlotSupportModuleDetails;
    SlotPropertyPanelExtensions* extData = new SlotPropertyPanelExtensions();
    extData->childCreator.reset(new PropertyPanel::SlotComponentChildCreator());
    extData->editorCreator.reset(new PropertyPanel::SlotComponentEditorCreator());
    GetAccessor()->GetGlobalContext()->CreateData(std::unique_ptr<DAVA::TArcDataNode>(extData));

    DAVA::SlotTemplatesData* slotTemplates = new DAVA::SlotTemplatesData();
    GetAccessor()->GetGlobalContext()->CreateData(std::unique_ptr<DAVA::TArcDataNode>(slotTemplates));

    DAVA::ContextAccessor* accessor = GetAccessor();
    fieldBinder.reset(new DAVA::FieldBinder(accessor));

    DAVA::FieldDescriptor descr;
    descr.fieldName = DAVA::FastName(DAVA::ProjectManagerData::ProjectPathProperty);
    descr.type = DAVA::ReflectedTypeDB::Get<DAVA::ProjectManagerData>();
    fieldBinder->BindField(descr, DAVA::MakeFunction(this, &SlotSupportModule::ParseConfig));

    DAVA::QtAction* action = new DAVA::QtAction(accessor, "Reload slot templates");
    action->SetStateUpdationFunction(DAVA::QtAction::Enabled, descr, [](const DAVA::Any& v) {
        return !v.IsEmpty();
    });

    connections.AddConnection(action, &QAction::triggered, DAVA::MakeFunction(this, &SlotSupportModule::ReloadConfig));

    DAVA::ActionPlacementInfo placement(DAVA::CreateMenuPoint(QList<QString>() << "DebugFunctions"));
    GetUI()->AddAction(DAVA::mainWindowKey, placement, action);

    GetAccessor()->GetEngineContext()->componentManager->RegisterComponent<DAVA::LoadedSlotItemComponent>();
}

DECL_TARC_MODULE(SlotSupportModule);


text:
@interface ConcreteIteratorDesc : Iterator <Iterator> {
    @private
    NSArray *_array;
    int _current;
}
- (instancetype)initWithArray:(NSArray *)array;

@end


text:
/*
 * This file runs in a Node context (it's NOT transpiled by Babel), so use only
 * the ES6 features that are supported by your Node version. https://node.green/
 *
 * WARNING!
 * If you import anything from node_modules, then make sure that the package is specified
 * in package.json > dependencies and NOT in devDependencies
 *
 * Note: This file is used for both PRODUCTION & DEVELOPMENT.
 * Note: Changes to this file (but not any file it imports!) are picked up by the
 * development server, but such updates are costly since the dev-server needs a reboot.
 */

module.exports.extendApp = function ({ app, ssr }) {
  /*
     Extend the parts of the express app that you
     want to use with development server too.

     Example: app.use(), app.get() etc
  */
}


text:
import inspect
import logging
import os
import click
from craftbuildtools.operations import OperationPlugin
from craftbuildtools.template import TemplateRenderPlugin

logger = logging.getLogger("craft-buildtools")

class CreateProjectOperation(OperationPlugin):
    def __init__(self):
        super(CreateProjectOperation, self).__init__()
        self.name = "createproject_operation"
        self.description = "Generate a project for you to hack on via a CookieCutter Template"

    def perform(self, *args, **kwargs):
        from craftbuildtools.utils import ChangeDir, get_filename

        templates_folder = kwargs.pop("templatefolder")
        template = kwargs.pop("template")
        git_repo = kwargs.pop("git_clone_repo")
        plugin_manager = kwargs.pop('plugin_manager')

        if not os.path.exists(templates_folder):
            os.makedirs(templates_folder)

        new_git_repo = click.prompt("Would you like to add a new template?", default=False, type=click.BOOL)

        if new_git_repo:
            git_repo = click.prompt("Enter the URL For your git-repo to use as a template", type=click.STRING)

        # If there was a git repository included in the arguments, then
        # Attempt to clone this done!
        if git_repo is not None:
            # Enter the Templates Folder!
            with ChangeDir(templates_folder):
                # Get the name of the folder, from the git repo.
                cloned_folder_name = get_filename(git_repo)
                # If the git repository doesn't exist then we need to clone it doen.
                if not os.path.exists(os.path.join(templates_folder, cloned_folder_name)):
                    try:
                        from sh import git
                    except:
                        click.echo(
                            "You must have git installed on your machine in order to perform a clone. Aborting. Install git and try again")

                        exit()
                        return

                    git.clone(git_repo)

                    if not os.path.exists(os.path.join(templates_folder, cloned_folder_name).replace(".git", "")):
                        logger.error("Unable to find cloned repo %s at expected location %s" % (
                            cloned_folder_name, os.path.join(templates_folder, cloned_folder_name)))
                        exit()
                        return
                else:
                    click.echo("Git Repo %s already exists at %s" % (cloned_folder_name, templates_folder))

        available_templates = []

        for file in os.listdir(templates_folder):
            file = os.path.join(templates_folder, file)
            logger.debug("First Loop File: %s" % file)
            if os.path.isdir(file):
                logger.debug("%s is dir" % file)
                available_templates.append(file)

        # If there's no template or git_repo available, and no projects
        # In the available templates folder.
        if len(available_templates) == 0:
            click.echo("A template is required in order to create a project.")
            wants_to_clone = click.prompt("Would you like to clone a git repo for your template?", default=True,
                                          type=click.BOOL)

            try:
                from sh import git
            except:
                click.echo(
                    "You must have git installed on your machine in order to perform a clone. Aborting. Install git and try again")

                exit()
                return

            if not wants_to_clone:
                clone_commons_templates = click.prompt("Would you like to clone the default repositories?",
                                                       default=True, type=click.BOOL)

                if not clone_commons_templates:
                    logger.error("You must have atleast one available template in-order to create a project")
                    exit()
                    return

                with ChangeDir(templates_folder):
                    # TODO Read list of default repositories from config on git. Or something.

                    cloned = 0

                    if not os.path.exists(os.path.join(templates_folder, "cookiecutter-commons-bukkitplugin")):
                        logger.info("Cloning CookieCutter Template: Commons (BukkitPlugin)")
                        git.clone('https://github.com/TechnicalBro/cookiecutter-commons-bukkitplugin.git')
                        cloned += 1

                    if not os.path.exists(os.path.join(templates_folder, "cookiecutter-commons-minigame")):
                        logger.info("Cloning CookieCutter Template: Commons (MiniGame)")
                        git.clone("https://github.com/TechnicalBro/cookiecutter-commons-minigame.git")
                        cloned += 1

                    if not os.path.exists(os.path.join(templates_folder, "cookiecutter-bukkit-maven")):
                        logger.info("Cloning CookieCutter Template: Bukkit Plugin")
                        git.clone("https://github.com/TechnicalBro/cookiecutter-bukkit-maven.git")
                        cloned += 1

                    if cloned > 0:
                        logger.info("Finished Cloning available repositories.")

            else:
                git_repo = click.prompt("Enter the URL of the git repo to clone", type=click.STRING)

                with ChangeDir(templates_folder):
                    # Get the name of the folder, from the git repo.
                    cloned_folder_name = get_filename(git_repo)
                    # If the git repository doesn't exist then we need to clone it doen.
                    if not os.path.exists(os.path.join(templates_folder, cloned_folder_name)):
                        git.clone(git_repo)

                        if not os.path.exists(os.path.join(templates_folder, cloned_folder_name).replace(".git", "")):
                            logger.error("Unable to find cloned repo %s at expected location %s" % (
                                cloned_folder_name, os.path.join(templates_folder, cloned_folder_name)))
                            exit()
                            return
                    else:
                        click.echo("Git Repo %s already exists at %s" % (cloned_folder_name, templates_folder))

        available_templates = []

        logger.debug("Templates Folder is %s" % templates_folder)

        for file in os.listdir(templates_folder):
            file = os.path.join(templates_folder, file)

            if os.path.isdir(file):
                available_templates.append(file)
                logger.debug("Available Template: %s" % file)
            else:
                logger.debug("%s is not a directory" % file)

        if len(available_templates) == 0:
            click.echo("There's no available templates to choose from. Exiting")
            exit()

        templates_data = {}

        plugin_manager.register(directory=templates_folder, skip_types=OperationPlugin, override=True)

        if not plugin_manager.has_plugin(plugin_type=TemplateRenderPlugin):
            logger.error(
                "Unable to locate template rendering plugins in Plugin Manager. Assure your template has a script to render it by.")
            exit()
            return

        template_plugins = plugin_manager.get_plugins(plugin_type=TemplateRenderPlugin)
        for plugin in template_plugins:
            templates_data[plugin.template_name] = {
                'plugin': plugin,
                'folder': os.path.dirname(inspect.getfile(plugin.__class__))
            }

        logger.debug("Template Data map is: %s" % str(templates_data))

        project_type = template
        if project_type not in template_plugins:
            project_type_prompt_text = "Which Template Would you like to Render? Choose from ({})".format(
                ', '.join(list(templates_data.keys())))

            project_type = click.prompt(project_type_prompt_text, type=click.Choice(list(templates_data.keys())))

        template_plugin = templates_data[project_type]['plugin']
        template_plugin.perform(directory=templates_data[project_type]['folder'])

create_project_operation_plugin = CreateProjectOperation()


text:
<?php

namespace Site\AdminBundle\Controller;

use Sonata\AdminBundle\Controller\CRUDController;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Component\HttpFoundation\Response;

use Site\BaseBundle\Entity\Blog;
use Site\BaseBundle\Entity\BlogImage;
use Site\AdminBundle\Form\BlogImageType;

class BlogAdminController extends CRUDController
{
    /**
     * @Method("POST")
     * @param Blog    $blog
     * @param Request $request
     *
     * @return Response
     */
    public function uploadImagesAction(Blog $blog, Request $request)
    {
        $image = new BlogImage();
        $image->setBlog($blog);

        $form = $this->createForm(new BlogImageType(), $image);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $file = $image->getFile();
            $em   = $this->getDoctrine()->getManager();
            $em->persist($image);
            $em->flush();

            $result                 = array(
                'url'        => $this->get('vich_uploader.templating.helper.uploader_helper')->asset($image, 'file'),
                'name'       => $file->getClientOriginalName(),
                'type'       => $file->getMimeType(),
                'size'       => $file->getSize(),
                'deleteUrl'  => $this->generateUrl('admin_site_base_blogimage_delete', array('id' => $image->getId())),
                'deleteType' => 'DELETE'
            );
            $result['thumbnailUrl'] = $this->get('liip_imagine.templating.helper')->filter($result['url'], 'blog_admin_small');

            return new Response(json_encode(array('files' => array($result))));
        }

        return new Response('error', 500);
    }

    /**
     * @Method("POST")
     */
    public function orderImagesAction(Blog $blog)
    {
        $order  = $this->getRequest()->get('images', array());
        $images = $blog->getImages();
        $em     = $this->getDoctrine()->getManager();

        $i = 1;
        foreach ($order as $id) {
            foreach ($images as $image) {
                /** @var BlogImage $image */
                if ($image->getId() == $id) {
                    $image->setStackOrder($i++) && $em->persist($image);
                }
            }
        }

        $em->flush();

        return new Response('ok');
    }
}


text:
cask "fly" do
  version "7.3.2"
  sha256 "4c22ea4e7cdf5b2e009cf9d1d8eac7387a64894ede42c17c1a409c832c3cd058"

  url "https://github.com/concourse/concourse/releases/download/v#{version}/fly-#{version}-darwin-amd64.tgz"
  name "fly"
  desc "Official CLI tool for Concourse CI"
  homepage "https://github.com/concourse/concourse"

  binary "fly"
end


text:
package com.squareup.wire;

import com.google.protobuf.FieldDescriptorProto.Type;
import com.google.protobuf.FileOptions;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import okio.Buffer;
import okio.ByteString;
import org.junit.Test;

import static org.assertj.core.api.Assertions.assertThat;

public final class TagMapTest {
  final Extension<FileOptions, Object> unknownA = Extension.unknown(
      FileOptions.class, 1, FieldEncoding.FIXED64);
  final Extension<FileOptions, Double> extensionA = Extension.get(FileOptions.class,
      WireField.Label.OPTIONAL, "a", 1,
      "com.squareup.wire.ProtoAdapter#DOUBLE");
  final Extension<FileOptions, Object> unknownB = Extension.unknown(
      FileOptions.class, 2, FieldEncoding.LENGTH_DELIMITED);
  final Extension<FileOptions, String> extensionB = Extension.get(FileOptions.class,
      WireField.Label.OPTIONAL, "b", 2,
      "com.squareup.wire.ProtoAdapter#STRING");
  final Extension<FileOptions, Object> unknownC = Extension.unknown(
      FileOptions.class, 3, FieldEncoding.VARINT);
  final Extension<FileOptions, Type> extensionC = Extension.get(FileOptions.class,
      WireField.Label.OPTIONAL, "c", 3,
      "com.google.protobuf.FieldDescriptorProto$Type#ADAPTER");
  final Extension<FileOptions, List<Double>> extensionD = Extension.get(FileOptions.class,
      WireField.Label.PACKED, "d", 4,
      "com.squareup.wire.ProtoAdapter#DOUBLE");
  final Extension<FileOptions, List<String>> extensionE = Extension.get(FileOptions.class,
      WireField.Label.REPEATED, "e", 5,
      "com.squareup.wire.ProtoAdapter#STRING");

  @Test public void putAndGetExtensionValues() throws Exception {
    TagMap.Builder tagMap = new TagMap.Builder();
    tagMap.add(extensionA, 3.14159);
    tagMap.add(extensionB, "hello");
    tagMap.add(extensionC, Type.TYPE_SINT64);
    assertThat(tagMap.get(extensionA)).isEqualTo(3.14159);
    assertThat(tagMap.get(extensionB)).isEqualTo("hello");
    assertThat(tagMap.get(extensionC)).isEqualTo(Type.TYPE_SINT64);
  }

  @Test public void equalsAndHashCode() throws Exception {
    TagMap tagMap1 = new TagMap.Builder()
        .add(extensionA, 3.14159)
        .add(extensionB, "hello")
        .build();

    TagMap tagMap2 = new TagMap.Builder()
        .add(extensionA, 3.14159)
        .add(extensionB, "hello")
        .build();

    TagMap tagMap3 = new TagMap.Builder().build();

    TagMap tagMap4 = new TagMap.Builder()
        .add(extensionC, Type.TYPE_SINT64)
        .build();

    assertThat(tagMap1.equals(tagMap1)).isTrue();
    assertThat(tagMap1.equals(tagMap2)).isTrue();
    assertThat(tagMap1.equals(tagMap3)).isFalse();
    assertThat(tagMap1.equals(tagMap4)).isFalse();

    assertThat(tagMap3.equals(tagMap1)).isFalse();
    assertThat(tagMap3.equals(tagMap3)).isTrue();
    assertThat(tagMap3.equals(tagMap4)).isFalse();

    assertThat(tagMap4.equals(tagMap1)).isFalse();
    assertThat(tagMap4.equals(tagMap3)).isFalse();
    assertThat(tagMap4.equals(tagMap4)).isTrue();

    assertThat(tagMap1.hashCode()).isEqualTo(tagMap2.hashCode());
    assertThat(tagMap1.hashCode()).isNotEqualTo(tagMap3.hashCode());
    assertThat(tagMap1.hashCode()).isNotEqualTo(tagMap4.hashCode());
    assertThat(tagMap3.hashCode()).isNotEqualTo(tagMap4.hashCode());
  }

  @Test public void putAndGetRepeatedValues() throws Exception {
    TagMap tagMap = new TagMap.Builder()
        .add(extensionD, 1.0)
        .add(extensionD, 2.0)
        .add(extensionD, 3.0)
        .add(extensionE, "hacker")
        .add(extensionE, "slacker")
        .add(extensionE, "cracker")
        .build();
    assertThat(tagMap.get(extensionD)).isEqualTo(Arrays.asList(1.0, 2.0, 3.0));
    assertThat(tagMap.get(extensionE)).isEqualTo(Arrays.asList("hacker", "slacker", "cracker"));
  }

  /** Confirm that the implementation doubles from 8 to 16 and 16 to 32 elements. */
  @Test public void manyRepeatedValues() throws Exception {
    TagMap tagMap = new TagMap.Builder()
        .add(extensionD, 1.0)
        .add(extensionD, 2.0)
        .add(extensionD, 3.0)
        .add(extensionD, 4.0)
        .add(extensionD, 5.0)
        .add(extensionD, 6.0)
        .add(extensionD, 7.0)
        .add(extensionD, 8.0)
        .add(extensionD, 9.0)
        .add(extensionD, 10.0)
        .add(extensionD, 11.0)
        .add(extensionD, 12.0)
        .add(extensionD, 13.0)
        .add(extensionD, 14.0)
        .add(extensionD, 15.0)
        .add(extensionD, 16.0)
        .add(extensionD, 17.0)
        .build();
    assertThat(tagMap.get(extensionD)).isEqualTo(Arrays.asList(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0,
        8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0));
  }

  @Test public void rawToExtensionConversionForDouble() throws Exception {
    TagMap tagMap = new TagMap.Builder()
        .add(unknownA, 4614256650576692846L)
        .build();
    assertThat(tagMap.get(extensionA)).isEqualTo(3.14159);
  }

  @Test public void rawToExtensionConversionForString() throws Exception {
    TagMap tagMap = new TagMap.Builder()
        .add(unknownB, ByteString.encodeUtf8("hello"))
        .build();
    assertThat(tagMap.get(extensionB)).isEqualTo("hello");
  }

  @Test public void rawToExtensionConversionForEnum() throws Exception {
    TagMap tagMap = new TagMap.Builder()
        .add(unknownC, 18L)
        .build();
    assertThat(tagMap.get(extensionC)).isEqualTo(Type.TYPE_SINT64);
  }

  @Test public void rawToExtensionConversionForUnknownEnum() throws Exception {
    TagMap tagMap = new TagMap.Builder()
        .add(unknownC, 2828L)
        .build();
    assertThat(tagMap.get(extensionC)).isEqualTo(2828L);
  }

  @Test public void copyConstructor() throws Exception {
    TagMap a = new TagMap.Builder()
        .add(extensionD, 1.0)
        .build();

    TagMap b = new TagMap.Builder(a).build();
    assertThat(b.get(extensionD)).isEqualTo(Arrays.asList(1.0));
    assertThat(b.size()).isEqualTo(1);

    TagMap c = new TagMap.Builder(a)
        .add(extensionD, 2.0)
        .build();
    assertThat(c.get(extensionD)).isEqualTo(Arrays.asList(1.0, 2.0));
    assertThat(c.size()).isEqualTo(2);
    assertThat(b.get(extensionD)).isEqualTo(Arrays.asList(1.0));
    assertThat(b.size()).isEqualTo(1);

    TagMap d = new TagMap.Builder(b)
        .add(extensionD, 3.0)
        .build();
    assertThat(c.get(extensionD)).isEqualTo(Arrays.asList(1.0, 2.0));
    assertThat(c.size()).isEqualTo(2);
    assertThat(d.get(extensionD)).isEqualTo(Arrays.asList(1.0, 3.0));
    assertThat(d.size()).isEqualTo(2);
  }

  @Test public void removeAllNotFound() throws Exception {
    TagMap map = new TagMap.Builder()
        .add(extensionA, 1.0)
        .add(extensionB, 2.0)
        .add(extensionC, 3.0)
        .add(extensionD, 4.0)
        .removeAll(extensionE.getTag())
        .build();

    TagMap expected = new TagMap.Builder()
        .add(extensionA, 1.0)
        .add(extensionB, 2.0)
        .add(extensionC, 3.0)
        .add(extensionD, 4.0)
        .build();

    assertThat(map).isEqualTo(expected);
    assertThat(map.size()).isEqualTo(4);
  }

  @Test public void removeAllClearsMap() throws Exception {
    TagMap map = new TagMap.Builder()
        .add(extensionA, 1.0)
        .add(extensionA, 2.0)
        .removeAll(extensionA.getTag())
        .build();

    TagMap expected = new TagMap.Builder().build();

    assertThat(map).isEqualTo(expected);
    assertThat(map.size()).isEqualTo(0);
  }

  @Test public void removeAllRangeShift() throws Exception {
    TagMap map = new TagMap.Builder()
        .add(extensionA, 1.0)
        .add(extensionB, 2.0)
        .add(extensionB, 3.0)
        .add(extensionC, 4.0)
        .removeAll(extensionB.getTag())
        .build();

    TagMap expected = new TagMap.Builder()
        .add(extensionA, 1.0)
        .add(extensionC, 4.0)
        .build();

    assertThat(map).isEqualTo(expected);
    assertThat(map.size()).isEqualTo(2);
  }

  @Test public void removeAllMultipleRanges() throws Exception {
    TagMap map = new TagMap.Builder()
        .add(extensionA, 1.0)
        .add(extensionB, 2.0)
        .add(extensionB, 3.0)
        .add(extensionB, 4.0)
        .add(extensionC, 5.0)
        .add(extensionB, 6.0)
        .add(extensionD, 7.0)
        .removeAll(extensionB.getTag())
        .build();

    TagMap expected = new TagMap.Builder()
        .add(extensionA, 1.0)
        .add(extensionC, 5.0)
        .add(extensionD, 7.0)
        .build();

    assertThat(map).isEqualTo(expected);
    assertThat(map.size()).isEqualTo(3);
  }

  @Test public void encodeRepeatedExtension() throws IOException {
    Extension<FileOptions, List<Integer>> extension = Extension.get(FileOptions.class,
        WireField.Label.REPEATED, "a", 90,
        "com.squareup.wire.ProtoAdapter#INT32");

    TagMap map = new TagMap.Builder()
        .add(extension, 601)
        .add(extension, 701)
        .build();

    Buffer buffer = new Buffer();
    ProtoWriter protoWriter = new ProtoWriter(buffer);
    map.encode(protoWriter);
    assertThat(buffer.readByteString()).isEqualTo(ByteString.decodeHex("d005d904d005bd05"));
  }

  @Test public void encodePackedExtension() throws IOException {
    Extension<FileOptions, List<Integer>> extension = Extension.get(FileOptions.class,
        WireField.Label.PACKED, "a", 90,
        "com.squareup.wire.ProtoAdapter#INT32");

    TagMap map = new TagMap.Builder()
        .add(extension, 601)
        .add(extension, 701)
        .build();

    Buffer buffer = new Buffer();
    ProtoWriter protoWriter = new ProtoWriter(buffer);
    map.encode(protoWriter);
    assertThat(buffer.readByteString()).isEqualTo(ByteString.decodeHex("d20504d904bd05"));
  }

  @Test public void encodeUnknownEncodesAsRepeated() throws IOException {
    Extension<FileOptions, Object> unknown
        = Extension.unknown(FileOptions.class, 90, FieldEncoding.VARINT);
    TagMap map = new TagMap.Builder()
        .add(unknown, 601L)
        .add(unknown, 701L)
        .build();

    Buffer buffer = new Buffer();
    ProtoWriter protoWriter = new ProtoWriter(buffer);
    map.encode(protoWriter);
    assertThat(buffer.readByteString()).isEqualTo(ByteString.decodeHex("d005d904d005bd05"));
  }

  /**
   * Though it's unlikely in practice it's programmatically possible to have both extensions and
   * unknown values with the same tag!
   */
  @Test public void encodeMixOfPackedAndUnknown() throws IOException {
    Extension<FileOptions, List<Integer>> extension = Extension.get(FileOptions.class,
        WireField.Label.PACKED, "a", 90,
        "com.squareup.wire.ProtoAdapter#INT32");
    Extension<FileOptions, Object> unknown = Extension.unknown(FileOptions.class,
        90, FieldEncoding.VARINT);

    TagMap map = new TagMap.Builder()
        .add(extension, 601)
        .add(extension, 602)
        .add(unknown, 701L)
        .add(unknown, 702L)
        .build();

    Buffer buffer = new Buffer();
    ProtoWriter protoWriter = new ProtoWriter(buffer);
    map.encode(protoWriter);
    assertThat(buffer.readByteString())
        .isEqualTo(ByteString.decodeHex("d20504d904da04d005bd05d005be05"));
  }

  @Test public void transcodeUnknownValueToPackedList() throws Exception {
    Extension<FileOptions, List<Integer>> extension = Extension.get(FileOptions.class,
        WireField.Label.PACKED, "a", 90,
        "com.squareup.wire.ProtoAdapter#INT32");
    Extension<FileOptions, Object> unknown = Extension.unknown(
        FileOptions.class, 90, FieldEncoding.LENGTH_DELIMITED);

    TagMap map = new TagMap.Builder()
        .add(unknown, ByteString.decodeHex("d904da04"))
        .build();

    assertThat(map.get(extension)).isEqualTo(Arrays.asList(601, 602));
  }

  /** We had a bug where the capacity was being included in {@link TagMap#equals}. */
  @Test public void removeAllAndEquals() throws Exception {
    TagMap.Builder builder = new TagMap.Builder();
    builder.add(extensionA, 1.0);
    for (int i = 0; i < TagMap.Builder.INITIAL_CAPACITY; i++) {
      builder.add(extensionB, 1.0);
    }
    builder.removeAll(extensionB.getTag());
    TagMap map = builder.build();

    TagMap expected = new TagMap.Builder()
        .add(extensionA, 1.0)
        .build();

    assertThat(map).isEqualTo(expected);
    assertThat(map.size()).isEqualTo(1);
  }
}


text: Allow configuration mapping to code usages. Simplify configuration use and different formats.


text:
package javathreads.examples.ch02.example2;

import javathreads.examples.ch02.*;

import java.util.Random;

public class RandomCharacterGenerator extends Thread implements CharacterSource {
    static char[] chars;
    static String charArray = "abcdefghijklmnopqrstuvwxyz0123456789";

    static {
        chars = charArray.toCharArray();
    }

    Random random;
    CharacterEventHandler handler;

    public RandomCharacterGenerator() {
        random = new Random();
        handler = new CharacterEventHandler();
    }

    public int getPauseTime() {
        return (int) (Math.max(1000, 5000 * random.nextDouble()));
    }

    public void addCharacterListener(CharacterListener cl) {
        handler.addCharacterListener(cl);
    }

    public void removeCharacterListener(CharacterListener cl) {
        handler.removeCharacterListener(cl);
    }

    public void nextCharacter() {
        handler.fireNewCharacter(this,
                (int) chars[random.nextInt(chars.length)]);
    }

    public void run() {
        for (; ; ) {
            nextCharacter();
            try {
                Thread.sleep(getPauseTime());
            } catch (InterruptedException ie) {
                return;
            }
        }
    }
}


text:
package org.pepstock.charba.client.annotation;

import org.pepstock.charba.client.callbacks.ColorCallback;
import org.pepstock.charba.client.callbacks.NativeCallback;
import org.pepstock.charba.client.callbacks.ScriptableFunctions.ProxyObjectCallback;
import org.pepstock.charba.client.callbacks.ScriptableUtil;
import org.pepstock.charba.client.colors.HtmlColor;
import org.pepstock.charba.client.commons.CallbackPropertyHandler;
import org.pepstock.charba.client.commons.CallbackProxy;
import org.pepstock.charba.client.commons.JsHelper;
import org.pepstock.charba.client.commons.Key;
import org.pepstock.charba.client.commons.NativeObject;
import org.pepstock.charba.client.commons.PropertyHandler;

/**
 * Base object to map the shadow options.
 *
 * @author Andrea "Stock" Stocchero
 *
 */
final class ExtendedShadowOptionsHandler extends PropertyHandler<IsDefaultsExtendedShadowOptionsHandler> {

	// default of background shadow color
	static final String DEFAULT_BACKGROUND_SHADOW_COLOR_AS_STRING = HtmlColor.TRANSPARENT.getHtmlColorName();

	/**
	 * Name of properties of native object.
	 */
	private enum Property implements Key
	{
		BACKGROUND_SHADOW_COLOR("backgroundShadowColor");

		// name value of property
		private String value;

		/**
		 * Creates with the property value to use in the native object.
		 *
		 * @param value value of property name
		 */
		private Property(String value) {
			this.value = value;
		}

		/*
		 * (non-Javadoc)
		 *
		 * @see org.pepstock.charba.client.commons.Key#value()
		 */
		@Override
		public String value() {
			return value;
		}

	}

	// ---------------------------
	// -- CALLBACKS PROXIES ---
	// ---------------------------
	// callback proxy to invoke the background shadow color function
	private final CallbackProxy<ProxyObjectCallback> backgroundShadowColorCallbackProxy = JsHelper.get().newCallbackProxy();

	// callback instance to handle background shadow color options
	private static final CallbackPropertyHandler<ColorCallback<AnnotationContext>> BACKGROUND_SHADOW_COLOR_PROPERTY_HANDLER = new CallbackPropertyHandler<>(Property.BACKGROUND_SHADOW_COLOR);

	/**
	 * Creates a shadow options handler with the native object where shadow options properties must be managed and the default value to use when the property does not exist.
	 *
	 * @param parent model which contains the shadow options handler.
	 * @param defaultValues default value of shadow options to use when the properties do not exist
	 * @param nativeObject native object where shadow options handler properties must be managed
	 */
	ExtendedShadowOptionsHandler(AbstractAnnotation parent, IsDefaultsExtendedShadowOptionsHandler defaultValues, NativeObject nativeObject) {
		super(parent, defaultValues, nativeObject);
		// -------------------------------
		// -- SET CALLBACKS to PROXIES ---
		// -------------------------------
		// sets function to proxy callback in order to invoke the java interface
		this.backgroundShadowColorCallbackProxy.setCallback(context -> ScriptableUtil.getOptionValueAsColor(new AnnotationContext(parent, context), getBackgroundShadowColorCallback(), getDefaultValues().getBackgroundShadowColorAsString(), false));
	}

	/**
	 * Sets the color of the shadow of annotation.
	 *
	 * @param backgroundShadowColor the shadow of the border of annotation
	 */
	void setBackgroundShadowColor(String backgroundShadowColor) {
		// resets callback
		setBackgroundShadowColor((ColorCallback<AnnotationContext>) null);
		// stores value
		setValueAndAddToParent(Property.BACKGROUND_SHADOW_COLOR, backgroundShadowColor);
	}

	/**
	 * Returns the color of the shadow of annotation.
	 *
	 * @return the color of the shadow of annotation
	 */
	String getBackgroundShadowColorAsString() {
		return getValue(Property.BACKGROUND_SHADOW_COLOR, getDefaultValues().getBackgroundShadowColorAsString());
	}

	// ---------------------
	// CALLBACKS
	// ---------------------

	/**
	 * Returns the callback called to set the color of the shadow of annotation.
	 *
	 * @return the callback called to set the color of the shadow of annotation
	 */
	ColorCallback<AnnotationContext> getBackgroundShadowColorCallback() {
		return BACKGROUND_SHADOW_COLOR_PROPERTY_HANDLER.getCallback(this, getDefaultValues().getBackgroundShadowColorCallback());
	}

	/**
	 * Sets the callback to set the color of the shadow of annotation.
	 *
	 * @param borderShadowColorCallback to set the color of the shadow of annotation
	 */
	void setBackgroundShadowColor(ColorCallback<AnnotationContext> borderShadowColorCallback) {
		BACKGROUND_SHADOW_COLOR_PROPERTY_HANDLER.setCallback(this, AnnotationPlugin.ID, borderShadowColorCallback, backgroundShadowColorCallbackProxy.getProxy());
	}

	/**
	 * Sets the callback to set the color of the shadow of annotation.
	 *
	 * @param borderShadowColorCallback to set the color of the shadow of annotation
	 */
	void setBackgroundShadowColor(NativeCallback borderShadowColorCallback) {
		// resets callback
		setBackgroundShadowColor((ColorCallback<AnnotationContext>) null);
		// stores values
		setValueAndAddToParent(Property.BACKGROUND_SHADOW_COLOR, borderShadowColorCallback);
	}

}


text:
@interface ViewController : UITableViewController <EAIntroDelegate>

@end


text:
void periodic_ping(uint32_t periodic_100_ms) {

   printf("sender ping received (%d).  Writing to receiver \n", periodic_100_ms);

   test3__a_array_impl test_data;
   test_data[0] = 0;
   test_data[1] = 1;
   test_data[2] = 2;
   test_data[3] = 3;
   printf("sending array: (%d, %d, %d, %d) to receiver \n", test_data[0], test_data[1], test_data[2], test_data[3]);

   bool result = ping_Output1(test_data);
   printf("first attempt at pinging receiver was: %d. \n", result);

   result = ping_Output1(test_data);
   printf("second attempt at pinging receiver was: %d. \n", result);

}


text:
namespace content {
class BrowserContext;
}

namespace media_router {

// A stub implementation of MediaRouter interface on Android.
class MediaRouterAndroid : public MediaRouterBase {
 public:
  ~MediaRouterAndroid() override;

  static bool Register(JNIEnv* env);

  const MediaRoute* FindRouteBySource(const MediaSource::Id& source_id) const;

  // MediaRouter implementation.
  void CreateRoute(const MediaSource::Id& source_id,
                   const MediaSink::Id& sink_id,
                   const GURL& origin,
                   content::WebContents* web_contents,
                   const std::vector<MediaRouteResponseCallback>& callbacks,
                   base::TimeDelta timeout,
                   bool off_the_record) override;
  void JoinRoute(const MediaSource::Id& source,
                 const std::string& presentation_id,
                 const GURL& origin,
                 content::WebContents* web_contents,
                 const std::vector<MediaRouteResponseCallback>& callbacks,
                 base::TimeDelta timeout,
                 bool off_the_record) override;
  void ConnectRouteByRouteId(
      const MediaSource::Id& source,
      const MediaRoute::Id& route_id,
      const GURL& origin,
      content::WebContents* web_contents,
      const std::vector<MediaRouteResponseCallback>& callbacks,
      base::TimeDelta timeout,
      bool off_the_record) override;
  void DetachRoute(const MediaRoute::Id& route_id) override;
  void TerminateRoute(const MediaRoute::Id& route_id) override;
  void SendRouteMessage(const MediaRoute::Id& route_id,
                        const std::string& message,
                        const SendRouteMessageCallback& callback) override;
  void SendRouteBinaryMessage(
      const MediaRoute::Id& route_id,
      std::unique_ptr<std::vector<uint8_t>> data,
      const SendRouteMessageCallback& callback) override;
  void AddIssue(const Issue& issue) override;
  void ClearIssue(const Issue::Id& issue_id) override;
  void OnUserGesture() override;
  void SearchSinks(
      const MediaSink::Id& sink_id,
      const MediaSource::Id& source_id,
      const std::string& search_input,
      const std::string& domain,
      const MediaSinkSearchResponseCallback& sink_callback) override;

  // The methods called by the Java counterpart.

  // Notifies the media router that information about sinks is received for
  // a specific source URN.
  void OnSinksReceived(JNIEnv* env,
                       const base::android::JavaParamRef<jobject>& obj,
                       const base::android::JavaParamRef<jstring>& jsource_urn,
                       jint jcount);

  // Notifies the media router about a successful route creation.
  void OnRouteCreated(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj,
      const base::android::JavaParamRef<jstring>& jmedia_route_id,
      const base::android::JavaParamRef<jstring>& jmedia_sink_id,
      jint jroute_request_id,
      jboolean jis_local);

  // Notifies the media router that route creation or joining failed.
  void OnRouteRequestError(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj,
      const base::android::JavaParamRef<jstring>& jerror_text,
      jint jroute_request_id);

  // Notifies the media router when the route was closed.
  void OnRouteClosed(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj,
      const base::android::JavaParamRef<jstring>& jmedia_route_id);

  // Notifies the media router when the route was closed with an error.
  void OnRouteClosedWithError(
      JNIEnv* env,
      const base::android::JavaParamRef<jobject>& obj,
      const base::android::JavaParamRef<jstring>& jmedia_route_id,
      const base::android::JavaParamRef<jstring>& jmessage);

  // Notifies the media router about the result of sending a message.
  void OnMessageSentResult(JNIEnv* env,
                           const base::android::JavaParamRef<jobject>& obj,
                           jboolean jsuccess,
                           jint jcallback_id);

  // Notifies the media router about a message received from the media route.
  void OnMessage(JNIEnv* env,
                 const base::android::JavaParamRef<jobject>& obj,
                 const base::android::JavaParamRef<jstring>& jmedia_route_id,
                 const base::android::JavaParamRef<jstring>& jmessage);

 private:
  friend class MediaRouterFactory;

  explicit MediaRouterAndroid(content::BrowserContext*);

  // MediaRouter implementation.
  bool RegisterMediaSinksObserver(MediaSinksObserver* observer) override;
  void UnregisterMediaSinksObserver(MediaSinksObserver* observer) override;
  void RegisterMediaRoutesObserver(MediaRoutesObserver* observer) override;
  void UnregisterMediaRoutesObserver(MediaRoutesObserver* observer) override;
  void RegisterIssuesObserver(IssuesObserver* observer) override;
  void UnregisterIssuesObserver(IssuesObserver* observer) override;
  void RegisterPresentationSessionMessagesObserver(
      PresentationSessionMessagesObserver* observer) override;
  void UnregisterPresentationSessionMessagesObserver(
      PresentationSessionMessagesObserver* observer) override;

  base::android::ScopedJavaGlobalRef<jobject> java_media_router_;

  using MediaSinkObservers = base::ScopedPtrHashMap<
      MediaSource::Id,
      std::unique_ptr<base::ObserverList<MediaSinksObserver>>>;
  MediaSinkObservers sinks_observers_;

  base::ObserverList<MediaRoutesObserver> routes_observers_;

  struct MediaRouteRequest {
    MediaRouteRequest(
        const MediaSource& source,
        const std::string& presentation_id,
        const std::vector<MediaRouteResponseCallback>& callbacks);
    ~MediaRouteRequest();

    MediaSource media_source;
    std::string presentation_id;
    std::vector<MediaRouteResponseCallback> callbacks;
  };

  using MediaRouteRequests =
      IDMap<MediaRouteRequest, IDMapOwnPointer>;
  MediaRouteRequests route_requests_;

  using MediaRoutes = std::vector<MediaRoute>;
  MediaRoutes active_routes_;

  using SendMessageCallbacks = IDMap<SendRouteMessageCallback, IDMapOwnPointer>;
  SendMessageCallbacks message_callbacks_;

  using MessagesObservers = base::ScopedPtrHashMap<
      MediaRoute::Id,
      std::unique_ptr<base::ObserverList<PresentationSessionMessagesObserver>>>;
  MessagesObservers messages_observers_;

  DISALLOW_COPY_AND_ASSIGN(MediaRouterAndroid);
};

} // namespace media_router

#endif  // CHROME_BROWSER_MEDIA_ANDROID_ROUTER_MEDIA_ROUTER_ANDROID_H_


text:
package br.com.exe4;

import java.util.Scanner;

public class Multiplo {

	public boolean multiplo(double a,double b){
		if(a%b==0)return true;
		return false;
	}

}


text:
"use strict";

var assert = require("assert"),
    vows = require("vows"),
    databank = require("databank"),
    version = require("../lib/version").version,
    URLMaker = require("../lib/urlmaker").URLMaker,
    modelBatch = require("./lib/model").modelBatch,
    Databank = databank.Databank,
    DatabankObject = databank.DatabankObject;

var suite = vows.describe("task module interface");

var testSchema = {
    pkey: "id",
    fields: ["_created",
             "_uuid",
             "actor",
             "attachments",
             "author",
             "by",
             "content",
             "displayName",
             "downstreamDuplicates",
             "id",
             "image",
             "inReplyTo",
             "likes",
             "links",
             "object",
             "objectType",
             "prerequisites",
             "published",
             "replies",
             "required",
             "shares",
             "summary",
             "supersedes",
             "updated",
             "upstreamDuplicates",
             "url",
             "verb"],
    indices: ["_uuid", "url"]
};

var testData = {
    "create": {
        actor: {
            id: "urn:uuid:746e6d2c-ec86-11e1-988e-0024beb67924",
            displayName: "Evan Prodromou",
            objectType: "person"
        },
        verb: "post",
        object: {
            id: "urn:uuid:ad06288c-ec86-11e1-bc32-0024beb67924",
            displayName: "pump.io-"+version,
            objectType: "application"
        }
    },
    "update": {
        required: true
    }
};

suite.addBatch(modelBatch("task", "Task", testSchema, testData));

suite["export"](module);


text:
namespace cv { namespace gimpl {

// FIXME: exported for internal tests only!
class GAPI_EXPORTS GCompiler
{
    const GComputation&      m_c;
    const GMetaArgs          m_metas;
    GCompileArgs             m_args;
    ade::ExecutionEngine     m_e;

    cv::GKernelPackage       m_all_kernels;
    cv::gapi::GNetPackage    m_all_networks;

    // Patterns built from transformations
    std::vector<std::unique_ptr<ade::Graph>> m_all_patterns;

    void validateInputMeta();
    void validateOutProtoArgs();

public:
    // Metas may be empty in case when graph compiling for streaming
    // In this case graph get metas from first frame
    explicit GCompiler(const GComputation &c,
                             GMetaArgs    &&metas,
                             GCompileArgs &&args);

    // The method which does everything...
    GCompiled compile();

    // This too.
    GStreamingCompiled compileStreaming();

    // But those are actually composed of this:
    using GPtr = std::unique_ptr<ade::Graph>;
    GPtr        generateGraph();               // Unroll GComputation into a GModel
    void        runPasses(ade::Graph &g);      // Apply all G-API passes on a GModel
    void        compileIslands(ade::Graph &g); // Instantiate GIslandExecutables in GIslandModel
    static void compileIslands(ade::Graph &g, const cv::GCompileArgs &args);
    GCompiled   produceCompiled(GPtr &&pg);    // Produce GCompiled from processed GModel
    GStreamingCompiled  produceStreamingCompiled(GPtr &&pg); // Produce GStreamingCompiled from processed GMbodel
    static void runMetaPasses(ade::Graph &g, const cv::GMetaArgs &metas);

    static GPtr makeGraph(const cv::GComputation::Priv &);
};

}}

#endif // OPENCV_GAPI_GCOMPILER_HPP


text:
package cromwell.backend.standard

import akka.actor.ActorRef
import cromwell.backend.io.WorkflowPaths
import cromwell.backend.validation.RuntimeAttributesDefault
import cromwell.backend.wfs.WorkflowPathBuilder
import cromwell.backend.{BackendConfigurationDescriptor, BackendInitializationData, BackendWorkflowDescriptor, BackendWorkflowInitializationActor}
import cromwell.core.WorkflowOptions
import cromwell.core.path.PathBuilder
import wom.expression.WomExpression
import wom.graph.CommandCallNode
import wom.values.WomValue

import scala.concurrent.Future
import scala.util.{Success, Try}

trait StandardInitializationActorParams {
  def workflowDescriptor: BackendWorkflowDescriptor

  def calls: Set[CommandCallNode]

  def serviceRegistryActor: ActorRef

  def configurationDescriptor: BackendConfigurationDescriptor
}

case class DefaultInitializationActorParams
(
  workflowDescriptor: BackendWorkflowDescriptor,
  ioActor: ActorRef,
  calls: Set[CommandCallNode],
  serviceRegistryActor: ActorRef,
  configurationDescriptor: BackendConfigurationDescriptor,
  restarting: Boolean
) extends StandardInitializationActorParams

/**
  * Implements BackendWorkflowInitializationActor.beforeAll() by returning a basic initialization data.
  *
  * Most implementors will want to do custom initialization in a beforeAll() and/or return custom initialization data.
  *
  * @param standardParams Standard parameters
  */
class StandardInitializationActor(val standardParams: StandardInitializationActorParams)
  extends BackendWorkflowInitializationActor {

  implicit protected val system = context.system

  override lazy val serviceRegistryActor: ActorRef = standardParams.serviceRegistryActor

  override lazy val calls: Set[CommandCallNode] = standardParams.calls

  override def beforeAll(): Future[Option[BackendInitializationData]] = {
    initializationData map Option.apply
  }

  lazy val initializationData: Future[StandardInitializationData] =
    workflowPaths map { new StandardInitializationData(_, runtimeAttributesBuilder, classOf[StandardExpressionFunctions]) }

  lazy val expressionFunctions: Class[_ <: StandardExpressionFunctions] = classOf[StandardExpressionFunctions]

  lazy val pathBuilders: Future[List[PathBuilder]] = standardParams.configurationDescriptor.pathBuilders(workflowDescriptor.workflowOptions)

  lazy val workflowPaths: Future[WorkflowPaths] =
    pathBuilders map { WorkflowPathBuilder.workflowPaths(configurationDescriptor, workflowDescriptor, _) }

  /**
    * Returns the runtime attribute builder for this backend.
    *
    * NOTE: Implemented as a def instead of a lazy val to allow calls to super.runtimeAttributesBuilder.withValidation()
    *
    * @return runtime attributes builder with possible custom validations
    */
  def runtimeAttributesBuilder: StandardValidatedRuntimeAttributesBuilder =
    StandardValidatedRuntimeAttributesBuilder.default(configurationDescriptor.backendRuntimeAttributesConfig)

  override protected lazy val runtimeAttributeValidators: Map[String, (Option[WomExpression]) => Boolean] = {
    runtimeAttributesBuilder.validatorMap
  }

  override protected def coerceDefaultRuntimeAttributes(options: WorkflowOptions): Try[Map[String, WomValue]] = {
    RuntimeAttributesDefault.workflowOptionsDefault(options, runtimeAttributesBuilder.coercionMap)
  }

  def validateWorkflowOptions(): Try[Unit] = Success(())

  def checkForUnsupportedRuntimeAttributes(): Try[Unit] = Try {
    calls foreach { call =>
      val runtimeAttributeKeys = call.callable.runtimeAttributes.attributes.keys.toList
      val notSupportedAttributes = runtimeAttributesBuilder.unsupportedKeys(runtimeAttributeKeys).toList

      if (notSupportedAttributes.nonEmpty) {
        val notSupportedAttrString = notSupportedAttributes mkString ", "
        workflowLogger.warn(
          s"Key/s [$notSupportedAttrString] is/are not supported by backend. " +
            s"Unsupported attributes will not be part of job executions.")
      }
    }
  }

  override def validate(): Future[Unit] = {
    Future.fromTry(
      for {
        _ <- validateWorkflowOptions()
        _ <- checkForUnsupportedRuntimeAttributes()
      } yield ()
    )
  }

  override protected lazy val workflowDescriptor: BackendWorkflowDescriptor = standardParams.workflowDescriptor

  override protected lazy val configurationDescriptor: BackendConfigurationDescriptor =
    standardParams.configurationDescriptor
}


text:
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/slave/rel-m-rel-xr-osx64-bld/build/parser/xml/public/nsISAXErrorHandler.idl
 */

#ifndef __gen_nsISAXErrorHandler_h__
#define __gen_nsISAXErrorHandler_h__

#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsISAXLocator; /* forward declaration */

/* starting interface:    nsISAXErrorHandler */
#define NS_ISAXERRORHANDLER_IID_STR "e02b6693-6cca-11da-be43-001422106990"

#define NS_ISAXERRORHANDLER_IID \
  {0xe02b6693, 0x6cca, 0x11da, \
    { 0xbe, 0x43, 0x00, 0x14, 0x22, 0x10, 0x69, 0x90 }}

class NS_NO_VTABLE NS_SCRIPTABLE nsISAXErrorHandler : public nsISupports {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISAXERRORHANDLER_IID)

  /* void error (in nsISAXLocator locator, in AString error); */
  NS_SCRIPTABLE NS_IMETHOD Error(nsISAXLocator *locator, const nsAString & error) = 0;

  /* void fatalError (in nsISAXLocator locator, in AString error); */
  NS_SCRIPTABLE NS_IMETHOD FatalError(nsISAXLocator *locator, const nsAString & error) = 0;

  /* void ignorableWarning (in nsISAXLocator locator, in AString error); */
  NS_SCRIPTABLE NS_IMETHOD IgnorableWarning(nsISAXLocator *locator, const nsAString & error) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsISAXErrorHandler, NS_ISAXERRORHANDLER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISAXERRORHANDLER \
  NS_SCRIPTABLE NS_IMETHOD Error(nsISAXLocator *locator, const nsAString & error); \
  NS_SCRIPTABLE NS_IMETHOD FatalError(nsISAXLocator *locator, const nsAString & error); \
  NS_SCRIPTABLE NS_IMETHOD IgnorableWarning(nsISAXLocator *locator, const nsAString & error);

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISAXERRORHANDLER(_to) \
  NS_SCRIPTABLE NS_IMETHOD Error(nsISAXLocator *locator, const nsAString & error) { return _to Error(locator, error); } \
  NS_SCRIPTABLE NS_IMETHOD FatalError(nsISAXLocator *locator, const nsAString & error) { return _to FatalError(locator, error); } \
  NS_SCRIPTABLE NS_IMETHOD IgnorableWarning(nsISAXLocator *locator, const nsAString & error) { return _to IgnorableWarning(locator, error); }

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISAXERRORHANDLER(_to) \
  NS_SCRIPTABLE NS_IMETHOD Error(nsISAXLocator *locator, const nsAString & error) { return !_to ? NS_ERROR_NULL_POINTER : _to->Error(locator, error); } \
  NS_SCRIPTABLE NS_IMETHOD FatalError(nsISAXLocator *locator, const nsAString & error) { return !_to ? NS_ERROR_NULL_POINTER : _to->FatalError(locator, error); } \
  NS_SCRIPTABLE NS_IMETHOD IgnorableWarning(nsISAXLocator *locator, const nsAString & error) { return !_to ? NS_ERROR_NULL_POINTER : _to->IgnorableWarning(locator, error); }

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsSAXErrorHandler : public nsISAXErrorHandler
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISAXERRORHANDLER

  nsSAXErrorHandler();

private:
  ~nsSAXErrorHandler();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsSAXErrorHandler, nsISAXErrorHandler)

nsSAXErrorHandler::nsSAXErrorHandler()
{
  /* member initializers and constructor code */
}

nsSAXErrorHandler::~nsSAXErrorHandler()
{
  /* destructor code */
}

/* void error (in nsISAXLocator locator, in AString error); */
NS_IMETHODIMP nsSAXErrorHandler::Error(nsISAXLocator *locator, const nsAString & error)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void fatalError (in nsISAXLocator locator, in AString error); */
NS_IMETHODIMP nsSAXErrorHandler::FatalError(nsISAXLocator *locator, const nsAString & error)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void ignorableWarning (in nsISAXLocator locator, in AString error); */
NS_IMETHODIMP nsSAXErrorHandler::IgnorableWarning(nsISAXLocator *locator, const nsAString & error)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#endif /* __gen_nsISAXErrorHandler_h__ */


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace XecMe.Common
{
    /// <summary>
    /// This static class is used for performing the validation on the parameters passed to the methods
    /// </summary>
    public static class Guard
    {
        /// <summary>
        /// Checks whether the parameter is null
        /// </summary>
        /// <param name="parameter">Value of the parameter</param>
        /// <param name="parameterName">Name of the parameter</param>
        [Obsolete("Please use NotNull() instead")]
        public static void ArgumentNotNull(this object parameter, string parameterName)
        {
            if (parameter == null)
                throw new ArgumentNullException(parameterName);
        }

        /// <summary>
        /// This method check the parameter passed to it is null or empty
        /// </summary>
        /// <param name="parameter">Value of the string parameter</param>
        /// <param name="parameterName">Name of the string parameter</param>
        [Obsolete("Please use NotNullOrEmpty() instead")]
        public static void ArgumentNotNullOrEmptyString(this string parameter, string parameterName)
        {
            if(string.IsNullOrEmpty(parameter))
                throw new ArgumentNullException(parameterName);
        }

        /// <summary>
        /// Checks whether the parameter is null
        /// </summary>
        /// <param name="parameter">Value of the parameter</param>
        /// <param name="parameterName">Name of the parameter</param>
        /// <param name="message">Error message</param>
        public static void NotNull(this object parameter, string parameterName, string message = null)
        {
            if (parameter == null)
            {
                if (string.IsNullOrWhiteSpace(message))
                    throw new ArgumentNullException(parameterName);
                else
                    throw new ArgumentNullException(parameterName, message);
            }
        }

        /// <summary>
        /// This method check the parameter passed to it is null or empty
        /// </summary>
        /// <param name="parameter">Value of the string parameter</param>
        /// <param name="parameterName">Name of the string parameter</param>
        /// <param name="message">Error message</param>
        public static void NotNullOrEmpty(this string parameter, string parameterName, string message = null)
        {
            if (string.IsNullOrEmpty(parameter))
            {
                if (string.IsNullOrWhiteSpace(message))
                    throw new ArgumentNullException(parameterName);
                else
                    throw new ArgumentNullException(parameterName, message);
            }
        }

        /// <summary>
        /// This method check the parameter passed to it is null, empty or white space
        /// </summary>
        /// <param name="parameter">Value of the string parameter</param>
        /// <param name="parameterName">Name of the string parameter</param>
        /// <param name="message">Error message</param>
        public static void NotNullOrWhiteSpace(this string parameter, string parameterName, string message = null)
        {
            if (string.IsNullOrWhiteSpace(parameter))
            {
                if (string.IsNullOrWhiteSpace(message))
                    throw new ArgumentNullException(parameterName);
                else
                    throw new ArgumentNullException(parameterName, message);
            }
        }
    }
}


text:
from .health_information import HealthInformation

class HealthEvent(HealthInformation):
    """Represents health information reported on a health entity, such as
    cluster, application or node, with additional metadata added by the
    Health Manager.
    .

    :param source_id: The source name which identifies the
     client/watchdog/system component which generated the health information.
    :type source_id: str
    :param property: The property of the health information. An entity can
     have health reports for different properties.
     The property is a string and not a fixed enumeration to allow the
     reporter flexibility to categorize the state condition that triggers the
     report.
     For example, a reporter with SourceId "LocalWatchdog" can monitor the
     state of the available disk on a node,
     so it can report "AvailableDisk" property on that node.
     The same reporter can monitor the node connectivity, so it can report a
     property "Connectivity" on the same node.
     In the health store, these reports are treated as separate health events
     for the specified node.
     Together with the SourceId, the property uniquely identifies the health
     information.
    :type property: str
    :param health_state: Possible values include: 'Invalid', 'Ok', 'Warning',
     'Error', 'Unknown'
    :type health_state: str
    :param time_to_live_in_milli_seconds: The duration for which this health
     report is valid. This field is using ISO8601 format for specifying the
     duration.
     When clients report periodically, they should send reports with higher
     frequency than time to live.
     If clients report on transition, they can set the time to live to
     infinite.
     When time to live expires, the health event that contains the health
     information
     is either removed from health store, if RemoveWhenExpired is true, or
     evaluated at error, if RemoveWhenExpired false.
     If not specified, time to live defaults to infinite value.
    :type time_to_live_in_milli_seconds: timedelta
    :param description: The description of the health information. It
     represents free text used to add human readable information about the
     report.
     The maximum string length for the description is 4096 characters.
     If the provided string is longer, it will be automatically truncated.
     When truncated, the last characters of the description contain a marker
     "[Truncated]", and total string size is 4096 characters.
     The presence of the marker indicates to users that truncation occurred.
     Note that when truncated, the description has less than 4096 characters
     from the original string.
    :type description: str
    :param sequence_number: The sequence number for this health report as a
     numeric string.
     The report sequence number is used by the health store to detect stale
     reports.
     If not specified, a sequence number is auto-generated by the health
     client when a report is added.
    :type sequence_number: str
    :param remove_when_expired: Value that indicates whether the report is
     removed from health store when it expires.
     If set to true, the report is remopved from the health store after it
     expires.
     If set to false, the report is treated as an error when expired. The
     value of this property is false by default.
     When clients report periodically, they should set RemoveWhenExpired false
     (default).
     This way, is the reporter has issues (eg. deadlock) and can't report, the
     entity is evaluated at error when the health report expires.
     This flags the entity as being in Error health state.
    :type remove_when_expired: bool
    :param is_expired: Returns true if the health event is expired, otherwise
     false.
    :type is_expired: bool
    :param source_utc_timestamp: The date and time when the health report was
     sent by the source.
    :type source_utc_timestamp: datetime
    :param last_modified_utc_timestamp: The date and time when the health
     report was last modified by the health store.
    :type last_modified_utc_timestamp: datetime
    :param last_ok_transition_at: If the current health state is 'Ok', this
     property returns the time at which the health report was first reported
     with 'Ok'.
     For periodic reporting, many reports with the same state may have been
     generated.
     This property returns the date and time when the first 'Ok' health report
     was received.
     If the current health state is 'Error' or 'Warning', returns the date and
     time at which the health state was last in 'Ok', before transitioning to
     a different state.
     If the health state was never 'Ok', the value will be zero date-time.
    :type last_ok_transition_at: datetime
    :param last_warning_transition_at: If the current health state is
     'Warning', this property returns the time at which the health report was
     first reported with 'Warning'. For periodic reporting, many reports with
     the same state may have been generated however, this property returns
     only the date and time at the first 'Warning' health report was received.
     If the current health state is 'Ok' or 'Error', returns the date and time
     at which the health state was last in 'Warning', before transitioning to
     a different state.
     If the health state was never 'Warning', the value will be zero date-time.
    :type last_warning_transition_at: datetime
    :param last_error_transition_at: If the current health state is 'Error',
     this property returns the time at which the health report was first
     reported with 'Error'. For periodic reporting, many reports with the
     same state may have been generated however, this property returns only
     the date and time at the first 'Error' health report was received.
     If the current health state is 'Ok' or 'Warning', returns the date and
     time at which the health state was last in 'Error', before transitioning
     to a different state.
     If the health state was never 'Error', the value will be zero date-time.
    :type last_error_transition_at: datetime
    """

    _validation = {
        'source_id': {'required': True},
        'property': {'required': True},
        'health_state': {'required': True},
    }

    _attribute_map = {
        'source_id': {'key': 'SourceId', 'type': 'str'},
        'property': {'key': 'Property', 'type': 'str'},
        'health_state': {'key': 'HealthState', 'type': 'str'},
        'time_to_live_in_milli_seconds': {'key': 'TimeToLiveInMilliSeconds', 'type': 'duration'},
        'description': {'key': 'Description', 'type': 'str'},
        'sequence_number': {'key': 'SequenceNumber', 'type': 'str'},
        'remove_when_expired': {'key': 'RemoveWhenExpired', 'type': 'bool'},
        'is_expired': {'key': 'IsExpired', 'type': 'bool'},
        'source_utc_timestamp': {'key': 'SourceUtcTimestamp', 'type': 'iso-8601'},
        'last_modified_utc_timestamp': {'key': 'LastModifiedUtcTimestamp', 'type': 'iso-8601'},
        'last_ok_transition_at': {'key': 'LastOkTransitionAt', 'type': 'iso-8601'},
        'last_warning_transition_at': {'key': 'LastWarningTransitionAt', 'type': 'iso-8601'},
        'last_error_transition_at': {'key': 'LastErrorTransitionAt', 'type': 'iso-8601'},
    }

    def __init__(self, source_id, property, health_state, time_to_live_in_milli_seconds=None, description=None, sequence_number=None, remove_when_expired=None, is_expired=None, source_utc_timestamp=None, last_modified_utc_timestamp=None, last_ok_transition_at=None, last_warning_transition_at=None, last_error_transition_at=None):
        super(HealthEvent, self).__init__(source_id=source_id, property=property, health_state=health_state, time_to_live_in_milli_seconds=time_to_live_in_milli_seconds, description=description, sequence_number=sequence_number, remove_when_expired=remove_when_expired)
        self.is_expired = is_expired
        self.source_utc_timestamp = source_utc_timestamp
        self.last_modified_utc_timestamp = last_modified_utc_timestamp
        self.last_ok_transition_at = last_ok_transition_at
        self.last_warning_transition_at = last_warning_transition_at
        self.last_error_transition_at = last_error_transition_at


text:
<?php

namespace kvibes\SeleyaBundle\Repository;

use Doctrine\ORM\EntityRepository;

class FacultyRepository extends EntityRepository
{
    public function getFacultiesWithRecords()
    {
        $faculties = array();
        $qb = $this->getEntityManager()->createQueryBuilder();
        $results = $qb->select('f, count(r)')
                      ->from('SeleyaBundle:Faculty', 'f')
                      ->join('f.courses', 'c')
                      ->join('c.records', 'r')
                      ->where('r.visible=1')
                      ->groupBy('f')
                      ->orderBy('f.name', 'ASC')
                      ->getQuery()
                      ->getResult();

        foreach ($results as $result) {
            $faculties[] = array(
                'data'        => $result[0],
                'recordCount' => $result[1]
            );
        }

        return $faculties;
    }
}


text:
class SMergeTreeView	: public SCompoundWidget
{
public:
	virtual ~SMergeTreeView() {}

	SLATE_BEGIN_ARGS(SMergeTreeView)
	{}
	SLATE_END_ARGS()

	void Construct(	const FArguments InArgs
					, const FBlueprintMergeData& InData
					, FOnMergeNodeSelected SelectionCallback
					, TArray< TSharedPtr<FBlueprintDifferenceTreeEntry> >& OutTreeEntries
					, TArray< TSharedPtr<FBlueprintDifferenceTreeEntry> >& OutRealDifferences
					, TArray< TSharedPtr<FBlueprintDifferenceTreeEntry> >& OutConflicts);
private:
	void HighlightDifference( FSCSIdentifier VarName, FPropertySoftPath Property );

	TSharedRef<FSCSDiff>& GetRemoteView();
	TSharedRef<FSCSDiff>& GetBaseView();
	TSharedRef<FSCSDiff>& GetLocalView();

	FBlueprintMergeData Data;
	TArray< TSharedRef<FSCSDiff> > SCSViews;

	FSCSDiffRoot MergeConflicts;
	int CurrentMergeConflict;

	FSCSDiffRoot DifferingProperties;
	int CurrentDifference;
};


text:
package io.continuum.knit

import java.io.File
import java.util.Collections
import java.net._

import org.apache.hadoop.fs.Path
import org.apache.hadoop.fs.FileSystem
import org.apache.hadoop.yarn.api.ApplicationConstants
import org.apache.hadoop.yarn.api.records._
import org.apache.hadoop.yarn.client.api.AMRMClient.ContainerRequest
import org.apache.hadoop.yarn.client.api.{AMRMClient, NMClient}
import org.apache.hadoop.yarn.conf.YarnConfiguration
import org.apache.hadoop.yarn.util.Records
import org.apache.hadoop.security.{Credentials, UserGroupInformation}
import org.apache.hadoop.yarn.exceptions.ApplicationAttemptNotFoundException

import io.continuum.knit.Utils._
import io.continuum.knit.ApplicationMasterArguments.{parseArgs}

import scala.collection.JavaConverters._
import scala.collection.mutable.{ArrayBuffer, HashMap}

object ApplicationMaster {

  def main(args: Array[String]) {

    implicit val conf = new YarnConfiguration()
    val fs = FileSystem.get(conf)

    val parsedArgs = parseArgs(args)
    println(parsedArgs)

    val pythonEnv = parsedArgs.pythonEnv
    val numContainers = parsedArgs.numContainers
    val shellCMD = parsedArgs.command
    val vCores = parsedArgs.virtualCores
    val mem = parsedArgs.memory
    val files = parsedArgs.files

    val stagingDir = ".knitDeps"
    val user = sys.env.get("KNIT_USER")
    val stagingDirPath = new Path(System.getenv("KNIT_YARN_STAGING_DIR"))

    println(s"User: $user StagingDir: $stagingDirPath")
    println("Running command in container: " + shellCMD)
    val cmd = List(
      shellCMD +
        " 1>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stdout" +
        " 2>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stderr"
    )
    println(cmd)

    // Create a client to talk to the RM
    val rmClient = AMRMClient.createAMRMClient().asInstanceOf[AMRMClient[ContainerRequest]]
    rmClient.init(conf)
    rmClient.start()
    val amRMResponse = rmClient.registerApplicationMaster("", 0, "")

    val maxMem = amRMResponse.getMaximumResourceCapability.getMemory
    val maxCores = amRMResponse.getMaximumResourceCapability.getVirtualCores

    println(s"Max memory: $maxMem, Max vCores: $maxCores")

    //create a client to talk to NM
    val nmClient = NMClient.createNMClient()
    nmClient.init(conf)
    nmClient.start()

    val priority = Records.newRecord(classOf[Priority])
    priority.setPriority(0)

    //resources needed by each container
    val resource = Records.newRecord(classOf[Resource])
    println(s"Request: $mem MB of RAM and $vCores number of coress ")
    resource.setMemory(mem)
    resource.setVirtualCores(vCores)

    //request for containers
    for ( i <- 1 to numContainers) {
      val containerAsk = new ContainerRequest(resource,null,null,priority)
      println(s"Requesting Container: $i with Resources: $resource")
      println(s"Requested container ask: $containerAsk")
      rmClient.addContainerRequest(containerAsk)
    }

    var responseId = 0
    var completedContainers = 0
    try {
      while (completedContainers < numContainers) {

        val localResources = HashMap[String, LocalResource]()
        val env = collection.mutable.Map[String, String]()

        //setup local resources
        if (files.nonEmpty) {
          for (file <- files) {
            val name = file.getName
            println(s"Pulling File: $name")
            val localfile = Records.newRecord(classOf[LocalResource])
            val HDFS_FILE_PATH = new Path(stagingDirPath, name).makeQualified(fs.getUri, fs.getWorkingDirectory)
            setUpLocalResource(HDFS_FILE_PATH, localfile)
            localResources(name) = localfile
          }
        }

        //setup python resources
        if (pythonEnv.nonEmpty) {
          val appMasterPython = Records.newRecord(classOf[LocalResource])
          val envFile = new java.io.File(pythonEnv)
          val envZip = envFile.getName
          val envName = envZip.split('.').init(0)
          val PYTHON_ZIP = new Path(stagingDirPath, envZip).makeQualified(fs.getUri, fs.getWorkingDirectory)
          setUpLocalResource(PYTHON_ZIP, appMasterPython, archived = true)
          // set up local ENV
          env("PYTHON_BIN") = s"./PYTHON_DIR/$envName/bin/python"
          env("CONDA_PREFIX") = s"./PYTHON_DIR/$envName/"
          localResources("PYTHON_DIR") = appMasterPython
        }

        setUpEnv(env)

        val response = rmClient.allocate(0.1f)
        responseId += 1
        for (container <- response.getAllocatedContainers.asScala) {
          val ctx =
            Records.newRecord(classOf[ContainerLaunchContext])
          ctx.setCommands(
            List(
              shellCMD +
                " 1>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stdout" +
                " 2>" + ApplicationConstants.LOG_DIR_EXPANSION_VAR + "/stderr"
            ).asJava
          )

          ctx.setLocalResources(localResources.asJava)
          ctx.setEnvironment(env.asJava)

          System.out.println("Launching container " + container)
          try {
            nmClient.startContainer(container, ctx)
          } catch {
            case e: Exception => println(s"Exception $e")
          }
        }

        for (status <- response.getCompletedContainersStatuses.asScala) {
          println("completed" + status.getContainerId)
          completedContainers += 1

        }

        Thread.sleep(1000)
      }
    } catch {
      case e: org.apache.hadoop.yarn.exceptions.ApplicationAttemptNotFoundException =>
        println(s"Yarn Application is possibly being killed: $e")
    }

    rmClient.unregisterApplicationMaster(
      FinalApplicationStatus.SUCCEEDED, "", "")
    rmClient.stop()

  }

}