text:
Template exclamation syntax
=============
This templating tweak introduces the `!` syntax.
Inspired by [Symfony issue 1966](https://github.com/symfony/symfony/issues/1966) and [Twig issue 1334](https://github.com/twigphp/Twig/issues/1334).

*(Please keep in mind this will totally ignore the bundle [inheritance](http://symfony.com/doc/current/cookbook/bundles/inheritance.html) and  just use the original bundle.)*

Example
-------------
```jinja
{# app/Resources/MyBundle/views/layout.html.twig #}
{% extends "!MyBundle::layout.html.twig" %}

{# override you block here #}
```
The code above extends the example `src/MyBundle/Resources/views/layout.html.twig` and not its self (default twig + symfony behaviour).


text: Sample SignalR project for practice purposes

redpajama_set_name: RedPajamaGithub


text:
sumeru.packages(
    'homeController.js',
    'locationController.js',
    'targetController.js'
)


text:
'use strict';

let Rx            = require('rx/dist/rx.experimental.js');
let AppDispatcher = require('../dispatchers/AppDispatcher');

/**
 * @type {Object.<Number: userId, Object: user>}
 */
let UserRepository  = {};

/**
 * @type {Object.<Number: userId, Object: Rx.Subject>}
 */
let UserObservables = {};

function setUser(user) {
  let id   = user.id;
  UserRepository[id] = user;
  publishUser(id);
}

function publishUser(id) {
  let subject = UserObservables[id];
  let user    = UserRepository[id] || {};
  if (subject) {
    subject.onNext(user);
    subject.onCompleted();
  }
}

function subscribeUser(id) {
  let subject;

  if (UserObservables[id]) {
    subject = UserObservables[id];
  } else {
    subject = UserObservables[id] = new Rx.AsyncSubject();
  }

  return subject.asObservable();
}

let dispatchToken = AppDispatcher.register(function(action) {
  switch(action.type) {
    case 'user:upsert':
      setUser(action.payload.user);
      break;
    default:
  }
});

module.exports = {
  user          : subscribeUser,
  dispatchToken : dispatchToken
};


text:
/*
 *  BSD License (http://lemurproject.org/galago-license)
 */
package org.lemurproject.galago.core.parse;

import gnu.trove.map.hash.TObjectIntHashMap;
import org.lemurproject.galago.core.types.FieldLengthData;
import org.lemurproject.galago.tupleflow.InputClass;
import org.lemurproject.galago.tupleflow.OutputClass;
import org.lemurproject.galago.tupleflow.StandardStep;
import org.lemurproject.galago.tupleflow.execution.Verified;
import org.lemurproject.galago.utility.ByteUtil;

import java.io.IOException;

/**
 *
 * @author sjh
 */
@Verified
@InputClass(className = "org.lemurproject.galago.core.parse.Document")
@OutputClass(className = "org.lemurproject.galago.core.types.FieldLengthData")
public class FieldLengthExtractor extends StandardStep<Document, FieldLengthData> {

  @Override
  public void process(Document doc) throws IOException {
    processor.process(new FieldLengthData(ByteUtil.fromString("document"), doc.identifier, doc.terms.size()));

    TObjectIntHashMap<String> fieldLengths = new TObjectIntHashMap<>();
    for (Tag tag : doc.tags) {
      int len = tag.end - tag.begin;
      fieldLengths.adjustOrPutValue(tag.name, len, len);
    }

    for (String field : fieldLengths.keySet()) {
      processor.process(new FieldLengthData(ByteUtil.fromString(field), doc.identifier, fieldLengths.get(field)));
    }
  }
}


text:
int getLength(int grid[][6], int rowSize);

void Problem2();

#endif


text:
source /vagrant/Vagrantconf

###########################################################
# No need to edit below this line.
###########################################################

# Provision Apache.
${PROVISION_SH_DIR}/prov-apache.sh

# Set project directories.
if [ "${PROJECT_INDEX_DIR}" != "" ]; then
    PROJECT_INDEX_DIR="${PROJECT_DIR_NAME}/${PROJECT_INDEX_DIR}"
else
    PROJECT_INDEX_DIR="${PROJECT_DIR_NAME}"
fi

# Create directory for project.
mkdir -p /usr/local/var/www/${PROJECT_DIR_NAME}

# Install PHP5 Apache module and provision PHP5 apache application.
apt-get -y install libapache2-mod-php7.0

cat > /etc/apache2/sites-available/${PROJECT_DEV_DOMAIN}.conf <<EOF
<VirtualHost *:80>
    DocumentRoot /usr/local/var/www/${PROJECT_INDEX_DIR}
    ServerName ${PROJECT_DEV_DOMAIN}

    <Directory /usr/local/var/www/${PROJECT_INDEX_DIR}>
        Options Indexes FollowSymLinks Includes ExecCGI
        Require all granted
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog \${APACHE_LOG_DIR}/${PROJECT_DEV_DOMAIN}.error.log
    CustomLog \${APACHE_LOG_DIR}/${PROJECT_DEV_DOMAIN}.access.log combined
</VirtualHost>
EOF

# Enable project site.
a2ensite ${PROJECT_DEV_DOMAIN}

# Add development domain to hosts file.
echo "127.0.1.1 ${PROJECT_DEV_DOMAIN}" >> /etc/hosts

if [ "${PHP7_XDEBUG}" == "yes" ]; then
    apt-get install php-xdebug
fi


text:
#include "tensorflow/core/profiler/convert/op_metrics_to_record.h"

#include <tuple>

#include "absl/algorithm/container.h"
#include "tensorflow/core/profiler/protobuf/op_metrics.pb.h"

namespace tensorflow {
namespace profiler {

std::vector<const OpMetrics*> SortedOpMetricsDb(const OpMetricsDb& metrics_db,
                                                int max_records) {
  std::vector<const OpMetrics*> result;
  result.reserve(metrics_db.metrics_db_size());
  for (const OpMetrics& metrics : metrics_db.metrics_db()) {
    result.push_back(&metrics);
  }

  auto comp = [](const OpMetrics* a, const OpMetrics* b) {
    return std::make_tuple(a->self_time_ps(), b->name()) >
           std::make_tuple(b->self_time_ps(), a->name());
  };

  if (max_records != -1 && result.size() > max_records) {
    absl::c_partial_sort(result, result.begin() + max_records, comp);
    result.resize(max_records);
  } else {
    absl::c_sort(result, comp);
  }
  return result;
}

}  // namespace profiler
}  // namespace tensorflow


text:
module RestfulObjects::Router::DomainTypeResources
  def self.registered(router)
    # D.21 Domain Types
    router.get "/domain-types" do
      model.get_type_list_representation
    end

    # D.22 Domain Type
    router.get "/domain-types/:domain_type" do
      model.types[params[:domain_type]].get_representation
    end

    # D.23 Domain Type Property
    router.get "/domain-types/:domain_type/properties/:property_id" do
      model.types[params[:domain_type]].properties[params[:property_id]].get_representation
    end

    # D.24 Domain Type Collection
    router.get "/domain-types/:domain_type/collections/:collection_id" do
      model.types[params[:domain_type]].collections[params[:collection_id]].get_representation
    end

    # D.25 Domain Type Action
    router.get "/domain-types/:domain_type/actions/:action_id" do
      model.types[params[:domain_type]].actions[params[:action_id]].get_representation
    end

    # D.26 Domain Type Action Parameter

    # D.27 Domain Type Action Invoke
  end
end


text:
<?php

namespace Upc\Cards\Bundle\CardsBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Upc\Cards\Bundle\CardsBundle\Entity\Card;
use Upc\Cards\Bundle\CardsBundle\Entity\CardCategoryUser;

/**
 * Tarjeta controller.
 *
 */
class CardCrudController extends Controller
{

    /**
     * @Route("/", name="admin_tarjetas_list")
     * @Template("")
     */
    public function listAction(Request $request) {
        $form = $this->createForm('card_search', null);
        $form->handleRequest($request);
        $criteria = $form->getData() ? $form->getData() : array();
        foreach ($criteria as $key => $value) {
            if (!$value) {
                unset($criteria[$key]);
            }
        }
        $em = $this->getDoctrine()
                ->getRepository('CardsBundle:Card');
        $query = $em->findUsingLike($criteria);
        $paginator = $this->get('knp_paginator');
        $pagination = $paginator->paginate(
                $query, $this->get('request')->query->get('page', 1)/* page number */, 5/* limit per page */
        );
        return array(
            'pagination' => $pagination,
            'form' => $form->createView()
        );
    }

     /**
     * @Route("/add", name="admin_tarjetas_add")
     * @Template("")
     */
    public function newAction(Request $request) {
        $object = new Card();
        $object->setCreatedAt( new \DateTime("now"));
        $form = $this->createForm('card', $object);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $object->setRootDir( str_replace('/cards/app', $this->getRequest()->getBasePath(),  $this->get('kernel')->getRootDir()).'/' );
            $em->persist($object);
            $em->flush();
            foreach ($object->getCategories() as $category) {
                $catcard = new CardCategoryUser();
                $catcard->setCard($object)
                        ->setCategory($category)
                        ->setStatus($object->getStatus())
                        ->setCreatedAt($object->getCreatedAt());
                $em->persist($catcard);
                $em->flush();
            }
            $this->get('session')->getFlashBag()->add(
            'card',
            'Registro grabado satisfactoriamente'
            );
            $nextAction = $form->get('saveAndAdd')->isClicked() ? 'admin_tarjetas_add' : 'admin_tarjetas_list';
            return $this->redirect($this->generateUrl($nextAction));
        }
        return array(
            'form' => $form->createView()
        );
    }
    /**
     * @Route("/{pk}", name="admin_tarjetas_edit")
     * @Template("")
     */
    public function editAction(Request $request, $pk) {
        $object = $this->getDoctrine()->getRepository('CardsBundle:Card')->find($pk);
        $form = $this->createForm('card', $object);
        $form->handleRequest($request);

        if ($form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($object);
            $em->flush();
            $this->get('session')->getFlashBag()->add(
            'card',
            'Registro modificado satisfactoriamente'
            );
            $nextAction = $form->get('saveAndAdd')->isClicked() ? 'admin_cards_add' : 'admin_tarjetas_list';
            return $this->redirect($this->generateUrl($nextAction));
        }
        return array(
            'form' => $form->createView()
        );
    }

    /**
     * @Route("/delete/{pk}", name="admin_tarjetas_delete")
     * @Template("")
     */
    public function deleteAction(Request $request, $pk) {
        $object = $this->getDoctrine()->getRepository('CardsBundle:Card')->find($pk);
        if (!$object) {
            $this->createNotFoundException('No existe la categoria');
        }
        $cats = $this->getDoctrine()->getRepository('CardsBundle:CardCategoryUser')->findBy(
                array('card' => $object));
        $em = $this->getDoctrine()->getManager();
        foreach ($cats as $value) {
            $em->remove($value);
        }
        $em->flush();
        $em->remove($object);
        $em->flush();
        $this->get('session')->getFlashBag()->add(
        'card',
        'Registro eliminado satisfactoriamente'
        );
        $nextAction = 'admin_tarjetas_list';
        return $this->redirect($this->generateUrl($nextAction));
    }
}


text:
<?php
namespace Neos\Flow\Security\Exception;

/**
 * A "NoAuthenticationProviderFound" Exception
 *
 * @api
 */
class NoAuthenticationProviderFoundException extends \Neos\Flow\Security\Exception
{
}


text:
'use strict';

angular.module('core').controller('HeaderController', ['$scope', 'Authentication', 'AuthService', 'Menus',
	function($scope, Authentication, AuthService, Menus) {
		$scope.authentication = Authentication;
		$scope.isCollapsed = false;
		$scope.menu = Menus.getMenu('topbar');

		$scope.toggleCollapsibleMenu = function() {
			$scope.isCollapsed = !$scope.isCollapsed;
		};

		// Collapsing the menu after navigation
		$scope.$on('$stateChangeSuccess', function() {
			$scope.isCollapsed = false;
		});

		$scope.showUsersMenu = function() {
			return AuthService.hasAdminAuthorization($scope.authentication);
		};

		$scope.hasMasterAuthorization = function() {
			return AuthService.hasMasterAuthorization($scope.authentication);
		};
	}
]);


text:
<?php
/* ====================
[BEGIN_SED_EXTPLUGIN]
Code=fbconnect
Part=header
File=fbconnect.header
Hooks=header.body
Tags=header.tpl:{FB_XMLNS},{FB_LOGIN},{FB_LOGOUT},{FB_LOGIN_REGISTER},{FB_LOGIN_URL},{FB_LOGOUT_URL},{FB_REGISTER_URL}
Order=10
[END_SED_EXTPLUGIN]
==================== */

defined('SED_CODE') or die('Wrong URL');

/**
 * Embeds FBConnect in header
 *
 * @package fbconnect
 * @version 2.0.0
 * @author Trustmaster
 * @copyright (c) 2011 Vladimir Sibirov, Skuola.net
 * @license BSD
 */

// Try to detect the locale
if (preg_match('#([a-z]{2})(\-[A-Z]{2})?#i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $fb_mt))
{
	$fb_locale = empty($fb_mt[2])
		? $fb_mt[1] . '_' . strtoupper($fb_mt[1])
		: $fb_mt[1] . str_replace('-', '_', strtoupper($fb_mt[2]));
}
else
{
	$fb_locale = $cfg['plugin']['fbconnect']['locale'];
}

$fb_channel_url = $sys['host'].$sys['site_uri'].'plugins/fbconnect/lib/facebook_channel.php';
$fb_reload_page = $usr['id'] > 0 ? 'false' : 'true';
$fb_init_script = <<<HTM

HTM;

$fb_register_url = SED_ABSOLUTE_URL . sed_url('plug', 'e=fbconnect&m=register');

$out['loginout_url'] = sed_url('users', 'm=logout&'.sed_xg());
$out['loginout'] = "".$L['Logout']."";
$fb_logout_button = ''.$L['Logout'].'';

$fb_params = array();
$fb_button_params = '';
if (!empty($cfg['plugin']['fbconnect']['scope']))
{
	$fb_params['scope'] = explode(',', $cfg['plugin']['fbconnect']['scope']);
	$fb_button_params = ' perms="'.$cfg['plugin']['fbconnect']['scope'].'"';
}

$t->assign(array(
	'FB_XMLNS' => 'xmlns:fb="http://www.facebook.com/2008/fbml"',
	'FB_LOGIN' => $fb_connected ? $fb_logout_button : '<fb:login-button'.$fb_button_params.'></fb:login-button>',
	'FB_LOGOUT' => $fb_connected ? $fb_logout_button : $out['loginout'],
	'FB_LOGOUT_ONCLICK' => $fb_connected ? 'onclick="FB.logout();return true;"' : '',
	'FB_LOGIN_REGISTER' => $fb_connected ? '' : '<fb:login-button registration-url="'.$fb_register_url.'"'.$fb_button_params.'></fb:login-button>',
	'FB_REGISTER_URL' => $fb_register_url,
	'FB_LOGIN_URL' => $fb_connected ? '#' : $facebook->getLoginUrl($fb_params),
	'FB_LOGOUT_URL' => $fb_connected ? '#' : $facebook->getLogoutUrl(),
));

?>


text:
<!DOCTYPE html>

  <title>Pomodoro Timer</title>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="description" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>

  <link href='https://fonts.googleapis.com/css?family=Aclonica' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/normalize.css">
  <link rel="stylesheet" href="css/style.css">

  <link rel="apple-touch-icon" sizes="57x57" href="icons/apple-icon-57x57.png">
  <link rel="apple-touch-icon" sizes="60x60" href="icons/apple-icon-60x60.png">
  <link rel="apple-touch-icon" sizes="72x72" href="icons/apple-icon-72x72.png">
  <link rel="apple-touch-icon" sizes="76x76" href="icons/apple-icon-76x76.png">
  <link rel="apple-touch-icon" sizes="114x114" href="icons/apple-icon-114x114.png">
  <link rel="apple-touch-icon" sizes="120x120" href="icons/apple-icon-120x120.png">
  <link rel="apple-touch-icon" sizes="144x144" href="icons/apple-icon-144x144.png">
  <link rel="apple-touch-icon" sizes="152x152" href="icons/apple-icon-152x152.png">
  <link rel="apple-touch-icon" sizes="180x180" href="icons/apple-icon-180x180.png">
  <link rel="icon" type="image/png" sizes="192x192"  href="icons/android-icon-192x192.png">
  <link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
  <link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
  <link rel="manifest" href="icons/manifest.json">
  <meta name="msapplication-TileColor" content="#ffffff">
  <meta name="msapplication-TileImage" content="icons/ms-icon-144x144.png">
  <meta name="theme-color" content="#ffffff">

      <button class="btn" id="minus-pomodoro">-</button>

 :

      <button class="btn" id="plus-pomodoro">+</button>

      <button class="btn" id="minus-break">-</button>

 :

      <button class="btn" id="plus-break">+</button>

    <button class="btn" id="run">Work Time!</button>


text:
<?php

declare(strict_types=1);

namespace Inowas\Common\Command;

use Inowas\Common\Exception\JsonSchemaValidationFailedException;
use Inowas\Common\SchemaValidator\UrlReplaceLoader;
use League\JsonGuard\Validator;
use League\JsonReference\Dereferencer;
use Prooph\Common\Messaging\Command;
use Prooph\Common\Messaging\MessageDataAssertion;

abstract class AbstractJsonSchemaCommand extends Command
{
    /**
     * @var object
     */
    protected $dereferencedSchema;

    /**
     * @var array
     */
    protected $payload;

    /**
     * Returns the json schema for this command or an empty string if command has no payload
     *
     * @return string
     */
    abstract public function schema(): string;

    /**
     * AbstractJsonSchemaCommand constructor.
     * @param array|null $payload
     * @throws \League\JsonGuard\Exception\MaximumDepthExceededException
     * @throws \League\JsonGuard\Exception\InvalidSchemaException
     * @throws \InvalidArgumentException
     * @throws \Inowas\Common\Exception\JsonSchemaValidationFailedException
     */
    final public function __construct(array $payload = null)
    {
        $this->setPayload($payload);
        $this->init();
    }

    /**
     * @return array
     */
    final public function payload(): array
    {
        return $this->payload;
    }

    /**
     * @inheritdoc
     * @throws \InvalidArgumentException
     * @throws \League\JsonGuard\Exception\InvalidSchemaException
     * @throws \League\JsonGuard\Exception\MaximumDepthExceededException
     * @throws \Inowas\Common\Exception\JsonSchemaValidationFailedException
     */
    final protected function setPayload(array $payload = null): void
    {
        if ($this->schema() === '') {
            if (null !== $payload) {
                throw new \InvalidArgumentException(__CLASS__ . ' has no json schema defined, but is constructed with payload.');
            }
            $this->payload = [];
            return;
        }

        MessageDataAssertion::assertPayload($payload);

        $this->payload = $payload;

        $payload = json_decode(json_encode($payload), FALSE);
        $validator = new Validator($payload, $this->dereferencedSchema());
        if (! $validator->passes()) {
            throw JsonSchemaValidationFailedException::withErrors($validator->errors());
        }
    }

    /**
     * @return object
     */
    protected function dereferencedSchema()
    {
        if (null === $this->dereferencedSchema) {
            $dereferencer = Dereferencer::draft4();
            $dereferencer->getLoaderManager()->registerLoader('https', new UrlReplaceLoader());
            $this->dereferencedSchema = $dereferencer->dereference($this->schema());
        }
        return $this->dereferencedSchema;
    }
}


text:
<?php
namespace themes\standard;

class Layout extends \pew\Layout {

	public function header() {
?>
<html>
	<head>
		<title>pew Default Layout</title>
	</head>
	<body>

<?php
	}

	public function footer() {
?>
	</body>
<?php
	}

}

?>


text:
#include "pipe/p_shader_tokens.h"
#include "tgsi/tgsi_parse.h"
#include "util/u_memory.h"

#include "svga_tgsi_emit.h"

static boolean translate_vs_ps_semantic( struct tgsi_declaration_semantic semantic,
                                         unsigned *usage,
                                         unsigned *idx )
{
   switch (semantic.Name) {
   case TGSI_SEMANTIC_POSITION:
      *idx = semantic.Index;
      *usage = SVGA3D_DECLUSAGE_POSITION;
      break;
   case TGSI_SEMANTIC_COLOR:

      *idx = semantic.Index;
      *usage = SVGA3D_DECLUSAGE_COLOR;
      break;
   case TGSI_SEMANTIC_BCOLOR:
      *idx = semantic.Index + 2; /* sharing with COLOR */
      *usage = SVGA3D_DECLUSAGE_COLOR;
      break;
   case TGSI_SEMANTIC_FOG:
      *idx = 0;
      assert(semantic.Index == 0);
      *usage = SVGA3D_DECLUSAGE_TEXCOORD;
      break;
   case TGSI_SEMANTIC_PSIZE:
      *idx = semantic.Index;
      *usage = SVGA3D_DECLUSAGE_PSIZE;
      break;
   case TGSI_SEMANTIC_GENERIC:
      *idx = semantic.Index + 1; /* texcoord[0] is reserved for fog */
      *usage = SVGA3D_DECLUSAGE_TEXCOORD;
      break;
   case TGSI_SEMANTIC_NORMAL:
      *idx = semantic.Index;
      *usage = SVGA3D_DECLUSAGE_NORMAL;
      break;
   default:
      assert(0);
      *usage = SVGA3D_DECLUSAGE_TEXCOORD;
      *idx = 0;
      return FALSE;
   }

   return TRUE;
}

static boolean emit_decl( struct svga_shader_emitter *emit,
                          SVGA3dShaderDestToken reg,
                          unsigned usage,
                          unsigned index )
{
   SVGA3DOpDclArgs dcl;
   SVGA3dShaderInstToken opcode;

   opcode = inst_token( SVGA3DOP_DCL );
   dcl.values[0] = 0;
   dcl.values[1] = 0;

   dcl.dst = reg;
   dcl.usage = usage;
   dcl.index = index;
   dcl.values[0] |= 1<<31;

   return  (emit_instruction(emit, opcode) &&
            svga_shader_emit_dwords( emit, dcl.values, Elements(dcl.values)));
}

static boolean emit_vface_decl( struct svga_shader_emitter *emit )
{
   if (!emit->emitted_vface) {
      SVGA3dShaderDestToken reg =
         dst_register( SVGA3DREG_MISCTYPE,
                       SVGA3DMISCREG_FACE );

      if (!emit_decl( emit, reg, 0, 0 ))
         return FALSE;

      emit->emitted_vface = TRUE;
   }
   return TRUE;
}

static boolean ps30_input( struct svga_shader_emitter *emit,
                           struct tgsi_declaration_semantic semantic,
                           unsigned idx )
{
   unsigned usage, index;
   SVGA3dShaderDestToken reg;

   if (semantic.Name == TGSI_SEMANTIC_POSITION) {
      emit->input_map[idx] = src_register( SVGA3DREG_MISCTYPE,
                                           SVGA3DMISCREG_POSITION );

      emit->input_map[idx].base.swizzle = TRANSLATE_SWIZZLE( TGSI_SWIZZLE_X,
                                                             TGSI_SWIZZLE_Y,
                                                             TGSI_SWIZZLE_Y,
                                                             TGSI_SWIZZLE_Y );

      reg = writemask( dst(emit->input_map[idx]),
                       TGSI_WRITEMASK_XY );

      return emit_decl( emit, reg, 0, 0 );
   }
   else if (emit->key.fkey.light_twoside &&
            (semantic.Name == TGSI_SEMANTIC_COLOR)) {

      if (!translate_vs_ps_semantic( semantic, &usage, &index ))
         return FALSE;

      emit->internal_color_idx[emit->internal_color_count] = idx;
      emit->input_map[idx] = src_register( SVGA3DREG_INPUT, emit->ps30_input_count );
      emit->ps30_input_count++;
      emit->internal_color_count++;

      reg = dst( emit->input_map[idx] );

      if (!emit_decl( emit, reg, usage, index ))
         return FALSE;

      semantic.Name = TGSI_SEMANTIC_BCOLOR;
      if (!translate_vs_ps_semantic( semantic, &usage, &index ))
         return FALSE;

      reg = dst_register( SVGA3DREG_INPUT, emit->ps30_input_count++ );

      if (!emit_decl( emit, reg, usage, index ))
         return FALSE;

      if (!emit_vface_decl( emit ))
         return FALSE;

      return TRUE;
   }
   else if (semantic.Name == TGSI_SEMANTIC_FACE) {
      if (!emit_vface_decl( emit ))
         return FALSE;
      emit->emit_frontface = TRUE;
      emit->internal_frontface_idx = idx;
      return TRUE;
   }
   else {

      if (!translate_vs_ps_semantic( semantic, &usage, &index ))
         return FALSE;

      emit->input_map[idx] = src_register( SVGA3DREG_INPUT, emit->ps30_input_count++ );
      reg = dst( emit->input_map[idx] );

      return emit_decl( emit, reg, usage, index );
   }

}

/* PS output registers are the same as 2.0
 */
static boolean ps30_output( struct svga_shader_emitter *emit,
                            struct tgsi_declaration_semantic semantic,
                            unsigned idx )
{
   SVGA3dShaderDestToken reg;

   switch (semantic.Name) {
   case TGSI_SEMANTIC_COLOR:
      if (emit->unit == PIPE_SHADER_FRAGMENT &&
          emit->key.fkey.white_fragments) {

         emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                               emit->nr_hw_temp++ );
         emit->temp_col[idx] = emit->output_map[idx];
         emit->true_col[idx] = dst_register( SVGA3DREG_COLOROUT,
                                              semantic.Index );
      }
      else {
         emit->output_map[idx] = dst_register( SVGA3DREG_COLOROUT,
                                               semantic.Index );
      }
      break;
   case TGSI_SEMANTIC_POSITION:
      emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                            emit->nr_hw_temp++ );
      emit->temp_pos = emit->output_map[idx];
      emit->true_pos = dst_register( SVGA3DREG_DEPTHOUT,
                                     semantic.Index );
      break;
   default:
      assert(0);
      reg = dst_register( SVGA3DREG_COLOROUT, 0 );
      break;
   }

   return TRUE;
}

/* We still make up the input semantics the same as in 2.0
 */
static boolean vs30_input( struct svga_shader_emitter *emit,
                           struct tgsi_declaration_semantic semantic,
                           unsigned idx )
{
   SVGA3DOpDclArgs dcl;
   SVGA3dShaderInstToken opcode;
   unsigned usage, index;

   opcode = inst_token( SVGA3DOP_DCL );
   dcl.values[0] = 0;
   dcl.values[1] = 0;

   if (emit->key.vkey.zero_stride_vertex_elements & (1 << idx)) {
      unsigned i;
      unsigned offset = 0;
      unsigned start_idx = emit->info.file_max[TGSI_FILE_CONSTANT] + 1;
      /* adjust for prescale constants */
      start_idx += emit->key.vkey.need_prescale ? 2 : 0;
      /* compute the offset from the start of zero stride constants */
      for (i = 0; i < PIPE_MAX_ATTRIBS && i < idx; ++i) {
         if (emit->key.vkey.zero_stride_vertex_elements & (1<<i))
            ++offset;
      }
      emit->input_map[idx] = src_register( SVGA3DREG_CONST,
                                           start_idx + offset );
   } else {
      emit->input_map[idx] = src_register( SVGA3DREG_INPUT, idx );
      dcl.dst = dst_register( SVGA3DREG_INPUT, idx );

      assert(dcl.dst.reserved0);

      svga_generate_vdecl_semantics( idx, &usage, &index );

      dcl.usage = usage;
      dcl.index = index;
      dcl.values[0] |= 1<<31;

      return  (emit_instruction(emit, opcode) &&
               svga_shader_emit_dwords( emit, dcl.values, Elements(dcl.values)));
   }
   return TRUE;
}

/* VS3.0 outputs have proper declarations and semantic info for
 * matching against PS inputs.
 */
static boolean vs30_output( struct svga_shader_emitter *emit,
                         struct tgsi_declaration_semantic semantic,
                         unsigned idx )
{
   SVGA3DOpDclArgs dcl;
   SVGA3dShaderInstToken opcode;
   unsigned usage, index;

   opcode = inst_token( SVGA3DOP_DCL );
   dcl.values[0] = 0;
   dcl.values[1] = 0;

   if (!translate_vs_ps_semantic( semantic, &usage, &index ))
      return FALSE;

   dcl.dst = dst_register( SVGA3DREG_OUTPUT, idx );
   dcl.usage = usage;
   dcl.index = index;
   dcl.values[0] |= 1<<31;

   if (semantic.Name == TGSI_SEMANTIC_POSITION) {
      assert(idx == 0);
      emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                            emit->nr_hw_temp++ );
      emit->temp_pos = emit->output_map[idx];
      emit->true_pos = dcl.dst;
   }
   else if (semantic.Name == TGSI_SEMANTIC_PSIZE) {
      emit->output_map[idx] = dst_register( SVGA3DREG_TEMP,
                                            emit->nr_hw_temp++ );
      emit->temp_psiz = emit->output_map[idx];

      /* This has the effect of not declaring psiz (below) and not
       * emitting the final MOV to true_psiz in the postamble.
       */
      if (!emit->key.vkey.allow_psiz)
         return TRUE;

      emit->true_psiz = dcl.dst;
   }
   else {
      emit->output_map[idx] = dcl.dst;
   }

   return  (emit_instruction(emit, opcode) &&
            svga_shader_emit_dwords( emit, dcl.values, Elements(dcl.values)));
}

static boolean ps30_sampler( struct svga_shader_emitter *emit,
                          struct tgsi_declaration_semantic semantic,
                          unsigned idx )
{
   SVGA3DOpDclArgs dcl;
   SVGA3dShaderInstToken opcode;

   opcode = inst_token( SVGA3DOP_DCL );
   dcl.values[0] = 0;
   dcl.values[1] = 0;

   dcl.dst = dst_register( SVGA3DREG_SAMPLER, idx );
   dcl.type = svga_tgsi_sampler_type( emit, idx );
   dcl.values[0] |= 1<<31;

   return  (emit_instruction(emit, opcode) &&
            svga_shader_emit_dwords( emit, dcl.values, Elements(dcl.values)));
}

boolean svga_translate_decl_sm30( struct svga_shader_emitter *emit,
                             const struct tgsi_full_declaration *decl )
{
   unsigned first = decl->Range.First;
   unsigned last = decl->Range.Last;
   unsigned semantic = 0;
   unsigned semantic_idx = 0;
   unsigned idx;

   if (decl->Declaration.Semantic) {
      semantic = decl->Semantic.Name;
      semantic_idx = decl->Semantic.Index;
   }

   for( idx = first; idx <= last; idx++ ) {
      boolean ok;

      switch (decl->Declaration.File) {
      case TGSI_FILE_SAMPLER:
         assert (emit->unit == PIPE_SHADER_FRAGMENT);
         ok = ps30_sampler( emit, decl->Semantic, idx );
         break;

      case TGSI_FILE_INPUT:
         if (emit->unit == PIPE_SHADER_VERTEX)
            ok = vs30_input( emit, decl->Semantic, idx );
         else
            ok = ps30_input( emit, decl->Semantic, idx );
         break;

      case TGSI_FILE_OUTPUT:
         if (emit->unit == PIPE_SHADER_VERTEX)
            ok = vs30_output( emit, decl->Semantic, idx );
         else
            ok = ps30_output( emit, decl->Semantic, idx );
         break;

      default:
         /* don't need to declare other vars */
         ok = TRUE;
      }

      if (!ok)
         return FALSE;
   }

   return TRUE;
}


text:
namespace ProductsShop.App.DTOs.JsonExport
{
    using System.Collections.Generic;
    using Newtonsoft.Json;

    public class SuccessfullySoldProductsSellerDto
    {
        [JsonProperty("firstName")]
        public string SellerFirstName { get; set; }

        [JsonProperty("lastName")]
        public string SellerLastName { get; set; }

        [JsonProperty("soldProducts")]
        public IEnumerable<SuccessfullySoldProductsProductDto> SoldProducts { get; set; }
    }
}


text:
package mobi.tarantino.stub.auto.feature.dashboard.services;

import com.hannesdorfmann.mosby.mvp.MvpBasePresenter;

/**

 */
public class ServicesPresenter extends MvpBasePresenter<ServicesView> {

}


text:
EmployeeModule::Engine.routes.draw do
end


text:
from crtauth import exceptions, rsa, key_provider
import ldap
from ldap import filter

class LDAPKeyProvider(key_provider.KeyProvider):
    """
    Provides a PubKey instance based on a lookup in an LDAP directory.

    User entries are expected to be of class posixAccount living directly under
    base_dn in the directory information tree, have an uid matching the
    username parameter and one sshPublicKey string representation
    of the ssh public key of the user.

    Group entries are expected to be of class posixGroup and be located under
    cn=groups under the base_dn in the directory information tree. The group
    string parameter corresponds to the cn attribute of the posixGroup entry
    """
    def __init__(self, uri, auth_user, auth_password, base_dn, group=None):
        """
        Constructs and binds an LDAPKeyProvider instance to the server
        identified by the uri using auth_user and auth_password for
        authentication.

        When users are looked up, it is verified that they belong to the
        provided group.
        """
        self.group = None
        if group:
            self.group = filter.escape_filter_chars(group)
        self.base_dn = base_dn

        # I know, this is not functionality the ldap module straightforwardly
        # exposes, but it seems to work.
        self.conn = ldap.ldapobject.ReconnectLDAPObject(uri)
        self.conn.simple_bind(auth_user, auth_password)

    def get_key(self, username):
        """
        Returns a PubKey instance based on LDAP lookup. If group is specified
        in the constructor, the user needs to be a member for the lookup to
        succeed.

        Throws NoSuchUserException, InsufficientPrivilegesException,
        MissingKeyException when appropriate.
        """

        user = filter.escape_filter_chars(username)
        f = ("(|(&(uid=%s)(objectClass=posixAccount))"
             "(&(memberUid=%s)(objectClass=posixGroup)))" % (user, user))

        # We don't care about looking for a group if self.group is not set
        group_dn = None
        if self.group:
            group_dn = "cn=%s,cn=groups,%s" % (self.group, self.base_dn)

        result = dict(self.conn.search_s(self.base_dn, ldap.SCOPE_SUBTREE, f,
                                         ['sshPublicKey']))

        attributes = result.get("uid=%s,cn=users,%s" % (user, self.base_dn))
        if attributes is None:
            raise exceptions.NoSuchUserException("User '%s' not found" % user)

        key_list = attributes.get("sshPublicKey")
        if key_list is None:
            raise exceptions.MissingKeyException("User '%s' does not have "
                                                 "her key in LDAP" % user)
        if len(key_list) > 1:
            raise RuntimeError("Can't handle multiple sshPublicKey values "
                               "for an LDAP user")

        if group_dn and group_dn not in result:
            s = ("User '%s' not member of required group '%s'" %
                 (user, self.group))
            raise exceptions.InsufficientPrivilegesException(s)

        return rsa.RSAPublicKey(key_list[0])

class HybridKeyProvider(key_provider.KeyProvider):
    """
    A KeyProvider that behaves as an LDAP KeyProvider if there is no ldap data
    it falls back to a FileKeyProvider.
    Useful for non mixing real ldap users with service-specific non-human
    users.
    """

    def __init__(self, dir, uri, auth_user, auth_password, base_dn, group=None):
        """
        Constructs a FileKeyProvider based on the directory dir, and a
        LDAPKeyProvider based on the remaining arguments.
        """
        self.file_key_provider = key_provider.FileKeyProvider(dir)
        self.ldap_key_provider = LDAPKeyProvider(uri, auth_user, auth_password,
                                                 base_dn, group)

    def get_key(self, username):
        """
        Returns the user's public key if it can be found in LDAP, otherwise
        tries to find it in the key directory, or fails.
        """
        try:
            return self.ldap_key_provider.get_key(username)
        except exceptions.NoSuchUserException:
            try:
                return self.file_key_provider.get_key(username)
            except Exception, e:
                raise exceptions.NoSuchUserException(
                    "User %s not in ldap, defaulted to pubkey dir and got "
                    "exception %s" % (username, e))


text:
using System;
using System.Diagnostics;
using NUnit.Framework;

namespace Xamarin.Forms.Core.UnitTests
{
	[TestFixture]
	public class ButtonUnitTest
		: CommandSourceTests<Button>
	{
		[SetUp]
		public override void Setup ()
		{
			base.Setup ();
			Device.PlatformServices = new MockPlatformServices ();
		}

		[TearDown]
		public override void TearDown ()
		{
			base.TearDown ();
			Device.PlatformServices = null;
		}

		[Test]
		public void MeasureInvalidatedOnTextChange ()
		{
			var button = new Button ();

			bool fired = false;
			button.MeasureInvalidated += (sender, args) => fired = true;

			button.Text = "foo";
			Assert.True (fired);
		}

		[Test]
		public void TestTappedEvent ()
		{
			var view = new Button ();

			bool activated = false;
			view.Clicked += (sender, e) => activated = true;

			((IButtonController) view).SendClicked ();

			Assert.True (activated);
		}

		protected override Button CreateSource()
		{
			return new Button();
		}

		protected override void Activate (Button source)
		{
			((IButtonController) source).SendClicked();
		}

		protected override BindableProperty IsEnabledProperty
		{
			get { return Button.IsEnabledProperty; }
		}

		protected override BindableProperty CommandProperty
		{
			get { return Button.CommandProperty; }
		}

		protected override BindableProperty CommandParameterProperty
		{
			get { return Button.CommandParameterProperty; }
		}

		[Test]
		public void TestBindingContextPropagation ()
		{
			var context = new object ();
			var button = new Button ();
			button.BindingContext = context;
			var source = new FileImageSource ();
			button.Image = source;
			Assert.AreSame (context, source.BindingContext);

			button = new Button ();
			source = new FileImageSource ();
			button.Image = source;
			button.BindingContext = context;
			Assert.AreSame (context, source.BindingContext);
		}

		[Test]
		public void TestImageSourcePropertiesChangedTriggerResize ()
		{
			var source = new FileImageSource ();
			var button = new Button { Image = source };
			bool fired = false;
			button.MeasureInvalidated += (sender, e) => fired = true;
			Assert.Null (source.File);
			source.File = "foo.png";
			Assert.NotNull (source.File);
			Assert.True (fired);
		}

		[Test]
		public void AssignToFontStructUpdatesFontFamily (
			[Values (NamedSize.Default, NamedSize.Large, NamedSize.Medium, NamedSize.Small, NamedSize.Micro)] NamedSize size,
			[Values (FontAttributes.None, FontAttributes.Bold, FontAttributes.Italic, FontAttributes.Bold | FontAttributes.Italic)] FontAttributes attributes)
		{
			var button = new Button {Platform = new UnitPlatform ()};
			double startSize = button.FontSize;
			var startAttributes = button.FontAttributes;

			bool firedSizeChanged = false;
			bool firedAttributesChanged = false;
			button.PropertyChanged += (sender, args) => {
				if (args.PropertyName == Label.FontSizeProperty.PropertyName)
					firedSizeChanged = true;
				if (args.PropertyName == Label.FontAttributesProperty.PropertyName)
					firedAttributesChanged = true;
			};

			button.Font = Font.OfSize ("Testing123", size).WithAttributes (attributes);

			Assert.AreEqual (Device.GetNamedSize (size, typeof (Label), true), button.FontSize);
			Assert.AreEqual (attributes, button.FontAttributes);
			Assert.AreEqual (startSize != button.FontSize, firedSizeChanged);
			Assert.AreEqual (startAttributes != button.FontAttributes, firedAttributesChanged);
		}

		[Test]
		public void AssignToFontFamilyUpdatesFont ()
		{
			var button = new Button {Platform = new UnitPlatform ()};

			button.FontFamily = "CrazyFont";
			Assert.AreEqual (button.Font, Font.OfSize ("CrazyFont", button.FontSize));
		}

		[Test]
		public void AssignToFontSizeUpdatesFont ()
		{
			var button = new Button {Platform = new UnitPlatform ()};

			button.FontSize = 1000;
			Assert.AreEqual (button.Font, Font.SystemFontOfSize (1000));
		}

		[Test]
		public void AssignToFontAttributesUpdatesFont ()
		{
			var button = new Button {Platform = new UnitPlatform ()};

			button.FontAttributes = FontAttributes.Italic | FontAttributes.Bold;
			Assert.AreEqual (button.Font, Font.SystemFontOfSize (button.FontSize, FontAttributes.Bold | FontAttributes.Italic));
		}

		[Test]
		public void CommandCanExecuteUpdatesEnabled ()
		{
			var button = new Button ();

			bool result = false;

			var bindingContext = new {
				Command = new Command (() => { }, () => result)
			};

			button.SetBinding (Button.CommandProperty, "Command");
			button.BindingContext = bindingContext;

			Assert.False (button.IsEnabled);

			result = true;

			bindingContext.Command.ChangeCanExecute ();

			Assert.True (button.IsEnabled);
		}

		[Test]
		public void ButtonContentLayoutTypeConverterTest()
		{
			var converter = new Button.ButtonContentTypeConverter();
			Assert.True(converter.CanConvertFrom(typeof(string)));

			AssertButtonContentLayoutsEqual(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Left, 10), converter.ConvertFromInvariantString("left,10"));
			AssertButtonContentLayoutsEqual(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Right, 10), converter.ConvertFromInvariantString("right"));
			AssertButtonContentLayoutsEqual(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Top, 20), converter.ConvertFromInvariantString("top,20"));
			AssertButtonContentLayoutsEqual(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Left, 15), converter.ConvertFromInvariantString("15"));
			AssertButtonContentLayoutsEqual(new Button.ButtonContentLayout(Button.ButtonContentLayout.ImagePosition.Bottom, 0), converter.ConvertFromInvariantString("Bottom, 0"));

			Assert.Throws<InvalidOperationException>(() => converter.ConvertFromInvariantString(""));
		}

		private void AssertButtonContentLayoutsEqual(Button.ButtonContentLayout layout1, object layout2)
		{
			var bcl = (Button.ButtonContentLayout)layout2;

			Assert.AreEqual(layout1.Position, bcl.Position);
			Assert.AreEqual(layout1.Spacing, bcl.Spacing);
		}
	}
}


text:
'use strict';

/**
 * Module dependencies.
 */
var fs = require('fs'),
	http = require('http'),
	https = require('https'),
	express = require('express'),
	morgan = require('morgan'),
	bodyParser = require('body-parser'),
	session = require('express-session'),
	compress = require('compression'),
	methodOverride = require('method-override'),
	cookieParser = require('cookie-parser'),
	helmet = require('helmet'),
	passport = require('passport'),
	mongoStore = require('connect-mongo')({
		session: session
	}),
	flash = require('connect-flash'),
	config = require('./config'),
	consolidate = require('consolidate'),
	request = require('request'),
	path = require('path');

module.exports = function(db) {
	// Initialize express app
	var app = express();

	// Globbing model files
	config.getGlobbedFiles('./app/models/**/*.js').forEach(function(modelPath) {
		require(path.resolve(modelPath));
	});

	//checks for expired campaigns
	require('./../scheduler')();

	// Setting application local variables
	app.locals.title = config.app.title;
	app.locals.description = config.app.description;
	app.locals.keywords = config.app.keywords;
	app.locals.jsFiles = config.getJavaScriptAssets();
	app.locals.cssFiles = config.getCSSAssets();

	//converts all protocols to https
 	var forceSsl = function (req, res, next) {
    if (req.headers['x-forwarded-proto'] !== 'https') {
        return res.redirect(['https://', req.get('Host'), req.url].join(''));
    }
    return next();
 	};

 	//checks if the env is production or staging then converts url to https.. **I removed forceSSL for production- Google redirect URI error**
  if (process.env.NODE_ENV === 'staging') {
      app.use(forceSsl);
  }
	// Passing the request url to environment locals
	app.use(function(req, res, next) {
		res.locals.url = req.protocol + '://' + req.headers.host + req.url;
		next();
	});

	// Should be placed before express.static
	app.use(compress({
		filter: function(req, res) {
			return (/json|text|javascript|css/).test(res.getHeader('Content-Type'));
		},
		level: 9
	}));

	//keep app awake on heroku
	if (process.env.NODE_ENV === 'staging') {
		setInterval(function () {
			request('http://andonation-mando.herokuapp.com/#!/', function(err, res, body) {
			});
		}, 5000);
	}

	// Showing stack errors
	app.set('showStackError', true);

	// Set swig as the template engine
	app.engine('server.view.html', consolidate[config.templateEngine]);

	// Set views path and view engine
	app.set('view engine', 'server.view.html');
	app.set('views', './app/views');

	// Environment dependent middleware
	if (process.env.NODE_ENV === 'development') {
		// Enable logger (morgan)
		app.use(morgan('dev'));

		// Disable views cache
		app.set('view cache', false);
	} else if (process.env.NODE_ENV === 'production') {
		app.locals.cache = 'memory';
	}

	// Request body parsing middleware should be above methodOverride
	app.use(bodyParser.urlencoded({
		extended: true
	}));
	app.use(bodyParser.json());
	app.use(methodOverride());

	// CookieParser should be above session
	app.use(cookieParser());

	// Express MongoDB session storage
	app.use(session({
		saveUninitialized: true,
		resave: true,
		secret: config.sessionSecret,
		store: new mongoStore({
			db: db.connection.db,
			collection: config.sessionCollection
		})
	}));

	// use passport session
	app.use(passport.initialize());
	app.use(passport.session());

	// connect flash for flash messages
	app.use(flash());

	// Use helmet to secure Express headers
	app.use(helmet.xframe());
	app.use(helmet.xssFilter());
	app.use(helmet.nosniff());
	app.use(helmet.ienoopen());
	app.disable('x-powered-by');

	// Setting the app router and static folder
	app.use(express.static(path.resolve('./public')));

	// Globbing routing files
	config.getGlobbedFiles('./app/routes/**/*.js').forEach(function(routePath) {
		require(path.resolve(routePath))(app);
	});

	// Assume 'not found' in the error msgs is a 404. this is somewhat silly, but valid, you can do whatever you like, set properties, use instanceof etc.
	app.use(function(err, req, res, next) {
		// If the error object doesn't exists
		if (!err) return next();

		// Log it
		console.error(err.stack);

		// Error page
		res.status(500).render('500', {
			error: err.stack
		});
	});

	// Assume 404 since no middleware responded
	app.use(function(req, res) {
		res.status(404).render('404', {
			url: req.originalUrl,
			error: 'Not Found'
		});
	});

	if (process.env.NODE_ENV === 'secure') {
		// Log SSL usage
		console.log('Securely using https protocol');

		// Load SSL key and certificate
		var privateKey = fs.readFileSync('./config/sslcerts/key.pem', 'utf8');
		var certificate = fs.readFileSync('./config/sslcerts/cert.pem', 'utf8');

		// Create HTTPS Server
		var httpsServer = https.createServer({
			key: privateKey,
			cert: certificate
		}, app);

		// Return HTTPS server instance
		return httpsServer;
	}

	// Return Express server instance
	return app;
};


text:
package demo.model;

import java.io.Serializable;
import java.util.Set;

/**
 * Created by Administrator on 2017-05-10.
 */
public class Category implements Serializable {
    private int id;
    private String categoryName;
    private Category parentCategory;
    private Set subCategories;
    private String info;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Category getParentCategory() {
        return parentCategory;
    }

    /**
     * @param parentCategory the parentCategory to set
     */
    public void setParentCategory(Category parentCategory) {
        this.parentCategory = parentCategory;
    }

    public Set getSubCategories() {
        return subCategories;
    }

    public void setSubCategories(Set subCategories) {
        this.subCategories = subCategories;
    }

    public String toString() {
        return categoryName;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    /**
     * Try to avoid database ids in your hashCode and equals() implementation.
     * Base hashCode() and equals() implementation on buisness key and on immutable attributes of the entity object
     * @return
     */
    @Override
    public int hashCode() {
        return getCategoryName().length() + 20;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Category) {
            Category object = (Category) obj;
            if (this == object) {
                return true;
            }
            if (object.getCategoryName().equals(object.getCategoryName())) {
                return true;
            } else {
                return false;
            }

        } else
            return false;
    }

}


text:
"""
Simple shim for running the client program during development.
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals

import dev_glue  # NOQA
import ga4gh.client.cli as cli

if __name__ == "__main__":
    cli.client_main()


text:
import React from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';

import RaisedButton from 'material-ui/RaisedButton';
import FlatButton from 'material-ui/FlatButton';
import AppBar from 'material-ui/AppBar'
import BottomNavigation from 'material-ui/BottomNavigation'
import Avatar from 'material-ui/Avatar';
import Paper from 'material-ui/Paper';
import { Link } from 'react-router-dom';
import axios from 'axios';
import _ from 'lodash';
import profPic from '../Images/pedro.jpg';
import CircularProgress from 'material-ui/CircularProgress';
import { Tabs, Tab } from 'material-ui/Tabs';
import Slider from 'material-ui/Slider';
import { withRouter } from "react-router-dom";

import {
    Table,
    TableBody,
    TableHeader,
    TableHeaderColumn,
    TableRow,
    TableRowColumn,
} from 'material-ui/Table';

import CreateMotorista from '../Components/CreateMotorista'
import Header from '../ComponentsFixed/Header';

const inlineStyles = {
    tablerow: {
        fontSize: '13px',
        color: 'rgb(51, 51, 51)',
    },
    tablerowHead: {
        fontSize: '17px',
        color: 'rgb(51, 51, 51)',
    },
    tableHeader: {
        textAlign: 'center', fontSize: '20px', color: 'rgb(51, 51, 51)'
    }
}

import backgroundImg from '../Images/background-img.jpg'
import componentbgImg from '../Images/component-bg.jpg'

class ListMotoristas extends React.Component {

    constructor(props) {
        super(props);
        this.tableDesign = {
            fixedHeader: true,
            fixedFooter: true,
            stripedRows: true,
            showRowHover: false,
            selectable: false,
            multiSelectable: false,
            enableSelectAll: false,
            deselectOnClickaway: true,
            showCheckboxes: false,
            height: '200px',

        };

        this.state = {
            listMotoristas: [],
            listPassageiros: [],
            selected: [1],
        }
    }

    componentDidMount() {
        axios.all([
            axios.get("https://gerencia-corridas.herokuapp.com/api/select-passageiro"),
            axios.get("https://gerencia-corridas.herokuapp.com/api/select-motorista"),
        ]).then(axios.spread((passageiros, motoristas) => {
            this.setState({ listMotoristas: motoristas.data, listPassageiros: passageiros.data })
        }));
    }

    handleRowSelection(selectedRows) {
        this.setState({
            selected: selectedRows,
        });
    };

    render() {
        return (

            <div className="main-container" style={{ backgroundImage: `url(${componentbgImg})` }}>
                <MuiThemeProvider>

                                        <TableHeader
                                            displaySelectAll={this.tableDesign.showCheckboxes}
                                            adjustForCheckbox={this.tableDesign.showCheckboxes}
                                            enableSelectAll={this.tableDesign.enableSelectAll}>
                                            <TableRow>
                                                <TableHeaderColumn colSpan="8" style={inlineStyles.tableHeader}>
                                                    Lista de Motoristas
                                                </TableHeaderColumn>
                                            </TableRow>
                                            <TableRow >
                                                <TableHeaderColumn style={inlineStyles.tablerowHead}>Nome</TableHeaderColumn>
                                                <TableHeaderColumn style={inlineStyles.tablerowHead}>CPF</TableHeaderColumn>
                                                <TableHeaderColumn style={inlineStyles.tablerowHead}>Sexo</TableHeaderColumn>
                                                <TableHeaderColumn style={inlineStyles.tablerowHead}>Nascimento</TableHeaderColumn>
                                                <TableHeaderColumn style={inlineStyles.tablerowHead}>Carro</TableHeaderColumn>
                                                <TableHeaderColumn style={inlineStyles.tablerowHead}>Status</TableHeaderColumn>
                                                <TableHeaderColumn style={inlineStyles.tablerowHead}></TableHeaderColumn>
                                                <TableHeaderColumn style={inlineStyles.tablerowHead}></TableHeaderColumn>
                                            </TableRow>
                                        </TableHeader>

                                        <TableBody
                                            displayRowCheckbox={this.tableDesign.showCheckboxes}
                                            deselectOnClickaway={this.tableDesign.deselectOnClickaway}
                                            showRowHover={this.tableDesign.showRowHover}
                                            stripedRows={this.tableDesign.stripedRows}>
                                            {this.state.listMotoristas == [] ?
                                                <TableRow>
                                                    <TableRowColumn> <CircularProgress /></TableRowColumn>
                                                </TableRow>
                                                : this.state.listMotoristas.reverse().map((motorista) => {
                                                    let dataLegivel = new Date(motorista.DataNascimento);
                                                    dataLegivel = dataLegivel.getDate() + "/" + (dataLegivel.getMonth() + 1) + "/" + dataLegivel.getFullYear();
                                                    return (
                                                        <TableRow key={motorista.idMotorista}>
                                                            <TableRowColumn style={inlineStyles.tablerow}>{motorista.Nome}</TableRowColumn>
                                                            <TableRowColumn style={inlineStyles.tablerow}>{motorista.CPF}</TableRowColumn>
                                                            <TableRowColumn style={inlineStyles.tablerow}>{motorista.Sexo}</TableRowColumn>
                                                            <TableRowColumn style={inlineStyles.tablerow}>{dataLegivel}</TableRowColumn>
                                                            <TableRowColumn style={inlineStyles.tablerow}>{motorista.ModeloCarro}</TableRowColumn>
                                                            <TableRowColumn style={inlineStyles.tablerow}>{motorista.StatusMotorista ? "Ativo" : "Inativo"}</TableRowColumn>
                                                            <TableRowColumn style={inlineStyles.tablerow}><RaisedButton onClick={(evt) => {
                                                                axios.post('https://gerencia-corridas.herokuapp.com/api/alterar-status', { Motorista: motorista })
                                                                    .then((response) => {
                                                                        if (response.status == 200) {
                                                                            this.setState({ listMotoristas: response.data })
                                                                        } else {
                                                                            console.log("Algum problema na resposta");
                                                                        }
                                                                    }).catch((err) => {
                                                                        console.log("Err", err);
                                                                    })
                                                            }}>{motorista.StatusMotorista ? "Desativar" : "Ativar"}</RaisedButton></TableRowColumn>
                                                            <TableRowColumn style={inlineStyles.tablerow}><RaisedButton onClick={(evt) => {
                                                                axios.delete('https://gerencia-corridas.herokuapp.com/api/delete-motorista', { params: { MotoristaId: motorista.idMotorista } })
                                                                    .then((response) => {
                                                                        if (response.status == 200) {
                                                                            this.setState({ listMotoristas: response.data })
                                                                        } else {
                                                                            console.log("Algum problema na resposta");
                                                                        }
                                                                    }).catch((err) => {
                                                                        console.log("Err", err);
                                                                    })
                                                            }}>Deletar</RaisedButton></TableRowColumn>
                                                        </TableRow>
                                                    )
                                                }
                                                )
                                            })
                                    </TableBody>

                                        <CreateMotorista
                                            ListMotoristas={this}
                                            Home={this.props.Home}
                                            ListaDeMotoristas={this.state.listMotoristas}
                                            ListaDePassageiros={this.state.listPassageiros} />

                </MuiThemeProvider>

        )
    }
}

export default withRouter(ListMotoristas);


text:
[![Gem Version](https://badge.fury.io/rb/figaro.png)](http://badge.fury.io/rb/figaro)
[![Build Status](https://travis-ci.org/laserlemon/figaro.png?branch=master)](https://travis-ci.org/laserlemon/figaro)
[![Code Climate](https://codeclimate.com/github/laserlemon/figaro.png)](https://codeclimate.com/github/laserlemon/figaro)
[![Coverage Status](https://coveralls.io/repos/laserlemon/figaro/badge.png?branch=master)](https://coveralls.io/r/laserlemon/figaro)
[![Dependency Status](https://gemnasium.com/laserlemon/figaro.png)](https://gemnasium.com/laserlemon/figaro)

Simple Rails app configuration

## What is this for?

Figaro is for configuring Rails (3 and 4) apps, especially open source Rails apps.

Open sourcing a Rails app can be a little tricky when it comes to sensitive configuration information like [Pusher](http://pusher.com/) or [Stripe](https://stripe.com/) credentials. You don't want to check private credentials into the repo but what other choice is there?

Figaro provides a clean and simple way to configure your app and keep the private stuff… private.

## How does it work?

There are a few similar solutions out there, and a lot of homegrown attempts. Most namespace your configuration under a `Config` (or similar) namespace. That's fine, but there's already a place to describe the application environment… `ENV`!

`ENV` is a collection of simple string key/value pairs and it works just great for application configuration.

As an added bonus, this is exactly how apps on [Heroku](http://www.heroku.com/) are configured. So if you configure your Rails app using `ENV`, you're already set to deploy to Heroku.

## Give me an example.

Okay. Add Figaro to your Gemfile and run the `bundle` command to install it:

```ruby
gem "figaro"
```

Next up, use the generator provided by Figaro:

```bash
rails generate figaro:install
```

This creates a commented `config/application.yml` file and ignores it in your `.gitignore`. Add your own configuration to this file and you're done!

Your configuration will be available as key/value pairs in `ENV`. For example, here's `config/initializers/pusher.rb`:

```ruby
Pusher.app_id = ENV["PUSHER_APP_ID"]
Pusher.key    = ENV["PUSHER_KEY"]
Pusher.secret = ENV["PUSHER_SECRET"]
```

In addition, you can access these same configuration values through Figaro itself:

```ruby
Pusher.app_id = Figaro.env.pusher_app_id
Pusher.key    = Figaro.env.pusher_key
Pusher.secret = Figaro.env.pusher_secret
```

But wait… I thought configuration via constant was bad! Well, this is different. Rather than storing a _copy_ of `ENV` internally, `Figaro.env` passes directly through to `ENV`, making it just like using `ENV` itself. So why two approaches? Having your configurations available via method calls makes it easy to stub them out in tests. Either way is fine. The choice is yours!

If your app requires Rails-environment-specific configuration, you can also namespace your configuration under a key for `Rails.env`.

```yaml
HELLO: world
development:
  HELLO: developers
production:
  HELLO: users
```

In this case, `ENV["HELLO"]` will produce `"developers"` in development, `"users"` in production and `"world"` otherwise.

## How does it work with Heroku?

Heroku's beautifully simple application configuration was the [inspiration](http://laserlemon.com/blog/2011/03/08/heroku-friendly-application-configuration/) for Figaro.

Typically, to configure your application `ENV` on Heroku, you would do the following from the command line using the `heroku` gem:

```bash
heroku config:add PUSHER_APP_ID=8926
heroku config:add PUSHER_KEY=0463644d89a340ff1132
heroku config:add PUSHER_SECRET=0eadfd9847769f94367b
heroku config:add STRIPE_API_KEY=jHXKPPE0dUW84xJNYzn6CdWM2JfrCbPE
heroku config:add STRIPE_PUBLIC_KEY=pk_HHtUKJwlN7USCT6nE5jiXgoduiNl3
```

But Figaro provides a rake task to do just that! Just run:

```bash
rake figaro:heroku
```

Optionally, you can pass in the name of the Heroku app:

```bash
rake figaro:heroku[my-awesome-app]
```

Additionally, if `RAILS_ENV` is configured on your Heroku server, Figaro will use that environment automatically in determining your proper configuration.

## What if I'm not using Heroku?

No problem. Just add `config/application.yml` to your production app on the server.

## This sucks. How can I make it better?

1. Fork it.
2. Make it better.
3. Send me a pull request.

## Does Figaro have a mascot?

Yes.

[![Figaro](http://images2.wikia.nocookie.net/__cb20100628192722/disney/images/5/53/Pinocchio-pinocchio-4947890-960-720.jpg "Figaro's mascot: Figaro")](http://en.wikipedia.org/wiki/Figaro_(Disney\))


text:
<?php
include('config.php');
 ?>

<!DOCTYPE html>

  	<meta charset="UTF-8">
	<title>Únete a yeira e-learning</title>
	<link href='http://fonts.googleapis.com/css?family=Lato:400,400italic' rel='stylesheet' type='text/css'>
	<link href="styles.css" rel="stylesheet" type="text/css" />

Únete a yeira en slack

					Hablemos de e-learning

			<form action="register.php" method="POST">
			<input class="email" type="text" placeholder="Email" name="email"><input class="button" type="submit" name="submit" value="Únete">
			</form>

¿Necesitas ayuda? Contacta a <a href="mailto:<?php echo $GLOBALS['contactEmail']; ?>"><?php echo $GLOBALS['contactName']; ?>.


text:
package org.aws4j.data.dynamo.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import org.aws4j.data.core.annotation.KeyAttribute;

@Retention( RetentionPolicy.RUNTIME )
@Target( { ElementType.FIELD, ElementType.METHOD} )
@KeyAttribute
public @interface RangeKey {
}


text:
package hello;

import org.junit.* ;
import static org.junit.Assert.* ;

public class HelloUnitTest {

  private String hello = "Heisan!";
  private String goodbye = "Ciao!";

  @Test
  public void helloUnitTest() {
    assertTrue(hello.equals(hello));
    assertFalse(hello.equals(goodbye));
    assertTrue(hello==hello);
    assertFalse(hello==goodbye);
    System.out.println("================================================");
    System.out.println("Greetings from the hello the Unit Test!");
    System.out.println("================================================");
  }
}