text:
<?php

namespace nabu\data\site\base;

use \nabu\core\exceptions\ENabuCoreException;
use \nabu\data\CNabuDataObject;
use \nabu\data\lang\CNabuLanguage;
use \nabu\data\lang\CNabuLanguageList;
use \nabu\data\lang\interfaces\INabuTranslated;
use \nabu\data\lang\interfaces\INabuTranslation;
use \nabu\data\lang\traits\TNabuTranslation;
use \nabu\data\site\CNabuSiteMapLanguage;
use \nabu\data\site\CNabuSiteMapLanguageList;
use \nabu\db\CNabuDBInternalObject;

/**
 * Class to manage the entity Site Map Language stored in the storage named nb_site_map_lang.
 * @author Rafael Gutiérrez <rgutierrez@nabu-3.com>
 * @version 3.0.12 Surface
 * @package \nabu\data\site\base
 */
abstract class CNabuSiteMapLanguageBase extends CNabuDBInternalObject implements INabuTranslation
{
    use TNabuTranslation;

    /**
     * Instantiates the class. If you fill enough parameters to identify an instance serialized in the storage, then
     * the instance is deserialized from the storage.
     * @param mixed $nb_site_map An instance of CNabuSiteMapLanguageBase or another object descending from
     * \nabu\data\CNabuDataObject which contains a field named nb_site_map_id, or a valid ID.
     * @param mixed $nb_language An instance of CNabuSiteMapLanguageBase or another object descending from
     * \nabu\data\CNabuDataObject which contains a field named nb_language_id, or a valid ID.
     */
    public function __construct($nb_site_map = false, $nb_language = false)
    {
        if ($nb_site_map) {
            $this->transferMixedValue($nb_site_map, 'nb_site_map_id');
        }

        if ($nb_language) {
            $this->transferMixedValue($nb_language, 'nb_language_id');
        }

        parent::__construct();
    }

    /**
     * Get the file name and path where is stored the descriptor in JSON format.
     * @return string Return the file name with the full path
     */
    public static function getStorageDescriptorPath()
    {
        return preg_replace('/.php$/', '.json', __FILE__);
    }

    /**
     * Get the table name represented by this class
     * @return string Return the table name
     */
    public static function getStorageName()
    {
        return 'nb_site_map_lang';
    }

    /**
     * Gets SELECT sentence to load a single register from the storage.
     * @return string Return the sentence.
     */
    public function getSelectRegister()
    {
        return ($this->isValueNumeric('nb_site_map_id') && $this->isValueNumeric('nb_language_id'))
            ? $this->buildSentence(
                    'select * '
                    . 'from nb_site_map_lang '
                   . "where nb_site_map_id=%nb_site_map_id\$d "
                     . "and nb_language_id=%nb_language_id\$d "
              )
            : null;
    }

    /**
     * Query the storage to retrieve the full list of available languages (those that correspond to existent
     * translations) for $translated and returns a list with all languages.
     * @param mixed $translated Translated object or Id to retrieve languages.
     * @return CNabuLanguageList Returns a list of languages. If no languages are available, the list is empty.
     */
    public static function getLanguagesForTranslatedObject($translated)
    {
        $nb_site_map_id = nb_getMixedValue($translated, 'nb_site_map_id');
        if (is_numeric($nb_site_map_id)) {
            $retval = CNabuLanguage::buildObjectListFromSQL(
                    'nb_language_id',
                    'select l.* '
                    . 'from nb_language l, nb_site_map t1, nb_site_map_lang t2 '
                   . 'where t1.nb_site_map_id=t2.nb_site_map_id '
                     . 'and t1.nb_site_map_id=%nb_site_map_id$d '
                     . 'and l.nb_language_id=t2.nb_language_id ',
                    array(
                        'nb_site_map_id' => $nb_site_map_id
                    )
            );
        } else {
            $retval = new CNabuLanguageList();
        }

        return $retval;
    }

    /**
     * Query the storage to retrieve the full list of available translations for $translated and returns a list with
     * all translations.
     * @param mixed $translated Translated object or Id to retrieve translations.
     * @return CNabuSiteMapLanguageList Returns a list of translations. If no translations are available, the list is
     * empty.
     */
    public static function getTranslationsForTranslatedObject($translated)
    {
        $nb_site_map_id = nb_getMixedValue($translated, 'nb_site_map_id');
        if (is_numeric($nb_site_map_id)) {
            $retval = CNabuSiteMapLanguage::buildObjectListFromSQL(
                    'nb_language_id',
                    'select t2.* '
                    . 'from nb_language l, nb_site_map t1, nb_site_map_lang t2 '
                   . 'where t1.nb_site_map_id=t2.nb_site_map_id '
                     . 'and t1.nb_site_map_id=%nb_site_map_id$d '
                     . 'and l.nb_language_id=t2.nb_language_id ',
                    array(
                        'nb_site_map_id' => $nb_site_map_id
                    )
            );
            if ($translated instanceof INabuTranslated) {
                $retval->iterate(
                    function ($key, $nb_translation) use($translated) {
                        $nb_translation->setTranslatedObject($translated);
                        return true;
                    }
                );
            }
        } else {
            $retval = new CNabuSiteMapLanguageList();
        }

        return $retval;
    }

    /**
     * Get Site Map Id attribute value
     * @return int Returns the Site Map Id value
     */
    public function getSiteMapId() : int
    {
        return $this->getValue('nb_site_map_id');
    }

    /**
     * Sets the Site Map Id attribute value.
     * @param int $nb_site_map_id New value for attribute
     * @return CNabuDataObject Returns self instance to grant chained setters call.
     */
    public function setSiteMapId(int $nb_site_map_id) : CNabuDataObject
    {
        if ($nb_site_map_id === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$nb_site_map_id")
            );
        }
        $this->setValue('nb_site_map_id', $nb_site_map_id);

        return $this;
    }

    /**
     * Get Language Id attribute value
     * @return int Returns the Language Id value
     */
    public function getLanguageId() : int
    {
        return $this->getValue('nb_language_id');
    }

    /**
     * Sets the Language Id attribute value.
     * @param int $nb_language_id New value for attribute
     * @return CNabuDataObject Returns self instance to grant chained setters call.
     */
    public function setLanguageId(int $nb_language_id) : CNabuDataObject
    {
        if ($nb_language_id === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$nb_language_id")
            );
        }
        $this->setValue('nb_language_id', $nb_language_id);

        return $this;
    }

    /**
     * Get Site Map Lang Translation Status attribute value
     * @return null|string Returns the Site Map Lang Translation Status value
     */
    public function getTranslationStatus()
    {
        return $this->getValue('nb_site_map_lang_translation_status');
    }

    /**
     * Sets the Site Map Lang Translation Status attribute value.
     * @param string|null $translation_status New value for attribute
     * @return CNabuDataObject Returns self instance to grant chained setters call.
     */
    public function setTranslationStatus(string $translation_status = "E") : CNabuDataObject
    {
        $this->setValue('nb_site_map_lang_translation_status', $translation_status);

        return $this;
    }

    /**
     * Get Site Map Lang Title attribute value
     * @return null|string Returns the Site Map Lang Title value
     */
    public function getTitle()
    {
        return $this->getValue('nb_site_map_lang_title');
    }

    /**
     * Sets the Site Map Lang Title attribute value.
     * @param string|null $title New value for attribute
     * @return CNabuDataObject Returns self instance to grant chained setters call.
     */
    public function setTitle(string $title = null) : CNabuDataObject
    {
        $this->setValue('nb_site_map_lang_title', $title);

        return $this;
    }

    /**
     * Get Site Map Lang Subtitle attribute value
     * @return null|string Returns the Site Map Lang Subtitle value
     */
    public function getSubtitle()
    {
        return $this->getValue('nb_site_map_lang_subtitle');
    }

    /**
     * Sets the Site Map Lang Subtitle attribute value.
     * @param string|null $subtitle New value for attribute
     * @return CNabuDataObject Returns self instance to grant chained setters call.
     */
    public function setSubtitle(string $subtitle = null) : CNabuDataObject
    {
        $this->setValue('nb_site_map_lang_subtitle', $subtitle);

        return $this;
    }

    /**
     * Get Site Map Lang Content attribute value
     * @return null|string Returns the Site Map Lang Content value
     */
    public function getContent()
    {
        return $this->getValue('nb_site_map_lang_content');
    }

    /**
     * Sets the Site Map Lang Content attribute value.
     * @param string|null $content New value for attribute
     * @return CNabuDataObject Returns self instance to grant chained setters call.
     */
    public function setContent(string $content = null) : CNabuDataObject
    {
        $this->setValue('nb_site_map_lang_content', $content);

        return $this;
    }

    /**
     * Get Site Map Lang URL attribute value
     * @return null|string Returns the Site Map Lang URL value
     */
    public function getURL()
    {
        return $this->getValue('nb_site_map_lang_url');
    }

    /**
     * Sets the Site Map Lang URL attribute value.
     * @param string|null $url New value for attribute
     * @return CNabuDataObject Returns self instance to grant chained setters call.
     */
    public function setURL(string $url = null) : CNabuDataObject
    {
        $this->setValue('nb_site_map_lang_url', $url);

        return $this;
    }

    /**
     * Get Site Map Lang Image attribute value
     * @return null|string Returns the Site Map Lang Image value
     */
    public function getImage()
    {
        return $this->getValue('nb_site_map_lang_image');
    }

    /**
     * Sets the Site Map Lang Image attribute value.
     * @param string|null $image New value for attribute
     * @return CNabuDataObject Returns self instance to grant chained setters call.
     */
    public function setImage(string $image = null) : CNabuDataObject
    {
        $this->setValue('nb_site_map_lang_image', $image);

        return $this;
    }

    /**
     * Get Site Map Lang Match URL Fragment attribute value
     * @return null|string Returns the Site Map Lang Match URL Fragment value
     */
    public function getMatchURLFragment()
    {
        return $this->getValue('nb_site_map_lang_match_url_fragment');
    }

    /**
     * Sets the Site Map Lang Match URL Fragment attribute value.
     * @param string|null $match_url_fragment New value for attribute
     * @return CNabuDataObject Returns self instance to grant chained setters call.
     */
    public function setMatchURLFragment(string $match_url_fragment = null) : CNabuDataObject
    {
        $this->setValue('nb_site_map_lang_match_url_fragment', $match_url_fragment);

        return $this;
    }
}


text:
    Select

two

redpajama_set_name: RedPajamaGithub


text:
/**
 * @ngdoc function
 * @name controllers.function:Authentication
 * @description
 * Controller for handling /#/login and /#/logout routes.
 *
 * (app.js) verifies the user is authenticated and that the user session is not expired. If either condition is not true,
 * the user is redirected to /#/login and the Authentication controller.
 *
 * Methods for checking the session state are found in [js/shared/AuthService.js](/static/docs/api/shared.function:AuthService), which is referenced here as Authorization.
 *
 * #Login Modal Dialog
 *
 * The modal dialog prompting for username and password is found in templates/ui/index.html.
 *```
 *     <!-- login modal -->
 *     <div id="login-modal" class="modal fade">
 *         <div class="modal-dialog">
 *             <div class="modal-content" id="login-modal-content">
 *             </div><!-- modal-content -->
 *         </div><!-- modal-dialog -->
 *     </div><!-- modal -->
 *```
 * HTML for the login form is generated, compiled and injected into

 by the controller. This is done to associate the form with the controller's scope. Because
 *

 is outside of the ng-view container, it gets associated with $rootScope by default. In the controller we create a new scope using $rootScope.$new() and associate
 * that with the login form. Doing this each time the controller is instantiated insures the form is clean and not pre-populated with a prior user's username and password.
 *
 * Just before the release of 2.0 a bug was discovered where clicking logout and then immediately clicking login without providing a username and password would successfully log
 * the user back into the app. Implementing the above approach fixed this, forcing a new username/password to be entered each time the login dialog appears.
 *
 * #Login Workflow
 *
 * When the the login button is clicked, the following occurs:
 *
 * - Call Authorization.retrieveToken(username, password) - sends a POST request to /api/v2/authtoken to get a new token value.
 * - Call Authorization.setToken(token, expires) to store the token and exipration time in a session cookie.
 * - Start the expiration timer by calling the init() method of [js/shared/Timer.js](/static/docs/api/shared.function:Timer)
 * - Get user informaton by calling Authorization.getUser() - sends a GET request to /api/v2/me
 * - Store user information in the session cookie by calling Authorization.setUser().
 * - Get the license by calling ConfigService.getConfig() - sends a GET request to /api/vi/config
 * - Stores the license object in memory by calling CheckLicense.test(). This adds the version and a tested flag to the license object. The tested flag is initially set to false. Additionally, the pendoService and FeaturesService are called to initiate the other startup services
 *
 * Note that there is a session timer kept on the server side as well as the client side. Each time an API request is made, app.js calls
 * Timer.isExpired(). This verifies the UI does not think the session is expired, and if not, moves the expiration time into the future. The number of
 * seconds between API calls before a session is considered expired is set in config.js as session_timeout.
 *
 * @Usage
 * This is usage information.
 */

export default ['$log', '$cookies', '$compile', '$rootScope',
    '$location', 'Authorization', 'Alert', 'Wait', 'Timer',
    'Empty', '$scope', 'pendoService', 'ConfigService',
    'CheckLicense', 'FeaturesService', 'SocketService',
    function ($log, $cookies, $compile, $rootScope, $location,
        Authorization, Alert, Wait, Timer, Empty,
        scope, pendoService, ConfigService, CheckLicense, FeaturesService,
        SocketService) {
    var lastPath, lastUser, sessionExpired, loginAgain, preAuthUrl;

    loginAgain = function() {
        setTimeout(function() {
            $location.path('/logout');
        }, 1000);
    };

    scope.sessionExpired = (Empty($rootScope.sessionExpired)) ? $cookies.get('sessionExpired') : $rootScope.sessionExpired;
    scope.login_username = '';
    scope.login_password = '';

    lastPath = function () {
        return (Empty($rootScope.lastPath)) ? $cookies.get('lastPath') : $rootScope.lastPath;
    };

    lastUser = function(){
        if(!Empty($rootScope.lastUser) && $rootScope.lastUser === $rootScope.current_user.id){
            return true;
        }
        else {
            return false;
        }
    };

    preAuthUrl = $rootScope.preAuthUrl;

    $log.debug('User session expired: ' + sessionExpired);
    $log.debug('Last URL: ' + lastPath());

    $rootScope.loginConfig.promise.then(function () {
        if ($AnsibleConfig.custom_logo) {
            scope.customLogo = $rootScope.custom_logo;
            scope.customLogoPresent = true;
        } else {
            scope.customLogo = "logo-login.svg";
            scope.customLogoPresent = false;
        }
        scope.customLoginInfo = $AnsibleConfig.custom_login_info;
        scope.customLoginInfoPresent = (scope.customLoginInfo) ? true : false;
    });

    if (scope.removeAuthorizationGetLicense) {
        scope.removeAuthorizationGetLicense();
    }
    scope.removeAuthorizationGetLicense = scope.$on('AuthorizationGetLicense', function() {
        ConfigService.getConfig().then(function(){
                CheckLicense.test();
                pendoService.issuePendoIdentity();
                FeaturesService.get();
                Wait("stop");
                if(!Empty(preAuthUrl)){
                    $location.path(preAuthUrl);
                    delete $rootScope.preAuthUrl;
                }
                else {
                    if (lastPath() && lastUser()) {
                        // Go back to most recent navigation path
                        $location.path(lastPath());
                    } else {
                        $location.url('/home');
                    }
                }
            })
            .catch(function () {
                Wait('stop');
                Alert('Error', 'Failed to access license information. GET returned status: ' + status, 'alert-danger', loginAgain);
            });
    });

    if (scope.removeAuthorizationGetUser) {
        scope.removeAuthorizationGetUser();
    }
    scope.removeAuthorizationGetUser = scope.$on('AuthorizationGetUser', function() {
        // Get all the profile/access info regarding the logged in user
        Authorization.getUser()
            .success(function (data) {
                Authorization.setUserInfo(data);
                Timer.init().then(function(timer){
                    $rootScope.sessionTimer = timer;
                    SocketService.init();
                    $rootScope.user_is_superuser = data.results[0].is_superuser;
                    $rootScope.user_is_system_auditor = data.results[0].is_system_auditor;
                    scope.$emit('AuthorizationGetLicense');
                });
            })
            .error(function (data, status) {
                Authorization.logout().then( () => {
                    Wait('stop');
                    Alert('Error', 'Failed to access user information. GET returned status: ' + status, 'alert-danger', loginAgain);
                });
            });
    });

    // Call the API to get an auth token
    scope.systemLogin = function (username, password) {
        $('.api-error').empty();
        if (Empty(username) || Empty(password)) {
            scope.reset();
            scope.attemptFailed = true;
            $('#login-username').focus();
        } else {
            Wait('start');
            Authorization.retrieveToken(username, password)
                .then(function (data) {
                    $('#login-modal').modal('hide');
                    Authorization.setToken(data.data.token, data.data.expires);
                    scope.$emit('AuthorizationGetUser');
                },
                function (data) {
                    var key;
                    Wait('stop');
                    if (data && data.data && data.data.non_field_errors && data.data.non_field_errors.length === 0) {
                        // show field specific errors returned by the API
                        for (key in data.data) {
                            scope[key + 'Error'] = data.data[key][0];
                        }
                    } else {
                        scope.reset();
                        scope.attemptFailed = true;
                        $('#login-username').focus();
                    }
                });
        }
    };
}];


text:
/*
 * From: @(#)getent.c	5.1 (Berkeley) 2/28/91
 */
char ge_rcsid[] =
  "$Id: getent.c,v 1.3 1996/08/15 06:23:28 dholland Exp $";

/*
 * Copyright (c) 1991 Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms are permitted provided
 * that: (1) source distributions retain this entire copyright notice and
 * comment, and (2) distributions including binaries display the following
 * acknowledgement:  ``This product includes software developed by the
 * University of California, Berkeley and its contributors'' in the
 * documentation or other materials provided with the distribution and in
 * all advertising materials mentioning features or use of this software.
 * Neither the name of the University nor the names of its contributors may
 * be used to endorse or promote products derived from this software without
 * specific prior written permission.
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 */

#include <stdlib.h>

int getent(char *cp, char *name) {
    (void)cp;
    (void)name;
    return 0;
}

char *getstr(char *cp, char **cpp) {
    (void)cp;
    (void)cpp;
    return NULL;
}


text:
class ConstDemo

{
int empId;
int empSalary;
String empName;
ConstDemo()  //without parameter
{
empId=0;
empSalary=0.0f;
}

ConstDemo(int a,float b)    //with parameter
{
empId=a;
empSalary=b;
}

public static void main(String []args)
{
ConstDemo obj=new ConstDemo();
ConstDemo obj=new ConstDemo(1,2.5f);
}
}


text:
package google

import (
	"testing"

	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccComputeRegionNetworkEndpointGroup_negWithServerlessDeployment(t *testing.T) {
	t.Parallel()

	context := map[string]interface{}{
		"random_suffix": randString(t, 10),
	}

	vcrTest(t, resource.TestCase{
		PreCheck:     func() { testAccPreCheck(t) },
		Providers:    testAccProviders,
		CheckDestroy: testAccCheckComputeRegionNetworkEndpointGroupDestroyProducer(t),
		Steps: []resource.TestStep{
			{
				Config: testAccComputeRegionNetworkEndpointGroup_negWithServerlessDeployment(context),
			},
			{
				ResourceName:            "google_compute_region_network_endpoint_group.test_neg",
				ImportState:             true,
				ImportStateVerify:       true,
				ImportStateVerifyIgnore: []string{"region"},
			},
		},
	})
}

func testAccComputeRegionNetworkEndpointGroup_negWithServerlessDeployment(context map[string]interface{}) string {
	return Nprintf(`
resource "google_api_gateway_api" "api_gw" {
	api_id = "tf-test-%{random_suffix}"
}

resource "google_api_gateway_api_config" "api_gw" {
	api = google_api_gateway_api.api_gw.api_id
	api_config_id = "tf-test-config-%{random_suffix}"

	openapi_documents {
		document {
			path = "spec.yaml"
			contents = filebase64("test-fixtures/apigateway/openapi.yaml")
		}
	}

	lifecycle {
		create_before_destroy = true
	}
}

resource "google_api_gateway_gateway" "api_gw" {
	api_config = google_api_gateway_api_config.api_gw.id
	gateway_id = "tf-test-%{random_suffix}"
}

resource "google_compute_region_network_endpoint_group" "test_neg" {
	name                  = "test-serverless-neg"
	network_endpoint_type = "SERVERLESS"
	region                = "us-central1"
	serverless_deployment {
		platform = "apigateway.googleapis.com"
		url_mask = format("<gateway>%s/hello", trimprefix(google_api_gateway_gateway.api_gw.default_hostname, "tf-test-%{random_suffix}"))
	}
}
`, context)
}


text:
package cmd

import (
	"io"

	"github.com/spf13/cobra"

	"k8s.io/kubernetes/pkg/api"
	cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
	"k8s.io/kubernetes/pkg/kubectl/resource"
)

const (
	patch_long = `Update field(s) of a resource using strategic merge patch

JSON and YAML formats are accepted.

Please refer to the models in https://htmlpreview.github.io/?https://github.com/GoogleCloudPlatform/kubernetes/HEAD/docs/api-reference/definitions.html to find if a field is mutable.`
	patch_example = `
// Partially update a node using strategic merge patch
kubectl patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'

// Update a container's image; spec.containers[*].name is required because it's a merge key
kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve-hostname","image":"new image"}]}}'`
)

func NewCmdPatch(f *cmdutil.Factory, out io.Writer) *cobra.Command {
	cmd := &cobra.Command{
		Use:     "patch TYPE NAME -p PATCH",
		Short:   "Update field(s) of a resource by stdin.",
		Long:    patch_long,
		Example: patch_example,
		Run: func(cmd *cobra.Command, args []string) {
			cmdutil.CheckErr(cmdutil.ValidateOutputArgs(cmd))
			shortOutput := cmdutil.GetFlagString(cmd, "output") == "name"
			err := RunPatch(f, out, cmd, args, shortOutput)
			cmdutil.CheckErr(err)
		},
	}
	cmd.Flags().StringP("patch", "p", "", "The patch to be applied to the resource JSON file.")
	cmd.MarkFlagRequired("patch")
	cmdutil.AddOutputFlagsForMutation(cmd)
	return cmd
}

func RunPatch(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, shortOutput bool) error {
	cmdNamespace, _, err := f.DefaultNamespace()
	if err != nil {
		return err
	}

	patch := cmdutil.GetFlagString(cmd, "patch")
	if len(patch) == 0 {
		return cmdutil.UsageError(cmd, "Must specify -p to patch")
	}

	mapper, typer := f.Object()
	r := resource.NewBuilder(mapper, typer, f.ClientMapperForCommand()).
		ContinueOnError().
		NamespaceParam(cmdNamespace).DefaultNamespace().
		ResourceTypeOrNameArgs(false, args...).
		Flatten().
		Do()
	err = r.Err()
	if err != nil {
		return err
	}
	mapping, err := r.ResourceMapping()
	if err != nil {
		return err
	}
	client, err := f.RESTClient(mapping)
	if err != nil {
		return err
	}

	infos, err := r.Infos()
	if err != nil {
		return err
	}
	name, namespace := infos[0].Name, infos[0].Namespace

	helper := resource.NewHelper(client, mapping)
	_, err = helper.Patch(namespace, name, api.StrategicMergePatchType, []byte(patch))
	if err != nil {
		return err
	}
	cmdutil.PrintSuccess(mapper, shortOutput, out, "", name, "patched")
	return nil
}


text:
function HMopenmeeg_cm()
% HMopenmeeg_cm

[srcdir,~,~] = fileparts(mfilename('fullpath'));

cfg = [];
cfg.ft_prepare_headmodel.method = 'openmeeg';
cfg.units = 'cm';

save(fullfile(srcdir, [strrep(mfilename,'_','-') '.mat']),'cfg');

end


text:
<?php

namespace Itsup\Api\EndPoint;

use Itsup\Api\Model\AbstractModel;
use Itsup\Api\Model\Group;

/**
 * @author Cyril LEGRAND <cyril@sctr.net>
 */
class GroupEndPoint extends AbstractEntityEndPoint
{
    /**
     * The model name.
     *
     * @var string
     */
    protected $model = 'Group';

    /**
     * @param Group $group
     *
     * @return array|bool|AbstractModel
     */
    public function findAdZones(Group $group)
    {
        return $this->handleRequest(
            'GET',
            $this->getRoute().'/'.$group->getId().'/zones',
            [],
            'array'
        );
    }
}


text:
.. header:: COMP 447: Intrusion Detection
.. footer:: COMP 447: Intrusion Detection

.. index::
    Intrusion Detection
    Graduate
    COMP 447

#############################
COMP 447: Intrusion Detection
#############################

******************
Course Information
******************

.. sidebar:: General Information

    **Credit Hours**

    * 3

    **Prerequisites**

    * :doc:`comp271`

About
=====

This course will cover techniques for detecting the unusual usage patterns that typically signal a break-in.

Description
===========

This course will cover techniques for detecting the unusual usage patterns that typically signal a break-in. The course will also consider differences in the detection of local intruders versus intrusion over networks. Finally, issues in the prosecution of those breaking into computers, particularly evidentiary issues are explored.

Outcome
=======

Students will learn to configure ID systems (eg., snort) and analyze their output. They will also understand both network-based and host-based monitoring techniques.

*******
Syllabi
*******

|see-syllabi|


text:
cask "google-drive-file-stream" do
  version "44.0.14"
  sha256 :no_check

  url "https://dl.google.com/drive-file-stream/GoogleDriveFileStream.dmg"
  name "Google Drive File Stream"
  homepage "https://www.google.com/drive/"

  depends_on macos: ">= :el_capitan"

  pkg "GoogleDriveFileStream.pkg"

  uninstall login_item: "Google Drive File Stream",
            quit:       "com.google.drivefs",
            pkgutil:    [
              "com.google.drivefs",
              "com.google.drivefs.shortcuts",
              "com.google.pkg.Keystone",
            ],
            launchctl:  [
              "com.google.keystone.agent",
              "com.google.keystone.system.agent",
              "com.google.keystone.daemon",
              "com.google.keystone.xpcservice",
              "com.google.keystone.system.xpcservice",
            ]

  zap trash: [
    "~/Library/Application Support/Google/DriveFS",
    "~/Library/Caches/com.google.drivefs",
    "~/Library/Preferences/Google Drive File Stream Helper.plist",
    "~/Library/Preferences/com.google.drivefs.plist",
  ]

  caveats <<~EOS
    Although #{token} may be installed alongside Google Backup and Sync, you should not use the same account with both.

      https://support.google.com/a/answer/7496409#allowboth
  EOS
end


text:
<?php

final class PhabricatorMailManagementReceiveTestWorkflow
  extends PhabricatorMailManagementWorkflow {

  protected function didConstruct() {
    $this
      ->setName('receive-test')
      ->setSynopsis(
        pht(
          'Simulate receiving mail. This is primarily useful if you are '.
          'developing new mail receivers.'))
      ->setExamples(
        "**receive-test** --as alincoln --to D123 < body.txt")
      ->setArguments(
        array(
          array(
            'name'    => 'as',
            'param'   => 'user',
            'help'    => 'Act as the specified user.',
          ),
          array(
            'name'    => 'from',
            'param'   => 'email',
            'help'    => 'Simulate mail delivery "From:" the given user.',
          ),
          array(
            'name'    => 'to',
            'param'   => 'object',
            'help'    => 'Simulate mail delivery "To:" the given object.',
          ),
        ));
  }

  public function execute(PhutilArgumentParser $args) {
    $console = PhutilConsole::getConsole();

    $as = $args->getArg('as');
    if (!$as) {
      throw new PhutilArgumentUsageException(
        pht("Use '--as' to specify the acting user."));
    }

    $user = id(new PhabricatorPeopleQuery())
      ->setViewer($this->getViewer())
      ->withUsernames(array($as))
      ->executeOne();
    if (!$user) {
      throw new PhutilArgumentUsageException(
        pht("No such user '%s' exists.", $as));
    }

    $to = $args->getArg('to');
    if (!$to) {
      throw new PhutilArgumentUsageException(
        "Use '--to' to specify the receiving object or email address.");
    }

    $from = $args->getArg('from');
    if (!$from) {
      $from = $user->loadPrimaryEmail()->getAddress();
    }

    $console->writeErr("%s\n", pht('Reading message body from stdin...'));
    $body = file_get_contents('php://stdin');

    $received = new PhabricatorMetaMTAReceivedMail();
    $header_content = array(
      'Message-ID' => Filesystem::readRandomCharacters(12),
      'From'       => $from,
    );

    if (preg_match('/.+@.+/', $to)) {
      $header_content['to'] = $to;
    } else {
      // We allow the user to use an object name instead of a real address
      // as a convenience. To build the mail, we build a similar message and
      // look for a receiver which will accept it.
      $pseudohash = PhabricatorObjectMailReceiver::computeMailHash('x', 'y');
      $pseudomail = id(new PhabricatorMetaMTAReceivedMail())
        ->setHeaders(
          array(
            'to' => $to.'+1+'.$pseudohash,
          ));

      $receivers = id(new PhutilSymbolLoader())
        ->setAncestorClass('PhabricatorMailReceiver')
        ->loadObjects();

      $receiver = null;
      foreach ($receivers as $possible_receiver) {
        if (!$possible_receiver->isEnabled()) {
          continue;
        }
        if (!$possible_receiver->canAcceptMail($pseudomail)) {
          continue;
        }
        $receiver = $possible_receiver;
        break;
      }

      if (!$receiver) {
        throw new Exception(
          pht("No configured mail receiver can accept mail to '%s'.", $to));
      }

      if (!($receiver instanceof PhabricatorObjectMailReceiver)) {
        $class = get_class($receiver);
        throw new Exception(
          "Receiver '%s' accepts mail to '%s', but is not a ".
          "subclass of PhabricatorObjectMailReceiver.",
          $class,
          $to);
      }

      $object = $receiver->loadMailReceiverObject($to, $user);
      if (!$object) {
        throw new Exception(pht("No such object '%s'!", $to));
      }

      $hash = PhabricatorObjectMailReceiver::computeMailHash(
        $object->getMailKey(),
        $user->getPHID());

      $header_content['to'] = $to.'+'.$user->getID().'+'.$hash.'@test.com';
    }

    $received->setHeaders($header_content);
    $received->setBodies(
      array(
        'text' => $body,
      ));

    $received->save();
    $received->processReceivedMail();

    $console->writeErr(
      "%s\n\n    phabricator/ $ ./bin/mail show-inbound --id %d\n\n",
      pht("Mail received! You can view details by running this command:"),
      $received->getID());
  }

}


text:
package util;

import java.io.PrintStream;
import java.util.Collection;

import static resource.Configuration.DEBUG;
import resource.Configuration;
import soot.G;

public class Debugger {

    private interface Style {

        String getCode();

    }

    public static class Header {

        private final String header;
        private final String subheader;

        public Header(String header, String subheader) {
            this.header = header;
            this.subheader = subheader;
        }

        public Header(String header) {
            this.header = header;
            this.subheader = "";
        }

    }

    protected enum BGColor implements Style {
        BLACK(0),
        RED(1),
        GREEN(2),
        YELLOW(3),
        BLUE(4),
        MAGENTA(5),
        CYAN(6),
        WHITE(7);

        private int code = 0;

        private BGColor(int code) {
            this.code = code;
        }

        public String getCode() {
            if (highIntensity()) {
                return String.valueOf(100 + code);
            }
            return String.valueOf(40 + code);
        }

    }

    protected enum TextStyle implements Style {
        RESET(0),
        BOLD(1),
        ITALIC(3),
        UNDERLINE(4),
        NEGATIVE(7),
        CONCEAL(8),
        CROSSEDOUT(9),
        DOUBLE(21);

        private int code = 0;

        private TextStyle(int code) {
            this.code = code;
        }

        public String getCode() {
            return String.valueOf(code);
        }

    }

    protected enum TextColor implements Style {
        BLACK(0),
        RED(1),
        GREEN(2),
        YELLOW(3),
        BLUE(4),
        MAGENTA(5),
        CYAN(6),
        WHITE(7);

        private int code = 0;

        private TextColor(int code) {
            this.code = code;
        }

        public String getCode() {
            if (highIntensity()) {
                return String.valueOf(90 + code);
            }
            return String.valueOf(30 + code);
        }

    }

    private static final String ESC = (char) 27 + "[";
    private static final PrintStream OUT = G.v().out;

    public static void show(Header header) {
        formatAndShow(header.header, header.subheader, new String[] {}, null);
    }

    public static void show(String txt) {
        formatAndShow("", "", new String[] { txt }, null);
    }

    public static void show(Header header, String txt) {
        formatAndShow(header.header,
                      header.subheader,
                      new String[] { txt },
                      null);
    }

    public static void show(Header header,
                            String txt,
                            RuntimeException exception) {
        formatAndShow(header.header,
                      header.subheader,
                      new String[] { txt },
                      exception);
    }

    public static void show(Collection<String> txts) {
        formatAndShow("", "", txts.toArray(new String[] {}), null);
    }

    public static void show(Header header, Collection<String> txts) {
        formatAndShow(header.header,
                      header.subheader,
                      txts.toArray(new String[] {}),
                      null);
    }

    public static void show(Header header,
                            Collection<String> txts,
                            RuntimeException exception) {
        formatAndShow(header.header,
                      header.subheader,
                      txts.toArray(new String[] {}),
                      exception);
    }

    public static void show(String[] txts) {
        formatAndShow("", "", txts, null);
    }

    public static void show(Header header, String[] txts) {
        formatAndShow(header.header, header.subheader, txts, null);
    }

    public static void show(Header header,
                            String[] txts,
                            RuntimeException exception) {
        formatAndShow(header.header, header.subheader, txts, exception);
    }

    public static void showDependingOnError(Header header,
                                            String[] txts,
                                            RuntimeException exception) {
        if (exception != null)
            formatAndShow(header.header, header.subheader, txts, exception);
    }

    private static void formatAndShow(String title,
                                      String position,
                                      String[] txts,
                                      RuntimeException exception) {
        if (DEBUG) {
            String header =
                "DEBUG"
                        + ((title.isEmpty()) ? ""
                                            : (" - " + reduceString(title, 8)));
            String subheader =
                (position.isEmpty()) ? ""
                                    : ("[ " + reduceString(position, 4) + " ]");
            OUT.println();
            OUT.println(generateStyle(new Style[] { TextColor.BLUE,
                                                   TextStyle.BOLD,
                                                   TextStyle.DOUBLE })
                        + header
                        + repeat(Configuration.DISPLAY_SIZE - header.length(),
                                 " ")
                        + generateStyle(new Style[] { TextStyle.RESET }));
            if (!subheader.isEmpty()) {
                OUT.println(generateStyle(new Style[] { TextColor.BLUE,
                                                       TextStyle.BOLD })
                            + repeat(Configuration.DISPLAY_SIZE
                                             - subheader.length(),
                                     " ")
                            + subheader
                            + generateStyle(new Style[] { TextStyle.RESET }));
            }
            for (int i = 0; i < txts.length; i++) {
                OUT.println(generateStyle(new Style[] { TextColor.BLUE })
                            + txts[i]
                            + generateStyle(new Style[] { TextStyle.RESET }));
            }
        }
        if (exception != null)
            throw exception;
    }

    private static boolean highIntensity() {
        boolean highIntensity = false;
        if (System.getenv("HIGH_INTENSITY") != null
            && System.getenv("HIGH_INTENSITY").equals("true")) {
            highIntensity = true;
        }
        return highIntensity;
    }

    private static String generateStyle(Style[] styles) {
        String result = "";
        for (Style style : styles) {
            if (!result.isEmpty())
                result += ";";
            result += style.getCode();
        }
        return ESC + result + "m";
    }

    private static String reduceString(String string, int additional) {
        int size =
            Math.max(3, (Math.round(Configuration.DISPLAY_SIZE / 12) * 11)
                        - additional);
        if (string.length() > size) {
            return string.substring(0, size - 3) + "...";
        }
        return string;
    }

    private static String repeat(int n, String sign) {
        return new String(new char[Math.max(0, n)]).replace("\0", sign);
    }

}


text:
module SimpleObjects
  class Attribute
    attr_accessor :default, :name, :required, :type

    def initialize(name, opts = {})
      @name = name
      @required = false
      apply_opts(opts)
    end

    private

    def apply_opts(opts)
      opts.each do |opt, value|
        send("#{opt}=", value) if respond_to?(opt)
      end
    end
  end
end


text:
package org.ensime.core

import org.ensime.fixture._
import org.ensime.api._
import org.scalatest._

import scala.reflect.internal.util.RangePosition

class SemanticHighlightingSpec extends WordSpec with Matchers
    with IsolatedRichPresentationCompilerFixture
    with RichPresentationCompilerTestUtils
    with ReallyRichPresentationCompilerFixture {

  def original = EnsimeConfigFixture.EmptyTestProject

  def getSymbolDesignations(
    config: EnsimeConfig,
    cc: RichCompilerControl,
    content: String,
    tpes: List[SourceSymbol] = SourceSymbol.allSymbols
  ): List[(SourceSymbol, String)] = {

    val file = srcFile(config, "abc.scala", contents(content))
    cc.askLoadedTyped(file)
    val pos = new RangePosition(file, 0, 0, file.length)
    val sds = cc.askSymbolDesignationsInRegion(pos, tpes)
    sds.syms.sortWith((a, b) => a.start < b.start).
      map { sym =>
        (sym.symType, content.substring(sym.start, sym.end))
      }
  }

  "SemanticHighlighting" should {
    "highlight classes" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class X1[+A] { }
            class X2 { class Y { } }
            class Test {
              val a: Int = 1
              val b: X1[Any] = new X1[String]()
              val c: X2 = new X2
              val d = new c.Y
              def fun(a: Any) = a match { case x: Test => Unit }
            }
          """,
        List(ClassSymbol)
      )
      assert(sds === List(
        (ClassSymbol, "Int"),
        (ClassSymbol, "X1[Any]"),
        (ClassSymbol, "X1[String]"),
        (ClassSymbol, "X2"),
        (ClassSymbol, "X2"),
        (ClassSymbol, "Y"),
        (ClassSymbol, "Any"),
        (ClassSymbol, "Test")
      ))
    }

    "highlight constructors" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class X1(a: Int = 0) { }
            class X2(a: String) { }
            class X3 { }
            class Test {
              val b = new X1(3)
              val c1 = new X1(  )
              val d1 = new X2("y")
              val e1 = new   X3
            }
          """,
        List(ConstructorSymbol)
      )
      // TODO It would be better if the "new" was consistent.
      assert(sds === List(
        (ConstructorSymbol, "X1"),
        (ConstructorSymbol, "new X1(  )"),
        (ConstructorSymbol, "X2"),
        (ConstructorSymbol, "new   X3")
      ))
    }

    "highlight function calls" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              def fun(u: Int, v: Int) { u + v }
              def foo(u: Int, v: Int) { u + v }
              def bar { val X = fun(1, 2) ; foo(4, 5) }
              val x = "abc".substring(1,2)
              def baz { def quux(): Int = { 1 } ; quux() }
            }
          """,
        List(FunctionCallSymbol)
      )
      assert(sds === List(
        (FunctionCallSymbol, "fun"),
        (FunctionCallSymbol, "foo"),
        (FunctionCallSymbol, "substring"),
        (FunctionCallSymbol, "quux")
      ))
    }

    "highlight deprecated symbols" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              @deprecated("bad trait", "1.0")
              trait BadTrait
              class BadSubclass extends BadTrait
              @deprecated("bad class", "1.0")
              class BadClass(val data: String)
              @deprecated("bad object", "1.0")
              object BadObject
              @deprecated("bad method", "1.0")
              def foo(x: String) = { x + " foo" }
              @deprecated("bad val", "1.0")
              val badVal = 42
              @deprecated("bad var", "1.0")
              var badVar = 42
              val a = new BadClass("someData")
              val b = BadObject
              val c = foo("a")
              val d = badVal
              val e = badVar
            }
            @deprecated("blah", "sometime")
            class Baz { def boo() = {} }
            class Foo extends Baz {
              def bar(): Unit = {}
            }
            @deprecated("bad", "someday")
            object X {
              new Foo().bar()
              new Foo().boo()
              object Y { def goo(): Unit = {} }
            }
            object Z {
              X.Y.goo()
            }
          """,
        List(DeprecatedSymbol)
      )
      assert(sds == List(
        (DeprecatedSymbol, "BadTrait"),
        (DeprecatedSymbol, "BadClass"),
        (DeprecatedSymbol, "BadObject"),
        (DeprecatedSymbol, "foo"),
        (DeprecatedSymbol, "badVal"),
        (DeprecatedSymbol, "badVar"),
        (DeprecatedSymbol, "Baz"),
        (DeprecatedSymbol, "boo"),
        (DeprecatedSymbol, "X"),
        (DeprecatedSymbol, "Y"),
        (DeprecatedSymbol, "goo")
      ))
    }

    "highlight imported names" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            import scala.reflect.internal.util.RangePosition
            import org.scalatest. { Matchers,
                 FunSpec }
            """,
        List(ImportedNameSymbol)
      )
      assert(sds === List(
        (ImportedNameSymbol, "RangePosition"),
        (ImportedNameSymbol, "Matchers"),
        (ImportedNameSymbol, "FunSpec")
      ))
    }

    "highlight objects" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            object A { object B { } }
            case class C() { }
            case class D(i: Int) { case class E(i: Int) { } }
            object Test {
              def fun (x:Any) = x match { case C() => 1 }
              val b = A.B
              val c = D(1)
              val d = c.E(1)
            }
          """,
        List(ObjectSymbol)
      )
      assert(sds === List(
        (ObjectSymbol, "C"),
        (ObjectSymbol, "A"),
        (ObjectSymbol, "B"),
        (ObjectSymbol, "D"),
        // TODO two problems there: "c" should be a varField ; E should be highlighted.
        (ObjectSymbol, "c")
      ))
    }

    "highlight operators" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            object Test {
              var a = 1 + 2 * 3
              a += 8
            }
          """,
        List(OperatorFieldSymbol)
      )
      // TODO We should highlight the "+="
      assert(sds === List(
        (OperatorFieldSymbol, "+"),
        (OperatorFieldSymbol, "*")
      ))
    }

    "highlight packages" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
             package com.example
             package other
          """,
        List(PackageSymbol)
      )
      assert(sds === List(
        (PackageSymbol, "com"),
        (PackageSymbol, "example"),
        (PackageSymbol, "other")
      ))
    }

    "highlight params" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              def f(u:  Int, v   :String) = v + u
            }
          """,
        List(ParamSymbol)
      )
      assert(sds === List(
        (ParamSymbol, "u"),
        (ParamSymbol, "v"),
        (ParamSymbol, "v"),
        (ParamSymbol, "u")
      ))
    }

    "highlight traits" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            trait X1 { }
            trait X2 { }
            trait X3 { }
            trait X4 { }
            trait X5[A] { }
            class C extends X2 { trait X6 {}   }
            class Test {
              def fun(x2: X3) = x2
              var v1: X4
              val v2 = new C
              def foo(x: Any) = x match {
                case _: X5[ String] => x
                case _: v2 .X6 => x
              }
            }
          """,
        List(TraitSymbol)
      )
      assert(sds === List(
        (TraitSymbol, "X2"),
        (TraitSymbol, "X3"),
        (TraitSymbol, "X4"),
        (TraitSymbol, "X5[ String]"),
        (TraitSymbol, "v2 .X6")
      ))
    }

    "highlight typeParams" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              def f[XX,YY](y: YY, x: XX) = {
                var z: YY
              }
              f[Int, String](1, "a")
            }
          """,
        List(TypeParamSymbol)
      )
      assert(sds === List(
        (TypeParamSymbol, "XX"),
        (TypeParamSymbol, "YY"),
        (TypeParamSymbol, "YY"),
        (TypeParamSymbol, "XX"),
        (TypeParamSymbol, "YY")
      ))
    }

    "highlight vals" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              def fun() = {
                val u = 1
                val v: Int = 1
                println(u)
              }
            }
          """,
        List(ValSymbol)
      )
      assert(sds === List(
        (ValSymbol, "u"),
        (ValSymbol, "v"),
        (ValSymbol, "u")
      ))
    }

    "highlight valFields" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              val u= 1
              val v:Int = 1
              println( u )
            }
            class Test2 {
              println((new Test).v)
            }
          """,
        List(ValFieldSymbol)
      )
      assert(sds === List(
        (ValFieldSymbol, "u"),
        (ValFieldSymbol, "v"),
        (ValFieldSymbol, "u"),
        (ValFieldSymbol, "v")
      ))
    }

    "highlight vars" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              def fun() = {
                var u = 1
                var v: Int = 1
                println(u)
              }
            }
          """,
        List(VarSymbol)
      )
      assert(sds === List(
        (VarSymbol, "u"),
        (VarSymbol, "v"),
        (VarSymbol, "u")
      ))
    }

    "highlight varFields" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              var u= 1
              var v:Int   = 1
              println( u )
            }
            class Test2 {
              println((new Test).v)
            }
          """,
        List(VarFieldSymbol)
      )
      assert(sds === List(
        (VarFieldSymbol, "u"),
        (VarFieldSymbol, "v"),
        (VarFieldSymbol, "u"),
        (VarFieldSymbol, "v")
      ))
    }

    "highlight lazy val fields correctly as vals" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              lazy val u= 1
              lazy val v:Int   = 1
              println( u )
            }
            class Test2 {
              println((new Test).v)
            }
          """,
        List(ValFieldSymbol)
      )
      assert(sds === List(
        (ValFieldSymbol, "u"),
        (ValFieldSymbol, "v")
      ))
    }

    "highlight setter operators" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            object Fubar {
               private var v: Int = 0
               def value = v
               def value_=(a: Int) = v = a
            }
            class Test {
              Fubar.value = 1
            }
          """,
        List(OperatorFieldSymbol)
      )
      assert(sds === List(
        (OperatorFieldSymbol, "value")
      ))
    }

    "not be confused by whitespace" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.  example
          """,
        List(PackageSymbol)
      )
      // only part of "example" is highlighted
      assert(sds === List(
        (PackageSymbol, "com"),
        (PackageSymbol, "example")
      ))
    }

    "highlight negation operators" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              val x = !(3 == 4)
            }
          """,
        List(OperatorFieldSymbol)
      )
      // Call to foo is missing
      assert(sds === List(
        (OperatorFieldSymbol, "!"),
        (OperatorFieldSymbol, "==")
      ))
    }

    "highlight implicit conversions" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {}
            object I {
              implicit def StringToTest(v: String): Test = new Test
              val t: Test  = "sample";
              val u: Test  = StringToTest("y");
            }
          """,
        List(ImplicitConversionSymbol)
      )
      assert(sds === List(
        (ImplicitConversionSymbol, "\"sample\"")
      ))
    }

    "highlight implicit parameters" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Thing {}
            class Thong {}
            object I {
              implicit def myThing = new Thing
              implicit val myThong = new Thong
              def zz(u: Int)(implicit s: Thing, t: Thong) = u
              val t = zz(1)
            }
          """,
        List(ImplicitParamsSymbol)
      )
      assert(sds === List(
        (ImplicitParamsSymbol, "zz(1)")
      ))
    }

    "highlight method calls after operators" in withPresCompiler { (config, cc) =>
      val sds = getSymbolDesignations(
        config, cc, """
            package com.example
            class Test {
              def fun(u: Int, v: Int): Int = { u + v }
              def foo(u: Int, v: Int): Int = { u - v }
              fun(1, 2) + foo(4, 5)
            }
          """,
        List(FunctionCallSymbol)
      )
      assert(sds === List(
        (FunctionCallSymbol, "fun"),
        (FunctionCallSymbol, "foo")
      ))
    }
  }
}


text:
package com.dglogik.mobile.ui;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.ResultReceiver;

import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult;

public class ScanBarcodeActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void onResume() {
        super.onResume();
        IntentIntegrator integrator = new IntentIntegrator(this);
        integrator.initiateScan();
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        IntentResult scanResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);

        ResultReceiver receiver = (ResultReceiver) getIntent().getExtras().get("receiver");

        Runnable done = new Runnable() {
            @Override
            public void run() {
                finish();
            }
        };

        Bundle bundle = new Bundle();

        if (scanResult == null) {
            bundle.putString("code", "");
            bundle.putString("format", "");
            if (receiver != null) {
                receiver.send(RESULT_OK, bundle);
            }
            done.run();
            return;
        }

        bundle.putString("code", scanResult.getContents());
        bundle.putString("format", scanResult.getFormatName());
        if (receiver != null) {
            receiver.send(RESULT_OK, bundle);
        }

        done.run();
    }
}


text:
package com.esri.gpt.control.publication;
import com.esri.gpt.catalog.management.CollectionDao;
import com.esri.gpt.framework.context.RequestContext;
import com.esri.gpt.framework.util.Val;

import java.util.ArrayList;
import java.util.List;
import javax.faces.model.SelectItem;

/**
 * Defines a list of selectable collections.
 */
public class SelectableCollections {

  // class variables =============================================================

  // instance variables ==========================================================
  private ArrayList<SelectItem> _list = new ArrayList<SelectItem>();
  private String _selectedKey = "";

  // constructors ================================================================

  /** Default constructor. */
  public SelectableCollections() {}

  // properties ==================================================================

  /**
   * Determines if the items list contains multiple groups.
   * @return true if the items list is greater that 1
   */
  public boolean getHasMultiple() {
    return (_list.size() > 1);
  }

  /**
   * Gets the SelectItem list for UI display.
   * @return the SelectItem list
   */
  public ArrayList<SelectItem> getItems() {
    return _list;
  }

  /**
   * Gets the size of the list.
   * @return size of selactable groups
   */
  public int getSize() {
    return _list.size();
  }

  /**
   * Gets the currently selected key.
   * @return the currently selected key
   */
  public String getSelectedKey() {
    return _selectedKey;
  }

  /**
   * Sets the currently selected key.
   * @param key the currently selected key
   */
  public void setSelectedKey(String key) {
    _selectedKey = Val.chkStr(key);
  }

  // methods =====================================================================

  /**
   * Builds the list of collections.
   * @param context the active request context
   */
  public void buildAll(RequestContext context) throws Exception {
    _list.clear();
    CollectionDao colDao = new CollectionDao(context);
    List<String[]> collections = colDao.queryCollections();
    for (String[] col: collections) {
      _list.add(new SelectItem(col[0],col[1]));
    }
  }
}


text:
This project adheres to the following standards and practices.

## Versioning

We version under the [Semantic Versioning](http://semver.org/) guidelines as much as possible.

Releases will be numbered with the following format:

`<major>.<minor>.<patch>`

And constructed with the following guidelines:

* Breaking backward compatibility bumps the major (and resets the minor and patch)
* New additions without breaking backward compatibility bumps the minor (and resets the patch)
* Bug fixes and misc changes bumps the patch

## Coding Styles

Cartalyst follows the [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md) and [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) coding standards. In addition to these standards, below is a list of other coding standards that should be followed:

- Namespace declarations should be on the same line as `<?php`.
- Class opening `{` should be on the same line as the class name.
- Function and control structure opening `{` should be on a separate line.
- Interface names are suffixed with `Interface` (`FooInterface`)
- Use tabs instead of 4 spaces.

## Cartalyst Contribution Guide

This page contains guidelines for contributing to the Cartalyst packages. Please review these guidelines before submitting any pull requests to the package.

### Which Branch?

**ALL** bug fixes should be made to the branch which they belong. Bug fixes should never be sent to the `master` branch unless they fix features that exist only in the upcoming release.

### Pull Requests

The pull request process differs for new features and bugs. Before sending a pull request for a new feature, you should first create an issue with `[Proposal]` in the title. The proposal should describe the new feature, as well as implementation ideas. The proposal will then be reviewed and either approved or denied. Once a proposal is approved, a pull request may be created implementing the new feature. Pull requests which do not follow this guideline will be closed immediately.

Pull requests for bugs may be sent without creating any proposal issue. If you believe that you know of a solution for a bug that has been filed, please leave a comment detailing your proposed fix.

### Feature Requests

If you have an idea for a new feature you would like to see added to the package, you may create an issue with `[Request]` in the title. The feature request will then be reviewed by a core contributor.


text:
layout: post
title: Add line height to body
description: It's not necessary to add line height to each separate textual element. Here's a helpful tip for elements to inherit line height from the body.
image: img/posts/sunset-home-office-min.jpg
tags: [CSS]
comments: true
---

If you've been adding line height to each textual element separately, e.g., `<h*>`, `<p>`, etc., this is a helpful tip that you'll want to try: add line height to the `body` selector instead.

```css
body {
  line-height: 1.5;
}
```

Now all textual elements will have a consistent line height that is inherited from the body. This gives text a more uniform display on the page.

## Unitless line height

Always specify the line height as a unitless number, e.g., `line-height: 1.5;`. That way descendent elements that specify a different font size will inherit that number rather than a fixed line height.

See the Pen Add line-height to Body by Matt Smith (@AllThingsSmitty) on CodePen.

Feel free to poke holes in it, but give it a try first.


text:
'use strict';

var babelHelpers = require('./util/babelHelpers.js');

var React = require('react'),
    css = require('dom-helpers/style'),
    getHeight = require('dom-helpers/query/height'),
    config = require('./util/configuration'),
    cn = require('classnames'),
    compat = require('./util/compat');

var transform = config.animate.transform;

function properties(prop, value) {
  var _ref, _ref2;

  var TRANSLATION_MAP = config.animate.TRANSLATION_MAP;

  if (TRANSLATION_MAP && TRANSLATION_MAP[prop]) return (_ref = {}, _ref[transform] = TRANSLATION_MAP[prop] + '(' + value + ')', _ref);

  return (_ref2 = {}, _ref2[prop] = value, _ref2);
}

var PopupContent = React.createClass({
  displayName: 'PopupContent',

  render: function render() {
    var child = this.props.children;

    if (!child) return React.createElement('span', { className: 'rw-popup rw-widget' });

    child = React.Children.only(this.props.children);

    return compat.cloneElement(child, {
      className: cn(child.props.className, 'rw-popup rw-widget')
    });
  }
});

module.exports = React.createClass({

  displayName: 'Popup',

  propTypes: {
    open: React.PropTypes.bool,
    dropUp: React.PropTypes.bool,
    duration: React.PropTypes.number,

    onRequestClose: React.PropTypes.func.isRequired,
    onClosing: React.PropTypes.func,
    onOpening: React.PropTypes.func,
    onClose: React.PropTypes.func,
    onOpen: React.PropTypes.func
  },

  getInitialState: function getInitialState() {
    return {};
  },

  getDefaultProps: function getDefaultProps() {
    return {
      duration: 200,
      open: false,
      onClosing: function onClosing() {},
      onOpening: function onOpening() {},
      onClose: function onClose() {},
      onOpen: function onOpen() {}
    };
  },

  // componentDidMount(){
  //   !this.props.open && this.close(0)
  // },
  componentWillMount: function componentWillMount() {
    !this.props.open && (this._initialPosition = true);
  },

  componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
    this.setState({
      contentChanged: childKey(nextProps.children) !== childKey(this.props.children)
    });
  },

  componentDidUpdate: function componentDidUpdate(pvProps) {
    var closing = pvProps.open && !this.props.open,
        opening = !pvProps.open && this.props.open,
        open = this.props.open;

    if (opening) this.open();else if (closing) this.close();else if (open) this.height();
  },

  render: function render() {
    var _props = this.props;
    var className = _props.className;
    var open = _props.open;
    var dropUp = _props.dropUp;
    var props = babelHelpers.objectWithoutProperties(_props, ['className', 'open', 'dropUp']);
    var display = open ? 'block' : void 0;

    if (this._initialPosition) {
      display = 'none';
    }

    return React.createElement(
      'div',
      babelHelpers._extends({}, props, {
        style: babelHelpers._extends({
          display: display,
          height: this.state.height
        }, props.style),
        className: cn(className, 'rw-popup-container', { 'rw-dropup': dropUp })
      }),
      React.createElement(
        PopupContent,
        { ref: 'content' },
        this.props.children
      )
    );
  },

  reset: function reset() {
    var container = compat.findDOMNode(this),
        content = compat.findDOMNode(this.refs.content),
        style = { display: 'block', overflow: 'hidden' };

    css(container, style);
    this.height();
    css(content, properties('top', this.props.dropUp ? '100%' : '-100%'));
  },

  height: function height() {
    var el = compat.findDOMNode(this),
        content = compat.findDOMNode(this.refs.content),
        margin = parseInt(css(content, 'margin-top'), 10) + parseInt(css(content, 'margin-bottom'), 10);

    var height = getHeight(content) + (isNaN(margin) ? 0 : margin);

    if (this.state.height !== height) {
      el.style.height = height + 'px';
      this.setState({ height: height });
    }
  },

  open: function open() {
    var self = this,
        anim = compat.findDOMNode(this),
        el = compat.findDOMNode(this.refs.content);

    this.ORGINAL_POSITION = css(el, 'position');
    this._isOpening = true;

    if (this._initialPosition) {
      this._initialPosition = false;
      this.reset();
    } else this.height();

    this.props.onOpening();

    anim.className += ' rw-popup-animating';
    el.style.position = 'absolute';

    config.animate(el, { top: 0 }, self.props.duration, 'ease', function () {
      if (!self._isOpening) return;

      anim.className = anim.className.replace(/ ?rw-popup-animating/g, '');

      el.style.position = self.ORGINAL_POSITION;
      anim.style.overflow = 'visible';
      self.ORGINAL_POSITION = null;

      self.props.onOpen();
    });
  },

  close: function close(dur) {
    var self = this,
        el = compat.findDOMNode(this.refs.content),
        anim = compat.findDOMNode(this);

    this.ORGINAL_POSITION = css(el, 'position');

    this._isOpening = false;
    this.height();
    this.props.onClosing();

    anim.style.overflow = 'hidden';
    anim.className += ' rw-popup-animating';
    el.style.position = 'absolute';

    config.animate(el, { top: this.props.dropUp ? '100%' : '-100%' }, dur === undefined ? this.props.duration : dur, 'ease', function () {
      if (self._isOpening) return;

      el.style.position = self.ORGINAL_POSITION;
      anim.className = anim.className.replace(/ ?rw-popup-animating/g, '');

      anim.style.display = 'none';
      self.ORGINAL_POSITION = null;
      self.props.onClose();
    });
  }

});

function childKey(children) {
  var nextChildMapping = React.Children.map(children, function (c) {
    return c;
  });
  for (var key in nextChildMapping) return key;
}


text:
<?php
require_once(__DIR__.'/library/Autoload.php');
use \Application\Application;

$app = new Application();
$app->run();
//var_dump($app);


text:
package org.jboss.jbossts.qa.Utils;

import com.arjuna.ats.arjuna.common.Uid;
import com.arjuna.ats.arjuna.coordinator.AbstractRecord;
import com.arjuna.ats.arjuna.coordinator.AddOutcome;
import com.arjuna.ats.arjuna.coordinator.BasicAction;
import com.arjuna.ats.txoj.LockManager;

public class BaseTestCase
{
	public BaseTestCase()
	{
		super();
	}

	public BaseTestCase(String[] args)
	{
		super();
		mArgs = args;
		mArgsSize = args.length;
	}

	public void Fail()
	{
		Fail(null);
	}

	public void Fail(String s)
	{
		Fail(s, null);
	}

	public void Fail(String s, Exception e)
	{
		mComplete = false;
		if (e == null)
		{
			Debug(s);
		}
		else
		{
			Debug(s + ": " + e);
			e.printStackTrace();
		}
		Complete();
		System.exit(0);
	}

	public void Debug(String s)
	{
		if (s != null)
		{
			System.err.println(s);
		}
	}

	public void Debug(String s, Exception e)
	{
		if (s != null && e != null)
		{
			System.err.println(s + " :" + e);
			e.printStackTrace();
		}
		else
		{
			Debug(s);
		}
	}

	public void Pass()
	{
		mComplete = true;
		Complete();
	}

	public void qaAssert(boolean test)
	{
		if (test)
		{
			Pass();
		}
		else
		{
			Fail();
		}
	}

	private void Complete()
	{
		if (mComplete)
		{
			System.out.println("Passed");
		}
		else
		{
			System.out.println("Failed");
		}
	}

	public String[] getArgs()
	{
		return mArgs;
	}

	public int getNumberOfArgs()
	{
		return mArgsSize;
	}

	public String getArg(int position)
	{
		return mArgs[position];
	}

	public String getRelativeArg(int position)
	{
		return mArgs[mArgs.length - position];
	}

	public int getIntRelArg(int position)
	{
		return Integer.parseInt(getRelativeArg(position));
	}

	public String loadIOR(int relative_position)
	{
		String s = null;
		try
		{
			s = ServerIORStore.loadIOR(getRelativeArg(relative_position));
		}
		catch (Exception e)
		{
			Fail("Error in loading IOR: ", e);
		}
		return s;
	}

	public void storeIOR(int relative_position, String ior)
	{
		try
		{
			ServerIORStore.storeIOR(getRelativeArg(relative_position), ior);
		}
		catch (Exception e)
		{
			Fail("Error in loading IOR: ", e);
		}
	}

	public void storeIOR(String name, String ior)
	{
		try
		{
			ServerIORStore.storeIOR(name, ior);
		}
		catch (Exception e)
		{
			Fail("Error in loading IOR: ", e);
		}
	}

	public void storeUid(int relative_position, Object o)
	{
		try
		{
			LockManager lm = (LockManager) o;
			ObjectUidStore.storeUid(getRelativeArg(relative_position), lm.get_uid());
		}
		catch (Exception e)
		{
			Fail("Error storing Uid:", e);
		}
	}

	public Uid loadUid(int relative_position)
	{
		Uid u = null;
		try
		{
			u = ObjectUidStore.loadUid(getRelativeArg(relative_position));
		}
		catch (Exception e)
		{
			Fail("Error loading Uid:", e);
		}
		return u;
	}

	/**
	 * This method reads in a paramater from the comand line in a set position
	 * (relative_position) and sets the global variable.
	 */
	public void setNumberOfCalls(int relative_position)
	{
		numberOfCalls = getIntRelArg(relative_position);
	}

	public int numberOfCalls = 1000; //default value for tests
	private boolean mComplete = false;
	private String[] mArgs = null;
	private int mArgsSize = 0;

	public boolean addAction(AbstractRecord ar)
	{
		return (BasicAction.Current().add(ar) == AddOutcome.AR_ADDED);
	}

	//memory test metthods and variables used by JTS and Core tests
	public void getClientThreshold(int relative_position)
	{
		try
		{
			// If no threshold value then use default.
			if (MemoryTestProfileStore.getNoThresholdValue().equals(getRelativeArg(relative_position)))
			{
				clientIncreaseThreshold = Float.parseFloat(MemoryTestProfileStore.getDefaultClientIncreaseThreshold());
			}
			else // Use passed threshold
			{
				clientIncreaseThreshold = Float.parseFloat(getRelativeArg(relative_position));
			}
		}
		catch (Exception e)
		{
			Fail("Error whilst reading client values: ", e);
		}
	}

	//baseline values
	public int clientMemory0 = 0;
	//there can only be 1 client (this)
	public int clientMemory1 = 0;
	public float clientIncreaseThreshold = new Float(0.025).floatValue();//default value
}


text:
from cairis.core.ARM import *
from cairis.core.GoalContribution import GoalContribution
from cairis.daemon.CairisHTTPError import ObjectNotFoundHTTPError, MalformedJSONHTTPError, ARMHTTPError, MissingParameterHTTPError, OverwriteNotAllowedHTTPError
import cairis.core.armid
from cairis.data.CairisDAO import CairisDAO
from cairis.tools.ModelDefinitions import GoalContributionModel
from cairis.tools.SessionValidator import check_required_keys, get_fonts
from cairis.tools.JsonConverter import json_serialize, json_deserialize
import re

__author__ = 'Shamal Faily'

class GoalContributionDAO(CairisDAO):
  def __init__(self, session_id):
    CairisDAO.__init__(self, session_id)

  def get_objects(self,source = -1, target = -1, pathValues = []):
    try:
      rawObjts = self.db_proxy.getGoalContributionsTable(source,target)
      objts = []
      for objt in rawObjts:
        objts.append(objt)
      if (source != -1 and target != -1):
        return objts[0]
      else:
        return objts
    except DatabaseProxyException as ex:
      self.close()
      raise ARMHTTPError(ex)
    except ARMException as ex:
      self.close()
      raise ARMHTTPError(ex)

  def add_object(self, gc):
    try:
      self.db_proxy.addReferenceContribution(gc)
    except ARMException as ex:
      self.close()
      raise ARMHTTPError(ex)

  def update_object(self,gc,source,target, pathValues = []):
    try:
      self.db_proxy.deleteGoalContribution(source,target)
      self.db_proxy.addReferenceContribution(gc)
    except ARMException as ex:
      self.close()
      raise ARMHTTPError(ex)

  def delete_object(self, source, target, pathValues = []):
    try:
      self.db_proxy.deleteGoalContribution(source,target)
    except ARMException as ex:
      self.close()
      raise ARMHTTPError(ex)

  def from_json(self, request, to_props=False):
    json = request.get_json(silent=True)
    if json is False or json is None:
      self.close()
      raise MalformedJSONHTTPError(data=request.get_data())

    json_dict = json['object']
    check_required_keys(json_dict, GoalContributionModel.required)
    json_dict['__python_obj__'] = GoalContribution.__module__+'.'+ GoalContribution.__name__
    gc = json_serialize(json_dict)
    gc = json_deserialize(gc)

    if isinstance(gc, GoalContribution):
      return gc
    else:
      self.close()
      raise MalformedJSONHTTPError()


text:
/// <reference path='fourslash.ts'/>

////function Foo() {
////    for (var i = 0; i < 10; i++) {
////        /*insideStatement*/
////    }
////    /*afterStatement*/
////}

goTo.marker('insideStatement');
verify.indentationIs(8);

goTo.marker('afterStatement');
verify.indentationIs(4);


text:
"""
Django settings for project project.

Generated by 'django-admin startproject' using Django 1.8.4.

For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '2+icr7+y*3bq!^z8x(vgb1ha56=fi)861^9+1zqvx6=m7nhs+w'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'background_task',
    'api',
)

MIDDLEWARE_CLASSES = (
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'project.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'project.wsgi.application'

# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/

STATIC_URL = '/static/'

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(levelname)s %(message)s'
        },
    },
    'handlers': {
        'file': {
            'level': 'DEBUG',
            'class': 'logging.FileHandler',
            'filename': 'logs/request.log',
            'formatter': 'verbose',
        },
        'debug_file': {
            'level': 'DEBUG',
            'class': 'logging.FileHandler',
            'filename': 'logs/debug.log',
            'formatter': 'verbose',
        },
    },
    'loggers': {
        'django': {
            'handlers': ['file'],
            'level': 'DEBUG',
            'propagate': True,
        },
        'background_task': {
            'handlers': ['debug_file'],
            'level': 'DEBUG',
            'propagate': True,
        },
        'api': {
            'handlers': ['debug_file'],
            'level': 'DEBUG',
            'propagate': True,
        },
    },
}


text:
using System;

using JetBrains.Annotations;

namespace LinqToDB.Tools.Mapper
{
	///
	/// Mapper helper class.
	///
	/// <example>
	/// This example shows how to map one object to another.
	///
	/// </example>
	[PublicAPI]
	public static class Map
	{
		///
		/// Returns a mapper to map an object of TFrom type to an object of TTo type.
		///
		/// <typeparam name="TFrom">Type to map from.</typeparam>
		/// <typeparam name="TTo">Type to map to.</typeparam>
		/// <returns>Mapping expression.</returns>
		[Pure]
		public static Mapper<TFrom,TTo> GetMapper<TFrom,TTo>()
			=> new Mapper<TFrom,TTo>(new MapperBuilder<TFrom,TTo>());

		///
		/// Returns a mapper to map an object of TFrom type to an object of TTo type.
		///
		/// <typeparam name="TFrom">Type to map from.</typeparam>
		/// <typeparam name="TTo">Type to map to.</typeparam>
		/// <param name="setter">MapperBuilder parameter setter.</param>
		/// <returns>Mapping expression.</returns>
		[Pure, NotNull]
		public static Mapper<TFrom,TTo> GetMapper<TFrom,TTo>(
			[NotNull] Func<MapperBuilder<TFrom,TTo>,MapperBuilder<TFrom,TTo>> setter)
		{
			if (setter == null) throw new ArgumentNullException(nameof(setter));
			return new Mapper<TFrom,TTo>(setter(new MapperBuilder<TFrom,TTo>()));
		}

		static class MapHolder<T>
		{
			[NotNull]
			public static readonly Mapper<T,T> Mapper =
				GetMapper<T,T>(m => m
					 .SetProcessCrossReferences(true)
					 .SetDeepCopy(true));
		}

		///
		/// Performs deep copy.
		///
		/// <param name="obj">An object to copy.</param>
		/// <typeparam name="T">Type of object.</typeparam>
		/// <returns>Created object.</returns>
		[Pure]
		public static T DeepCopy<T>(this T obj) => MapHolder<T>.Mapper.Map(obj);
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.beam</groupId>
    <artifactId>beam-sdks-parent</artifactId>
    <version>0.5.0-incubating-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>beam-sdks-java-parent</artifactId>

  <packaging>pom</packaging>

  <name>Apache Beam :: SDKs :: Java</name>

  <modules>
    <!-- build-tools inherits from the Beam root pom to enable checkstyle
         and other project configuration to be used in all modules.
    <module>build-tools</module> -->
    <module>core</module>
    <module>io</module>
    <module>maven-archetypes</module>
    <module>extensions</module>
  </modules>

  <profiles>
    <profile>
      <id>java8-tests</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <modules>
        <module>java8tests</module>
      </modules>
    </profile>
  </profiles>
</project>


text: {{menuItem.name}}