text:
class CampaignMonitor

  # Encapsulates
  class SubscriberBounce #:nodoc:
    attr_reader :email_address, :bounce_type, :list_id

    def initialize(email_address, list_id, bounce_type)
      @email_address = email_address
      @bounce_type = bounce_type
      @list_id = list_id
    end
  end

  # Encapsulates
  class SubscriberOpen #:nodoc:
    attr_reader :email_address, :list_id, :opens

    def initialize(email_address, list_id, opens)
      @email_address = email_address
      @list_id = list_id
      @opens = opens
    end
  end

  # Encapsulates
  class SubscriberClick #:nodoc:
    attr_reader :email_address, :list_id, :clicked_links

    def initialize(email_address, list_id, clicked_links)
      @email_address = email_address
      @list_id = list_id
      @clicked_links = clicked_links
    end
  end

  # Encapsulates
  class SubscriberUnsubscribe #:nodoc:
    attr_reader :email_address, :list_id

    def initialize(email_address, list_id)
      @email_address = email_address
      @list_id = list_id
    end
  end

end

redpajama_set_name: RedPajamaGithub


text:
package com.github.joshholl.intellij.csharp.lang.psi.impl;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static com.github.joshholl.intellij.csharp.lang.lexer.CSharpTokenTypes.*;
import com.intellij.extapi.psi.ASTWrapperPsiElement;
import com.github.joshholl.intellij.csharp.lang.psi.*;

public class CSharpConstantDeclaratorsImpl extends ASTWrapperPsiElement implements CSharpConstantDeclarators {

  public CSharpConstantDeclaratorsImpl(ASTNode node) {
    super(node);
  }

  public void accept(@NotNull PsiElementVisitor visitor) {
    if (visitor instanceof CSharpVisitor) ((CSharpVisitor)visitor).visitConstantDeclarators(this);
    else super.accept(visitor);
  }

  @Override
  @NotNull
  public List<CSharpConstantDeclarator> getConstantDeclaratorList() {
    return PsiTreeUtil.getChildrenOfTypeAsList(this, CSharpConstantDeclarator.class);
  }

}


text:
from fabric.state import output

from .development import *

#
# Fabric configuration
#
output['debug'] = False  # see full command list

def help():
    ''' Fabfile documentation '''
    local('python -c "import fabfile; help(fabfile)"')


text:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import time

# Replace the path specified below with the absolute path to chromedriver in your PC
driver = webdriver.Chrome('/PATH/TO/CHROMEDRIVER')

driver.get("https://web.whatsapp.com/")
wait = WebDriverWait(driver, 600)

# Replace 'Friend's Name' with the name of your friend
# or the name of a group
target = '"Friend\'s Name"'

# Replace the below string with your own message
string = "Message sent using Python!!!"

arg = '//span[contains(@title,' + target + ')]'
# Searches The Contact Name
group = wait.until(EC.presence_of_element_located((
    By.XPATH, arg)))
group.click()
inp = '//div[@class="input"][@dir="auto"][@data-tab="1"]'
inputAction = wait.until(EC.presence_of_element_located((
    By.XPATH, inp)))
for i in range(100):
 # Sends the Message
    inputAction.send_keys(string + Keys.ENTER)
    time.sleep(1)


text:
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// 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
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing
// permissions and limitations under the License.
namespace Microsoft.Hadoop.Client
{
    using System;
    using System.Collections.Generic;
    using System.Runtime.Serialization;

    /// <summary>
    /// Represents the result of list application attempts on an HDInsight cluster.
    /// </summary>
    [DataContract]
    internal class ApplicationAttemptListResult
    {
        /// <summary>
        /// Gets or sets the application attempts.
        /// </summary>
        [DataMember(Name = "appAttempt")]
        public IEnumerable<ApplicationAttemptGetResult> ApplicationAttempts { get; set; }
    }
}


text:
class Question < ActiveRecord::Base
has_many :answers
  accepts_nested_attributes_for :answers, allow_destroy: true

  def upvote
    self.vote_count += 1
    self.save
  end

  def downvote
    self.vote_count -= 1
    self.save
  end

end


text:
<?php

use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\RequestContext;

/**
 * appDevUrlMatcher
 *
 * This class has been auto-generated
 * by the Symfony Routing Component.
 */
class appDevUrlMatcher extends Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher
{
    /**
     * Constructor.
     */
    public function __construct(RequestContext $context)
    {
        $this->context = $context;
    }

    public function match($pathinfo)
    {
        $allow = array();
        $pathinfo = rawurldecode($pathinfo);
        $context = $this->context;
        $request = $this->request;

        if (0 === strpos($pathinfo, '/_')) {
            // _wdt
            if (0 === strpos($pathinfo, '/_wdt') && preg_match('#^/_wdt/(?P<token>[^/]++)$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => '_wdt')), array (  '_controller' => 'web_profiler.controller.profiler:toolbarAction',));
            }

            if (0 === strpos($pathinfo, '/_profiler')) {
                // _profiler_home
                if (rtrim($pathinfo, '/') === '/_profiler') {
                    if (substr($pathinfo, -1) !== '/') {
                        return $this->redirect($pathinfo.'/', '_profiler_home');
                    }

                    return array (  '_controller' => 'web_profiler.controller.profiler:homeAction',  '_route' => '_profiler_home',);
                }

                if (0 === strpos($pathinfo, '/_profiler/search')) {
                    // _profiler_search
                    if ($pathinfo === '/_profiler/search') {
                        return array (  '_controller' => 'web_profiler.controller.profiler:searchAction',  '_route' => '_profiler_search',);
                    }

                    // _profiler_search_bar
                    if ($pathinfo === '/_profiler/search_bar') {
                        return array (  '_controller' => 'web_profiler.controller.profiler:searchBarAction',  '_route' => '_profiler_search_bar',);
                    }

                }

                // _profiler_purge
                if ($pathinfo === '/_profiler/purge') {
                    return array (  '_controller' => 'web_profiler.controller.profiler:purgeAction',  '_route' => '_profiler_purge',);
                }

                // _profiler_info
                if (0 === strpos($pathinfo, '/_profiler/info') && preg_match('#^/_profiler/info/(?P<about>[^/]++)$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_info')), array (  '_controller' => 'web_profiler.controller.profiler:infoAction',));
                }

                // _profiler_phpinfo
                if ($pathinfo === '/_profiler/phpinfo') {
                    return array (  '_controller' => 'web_profiler.controller.profiler:phpinfoAction',  '_route' => '_profiler_phpinfo',);
                }

                // _profiler_search_results
                if (preg_match('#^/_profiler/(?P<token>[^/]++)/search/results$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_search_results')), array (  '_controller' => 'web_profiler.controller.profiler:searchResultsAction',));
                }

                // _profiler
                if (preg_match('#^/_profiler/(?P<token>[^/]++)$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler')), array (  '_controller' => 'web_profiler.controller.profiler:panelAction',));
                }

                // _profiler_router
                if (preg_match('#^/_profiler/(?P<token>[^/]++)/router$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_router')), array (  '_controller' => 'web_profiler.controller.router:panelAction',));
                }

                // _profiler_exception
                if (preg_match('#^/_profiler/(?P<token>[^/]++)/exception$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_exception')), array (  '_controller' => 'web_profiler.controller.exception:showAction',));
                }

                // _profiler_exception_css
                if (preg_match('#^/_profiler/(?P<token>[^/]++)/exception\\.css$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_exception_css')), array (  '_controller' => 'web_profiler.controller.exception:cssAction',));
                }

            }

            if (0 === strpos($pathinfo, '/_configurator')) {
                // _configurator_home
                if (rtrim($pathinfo, '/') === '/_configurator') {
                    if (substr($pathinfo, -1) !== '/') {
                        return $this->redirect($pathinfo.'/', '_configurator_home');
                    }

                    return array (  '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::checkAction',  '_route' => '_configurator_home',);
                }

                // _configurator_step
                if (0 === strpos($pathinfo, '/_configurator/step') && preg_match('#^/_configurator/step/(?P<index>[^/]++)$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => '_configurator_step')), array (  '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::stepAction',));
                }

                // _configurator_final
                if ($pathinfo === '/_configurator/final') {
                    return array (  '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::finalAction',  '_route' => '_configurator_final',);
                }

            }

        }

        // general_widget_homepage
        if (0 === strpos($pathinfo, '/hello') && preg_match('#^/hello/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
            return $this->mergeDefaults(array_replace($matches, array('_route' => 'general_widget_homepage')), array (  '_controller' => 'GeneralWidgetBundle:Default:index',));
        }

        // general_widget_profil_edit
        if (0 === strpos($pathinfo, '/Profil_edit') && preg_match('#^/Profil_edit/(?P<home_url>[^/]++)$#s', $pathinfo, $matches)) {
            return $this->mergeDefaults(array_replace($matches, array('_route' => 'general_widget_profil_edit')), array (  '_controller' => 'General\\WidgetBundle\\Controller\\WidgetController::login_editAction',));
        }

        if (0 === strpos($pathinfo, '/h')) {
            if (0 === strpos($pathinfo, '/hello')) {
                // dbormoldcsi_homepage
                if (preg_match('#^/hello/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => 'dbormoldcsi_homepage')), array (  '_controller' => 'DBORM\\OLDCSIBundle\\Controller\\DefaultController::indexAction',));
                }

                // dbormcsi_homepage
                if (preg_match('#^/hello/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => 'dbormcsi_homepage')), array (  '_controller' => 'DBORM\\CSIBundle\\Controller\\DefaultController::indexAction',));
                }

            }

            // rmcargo_dashboard_rh_homepage
            if ($pathinfo === '/home') {
                return array (  '_controller' => 'RMCARGO\\DashboardRHBundle\\Controller\\DefaultController::indexAction',  '_route' => 'rmcargo_dashboard_rh_homepage',);
            }

            // rmcargo_dashboard_chief_sector_homepage
            if (0 === strpos($pathinfo, '/hello') && preg_match('#^/hello/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'rmcargo_dashboard_chief_sector_homepage')), array (  '_controller' => 'RMCARGO\\DashboardChiefSectorBundle\\Controller\\DefaultController::indexAction',));
            }

        }

        // general_login_homepage
        if (rtrim($pathinfo, '/') === '') {
            if (substr($pathinfo, -1) !== '/') {
                return $this->redirect($pathinfo.'/', 'general_login_homepage');
            }

            return array (  '_controller' => 'General\\LoginBundle\\Controller\\LoginController::indexAction',  '_route' => 'general_login_homepage',);
        }

        // general_logout
        if ($pathinfo === '/logout') {
            return array (  '_controller' => 'General\\LoginBundle\\Controller\\LoginController::logoutAction',  '_route' => 'general_logout',);
        }

        // rmcargo_dashboard_admin_homepage
        if ($pathinfo === '/Admin_Dashboard') {
            return array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::indexAction',  '_route' => 'rmcargo_dashboard_admin_homepage',);
        }

        // rmcargo_dashboard_db_purge_stat
        if (0 === strpos($pathinfo, '/requested_purge_b152ddb696c856ae242230edc26e8b4a3359eb246c_stat') && preg_match('#^/requested_purge_b152ddb696c856ae242230edc26e8b4a3359eb246c_stat/(?P<status>[^/]++)$#s', $pathinfo, $matches)) {
            return $this->mergeDefaults(array_replace($matches, array('_route' => 'rmcargo_dashboard_db_purge_stat')), array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::purge_statusAction',));
        }

        // rmcargo_dashboard_admin_data_details
        if ($pathinfo === '/admin_data_details') {
            return array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::data_detailsAction',  '_route' => 'rmcargo_dashboard_admin_data_details',);
        }

        // rmcargo_dashboard_admin_purge_monitoring
        if ($pathinfo === '/purge_monitoring') {
            return array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::clean_monitoringAction',  '_route' => 'rmcargo_dashboard_admin_purge_monitoring',);
        }

        if (0 === strpos($pathinfo, '/robot_pc_monitoring')) {
            // rmcargo_dashboard_admin_robot_pc_monitoring
            if ($pathinfo === '/robot_pc_monitoring') {
                return array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::robot_pc_monitoringAction',  '_route' => 'rmcargo_dashboard_admin_robot_pc_monitoring',);
            }

            // rmcargo_dashboard_admin_robot_pc_delete
            if (0 === strpos($pathinfo, '/robot_pc_monitoring_delete') && preg_match('#^/robot_pc_monitoring_delete/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'rmcargo_dashboard_admin_robot_pc_delete')), array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::delete_pcAction',));
            }

        }

        if (0 === strpos($pathinfo, '/user')) {
            if (0 === strpos($pathinfo, '/user_')) {
                // rmcargo_dashboard_admin_users_monitoring
                if ($pathinfo === '/user_monitoring') {
                    return array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::users_monitoringAction',  '_route' => 'rmcargo_dashboard_admin_users_monitoring',);
                }

                // rmcargo_dashboard_admin_user_delete
                if (0 === strpos($pathinfo, '/user_delete') && preg_match('#^/user_delete/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => 'rmcargo_dashboard_admin_user_delete')), array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::delete_userAction',));
                }

                // rmcargo_dashboard_admin_user_edit
                if (0 === strpos($pathinfo, '/user_edit') && preg_match('#^/user_edit/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
                    return $this->mergeDefaults(array_replace($matches, array('_route' => 'rmcargo_dashboard_admin_user_edit')), array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::user_editAction',));
                }

            }

            // rmcargo_dashboard_admin_users_search
            if (rtrim($pathinfo, '/') === '/users_search') {
                if (substr($pathinfo, -1) !== '/') {
                    return $this->redirect($pathinfo.'/', 'rmcargo_dashboard_admin_users_search');
                }

                return array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::users_searchAction',  '_route' => 'rmcargo_dashboard_admin_users_search',);
            }

        }

        if (0 === strpos($pathinfo, '/group_')) {
            // rmcargo_dashboard_admin_group_monitoring
            if (rtrim($pathinfo, '/') === '/group_monitoring') {
                if (substr($pathinfo, -1) !== '/') {
                    return $this->redirect($pathinfo.'/', 'rmcargo_dashboard_admin_group_monitoring');
                }

                return array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::group_monitoringAction',  '_route' => 'rmcargo_dashboard_admin_group_monitoring',);
            }

            // rmcargo_dashboard_admin_group_delete
            if (0 === strpos($pathinfo, '/group_delete') && preg_match('#^/group_delete/(?P<id>[^/]++)$#s', $pathinfo, $matches)) {
                return $this->mergeDefaults(array_replace($matches, array('_route' => 'rmcargo_dashboard_admin_group_delete')), array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::delete_groupAction',));
            }

        }

        // rmcargo_dashboard_admin_prio_monitoring
        if ($pathinfo === '/prio_monitoring') {
            return array (  '_controller' => 'RMCARGO\\DashboardAdminBundle\\Controller\\AdminController::prio_monitoringAction',  '_route' => 'rmcargo_dashboard_admin_prio_monitoring',);
        }

        // rmcargo_dashboard_fa_homepage
        if ($pathinfo === '/FA_Dashboard') {
            return array (  '_controller' => 'RMCARGO\\DashboardFABundle\\Controller\\HomeController::indexAction',  '_route' => 'rmcargo_dashboard_fa_homepage',);
        }

        // hello_the_world
        if ($pathinfo === '/backlog') {
            return array (  '_controller' => 'RMCARGO\\DashboardFABundle\\Controller\\BacklogController::indexAction',  '_route' => 'hello_the_world',);
        }

        throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
    }
}


text:
.class final Landroid/transition/ChangeTransform$2;
.super Landroid/util/Property;
.source "ChangeTransform.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/transition/ChangeTransform;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/util/Property",
        "<",
        "Landroid/transition/ChangeTransform$PathAnimatorMatrix;",
        "Landroid/graphics/PointF;",
        ">;"
    }
.end annotation

# direct methods
.method constructor <init>(Ljava/lang/Class;Ljava/lang/String;)V
    .locals 0
    .param p2, "$anonymous1"    # Ljava/lang/String;

    .prologue
    .line 82
    .local p1, "$anonymous0":Ljava/lang/Class;, "Ljava/lang/Class<Landroid/graphics/PointF;>;"
    invoke-direct {p0, p1, p2}, Landroid/util/Property;-><init>(Ljava/lang/Class;Ljava/lang/String;)V

    return-void
.end method

# virtual methods
.method public get(Landroid/transition/ChangeTransform$PathAnimatorMatrix;)Landroid/graphics/PointF;
    .locals 1
    .param p1, "object"    # Landroid/transition/ChangeTransform$PathAnimatorMatrix;

    .prologue
    .line 85
    const/4 v0, 0x0

    return-object v0
.end method

.method public bridge synthetic get(Ljava/lang/Object;)Ljava/lang/Object;
    .locals 1
    .param p1, "object"    # Ljava/lang/Object;

    .prologue
    .line 84
    check-cast p1, Landroid/transition/ChangeTransform$PathAnimatorMatrix;

    .end local p1    # "object":Ljava/lang/Object;
    invoke-virtual {p0, p1}, Landroid/transition/ChangeTransform$2;->get(Landroid/transition/ChangeTransform$PathAnimatorMatrix;)Landroid/graphics/PointF;

    move-result-object v0

    return-object v0
.end method

.method public set(Landroid/transition/ChangeTransform$PathAnimatorMatrix;Landroid/graphics/PointF;)V
    .locals 0
    .param p1, "object"    # Landroid/transition/ChangeTransform$PathAnimatorMatrix;
    .param p2, "value"    # Landroid/graphics/PointF;

    .prologue
    .line 90
    invoke-virtual {p1, p2}, Landroid/transition/ChangeTransform$PathAnimatorMatrix;->setTranslation(Landroid/graphics/PointF;)V

    .line 89
    return-void
.end method

.method public bridge synthetic set(Ljava/lang/Object;Ljava/lang/Object;)V
    .locals 0
    .param p1, "object"    # Ljava/lang/Object;
    .param p2, "value"    # Ljava/lang/Object;

    .prologue
    .line 89
    check-cast p1, Landroid/transition/ChangeTransform$PathAnimatorMatrix;

    .end local p1    # "object":Ljava/lang/Object;
    check-cast p2, Landroid/graphics/PointF;

    .end local p2    # "value":Ljava/lang/Object;
    invoke-virtual {p0, p1, p2}, Landroid/transition/ChangeTransform$2;->set(Landroid/transition/ChangeTransform$PathAnimatorMatrix;Landroid/graphics/PointF;)V

    return-void
.end method


text:
import { Types } from "mongoose";
import { Validatable } from "../../app/index";
import { FoodItemBase } from "./FoodItemBase";

export class FoodItemUnit extends FoodItemBase implements Validatable {

  public clone = (foodItemUnit: FoodItemUnit): this => {
    if (!foodItemUnit) {
      return undefined;
    }
    this._id = foodItemUnit._id ? foodItemUnit._id : undefined;
    this.name = foodItemUnit.name;
    this.createDates();
    return this;
  }
}


text:
import ma = require('azure-pipelines-task-lib/mock-answer');
import tmrm = require('azure-pipelines-task-lib/mock-run');
import path = require('path');

let taskPath = path.join(__dirname, '..', 'ftpuploadtask.js');
let tr: tmrm.TaskMockRunner = new tmrm.TaskMockRunner(taskPath);

tr.setInput('credsType', 'inputs');
tr.setInput('serverUrl', 'ftps://');
tr.setInput('username', 'username');
tr.setInput('password', 'password');
tr.setInput('rootFolder', 'rootFolder');
tr.setInput('filePatterns', '**');
tr.setInput('remotePath', '/upload/');
tr.setInput('clean', 'true');
tr.setInput('overwrite', 'true');
tr.setInput('preservePaths', 'true');
tr.setInput('trustSSL', 'true');
process.env["ENDPOINT_URL_ID1"] = "ftp://valid.microsoft.com";
process.env["ENDPOINT_AUTH_ID1"] = "{\"scheme\":\"UsernamePassword\", \"parameters\": {\"username\": \"uname\", \"password\": \"pword\"}}";
process.env["build.sourcesDirectory"] = "/";

// provide answers for task mock
let a: ma.TaskLibAnswers = <ma.TaskLibAnswers>{
    "exist": {
        "rootFolder": true
    },
    "find": {
        "rootFolder": [
            "rootFolder/a",
            "rootFolder/b",
            "rootFolder/c"
        ]
    },
    "match": {
        "*": [
            "rootFolder/a",
            "rootFolder/b",
            "rootFolder/c"
        ]
    }
};
tr.setAnswers(a);

tr.run();


text:
import hashlib
from datetime import datetime
from werkzeug import security
from ._base import db, JuneQuery, SessionMixin

__all__ = ['Account', 'NonAccount']

class Account(db.Model, SessionMixin):
    query_class = JuneQuery

    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.String(40), unique=True, index=True,
                         nullable=False)
    email = db.Column(db.String(200), nullable=False, unique=True, index=True)
    password = db.Column(db.String(100), nullable=False)

    screen_name = db.Column(db.String(80))
    description = db.Column(db.String(400))
    city = db.Column(db.String(200))
    website = db.Column(db.String(400))

    role = db.Column(db.String(10), default='new')
    active = db.Column(db.DateTime, default=datetime.utcnow)

    created = db.Column(db.DateTime, default=datetime.utcnow)
    token = db.Column(db.String(20))

    def __init__(self, **kwargs):
        self.token = self.create_token(16)

        if 'password' in kwargs:
            raw = kwargs.pop('password')
            self.password = self.create_password(raw)

        if 'username' in kwargs:
            username = kwargs.pop('username')
            self.username = username.lower()

        if 'email' in kwargs:
            email = kwargs.pop('email')
            self.email = email.lower()

        for k, v in kwargs.items():
            setattr(self, k, v)

    def __str__(self):
        return self.screen_name or self.username

    def __repr__(self):
        return '<Account: %s>' % self.username

    def avatar(self, size=48):
        md5email = hashlib.md5(self.email).hexdigest()
        query = "%s?s=%s%s" % (md5email, size, db.app.config['GRAVATAR_EXTRA'])
        return db.app.config['GRAVATAR_BASE_URL'] + query

    @staticmethod
    def create_password(raw):
        passwd = '%s%s' % (raw, db.app.config['PASSWORD_SECRET'])
        return security.generate_password_hash(passwd)

    @staticmethod
    def create_token(length=16):
        return security.gen_salt(length)

    @property
    def is_staff(self):
        if self.id == 1:
            return True
        return self.role == 'staff' or self.role == 'admin'

    @property
    def is_admin(self):
        return self.id == 1 or self.role == 'admin'

    def check_password(self, raw):
        passwd = '%s%s' % (raw, db.app.config['PASSWORD_SECRET'])
        return security.check_password_hash(self.password, passwd)

    def change_password(self, raw):
        self.password = self.create_password(raw)
        self.token = self.create_token()
        return self

class NonAccount(object):
    """Non Account is a model designed for the deleted account.
    Since the account is deleted, the topics and replies will has no
    account related to them, in such cases, a `NonAccount` is used."""

    username = 'none'
    is_staff = False
    is_admin = False

    def __str__(self):
        return 'none'

    def __repr__(self):
        return '<NonAccount: none>' % self.username


text:
package org.apache.commons.jcs3.jcache.proxy;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

public class ExceptionWrapperHandler<T> implements InvocationHandler
{
    private final T delegate;
    private final Constructor<? extends RuntimeException> wrapper;

    public ExceptionWrapperHandler(final T delegate, final Class<? extends RuntimeException> exceptionType)
    {
        this.delegate = delegate;
        try
        {
            this.wrapper = exceptionType.getConstructor(Throwable.class);
        }
        catch (final NoSuchMethodException e)
        {
            throw new IllegalStateException(e);
        }
    }

    @Override
    public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable
    {
        try
        {
            return method.invoke(delegate, args);
        }
        catch (final InvocationTargetException ite)
        {
            final Throwable e = ite.getCause();
            if (RuntimeException.class.isInstance(e))
            {
                final RuntimeException re;
                try
                {
                    re = wrapper.newInstance(e);
                }
                catch (final Exception e1)
                {
                    throw new IllegalArgumentException(e1);
                }
                throw re;
            }
            throw e;
        }
    }

    public static <T> T newProxy(final ClassLoader loader, final T delegate, final Class<? extends RuntimeException> exceptionType,
            final Class<T> apis)
    {
        return (T) Proxy.newProxyInstance(loader, new Class<?>[] { apis }, new ExceptionWrapperHandler<>(delegate, exceptionType));
    }
}


text:
package org.apache.manifoldcf.crawler.connectors.generic.api;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "seed")
public class Seed {

  @XmlAttribute(name = "id", required = true)
  public String id;
}


text:
brackets-xunit
===========

A brackets extension to detect and run various test tools against the currently edited brackets program.  The plugin
currently supports jasmine, jasmine-node, YUI3, qunit, and test262 testing frameworks.  The plugin also can run any script
if it is executable and contains #!/usr/bin/env on the first line.  For example a node, python, or bash script can be executed.
Selecting Run Script on the context menu will invoke a new window containing the stdout and stderr of the script output.

Installation
===========

1. Select File/Install Extension... from the Brackets main menu
2. In the url field specify https://github.com/dschaffe/brackets-xunit
3. Create a unit test in brackets or open a test in the brackets-xunit/samples directory from the extensions directory
4. Right click on the script file in the sidebar
5. Select Run Unit Test from the context menu
6. The results will appear in new window

Usage
=====

Here is a 5 minute youtube video: http://www.youtube.com/watch?v=lcxx49RoZP8

The goal is for the xunit extension is to make creating and maintaining unit tests easier.   The extension will detect several types of javascript
unit tests and provide functionality to run the unit test from the context menu by right clicking on a file in the project sidebar.  The extension
also generates skeleton unit tests for a file when the user select Generate xunit test from the context menu.

Implementation Notes
============

Currently supports jasmine, YUI3, and qunit.  The script detects the type by looking for "brackets-xunit: <type>" where <type> is
jasmine, yui, qunit, and test262.  If no type tag exists the extension looks for patterns to determine if the file is of a particular type.
For example if a file contains describe() and it() functions the Run jasmine xunit test menu item appears.

If a javascript file is not detected as a unit test the context menu will contain Generate Jasmine xUnit test, Generate Qunit xUnit Test, and
Generate YUI xUnit Test.  Each selection will generate a test file with assertions for each function defined in the file.  The skeleton generates
the basic structure of the test and may then be customized with actual parameter values and expected return values.

The extension also supports an annotation to include external files.  For example the samples/jasmine/PlayerSpec.js test requires SpecHelper.js,
src/Player.js, and src/Song.js to be loaded into the html wrapper file.  In a comment:
    /* brackets-xunit: includes=SpecHelper.js,src/Player.js,src/Song.js */

In the generated html the following is added into the head section based upon the comment:
    <script src="samples/jasmine/SpecHelper.js"></script>
    <script src="samples/jasmine/src/Player.js"></script>
    <script src="samples/jasmine/src/Song.js"></script>

Let me know if you have any suggestions or issues.  Contact me at: dschaffe@adobe.com.

The test262 support was moved into a separate extension https://github.com/dschaffe/brackets-test262.

To disable the brackets-xunit menu items for a project, create a config.js in the project root directory containing:
   {
       'brackets-xunit' : 'disable'
   }

Limitations and Future Enhancements
============

* Want to support mocha testing framework and any others requested.
* Want to improve generated test code to be jslint compliant.
* Interested in generating test templates based on parsing an existing api to help generate or start tests.

Change Log
=========

* 03-21-2013 Initial commit
* 04-01-2013 added qunit, test262, and script support
* 04-17-2013 added test generation support for jasmine, qunit, yui.  jasmine supports AMD/require syntax


text:
package org.sagebionetworks.table.query.util;

/**
 * Simple aggregate queries always return one row so count queries are not necessary.
 *
 */
public class SimpleAggregateQueryException extends Exception {

	private static final long serialVersionUID = 1L;

	public SimpleAggregateQueryException() {
		super();
	}

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

}


text:
# dBEAR

Common basics for Entity-Attribute-Relation databases.

## Install

    $ npm install
    $ npm i -g mocha

## Usage

    $ node ./src/dbear.js --help

    Usage: dbear [options] [command]

    Commands:

        validate   Validate incoming DEM (XML or JSON)
        convert    Convert DEM from one format to another (XML to JSON, for example)
        generate   Parse incoming DEM and create tables in DB
        analyze    Analize given DB and create outgoing DEM

    Options:

        -h, --help                 output usage information
        -V, --version              output the version number
        -d, --db-dialect [value]   RDBMS dialect (mariadb|postgres|mysql), default: mariadb
        -H, --db-host [value]      Host to connect to, default: localhost
        -n, --db-name [value]      Database name to connect to, default: sample
        -u, --db-user [value]      User name to create database connection, default: sample
        -p, --db-password [value]  Password to create database connection, default: sample
        -i, --in [value]           Input DEM file (XML or JSON)
        -o, --out [value]          Output DEM file (JSON)

### Convert XML DEM to JSON DEM

    $ node ./src/dbear.js --in ./sample/sample.dem.xml --out ./sample/sample.dem.json convert

### Create DB structure from XML DEM

    $ node ./src/dbear.js --in ./sample/sample.dem.xml generate

## Samples

[Samples](./sample/)

## Development tasks
[Gulp](https://github.com/gulpjs/gulp)

    $ gulp
    ...
    Use the following commands with gulp:
        clean:      clean up build results;
        todo:       generate to-do list in ./build/TODO.md;
        plato:      generate source analysis report in ./build/plato/;
        test:       run tests (./src/**/*.spec.js) and display report in console;
        test-rep:   run tests (./src/**/*.spec.js) and save report to './build/TEST.md' (failed if launched first, start 'gulp todo' before);
        cover:      run test coverage and save report to './build/coverage/lcov-report/index.html';
    ...


text:
module.exports = function (api, options) {
  return {
    plugins: [
      ...require("./proposals.js").plugins,
      require("@babel/plugin-transform-arrow-functions"),
      require("@babel/plugin-transform-block-scoped-functions"),
      require("@babel/plugin-transform-block-scoping"),
      [require("@babel/plugin-transform-classes"), {
        loose: true
      }],
      [require("@babel/plugin-transform-computed-properties"), {
        loose: true
      }],
      require("@babel/plugin-transform-destructuring"),
      [require("@babel/plugin-transform-for-of"), {
        loose: true
      }],
      require("@babel/plugin-transform-literals"),
      require("@babel/plugin-transform-object-super"),
      require("@babel/plugin-transform-parameters"),
      require("@babel/plugin-transform-shorthand-properties"),
      require("@babel/plugin-transform-spread"),
      require("@babel/plugin-transform-sticky-regex"),
      [require("@babel/plugin-transform-template-literals"), {
        loose: true
      }],
      require("@babel/plugin-transform-typeof-symbol"),
      require("@babel/plugin-transform-unicode-regex"),
      require("@babel/plugin-transform-property-literals"),
      require("@babel/plugin-transform-exponentiation-operator"),
      require("@babel/plugin-transform-regenerator"),
    ]
  };
};


text:
layout: post
title: "Avoid static imports"
---

There are a lot of Java API's and Frameworks which rely in `static` methods and
the sort. Arguably, this is a bad OOP practice, but lets not enter in this
particular subject just yet.

For example, it is pretty common to write unit tests like this:

```java
package blah;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class SomeTest {

  @Test
  public void testSomething() {
    assertTrue(1 + 1 == 2);
  }
}
```

While it's kind of pretty to `import static org.junit.Assert.assertTrue`
and use `assertTrue` directly instead of `Assert.assertTrue`, one might argue
that it's difficult to know where this `assertTrue` method came from. I
don't fully agree with that in this particular case because this is an isolated
and well known context (the test) and every Java developer knows
(or should know) Junit, therefore the `assertTrue` should be obvious.

What I believe not to be a good thing is this:

```java
package foo;

public enum FooType {
  BAR, ANOTHER;
}
```

Later:

```java
package bar;

import static foo.FooType.*;
import foo.BarService;

public class BarService {
  private FooService foo;

  public void update(Long id) {
    foo.update(id, BAR);
  }
}
```

Now, when other folks read this code, they will see this `BAR` there and will
have to discover where it come from. It's not the `Foo` context anymore and
it's not a well known API, so, how can people know where this came from?
It would be much simpler if it was written as `FooType.BAR`, right?
Besides, we just polluted the namespace with all `FooTypes`, which is also
a bad thing.

I know... static importing some stuff can make the code "prettier" or
look simpler. Yeah, nope. If your code is not simple or pretty enough, it's
not the job of static imports to fix it. Probably your design is just bad.

I'm not the only one who believe in this:

- There is a [checkstyle has a rule for it][check-rule];
- [Java Documentation about static imports][java-static-import].

Check this out:

> So when should you use static import? **Very sparingly!** Only use it when
> you'd otherwise be tempted to declare local copies of constants, or to abuse
> inheritance (the Constant Interface Antipattern). In other words, use it
> when you require frequent access to static members from one or two classes.
> If you overuse the static import feature, it can make your program unreadable
> and unmaintainable, polluting its namespace with all the static members you
> import. Readers of your code (including you, a few months after you wrote
> it) will not know which class a static member comes from. Importing all
> of the static members from a class can be particularly harmful to
> readability; if you need only one or two members, import them
> individually. Used appropriately, static import can make your program more
> readable, by removing the boilerplate of repetition of class names.

Of course, if you follow the checkstyle rule, you will have no static imports
in your code. This can be a little "too much", but, if I had to choose
between static imports everywhere or no static imports at all, I'll surely
choose the later. But, what I really prefer, is the common sense.

[check-rule]: http://checkstyle.sourceforge.net/config_imports.html#AvoidStaticImport
[java-static-import]: http://docs.oracle.com/javase/1.5.0/docs/guide/language/static-import.html


text:
title: Entering VR
type: guide
layout: docs
parent_section: guide
order: 5
show_guide: true
---

A-Frame provides out-of-the-box support for desktop, mobile, and Oculus Rift.

## For iOS and Android

1. Load your site in a browser.
2. Hold up your phone and move it around to "look," or touch-and-drag to rotate.
3. Tap the "VR" icon button, and drop your phone in a Cardboard holder.

### Notes

* Requires a WebGL-compatible browser. The faster the phone the better. We recommend Google Cardboard V2-compatible headsets for best results. Tested with Mobile Safari and Firefox for iOS, and Firefox for Android, and Chrome on Android.
* Requires iOS 9.1 or greater. The faster the iPhone the better. Tested in Mobile Safari and Firefox for iOS. We recommend Google Cardboard V2-compatible headset for best results with iPhones.
* iPhone 6+ users will want to disable the Safari Tab Bar when viewing VR content.  This can be done in `Settings > Safari > Show Tab Bar`.

## For Oculus Rift

1. Install the latest [Oculus runtime](https://developer.oculus.com/downloads/).
2. Install [Firefox Nightly](https://nightly.mozilla.org/) or [experimental builds of Chromium](https://drive.google.com/folderview?id=0BzudLt22BqGRbW9WTHMtOWMzNjQ&usp=sharing#list).
3. Install the [WebVR Enabler Add-on](https://addons.mozilla.org/en-US/firefox/addon/mozilla-webvr-enabler/) (Firefox only).
4. Open your site.
5. Make sure your headset is plugged in and working properly. Lights on the headset and camera should be blue.
6. Press the "Enter VR" button.

### Notes

Unfortunately, Macs are not recommended for consuming content with the Oculus Rift. Oculus froze Mac and Linux SDK development in the summer of 2015, and while the 0.5.0.1 SDK is still currently available from their [developer site](https://developer.oculus.com/downloads/), newer versions of OS X are beginning to break support for the Rift DK2. We still use the 0.5.0.1 with our Macs on the MozVR team, but only during development, to test basics of tracking and scene composition. For actually consuming VR experiences, we use Windows PCs or our mobile phones.

If you experience difficulties getting WebVR to work properly, try the following:

1. Confirm that your headset is working properly with the built-in native Oculus demo app. It can be accessed through the Oculus Rift Configuration utility, and "Show Demo Scene." If the demo scene loads and tracks properly, it narrows the problem down to the browser.
2. Make sure you open the browser _after_ plugging in the headset. WebVR browsers do not reliably support plug-and-play (yet), and can fail to recognise a VR headset if it is plugged in when the browser is already open.
3. Confirm that the WebVR enabler is installed and running. You can do this by checking `Tools > Add-ons > Mozilla WebVR Enabler` is present.

## For Desktop

1. Load your site into any desktop browser with WebGL support (all latest stable browsers).
2. Click-and-drag to "look." Use arrow keys to walk.


text:
<?php

$targetchargers = [];
array_push($targetchargers,"Moto Chieveley, M4 Motorway, Jct 13, Oxford Road, Hermitage, ThatchamCCS fast charge");
array_push($targetchargers,"Welcome Break Oxford, M40 Motorway, Junction 8a, Thame Road, WaterstockCCS fast charge");
array_push($targetchargers,"Welcome Break Warwick North, M40 Motorway Northbound, Jct 12/13, Banbury Road, AshorneCCS fast charge");
array_push($targetchargers,"Welcome Break Warwick South, M40 Motorway Southbound, Jct, 12/13, Banbury Road, AshorneCCS fast charge");
array_push($targetchargers,"Welcome Break Hopwood Park, M42 Motorway, Jct 2, Redditch Road, Alvechurch, BirminghamCCS fast charge");
array_push($targetchargers,"IKEA Wednesbury, Park Lane, WednesburyCCS fast charge");

include("../../php/rss_template.php");
?>


text:
/*jshint curly:true, eqeqeq:true, laxbreak:true, noempty:false */
/*

  The MIT License (MIT)

  Copyright (c) 2007-2013 Einar Lielmanis and contributors.

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

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

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

 CSS Beautifier
---------------

    Written by Harutyun Amirjanyan, (amirjanyan@gmail.com)

    Based on code initially developed by: Einar Lielmanis, <elfz@laacz.lv>
        http://jsbeautifier.org/

    Usage:
        css_beautify(source_text);
        css_beautify(source_text, options);

    The options are:
        indent_size (default 4)          — indentation size,
        indent_char (default space)      — character to indent with,

    e.g

    css_beautify(css_source_text, {
      'indent_size': 1,
      'indent_char': '\t'
    });
*/

// http://www.w3.org/TR/CSS21/syndata.html#tokenization
// http://www.w3.org/TR/css3-syntax/

(function() {
    function css_beautify(source_text, options) {
        options = options || {};
        var indentSize = options.indent_size || 4;
        var indentCharacter = options.indent_char || ' ';

        // compatibility
        if (typeof indentSize === "string") {
            indentSize = parseInt(indentSize, 10);
        }

        // tokenizer
        var whiteRe = /^\s+$/;
        var wordRe = /[\w$\-_]/;

        var pos = -1, ch;
        function next() {
            ch = source_text.charAt(++pos);
            return ch;
        }
        function peek() {
            return source_text.charAt(pos+1);
        }
        function eatString(comma) {
            var start = pos;
            while(next()){
                if (ch === "\\"){
                    next();
                    next();
                } else if (ch === comma) {
                    break;
                } else if (ch === "\n") {
                    break;
                }
            }
            return source_text.substring(start, pos + 1);
        }

        function eatWhitespace() {
            var start = pos;
            while (whiteRe.test(peek())) {
                pos++;
            }
            return pos !== start;
        }

        function skipWhitespace() {
            var start = pos;
            do{
            }while (whiteRe.test(next()));
            return pos !== start + 1;
        }

        function eatComment() {
            var start = pos;
            next();
            while (next()) {
                if (ch === "*" && peek() === "/") {
                    pos ++;
                    break;
                }
            }

            return source_text.substring(start, pos + 1);
        }

        function lookBack(str) {
            return source_text.substring(pos-str.length, pos).toLowerCase() === str;
        }

        // printer
        var indentString = source_text.match(/^[\r\n]*[\t ]*/)[0];
        var singleIndent = Array(indentSize + 1).join(indentCharacter);
        var indentLevel = 0;
        function indent() {
            indentLevel++;
            indentString += singleIndent;
        }
        function outdent() {
            indentLevel--;
            indentString = indentString.slice(0, -indentSize);
        }

        var print = {};
        print["{"] = function(ch) {
            print.singleSpace();
            output.push(ch);
            print.newLine();
        };
        print["}"] = function(ch) {
            print.newLine();
            output.push(ch);
            print.newLine();
        };

        print.newLine = function(keepWhitespace) {
            if (!keepWhitespace) {
                while (whiteRe.test(output[output.length - 1])) {
                    output.pop();
                }
            }

            if (output.length) {
                output.push('\n');
            }
            if (indentString) {
                output.push(indentString);
            }
        };
        print.singleSpace = function() {
            if (output.length && !whiteRe.test(output[output.length - 1])) {
                output.push(' ');
            }
        };
        var output = [];
        if (indentString) {
            output.push(indentString);
        }
        /*_____________________--------------------_____________________*/

        while(true) {
            var isAfterSpace = skipWhitespace();

            if (!ch) {
                break;
            }

            if (ch === '{') {
                indent();
                print["{"](ch);
            } else if (ch === '}') {
                outdent();
                print["}"](ch);
            } else if (ch === '"' || ch === '\'') {
                output.push(eatString(ch));
            } else if (ch === ';') {
                output.push(ch, '\n', indentString);
            } else if (ch === '/' && peek() === '*') { // comment
                print.newLine();
                output.push(eatComment(), "\n", indentString);
            } else if (ch === '(') { // may be a url
                if (lookBack("url")) {
                  output.push(ch);
                  eatWhitespace();
                  if (next()) {
                    if (ch !== ')' && ch !== '"' && ch !== '\'') {
                        output.push(eatString(')'));
                    } else {
                        pos--;
                    }
                  }
                } else {
                  if (isAfterSpace) {
                      print.singleSpace();
                  }
                  output.push(ch);
                  eatWhitespace();
                }
            } else if (ch === ')') {
                output.push(ch);
            } else if (ch === ',') {
                eatWhitespace();
                output.push(ch);
                print.singleSpace();
            } else if (ch === ']') {
                output.push(ch);
            }  else if (ch === '[' || ch === '=') { // no whitespace before or after
                eatWhitespace();
                output.push(ch);
            } else {
                if (isAfterSpace) {
                    print.singleSpace();
                }

                output.push(ch);
            }
        }

        var sweetCode = output.join('').replace(/[\n ]+$/, '');
        return sweetCode;
    }

    if (typeof define === "function") {
        // Add support for require.js
        define(function(require, exports, module) {
            exports.css_beautify = css_beautify;
        });
    } else if (typeof exports !== "undefined") {
        // Add support for CommonJS. Just put this file somewhere on your require.paths
        // and you will be able to `var html_beautify = require("beautify").html_beautify`.
        exports.css_beautify = css_beautify;
    } else if (typeof window !== "undefined") {
        // If we're running a web page and don't have either of the above, add our one global
        window.css_beautify = css_beautify;
    }

}());


text:
package us.nineworlds.serenity.core.menus;

/**
 * @author dcarver
 *
 */
public class MenuDrawerItemImpl implements MenuDrawerItem {

	private String text;
	private int resourceID;

	public MenuDrawerItemImpl(String text) {
		this.text = text;
	}

	public MenuDrawerItemImpl(String text, int resourceID) {
		this.text = text;
		this.resourceID = resourceID;
	}

	@Override
	public String getText() {
		return text;
	}

	@Override
	public int getImageResourceID() {
		return resourceID;
	}

	@Override
	public void setText(String text) {
		this.text = text;

	}

	@Override
	public void setImageResourceID(int resourceId) {
		resourceID = resourceId;
	}

}


text:
using Hanselman.Styles;
using MediaManager;
using Windows.Foundation;
using Windows.System.Profile;
using Windows.UI.ViewManagement;
using Xamarin.Forms;
using Size = Windows.Foundation.Size;
using Application = Windows.UI.Xaml.Application;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409

namespace Hanselman.UWP
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage
    {
        private UISettings uiSettings = new UISettings();
        public MainPage()
        {
            InitializeComponent();
            LoadApplication(new Hanselman.App());

            CrossMediaManager.Current.Init();
            ApplicationView.PreferredLaunchViewSize = new Size(480, 600);
            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
            ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(480, 600));
            uiSettings.ColorValuesChanged += UISettings_ColorValuesChanged;
        }

        private void UISettings_ColorValuesChanged(UISettings sender, object args)
        {
            ThemeHelper.ChangeTheme(Application.Current.RequestedTheme == Windows.UI.Xaml.ApplicationTheme.Dark ? Models.Theme.Dark : Models.Theme.Light);
        }
    }
}


text:
package cmput301w15t07.TravelTracker.serverinterface;

import java.util.Collection;
import java.util.UUID;

import cmput301w15t07.TravelTracker.model.Claim;
import cmput301w15t07.TravelTracker.model.Document;
import cmput301w15t07.TravelTracker.model.Item;
import cmput301w15t07.TravelTracker.model.Tag;
import cmput301w15t07.TravelTracker.model.User;

/**
 * Contains helper functions for server operations.
 *
 * @author ryant26
 */
public interface ServerHelper {

    /**
     * This method deletes all passed documents from the ES cluster.
     * When finished or on error will use the callback.
     * @param documents
     */
    public <T extends Document> void deleteDocuments(Collection<T> documents) throws Exception;

    /**
     * This method returns all claims from the server
     * @return all claims in the server
     * @throws Exception
     */
    public Collection<Claim> getAllClaims() throws Exception;

    /**
     * This method returns all items from the server
     * @return all items in server
     * @throws Exception
     */
    public Collection<Item> getAllItems() throws Exception;

    /**
     * This method gets all tags from the server
     * @return all tags in server
     * @throws Exception
     */
    public Collection<Tag> getAllTags() throws Exception;

    /**
     * This method gets all users from the server
     * @return    all users in server
     * @throws Exception
     */
    public Collection<User> getAllUsers() throws Exception;

    /**
     * Gets all claims for the passed user from the server asynchronously, returns it via
     * ResultCallback
     * @param user
     * @return collection of claims
     */
    public Collection<Claim> getClaims(UUID user) throws Exception;

    /**
     * Gets all expense items for the passed claim from the server asynchronously, returns it
     * via ResultCallback
     * @param claim
     * @return collection of expense Items
     */
    public Collection<Item> getExpenses(UUID claim) throws Exception;
    /**
     * Gets all tags for the passed user from the server asynchronously, returns it
     * via ResultCallback
     * @param user
     * @return collection of Tags
     */
    public Collection<Tag> getTags(UUID user) throws Exception;

    /**
     * Gets gets user for passed name from the server asynchronously, returns it
     * via ResultCallback
     * @param name
     * @return user
     */
    public User getUser(String name) throws Exception;

    /**
     * Gets the user for the passed UUID from the server synchronously
     * @param user UUID for the user to be retrieved
     * @return user for passed UUID
     * @throws Exception
     */
    public User getUser(UUID user) throws Exception;

    /**
     * Saves passed documents to the server asynchronously, returns the documents that
     * were successfully saved via callback
     * @param documents
     */
    public <T extends Document> void saveDocuments(Collection<T> documents) throws Exception;
}


text:
using System.Runtime.Serialization;

namespace System
{
    public sealed class Empty : ISerializable
    {
        private Empty() { }

        public static readonly Empty Value = new Empty();

        public void GetObjectData(SerializationInfo info, StreamingContext context)
        {
            throw new PlatformNotSupportedException();
        }
    }
}


text:
/**
 * @file The core file for the pro events calendar plugin javascript.
 * This file must load on all front facing events pages and be the first file loaded after treibe-events.js.
 * @version 3.0
 */

if (Object.prototype.hasOwnProperty.call(window, 'tribe_ev')) {

	/**
	 * @namespace tribe_ev
	 * @since 3.0
	 * @desc tribe_ev.geoloc namespace stores all google maps data used in both map view and for events wide geo search.
	 */

	tribe_ev.geoloc = {
		map: [],
		geocoder: [],
		geocodes: [],
		bounds: [],
		markers: [],
		refine: false
	};
}

(function (window, document, $, te, tf, tg, ts, tt, dbug) {

	/*
	 * $    = jQuery
	 * td   = tribe_ev.data
	 * te   = tribe_ev.events
	 * tf   = tribe_ev.fn
	 * ts   = tribe_ev.state
	 * tt   = tribe_ev.tests
	 * dbug = tribe_debug
	 */

	$.extend(tribe_ev.fn, {

		/**
		 * @function tribe_ev.fn.has_address
		 * @since 3.0
		 * @desc tribe_ev.fn.has_address
		 * @param {String} val The value to compare against the array.
		 * @param {Array} geocodes Tests for an immediate duplicate in the geocodes array.
		 * @returns {Boolean} Returns true if a duplicate is found.
		 */

		has_address: function (val, geocodes) {
			for(var i = 0; i < geocodes.length; i++) {
				if(geocodes[i].formatted_address == val) return true;
			}
			return false;
		},

		/**
		 * @function tribe_ev.fn.pre_ajax
		 * @since 3.0
		 * @desc tribe_ev.fn.pre_ajax allows for functions to be executed before ajax begins.
		 * @param {Function} callback The callback function, expected to be an ajax function for one of our views.
		 */

		pre_ajax: function (callback) {
			if ($('#tribe-bar-geoloc').length) {
				var val = $('#tribe-bar-geoloc').val();
				if (val.length) {
					tf.process_geocoding(val, function (results) {
						tg.geocodes = results;
						if (tg.geocodes.length > 1 && !tf.has_address(val, tg.geocodes)) {
							tf.print_geo_options();
						} else {
							var lat = results[0].geometry.location.lat();
							var lng = results[0].geometry.location.lng();
							if (lat)
								$('#tribe-bar-geoloc-lat').val(lat);

							if (lng)
								$('#tribe-bar-geoloc-lng').val(lng);

							if (callback && typeof( callback ) === "function") {
								if ($("#tribe_events_filter_item_geofence").length)
									$("#tribe_events_filter_item_geofence").show();
								callback();
							}
						}
					});
				} else {
					$('#tribe-bar-geoloc-lat, #tribe-bar-geoloc-lng').val('');
					if (callback && typeof( callback ) === "function") {
						if ($("#tribe_events_filter_item_geofence").length) {
							$('#tribe_events_filter_item_geofence input').prop('checked', false);
							$("#tribe_events_filter_item_geofence").hide().find('select').prop('selectedIndex', 0);
						}
						callback();
					}
				}
			} else {

				if (callback && typeof( callback ) === "function") {
					callback();
				}
			}
		},

		/**
		 * @function tribe_ev.fn.print_geo_options
		 * @since 3.0
		 * @desc tribe_ev.fn.print_geo_options prints out the geolocation options returned by google maps if a geo search term requires refinement.
		 */

		print_geo_options: function () {
			$("#tribe-geo-links").empty();
			$("#tribe-geo-options").show();
			var dupe_test = [];
			tg.refine = true;
			for (var i = 0; i < tg.geocodes.length; i++) {
				var address = tg.geocodes[i].formatted_address;
				if(!dupe_test[address]) {
					dupe_test[address] = true;
					$("").text(address).attr("href", "#").addClass('tribe-geo-option-link').data('index', i).appendTo("#tribe-geo-links");
					if (tt.map_view()) {
						tf.map_add_marker(
							tg.geocodes[i].geometry.location.lat(),
							tg.geocodes[i].geometry.location.lng(),
							address
						);
					}
				}
			}
			tg.refine = false;
		},

		/**
		 * @function tribe_ev.fn.pro_tooltips
		 * @since 3.0
		 * @desc tribe_ev.fn.pro_tooltips supplies additional tooltip functions for view use on top of the ones defined in core, especially for week view.
		 */

		pro_tooltips: function () {

			$('#tribe-events').on('mouseenter', 'div[id*="tribe-events-event-"], div[id*="tribe-events-daynum-"]:has(a), div.event-is-recurring', function () {

				var bottomPad = 0;
				var $this = $(this);

				if ($('body').hasClass('tribe-events-week')) {

					var $tip = $this.find('.tribe-events-tooltip');

					if (!$this.parents('.tribe-grid-allday').length) {

						var $wrapper = $('.tribe-week-grid-wrapper');
						var $parent = $this.parent();
						var $container = $parent.parent();

						var pwidth = Math.ceil($container.width());
						var cwidth = Math.ceil($this.width());
						var twidth = Math.ceil($tip.outerWidth());
						var gheight = $wrapper.height();

						var scroll = $wrapper.scrollTop();
						var coffset = $parent.position();
						var poffset = $this.position();
						var ptop = Math.ceil(poffset.top);
						var toffset = scroll - ptop;

						var isright = $parent.hasClass('tribe-events-right');
						var wcheck;
						var theight;
						var available;
						var cssmap = {};

						if (!$tip.hasClass('hovered')) {
							$tip.data('ow', twidth).addClass('hovered');
						}

						if (isright)
							wcheck = Math.ceil(coffset.left) - 20;
						else
							wcheck = pwidth - cwidth - Math.ceil(coffset.left);

						if (twidth >= wcheck)
							twidth = wcheck;
						else if ($tip.data('ow') > wcheck)
							twidth = wcheck;
						else
							twidth = $tip.data('ow');

						if (isright)
							cssmap = { "right": cwidth + 20, "bottom": "auto", "width": twidth + "px"};
						else
							cssmap = { "left": cwidth + 20, "bottom": "auto", "width": twidth + "px"};

						$tip.css(cssmap);

						theight = $tip.height();

						if (toffset >= 0) {
							toffset = toffset + 5;
						} else {
							available = toffset + gheight;
							if (theight > available)
								toffset = available - theight - 8;
							else
								toffset = 5;
						}

						$tip.css("top", toffset).show();

					} else {
						bottomPad = $this.outerHeight() + 6;
						$tip.css('bottom', bottomPad).show();
					}

				}

			});
		},

		/**
		 * @function tribe_ev.fn.process_geocoding
		 * @since 3.0
		 * @desc tribe_ev.fn.process_geocoding middle mans the geolocation request to google with its callback.
		 * @param {String} location The location value, generally from the event bar.
		 * @param {Function} callback The callback function.
		 */

		process_geocoding: function (location, callback) {

			var request = {
				address: location,
				bounds : new google.maps.LatLngBounds(
					new google.maps.LatLng( TribeEventsPro.geocenter.min_lat, TribeEventsPro.geocenter.min_lng ),
					new google.maps.LatLng( TribeEventsPro.geocenter.max_lat, TribeEventsPro.geocenter.max_lng )
				)
			};

			tg.geocoder.geocode(request, function (results, status) {
				if (status == google.maps.GeocoderStatus.OK) {
					callback(results);
					return results;
				}

				if (status == google.maps.GeocoderStatus.ZERO_RESULTS) {
					if (GeoLoc.map_view) {
						spin_end();
					}
					return status;
				}

				return status;
			});
		},

		/**
		 * @function tribe_ev.fn.set_recurrence
		 * @since 3.0
		 * @desc tribe_ev.fn.set_recurrence uses local storage to store the user front end setting for the hiding of subsequent recurrences of a recurring event.
		 * @param {Boolean} recurrence_on Bool sent to set appropriate recurrence storage option.
		 */

		set_recurrence: function (recurrence_on) {
			if (recurrence_on) {
				ts.recurrence = true;
				if (tribe_storage) {
					tribe_storage.setItem('tribeHideRecurrence', '1');
				}
			} else {
				ts.recurrence = false;
				if (tribe_storage) {
					tribe_storage.setItem('tribeHideRecurrence', '0');
				}
			}
		}
	});

	$.extend(tribe_ev.tests, {

		/**
		 * @function tribe_ev.tests.hide_recurrence
		 * @since 3.0
		 * @desc tribe_ev.tests.hide_recurrence uses local storage to store the user front end setting for the hiding of subsequent recurrences of a recurring event.
		 */

		hide_recurrence: function () {
			return  ($('#tribeHideRecurrence:checked').length) ? true : false;
		}
	});

	$(document).ready(function () {

		if($('.tribe-bar-geoloc-filter').length){
			$(".tribe-bar-geoloc-filter").append('

');
		}

		var $tribe_container = $('#tribe-events'),
			$geo_bar_input = $('#tribe-bar-geoloc'),
			$geo_options = $("#tribe-geo-options"),
			recurrence_on = false;

		tf.pro_tooltips();

		if (tt.hide_recurrence()) {
			tf.set_recurrence(true);
		}

		/**
		 * @function tribe_ical_url
		 * @since 3.0
		 * @desc tribe_ical_url This function adds required params to the ical url. Runs on doc ready, and hooks into 'tribe_ev_ajaxSuccess' also.
		 */

		function tribe_ical_url() {
			var url = document.URL,
				separator = '?';

			if (url.indexOf('?') > 0)
				separator = '&';

			var new_link = url + separator + 'ical=1' + '&' + 'tribe_display=' + ts.view;

			$('a.tribe-events-ical').attr('href', new_link);
		}

		$(te).on("tribe_ev_ajaxSuccess", function () {
			tribe_ical_url();
		});

		tribe_ical_url();

		ts.recurrence = tt.hide_recurrence();

		$tribe_container.on('click', '#tribeHideRecurrence', function () {
			ts.popping = false;
			ts.do_string = true;
			ts.paged = 1;
			recurrence_on = ($(this).is(':checked') ? true : false);

			tf.set_recurrence(recurrence_on);

			$(te).trigger('tribe_ev_updatingRecurrence').trigger('tribe_ev_runAjax');
		});

		$(te).on("tribe_ev_preCollectBarParams", function () {
			if ($geo_bar_input.length) {
				var tribe_map_val = $geo_bar_input.val();
				if (!tribe_map_val.length) {
					$('#tribe-bar-geoloc-lat, #tribe-bar-geoloc-lng').val('');
				} else {
					if (ts.view_target === 'map')
						ts.url_params['action'] = 'tribe_geosearch';
				}
			}

			if (tribe_storage) {
				if (tribe_storage.getItem('tribeHideRecurrence') === '1' && (ts.view_target !== 'month' && ts.view_target !== 'week')) {
					ts.url_params['tribeHideRecurrence'] = '1';
				}
			}
		});

		if (!tt.map_view()) {

			if($geo_options.length) {

				$tribe_container.on('click', '.tribe-geo-option-link',function (e) {
					e.preventDefault();
					e.stopPropagation();
					var $this = $(this);

					$('.tribe-geo-option-link').removeClass('tribe-option-loaded');
					$this.addClass('tribe-option-loaded');

					$geo_bar_input.val($this.text());

					$('#tribe-bar-geoloc-lat').val(tg.geocodes[$this.data('index')].geometry.location.lat());
					$('#tribe-bar-geoloc-lng').val(tg.geocodes[$this.data('index')].geometry.location.lng());

					tf.pre_ajax(function () {
						$(te).trigger('tribe_ev_runAjax');
						$geo_options.hide();
					});

				});

				$(document).on('click', function (e) {
					$geo_options.hide();
				});

			}

			tf.snap('#tribe-geo-wrapper', '#tribe-geo-wrapper', '#tribe-events-footer .tribe-events-nav-previous a, #tribe-events-footer .tribe-events-nav-next a');

		}

		dbug && debug.info('TEC Debug: tribe-events-pro.js successfully loaded');

	});

})(window, document, jQuery, tribe_ev.events, tribe_ev.fn, tribe_ev.geoloc, tribe_ev.state, tribe_ev.tests, tribe_debug);


text:
<?php

namespace Controllers;

class Artists_Controller extends Master_Controller {
    public  function  __construct() {
        parent::__construct(get_class(),
            'artist', '/views/artists/');
//        echo "I`m an artist<br />";
    }

    public function index() {
        //$artists = $this->model->get(2);
        //$artists = $this->model->get_by_name('Rado Shisharkata');
        $artists = $this->model->find();
        //var_dump($artists); die();
        //var_dump($this->model); die();
        $template_name = DX_ROOT_DIR . $this->views_dir . 'index.php';

        include_once $this->layout;
    }

    public function view($id) {
        $artists = $this->model->get($id);
        var_dump($artists); die();

        $template_name = DX_ROOT_DIR . $this->views_dir . 'index.php';

        include_once $this->layout;
    }

    public function dve() {
        include_once DX_ROOT_DIR . $this->views_dir . 'dve.php';

        include_once $this->layout;
    }

    public function tri() {
        include_once DX_ROOT_DIR . $this->views_dir . 'tri.php';

        include_once $this->layout;
    }
}


text:
package com.facebook.buck.zip;

import static com.facebook.buck.testutil.FakeProjectFilesystem.createJavaOnlyFilesystem;
import static org.junit.Assert.assertEquals;

import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.step.ExecutionContext;
import com.facebook.buck.step.TestExecutionContext;
import com.facebook.buck.testutil.FakeProjectFilesystem;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.Test;

public class UnzipStepTest {

  @Test
  public void testGetShortName() throws InterruptedException {
    Path zipFile = Paths.get("the/zipfile.zip");
    Path outputDirectory = Paths.get("an/output/dir");
    UnzipStep unzipStep = new UnzipStep(createJavaOnlyFilesystem(), zipFile, outputDirectory);
    assertEquals("unzip", unzipStep.getShortName());
  }

  @Test
  public void testGetShellCommand() {
    ProjectFilesystem projectFilesystem =
        new FakeProjectFilesystem() {
          @Override
          public Path resolve(Path relativePath) {
            return Paths.get("/abs/path").resolve(relativePath);
          }
        };

    Path zipFile = Paths.get("the/zipfile.zip");
    Path outputDirectory = Paths.get("an/output/dir");
    UnzipStep unzipStep = new UnzipStep(projectFilesystem, zipFile, outputDirectory);

    ExecutionContext executionContext = TestExecutionContext.newInstance();
    assertEquals(
        "unzip /abs/path/the/zipfile.zip -d /abs/path/an/output/dir",
        unzipStep.getDescription(executionContext));
  }
}


text:
{{ test }}

{{  yop }}

        Profil

                <form role="form" id="loginForm" action=''>

                        Username
                        <input type="text" class="form-control" id="username" placeholder="Enter username" />

                        Password
                        <input type="password" class="form-control" id="password" placeholder="Password">

                        <button type="submit" class="btn btn-default" id="btnSubmit">Sign In </button>

                </form>


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 15.2.3.7-6-a-220
description: >
    Object.defineProperties - 'O' is an Array, 'P' is an array index
    property that already exists on 'O' with [[Writable]] true, and
    the [[Writable]] field of 'desc' is false  (15.4.5.1 step 4.c)
includes: [propertyHelper.js]
---*/

var arr = [];

Object.defineProperty(arr, "0", {
    writable: true,
    configurable: true
});

Object.defineProperties(arr, {
    "0": {
        writable: false
    }
});
verifyEqualTo(arr, "0", undefined);

verifyNotWritable(arr, "0");

verifyNotEnumerable(arr, "0");

verifyConfigurable(arr, "0");


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">

    <meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
    <title>MyConversions</title>
    <meta name="date" content="2013-05-24">
    <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css"
          title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

            Prev Class

Next Class

            Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

info.java_kompakt.kapitel_4.aufgabe_4_2

Class MyConversions

java.lang.Object

info.java_kompakt.kapitel_4.aufgabe_4_2.MyConversions

public final class MyConversions
extends java.lang.Object

Klasse, die statische Methoden zur
                    Konvertierung zwischen verschiedenen
                    Maßeinheiten anbietet.

Constructor Summary

Constructors

                                Constructor and
                                    Description

                                MyConversions()

Method Summary

Methods

                                Modifier and
                                    Type

                                Method and
                                    Description

                                static double

                                cmNachZoll(double cm)

                                static double

                                zollNachCm(double zoll)

Konvertiert das in Zoll
                                        angegebene Argument in Centimeter und
                                        gibt das
                                        Resultat zurück.

Methods inherited from class java.lang.Object

                                clone, equals, finalize, getClass,
                                    hashCode, notify, notifyAll, toString, wait,
                                    wait, wait

Constructor Detail

MyConversions

public MyConversions()

Method Detail

zollNachCm

public static double zollNachCm(double zoll)

Konvertiert das in Zoll
                                    angegebene Argument in Centimeter und gibt
                                    das
                                    Resultat zurück.

Parameters:

zoll - Länge in Zoll

Returns:

zoll in Centimeter
                                        konvertiert

cmNachZoll

public static double cmNachZoll(double cm)

Overview

Package

Class

Tree

Deprecated

Index

Help

            Prev Class

Next Class

            Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
#ifndef GCC_OPTINFO_EMIT_JSON_H
#define GCC_OPTINFO_EMIT_JSON_H

#include "json.h"

class optinfo;

/* A class for writing out optimization records in JSON format.  */

class optrecord_json_writer
{
public:
  optrecord_json_writer ();
  ~optrecord_json_writer ();
  void write () const;
  void add_record (const optinfo *optinfo);
  void pop_scope ();

  void add_record (json::object *obj);
  json::object *impl_location_to_json (dump_impl_location_t loc);
  json::object *location_to_json (location_t loc);
  json::object *profile_count_to_json (profile_count count);
  json::string *get_id_value_for_pass (opt_pass *pass);
  json::object *pass_to_json (opt_pass *pass);
  json::value *inlining_chain_to_json (location_t loc);
  json::object *optinfo_to_json (const optinfo *optinfo);
  void add_pass_list (json::array *arr, opt_pass *pass);

 private:
  /* The root value for the JSON file.
     Currently the JSON values are stored in memory, and flushed when the
     compiler exits.  It would probably be better to simply write out
     the JSON as we go.  */
  json::array *m_root_tuple;

  /* The currently open scopes, for expressing nested optimization records.  */
  auto_vec<json::array *> m_scopes;
};

#endif /* #ifndef GCC_OPTINFO_EMIT_JSON_H */


text:
<?php

use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;

class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
            new Symfony\Bundle\TwigBundle\TwigBundle(),
            new Symfony\Bundle\MonologBundle\MonologBundle(),
            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
            new AppBundle\AppBundle(),
            new finalProjectBundle\finalProjectBundle(),
            new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),

            new Sonata\CoreBundle\SonataCoreBundle(),
            new Sonata\BlockBundle\SonataBlockBundle(),
            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
            new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
            new Sonata\AdminBundle\SonataAdminBundle(),
            new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
            new FOS\UserBundle\FOSUserBundle(),
            new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
            new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),

            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
            new Vich\UploaderBundle\VichUploaderBundle(),
            new Mykees\CommentBundle\CommentBundle(), #override downloaded bundle
            new Mykees\CommentBundle\MykeesCommentBundle(),
            new Positibe\Bundle\UniqueViewsBundle\PositibeUniqueViewsBundle(),
            new JMS\SerializerBundle\JMSSerializerBundle(),
            new FOS\MessageBundle\FOSMessageBundle(),

            );

        if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
            $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
        }

        return $bundles;
    }

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
    }
}


text:
@interface TSStressViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *txtSearch;
- (IBAction)btnSearch:(id)sender;
@property (weak, nonatomic) IBOutlet UILabel *lblSearch;

@end


text:
<?php

namespace Magento\Framework\App\Router;

use Magento\Framework\App\RequestInterface;
use Magento\Store\Model\ScopeInterface;

/**
 * @SuppressWarnings(PHPMD.TooManyFields)
 * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
 */
class Base implements \Magento\Framework\App\RouterInterface
{
    /**
     * @var \Magento\Framework\App\ActionFactory
     */
    protected $actionFactory;

    /**
     * @var string
     */
    protected $actionInterface = '\Magento\Framework\App\ActionInterface';

    /**
     * @var array
     */
    protected $_modules = [];

    /**
     * @var array
     */
    protected $_dispatchData = [];

    /**
     * List of required request parameters
     * Order sensitive
     * @var string[]
     */
    protected $_requiredParams = ['moduleFrontName', 'actionPath', 'actionName'];

    /**
     * @var \Magento\Framework\App\Route\ConfigInterface
     */
    protected $_routeConfig;

    /**
     * Url security information.
     *
     * @var \Magento\Framework\Url\SecurityInfoInterface
     */
    protected $_urlSecurityInfo;

    /**
     * Core store config
     *
     * @var \Magento\Framework\App\Config\ScopeConfigInterface
     */
    protected $_scopeConfig;

    /**
     * @var \Magento\Framework\UrlInterface
     */
    protected $_url;

    /**
     * @var \Magento\Store\Model\StoreManagerInterface
     */
    protected $_storeManager;

    /**
     * @var \Magento\Framework\App\ResponseFactory
     */
    protected $_responseFactory;

    /**
     * @var \Magento\Framework\App\DefaultPathInterface
     */
    protected $_defaultPath;

    /**
     * @var \Magento\Framework\Code\NameBuilder
     */
    protected $nameBuilder;

    /**
     * @var array
     */
    protected $reservedNames = ['new', 'print', 'switch', 'return'];

    /**
     * Allows to control if we need to enable no route functionality in current router
     *
     * @var bool
     */
    protected $applyNoRoute = false;

    /**
     * @var string
     */
    protected $pathPrefix = null;

    /**
     * @var \Magento\Framework\App\Router\ActionList
     */
    protected $actionList;

    /** @var PathConfigInterface */
    protected $pathConfig;

    /**
     * @param \Magento\Framework\App\Router\ActionList $actionList
     * @param \Magento\Framework\App\ActionFactory $actionFactory
     * @param \Magento\Framework\App\DefaultPathInterface $defaultPath
     * @param \Magento\Framework\App\ResponseFactory $responseFactory
     * @param \Magento\Framework\App\Route\ConfigInterface $routeConfig
     * @param \Magento\Framework\UrlInterface $url
     * @param string $routerId
     * @param \Magento\Framework\Code\NameBuilder $nameBuilder
     * @param \Magento\Framework\App\Router\PathConfigInterface $pathConfig
     *
     * @throws \InvalidArgumentException
     * @SuppressWarnings(PHPMD.ExcessiveParameterList)
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function __construct(
        \Magento\Framework\App\Router\ActionList $actionList,
        \Magento\Framework\App\ActionFactory $actionFactory,
        \Magento\Framework\App\DefaultPathInterface $defaultPath,
        \Magento\Framework\App\ResponseFactory $responseFactory,
        \Magento\Framework\App\Route\ConfigInterface $routeConfig,
        \Magento\Framework\UrlInterface $url,
        $routerId,
        \Magento\Framework\Code\NameBuilder $nameBuilder,
        \Magento\Framework\App\Router\PathConfigInterface $pathConfig
    ) {
        $this->actionList = $actionList;
        $this->actionFactory = $actionFactory;
        $this->_responseFactory = $responseFactory;
        $this->_defaultPath = $defaultPath;
        $this->_routeConfig = $routeConfig;
        $this->_url = $url;
        $this->nameBuilder = $nameBuilder;
        $this->pathConfig = $pathConfig;
    }

    /**
     * Match provided request and if matched - return corresponding controller
     *
     * @param \Magento\Framework\App\RequestInterface $request
     * @return \Magento\Framework\App\ActionInterface|null
     */
    public function match(\Magento\Framework\App\RequestInterface $request)
    {
        $params = $this->parseRequest($request);

        return $this->matchAction($request, $params);
    }

    /**
     * Parse request URL params
     *
     * @param \Magento\Framework\App\RequestInterface $request
     * @return array
     */
    protected function parseRequest(\Magento\Framework\App\RequestInterface $request)
    {
        $output = [];

        $path = trim($request->getPathInfo(), '/');

        $params = explode('/', $path ? $path : $this->pathConfig->getDefaultPath());
        foreach ($this->_requiredParams as $paramName) {
            $output[$paramName] = array_shift($params);
        }

        for ($i = 0, $l = sizeof($params); $i < $l; $i += 2) {
            $output['variables'][$params[$i]] = isset($params[$i + 1]) ? urldecode($params[$i + 1]) : '';
        }
        return $output;
    }

    /**
     * Match module front name
     *
     * @param \Magento\Framework\App\RequestInterface $request
     * @param string $param
     * @return string|null
     */
    protected function matchModuleFrontName(\Magento\Framework\App\RequestInterface $request, $param)
    {
        // get module name
        if ($request->getModuleName()) {
            $moduleFrontName = $request->getModuleName();
        } elseif (!empty($param)) {
            $moduleFrontName = $param;
        } else {
            $moduleFrontName = $this->_defaultPath->getPart('module');
            $request->setAlias(\Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS, '');
        }
        if (!$moduleFrontName) {
            return null;
        }
        return $moduleFrontName;
    }

    /**
     * Match controller name
     *
     * @param \Magento\Framework\App\RequestInterface $request
     * @param string $param
     * @return string
     */
    protected function matchActionPath(\Magento\Framework\App\RequestInterface $request, $param)
    {
        if ($request->getControllerName()) {
            $actionPath = $request->getControllerName();
        } elseif (!empty($param)) {
            $actionPath = $param;
        } else {
            $actionPath = $this->_defaultPath->getPart('controller');
            $request->setAlias(
                \Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS,
                ltrim($request->getOriginalPathInfo(), '/')
            );
        }
        return $actionPath;
    }

    /**
     * Get not found controller instance
     *
     * @param string $currentModuleName
     * @return \Magento\Framework\App\ActionInterface|null
     */
    protected function getNotFoundAction($currentModuleName)
    {
        if (!$this->applyNoRoute) {
            return null;
        }

        $actionClassName = $this->getActionClassName($currentModuleName, 'noroute');
        if (!$actionClassName || !is_subclass_of($actionClassName, $this->actionInterface)) {
            return null;
        }

        // instantiate action class
        return $this->actionFactory->create($actionClassName);
    }

    /**
     * Create matched controller instance
     *
     * @param \Magento\Framework\App\RequestInterface $request
     * @param array $params
     * @return \Magento\Framework\App\ActionInterface|null
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     */
    protected function matchAction(\Magento\Framework\App\RequestInterface $request, array $params)
    {
        $moduleFrontName = $this->matchModuleFrontName($request, $params['moduleFrontName']);
        if (empty($moduleFrontName)) {
            return null;
        }

        /**
         * Searching router args by module name from route using it as key
         */
        $modules = $this->_routeConfig->getModulesByFrontName($moduleFrontName);

        if (empty($modules) === true) {
            return null;
        }

        /**
         * Going through modules to find appropriate controller
         */
        $currentModuleName = null;
        $actionPath = null;
        $action = null;
        $actionInstance = null;

        $actionPath = $this->matchActionPath($request, $params['actionPath']);
        $action = $request->getActionName() ?: ($params['actionName'] ?: $this->_defaultPath->getPart('action'));
        $this->_checkShouldBeSecure($request, '/' . $moduleFrontName . '/' . $actionPath . '/' . $action);

        foreach ($modules as $moduleName) {
            $currentModuleName = $moduleName;

            $actionClassName = $this->actionList->get($moduleName, $this->pathPrefix, $actionPath, $action);
            if (!$actionClassName || !is_subclass_of($actionClassName, $this->actionInterface)) {
                continue;
            }

            $actionInstance = $this->actionFactory->create($actionClassName);
            break;
        }

        if (null == $actionInstance) {
            $actionInstance = $this->getNotFoundAction($currentModuleName);
            if ($actionInstance === null) {
                return null;
            }
            $action = 'noroute';
        }

        // set values only after all the checks are done
        $request->setModuleName($moduleFrontName);
        $request->setControllerName($actionPath);
        $request->setActionName($action);
        $request->setControllerModule($currentModuleName);
        $request->setRouteName($this->_routeConfig->getRouteByFrontName($moduleFrontName));
        if (isset($params['variables'])) {
            $request->setParams($params['variables']);
        }
        return $actionInstance;
    }

    /**
     * Build controller class name
     *
     * @param string $module
     * @param string $actionPath
     * @return string
     */
    public function getActionClassName($module, $actionPath)
    {
        $prefix = $this->pathPrefix ? 'Controller\\' . $this->pathPrefix  : 'Controller';
        return $this->nameBuilder->buildClassName([$module, $prefix, $actionPath]);
    }

    /**
     * Check that request uses https protocol if it should.
     * Function redirects user to correct URL if needed.
     *
     * @param \Magento\Framework\App\RequestInterface $request
     * @param string $path
     * @return void
     * @SuppressWarnings(PHPMD.ExitExpression)
     */
    protected function _checkShouldBeSecure(\Magento\Framework\App\RequestInterface $request, $path = '')
    {
        if ($request->getPostValue()) {
            return;
        }

        if ($this->pathConfig->shouldBeSecure($path) && !$request->isSecure()) {
            $url = $this->pathConfig->getCurrentSecureUrl($request);
            if ($this->_shouldRedirectToSecure()) {
                $url = $this->_url->getRedirectUrl($url);
            }

            $this->_responseFactory->create()->setRedirect($url)->sendResponse();
            exit;
        }
    }

    /**
     * Check whether redirect url should be used for secure routes
     *
     * @return bool
     */
    protected function _shouldRedirectToSecure()
    {
        return $this->_url->getUseSession();
    }
}


text:
Genetic-Framework
=================

A framework for the resolution of problems using genetic algorithms


text:
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.ServiceManagemenet.Common.Models;
using Microsoft.WindowsAzure.Commands.ScenarioTest;
using Microsoft.WindowsAzure.Commands.Test.Utilities.Common;
using Xunit;
using Xunit.Abstractions;

namespace Microsoft.Azure.Commands.ApplicationInsights.Test.ScenarioTests
{
    public class ContinuousExportTests : RMTestBase
    {
        public ContinuousExportTests(ITestOutputHelper output)
        {
            XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
        }

        [Fact]
        [Trait(Category.AcceptanceType, Category.CheckIn)]
        public void TestGetContinuousExport()
        {
            TestController.NewInstance.RunPsTest("Test-GetApplicationInsightsContinuousExport");
        }

        [Fact]
        [Trait(Category.AcceptanceType, Category.CheckIn)]
        public void TestNewContinuousExport()
        {
            TestController.NewInstance.RunPsTest("Test-NewApplicationInsightsContinuousExport");
        }

        [Fact]
        [Trait(Category.AcceptanceType, Category.CheckIn)]
        public void TestSetContinuousExport()
        {
            TestController.NewInstance.RunPsTest("Test-SetApplicationInsightsContinuousExport");
        }

        [Fact]
        [Trait(Category.AcceptanceType, Category.CheckIn)]
        public void TestRemoveContinuousExport()
        {
            TestController.NewInstance.RunPsTest("Test-RemoveApplicationInsightsContinuousExport");
        }
    }
}