text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>Qt 4.8: svgalibpaintengine.cpp Example File (qws/svgalib/svgalibpaintengine.cpp)</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />

  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />

      Home

    Qt Reference Documentation

Qt HOME

DEV

          DOC

BLOG

Qt 4.8

ALL VERSIONS

API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

Examples

Examples

Tutorials

Demos

QML Examples

          Search index:

          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />

 Close

All | API | Articles | Examples

 results:

            </fieldset>
          </form>

            API Lookup

Class index

Function index

Modules

Namespaces

Global Declarations

QML elements

            Qt Topics

Programming with Qt

Device UIs & Qt Quick

UI Design with Qt

Supported Platforms

Qt and Key Technologies

How-To's and Best Practices

            Examples

Examples

Tutorials

Demos

QML Examples

Home

A

A

A

                Print

svgalibpaintengine.cpp Example File

qws/svgalib/svgalibpaintengine.cpp

 #include "svgalibpaintengine.h"

 #include <QColor>
 #include <vga.h>
 #include <vgagl.h>

 SvgalibPaintEngine::SvgalibPaintEngine(QPaintDevice *device)
     : QRasterPaintEngine(device)
 {
 }

 SvgalibPaintEngine::~SvgalibPaintEngine()
 {
 }

 bool SvgalibPaintEngine::begin(QPaintDevice *dev)
 {
     device = dev;
     pen = Qt::NoPen;
     simplePen = true;
     brush = Qt::NoBrush;
     simpleBrush = true;
     matrix = QTransform();
     simpleMatrix = true;
     setClip(QRect(0, 0, device->width(), device->height()));
     opaque = true;
     aliased = true;
     sourceOver = true;

     return QRasterPaintEngine::begin(dev);
 }

 bool SvgalibPaintEngine::end()
 {
     gl_setclippingwindow(0, 0, device->width() - 1, device->height() - 1);
     return QRasterPaintEngine::end();
 }

 void SvgalibPaintEngine::updateState()
 {
     QRasterPaintEngineState *s = state();

     if (s->dirty & DirtyTransform) {
         matrix = s->matrix;
         simpleMatrix = (matrix.m12() == 0 && matrix.m21() == 0);
     }

     if (s->dirty & DirtyPen) {
         pen = s->pen;
         simplePen = (pen.width() == 0 || pen.widthF() <= 1)
                     && (pen.style() == Qt::NoPen || pen.style() == Qt::SolidLine)
                     && (pen.color().alpha() == 255);
     }

     if (s->dirty & DirtyBrush) {
         brush = s->brush;
         simpleBrush = (brush.style() == Qt::SolidPattern
                        || brush.style() == Qt::NoBrush)
                       && (brush.color().alpha() == 255);
     }

     if (s->dirty & DirtyClipRegion)
         setClip(s->clipRegion);

     if (s->dirty & DirtyClipEnabled) {
         clipEnabled = s->isClipEnabled();
         updateClip();
     }

     if (s->dirty & DirtyClipPath) {
         setClip(QRegion());
         simpleClip = false;
     }

     if (s->dirty & DirtyCompositionMode) {
         const QPainter::CompositionMode m = s->composition_mode;
         sourceOver = (m == QPainter::CompositionMode_SourceOver);
     }

     if (s->dirty & DirtyOpacity)
         opaque = (s->opacity == 256);

     if (s->dirty & DirtyHints)
         aliased = !(s->flags.antialiased);
 }

 void SvgalibPaintEngine::setClip(const QRegion &region)
 {
     if (region.isEmpty())
         clip = QRect(0, 0, device->width(), device->height());
     else
         clip = matrix.map(region) & QRect(0, 0, device->width(), device->height());
     clipEnabled = true;
     updateClip();
 }

 void SvgalibPaintEngine::updateClip()
 {
     QRegion clipRegion = QRect(0, 0, device->width(), device->height());

     if (!systemClip().isEmpty())
         clipRegion &= systemClip();
     if (clipEnabled)
         clipRegion &= clip;

     simpleClip = (clipRegion.rects().size() <= 1);

     const QRect r = clipRegion.boundingRect();
     gl_setclippingwindow(r.left(), r.top(),
                          r.x() + r.width(),
                          r.y() + r.height());
 }

 void SvgalibPaintEngine::drawRects(const QRect *rects, int rectCount)
 {
     const bool canAccelerate = simplePen && simpleBrush && simpleMatrix
                                && simpleClip && opaque && aliased
                                && sourceOver;
     if (!canAccelerate) {
         QRasterPaintEngine::drawRects(rects, rectCount);
         return;
     }

     for (int i = 0; i < rectCount; ++i) {
         const QRect r = matrix.mapRect(rects[i]);
         if (brush != Qt::NoBrush) {
             gl_fillbox(r.left(), r.top(), r.width(), r.height(),
                        brush.color().rgba());
         }
         if (pen != Qt::NoPen) {
             const int c = pen.color().rgba();
             gl_hline(r.left(), r.top(), r.right(), c);
             gl_hline(r.left(), r.bottom(), r.right(), c);
             gl_line(r.left(), r.top(), r.left(), r.bottom(), c);
             gl_line(r.right(), r.top(), r.right(), r.bottom(), c);
         }
     }
 }

      <acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.

      The documentation provided herein is licensed under the terms of the
      GNU Free Documentation
      License version 1.3 as published by the Free Software Foundation.

      Documentation sources may be obtained from
      www.qt-project.org.

      Digia, Qt and their respective logos are trademarks of Digia Plc
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. Privacy Policy


text:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { LoginComponent }      from './components/login/login.component';
import { DashboardComponent }   from './components/dashboard/dashboard.component';

const routes: Routes = [
  { path: '', redirectTo: '/login', pathMatch: 'full' },
  { path: 'login',  component: LoginComponent },
  { path: 'dashboard',  component: DashboardComponent }
];

@NgModule({
  imports: [ RouterModule.forRoot(routes) ],
  exports: [ RouterModule ]
})
export class AppRoutingModule {}

redpajama_set_name: RedPajamaGithub


text:
var gulp = require('gulp'),
	del = require('del');

gulp.task('clean', function (callback) {
	del([
		'build',
		'extension/pages',
		'extension/styles',
		'extension/js',
		'extension/vendor'
	], callback);
});


text:
package gw.plugin.ij.refactor.introduceVariable;

import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiExpression;
import com.intellij.psi.PsiVariable;
import com.intellij.refactoring.RefactoringBundle;
import com.intellij.refactoring.introduceVariable.IntroduceVariableSettings;
import com.intellij.refactoring.rename.JavaUnresolvableLocalCollisionDetector;
import com.intellij.refactoring.util.RefactoringUIUtil;
import com.intellij.refactoring.util.occurrences.ExpressionOccurrenceManager;
import com.intellij.util.containers.HashSet;
import com.intellij.util.containers.MultiMap;

/**
 * copy of Intellij InputValidator
 */
public class GosuInputValidator implements GosuIntroduceVariableBase.Validator {
  private final Project myProject;
  private final PsiElement myAnchorStatementIfAll;
  private final PsiElement myAnchorStatement;
  private final ExpressionOccurrenceManager myOccurenceManager;
  private final GosuIntroduceVariableBase myIntroduceVariableBase;

  public boolean isOK(IntroduceVariableSettings settings) {
    String name = settings.getEnteredName();
    final PsiElement anchor;
    final boolean replaceAllOccurrences = settings.isReplaceAllOccurrences();
    if (replaceAllOccurrences) {
      anchor = myAnchorStatementIfAll;
    } else {
      anchor = myAnchorStatement;
    }
    final PsiElement scope = anchor.getParent();
    if (scope == null) {
      return true;
    }
    final MultiMap<PsiElement, String> conflicts = new MultiMap<>();
    final HashSet<PsiVariable> reportedVariables = new HashSet<>();
    JavaUnresolvableLocalCollisionDetector.CollidingVariableVisitor visitor = new JavaUnresolvableLocalCollisionDetector.CollidingVariableVisitor() {
      public void visitCollidingElement(PsiVariable collidingVariable) {
        if (!reportedVariables.contains(collidingVariable)) {
          reportedVariables.add(collidingVariable);
          String message = RefactoringBundle.message("introduced.variable.will.conflict.with.0", RefactoringUIUtil.getDescription(collidingVariable, true));
          conflicts.putValue(collidingVariable, message);
        }
      }
    };
    JavaUnresolvableLocalCollisionDetector.visitLocalsCollisions(anchor, name, scope, anchor, visitor);
    if (replaceAllOccurrences) {
      final PsiExpression[] occurences = myOccurenceManager.getOccurrences();
      for (PsiExpression occurence : occurences) {
        GosuIntroduceVariableBase.checkInLoopCondition(occurence, conflicts);
      }
    } else {
      GosuIntroduceVariableBase.checkInLoopCondition(myOccurenceManager.getMainOccurence(), conflicts);
    }

    if (conflicts.size() > 0) {
      return myIntroduceVariableBase.reportConflicts(conflicts, myProject, settings);
    } else {
      return true;
    }
  }

  public GosuInputValidator(final GosuIntroduceVariableBase introduceVariableBase,
                            Project project,
                            PsiElement anchorStatementIfAll,
                            PsiElement anchorStatement,
                            ExpressionOccurrenceManager occurenceManager) {
    myIntroduceVariableBase = introduceVariableBase;
    myProject = project;
    myAnchorStatementIfAll = anchorStatementIfAll;
    myAnchorStatement = anchorStatement;
    myOccurenceManager = occurenceManager;
  }
}


text:
/* global define */

define([
  'app/common/view/value/dateTime',
  'sulfur/ui/presenter'
], function (DateTimeValueView, Presenter) {

  'use strict';

  function invoke(fn) {
    fn();
    return fn;
  }

  return Presenter.derive({

    initialize: function (model) {
      var view = DateTimeValueView.create();
      Presenter.prototype.initialize.call(this, view, model);

      view.publisher.subscribe('change', function () {
        model.update({ value: view.access('value').value });
      });

      this._registerModel();
    },

    _registerModel: function () {
      var view = this.view;
      var model = this.model;
      model.publisher.subscribe('change:value', invoke(function () {
        view.access('value').value = model.get('value');
        view.access('value').error = model.error('value');
      }));
    }

  });

});


text:
<?php

namespace app\controllers;

use Yii;
use app\models\Incidente;
use app\models\IncidenteHasCorporacion;
use app\models\search\IncidenteHasCorporacionSearch;
use app\models\Municipio;
use app\models\Operativo;
use app\models\EstadoPersona;
use app\models\Persona;
use app\models\Seguimiento;
use app\models\Distrito;
use app\models\search\SeguimientoSearch;
use app\models\search\PersonaSearch;
use app\models\ClaseIncidente;
use app\models\Usuario;
use app\models\Corporacion;
use app\models\Vehiculo;
use app\models\EstadoVehiculo;
use app\models\search\VehiculoSearch;
use app\models\MarcaVehiculo;
use app\models\search\IncidenteSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\helpers\Url;

/**
 * IncidenteController implements the CRUD actions for Incidente model.
 */
class IncidenteController extends Controller
{
    public function behaviors()
    {
        return [
            'rules' => Usuario::permisos(Yii::$app->controller->id),
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all Incidente models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new IncidenteSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single Incidente model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($incidente_id)
    {
        Url::remember();
        $searchModelCorporacion = new IncidenteHasCorporacionSearch();
        $dataProviderCorporacion = $searchModelCorporacion->search(Yii::$app->request->queryParams);

        $searchModelPersonas = new PersonaSearch();
        $dataProviderPersonas = $searchModelPersonas->search(Yii::$app->request->queryParams);

        $searchModelVehiculo = new VehiculoSearch();
        $dataProviderVehiculo = $searchModelVehiculo->search(Yii::$app->request->queryParams);

        $searchModelSeguimiento = new SeguimientoSearch();
        $dataProviderSeguimiento = $searchModelSeguimiento->search(Yii::$app->request->queryParams);

        return $this->render('view', [
            'model' => $this->findModel($incidente_id),
            'dataProviderCorporacion'=>$dataProviderCorporacion,
            'dataProviderPersonas'=>$dataProviderPersonas,
            'dataProviderVehiculo'=>$dataProviderVehiculo,
            'dataProviderSeguimiento'=>$dataProviderSeguimiento,
        ]);
    }

    /**
     * Creates a new Incidente model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new Incidente();

        $data =  Municipio::find()->all();
        $municipios = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'municipio_id','municipio_nombre');

        $data =  Operativo::find()->all();
        $operativos = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'operativo_id','operativo_nombre');

        $data =  ClaseIncidente::find()->all();
        $claseIncidente = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'clase_incidente_id','clase_incidente_nombre');

        $data =  Distrito::find()->all();
        $distritos = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'distrito_id','distrito_nombre');

        $model->usuario_id =Yii::$app->user->identity->id;

        $sql= 'Select * FROM operativo where operativo_id =1';

        $modela = Operativo::findBySql($sql)->one();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['agregar-corporacion', 'incidente_id' => $model->incidente_id]);
        } else {
            return $this->render('create', [
                'model' => $model,

                'municipios'=>$municipios,
                'operativos'=>$operativos,
                'claseIncidente'=>$claseIncidente,
                'distritos'=>$distritos,
            ]);
        }
    }

    public function actionAgregarCorporacion($incidente_id,$bandera=null)
    {
        $model =  new IncidenteHasCorporacion();
        $data =  Corporacion::find()->all();

        $searchModel = new IncidenteHasCorporacionSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        if ($model->load(Yii::$app->request->post()) ) {
            $model->incidente_id=$incidente_id;
            $model->save();
            $model = new IncidenteHasCorporacion();
        }

        $estasno=[];
        $corporaciones =[];
        if(count($data)==0)
            $corporaciones = [''=>''];

        $tomadas = IncidenteHasCorporacion::find()->where('incidente_id='.$incidente_id)->all();
        foreach ($tomadas as $tomada) {
            $estasno[$tomada->corporacion_id] = 1;
        }
        foreach ($data as $corp) {
            if (!isset($estasno[$corp->corporacion_id])) {
                $corporaciones[$corp->corporacion_id]=$corp->corporacion_nombre;
            }

        }
        //$corporaciones = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'corporacion_id','corporacion_nombre');

        return $this->render('addcorp', [
           'model' => (new IncidenteHasCorporacion),
           'corporaciones'=> $corporaciones,
           'incidente_id'=> $incidente_id,
           'bandera'=>$bandera,

           'dataProvider' => $dataProvider,
        ]);

    }
    public function actionAgregarSeguimiento($incidente_id)
    {
        $model =  new Seguimiento();
        $incidente = $this->findModel($incidente_id);

        $data =  Corporacion::find()->all();
        $corporaciones = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'corporacion_id','corporacion_nombre');

        if ($model->load(Yii::$app->request->post()) ) {
            $model->incidente_id=$incidente_id;

            if($model->save())
            {
                 $incidente->incidente_estado=Yii::$app->request->post()['Incidente']['incidente_estado'];
                $incidente->save();
                $modela = IncidenteHasCorporacion::find()->where(['incidente_id'=>$model->incidente_id,'corporacion_id'=>$model->corporacion_id])->one();
                if(empty($modela))
                {
                    $modela= new IncidenteHasCorporacion;
                    $modela->incidente_id=$model->incidente_id;
                    $modela->corporacion_id=$model->corporacion_id;
                    $modela->save();

                }

                return $this->redirect(['view', 'incidente_id' => $model->incidente_id]);
            }

        }
        return $this->render('addSeg', [
           'model' => $model,

           'corporaciones'=> $corporaciones,
           'incidente_id'=> $incidente_id,
           'incidente'=>$incidente
        ]);

    }

    public function actionAgregarPersona($incidente_id,$persona_id=null,$bandera=null)
    {

        $model =  new Persona();
        if(isset($persona_id))
            $model = Persona::findOne($persona_id);

        $data =  Municipio::find()->all();
        $municipios = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'municipio_id','municipio_nombre');

        $data =  EstadoPersona::find()->all();
        $estados = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'estado_persona_id','estado_persona_nombre');

        $searchModel = new PersonaSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        if ($model->load(Yii::$app->request->post()) ) {
            $model->incidente_id=$incidente_id;
            $model->save();
            if(isset($persona_id ))
                $this->redirect(['view', 'incidente_id' => $incidente_id]);
            $model = new Persona();
        }

        return $this->render('addPers', [
            'bandera'=>$bandera,
            'model' => $model,
            'municipios'=>$municipios,
            'estados'=>$estados,
            'dataProvider' => $dataProvider,
               'incidente_id'=> $incidente_id,

            ]);

    }

    public function actionAgregarVehiculo($incidente_id,$vehiculo_id=null,$bandera=null)
    {
        $model =  new Vehiculo();
        if(isset($vehiculo_id))
            $model = Vehiculo::findOne($vehiculo_id);

        $data =  EstadoVehiculo::find()->all();
        $estados = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'estado_vehiculo_id','estado_vehiculo_nombre');

        $data =  MarcaVehiculo::find()->all();
        $marcas = (count($data)==0)? [''=>'']: \yii\helpers\ArrayHelper::map($data, 'marca_vehiculo_id','marca_vehiculoco_nombre');

        $model->incidente_id=$incidente_id;
        $searchModel = new VehiculoSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        if ($model->load(Yii::$app->request->post()) ) {
            $model->incidente_id=$incidente_id;
            $model->save();
            if (isset($vehiculo_id))
                $this->redirect(['view','incidente_id'=> $incidente_id]);
            $model = new Vehiculo();
        }
        return $this->render('addvehi', [
           'model' => $model,
           'estados'=>$estados,
           'marcas'=>$marcas,
           'dataProvider' => $dataProvider,
           'incidente_id'=> $incidente_id,

        ]);

    }

    /**
     * Updates an existing Incidente model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */

    /**
     * Deletes an existing Incidente model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */

    public function actionCorporacionDelete($incidente_id, $corporacion_id)
    {
        $model = IncidenteHasCorporacion::findOne(['incidente_id' => $incidente_id, 'corporacion_id' => $corporacion_id]);
        $model->delete();

        return $this->redirect(Yii::$app->request->referrer);
    }

    public function actionPersonaDelete($incidente_id, $persona_id)
    {
        $model = Persona::findOne(['incidente_id' => $incidente_id, 'persona_id' => $persona_id]);
        $model->delete();

        return $this->redirect(Yii::$app->request->referrer);
    }

    public function actionVehiculoDelete($vehiculo_id)
    {
        $model = Vehiculo::findOne(['vehiculo_id' => $vehiculo_id]);
        $model->delete();

        return $this->redirect(Yii::$app->request->referrer);
    }

    public function actionSeguimientoDelete($seguimiento_id)
    {
        $model = Seguimiento::findOne(['seguimiento_id' => $seguimiento_id]);
        $model->delete();

        return $this->redirect(Yii::$app->request->referrer);
    }

    public function actionDelete($incidente_id)
    {
        $this->findModel($incidente_id)->delete();

        return $this->redirect(['index']);
    }

    public function actionDatosIncidente($id)
    {
        \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
        $model=$this->findModel($id);
        return $model->attributes;
    }

    /**
     * Finds the Incidente model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Incidente the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = Incidente::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
<!doctype html>

    <title>This is a test page</title>

    <link rel="stylesheet" href="assets/alreadyBustedQueryString.css?123abc456def789g" />

Have you heard?

Heard what??

THE BIRD IS THE WORD!!


text:
import {Component} from '@angular/core';

@Component({
  selector: 'demo-complex-column-ordering',
  styleUrls : [
    'columnOrder.demo.css',
    '../demo-app/material2.css'
  ],
  template: `
   <md-card class="card-demo" >
    <md-card-title> StackOverflow</md-card-title>
    <md-card-subtitle>Complex column ordering to wrap items to align to items above </md-card-subtitle>
    <md-card-content>

 1
<div fxFlexOrder="1">

 2
<div fxFlexOrder="3">

 3
<div fxFlexOrder="5">

 4
<div fxFlexOrder="2">

 5
<div fxFlexOrder="4">

    </md-card-content>
    <md-card-footer class="bottomPad">

<fxLayout="{{ direction }}">

    </md-card-footer>
  </md-card>
  `
})
export class DemoComplexColumnOrder {
  direction = "column";

  toggleDirection() {
    let next = (DIRECTIONS.indexOf(this.direction) +1 ) % DIRECTIONS.length;
    this.direction = DIRECTIONS[next];
  }
}
const DIRECTIONS = ['column', 'column-reverse'];


text:
/* DO NOT EDIT */
/* This file was generated from team_log_generated.stone */

package com.dropbox.core.v2.teamlog;

import com.dropbox.core.stone.StoneDeserializerLogger;
import com.dropbox.core.stone.StoneSerializers;
import com.dropbox.core.stone.StructSerializer;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;

import java.io.IOException;
import java.util.Arrays;

/**
 * User's name logged information
 */
public class UserNameLogInfo {
    // struct team_log.UserNameLogInfo (team_log_generated.stone)

    protected final String givenName;
    protected final String surname;
    protected final String locale;

    /**
     * User's name logged information
     *
     * @param givenName  Given name. Must not be {@code null}.
     * @param surname  Surname. Must not be {@code null}.
     * @param locale  Locale. Might be missing due to historical data gap.
     *
     * @throws IllegalArgumentException  If any argument does not meet its
     *     preconditions.
     */
    public UserNameLogInfo(String givenName, String surname, String locale) {
        if (givenName == null) {
            throw new IllegalArgumentException("Required value for 'givenName' is null");
        }
        this.givenName = givenName;
        if (surname == null) {
            throw new IllegalArgumentException("Required value for 'surname' is null");
        }
        this.surname = surname;
        this.locale = locale;
    }

    /**
     * User's name logged information
     *
     * <p> The default values for unset fields will be used. </p>
     *
     * @param givenName  Given name. Must not be {@code null}.
     * @param surname  Surname. Must not be {@code null}.
     *
     * @throws IllegalArgumentException  If any argument does not meet its
     *     preconditions.
     */
    public UserNameLogInfo(String givenName, String surname) {
        this(givenName, surname, null);
    }

    /**
     * Given name.
     *
     * @return value for this field, never {@code null}.
     */
    public String getGivenName() {
        return givenName;
    }

    /**
     * Surname.
     *
     * @return value for this field, never {@code null}.
     */
    public String getSurname() {
        return surname;
    }

    /**
     * Locale. Might be missing due to historical data gap.
     *
     * @return value for this field, or {@code null} if not present.
     */
    public String getLocale() {
        return locale;
    }

    @Override
    public int hashCode() {
        int hash = Arrays.hashCode(new Object [] {
            givenName,
            surname,
            locale
        });
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        // be careful with inheritance
        else if (obj.getClass().equals(this.getClass())) {
            UserNameLogInfo other = (UserNameLogInfo) obj;
            return ((this.givenName == other.givenName) || (this.givenName.equals(other.givenName)))
                && ((this.surname == other.surname) || (this.surname.equals(other.surname)))
                && ((this.locale == other.locale) || (this.locale != null && this.locale.equals(other.locale)))
                ;
        }
        else {
            return false;
        }
    }

    @Override
    public String toString() {
        return Serializer.INSTANCE.serialize(this, false);
    }

    /**
     * Returns a String representation of this object formatted for easier
     * readability.
     *
     * <p> The returned String may contain newlines. </p>
     *
     * @return Formatted, multiline String representation of this object
     */
    public String toStringMultiline() {
        return Serializer.INSTANCE.serialize(this, true);
    }

    /**
     * For internal use only.
     */
    static class Serializer extends StructSerializer<UserNameLogInfo> {
        public static final Serializer INSTANCE = new Serializer();

        @Override
        public void serialize(UserNameLogInfo value, JsonGenerator g, boolean collapse) throws IOException, JsonGenerationException {
            if (!collapse) {
                g.writeStartObject();
            }
            g.writeFieldName("given_name");
            StoneSerializers.string().serialize(value.givenName, g);
            g.writeFieldName("surname");
            StoneSerializers.string().serialize(value.surname, g);
            if (value.locale != null) {
                g.writeFieldName("locale");
                StoneSerializers.nullable(StoneSerializers.string()).serialize(value.locale, g);
            }
            if (!collapse) {
                g.writeEndObject();
            }
        }

        @Override
        public UserNameLogInfo deserialize(JsonParser p, boolean collapsed) throws IOException, JsonParseException {
            UserNameLogInfo value;
            String tag = null;
            if (!collapsed) {
                expectStartObject(p);
                tag = readTag(p);
            }
            if (tag == null) {
                String f_givenName = null;
                String f_surname = null;
                String f_locale = null;
                while (p.getCurrentToken() == JsonToken.FIELD_NAME) {
                    String field = p.getCurrentName();
                    p.nextToken();
                    if ("given_name".equals(field)) {
                        f_givenName = StoneSerializers.string().deserialize(p);
                    }
                    else if ("surname".equals(field)) {
                        f_surname = StoneSerializers.string().deserialize(p);
                    }
                    else if ("locale".equals(field)) {
                        f_locale = StoneSerializers.nullable(StoneSerializers.string()).deserialize(p);
                    }
                    else {
                        skipValue(p);
                    }
                }
                if (f_givenName == null) {
                    throw new JsonParseException(p, "Required field \"given_name\" missing.");
                }
                if (f_surname == null) {
                    throw new JsonParseException(p, "Required field \"surname\" missing.");
                }
                value = new UserNameLogInfo(f_givenName, f_surname, f_locale);
            }
            else {
                throw new JsonParseException(p, "No subtype found that matches tag: \"" + tag + "\"");
            }
            if (!collapsed) {
                expectEndObject(p);
            }
            StoneDeserializerLogger.log(value, value.toStringMultiline());
            return value;
        }
    }
}


text:
import xss from 'xss';
import { SOFTWARE_WALLET_TYPES } from '@/modules/access-wallet/software/handlers/helpers';
import { ROUTES_WALLET } from '../configs/configRoutes';

const ACCESS_VALID_OVERLAYS = {
  HARDWARE: 'hardware',
  MOBILE: 'mobile',
  SOFTWARE: 'software'
};

const stripQuery = queryObj => {
  const newObj = {};
  Object.keys(queryObj).forEach(key => {
    newObj[key] = xss(queryObj[key]);
  });

  return newObj;
};

const createWalletProps = route => {
  if (Object.keys(route.query).length > 0) {
    const { type } = stripQuery(route.query);
    const walletType = type ? type : '';
    const isSoftware =
      route.params &&
      route.params.overlay &&
      route.params.overlay === 'software'
        ? true
        : false;

    return {
      showSoftwareModule: isSoftware,
      type: walletType
    };
  }
};
const createRouteGuard = (to, from, next) => {
  if (to.params.overlay === undefined) {
    next();
  } else if (to.params.overlay === 'software') {
    const validTypes = ['keystore', 'mnemonic', 'overview'];
    if (validTypes.includes(to.query.type)) {
      next();
    } else {
      next('*');
    }
  } else {
    next('*');
  }
};

const accessWalletProps = route => {
  if (Object.keys(route.query).length > 0) {
    const { type } = stripQuery(route.query);
    const walletType = type ? type : '';
    const overlay =
      route.params && route.params.overlay ? route.params.overlay : '';
    return {
      overlay: overlay,
      type: walletType
    };
  }
};

const accessRouteGuard = (to, from, next) => {
  if (to.params.overlay === undefined) {
    next();
  } else {
    if (to.params.overlay === ACCESS_VALID_OVERLAYS.HARDWARE) {
      const validTypes = [
        'overview',
        'ledger',
        'keepkey',
        'coolwallet',
        'bitbox02',
        'trezor'
      ];
      if (validTypes.includes(to.query.type)) {
        next();
      } else {
        next('wallet/access/hardware?type=overview'); //redirects to overlay pop up on invalid url type "/wallet/access/hardware"
      }
    }
    if (to.params.overlay === ACCESS_VALID_OVERLAYS.MOBILE) {
      const validTypes = ['overview'];
      if (validTypes[0] === to.query.type) {
        next();
      } else {
        next('*');
      }
    }
    if (to.params.overlay === ACCESS_VALID_OVERLAYS.SOFTWARE) {
      if (Object.values(SOFTWARE_WALLET_TYPES).includes(to.query.type)) {
        next();
      } else {
        next('*');
      }
    }
  }
};

const swapProps = route => {
  if (Object.keys(route.query).length > 0) {
    const { fromToken, toToken, amount } = stripQuery(route.query);
    const parsedFromToken = fromToken;
    const parsedToToken = toToken;
    const parsedAmt = amount;
    return {
      tokenInValue: parsedAmt,
      defaults: {
        fromToken: parsedFromToken,
        toToken: parsedToToken
      }
    };
  }
};

const swapRouterGuard = (to, from, next) => {
  const queries = Object.keys(to.query);
  if (queries.length === 0) {
    next();
  } else {
    const validQueries = ['toToken', 'fromToken', 'amount'];
    for (let i = 0; i < queries.length; i++) {
      if (validQueries.includes(queries[i])) return next();
    }
    next('*');
  }
};

const stakedRouterGuard = (to, from, next) => {
  if (
    // STAKED => STAKED 1
    from.name == ROUTES_WALLET.STAKED.NAME &&
    to.name == ROUTES_WALLET.STAKED_1.NAME
  ) {
    next();
  } else if (
    // STAKED 1 => STAKED 2
    from.name == ROUTES_WALLET.STAKED_1.NAME &&
    to.name == ROUTES_WALLET.STAKED_2.NAME
  ) {
    next();
  } else if (
    // STAKED 2 => STAKED 3
    from.name == ROUTES_WALLET.STAKED_2.NAME &&
    to.name == ROUTES_WALLET.STAKED_3.NAME
  ) {
    next();
  } else if (
    // STAKED 3 => STAKED 4
    from.name == ROUTES_WALLET.STAKED_3.NAME &&
    to.name == ROUTES_WALLET.STAKED_4.NAME
  ) {
    next();
  }
};

export {
  createWalletProps,
  createRouteGuard,
  accessWalletProps,
  accessRouteGuard,
  ACCESS_VALID_OVERLAYS,
  swapProps,
  swapRouterGuard,
  stakedRouterGuard
};


text:
layout: post
title: Busty blonde Gemma Jolie gets nailed in the office
titleinfo: pornvd
desc: Watch Busty blonde Gemma Jolie gets nailed in the office. Pornhub is the ultimate xxx porn and sex site.
---

Busty blonde Gemma Jolie gets nailed in the office

Watch Busty blonde Gemma Jolie gets nailed in the office. Pornhub is the ultimate xxx porn and sex site.


text:
#pragma once
#include <aws/redshift/Redshift_EXPORTS.h>
#include <aws/redshift/RedshiftRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/core/utils/memory/stl/AWSVector.h>

namespace Aws
{
namespace Redshift
{
namespace Model
{

  /**
   *

   */
  class AWS_REDSHIFT_API ModifyClusterSubnetGroupRequest : public RedshiftRequest
  {
  public:
    ModifyClusterSubnetGroupRequest();
    Aws::String SerializePayload() const override;

    /**
     *
The name of the subnet group to be modified.

     */
    inline const Aws::String& GetClusterSubnetGroupName() const{ return m_clusterSubnetGroupName; }

    /**
     *
The name of the subnet group to be modified.

     */
    inline void SetClusterSubnetGroupName(const Aws::String& value) { m_clusterSubnetGroupNameHasBeenSet = true; m_clusterSubnetGroupName = value; }

    /**
     *
The name of the subnet group to be modified.

     */
    inline void SetClusterSubnetGroupName(Aws::String&& value) { m_clusterSubnetGroupNameHasBeenSet = true; m_clusterSubnetGroupName = value; }

    /**
     *
The name of the subnet group to be modified.

     */
    inline void SetClusterSubnetGroupName(const char* value) { m_clusterSubnetGroupNameHasBeenSet = true; m_clusterSubnetGroupName.assign(value); }

    /**
     *
The name of the subnet group to be modified.

     */
    inline ModifyClusterSubnetGroupRequest& WithClusterSubnetGroupName(const Aws::String& value) { SetClusterSubnetGroupName(value); return *this;}

    /**
     *
The name of the subnet group to be modified.

     */
    inline ModifyClusterSubnetGroupRequest& WithClusterSubnetGroupName(Aws::String&& value) { SetClusterSubnetGroupName(value); return *this;}

    /**
     *
The name of the subnet group to be modified.

     */
    inline ModifyClusterSubnetGroupRequest& WithClusterSubnetGroupName(const char* value) { SetClusterSubnetGroupName(value); return *this;}

    /**
     *
A text description of the subnet group to be modified.

     */
    inline const Aws::String& GetDescription() const{ return m_description; }

    /**
     *
A text description of the subnet group to be modified.

     */
    inline void SetDescription(const Aws::String& value) { m_descriptionHasBeenSet = true; m_description = value; }

    /**
     *
A text description of the subnet group to be modified.

     */
    inline void SetDescription(Aws::String&& value) { m_descriptionHasBeenSet = true; m_description = value; }

    /**
     *
A text description of the subnet group to be modified.

     */
    inline void SetDescription(const char* value) { m_descriptionHasBeenSet = true; m_description.assign(value); }

    /**
     *
A text description of the subnet group to be modified.

     */
    inline ModifyClusterSubnetGroupRequest& WithDescription(const Aws::String& value) { SetDescription(value); return *this;}

    /**
     *
A text description of the subnet group to be modified.

     */
    inline ModifyClusterSubnetGroupRequest& WithDescription(Aws::String&& value) { SetDescription(value); return *this;}

    /**
     *
A text description of the subnet group to be modified.

     */
    inline ModifyClusterSubnetGroupRequest& WithDescription(const char* value) { SetDescription(value); return *this;}

    /**
     *
An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a
     * single request.

     */
    inline const Aws::Vector<Aws::String>& GetSubnetIds() const{ return m_subnetIds; }

    /**
     *
An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a
     * single request.

     */
    inline void SetSubnetIds(const Aws::Vector<Aws::String>& value) { m_subnetIdsHasBeenSet = true; m_subnetIds = value; }

    /**
     *
An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a
     * single request.

     */
    inline void SetSubnetIds(Aws::Vector<Aws::String>&& value) { m_subnetIdsHasBeenSet = true; m_subnetIds = value; }

    /**
     *
An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a
     * single request.

     */
    inline ModifyClusterSubnetGroupRequest& WithSubnetIds(const Aws::Vector<Aws::String>& value) { SetSubnetIds(value); return *this;}

    /**
     *
An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a
     * single request.

     */
    inline ModifyClusterSubnetGroupRequest& WithSubnetIds(Aws::Vector<Aws::String>&& value) { SetSubnetIds(value); return *this;}

    /**
     *
An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a
     * single request.

     */
    inline ModifyClusterSubnetGroupRequest& AddSubnetIds(const Aws::String& value) { m_subnetIdsHasBeenSet = true; m_subnetIds.push_back(value); return *this; }

    /**
     *
An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a
     * single request.

     */
    inline ModifyClusterSubnetGroupRequest& AddSubnetIds(Aws::String&& value) { m_subnetIdsHasBeenSet = true; m_subnetIds.push_back(value); return *this; }

    /**
     *
An array of VPC subnet IDs. A maximum of 20 subnets can be modified in a
     * single request.

     */
    inline ModifyClusterSubnetGroupRequest& AddSubnetIds(const char* value) { m_subnetIdsHasBeenSet = true; m_subnetIds.push_back(value); return *this; }

  private:
    Aws::String m_clusterSubnetGroupName;
    bool m_clusterSubnetGroupNameHasBeenSet;
    Aws::String m_description;
    bool m_descriptionHasBeenSet;
    Aws::Vector<Aws::String> m_subnetIds;
    bool m_subnetIdsHasBeenSet;
  };

} // namespace Model
} // namespace Redshift
} // namespace Aws


text:
package com.iordanis.example.capabilities;
import org.jmock.Expectations;
import org.jmock.auto.Mock;
import org.jmock.integration.junit4.JUnitRuleMockery;
import org.junit.Rule;
import org.junit.Test;

public class GooglePlusPresenterTest {
	@Rule public JUnitRuleMockery mockery = new JUnitRuleMockery();
	@Mock private GooglePlusView googlePlusView;

	@Test
	public void hidesGooglePlusIfNotAvailable() {
		mockery.checking(new Expectations() {{
			oneOf(googlePlusView).hideGooglePlus();
		}});

		presenterWithPlayInstalled(false).present();
	}

	@Test
	public void showsGooglePlusIfAvailable() {
		mockery.checking(new Expectations() {{
			oneOf(googlePlusView).showGooglePlus();
		}});

		presenterWithPlayInstalled(true).present();
	}

	private GooglePlusPresenter presenterWithPlayInstalled(final boolean installed) {
		return new GooglePlusPresenter(googlePlusView, new GooglePlayAvailability() {
			@Override
			public boolean googlePlayIsAvailable() {
				return installed;
			}
		});
	}

}


text:
<!DOCTYPE html>

    <title></title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="css/reset.css" type="text/css" media="screen">
    <link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
    <link rel="stylesheet" href="css/layout.css" type="text/css" media="screen">
    <link href='http://fonts.googleapis.com/css?family=Adamina' rel='stylesheet' type='text/css'>

GoodCook

1

2

3

                        Background:

Main

About Us

Courses

New Recipes

Calendar

Contacts

More Website Templates @ TemplateMonster.com - September 26, 2011!

Short Courses

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias.

Excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio.

Lorem ipsum dolor amet consectetur

Adipisicing eldo eiusmd tempor incididunt

Labore et dolore magna aliqua

Ut enim ad minim veniam, quis nostrud

Exercitation ullamco laboris nisi ut aliquip

Duis aute irure dolor reprehenderit

Voluptate vejlit esse cillum dolore eu fugiat

Excepteur sint occaecat cupidatat non

Main Courses

Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium.

Totam rem aperiam eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas.

                                                Read More

Sit aspernatur aut odit aut fugited quia consequuntur magni dolores qui ratione voluptatem.

Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam.

                                                Read More

All Courses

At vero eos et accusamus et iusto odio dignissimos

Qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident.

Similique sunt in culpa qui officia

Saepe eveniet voluptates repudian

Deserunt mollitia animi id est

Laborum et dolorum fugait harum

Quidem rerum facilis expedita

Nam libero tempore cum soluta

Nobis eligendi optio cumque nihil

Impedit quo minus id quod maxime

Placeat facere possimus, omnis

Voluptas assumenda omnis dolor

Temporibus autem quibusdam

Officiis debitis rerum necessitati

                    	Good Cook © 2011
                        Website Template by TemplateMonster.com | html5xcss3.com

Link to Us:


text:
<?php

namespace Amadeus\Client\Struct\DocRefund\ProcessRefund;

use Amadeus\Client\Struct\DocRefund\UpdateRefund\ReferenceDetails;
use Amadeus\Client\Struct\WsMessageUtility;

/**
 * PrinterReference
 *
 * @package Amadeus\Client\Struct\DocRefund\ProcessRefund
 * @author Dieter Devlieghere <dermikagh@gmail.com>
 */
class PrinterReference extends WsMessageUtility
{
    /**
     * @var ReferenceDetails[]
     */
    public $referenceDetails = [];

    /**
     * PrinterReference constructor.
     *
     * @param string|null $printer
     * @param string|null $printerType
     */
    public function __construct($printer = null, $printerType = null)
    {
        $this->referenceDetails[] = new ReferenceDetails($printer, $printerType);
    }
}


text:
'use strict';

module.exports = PatientDetailDirective

PatientDetailDirective.$inject = [
]

function PatientDetailDirective() {
    return {
        restrict: 'EA'
        ,templateUrl: '/lib/patient-detail.html'
        ,replace: true
        ,link: function(scope, elem, attrs) {

        }
    }
}


text:
. "$IMAGEDIR/config.sh"
BASEURL=http://ftp.fi.muni.cz/pub/linux/fedora/linux/releases/$RELVER/Everything/x86_64/os
RELEASE="$BASEURL/Packages/f/fedora-release-server-$RELVER-33.noarch.rpm"
GROUPNAME="minimal install"
EXTRAPKGS="vim man fedora-gpg-keys"
REMOVEPKGS="plymouth"

. $INCLUDE/redhat-family.sh

bootstrap
configure-common

configure-redhat-common
configure-fedora
run-configure

set-initcmd "/sbin/init" "systemd.unified_cgroup_hierarchy=0"


text:
from behave import step, then
import requests
from hamcrest import assert_that, is_, equal_to
import os

__author__ = "Telefonica I+D"
__copyright__ = "Copyright 2015"
__license__ = " Apache License, Version 2.0"

@step(u'the web server running properly')
def server_running_properly(context):
    """
    Step: Prepare server for running and check status.
    """
    pass

@step(u'I launch get operation')
def get(context):
    """
    Step: Launch get operation
    """

    if context.selenium:
        context.driver.get(context.dashboard_url)
    context.request = requests.get(context.dashboard_url)

@step(u'I receive a HTTP "(?P<status>\w*)" .*')
def http_status_code(context, status):
    """
    Step: Check the HTTP response status.
    """
    assert_that(str(context.request.status_code), is_(equal_to(status)),
                "HTTP response code is not the expected one.")

@step(u'the response title contains Sanity check status')
def response_title(context):
    """
    Step: Check the response title
    """
    assert_that(context.driver.title, is_(equal_to('Sanity check status')),
                "the response title is not the expected one.")


text:
const express = require('express'),
      router = express.Router({mergeParams: true}),
      User = require('../models/user');
      Emoticon = require('../models/emoticon');

router.get('/', function(req, res, next) {
  User.findOne({username: req.params.username}).populate('emoticons').exec(function(err, user) {
    if (err) console.log(err);
    res.render('emoticons/index', {user, emoticons: user.emoticons});
  });
});

router.get('/new', isLoggedIn, function(req, res, next) {
  res.render('emoticons/new', {user: req.user});
});

router.post('/new', isLoggedIn, function(req, res, next) {
  User.findOne({username: req.user.username}).then(function(user) {
    Emoticon.create({content: req.sanitize(req.body.content), category: req.sanitize(req.body.category), user: user._id}).then(function(newEmoticon) {
      user.emoticons.push(newEmoticon);
      user.markModified('emoticons');
      user.save(function(err) {
        if (err) console.log(err);
        console.log('Saved!');
      });
      res.redirect(`/user/${user.username}/collection`);
    }).catch(function(err) {
      console.log(err);
    });
  });
});

router.post('/delete', isLoggedIn, function(req, res, next) {
  var removeArr = req.body.selectedArr;
  var user = req.user;

  Promise.all(
    removeArr.map(id => {
      return Emoticon.findOneAndRemove({_id: id});
    }))
    .then(results => {
      removeArr.forEach(id => {
        var index = user.emoticons.indexOf(id);
        if (index > -1) {
          user.emoticons.splice(index, 1);
        }
      });
    })
    .catch(err => { console.log(err)});
});

function isLoggedIn(req, res, next) {
  if (req.isAuthenticated()) {
    return next();
  }
  res.redirect('/login');
}

module.exports = router;


text:
require "cask/lib/hbc/cli/abstract_command"

module Hbc
  class CLI
    class Update < AbstractCommand
      def self.run(*_ignored)
        odeprecated "`brew cask update`", "`brew update`", disable_on: Time.utc(2017, 7, 1)
        result = SystemCommand.run(HOMEBREW_BREW_FILE, args:         ["update"],
                                                       print_stderr: true,
                                                       print_stdout: true)
        exit result.exit_status
      end

      def self.visible
        false
      end

      def self.help
        "a synonym for 'brew update'"
      end
    end
  end
end


text:
<?php
/**
 * Created by PhpStorm.
 * User: hp
 * Date: 25/12/2016
 * Time: 01:10
 */

namespace AppBundle\Entity;

use MBL\CSVRWBundle\Annotation\Depndency;

class School
{
    /**
     * @var string
     */
    public $name;

    /**
     * @var string
     */
    public $category;

    /**
     * @var Address
     * @Depndency(class="AppBundle\Entity\Address")
     */
    public $address;

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

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

    /**
     * @return string
     */
    public function getCategory()
    {
        return $this->category;
    }

    /**
     * @param string $category
     */
    public function setCategory($category)
    {
        $this->category = $category;
    }

}


text:
package org.apache.activemq.artemis.tests.integration.openwire.amq;

import javax.jms.DeliveryMode;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
import javax.jms.Session;
import javax.jms.TextMessage;

import org.apache.activemq.command.ActiveMQDestination;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;

/**
 * adapted from: org.apache.activemq.JmsTopicWildcardSendReceiveTest
 */
@Ignore
public class JmsTopicWildcardSendReceiveTest extends JmsTopicSendReceiveTest {

   private String destination1String = "TEST.ONE.ONE";
   private String destination2String = "TEST.ONE.ONE.ONE";
   private String destination3String = "TEST.ONE.TWO";
   private String destination4String = "TEST.TWO.ONE";

   @Override
   @Before
   public void setUp() throws Exception {
      topic = true;
      durable = false;
      deliveryMode = DeliveryMode.NON_PERSISTENT;
      super.setUp();
   }

   @Override
   protected String getConsumerSubject() {
      return "FOO.>";
   }

   @Override
   protected String getProducerSubject() {
      return "FOO.BAR.HUMBUG";
   }

   @Test
   public void testReceiveWildcardTopicEndAsterisk() throws Exception {
      connection.start();
      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

      ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic(destination1String);
      ActiveMQDestination destination3 = (ActiveMQDestination) session.createTopic(destination3String);

      Message m = null;
      MessageConsumer consumer = null;
      String text = null;

      ActiveMQDestination destination6 = (ActiveMQDestination) session.createTopic("TEST.ONE.*");
      consumer = session.createConsumer(destination6);
      sendMessage(session, destination1, destination1String);
      sendMessage(session, destination3, destination3String);
      m = consumer.receive(5000);
      assertNotNull(m);
      text = ((TextMessage) m).getText();
      if (!(text.equals(destination1String) || text.equals(destination3String))) {
         fail("unexpected message:" + text);
      }
      m = consumer.receive(5000);
      assertNotNull(m);
      text = ((TextMessage) m).getText();
      if (!(text.equals(destination1String) || text.equals(destination3String))) {
         fail("unexpected message:" + text);
      }
      assertNull(consumer.receiveNoWait());
   }

   @Test
   public void testReceiveWildcardTopicEndGreaterThan() throws Exception {
      connection.start();
      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

      ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic(destination1String);
      ActiveMQDestination destination2 = (ActiveMQDestination) session.createTopic(destination2String);
      ActiveMQDestination destination3 = (ActiveMQDestination) session.createTopic(destination3String);

      Message m = null;
      MessageConsumer consumer = null;
      String text = null;

      ActiveMQDestination destination7 = (ActiveMQDestination) session.createTopic("TEST.ONE.>");
      consumer = session.createConsumer(destination7);
      sendMessage(session, destination1, destination1String);
      sendMessage(session, destination2, destination2String);
      sendMessage(session, destination3, destination3String);
      m = consumer.receive(1000);
      assertNotNull(m);
      text = ((TextMessage) m).getText();
      if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
         fail("unexpected message:" + text);
      }
      m = consumer.receive(1000);
      assertNotNull(m);
      if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
         fail("unexpected message:" + text);
      }
      m = consumer.receive(1000);
      assertNotNull(m);
      if (!(text.equals(destination1String) || text.equals(destination2String) || text.equals(destination3String))) {
         fail("unexpected message:" + text);
      }
      assertNull(consumer.receiveNoWait());
   }

   @Test
   public void testReceiveWildcardTopicMidAsterisk() throws Exception {
      connection.start();
      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

      ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic(destination1String);
      ActiveMQDestination destination4 = (ActiveMQDestination) session.createTopic(destination4String);

      Message m = null;
      MessageConsumer consumer = null;
      String text = null;

      ActiveMQDestination destination8 = (ActiveMQDestination) session.createTopic("TEST.*.ONE");
      consumer = session.createConsumer(destination8);
      sendMessage(session, destination1, destination1String);
      sendMessage(session, destination4, destination4String);
      m = consumer.receive(1000);
      assertNotNull(m);
      text = ((TextMessage) m).getText();
      if (!(text.equals(destination1String) || text.equals(destination4String))) {
         fail("unexpected message:" + text);
      }
      m = consumer.receive(1000);
      assertNotNull(m);
      text = ((TextMessage) m).getText();
      if (!(text.equals(destination1String) || text.equals(destination4String))) {
         fail("unexpected message:" + text);
      }
      assertNull(consumer.receiveNoWait());

   }

   @Test
   public void testReceiveWildcardTopicMatchSinglePastTheEndWildcard() throws Exception {
      connection.start();
      Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

      ActiveMQDestination destination1 = (ActiveMQDestination) session.createTopic("a.>");
      ActiveMQDestination destination2 = (ActiveMQDestination) session.createTopic("a");

      Message m = null;
      MessageConsumer consumer = null;
      String text = null;

      consumer = session.createConsumer(destination1);
      sendMessage(session, destination2, destination3String);

      m = consumer.receive(1000);
      assertNotNull(m);
      text = ((TextMessage) m).getText();
      if (!(text.equals(destination1String) || text.equals(destination3String))) {
         fail("unexpected message:" + text);
      }

      assertNull(consumer.receiveNoWait());
   }

   private void sendMessage(Session session, Destination destination, String text) throws JMSException {
      MessageProducer producer = session.createProducer(destination);
      producer.send(session.createTextMessage(text));
      producer.close();
   }

}


text:
<?php

declare (strict_types=1);
namespace Rector\Doctrine\Rector\Class_;

use PhpParser\Node;
use PhpParser\Node\Stmt\Class_;
use Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode;
use Rector\Core\Rector\AbstractRector;
use Rector\Doctrine\NodeManipulator\DoctrineItemDefaultValueManipulator;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
 * @see \Rector\Doctrine\Tests\Rector\Class_\RemoveRedundantDefaultClassAnnotationValuesRector\RemoveRedundantDefaultClassAnnotationValuesRectorTest
 */
final class RemoveRedundantDefaultClassAnnotationValuesRector extends \Rector\Core\Rector\AbstractRector
{
    /**
     * @var \Rector\Doctrine\NodeManipulator\DoctrineItemDefaultValueManipulator
     */
    private $doctrineItemDefaultValueManipulator;
    public function __construct(\Rector\Doctrine\NodeManipulator\DoctrineItemDefaultValueManipulator $doctrineItemDefaultValueManipulator)
    {
        $this->doctrineItemDefaultValueManipulator = $doctrineItemDefaultValueManipulator;
    }
    public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
    {
        return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Removes redundant default values from Doctrine ORM annotations on class level', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(readOnly=false)
 */
class SomeClass
{
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity()
 */
class SomeClass
{
}
CODE_SAMPLE
)]);
    }
    /**
     * @return array<class-string<Node>>
     */
    public function getNodeTypes() : array
    {
        return [\PhpParser\Node\Stmt\Class_::class];
    }
    /**
     * @param Class_ $node
     */
    public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
    {
        $this->refactorClassAnnotations($node);
        return $node;
    }
    private function refactorClassAnnotations(\PhpParser\Node\Stmt\Class_ $class) : void
    {
        $this->refactorEntityAnnotation($class);
    }
    private function refactorEntityAnnotation(\PhpParser\Node\Stmt\Class_ $class) : void
    {
        $phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($class);
        $doctrineTagValueNode = $phpDocInfo->getByAnnotationClass('Doctrine\\ORM\\Mapping\\Entity');
        if (!$doctrineTagValueNode instanceof \Rector\BetterPhpDocParser\PhpDoc\DoctrineAnnotationTagValueNode) {
            return;
        }
        $this->doctrineItemDefaultValueManipulator->remove($phpDocInfo, $doctrineTagValueNode, 'readOnly', \false);
    }
}


text:
r'''
Copyright 2014 Google Inc. 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

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

from nogotofail.mitm.connection.handlers import store
from data import DataHandler

handlers = store.HandlerStore()

from report import ClientReportDetection
from log import RawTrafficLogger
from http import *
from imap import *
from smtp import *
from xmpp import *
from custom import CustomRequestDetection


text:
/**
 *
 */
package com.apixandru.jvshot.core;

import java.awt.image.BufferedImage;

/**
 * @author apixandru
 */
public interface JVCutListener {

    void imageCut(BufferedImage image);

}


text:
$(document).ready(function() {

	// Initialize Masonry
	$('#content').masonry({
		columnWidth: 205,
		itemSelector: '.item',
		isFitWidth: true,
		isAnimated: !Modernizr.csstransitions
	}).imagesLoaded(function() {
		$(this).masonry('reload');
	});

});


text:
<!DOCTYPE html>
<html lang="en">
<head>
    <script type="text/javascript" src="cloudInterface.js" ></script>
    <script type="text/javascript" src="cloudHelpers.js" ></script>
    <script type="text/javascript" src="simpleFileServerImplementation.js" ></script>
    <script type="text/javascript" src="dropboxImplementation.js" ></script>
    <script>
        var sfs = new SimpleFileServer("user1");
        function sfsTest() {
            var sfs = new SimpleFileServer("user1");
            return sfs.uploadTextFile("test2","a/testFile.txt").then(function() {
                return sfs.shareFile("a/testFile.txt")
            }).then(function(accessor) {
                return accessor.retrieve();
            }).then(function(contents) {
                alert(decodeAscii(contents));
                return sfs.removeFile("a/testFile.txt");
            });
        }

        function getDropbox() {
            var dropbox = new Dropbox("rwovrjf7g18ya3b");
            dropbox.authenticate("ecJ2oWRI0wUAAAAAAAABN9fb2Hx2nyDqp-4BbaVK6p3kLVZgZM3M1NDcwCtl-2aV");
            return dropbox;
        }
        function testUploadDownload() {
            var dropbox = new Dropbox("rwovrjf7g18ya3b");
            dropbox.authenticate("ecJ2oWRI0wUAAAAAAAABN9fb2Hx2nyDqp-4BbaVK6p3kLVZgZM3M1NDcwCtl-2aV");
            dropbox.uploadFile(encodeAscii("ABC"), "stuff.txt")
                    .then(function (req) {
                        return dropbox.downloadFile("stuff.txt");
                    })
                    .then(function (contents) {
                        alert(decodeAscii(contents));
                    });
        }
        function testSharing() {
            var dropbox = new Dropbox("rwovrjf7g18ya3b");
            dropbox.authenticate("ecJ2oWRI0wUAAAAAAAABN9fb2Hx2nyDqp-4BbaVK6p3kLVZgZM3M1NDcwCtl-2aV");
            dropbox.uploadFile(encodeAscii("ABC"), "stuff.txt")
                    .then(function () {
                        return dropbox.shareFile("stuff.txt");
                    }).then( function (linkToFile) {
                        return (new SharedFile(linkToFile.encode())).retrieve();
                    }).then( function (fileContents) {
                        alert(decodeAscii(fileContents));
                    });
        }
        function testUpdate() {
            var dropbox = new Dropbox("rwovrjf7g18ya3b");
            dropbox.authenticate("ecJ2oWRI0wUAAAAAAAABN9fb2Hx2nyDqp-4BbaVK6p3kLVZgZM3M1NDcwCtl-2aV");
            initializeVersionFile(dropbox, "version.txt").then(function(versionFile){
                setInterval(function() {versionFile.advance();}, 5000);
                startUpdateCheck(versionFile.sharedResourceAccessor, 247, function() {document.body.innerHTML += "Alert!";});
            });
        }
        function testShareMultiple() {
            var dropbox = new Dropbox("rwovrjf7g18ya3b");
            dropbox.authenticate("ecJ2oWRI0wUAAAAAAAABN9fb2Hx2nyDqp-4BbaVK6p3kLVZgZM3M1NDcwCtl-2aV");
            var promise1 = dropbox.uploadFile(encodeAscii("ABC"), "stuff1.txt");
            var promise2 = dropbox.uploadFile(encodeAscii("DEF"), "stuff2.txt");
            var promise3 = dropbox.uploadFile(encodeAscii("GHI"), "stuff3.txt");
            var promise4 = dropbox.uploadFile(encodeAscii("JKL"), "stuff4.txt");
            Promise.all([promise1, promise2, promise3, promise4]).then(
                    function() {
                        var promise1 = dropbox.shareFile("stuff1.txt");
                        var promise2 = dropbox.shareFile("stuff2.txt");
                        var promise3 = dropbox.shareFile("stuff3.txt");
                        var promise4 = dropbox.shareFile("stuff4.txt");
                        return Promise.all([promise1, promise2, promise3, promise4]);
                    }
            ).then(function([link1,link2,link3,link4]){
                var toShare = [];
                toShare["one"]=link1;
                toShare["two"]=link2;
                toShare["three"]=link3;
                toShare["four"]=link4;
                return shareMultipleResources(toShare,"allstuff.txt",dropbox);
            }).then(function(allResourcesLink){
                return readMultipleSharedResourcesFromAccessor(allResourcesLink);
            }).then(function(resources) {
                var promise1 = resources["one"].retrieve();
                var promise2 = resources["two"].retrieve();
                var promise3 = resources["three"].retrieve();
                var promise4 = resources["four"].retrieve();
                return Promise.all([promise1, promise2, promise3, promise4]);
            }).then(function([one,two,three,four]){
                console.log("one: " + decodeAscii(one));
                console.log("two: " + decodeAscii(two));
                console.log("three: " + decodeAscii(three));
                console.log("four: " + decodeAscii(four));
            });
        }
    </script>
    <meta charset="UTF-8">
    <title>Test</title>
</head>
<body>

</body>
</html>


text:
import fs from 'fs';
import path from 'path';

const dataDir = path.join(__dirname, '../data/');
const re11 = new RegExp(/_/g);
const replacements = {};
const fileCache = [];

const quotemeta = function quotemeta(string) {
  const unsafe = '\\.+*?[^]$(){}=!<>|:';
  for (let i = 0; i < unsafe.length; i++) {
    string = string.replace(new RegExp(`\\${unsafe.charAt(i)}`, 'g'), `\\${unsafe.charAt(i)}`);
  }
  return string;
};

const lineHandle = function lineHandle(source, phrase, replacement = '') {
  let start = false;
  let end = false;

  if (phrase[0] === '<') {
    start = true;
    phrase = phrase.substring(1);
  }

  if (phrase.slice(-1) === '>') {
    end = true;
    phrase = phrase.substring(0, phrase.length - 1);
  }

  phrase = phrase.replace(re11, ' ');
  const cleanPhrase = quotemeta(phrase);

  phrase.split(' ').forEach((word) => {
    word = word.toLowerCase();
    if (word !== '') {
      if (replacements[word] === undefined) {
        replacements[word] = [];
      }

      let phraseRegex;
      let replacementRegex;

      if (start && end) {
        phraseRegex = new RegExp(`^${cleanPhrase}$`, 'gi');
        replacementRegex = replacement;
      } else if (start) {
        phraseRegex = new RegExp(`^${cleanPhrase}(\\W+|$)`, 'gi');
        replacementRegex = `${replacement}$1`;
      } else if (end) {
        phraseRegex = new RegExp(`(\\W+|^)${cleanPhrase}$`, 'gi');
        replacementRegex = `$1${replacement}`;
      } else {
        phraseRegex = new RegExp(`(\\W+|^)${cleanPhrase}(\\W+|$)`, 'gi');
        replacementRegex = `$1${replacement}$2`;
      }

      replacements[word].push({ phrase, replacement, phraseRegex, replacementRegex, source });
      replacements[word].sort((a, b) => (b.phrase.split(' ').length - a.phrase.split(' ').length));
    }
  });
};

const textFile = (file) => {
  const source = file.replace('.txt', '');
  const data = fs.readFileSync(dataDir + file, 'utf8').split(/\r|\n/);

  for (let i = 0; i < data.length; i++) {
    const line = data[i];
    let nline = line.trimLeft();

    // Let's allow comments with '#'
    const pos = nline.indexOf('#');

    if (pos === -1) {
      const parts = nline.split(' ');

      if (parts[1] === undefined) {
        lineHandle(source, parts[0], '');
      } else {
        lineHandle(source, parts[0], parts[1]);
      }
    } else if (pos > 0) {
      nline = nline.substr(0, pos);
      const parts = nline.split(' ');
      lineHandle(source, parts[0], parts[1]);
    }
  }

  fileCache.push(file);
};

/**
 * The default json format is and array of objects with a phase / replacement keys
 * key = replacement and value is the match phrase.
 */
const jsonFile = (file) => {
  const source = file.replace('.json', '');
  const contents = fs.readFileSync(dataDir + file, 'utf8');
  const data = JSON.parse(contents);
  for (let i = 0; i < data.length; i++) {
    const phrase = data[i].phrase;
    const replacement = data[i].replacement;
    lineHandle(source, phrase, replacement);
  }

  fileCache.push(file);
};

const prepFile = function prepFile(file) {
  if (fileCache.indexOf(file) === -1) {
    if (file.indexOf('.txt') !== -1) {
      textFile(file);
    } else if (file.indexOf('.json') !== -1) {
      jsonFile(file);
    }
  }
};

const uniq = function uniq(a) {
  return a.sort().filter((item, pos, ary) => !pos || item !== ary[pos - 1]);
};

const CLEAN_REGEX = /[\w'-]+/i;

const cleanWord = (word = '') => {
  const matches = word.match(CLEAN_REGEX);
  return matches ? matches[0] : word;
};

export default { cleanWord, prepFile, quotemeta, replacements, uniq };


text:
<!DOCTYPE html>

<link rel="stylesheet" type="text/css" href="http://static.tongrenlu.info/jquery.jpaginate/css/style.css" media="screen"/>


text:
package org.apache.qpid.proton.engine.impl;

import java.nio.ByteBuffer;

import org.apache.qpid.proton.codec.ReadableBuffer;
import org.apache.qpid.proton.codec.WritableBuffer;

public class FrameWriterBuffer implements WritableBuffer {

    public final static int DEFAULT_CAPACITY = 1024;

    byte array[];
    int position;

   /**
    * Creates a new WritableBuffer with default capacity.
    */
   public FrameWriterBuffer() {
       this(DEFAULT_CAPACITY);
   }

    /**
     * Create a new WritableBuffer with the given capacity.
     *
     * @param capacity
     *      the inital capacity to allocate for this buffer.
     */
    public FrameWriterBuffer(int capacity) {
        this.array = new byte[capacity];
    }

    public byte[] array() {
        return array;
    }

    public int arrayOffset() {
        return 0;
    }

    @Override
    public void put(byte b) {
        ensureRemaining(Byte.BYTES);
        array[position++] = b;
    }

    @Override
    public void putShort(short value) {
        ensureRemaining(Short.BYTES);
        array[position++] = (byte)(value >>> 8);
        array[position++] = (byte)(value >>> 0);
    }

    @Override
    public void putInt(int value) {
        ensureRemaining(Integer.BYTES);
        array[position++] = (byte)(value >>> 24);
        array[position++] = (byte)(value >>> 16);
        array[position++] = (byte)(value >>> 8);
        array[position++] = (byte)(value >>> 0);
    }

    @Override
    public void putLong(long value) {
        ensureRemaining(Long.BYTES);
        array[position++] = (byte)(value >>> 56);
        array[position++] = (byte)(value >>> 48);
        array[position++] = (byte)(value >>> 40);
        array[position++] = (byte)(value >>> 32);
        array[position++] = (byte)(value >>> 24);
        array[position++] = (byte)(value >>> 16);
        array[position++] = (byte)(value >>> 8);
        array[position++] = (byte)(value >>> 0);
    }

    @Override
    public void putFloat(float value) {
        putInt(Float.floatToRawIntBits(value));
    }

    @Override
    public void putDouble(double value) {
        putLong(Double.doubleToRawLongBits(value));
    }

    @Override
    public void put(byte[] src, int offset, int length) {
        if (length == 0) {
            return;
        }

        ensureRemaining(length);
        System.arraycopy(src, offset, array, position, length);
        position += length;
    }

    @Override
    public void put(ByteBuffer payload) {
        final int toCopy = payload.remaining();
        ensureRemaining(toCopy);

        if (payload.hasArray()) {
            System.arraycopy(payload.array(), payload.arrayOffset() + payload.position(), array, position, toCopy);
            payload.position(payload.position() + toCopy);
        } else {
            payload.get(array, position, toCopy);
        }

        position += toCopy;
    }

    @Override
    public void put(ReadableBuffer payload) {
        final int toCopy = payload.remaining();
        ensureRemaining(toCopy);

        if (payload.hasArray()) {
            System.arraycopy(payload.array(), payload.arrayOffset() + payload.position(), array, position, toCopy);
            payload.position(payload.position() + toCopy);
        } else {
            payload.get(array, position, toCopy);
        }

        position += toCopy;
    }

    @Override
    public boolean hasRemaining() {
        return position < Integer.MAX_VALUE;
    }

    @Override
    public int remaining() {
        return Integer.MAX_VALUE - position;
    }

    /**
     * Ensures the the buffer has at least the requiredRemaining space specified.
     *

     * The internal buffer will be doubled if the requested capacity is less than that
     * amount or the buffer will be expanded to the full new requiredRemaining value.
     *
     * @param requiredRemaining
     *      the minimum remaining bytes needed to meet the next write operation.
     */
    @Override
    public void ensureRemaining(int requiredRemaining) {
        if (requiredRemaining > array.length - position) {
            byte newBuffer[] = new byte[Math.max(array.length << 1, requiredRemaining + position)];
            System.arraycopy(array, 0, newBuffer, 0, array.length);
            array = newBuffer;
        }
    }

    @Override
    public int position() {
        return position;
    }

    @Override
    public void position(int position) {
        if (position < 0) {
            throw new IllegalArgumentException("Requested new buffer position cannot be negative");
        }

        if (position > array.length) {
            ensureRemaining(position - array.length);
        }

        this.position = position;
    }

    @Override
    public int limit() {
        return Integer.MAX_VALUE;
    }

    /**
     * Copy bytes from this buffer into the target buffer and compacts this buffer.
     *

     * Copy either all bytes written into this buffer (start to current position) or
     * as many as will fit if the target capacity is less that the bytes written.  Bytes
     * not read from this buffer are moved to the front of the buffer and the position is
     * reset to the end of the copied region.
     *
     * @param target
     *      The array to move bytes to from those written into this buffer.
     *
     * @return the number of bytes transfered to the target buffer.
     */
    public int transferTo(ByteBuffer target) {
        int size = Math.min(position, target.remaining());

        if (size == 0) {
            return 0;
        }

        if (target.hasArray()) {
            System.arraycopy(array, 0, target.array(), target.arrayOffset() + target.position(), size);
            target.position(target.position() + size);
        } else {
            target.put(array, 0, size);
        }

        // Compact any remaining data to the front of the array so that new writes can reuse
        // space previously allocated and not extend the array if possible.
        if (size != position) {
            int remainder = position - size;
            System.arraycopy(array, size, array, 0, remainder);
            position = remainder;  // ensure we are at end of unread chunk
        } else {
            position = 0; // reset to empty state.
        }

        return size;
    }
}


text:
<?php

ob_start();

/*
 * Prototype : bool session_set_save_handler(SessionHandler $handler [, bool $register_shutdown_function = true])
 * Description : Sets user-level session storage functions
 * Source code : ext/session/session.c
 */

echo "*** Testing session_set_save_handler() : manual shutdown ***\n";

class MySession extends SessionHandler {
	public $num;
	public function __construct($num) {
		$this->num = $num;
		echo "(#$this->num) constructor called\n";
	}
	public function __destruct() {
		echo "(#$this->num) destructor called\n";
	}
	public function finish() {
		$id = session_id();
		echo "(#$this->num) finish called $id\n";
		session_write_close();
	}
	public function write($id, $data) {
		echo "(#$this->num) writing $id = $data\n";
		return parent::write($id, $data);
	}
	public function close() {
		$id = session_id();
		echo "(#$this->num) closing $id\n";
		return parent::close();
	}
}

$handler = new MySession(1);
session_set_save_handler($handler);
session_start();

$_SESSION['foo'] = 'bar';

// explicit close
$handler->finish();

echo "done\n";
ob_end_flush();
?>


text:
<?php

require_once dirname(dirname(dirname(dirname(__FILE__)))) .'/Core/testConfig.inc.php';

class gosUtility_YamlLoaderTest extends gosTest_Framework_TestCase
{
    public function setUpExtension()
    {
    }

    public function tearDownExtension()
    {
    }

    public function testLoadFile_FileExists()
    {
        $parsedYaml = gosUtility_YamlLoader::loadFile(GOS_ROOT . 'Utility/test/gosUtility/_helpers/nameMapping.yaml', false);

        $this->assertNotNull($parsedYaml);
        $this->assertTrue(is_array($parsedYaml['dataType']));
    }

    public function testLoadFile_FileNotExists()
    {
        $fileName = GOS_ROOT . 'Utility/test/gosUtility/_helpers/nameMapping.yaml.doesNotExist';

        try
        {
            gosUtility_YamlLoader::loadFile($fileName, false);
            $this->fail("Yaml loader did not throw an error for missing file.");
        }
        catch(gosException_InvalidArgument $e)
        {
            $this->assertEquals('File ' . $fileName . ' does not exist', $e->getMessage());
        }
    }

    public function testLoadFile_NullOnEmptyFile()
    {
        $fileName = GOS_ROOT . 'Utility/test/gosUtility/_helpers/Empty.yaml';

        // Specify that an error should NOT be thrown for empty yaml content
        $parsedYaml = gosUtility_YamlLoader::loadFile($fileName, false);

        $this->assertNull($parsedYaml);
    }

    public function testLoadFile_FaultOnEmptyFile()
    {
        $fileName = GOS_ROOT . 'Utility/test/gosUtility/_helpers/Empty.yaml';

        try
        {
            // Specify that an error SHOULD be thrown for empty yaml content
            gosUtility_YamlLoader::loadFile($fileName, true);
            $this->fail("Yaml loader did not throw an error for empty file.");
        }
        catch(gosException_RuntimeError $e)
        {
            $this->assertEquals($fileName . ' was empty!', $e->getMessage());
        }
    }
}


text:
Option Explicit On
Option Infer On
Option Strict On

#Region " --------------->> Imports/ usings "
Imports System.Runtime.CompilerServices
#End Region

Namespace ExtensionMethods

	Public Module ObjectExtensions

#Region " --------------->> Enumerationen der Klasse "
#End Region '{Enumerationen der Klasse}

#Region " --------------->> Eigenschaften der Klasse "
#End Region '{Eigenschaften der Klasse}

#Region " --------------->> Konstruktor und Destruktor der Klasse "
#End Region '{Konstruktor und Destruktor der Klasse}

#Region " --------------->> Zugriffsmethoden der Klasse "
#End Region '{Zugriffsmethoden der Klasse}

#Region " --------------->> Ereignismethoden Methoden der Klasse "
#End Region '{Ereignismethoden der Klasse}

#Region " --------------->> Private Methoden der Klasse "
#End Region '{Private Methoden der Klasse}

#Region " --------------->> Öffentliche Methoden der Klasse "

		<Extension()>
		Public Sub WriteLineStructureToConsole(Of T As Structure)(ByVal v As T)

			Console.WriteLine(v.ToString)
		End Sub

		<Extension()>
		Public Sub WriteStructureToConsole(Of T As Structure)(ByVal v As T)

			Console.Write(v.ToString)
		End Sub

		<Extension()>
		Public Sub WriteLineClassToConsole(Of T As Class)(ByVal v As T)

			Console.WriteLine(v.ToString)
		End Sub

		<Extension()>
		Public Sub WriteClassToConsole(Of T As Class)(ByVal v As T)

			Console.Write(v.ToString)
		End Sub

#End Region '{Öffentliche Methoden der Klasse}

	End Module

End Namespace


text:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="false" android:drawable="@drawable/shape_red_corners_button_disable"/>
    <item android:state_pressed="true" android:drawable="@drawable/shape_red_corners_button_pressed" />
    <item android:drawable="@drawable/shape_red_corners_button" />
</selector>


text:
using std::string;

class ipc_handler
{
public:
	enum ipc_handler_mode
	{
		sync_mode,
		async_mode,
		truncate_mode
	};

	enum ipc_handler_exception
	{
		unknown
	};
	virtual void connect(ipc_handler_mode)=0;
	virtual void disconnect(ipc_handler_mode)=0;
	virtual void handle(ipc_handler_mode,string data)=0;
	virtual void exception(ipc_handler_mode,ipc_handler_exception)=0;
};

class ipc_handler_factory
{
public:
	virtual ipc_handler *create()=0;
};


text:
package hu.belicza.andras.sc2gearsdb.datastore;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Inheritance;
import javax.jdo.annotations.InheritanceStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

/**
 * Common ancestor for objects stored in the data store.
 *
 *
The {@link InheritanceStrategy#SUBCLASS_TABLE} strategy will tell to store properties of this class
 * on the tables of the subclasses.

 *
 *
This class is abstract because we do not want to save instances of this class.

 *
 * @author Andras Belicza
 */
@PersistenceCapable
@Inheritance( strategy = InheritanceStrategy.SUBCLASS_TABLE )
public abstract class DataStoreObject {

	/** Key of the entity. */
	@PrimaryKey
	@Persistent( valueStrategy = IdGeneratorStrategy.IDENTITY )
	protected Key key;

	/** Object creation date. */
	@Persistent
	protected Date date;

	/** Entity class format version. */
	@Persistent
	protected int v;

	/**
	 * Creates a new DataStoreObject.
	 */
	public DataStoreObject() {
		date = new Date();
	}

	/**
	 * Sets the key.
	 * @param key key to set
	 */
	public void setKey( final Key key ) {
		this.key = key;
	}

	/**
	 * Returns the key.
	 * @return the key
	 */
	public Key getKey() {
		return key;
	}

	/**
	 * Returns the creation date.
	 * @return the creation date
	 */
	public Date getDate() {
		return date;
	}

	/**
	 * Sets the entity class format version.
	 * @param v the entity class format version to be set
	 */
	public void setV( int v ) {
		this.v = v;
	}

	/**
	 * Returns the entity class format version.
	 * @return the entity class format version
	 */
	public int getV() {
		return v;
	}

}


text:
.PHONY : default test publish set-version check-version clean

# Typical Uses
#
# Build for Nodejs
#   make
#
# Test
#   make test
#
# Bump Version
#   make set-version VERSION=3.0.0
#
# Publish to NPM and Atmosphere
#   make publish

# The directory we'll build files for NodeJS.
build_dir := commonjs
# Grab the current directory. It's expected that make will be run in the package root.
pwd := $(shell pwd)
# Read the current version of the package.
current_version := $(shell node -e 'console.log(require("./package.json").version)')

# Run the default targerts.
default : build meteor/packages/ioc-container/src

# Build the ES3 NodeJS files from the ES2015 source files.
build : src/*
	@npm run build

# Create the symbolic links for the meteor project.
meteor/packages/ioc-container/src :
	@ln -s $(pwd)/src/ meteor/packages/ioc-container/src
	@ln -s $(pwd)/README.md meteor/packages/ioc-container/README.md

# Run the tests in NodeJS.
test : build
	@npm test

# Publish the package on NPM and Atmosphere. This requires the package already exist on Atmosphere.
publish : default
	@npm publish --access public
	@pushd . && cd meteor/packages/ioc-container && meteor publish && popd

# Set the version number in package.json and package.js
# Requires VERSION be set on the command line.
set-version : check-version
	@sed -E -i '' 's/"version":[[:space:]]+"[^"]+"/"version": "$(VERSION)"/' package.json
	@sed -E -i '' "s/version:[[:space:]]+'[^']+'/version: '$(VERSION)'/" meteor/packages/ioc-container/package.js

# Ensure a VERSION is specified at the command line and that it is different than the current version.
check-version :
ifeq ($(VERSION),)
	$(error VERSION on command line not specified. Use VERSION=x.x.x on the command line.)
else ifeq ($(current_version), $(VERSION))
	$(error Version has not been updated since $(current_version).)
endif

# Clean all artifacts.
clean :
	@rm -fr $(build_dir)
	@rm -f meteor/packages/ioc-container/src


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Cladonia miniata var. miniata G. Mey.

### Remarks
null


text:
require 'socket'

describe 'BasicSocket#sendmsg' do
  each_ip_protocol do |family, ip_address|
    describe 'using a disconnected socket' do
      before do
        @client = Socket.new(family, :DGRAM)
        @server = Socket.new(family, :DGRAM)

        @server.bind(Socket.sockaddr_in(0, ip_address))
      end

      after do
        @client.close
        @server.close
      end

      describe 'without a destination address' do
        it 'raises Errno::EDESTADDRREQ' do
          proc { @client.sendmsg('hello') }
            .should raise_error(Errno::EDESTADDRREQ)
        end
      end

      describe 'with a destination address as a String' do
        it 'returns the amount of sent bytes' do
          @client.sendmsg('hello', 0, @server.getsockname).should == 5
        end
      end

      describe 'with a destination address as an Addrinfo' do
        it 'returns the amount of sent bytes' do
          @client.sendmsg('hello', 0, @server.connect_address).should == 5
        end
      end
    end

    describe 'using a connected UDP socket' do
      before do
        @client = Socket.new(family, :DGRAM)
        @server = Socket.new(family, :DGRAM)

        @server.bind(Socket.sockaddr_in(0, ip_address))
      end

      after do
        @client.close
        @server.close
      end

      describe 'without a destination address argument' do
        before do
          @client.connect(@server.getsockname)
        end

        it 'returns the amount of bytes written' do
          @client.sendmsg('hello').should == 5
        end
      end

      describe 'with a destination address argument' do
        before do
          @alt_server = Socket.new(family, :DGRAM)

          @alt_server.bind(Socket.sockaddr_in(0, ip_address))
        end

        after do
          @alt_server.close
        end

        it 'sends the message to the given address instead' do
          @client.sendmsg('hello', 0, @alt_server.getsockname).should == 5

          proc { @server.recv(5) }.should block_caller

          @alt_server.recv(5).should == 'hello'
        end
      end
    end

    describe 'using a connected TCP socket' do
      before do
        @client = Socket.new(family, :STREAM)
        @server = Socket.new(family, :STREAM)

        @server.bind(Socket.sockaddr_in(0, ip_address))
        @server.listen(1)

        @client.connect(@server.getsockname)
      end

      after do
        @client.close
        @server.close
      end

      it 'blocks when the underlying buffer is full' do
        # Buffer sizes may differ per platform, so sadly this is the only
        # reliable way of testing blocking behaviour.
        block = proc do
          10.times { @client.sendmsg('hello' * 1_000_000) }
        end

        block.should block_caller
      end
    end
  end
end


text:
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "media/mojo/services/mojo_audio_input_stream.h"

#include <memory>
#include <utility>

#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/memory/read_only_shared_memory_region.h"
#include "base/sync_socket.h"
#include "mojo/public/cpp/system/platform_handle.h"

namespace media {

MojoAudioInputStream::MojoAudioInputStream(
    mojo::PendingReceiver<mojom::AudioInputStream> receiver,
    mojo::PendingRemote<mojom::AudioInputStreamClient> client,
    CreateDelegateCallback create_delegate_callback,
    StreamCreatedCallback stream_created_callback,
    base::OnceClosure deleter_callback)
    : stream_created_callback_(std::move(stream_created_callback)),
      deleter_callback_(std::move(deleter_callback)),
      receiver_(this, std::move(receiver)),
      client_(std::move(client)) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(stream_created_callback_);
  DCHECK(deleter_callback_);
  // |this| owns |receiver_|, so unretained is safe.
  receiver_.set_disconnect_handler(
      base::BindOnce(&MojoAudioInputStream::OnError, base::Unretained(this)));
  client_.set_disconnect_handler(
      base::BindOnce(&MojoAudioInputStream::OnError, base::Unretained(this)));
  delegate_ = std::move(create_delegate_callback).Run(this);
  if (!delegate_) {
    // Failed to initialize the stream. We cannot call |deleter_callback_| yet,
    // since construction isn't done.
    receiver_.reset();
    base::ThreadTaskRunnerHandle::Get()->PostTask(
        FROM_HERE,
        base::BindOnce(&MojoAudioInputStream::OnStreamError,
                       weak_factory_.GetWeakPtr(), /* not used */ 0));
  }
}

MojoAudioInputStream::~MojoAudioInputStream() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}

void MojoAudioInputStream::SetOutputDeviceForAec(
    const std::string& raw_output_device_id) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  delegate_->OnSetOutputDeviceForAec(raw_output_device_id);
}

void MojoAudioInputStream::Record() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  delegate_->OnRecordStream();
}

void MojoAudioInputStream::SetVolume(double volume) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  if (volume < 0 || volume > 1) {
    LOG(ERROR) << "MojoAudioInputStream::SetVolume(" << volume
               << ") out of range.";
    OnStreamError(/*not used*/ 0);
    return;
  }
  delegate_->OnSetVolume(volume);
}

void MojoAudioInputStream::OnStreamCreated(
    int stream_id,
    base::ReadOnlySharedMemoryRegion shared_memory_region,
    std::unique_ptr<base::CancelableSyncSocket> foreign_socket,
    bool initially_muted) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(stream_created_callback_);
  DCHECK(foreign_socket);

  if (!shared_memory_region.IsValid()) {
    OnStreamError(/*not used*/ 0);
    return;
  }

  DCHECK(foreign_socket->IsValid());
  mojo::PlatformHandle socket_handle(foreign_socket->Take());

  std::move(stream_created_callback_)
      .Run({base::in_place, std::move(shared_memory_region),
            std::move(socket_handle)},
           initially_muted);
}

void MojoAudioInputStream::OnMuted(int stream_id, bool is_muted) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  client_->OnMutedStateChanged(is_muted);
}

void MojoAudioInputStream::OnStreamError(int stream_id) {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  client_->OnError();
  OnError();
}

void MojoAudioInputStream::OnError() {
  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
  DCHECK(deleter_callback_);
  std::move(deleter_callback_).Run();  // Deletes |this|.
}

}  // namespace media


text:
/**
 * @author envjs team
 * @param {Document} onwnerDocument
 */
DocumentType = function(ownerDocument) {
    Node.apply(this, arguments);
    this.systemId = null;
    this.publicId = null;
};
DocumentType.prototype = new Node();
__extend__({
    get name(){
        return this.nodeName;
    },
    get entities(){
        return null;
    },
    get internalSubsets(){
        return null;
    },
    get notations(){
        return null;
    },
    toString : function(){
        return "[object DocumentType]";
    }
});


text:
@implementation StartStopObject

- (void)start {
    self.started = YES;
}

- (void)stop {
    self.started = NO;
}

@end