text:
package azkaban.executor.container.watch;

import static azkaban.executor.container.KubernetesContainerizedImpl.CLUSTER_LABEL_NAME;
import static azkaban.executor.container.KubernetesContainerizedImpl.DISABLE_CLEANUP_LABEL_NAME;
import static azkaban.executor.container.KubernetesContainerizedImpl.EXECUTION_ID_LABEL_NAME;
import static azkaban.executor.container.KubernetesContainerizedImpl.EXECUTION_ID_LABEL_PREFIX;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;

import io.kubernetes.client.openapi.models.V1ContainerStatus;
import io.kubernetes.client.openapi.models.V1Pod;
import io.kubernetes.client.openapi.models.V1PodStatus;
import io.kubernetes.client.proto.V1.ContainerStatus;
import io.kubernetes.client.util.Watch;
import java.util.List;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * This is intended for maintaining any relevant data from a Pod Watch event that was derived
 * during the inference of {@link AzPodStatus}. The data here can be consumed by any downstream
 * callbacks.
 */
public class AzPodStatusMetadata {
  private static final Logger logger = LoggerFactory.getLogger(AzPodStatusMetadata.class);

  private final AzPodStatus azPodStatus;
  private final String podName;
  private final Watch.Response<V1Pod> podWatchEvent;
  private final Optional<FlowPodMetadata> flowPodMetadata;

  public AzPodStatusMetadata(AzPodStatusExtractor extractor) {
    this.azPodStatus = extractor.createAzPodStatus();
    this.podName = extractor.getPodName();
    this.podWatchEvent = extractor.getPodWatchEvent();
    this.flowPodMetadata = FlowPodMetadata.extract(extractor);
  }

  public AzPodStatus getAzPodStatus() {
    return this.azPodStatus;
  }

  public String getPodName() {
    return this.podName;
  }

  public Watch.Response<V1Pod> getPodWatchEvent() {
    return this.podWatchEvent;
  }

  public Optional<FlowPodMetadata> getFlowPodMetadata() {
    return this.flowPodMetadata;
  }

  /**
   * This is specifically for maintaining data relevant to a FlowContainer pod. Any data not
   * specific to FlowContainers should be directly added to the outer class {@link
   * AzPodStatusMetadata}
   */
  public static class FlowPodMetadata {
    private static final String KUBERNETES_OOM_KILLED_REASON = "OOMKilled";
    private final String executionId;
    private final String clusterName;
    private final boolean isCleanupDisabled;
    private final boolean isOOMKilled;

    private FlowPodMetadata(String executionId, String clusterName, boolean isCleanupDisabled,
        boolean isOOMKilled) {
      this.executionId = executionId;
      this.clusterName = clusterName;
      this.isCleanupDisabled = isCleanupDisabled;
      this.isOOMKilled = isOOMKilled;
    }

    public FlowPodMetadata(String executionId, String clusterName) {
      this(executionId, clusterName, false, false);
    }

    public String getExecutionId() {
      return this.executionId;
    }

    public String getClusterName() {
      return this.clusterName;
    }

    public boolean isCleanupDisabled() {
      return this.isCleanupDisabled;
    }

    public boolean isOOMKilled() {
      return this.isOOMKilled;
    }

    public static Optional<FlowPodMetadata> extract(AzPodStatusExtractor podStatusExtractor) {
      requireNonNull(podStatusExtractor.getV1Pod(), "pod must not be null");
      requireNonNull(podStatusExtractor.getV1Pod().getMetadata(), "pod metadata must not be null");
      requireNonNull(podStatusExtractor.getV1Pod().getMetadata().getName(), "pod name must not be null");

      String podName = podStatusExtractor.getV1Pod().getMetadata().getName();
      V1PodStatus v1PodStatus = podStatusExtractor.getV1PodStatus();
      String executionId = null;
      String clusterName = null;
      boolean isCleanupDisabled = false;
      boolean isOOMKilled = false;

      if (podStatusExtractor.getV1Pod().getMetadata().getLabels() == null) {
        logger.warn("No labels found for pod: " + podName);
        return Optional.empty();
      }
      clusterName = podStatusExtractor.getV1Pod().getMetadata().getLabels().get(CLUSTER_LABEL_NAME);
      if (clusterName == null) {
        logger.warn(format("Label %s not found for pod %s", CLUSTER_LABEL_NAME, podName));
        return Optional.empty();
      }
      String executionLabel =
          podStatusExtractor.getV1Pod().getMetadata().getLabels().get(EXECUTION_ID_LABEL_NAME);
      if (executionLabel == null) {
        logger.warn(format("Label %s not found for pod %s", EXECUTION_ID_LABEL_NAME, podName));
        return Optional.empty();
      }
      executionId = executionLabel.substring(EXECUTION_ID_LABEL_PREFIX.length());

      String cleanupDisabledLabel =
          podStatusExtractor.getV1Pod().getMetadata().getLabels().get(DISABLE_CLEANUP_LABEL_NAME);
      if (cleanupDisabledLabel != null) {
        // Any value other than false or 0 will is considered as true. The label is expected to
        // to be assigned sparingly and only for the purpose of debugging any issues.
        if (!cleanupDisabledLabel.equalsIgnoreCase("false") &&
            !cleanupDisabledLabel.equals("0")) {
          isCleanupDisabled = true;
        }
      } else {
        logger.debug(format("Label %s is not found for pod %s", DISABLE_CLEANUP_LABEL_NAME,
            podName));
      }

      // Only check for OOMKilled status for app container.
      // OOMKilled logic comes from:
      // https://github.com/xing/kubernetes-oom-event-generator/blob/2ceca4509eb415b3056fb6b942057fb36702721f/src/controller/controller.go#L150
      try {
        isOOMKilled =
            podStatusExtractor.getV1PodStatus().getContainerStatuses().get(0).getState().getTerminated().getReason().equals(KUBERNETES_OOM_KILLED_REASON);
      } catch (Exception e) {
        logger.debug(format("Terminated reason not found for pod %s, podStatus %s", podName,
            v1PodStatus), e);
      }

      return Optional.of(new FlowPodMetadata(executionId, clusterName, isCleanupDisabled, isOOMKilled));
    }
  }
}


text:
template <typename T>
void reverse(
	Vector<T>& collection)
{

	ArrayStack<T> stack(collection.size());

	while(!collection.isEmpty())
	{
		T value = collection.at(0);

		stack.push(value);

		collection.erase(0);
	}

	while(!stack.isEmpty())
	{
		T value = stack.top();

		collection.insert(collection.size(), value);

		stack.pop();
	}

}

int main(
	int argc,
	char** argv)
{

	Vector<int> numbers;

	numbers.insert(numbers.size(), 0);
	numbers.insert(numbers.size(), 1);
	numbers.insert(numbers.size(), 2);
	numbers.insert(numbers.size(), 3);
	numbers.insert(numbers.size(), 4);
	numbers.insert(numbers.size(), 5);

	numbers.print();

	reverse(numbers);

	numbers.print();

	return 0;

}

redpajama_set_name: RedPajamaGithub


text:
import takeControl from '../actions/takeControl';
import showSnackbar from '../../Bin/factories/showSnackbar';

export default [
  takeControl,
  showSnackbar('You now have control of the bin')
];


text:
export default class MessageWarning {

    constructor(details: string, ) {

        this.details = details;
    }

    details: string;
}


text:
function storeUser(id) {
    sessionStorage.setItem('user_id', id);
};

function getUser() {
    sessionStorage.getItem('user_id');
};


text:
import {frameworks, url, setOptions, initSurvey, getSurveyResult} from "../settings";
import {Selector, ClientFunction} from 'testcafe';
const setupSurvey = ClientFunction(() => {
    document.querySelector('#surveyElement').insertAdjacentHTML(
        'afterend',
        '

'
    );

    window.survey.onSendResult.add(function(s, options) {
        if(options.success) {
            s.getResult('a15eee7a-9418-4eb4-9671-2009c8ff6b24', 'langs');
        }
    });
    window.survey.onGetResult.add(function(s, options) {
        if(options.success) {
            showChart(options.dataList);
        }
    });
    window.showChart = function(chartDataSource) {
        document.getElementById("chartContainer").style.height = "500px";
        $("#chartContainer").dxPieChart({
            dataSource: chartDataSource,
            series: {
                argumentField: 'name',
                valueField: 'value'
            }
        });
    }
});
const assert = require('assert');
const title = `getSurveyResult`;

const json = {
    surveyId: '5af48e08-a0a5-44a5-83f4-1c90e8e98de1',
    surveyPostId: '3ce10f8b-2d8a-4ca2-a110-2994b9e697a1'
};

frameworks.forEach( (framework) => {
    fixture `${framework} ${title}`

        .page `${url}${framework}`

        .beforeEach( async t => {
            await initSurvey(framework, json);
        });

    test(`correct get result`, async t => {
        await setupSurvey();
        await t
            .click(`div:nth-child(20) label input`)
            .click(`input[value="Complete"]`)
            .hover(`svg`);
    });
});


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

namespace ASPPatterns.Chap8.CoR.Model
{
    public class Product
    {
        public Category Category { get; set; }
        public string Name { get; set; }
        public decimal Price { get; set; }
        public int Id { get; set; }
        public string Description { get; set; }
    }
}


text:
<?php
namespace Duedil\GitMapperBundle\Service\Response;

use JMS\Serializer\Annotation\Type;

class GitComposerFileResponse
{
    /**
     * @var string $name Composer package name
     * @Type("string")
     */
    private $name;

    /**
     * @var string $type Composer package type, e.g. library, module
     * @Type("string")
     */
    private $type;

    /**
     * @var string $homepage URL to home page could be GitHub
     * @Type("string")
     */
    private $homepage;

    /**
     * @return string Composer package name
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @param string $name Composer package name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * @return string Composer package type, e.g. library, module
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * @param string $type Composer package type, e.g. library, module
     */
    public function setType($type)
    {
        $this->type = $type;
    }

    /**
     * @return string URL to home page could be GitHub
     */
    public function getHomepage()
    {
        return $this->homepage;
    }

    /**
     * @param string $homepage URL to home page could be GitHub
     */
    public function setHomepage($homepage)
    {
        $this->homepage = $homepage;
    }
}


text:
<?php

namespace Figaromedias\Bundle\DashboardBriefBundle\Admin;

use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;

use Figaromedias\Bundle\DashboardBriefBundle\Entity\Production as Production;

class ProductionAdmin extends Admin
{

    protected $datagridValues = array(
        '_page' => 1,            // display the first page (default = 1)
        '_sort_order' => 'DESC', // reverse order (default = 'ASC')
        '_sort_by' => 'created'  // name of the ordered field
    );

    /**
     * @param DatagridMapper $datagridMapper
     */
    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('id')
            ->add('proposition')
            ->add('status', 'doctrine_orm_choice', array(), 'choice', array(
                'choices' => Production::getStatusList(), // required, what to show for choices. note that the array key is the actual value to search for, the array value is the label to be displayed
                'expanded' => true, // optional, shows checkboxes or radio buttons depending if 'multiple' is true or false
                'multiple' => true,
                'required' => true,
                'attr'=>array('class'=>'list-inline '),
                'horizontal'=>true
            ))
            ->add('projectManager')
        ;
    }

    /**
     * @param ListMapper $listMapper
     */
    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->add('id', null, array('label' => '#'))
            ->add('proposition', null, array('label' => 'Dispositif'))
            ->add('proposition.isDigital', null, array('label' => 'Espace dédié digital sur mesure'))
            ->add('proposition.isDigitalGarden', null, array('label' => 'Espace dédié digital Garden'))
            ->add('proposition.nbContentDigital', null, array('label' => 'Nombre contenu digital'))
            ->add('proposition.nbContentPrint', null, array('label' => 'Nombre contenu print'))
            ->add('engagementVisitAsString', null, array('label' => 'Engagement visites'))
            ->add('proposition.budgetFraistechniqueHorsEditeur', null, array('label' => 'Total FT hors éditeur'))
            ->add('proposition.budgetFraistechniqueEditeur', null, array('label' => 'Total FT éditeur'))
            ->add('projectManager', null, array('label' => 'En charge'))
            ->add('proposition.commercialsAsString', null, array('label' => 'Commercial'))
            ->add('proposition.periodeStart', null, array('label' => 'Mise en ligne'))
            ->add('proposition.periodeStop', null, array('label' => 'Date de fin'))
            ->add('proposition.periodeLength', null, array('label' => 'Durée'))
            ->add('statusAsString', null, array('label' => 'Statut production', 'template' => 'DashboardBriefBundle:Admin:list_Production_Statut.html.twig',))

            ->add('_action', 'actions', array(
                'actions' => array(
                    'show' => array(),
                    'edit' => array(),
                    'delete' => array(),
                )
            ))
        ;
    }

    /**
     * @param FormMapper $formMapper
     */
    protected function configureFormFields(FormMapper $formMapper)
    {
        $em = $this->getConfigurationPool()->getContainer()->get('Doctrine')->getManager();
        $queryProposition = $em->createQueryBuilder('a')
            ->select('a')
            ->from('DashboardBriefBundle:Proposition', 'a')
            ->orderBy('a.id', 'DESC');
        $queryProjectManager = $em->createQueryBuilder('a')
            ->select('a')
            ->from('DashboardBriefBundle:ProjectManager', 'a')
            ->orderBy('a.name', 'ASC');

        $formMapper

            ->with('Projet', array(
                'class' => 'col-md-8'
            ))
                ->add('proposition')
                ->add('status','choice',array('choices'=> Production::getStatusList(),
                    'expanded'=>true,
                    'multiple'=>false, 'attr'=>array('class'=>'list-inline proposition-chance')))
                ->add('projectManager')
                ->add('engagementVisit', null, array('label' => 'Engagement visites en K'))
            ->end()

        ;
    }

    /**
     * @param ShowMapper $showMapper
     */
    protected function configureShowFields(ShowMapper $showMapper)
    {
        $showMapper
            ->add('id')
            ->add('proposition')
            ->add('status')
            ->add('projectManager')
            ->add('proposition.isDigital', null, array('label' => 'Espace dédié digital sur mesure'))
            ->add('proposition.isDigitalGarden', null, array('label' => 'Espace dédié digital Garden'))
            ->add('proposition.nbContentDigital', null, array('label' => 'Nombre contenu digital'))
            ->add('proposition.nbContentPrint', null, array('label' => 'Nombre contenu print'))
        ;
    }

    public  function getExportFields()
    {
        $fields = array(
            '#' => 'id'
            ,'Dispositif'=>'proposition'
            ,'Espace dédié digital sur mesure'=>'proposition.isDigital'
            ,'Espace dédié digital Garden'=>'proposition.isDigitalGarden'
            ,'Nombre contenu digital'=>'proposition.nbContentDigital'
            ,'Nombre contenu print'=>'proposition.nbContentPrint'
            ,'Engagement visites' => 'engagementVisitAsString'
            ,'Total FT hors éditeur' => 'proposition.budgetFraistechniqueHorsEditeur'
            ,'Total FT éditeur' => 'proposition.budgetFraistechniqueEditeur'
            ,'En charge' => 'projectManager'
            ,'Commercial' => 'proposition.commercialsAsString'
            ,'Mise en ligne' => 'proposition.periodeStart'
            ,'Date de fin' => 'proposition.periodeStop'
            ,'Durée' => 'proposition.periodeLength'
            ,'Statut production' => 'statusAsString'
        );
        return $fields;
    }
}


text:
import {beforeEachProviders, beforeEach, ddescribe, describe, expect, iit, inject, it, xit,} from '@angular/core/testing/testing_internal';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {TestComponentBuilder} from '@angular/compiler/testing';

import {Component, Injectable} from '@angular/core';
import {NgPlural, NgPluralCase, NgLocalization} from '@angular/common';

export function main() {
  describe('switch', () => {
    beforeEachProviders(() => [{provide: NgLocalization, useClass: TestLocalizationMap}]);

    it('should display the template according to the exact value',
       inject(
           [TestComponentBuilder, AsyncTestCompleter],
           (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
             var template = '
' +
                 '
' +
                 '<template ngPluralCase="=0">
you have no messages.
</template>' +
                 '<template ngPluralCase="=1">
you have one message.
</template>' +
                 '

';

             tcb.overrideTemplate(TestComponent, template)
                 .createAsync(TestComponent)
                 .then((fixture) => {
                   fixture.debugElement.componentInstance.switchValue = 0;
                   fixture.detectChanges();
                   expect(fixture.debugElement.nativeElement).toHaveText('you have no messages.');

                   fixture.debugElement.componentInstance.switchValue = 1;
                   fixture.detectChanges();
                   expect(fixture.debugElement.nativeElement).toHaveText('you have one message.');

                   async.done();
                 });
           }));

    it('should be applicable to <ng-container> elements',
       inject(
           [TestComponentBuilder, AsyncTestCompleter],
           (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
             var template = '
' +
                 '<ng-container [ngPlural]="switchValue">' +
                 '<template ngPluralCase="=0">you have no messages.</template>' +
                 '<template ngPluralCase="=1">you have one message.</template>' +
                 '</ng-container>
';

             tcb.overrideTemplate(TestComponent, template)
                 .createAsync(TestComponent)
                 .then((fixture) => {
                   fixture.debugElement.componentInstance.switchValue = 0;
                   fixture.detectChanges();
                   expect(fixture.debugElement.nativeElement).toHaveText('you have no messages.');

                   fixture.debugElement.componentInstance.switchValue = 1;
                   fixture.detectChanges();
                   expect(fixture.debugElement.nativeElement).toHaveText('you have one message.');

                   async.done();
                 });
           }));

    it('should display the template according to the category',
       inject(
           [TestComponentBuilder, AsyncTestCompleter],
           (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
             var template = '
' +
                 '
' +
                 '<template ngPluralCase="few">
you have a few messages.
</template>' +
                 '<template ngPluralCase="many">
you have many messages.
</template>' +
                 '

';

             tcb.overrideTemplate(TestComponent, template)
                 .createAsync(TestComponent)
                 .then((fixture) => {
                   fixture.debugElement.componentInstance.switchValue = 2;
                   fixture.detectChanges();
                   expect(fixture.debugElement.nativeElement)
                       .toHaveText('you have a few messages.');

                   fixture.debugElement.componentInstance.switchValue = 8;
                   fixture.detectChanges();
                   expect(fixture.debugElement.nativeElement).toHaveText('you have many messages.');

                   async.done();
                 });
           }));

    it('should default to other when no matches are found',
       inject(
           [TestComponentBuilder, AsyncTestCompleter],
           (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
             var template = '
' +
                 '
' +
                 '<template ngPluralCase="few">
you have a few messages.
</template>' +
                 '<template ngPluralCase="other">
default message.
</template>' +
                 '

';

             tcb.overrideTemplate(TestComponent, template)
                 .createAsync(TestComponent)
                 .then((fixture) => {
                   fixture.debugElement.componentInstance.switchValue = 100;
                   fixture.detectChanges();
                   expect(fixture.debugElement.nativeElement).toHaveText('default message.');

                   async.done();
                 });
           }));

    it('should prioritize value matches over category matches',
       inject(
           [TestComponentBuilder, AsyncTestCompleter],
           (tcb: TestComponentBuilder, async: AsyncTestCompleter) => {
             var template = '
' +
                 '
' +
                 '<template ngPluralCase="few">
you have a few messages.
</template>' +
                 '<template ngPluralCase="=2">you have two messages.</template>' +
                 '

';

             tcb.overrideTemplate(TestComponent, template)
                 .createAsync(TestComponent)
                 .then((fixture) => {
                   fixture.debugElement.componentInstance.switchValue = 2;
                   fixture.detectChanges();
                   expect(fixture.debugElement.nativeElement).toHaveText('you have two messages.');

                   fixture.debugElement.componentInstance.switchValue = 3;
                   fixture.detectChanges();
                   expect(fixture.debugElement.nativeElement)
                       .toHaveText('you have a few messages.');

                   async.done();
                 });
           }));
  });
}

@Injectable()
export class TestLocalizationMap extends NgLocalization {
  getPluralCategory(value: number): string {
    if (value > 1 && value < 4) {
      return 'few';
    } else if (value >= 4 && value < 10) {
      return 'many';
    } else {
      return 'other';
    }
  }
}

@Component({selector: 'test-cmp', directives: [NgPluralCase, NgPlural], template: ''})
class TestComponent {
  switchValue: number = null;
}


text:
#if !defined(__FSL_CLOCK_MANAGER_H__)
#define __FSL_CLOCK_MANAGER_H__

#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include "fsl_mcg_hal.h"
#include "fsl_sim_hal.h"

/*! @addtogroup clock_manager*/
/*! @{*/

/*! @file*/

/*******************************************************************************
 * Definitions
 ******************************************************************************/

/* system clocks definition (should be moved to other proper place) */
#define CPU_XTAL1hz_CLK_HZ          1
#define CPU_LPO_CLK_HZ           1000

/* external clock definition (should be moved to other proper place) */

#define SDHC0_CLKIN                 0   /* kSimSDHC0_CLKIN */
#define ENET_1588_CLKIN             0   /* kSimENET_1588_CLKIN */
#define EXTAL_Clock                 0   /* kSimEXTAL_Clock */
#define EXTAL1_Clock                0   /* kSimEXTAL1_Clock */
#define USB_CLKIN                   0   /* kSimUSB_CLKIN */

/* Table of base addresses for instances. */
extern const uint32_t g_simBaseAddr[];
extern const uint32_t g_mcgBaseAddr[];

/*!
 * @brief Error code definition for the clock manager APIs
 */
typedef enum _clock_manager_error_code {
    kClockManagerSuccess,                           /*!< success */
    kClockManagerNoSuchClockName,                   /*!< cannot find the clock name */
    kClockManagerNoSuchClockModule,                 /*!< cannot find the clock module name */
    kClockManagerNoSuchClockSource,                 /*!< cannot find the clock source name */
    kClockManagerNoSuchDivider,                     /*!< cannot find the divider name */
    kClockManagerUnknown                            /*!< unknown error*/
} clock_manager_error_code_t;

/*******************************************************************************
 * API
 ******************************************************************************/

#if defined(__cplusplus)
extern "C" {
#endif /* __cplusplus*/

/*! @name Clock Frequencies*/
/*@{*/

/*!
 * @brief Gets the clock frequency for a specific clock name.
 *
 * This function checks the current clock configurations and then calculates
 * the clock frequency for a specific clock name defined in clock_names_t.
 * The MCG must be properly configured before using this function. See
 * the reference manual for supported clock names for different chip families.
 * The returned value is in Hertz. If it cannot find the clock name
 * or the name is not supported for a specific chip family, it returns an
 * error.
 *
 * @param clockName Clock names defined in clock_names_t
 * @param frequency Returned clock frequency value in Hertz
 * @return status   Error code defined in clock_manager_error_code_t
 */
clock_manager_error_code_t CLOCK_SYS_GetFreq(clock_names_t clockName,
                                                        uint32_t *frequency);

/*!
 * @brief Sets the clock source setting.
 *
 * This function sets the settings for a specified clock source. Each clock
 * source has its own clock selection settings. See the chip reference manual for
 * clock source detailed settings and the sim_clock_source_names_t
 * for clock sources.
 *
 * @param clockSource Clock source name defined in sim_clock_source_names_t
 * @param setting     Setting value
 * @return status     If the clock source doesn't exist, it returns an error.
 */
clock_manager_error_code_t CLOCK_SYS_SetSource(clock_source_names_t clockSource,
                                               uint8_t setting);

/*!
 * @brief Gets the clock source setting.
 *
 * This function gets the settings for a specified clock source. Each clock
 * source has its own clock selection settings. See the reference manual for
 * clock source detailed settings and the sim_clock_source_names_t
 * for clock sources.
 *
 * @param clockSource Clock source name
 * @param setting     Current setting for the clock source
 * @return status     If the clock source doesn't exist, it returns an error.
 */
clock_manager_error_code_t CLOCK_SYS_GetSource(clock_source_names_t clockSource,
                                               uint8_t *setting);

/*!
 * @brief Sets the clock divider setting.
 *
 * This function sets the setting for a specified clock divider. See the
 * reference manual for a supported clock divider and value range and the
 * sim_clock_divider_names_t for dividers.
 *
 * @param clockDivider Clock divider name
 * @param divider      Divider setting
 * @return status      If the clock divider doesn't exist, it  returns an error.
 */
clock_manager_error_code_t CLOCK_SYS_SetDivider(clock_divider_names_t clockDivider,
                                                uint32_t setting);

/*!
 * @brief Gets the clock divider setting.
 *
 * This function gets the setting for a specified clock divider. See the
 * reference manual for a supported clock divider and value range and the
 * clock_divider_names_t for dividers.
 *
 * @param clockDivider Clock divider name
 * @param divider      Divider value pointer
 * @return status      If the clock divider doesn't exist, it returns an error.
 */
clock_manager_error_code_t CLOCK_SYS_GetDivider(clock_divider_names_t clockDivider,
                                                uint32_t *setting);

/*!
 * @brief Sets the clock out dividers setting.
 *
 * This function sets the setting for all clock out dividers at the same time.
 * See the reference manual for a supported clock divider and value range and the
 * clock_divider_names_t for clock out dividers.
 *
 * @param outdiv1      Outdivider1 setting
 * @param outdiv2      Outdivider2 setting
 * @param outdiv3      Outdivider3 setting
 * @param outdiv4      Outdivider4 setting
 */
static inline void CLOCK_SYS_SetOutDividers(uint32_t outdiv1, uint32_t outdiv2,
                                            uint32_t outdiv3, uint32_t outdiv4)
{
    CLOCK_HAL_SetOutDividers(g_simBaseAddr[0], outdiv1, outdiv2, outdiv3, outdiv4);
}

#if defined(__cplusplus)
}
#endif /* __cplusplus*/

/*! @}*/

/*
 * Include the cpu specific clock API header files.
 */
#if (defined(CPU_MK02FN128VFM10) || defined(CPU_MK02FN64VFM10) || defined(CPU_MK02FN128VLF10) || \
    defined(CPU_MK02FN64VLF10) || defined(CPU_MK02FN128VLH10) || defined(CPU_MK02FN64VLH10))

    #define K02F12810_SERIES

#elif (defined(CPU_MK20DX128VMP5) || defined(CPU_MK20DN128VMP5) || defined(CPU_MK20DX64VMP5) || \
    defined(CPU_MK20DN64VMP5) || defined(CPU_MK20DX32VMP5) || defined(CPU_MK20DN32VMP5) || \
    defined(CPU_MK20DX128VLH5) || defined(CPU_MK20DN128VLH5) || defined(CPU_MK20DX64VLH5) || \
    defined(CPU_MK20DN64VLH5) || defined(CPU_MK20DX32VLH5) || defined(CPU_MK20DN32VLH5) || \
    defined(CPU_MK20DX128VFM5) || defined(CPU_MK20DN128VFM5) || defined(CPU_MK20DX64VFM5) || \
    defined(CPU_MK20DN64VFM5) || defined(CPU_MK20DX32VFM5) || defined(CPU_MK20DN32VFM5) || \
    defined(CPU_MK20DX128VFT5) || defined(CPU_MK20DN128VFT5) || defined(CPU_MK20DX64VFT5) || \
    defined(CPU_MK20DN64VFT5) || defined(CPU_MK20DX32VFT5) || defined(CPU_MK20DN32VFT5) || \
    defined(CPU_MK20DX128VLF5) || defined(CPU_MK20DN128VLF5) || defined(CPU_MK20DX64VLF5) || \
    defined(CPU_MK20DN64VLF5) || defined(CPU_MK20DX32VLF5) || defined(CPU_MK20DN32VLF5))

    #define K20D5_SERIES

#elif (defined(CPU_MK22FN128VDC10) || defined(CPU_MK22FN128VLH10) || defined(CPU_MK22FN128VLL10) || \
    defined(CPU_MK22FN128VMP10))

    #define K22F12810_SERIES

    /* Clock System Level API header file */
    #include "MK22F12810/fsl_clock_K22F12810.h"

#elif (defined(CPU_MK22FN256VDC12) || defined(CPU_MK22FN256VLH12) || defined(CPU_MK22FN256VLL12) || \
    defined(CPU_MK22FN256VMP12))

    #define K22F25612_SERIES

    /* Clock System Level API header file */
    #include "MK22F25612/fsl_clock_K22F25612.h"

#elif (defined(CPU_MK22FN512VDC12) || defined(CPU_MK22FN512VLH12) || defined(CPU_MK22FN512VLL12))

    #define K22F51212_SERIES

    /* Clock System Level API header file */
    #include "MK22F51212/fsl_clock_K22F51212.h"

#elif (defined(CPU_MK24FN1M0VDC12) || defined(CPU_MK24FN1M0VLQ12))

    #define K24F12_SERIES

    /* Clock System Level API header file */
    #include "MK24F12/fsl_clock_K24F12.h"

#elif (defined(CPU_MK24FN256VDC12))

    #define K24F25612_SERIES

#elif (defined(CPU_MK63FN1M0VLQ12) || defined(CPU_MK63FN1M0VMD12))

    #define K63F12_SERIES

    /* Clock System Level API header file */
    #include "MK63F12/fsl_clock_K63F12.h"

#elif (defined(CPU_MK64FX512VDC12) || defined(CPU_MK64FN1M0VDC12) || defined(CPU_MK64FX512VLL12) || \
    defined(CPU_MK64FN1M0VLL12) || defined(CPU_MK64FX512VLQ12) || defined(CPU_MK64FN1M0VLQ12) || \
    defined(CPU_MK64FX512VMD12) || defined(CPU_MK64FN1M0VMD12))

    #define K64F12_SERIES

    /* Clock System Level API header file */
    #include "MK64F12/fsl_clock_K64F12.h"

#elif (defined(CPU_MK65FN2M0CAC18) || defined(CPU_MK65FX1M0CAC18) || defined(CPU_MK65FN2M0VMI18) || \
    defined(CPU_MK65FX1M0VMI18))

    #define K65F18_SERIES

#elif (defined(CPU_MK66FN2M0VLQ18) || defined(CPU_MK66FX1M0VLQ18) || defined(CPU_MK66FN2M0VMD18) || \
    defined(CPU_MK66FX1M0VMD18))

    #define K66F18_SERIES

#elif (defined(CPU_MK70FN1M0VMF12) || defined(CPU_MK70FX512VMF12) || defined(CPU_MK70FN1M0VMF15) || \
    defined(CPU_MK70FX512VMF15) || defined(CPU_MK70FN1M0VMJ12) || defined(CPU_MK70FX512VMJ12) || \
    defined(CPU_MK70FN1M0VMJ15) || defined(CPU_MK70FX512VMJ15))

    #define K70F12_SERIES

#elif (defined(CPU_MK70FN1M0VMF12) || defined(CPU_MK70FX512VMF12) || defined(CPU_MK70FN1M0VMF15) || \
    defined(CPU_MK70FX512VMF15) || defined(CPU_MK70FN1M0VMJ12) || defined(CPU_MK70FX512VMJ12) || \
    defined(CPU_MK70FN1M0VMJ15) || defined(CPU_MK70FX512VMJ15))

    #define K70F15_SERIES

#elif (defined(CPU_MKL02Z32CAF4) || defined(CPU_MKL02Z8VFG4) || defined(CPU_MKL02Z16VFG4) || \
    defined(CPU_MKL02Z32VFG4) || defined(CPU_MKL02Z16VFK4) || defined(CPU_MKL02Z32VFK4) || \
    defined(CPU_MKL02Z16VFM4) || defined(CPU_MKL02Z32VFM4))

    #define KL02Z4_SERIES

#elif (defined(CPU_MKL03Z32CAF4) || defined(CPU_MKL03Z8VFG4) || defined(CPU_MKL03Z16VFG4) || \
    defined(CPU_MKL03Z32VFG4) || defined(CPU_MKL03Z8VFK4) || defined(CPU_MKL03Z16VFK4) || \
    defined(CPU_MKL03Z32VFK4))

    #define KL03Z4_SERIES

#elif (defined(CPU_MKL05Z8VFK4) || defined(CPU_MKL05Z16VFK4) || defined(CPU_MKL05Z32VFK4) || \
    defined(CPU_MKL05Z8VLC4) || defined(CPU_MKL05Z16VLC4) || defined(CPU_MKL05Z32VLC4) || \
    defined(CPU_MKL05Z8VFM4) || defined(CPU_MKL05Z16VFM4) || defined(CPU_MKL05Z32VFM4) || \
    defined(CPU_MKL05Z16VLF4) || defined(CPU_MKL05Z32VLF4))

    #define KL05Z4_SERIES

#elif (defined(CPU_MKL13Z64VFM4) || defined(CPU_MKL13Z128VFM4) || defined(CPU_MKL13Z256VFM4) || \
    defined(CPU_MKL13Z64VFT4) || defined(CPU_MKL13Z128VFT4) || defined(CPU_MKL13Z256VFT4) || \
    defined(CPU_MKL13Z64VLH4) || defined(CPU_MKL13Z128VLH4) || defined(CPU_MKL13Z256VLH4) || \
    defined(CPU_MKL13Z64VMP4) || defined(CPU_MKL13Z128VMP4) || defined(CPU_MKL13Z256VMP4))

    #define KL13Z4_SERIES

#elif (defined(CPU_MKL23Z64VFM4) || defined(CPU_MKL23Z128VFM4) || defined(CPU_MKL23Z256VFM4) || \
    defined(CPU_MKL23Z64VFT4) || defined(CPU_MKL23Z128VFT4) || defined(CPU_MKL23Z256VFT4) || \
    defined(CPU_MKL23Z64VLH4) || defined(CPU_MKL23Z128VLH4) || defined(CPU_MKL23Z256VLH4) || \
    defined(CPU_MKL23Z64VMP4) || defined(CPU_MKL23Z128VMP4) || defined(CPU_MKL23Z256VMP4))

    #define KL23Z4_SERIES

#elif (defined(CPU_MKL25Z32VFM4) || defined(CPU_MKL25Z64VFM4) || defined(CPU_MKL25Z128VFM4) || \
    defined(CPU_MKL25Z32VFT4) || defined(CPU_MKL25Z64VFT4) || defined(CPU_MKL25Z128VFT4) || \
    defined(CPU_MKL25Z32VLH4) || defined(CPU_MKL25Z64VLH4) || defined(CPU_MKL25Z128VLH4) || \
    defined(CPU_MKL25Z32VLK4) || defined(CPU_MKL25Z64VLK4) || defined(CPU_MKL25Z128VLK4))

    #define KL25Z4_SERIES

    /* Clock System Level API header file */
    #include "MKL25Z4/fsl_clock_KL25Z4.h"

#elif (defined(CPU_MKL26Z32VFM4) || defined(CPU_MKL26Z64VFM4) || defined(CPU_MKL26Z128VFM4) || \
    defined(CPU_MKL26Z32VFT4) || defined(CPU_MKL26Z64VFT4) || defined(CPU_MKL26Z128VFT4) || \
    defined(CPU_MKL26Z32VLH4) || defined(CPU_MKL26Z64VLH4) || defined(CPU_MKL26Z128VLH4) || \
    defined(CPU_MKL26Z256VLH4) || defined(CPU_MKL26Z256VLK4) || defined(CPU_MKL26Z128VLL4) || \
    defined(CPU_MKL26Z256VLL4) || defined(CPU_MKL26Z128VMC4) || defined(CPU_MKL26Z256VMC4))

    #define KL26Z4_SERIES

#elif (defined(CPU_MKL33Z128VLH4) || defined(CPU_MKL33Z256VLH4) || defined(CPU_MKL33Z128VMP4) || \
    defined(CPU_MKL33Z256VMP4))

    #define KL33Z4_SERIES

#elif (defined(CPU_MKL43Z64VLH4) || defined(CPU_MKL43Z128VLH4) || defined(CPU_MKL43Z256VLH4) || \
    defined(CPU_MKL43Z64VMP4) || defined(CPU_MKL43Z128VMP4) || defined(CPU_MKL43Z256VMP4))

    #define KL43Z4_SERIES

#elif (defined(CPU_MKL46Z128VLH4) || defined(CPU_MKL46Z256VLH4) || defined(CPU_MKL46Z128VLL4) || \
    defined(CPU_MKL46Z256VLL4) || defined(CPU_MKL46Z128VMC4) || defined(CPU_MKL46Z256VMC4))

    #define KL46Z4_SERIES

#elif (defined(CPU_MKV30F128VFM10) || defined(CPU_MKV30F64VFM10) || defined(CPU_MKV30F128VLF10) || \
    defined(CPU_MKV30F64VLF10) || defined(CPU_MKV30F128VLH10) || defined(CPU_MKV30F64VLH10))

    #define KV30F12810_SERIES

#elif (defined(CPU_MKV31F128VLH10) || defined(CPU_MKV31F128VLL10))

    #define KV31F12810_SERIES

    /* Clock System Level API header file */
    #include "MKV31F12810/fsl_clock_KV31F12810.h"

#elif (defined(CPU_MKV31F256VLH12) || defined(CPU_MKV31F256VLL12))

    #define KV31F25612_SERIES

    /* Clock System Level API header file */
    #include "MKV31F25612/fsl_clock_KV31F25612.h"

#elif (defined(CPU_MKV31F512VLH12) || defined(CPU_MKV31F512VLL12))

    #define KV31F51212_SERIES

    /* Clock System Level API header file */
    #include "MKV31F51212/fsl_clock_KV31F51212.h"

#elif (defined(CPU_MKV40F128VLH15) || defined(CPU_MKV40F128VLL15) || defined(CPU_MKV40F256VLH15) || \
    defined(CPU_MKV40F256VLL15) || defined(CPU_MKV40F64VLH15))

    #define KV40F15_SERIES

#elif (defined(CPU_MKV43F128VLH15) || defined(CPU_MKV43F128VLL15) || defined(CPU_MKV43F64VLH15))

    #define KV43F15_SERIES

#elif (defined(CPU_MKV44F128VLH15) || defined(CPU_MKV44F128VLL15) || defined(CPU_MKV44F64VLH15))

    #define KV44F15_SERIES

#elif (defined(CPU_MKV45F128VLH15) || defined(CPU_MKV45F128VLL15) || defined(CPU_MKV45F256VLH15) || \
    defined(CPU_MKV45F256VLL15))

    #define KV45F15_SERIES

#elif (defined(CPU_MKV46F128VLH15) || defined(CPU_MKV46F128VLL15) || defined(CPU_MKV46F256VLH15) || \
    defined(CPU_MKV46F256VLL15))

    #define KV46F15_SERIES

#else
    #error "No valid CPU defined!"
#endif

#endif /* __FSL_CLOCK_MANAGER_H__*/
/*******************************************************************************
 * EOF
 ******************************************************************************/


text:
namespace yafic {

  const std::string NOT_FOUND = "Not found";

}


text:
package VMOMI::PhysicalNicSpec;
use parent 'VMOMI::DynamicData';

use strict;
use warnings;

our @class_ancestors = (
    'DynamicData',
);

our @class_members = (
    ['ip', 'HostIpConfig', 0, 1],
    ['linkSpeed', 'PhysicalNicLinkInfo', 0, 1],
);

sub get_class_ancestors {
    return @class_ancestors;
}

sub get_class_members {
    my $class = shift;
    my @super_members = $class->SUPER::get_class_members();
    return (@super_members, @class_members);
}

1;


text: The TNS listener usually listens on port 1521


text:
package com.jeecms.common.web.session;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

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

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;

import com.jeecms.common.web.Constants;
import com.jeecms.common.web.RequestUtils;
import com.jeecms.common.web.session.cache.SessionCache;
import com.jeecms.common.web.session.id.SessionIdGenerator;

/**
 * 使用Memcached分布式缓存实现Session
 */
public class CacheSessionProvider implements SessionProvider, InitializingBean {
	public static final String CURRENT_SESSION = "_current_session";
	public static final String CURRENT_SESSION_ID = "_current_session_id";

	@SuppressWarnings("unchecked")
	public Serializable getAttribute(HttpServletRequest request, String name) {
		// 为了避免同一个请求多次获取缓存session,所以将缓存session保存至request中。
		Map<String, Serializable> session = (Map<String, Serializable>) request
				.getAttribute(CURRENT_SESSION);
		if (session != null) {
			return session.get(name);
		}

		String root = (String) request.getAttribute(CURRENT_SESSION_ID);
		if (root == null) {
			root = RequestUtils.getRequestedSessionId(request);
		}
		if (StringUtils.isBlank(root)) {
			request.setAttribute(CURRENT_SESSION,
					new HashMap<String, Serializable>());
			return null;
		}
		session = sessionCache.getSession(root);
		if (session != null) {
			request.setAttribute(CURRENT_SESSION_ID, root);
			request.setAttribute(CURRENT_SESSION, session);
			return session.get(name);
		} else {
			return null;
		}
	}

	@SuppressWarnings("unchecked")
	public void setAttribute(HttpServletRequest request,
			HttpServletResponse response, String name, Serializable value) {
		Map<String, Serializable> session = (Map<String, Serializable>) request
				.getAttribute(CURRENT_SESSION);
		String root;
		if (session == null) {
			root = RequestUtils.getRequestedSessionId(request);
			if (root != null && root.length() == 32) {
				session = sessionCache.getSession(root);
			}
			if (session == null) {
				session = new HashMap<String, Serializable>();
				do {
					root = sessionIdGenerator.get();
				} while (sessionCache.exist(root));
				response.addCookie(createCookie(request, root));
			}
			request.setAttribute(CURRENT_SESSION, session);
			request.setAttribute(CURRENT_SESSION_ID, root);
		} else {
			root = (String) request.getAttribute(CURRENT_SESSION_ID);
			if (root == null) {
				do {
					root = sessionIdGenerator.get();
				} while (sessionCache.exist(root));
				response.addCookie(createCookie(request, root));
				request.setAttribute(CURRENT_SESSION_ID, root);
			}
		}
		session.put(name, value);
		sessionCache.setSession(root, session, sessionTimeout);
	}

	public String getSessionId(HttpServletRequest request,
			HttpServletResponse response) {
		String root = (String) request.getAttribute(CURRENT_SESSION_ID);
		if (root != null) {
			return root;
		}
		root = RequestUtils.getRequestedSessionId(request);
		if (root == null || root.length() != 32 || !sessionCache.exist(root)) {
			do {
				root = sessionIdGenerator.get();
			} while (sessionCache.exist(root));
			sessionCache.setSession(root, new HashMap<String, Serializable>(),
					sessionTimeout);
			response.addCookie(createCookie(request, root));
		}
		request.setAttribute(CURRENT_SESSION_ID, root);
		return root;
	}

	public void logout(HttpServletRequest request, HttpServletResponse response) {
		request.removeAttribute(CURRENT_SESSION);
		request.removeAttribute(CURRENT_SESSION_ID);
		String root = RequestUtils.getRequestedSessionId(request);
		if (!StringUtils.isBlank(root)) {
			sessionCache.clear(root);
			Cookie cookie = createCookie(request, null);
			cookie.setMaxAge(0);
			response.addCookie(cookie);
		}
	}

	private Cookie createCookie(HttpServletRequest request, String value) {
		Cookie cookie = new Cookie(Constants.JSESSION_COOKIE, value);
		String ctx = request.getContextPath();
		cookie.setPath(StringUtils.isBlank(ctx) ? "/" : ctx);
		return cookie;
	}

	public void afterPropertiesSet() throws Exception {
		Assert.notNull(sessionCache);
		Assert.notNull(sessionIdGenerator);
	}

	private SessionCache sessionCache;
	private SessionIdGenerator sessionIdGenerator;
	private int sessionTimeout = 30;

	public void setSessionCache(SessionCache sessionCache) {
		this.sessionCache = sessionCache;
	}

	/**
	 * 设置session过期时间
	 *
	 * @param sessionTimeout
	 *            分钟
	 */
	public void setSessionTimeout(int sessionTimeout) {
		Assert.isTrue(sessionTimeout > 0);
		this.sessionTimeout = sessionTimeout;
	}

	public void setSessionIdGenerator(SessionIdGenerator sessionIdGenerator) {
		this.sessionIdGenerator = sessionIdGenerator;
	}
}


text:
_I18n-amd internationalization library_

I18n.js is a library that helps working with internationalization on javascript. This library uses [amd](http://en.wikipedia.org/wiki/Asynchronous_module_definition) structure.
[![Build Status](https://travis-ci.org/elo7/i18n-amd.svg?branch=master)](https://travis-ci.org/elo7/i18n-amd)

## Install

Install with [npm](https://www.npmjs.com): `npm install elo7-i18n-amd`

## Dependency

I18n-amd depends on an [amd](http://en.wikipedia.org/wiki/Asynchronous_module_definition) implementation. We suggest [async-define](https://github.com/elo7/async-define) implementation for dependency lookup.
I18n-amd also depends on [ajax-amd](https://github.com/elo7/ajax-amd) and a stable version is already defined in `package.json`. You only need to install with [npm](https://www.npmjs.com) and load i18n-amd and ajax-amd files on your page.
I18n-amd expects an endpoint with the url "/i18n/{messageKey}" to return a JSON response with the following structure:
```js
{
	version: 1,
	message: "Confirm",
	key: "words.Confirm"
}
```
This one should be implemented on your web application.

For pluralized keys it's expect the following message structure:
```
{
	version: 1,
	message: "No product",
	key: "products.zero"
},
{
	version: 1,
	message: "One product",
	key: "products.one"
},
{
	version: 1,
	message: "{0} products",
	key: "products.other"
}
```

For formatted messages, it's expect the following message structure:
```js
{
	version: 1,
	message: "Hello {0}! Have a {1} day!",
	key: "args.example"
}
```

## Methods

#### get
`.get(key)`

###### Description:
Returns an internationalized message for the given key. This method caches the key, value and version on `localStorage` to avoid unecessary requests. The current version of your application is stored on `sessionStorage`, if the message version doesn't match current version, a new request is done to update the cached value with the new message.

###### Sample:
``` js
define(['i18n'], function(i18n) {
	// words.Confirm=Confirm
	i18n.get('words.Confirm'); // Returns "Confirm"
});
```
#### count
`.count(key, size)`

###### Description:
Returns the pluralized internationalized message for the given key. It's also replace `{0}` with the size parameter. This method uses `get` method and caches the message on the same way.

###### Sample:
``` js
define(['i18n'], function(i18n) {
	i18n.count('products', 0); // Returns "No product"
	i18n.count('products', 1); // Returns "One product"
	i18n.count('products', 2); // Returns "2 products"
});
```
#### args
`.args(key, args...)`

###### Description:
Returns internationalized message for the given key formatted with arguments. The message should contains `{n}` to be replaced with the argument[n]. This method also uses `get` method on background and caches the message on the same way.

###### Sample:
``` js
define(['i18n'], function(i18n) {
	i18n.args('args.example', 'Bielo', 'nice'); // Returns "Hello Bielo! Have a nice day!"
});
```

#### domain
`.domain("example.com")`

###### Description:
Sets an optional domain which i18n lib will make requests for the internationalization. This variable needs to be set before any `get()` usage if the domain isn't the same as the current page.

###### Sample:
``` js
define(['i18n'], function(i18n) {
	i18n.domain("some-domain.com");
});
```

## License

Event-amd is released under the [BSD](https://github.com/elo7/i18n-amd/blob/master/LICENSE). Have at it.

* * *

Copyright :copyright: 2019 Elo7# i18n-amd


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.javahris.springmvc.converter;

import java.beans.PropertyEditorSupport;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import org.joda.time.LocalDate;
import org.springframework.web.context.request.WebRequest;

/**
 *
 * @author jem
 */
public class DatePropertyEditor extends PropertyEditorSupport {
    private WebRequest webRequest;

    public DatePropertyEditor(WebRequest webRequest) {
        this.webRequest = webRequest;
    }

    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        Map<String, String[]> parameterMap = webRequest.getParameterMap();

        Integer year = Integer.valueOf(parameterMap.get("birthYear")[0]);
        Integer month = Integer.valueOf(parameterMap.get("birthMonth")[0]);
        Integer day = Integer.valueOf(parameterMap.get("birthDay")[0]);

        try {
            String value = String.format("%1$d-%2$d-%3$d", year, month, day);
            Date date = new SimpleDateFormat("yyyy-MM-dd").parse(value);
//            setValue(new SimpleDateFormat("yyyy-MM-dd").parse(value));
            setValue(LocalDate.fromDateFields(date));
        } catch (ParseException ex) {
            setValue(null);
        }
    }
}


text:
"""
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.

"""
from ambari_commons import OSCheck
from resource_management.libraries.functions import format
from resource_management.libraries.functions.default import default
from resource_management.libraries.functions.version import format_stack_version
from resource_management.libraries.functions.stack_features import check_stack_feature
from resource_management.libraries.functions import StackFeature
from resource_management.libraries.functions import get_kinit_path
from resource_management.libraries.script.script import Script

# a map of the Ambari role to the component name
# for use with <stack-root>/current/<component>
SERVER_ROLE_DIRECTORY_MAP = {
  'ZOOKEEPER_SERVER' : 'zookeeper-server',
  'ZOOKEEPER_CLIENT' : 'zookeeper-client'
}

component_directory = Script.get_component_from_role(SERVER_ROLE_DIRECTORY_MAP, "ZOOKEEPER_CLIENT")

config = Script.get_config()

if OSCheck.is_windows_family():
  zookeeper_win_service_name = "zkServer"
else:
  zk_pid_dir = config['configurations']['zookeeper-env']['zk_pid_dir']
  zk_pid_file = format("{zk_pid_dir}/zookeeper_server.pid")

  # Security related/required params
  hostname = config['hostname']
  security_enabled = config['configurations']['cluster-env']['security_enabled']
  kinit_path_local = get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
  tmp_dir = Script.get_tmp_dir()
  zk_user =  config['configurations']['zookeeper-env']['zk_user']

  stack_version_unformatted = str(config['hostLevelParams']['stack_version'])
  stack_version_formatted = format_stack_version(stack_version_unformatted)
  stack_root = Script.get_stack_root()

  config_dir = "/etc/zookeeper/conf"
  if stack_version_formatted and check_stack_feature(StackFeature.ROLLING_UPGRADE, stack_version_formatted):
    config_dir = format("{stack_root}/current/{component_directory}/conf")
stack_name = default("/hostLevelParams/stack_name", None)


text:
package goexpose

import (
	"fmt"
	"net/http"

	"time"

	"io/ioutil"
	"runtime/debug"

	"os"
	"strings"

	"github.com/golang/glog"
	"github.com/gorilla/mux"
)

var (
	logo = `
     ______  ______  ______ __  __  ______ ______  ______  ______
    /\  ___\/\  __ \/\  ___/\_\_\_\/\  == /\  __ \/\  ___\/\  ___\
    \ \ \__ \ \ \/\ \ \  __\/_/\_\/\ \  _-\ \ \/\ \ \___  \ \  __\
     \ \_____\ \_____\ \_____/\_\/\_\ \_\  \ \_____\/\_____\ \_____\
      \/_____/\/_____/\/_____\/_/\/_/\/_/   \/_____/\/_____/\/_____/
                                                            version: %v`
)

/*
Returns new server instance
*/
func NewServer(config *Config) (server *Server, err error) {
	server = &Server{
		Config:  config,
		Version: VERSION,
	}

	return
}

/*
Goexpose server
*/
type Server struct {

	// config instance
	Config *Config

	// Version
	Version string

	// Router
	Router *mux.Router
}

/*
Runs http server
*/
func (s *Server) Run() (err error) {

	glog.V(2).Infof(logo, s.Version)

	if s.Router, err = s.router(); err != nil {
		return
	}

	// construct listen from host and port
	listen := fmt.Sprintf("%s:%d", s.Config.Host, s.Config.Port)

	// ssl version
	if s.Config.SSL != nil {
		glog.Infof("Start listen on https://%s", listen)
		if err = http.ListenAndServeTLS(listen, s.Config.SSL.Cert, s.Config.SSL.Key, s.Router); err != nil {
			return
		}
	} else {
		glog.Infof("Start listen on http://%s", listen)
		if err = http.ListenAndServe(listen, s.Router); err != nil {
			return
		}
	}

	return
}

/*
Creates new mux.Router registers all tasks to it and returns it.
*/
func (s *Server) router(ignored ...string) (router *mux.Router, err error) {
	// create new router
	router = mux.NewRouter()
	router.NotFoundHandler = http.HandlerFunc(s.NotFoundHandler)

	var routes []*route
	if routes, err = s.routes(ignored...); err != nil {
		return
	}

	for _, route := range routes {
		// Log registered route
		glog.V(2).Infof("Register route for task: %s path: %s method: %v",
			route.TaskConfig.Type, route.Path, route.Method)

		// register route to router
		router.HandleFunc(route.Path, s.Handle(route.Task, route.Authorizers, route.EndpointConfig, route.TaskConfig)).Methods(route.Method).Name(route.EndpointConfig.RouteName())
	}

	return
}

/*
Route
*/
type route struct {
	Authorizers    Authorizers
	Method         string
	Path           string
	TaskConfig     *TaskConfig
	EndpointConfig *EndpointConfig
	Task           Tasker
}

/*
Returns prepared routes
*/
func (s *Server) routes(ignored ...string) (routes []*route, err error) {
	var (
		authorizers Authorizers
		factory     TaskFactory
		ok          bool
		tasks       []Tasker
	)

	routes = []*route{}
	// Get all authorizers
	if authorizers, err = GetAuthorizers(s.Config); err != nil {
		return
	}

Outer:
	for _, econfig := range s.Config.Endpoints {

		if err = econfig.Validate(); err != nil {
			return
		}

		for method, taskconf := range econfig.Methods {

			// ignored task
			for _, it := range ignored {
				if taskconf.Type == it {
					continue Outer
				}
			}

			// validate task config
			if err = taskconf.Validate(); err != nil {
				return
			}

			if factory, ok = getTaskFactory(taskconf.Type); !ok {
				err = fmt.Errorf("task %s doesn't exist", taskconf.Type)
				return
			}

			if tasks, err = factory(s, &taskconf, econfig); err != nil {
				err = fmt.Errorf("task %s returned error: %s", taskconf.Type, err)
				return
			}

			for _, task := range tasks {
				path := econfig.Path + task.Path()

				r := &route{
					Authorizers:    authorizers,
					EndpointConfig: econfig,
					Path:           path,
					Task:           task,
					TaskConfig:     &taskconf,
					Method:         method,
				}

				routes = append(routes, r)
			}

		}

	}
	return
}

/*
Handle func
*/
func (s *Server) Handle(task Tasker, authorizers Authorizers, ec *EndpointConfig, tc *TaskConfig) http.HandlerFunc {

	env := s.GetEnv()

	return func(w http.ResponseWriter, r *http.Request) {
		t := time.Now()
		defer func() {
			if e := recover(); e != nil {
				debug.PrintStack()
				NewResponse(http.StatusInternalServerError).Pretty(s.Config.PrettyJson).Error(e).Write(w, r, t)
			}
		}()

		// run authorizers on request
		if err := authorizers.Authorize(r, ec); err != nil {
			NewResponse(http.StatusUnauthorized).Write(w, r, t)
			return
		}

		// read request body
		var body = ""
		if r.Body != nil {
			if b, err := ioutil.ReadAll(r.Body); err != nil {
				body = string(b)
			}
		}

		/*
		 prepare data for task
		    mux vars are under "url"
		    cleaned query params are under "query"
		*/
		params := map[string]interface{}{
			"url":   mux.Vars(r),
			"query": s.GetQueryParams(r, ec),
			"request": map[string]interface{}{
				"method": r.Method,
				"body":   body,
			},
		}

		// reload environment every request?
		if s.Config.ReloadEnv {
			params["env"] = s.GetEnv()
		} else {
			params["env"] = env
		}

		// prepare response
		response := task.Run(r, params)

		// should i add params
		if ec.QueryParams != nil {
			if ec.QueryParams.ReturnParams {
				response = response.AddValue("params", params)
			}
		}

		mqp := ec.Methods[r.Method].QueryParams
		if mqp != nil {
			if mqp.ReturnParams && !response.HasValue("params") {
				response = response.AddValue("params", params)
			}
		}

		response.Write(w, r, t)
	}
}

/*
Handler for not found
*/
func (s *Server) NotFoundHandler(w http.ResponseWriter, r *http.Request) {
	t := time.Now()
	NewResponse(http.StatusNotFound).Write(w, r, t)
}

/*
Returns
*/
func (s *Server) GetQueryParams(r *http.Request, ec *EndpointConfig) (result map[string]string) {
	result = map[string]string{}
	if ec.QueryParams != nil {
		result = ec.QueryParams.GetParams(r)
		return
	}

	for k, v := range ec.Methods[r.Method].QueryParams.GetParams(r) {
		result[k] = v
	}

	return
}

/*
Get environment variables
*/
func (s *Server) GetEnv() map[string]interface{} {
	result := map[string]interface{}{}
	for _, v := range os.Environ() {
		splitted := strings.SplitN(v, "=", 2)
		if len(splitted) != 2 {
			continue
		}

		key, value := strings.TrimSpace(splitted[0]), strings.TrimSpace(splitted[1])
		result[key] = value
	}
	return result
}


text:
module Punchfork

  # Wrapper for recipe search results.  Provides dot syntax support.
  class Recipe

    def initialize(*args)
      @hash = args[0]
      @attributes = {}
      @hash.each do |k, v|
        instance_variable_set("@#{k}", v)
        self.class.class_eval{attr_reader k}
        @attributes[k] = v
      end
    end

    attr_reader :attributes

    def secure_thumb
      return Recipe.secure_url(thumb)
    end

    def self.secure_url(url)
      return url if url.match(/^https/)
      uri = URI.parse(url).tap{ |uri| uri.scheme = 'https'; uri.path = File.join('/', uri.host, uri.path); uri.host = 's3.amazonaws.com' }
      return uri.to_s
    end

  end
end


text:
""" Desktop Environments information """

# Enabled desktops

DESKTOPS = ["base", "cinnamon", "gnome", "kde4", "mate", "openbox", "xfce"]

DESKTOPS_DEV = DESKTOPS + ["enlightenment", "lxqt", "plasma5"]

DESKTOP_ICONS_PATH = "/usr/share/DSGos-Installer/data/icons"

'''
MENU - Size appropriate for menus (16px).
SMALL_TOOLBAR - Size appropriate for small toolbars (16px).
LARGE_TOOLBAR - Size appropriate for large toolbars (24px)
BUTTON - Size appropriate for buttons (16px )
DND - Size appropriate for drag and drop (32px )
DIALOG - Size appropriate for dialogs (48px )
'''

# Descriptive names
NAMES = {
    'base': "Base",
    'gnome': "GNOME",
    'cinnamon': "Cinnamon",
    'xfce': "Xfce",
    'openbox': "Openbox",
    'enlightenment': "Enlightenment",
    'kde4': "KDE 4",
    'plasma5': "KDE Plasma 5",
    'lxqt': "LXQt",
    'mate': "MATE"}

LIBS = {
    'gtk': ["cinnamon", "enlightenment", "gnome", "mate", "openbox", "xfce"],
    'qt': ["kde4", "lxqt", "plasma5"]}

ALL_FEATURES = ["aur", "bluetooth", "cups", "firefox", "fonts", "games", "graphic_drivers", "lamp", "lts", "office",
                "visual", "firewall", "smb"]

# Each desktop has its own available features
FEATURES = {
    'cinnamon': ["electronic", "computer", "aur", "bluetooth", "cups", "firefox", "firewall", "fonts", "games", "graphic_drivers", "lts",
                 "office", "smb"],
    'gnome': ["electronic", "computer", "aur", "bluetooth", "cups", "firefox", "firewall", "fonts", "games", "graphic_drivers", "lts",
              "office", "smb"],
    'kde4': ["electronic", "computer", "aur", "bluetooth", "cups", "firefox", "firewall", "fonts", "games", "graphic_drivers", "lts",
             "office", "smb"],
    'plasma5': ["electronic", "computer", "aur", "bluetooth", "cups", "firefox", "firewall", "fonts", "games", "graphic_drivers", "lts",
                "office", "smb"],
    'mate': ["electronic", "computer", "aur", "bluetooth", "cups", "firefox", "firewall", "fonts", "lts", "office", "games", "graphic_drivers", "smb"],
    'enlightenment': ["electronic", "computer", "aur", "bluetooth", "cups", "firefox", "firewall", "fonts", "games", "graphic_drivers", "lts",
                      "office", "smb"],
    'base': ["electronic", "computer", "aur", "cups", "fonts", "lamp", "lts"],
    'openbox': ["electronic", "computer", "aur", "bluetooth", "cups", "firefox", "firewall", "fonts", "games", "graphic_drivers", "lts",
                "office", "smb", "visual"],
    'lxqt': ["electronic", "computer", "aur", "bluetooth", "cups", "firefox", "firewall", "fonts", "games", "graphic_drivers", "lts",
             "office", "smb"],
    'xfce': ["electronic", "computer", "aur", "bluetooth", "cups", "firefox", "firewall", "fonts", "games", "graphic_drivers", "lts",
             "office", "smb"]}

# Session names for lightDM setup
SESSIONS = {
    'cinnamon': 'cinnamon',
    'gnome': 'gnome',
    'kde4': 'kde-plasma',
    'plasma5': 'kde-plasma',
    'mate': 'mate',
    'enlightenment': 'enlightenment',
    'openbox': 'openbox',
    'lxqt': 'lx-session',  # FIXME: check this!
    'xfce': 'xfce'}

# See http://docs.python.org/2/library/gettext.html "22.1.3.4. Deferred translations"
def _(message):
    return message

DESCRIPTIONS = {
    'gnome': _("GNOME 3 is an easy and elegant way to use your "
               "computer. It features the Activities Overview which "
               "is an easy way to access all your basic tasks. GNOME 3 is "
               "the default desktop in DSGos."),

    'cinnamon': _("Cinnamon is a fork of GNOME 3 developed "
                  "by (and for) Linux Mint. It provides users a more traditional desktop "
                  "interface along with the newest compositing techniques of GNOME 3. "
                  "Cinnamon is for users of all experience levels. "),

    'xfce': _("Xfce is a lightweight desktop environment. It aims to "
              "be fast and low on system resources, while remaining visually "
              "appealing and user friendly. It is a great option for use "
              "on older computers or those with low hardware specifications. "),

    'openbox': _("Openbox is a highly configurable, next generation window "
                 "manager with extensive standards support. It's default theme "
                 "is well known for its minimalistic appearance and flexibility. "
                 "Your desktop becomes cleaner, faster. Perfect for low hardware specifications, too."),

    'enlightenment': _("Enlightenment is not just a window manager for Linux/X11 "
                       "and others, but also a whole suite of libraries to help "
                       "you create beautiful user interfaces with much less work"),

    'kde4': _("If you are looking for a familiar working environment, KDE's "
              "Plasma Desktop offers all the tools required for a modern desktop "
              "computing experience so you can be productive right from the start."),

    'plasma5': _("Plasma 5.0 introduces a new major version of KDE's workspace offering. "
                 "It provides a visually updated core desktop experience that is easy to use "
                 "and familiar to the user. "),

    'lxqt': _("LXQt is an advanced, easy-to-use, and fast desktop environment "
              "based on Qt technologies. It has been tailored for users who "
              "value simplicity, speed, and an intuitive interface."),

    'base': _("This option will install DSGos as command-line only system, "
              "without any type of graphical interface. After the installation you can "
              "customize DSGos by installing packages with the command-line package manager."),

    'mate': _("An intuitive, attractive and lightweight desktop environment, fork of GNOME 2. "
              "MATE is one of the best options for use on older computers or those with low hardware "
              "specifications due to its lightweight yet very customizable set of features.")}

# Delete previous _() dummy declaration
del _


text:
import socket
import time

class PingTCP(object):

    def __init__(self):
        pass

    def ping_once(self, dest_addr, timeout):

        start_time = time.time()

        try:
            tcp_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
            tcp_socket.settimeout(timeout)
            tcp_socket.connect(dest_addr)
            tcp_socket.send('hello\r')
            tcp_socket.close()

            return time.time() - start_time
        except socket.timeout:
            return None
        except socket.error:
            raise socket.error

    def ping(self, host_name, port, timeout = 10, count = 5):

        ping_result_list = []

        try:
            dest_addr = socket.gethostbyname(host_name)
        except socket.gaierror, e:
            raise IOError('%s is not right hostname or ip' % host_name)

        for _ in xrange(count):
            ping_result = {'host_name' : host_name, 'dest_addr' : dest_addr, 'dest_port' : port}
            try:
                delay = self.ping_once((dest_addr, port), timeout)
                if delay is not None:
                    ping_result['result'] = 'success'
                    ping_result['delay'] = delay * 1000
                else:
                    ping_result['result'] = 'timeout'
            except socket.gaierror, e:
                ping_result['result'] = 'exception'
                ping_result['message'] = e

            ping_result_list.append(ping_result)

        return ping_result_list


text:
'use strict';

module.exports = function() {
	return function(req, res, next) {
		var diff = process.hrtime(req.log.logTime);

		req.log.logTime = undefined;
		req.log.elapsed = diff[0] * 1e9 + diff[1];

		print(2, JSON.stringify(req.log));

		next();
	};
};


text:
using System;
using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Mvc.ApplicationModels;

namespace Picums.Mvc.FeatureSlices
{
	internal sealed class FeatureConvention : IControllerModelConvention

	{
		public void Apply(ControllerModel controller)
		{
			controller.Properties.Add(
				"feature"
				, GetFeatureName(controller.ControllerType));

			var alternativeGroupingName = GetGroupView(controller.ControllerType);
			if (!string.IsNullOrEmpty(alternativeGroupingName))
			{
				controller.Properties.Add(
					"feature-group"
					, alternativeGroupingName);
			}
		}

		private string GetGroupView(TypeInfo controllerType)
		{
			var alternativeViewGroupingName = controllerType.GetCustomAttribute<GroupedLocationAttribute>();

			return alternativeViewGroupingName?.GrupeName ?? string.Empty;
		}

		private string GetFeatureName(TypeInfo controllerType)
		{
			var tokens = controllerType.FullName.Split('.');
			if (!tokens.Any(t => t == "Features"))
			{
				return "";
			}
			string featureName = tokens
			  .SkipWhile(t => !t.Equals("features", StringComparison.CurrentCultureIgnoreCase))
			  .Skip(1)
			  .Take(1)
			  .FirstOrDefault();

			return featureName;
		}
	}
}


text:
package com.sadc.game.gameobject.trackobject;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.sadc.game.gameobject.Player;

/**
 * @author f536985 (Tom Farello)
 */
public class BackgroundChange extends TrackObject {

    public BackgroundChange(float distance, int side) {
        setActive(true);
        setDistance(distance);
        setAngle(0);
        setWidth(180);
        if (side == 1) {
            setTexture(new Texture("datNightSky.png"));
        }
    }

    @Override
    public void update(float delta, Player player) {
        if (collide(player)) {
            setActive(false);
            player.changeBackground(getTexture());
        }
    }

    @Override
    public void draw(float delta, float playerDistance, SpriteBatch spriteBatch) { }

}


text:
require 'formula'

class Libzzip < Formula
  homepage 'http://sourceforge.net/projects/zziplib/'
  url 'https://downloads.sourceforge.net/project/zziplib/zziplib13/0.13.62/zziplib-0.13.62.tar.bz2'
  sha1 'cf8b642abd9db618324a1b98cc71492a007cd687'

  bottle do
    cellar :any
    sha1 "0054168728b77dcd9e1a73fdb1af945ad1ba9dd9" => :mavericks
    sha1 "d745e568d441b66c4bc9ccc920c22d0a1ce4e904" => :mountain_lion
    sha1 "a2191d35352eddb133bc838f587bf98764f32378" => :lion
  end

  option 'sdl', 'Enable SDL usage and create SDL_rwops_zzip.pc'
  option :universal

  depends_on 'pkg-config' => :build
  depends_on 'sdl' if build.include? 'sdl'

  conflicts_with 'zzuf', :because => 'both install `zzcat` binaries'

  def install
    if build.universal?
      ENV.universal_binary
      # See: https://sourceforge.net/tracker/?func=detail&aid=3511669&group_id=6389&atid=356389
      ENV["ac_cv_sizeof_long"] = "(LONG_BIT/8)"
    end

    args = %W[
      --without-debug
      --disable-dependency-tracking
      --prefix=#{prefix}
    ]
    args << '--enable-sdl' if build.include? 'sdl'
    system './configure', *args
    system 'make install'
    ENV.deparallelize   # fails without this when a compressed file isn't ready
    system 'make check' # runing this after install bypasses DYLD issues
  end
end


text:
var validName1 = "hi";
var VALIDNAME2 = "there";
var InvalidName1 = ",";
var invalid_name2 = " ";

class Test {
    private Invalid_name3 = "how";
    private _optionallyValid = "are";
}

function test() {
    () => {
        var InVaLiDnAmE4 = "you";
    };
}

declare var DeclaresAreValid: any;


text:
<%#
 Copyright 2013-2017 the original author or authors from the JHipster project.

 This file is part of the JHipster project, see http://www.jhipster.tech/
 for more information.

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

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

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-%>
(function() {
    'use strict';

    angular
        .module('<%=angularAppName%>')
        .config(stateConfig);

    stateConfig.$inject = ['$stateProvider'];

    function stateConfig($stateProvider) {
        $stateProvider.state('register', {
            parent: 'account',
            url: '/register',
            data: {
                authorities: [],
                pageTitle: 'register.title'
            },
            views: {
                'content@': {
                    templateUrl: 'app/account/register/register.html',
                    controller: 'RegisterController',
                    controllerAs: 'vm'
                }
            },
            resolve: {
                translatePartialLoader: ['$translate', '$translatePartialLoader', function ($translate, $translatePartialLoader) {
                    $translatePartialLoader.addPart('register');
                    return $translate.refresh();
                }]
            }
        });
    }
})();


text:
require_relative 'memphis/configuration'
require_relative 'memphis/client'
require_relative 'memphis/artist'
require_relative 'memphis/result'
require_relative 'memphis/version'

require 'httparty'
require 'multi_json'

module Memphis
  extend Configuration
end


text:
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/BlackrockDigital/startbootstrap-freelancer/master/LICENSE)
[![npm version](https://img.shields.io/npm/v/startbootstrap-freelancer.svg)](https://www.npmjs.com/package/startbootstrap-freelancer)
[![Build Status](https://travis-ci.org/BlackrockDigital/startbootstrap-freelancer.svg?branch=master)](https://travis-ci.org/BlackrockDigital/startbootstrap-freelancer)
[![dependencies Status](https://david-dm.org/BlackrockDigital/startbootstrap-freelancer/status.svg)](https://david-dm.org/BlackrockDigital/startbootstrap-freelancer)
[![devDependencies Status](https://david-dm.org/BlackrockDigital/startbootstrap-freelancer/dev-status.svg)](https://david-dm.org/BlackrockDigital/startbootstrap-freelancer?type=dev)

## Download and Installation

To begin using, choose one of the following options to get started:
* [Download the latest release ](https://github.com/luisdelacruzio/luis-delacruz-site/archive/master.zip)
* Clone the repo: `git clone git@github.com:luisdelacruzio/luis-delacruz-site.git`

## Usage

### Basic Usage

After downloading, simply edit the HTML and CSS files included with the template in your favorite text editor to make changes. These are the only files you need to worry about, you can ignore everything else! To preview the changes you make to the code, you can open the `index.html` file in your web browser.

### Advanced Usage

After installation, run `npm install` and then run `gulp dev` which will open up a preview of the template in your default browser, watch for changes to core template files, and live reload the browser when changes are saved. You can view the `gulpfile.js` to see which tasks are included with the dev environment.

#### Gulp Tasks

- `gulp` the default task that builds everything
- `gulp dev` browserSync opens the project in your default browser and live reloads when changes are made
- `gulp sass` compiles SCSS files into CSS
- `gulp minify-css` minifies the compiled CSS file
- `gulp minify-js` minifies the themes JS file
- `gulp copy` copies dependencies from node_modules to the vendor directory

## About

This site was based on Start Bootstrap. Start Bootstrap was created by and is maintained by **[David Miller](http://davidmiller.io/)**, Owner of [Blackrock Digital](http://blackrockdigital.io/).

* http://davidmiller.io
* https://twitter.com/davidmillerskt
* https://github.com/davidtmiller

Start Bootstrap is based on the [Bootstrap](http://getbootstrap.com/) framework created by [Mark Otto](https://twitter.com/mdo) and [Jacob Thorton](https://twitter.com/fat).

## Copyright and License

Copyright 2013-2017 Blackrock Digital LLC. Code released under the [MIT](https://github.com/BlackrockDigital/startbootstrap-freelancer/blob/gh-pages/LICENSE) license.


text:
using CK.Glouton.Model.Lucene.Searcher;
using Lucene.Net.Documents;
using Lucene.Net.Index;
using Lucene.Net.Search;

namespace CK.Glouton.Model.Lucene.Logs.Implementation
{
    public class InnerExceptionViewModel : IInnerExceptionViewModel
    {
        public string StackTrace { get; set; }
        public string Message { get; set; }
        public string FileName { get; set; }

        public static IInnerExceptionViewModel Get( ILuceneSearcher searcher, Document doc )
        {
            if( doc.GetField( LogField.INNER_EXCEPTION ) == null )
                return null;

            var exception = searcher.GetDocument( new TermQuery( new Term( LogField.INDEX_DTS, doc.Get( LogField.INNER_EXCEPTION ) ) ), 999 );

            return new InnerExceptionViewModel
            {
                StackTrace = exception.Get( LogField.STACKTRACE ),
                Message = exception.Get( LogField.MESSAGE ),
                FileName = exception.Get( LogField.SOURCE_FILE_NAME )
            };
        }
    }
}


text:
from azure.identity import DefaultAzureCredential
from azure.mgmt.quota import AzureQuotaExtensionAPI

"""
# PREREQUISITES
    pip install azure-identity
    pip install azure-mgmt-quota
# USAGE
    python quotas_usages_request_for_network.py

    Before run the sample, please set the values of the client ID, tenant ID and client secret
    of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
    AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
    https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""

def main():
    client = AzureQuotaExtensionAPI(
        credential=DefaultAzureCredential(),
    )

    response = client.usages.get(
        resource_name="MinPublicIpInterNetworkPrefixLength",
        scope="subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus",
    )
    print(response)

# x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkOneSkuUsages.json
if __name__ == "__main__":
    main()


text:
@interface DVTTextStorage : NSTextStorage
- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)string withUndoManager:(id)undoManager;
- (NSRange)lineRangeForCharacterRange:(NSRange)range;
- (NSRange)characterRangeForLineRange:(NSRange)range;
- (void)indentCharacterRange:(NSRange)range undoManager:(id)undoManager;
@end

@interface IDESourceCodeDocument : NSDocument

@property(readonly) DVTTextStorage *textStorage;

@end

@interface IDEEditor : NSObject

@property(readonly) IDESourceCodeDocument *sourceCodeDocument;

@end

@class IDESourceCodeEditor;

@interface IDESourceCodeEditor : IDEEditor
@property (retain) NSTextView *textView;
- (IDESourceCodeDocument *)sourceCodeDocument;
@end

@interface IDEEditorContext : NSObject
@property(retain, nonatomic) IDEEditor *editor;
@end

@interface IDEEditorArea : NSObject

@property(retain, nonatomic) IDEEditorContext *lastActiveEditorContext;

@end

@interface IDEWorkspaceWindowController : NSObject

@property(readonly) IDEEditorArea *editorArea;

@end

#endif


text:
package org.elasticsearch.benchmark.routing.allocation;

import org.elasticsearch.Version;
import org.elasticsearch.cluster.ClusterModule;
import org.elasticsearch.cluster.EmptyClusterInfoService;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodeRole;
import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.cluster.routing.allocation.AllocationService;
import org.elasticsearch.cluster.routing.allocation.FailedShard;
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.cluster.routing.allocation.allocator.BalancedShardsAllocator;
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDecider;
import org.elasticsearch.cluster.routing.allocation.decider.AllocationDeciders;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.common.util.set.Sets;
import org.elasticsearch.gateway.GatewayAllocator;
import org.elasticsearch.snapshots.EmptySnapshotsInfoService;

import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;

public final class Allocators {
    private static class NoopGatewayAllocator extends GatewayAllocator {
        public static final NoopGatewayAllocator INSTANCE = new NoopGatewayAllocator();

        @Override
        public void applyStartedShards(List<ShardRouting> startedShards, RoutingAllocation allocation) {
            // noop
        }

        @Override
        public void applyFailedShards(List<FailedShard> failedShards, RoutingAllocation allocation) {
            // noop
        }

        @Override
        public void allocateUnassigned(
            ShardRouting shardRouting,
            RoutingAllocation allocation,
            UnassignedAllocationHandler unassignedAllocationHandler
        ) {
            // noop
        }
    }

    private Allocators() {
        throw new AssertionError("Do not instantiate");
    }

    public static AllocationService createAllocationService(Settings settings) {
        return createAllocationService(settings, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS));
    }

    public static AllocationService createAllocationService(Settings settings, ClusterSettings clusterSettings) {
        return new AllocationService(
            defaultAllocationDeciders(settings, clusterSettings),
            NoopGatewayAllocator.INSTANCE,
            new BalancedShardsAllocator(settings),
            EmptyClusterInfoService.INSTANCE,
            EmptySnapshotsInfoService.INSTANCE
        );
    }

    public static AllocationDeciders defaultAllocationDeciders(Settings settings, ClusterSettings clusterSettings) {
        Collection<AllocationDecider> deciders = ClusterModule.createAllocationDeciders(settings, clusterSettings, Collections.emptyList());
        return new AllocationDeciders(deciders);
    }

    private static final AtomicInteger portGenerator = new AtomicInteger();

    public static DiscoveryNode newNode(String nodeId, Map<String, String> attributes) {
        return new DiscoveryNode(
            "",
            nodeId,
            new TransportAddress(TransportAddress.META_ADDRESS, portGenerator.incrementAndGet()),
            attributes,
            Sets.newHashSet(DiscoveryNodeRole.MASTER_ROLE, DiscoveryNodeRole.DATA_ROLE),
            Version.CURRENT
        );
    }
}