text:
<resources>
    <string name="app_name">Roméo</string>
    <string name="options">Options</string>
    <string name="penpal_ip">Adresse IP du correspondant</string>
    <string name="description_black_button">Black Button</string>
    <string name="description_red_button">Red Button</string>
    <string name="description_green_button">Green Button</string>
    <string name="description_blue_button">Blue Button</string>
    <string name="description_eraser">Eraser Button</string>
    <string name="description_top_right_corner">Top Right Corner</string>
    <string name="gender">Votre genre</string>
    <string name="male">Masculin</string>
    <string name="female">Féminin</string>
    <string name="about">A propos</string>
    <string name="description_change_mode_button">Change Mode Button</string>
    <string name="description_settings_button">Settings Button</string>
</resources>


text:
<?php

namespace LEA\ProfBundle\Entity;

class ChoixSansTuteur
{

    protected $etat;
    protected $tuteurRef;
    protected $formationRef;
    protected $altCle;

    /**
     * @return mixed
     */
    public function getEtat()
    {
        return $this->etat;
    }

    /**
     * @param mixed $etat
     */
    public function setEtat($etat)
    {
        $this->etat = $etat;
    }

    /**
     * @return mixed
     */
    public function getTuteurRef()
    {
        return $this->tuteurRef;
    }

    /**
     * @param mixed $tuteurRef
     */
    public function setTuteurRef($tuteurRef)
    {
        $this->tuteurRef = $tuteurRef;
    }

    /**
     * @return mixed
     */
    public function getFormationRef()
    {
        return $this->formationRef;
    }

    /**
     * @param mixed $formationRef
     */
    public function setFormationRef($formationRef)
    {
        $this->formationRef = $formationRef;
    }

    /**
     * @return mixed
     */
    public function getAltCle()
    {
        return array($this->altCle);
    }

    /**
     * @param mixed $altCle
     */
    public function setAltCle(array $altCle)
    {
        $this->altCle = $altCle;
    }

}

redpajama_set_name: RedPajamaGithub


text:
#import "CPTGraphHostingView.h"

#import "CPTGraph.h"
#import "CPTPlotArea.h"
#import "CPTPlotAreaFrame.h"
#import "CPTPlotSpace.h"
#import "NSNumberExtensions.h"

/// @cond
@interface CPTGraphHostingView()

@property (nonatomic, readwrite, cpt_weak_property) __cpt_weak UIPinchGestureRecognizer *pinchGestureRecognizer;

-(void)updateNotifications;
-(void)graphNeedsRedraw:(NSNotification *)notification;
-(void)handlePinchGesture:(UIPinchGestureRecognizer *)aPinchGestureRecognizer;

@end

/// @endcond

#pragma mark -

/**
 *  @brief A container view for displaying a CPTGraph.
 **/
@implementation CPTGraphHostingView

/** @property CPTGraph *hostedGraph
 *  @brief The CPTLayer hosted inside this view.
 **/
@synthesize hostedGraph;

/** @property BOOL collapsesLayers
 *  @brief Whether view draws all graph layers into a single layer.
 *  Collapsing layers may improve performance in some cases.
 **/
@synthesize collapsesLayers;

/** @property BOOL allowPinchScaling
 *  @brief Whether a pinch will trigger plot space scaling.
 *  Default is @YES. This causes gesture recognizers to be added to identify pinches.
 **/
@synthesize allowPinchScaling;

/// @cond

/** @internal
 *  @property __cpt_weak id pinchGestureRecognizer
 *  @brief The pinch gesture recognizer for this view.
 **/
@synthesize pinchGestureRecognizer;

/// @endcond

#pragma mark -
#pragma mark init/dealloc

/// @cond

+(Class)layerClass
{
    return [CALayer class];
}

-(void)commonInit
{
    hostedGraph     = nil;
    collapsesLayers = NO;

    self.backgroundColor = [UIColor clearColor];

    self.allowPinchScaling = YES;

    // This undoes the normal coordinate space inversion that UIViews apply to their layers
    self.layer.sublayerTransform = CATransform3DMakeScale( CPTFloat(1.0), CPTFloat(-1.0), CPTFloat(1.0) );
}

-(id)initWithFrame:(CGRect)frame
{
    if ( (self = [super initWithFrame:frame]) ) {
        [self commonInit];
    }
    return self;
}

-(void)dealloc
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [hostedGraph release];
    [super dealloc];
}

/// @endcond

#pragma mark -
#pragma mark NSCoding methods

/// @cond

-(void)encodeWithCoder:(NSCoder *)coder
{
    [super encodeWithCoder:coder];

    [coder encodeBool:self.collapsesLayers forKey:@"CPTGraphHostingView.collapsesLayers"];
    [coder encodeObject:self.hostedGraph forKey:@"CPTGraphHostingView.hostedGraph"];
    [coder encodeBool:self.allowPinchScaling forKey:@"CPTGraphHostingView.allowPinchScaling"];

    // No need to archive these properties:
    // pinchGestureRecognizer
}

-(id)initWithCoder:(NSCoder *)coder
{
    if ( (self = [super initWithCoder:coder]) ) {
        [self commonInit];

        collapsesLayers  = [coder decodeBoolForKey:@"CPTGraphHostingView.collapsesLayers"];
        self.hostedGraph = [coder decodeObjectForKey:@"CPTGraphHostingView.hostedGraph"]; // setup layers

        if ( [coder containsValueForKey:@"CPTGraphHostingView.allowPinchScaling"] ) {
            self.allowPinchScaling = [coder decodeBoolForKey:@"CPTGraphHostingView.allowPinchScaling"]; // set gesture recognizer if needed
        }
    }
    return self;
}

/// @endcond

#pragma mark -
#pragma mark Touch handling

/// @cond

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    // Ignore pinch or other multitouch gestures
    if ( [[event allTouches] count] > 1 ) {
        return;
    }

    CPTGraph *theHostedGraph = self.hostedGraph;

    theHostedGraph.frame = self.bounds;
    [theHostedGraph layoutIfNeeded];

    CGPoint pointOfTouch = [[[event touchesForView:self] anyObject] locationInView:self];

    if ( self.collapsesLayers ) {
        pointOfTouch.y = self.frame.size.height - pointOfTouch.y;
    }
    else {
        pointOfTouch = [self.layer convertPoint:pointOfTouch toLayer:theHostedGraph];
    }
    [theHostedGraph pointingDeviceDownEvent:event atPoint:pointOfTouch];
}

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
    CPTGraph *theHostedGraph = self.hostedGraph;

    theHostedGraph.frame = self.bounds;
    [theHostedGraph layoutIfNeeded];

    CGPoint pointOfTouch = [[[event touchesForView:self] anyObject] locationInView:self];

    if ( self.collapsesLayers ) {
        pointOfTouch.y = self.frame.size.height - pointOfTouch.y;
    }
    else {
        pointOfTouch = [self.layer convertPoint:pointOfTouch toLayer:theHostedGraph];
    }
    [theHostedGraph pointingDeviceDraggedEvent:event atPoint:pointOfTouch];
}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    CPTGraph *theHostedGraph = self.hostedGraph;

    theHostedGraph.frame = self.bounds;
    [theHostedGraph layoutIfNeeded];

    CGPoint pointOfTouch = [[[event touchesForView:self] anyObject] locationInView:self];

    if ( self.collapsesLayers ) {
        pointOfTouch.y = self.frame.size.height - pointOfTouch.y;
    }
    else {
        pointOfTouch = [self.layer convertPoint:pointOfTouch toLayer:theHostedGraph];
    }
    [theHostedGraph pointingDeviceUpEvent:event atPoint:pointOfTouch];
}

-(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.hostedGraph pointingDeviceCancelledEvent:event];
}

/// @endcond

#pragma mark -
#pragma mark Gestures

/// @cond

-(void)setAllowPinchScaling:(BOOL)allowScaling
{
    if ( allowPinchScaling != allowScaling ) {
        allowPinchScaling = allowScaling;
        if ( allowPinchScaling ) {
            // Register for pinches
            Class pinchClass = NSClassFromString(@"UIPinchGestureRecognizer");
            if ( pinchClass ) {
                pinchGestureRecognizer = [[pinchClass alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
                [self addGestureRecognizer:pinchGestureRecognizer];
                [pinchGestureRecognizer release];
            }
        }
        else {
            if ( pinchGestureRecognizer ) {
                [self removeGestureRecognizer:pinchGestureRecognizer];
            }
            pinchGestureRecognizer = nil;
        }
    }
}

-(void)handlePinchGesture:(UIPinchGestureRecognizer *)aPinchGestureRecognizer
{
    CGPoint interactionPoint = [aPinchGestureRecognizer locationInView:self];
    CPTGraph *theHostedGraph = self.hostedGraph;

    theHostedGraph.frame = self.bounds;
    [theHostedGraph layoutIfNeeded];

    if ( self.collapsesLayers ) {
        interactionPoint.y = self.frame.size.height - interactionPoint.y;
    }
    else {
        interactionPoint = [self.layer convertPoint:interactionPoint toLayer:theHostedGraph];
    }

    CGPoint pointInPlotArea = [theHostedGraph convertPoint:interactionPoint toLayer:theHostedGraph.plotAreaFrame.plotArea];

    for ( CPTPlotSpace *space in theHostedGraph.allPlotSpaces ) {
        if ( space.allowsUserInteraction ) {
            [space scaleBy:[[pinchGestureRecognizer valueForKey:@"scale"] cgFloatValue] aboutPoint:pointInPlotArea];
        }
    }

    [pinchGestureRecognizer setScale:CPTFloat(1.0)];
}

/// @endcond

#pragma mark -
#pragma mark Drawing

/// @cond

-(void)drawRect:(CGRect)rect
{
    if ( self.collapsesLayers ) {
        CGContextRef context = UIGraphicsGetCurrentContext();
        CGContextTranslateCTM(context, 0, self.bounds.size.height);
        CGContextScaleCTM(context, 1, -1);

        CPTGraph *theHostedGraph = self.hostedGraph;
        theHostedGraph.frame = self.bounds;
        [theHostedGraph layoutAndRenderInContext:context];
    }
}

-(void)graphNeedsRedraw:(NSNotification *)notification
{
    [self setNeedsDisplay];
}

/// @endcond

#pragma mark -
#pragma mark Accessors

/// @cond

-(void)updateNotifications
{
    [[NSNotificationCenter defaultCenter] removeObserver:self];

    if ( self.collapsesLayers ) {
        CPTGraph *theHostedGraph = self.hostedGraph;
        if ( theHostedGraph ) {
            [[NSNotificationCenter defaultCenter] addObserver:self
                                                     selector:@selector(graphNeedsRedraw:)
                                                         name:CPTGraphNeedsRedrawNotification
                                                       object:theHostedGraph];
        }
    }
}

-(void)setHostedGraph:(CPTGraph *)newLayer
{
    NSParameterAssert( (newLayer == nil) || [newLayer isKindOfClass:[CPTGraph class]] );

    if ( newLayer == hostedGraph ) {
        return;
    }

    [hostedGraph removeFromSuperlayer];
    hostedGraph.hostingView = nil;
    [hostedGraph release];
    hostedGraph = [newLayer retain];

    // Screen scaling
    UIScreen *screen = [UIScreen mainScreen];
    // scale property is available in iOS 4.0 and later
    if ( [screen respondsToSelector:@selector(scale)] ) {
        hostedGraph.contentsScale = screen.scale;
    }
    else {
        hostedGraph.contentsScale = (CGFloat)1.0;
    }
    hostedGraph.hostingView = self;

    if ( self.collapsesLayers ) {
        [self setNeedsDisplay];
    }
    else {
        if ( hostedGraph ) {
            hostedGraph.frame = self.layer.bounds;
            [self.layer addSublayer:hostedGraph];
        }
    }

    [self updateNotifications];
}

-(void)setCollapsesLayers:(BOOL)collapse
{
    if ( collapse != collapsesLayers ) {
        collapsesLayers = collapse;

        CPTGraph *theHostedGraph = self.hostedGraph;

        if ( collapsesLayers ) {
            [theHostedGraph removeFromSuperlayer];
            [self setNeedsDisplay];
        }
        else {
            if ( theHostedGraph ) {
                [self.layer addSublayer:theHostedGraph];
            }
        }
        [self updateNotifications];
    }
}

-(void)setFrame:(CGRect)newFrame
{
    [super setFrame:newFrame];

    CPTGraph *theHostedGraph = self.hostedGraph;
    [theHostedGraph setNeedsLayout];

    if ( self.collapsesLayers ) {
        [self setNeedsDisplay];
    }
    else {
        theHostedGraph.frame = self.bounds;
    }
}

-(void)setBounds:(CGRect)newBounds
{
    [super setBounds:newBounds];

    CPTGraph *theHostedGraph = self.hostedGraph;
    [theHostedGraph setNeedsLayout];

    if ( self.collapsesLayers ) {
        [self setNeedsDisplay];
    }
    else {
        theHostedGraph.frame = newBounds;
    }
}

/// @endcond

@end


text:
package com.mayreh.kaiyote.misc

package object tap {
  implicit class AnyTap[A](val self: A) extends AnyVal {
    def tap(f: A => Unit): A = {
      f(self)
      self
    }

    def tapMatch(f: PartialFunction[A, Unit]): A = {
      if (f.isDefinedAt(self)) f(self)
      self
    }
  }

  implicit class BooleanTap(val self: Boolean) extends AnyVal {
    def tapTrue(f: => Unit): Boolean = {
      if (self) f
      self
    }

    def tapFalse(f: => Unit): Boolean = {
      if (!self) f
      self
    }
  }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Paleont. Contr. Univ. Kans. 51: 21.

#### Original name
null

### Remarks
null


text:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Filibuster</title> <link rel="stylesheet" href="styles.css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">

Results for "bank_company"

Index

Federal Treasury Trust

Federal Reserve Group

Chemical Cooperative Group

Chemical Reserve Group

Merchant's Cooperative Bank

Merchant's National Trust

Federal Cooperative Trust

Merchant's National Pension Fund

Dow Treasury Pension Fund

Chemical Treasury Pension Fund

Amalgamated National Trust

Amalgamated National Bank

Merchant's Cooperative Trust

Federal Cooperative Trust

Chemical National Trust

Merchant's Treasury Trust

Amalgamated National Bank

Amalgamated Cooperative Bank

Fireman's Treasury Trust

Fireman's Reserve Trust


text:
package org.intellij.plugins.relaxNG.compact.psi.impl;

import javax.annotation.Nonnull;

import org.intellij.plugins.relaxNG.compact.psi.RncElementVisitor;
import org.intellij.plugins.relaxNG.compact.psi.RncGrammar;

import javax.annotation.Nullable;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.impl.meta.MetaRegistry;
import com.intellij.psi.meta.PsiMetaData;
import com.intellij.psi.search.PsiElementProcessor;
import com.intellij.psi.xml.XmlDocument;
import com.intellij.psi.xml.XmlProlog;
import com.intellij.psi.xml.XmlTag;
import com.intellij.xml.XmlNSDescriptor;

public class RncDocument extends RncElementImpl implements XmlDocument {
  public RncDocument(ASTNode node) {
    super(node);
  }

  @Override
  public XmlNSDescriptor getDefaultNSDescriptor(String namespace, boolean strict) {
    return null;
  }

  @Override
  public XmlProlog getProlog() {
    return null;
  }

  @Override
  @Nullable
  public XmlTag getRootTag() {
    return null;
  }

  @Override
  public XmlNSDescriptor getRootTagNSDescriptor() {
    return null;
  }

  @Override
  public boolean processElements(PsiElementProcessor processor, PsiElement place) {
    return false;
  }

  @Override
  @Nullable
  public PsiMetaData getMetaData() {
    return MetaRegistry.getMeta(this);
  }

  public boolean isMetaEnough() {
    return true;
  }

  public RncGrammar getGrammar() {
    return findChildByClass(RncGrammar.class);
  }

  @Override
  @Nonnull
  protected <T> T[] findChildrenByClass(Class<T> aClass) {
    return super.findChildrenByClass(aClass);
  }

  @Override
  public void accept(@Nonnull RncElementVisitor visitor) {
    visitor.visitElement(this);
  }
}


text:
<?php

require_once 'ProjectController.php';

class RelationDatabaseController extends ProjectController {

    var $name = 'relation_database';

   /**
    * before_action
    *
    * @param string $action
    * @return void
    */
    function before_action($action) {
        parent::before_action($action);
        if (!$this->project->value) {
            $this->redirectTo(['controller' => 'project']);
        }
    }

   /**
    * before_rendering
    *
    * @param string $action
    * @return void
    */
    function before_rendering($action) {
    }

    function action_index() {
        $this->redirectTo(['action' => 'list']);;
    }

    function action_cancel() {
        unset($this->session['posts']);
        $this->redirectTo(['action' => 'list']);;
    }

    function action_list() {
        $this->relation_database = DB::model('RelationDatabase')
                                        ->join('Database', 'id', 'old_database_id')
                                        ->join('Project', 'id', 'project_id')
                                        ->all();
    }

    function action_new() {

    }

    function action_edit() {
        $this->relation_database = DB::model('RelationDatabase')->fetch($this->pw_gets['id']);
    }

    function action_add() {
        if (!isPost()) exit;

        DB::model('RelationDatabase')->insert($this->pw_posts['relation_database']);
        $this->redirectTo(['action' => 'list']);;
    }

    function action_update() {
        if (!isPost()) exit;

        $posts = $this->pw_posts['posts'];

        $this->redirectTo(['action' => 'list']);;
    }

    function action_delete() {
        if (!isPost()) exit;

        DB::model('RelationDatabase')->delete($this->pw_gets['id']);
        $this->redirectTo(['action' => 'list']);;
    }

    function action_update_old_table() {
        $relation_database = DB::model('RelationDatabase')
                                        ->join('Database', 'id', 'old_database_id')
                                        ->join('Project', 'id', 'project_id')
                                        ->all();

        $pm_pgsql = $this->database->pgsql();
        $pgsql = new PwPgsql();

        foreach ($relation_database->values as $relation_database) {
            $pgsql->setDBName($relation_database['database_name'])
                  ->setDBHost($relation_database['database_hostname']);

            $old_pg_classes = $pgsql->pgClasses();

            foreach ($old_pg_classes as $old_pg_class) {
                $is_numbering = PwPgsql::isNumberingName($old_pg_class['relname']);
                if (!$is_numbering) {
                    $pgsql->table($old_pg_class['relname']);
                    $table_name = str_replace($_REQUEST['prefix'], '', $old_pg_class['relname']);
                    $table_name = PwFile::pluralToSingular($table_name);
                    $table_name = PwFile::singularToPlural($table_name);

                    $model = DB::model('Model')
                                            ->where("project_id = '{$this->project->value['id']}'")
                                            ->where("name = '{$table_name}'")
                                            ->one();

                    if ($model->value) {
                        $posts = null;
                        $posts['old_name'] = $old_pg_class['relname'];
                        $posts['old_database_id'] = $relation_database['old_database_id'];
                        $model->update($posts);
                    }
                }
            }
        }
        $this->redirectTo(['action' => 'list']);;
    }

    /**
     * update old
     *
     * @return void
     */
    function update_old() {
        $relation_database = DB::model('RelationDatabase')
                                        ->join('Database', 'id', 'old_database_id')
                                        ->join('Project', 'id', 'project_id')
                                        ->all();

        $pm_pgsql = $this->database->pgsql();
        $pgsql = new PwPgsql();

        foreach ($relation_database->values as $relation_database) {
            $pgsql->setDBName($relation_database['database_name'])
                  ->setDBHost($relation_database['database_hostname']);

            $pg_classes = $pgsql->pgClasses();

            foreach ($pg_classes as $pg_class) {
                $is_numbering = PwPgsql::isNumberingName($pg_class['relname']);
                if (!$is_numbering) {
                    $pgsql->table($pg_class['relname']);
                    $table_name = str_replace($_REQUEST['except_table_prefix'], '', $pg_class['relname']);
                    $table_name = PwFile::pluralToSingular($table_name);
                    $table_name = PwFile::singularToPlural($table_name);

                    $model = DB::model('Model')
                                            ->where("project_id = '{$this->project->value['id']}'")
                                            ->where("name = '{$table_name}'")
                                            ->one();

                    if ($model->value) {
                        $posts = null;
                        $posts['old_name'] = $pg_class['relname'];
                        $model->update($posts);

                        $pm_pgsql->table($table_name);
                        if ($pm_pgsql->columns) {
                            $pm_columns = array_keys($pm_pgsql->columns);
                            foreach ($pm_columns as $pm_column) {
                                if (array_key_exists($pm_column, $pgsql->columns)) {
                                    $attribute = DB::model('Attribute')
                                                        ->where('model_id', $model->value['id'])
                                                        ->where('name', $pm_column)
                                                        ->one();

                                    if ($attribute->value) {
                                        $posts = null;
                                        $posts['old_name'] = $pm_column;
                                        $attribute->update($posts);
                                    }

                                }
                            }
                        }
                    }
                }
            }
        }
        $this->redirectTo(['action' => 'list']);;
    }

    function diff_model() {
        $models = $this->project->hasMany('Model')->values;

        foreach ($models as $model) {
            $attributes = DB::model('Attribute')
                                ->where('model_id', $model['id'])
                                ->all()
                                ->values;

            if ($attributes) {
                $this->values[$model['name']]['model'] = $model;
                foreach ($attributes as $attribute) {
                    if (!$attribute['old_name']) {
                        $this->values[$model['name']]['attribute'][] = $attribute;
                    }
                }
            }
        }
    }

}


text:
package com.gmail.zahusek.tinyprotocolapi.packet;

import com.gmail.zahusek.tinyprotocolapi.asm.reflection.ClassAccess;

public abstract class Packet {

	public final Object handle;

	public Packet()
	{ handle = access().newInstance(); }

	public Packet(int index, Object...args)
	{ handle = access().newInstance(index, args); }

	public Object getHandle()
	{ return handle; }

	abstract public ClassAccess access();
}


text:
(function(slap){

	slap.app.controller('CreateCtrl', function ($modalInstance, $scope, fbutil) {
    $scope.slap = emptySlap();
		var slaps = fbutil.syncArray('slaps');

    $scope.cancel = function() {
      $modalInstance.dismiss();
  	};

    $scope.save = function() {
			slaps.$add($scope.slap);
			slaps.$save();
      $modalInstance.close();
    };
	});

  function user() {
    return (slap.user || {}).email || '';
  }

  function emptySlap() {
    return {
      name: '',
      owner: user(),
      pages: []
    };
  }

}(window.slap));


text:
void run(plugin_pipe p, std::string name) {
    // Register for the messages that pertain to the GUI
    p.write(registration_message::create(LIRCH_MSG_PRI_REG_MAX, name, LIRCH_MSG_TYPE_DISPLAY));
    p.write(registration_message::create(LIRCH_MSG_PRI_REG_MAX, name, LIRCH_MSG_TYPE_USERLIST));
    p.write(registration_message::create(LIRCH_MSG_PRI_REG_MAX, name, LIRCH_MSG_TYPE_CHANGED_NICK));
    p.write(registration_message::create(LIRCH_MSG_PRI_REG_MAX, name, LIRCH_MSG_TYPE_SET_CHANNEL));
    p.write(registration_message::create(LIRCH_MSG_PRI_REG_MAX, name, LIRCH_MSG_TYPE_LEAVE_CHANNEL));
    extern LirchClientPipe mediator;
    mediator.open(p, QString::fromStdString(name));

    // The mediator will act as a courier to the GUI
    while (mediator.ready()) {
        // Fetch a message from the pipe whenever it arrives
        message m = p.blocking_read();
        // Determine what type of message it is
        if (m.type == LIRCH_MSG_TYPE_SHUTDOWN) {
            mediator.close(QObject::tr("core shutdown"));
            break;
        } else if (m.type == LIRCH_MSG_TYPE_REG_STAT) {
            // Recieved a registration status message
            auto reg = dynamic_cast<registration_status *>(m.getdata());
            if (reg && !reg->status) {
                int registration_priority = reg->priority;
                // Retry over 9000 times until we succeed
                if (registration_priority < LIRCH_MSG_PRI_REG_MIN) {
                  mediator.close(QObject::tr("failed to register with core"));
                  break;
		} else {
                  // Try again to register, if necessary
                  p.write(registration_message::create(--registration_priority, name, reg->type));
                }
            }
        } else if (m.type == LIRCH_MSG_TYPE_DISPLAY) {
            auto data = dynamic_cast<display_message *>(m.getdata());
            if (data) {
                mediator.display(*data);
            }
            p.write(m.decrement_priority());
        } else if (m.type == LIRCH_MSG_TYPE_USERLIST) {
            auto data = dynamic_cast<userlist_message *>(m.getdata());
            if (data) {
                mediator.userlist(*data);
            }
            p.write(m.decrement_priority());
        } else if (m.type == LIRCH_MSG_TYPE_CHANGED_NICK) {
            auto data = dynamic_cast<changed_nick_message *>(m.getdata());
            if (data) {
                mediator.nick(*data);
            }
            p.write(m.decrement_priority());
	} else if (m.type == LIRCH_MSG_TYPE_SET_CHANNEL) {
            auto data = dynamic_cast<set_channel_message *>(m.getdata());
            if (data) {
                mediator.channel(*data);
            }
            p.write(m.decrement_priority());
	} else if (m.type == LIRCH_MSG_TYPE_LEAVE_CHANNEL) {
            auto data = dynamic_cast<leave_channel_message *>(m.getdata());
            if (data) {
                mediator.channel(*data);
            }
            p.write(m.decrement_priority());
        } else {
            // By default, echo the message with decremented priority
            p.write(m.decrement_priority());
        }
    }

    // We only get here through anomalous behavior (though it is good to have a catch-all)
    if (mediator.ready()) {
        mediator.close();
    }
}


text:
/// \class AliAnalysisTaskPsEfficiency
/// \brief This task fills histograms required to perform the analysis on the light nuclei yield.
///
/// The histograms filled in this tasks are used by the analysis macro
/// ## Monte Carlo
/// There are mainly three items studied here:
/// * the acceptance x efficiency;
/// * the difference of the reconstructed \f$p_{T}\f$ with respect to the MC truth \f$p_{T}\f$
///
/// \author Maximiliano Puccio <maximiliano.puccio@unito.it> and Luca Barioglio <luca.barioglio@unito.it>, University and INFN Torino
/// \date Apr 14, 2017

#ifndef __AliAnalysisTaskPsEfficiency__
#define __AliAnalysisTaskPsEfficiency__

#include <Rtypes.h>
#include "AliAnalysisTaskSE.h"
#include "AliEventCuts.h"
#include "AliPIDResponse.h"
#include "AliPID.h"

class AliVTrack;
class TH2F;
class TList;

class AliAnalysisTaskPsEfficiency : public AliAnalysisTaskSE {
public:
  AliAnalysisTaskPsEfficiency(const char* taskname = "PsEfficiency");
  virtual ~AliAnalysisTaskPsEfficiency();
  virtual void   UserCreateOutputObjects();
  virtual void   UserExec(Option_t *);
  virtual void   Terminate(Option_t *) {}

  AliEventCuts fEventCut;               /// Standard cuts for event selection
  unsigned int fFilterBit;              /// AOD filter bit for the tracks used in this analysis

private:
  AliAnalysisTaskPsEfficiency (const AliAnalysisTaskPsEfficiency&);
  AliAnalysisTaskPsEfficiency& operator=(const AliAnalysisTaskPsEfficiency&) {return *this;}

  bool HasTOF(AliVTrack *track);

  TList                *fList;                      ///<  Output list

  float                fRequireYmin;                ///<  Cut on tracks: mimimum y for the track (using PDG mass)
  float                fRequireYmax;                ///<  Cut on tracks: maximum y for the track (using PDG mass)

  AliPIDResponse       *fPID;                       //!<! PID response class

  // MC only histograms
  TH2F                 *fProduction[2][2];             //!<! *(MC only)* Total number of produced particles [Ps state][Matter-Antimatter]
  TH2F                 *fReconstructed[2][2][3];    //!<! *(MC only)* Positive and negative tracks reconstructed in the acceptance (ITS-TPC,ITS-TPC-TOF,ITS-TPC-(TOF)) [Ps state][Matter-Antimatter][Detector]
  TH2F                 *fTotal[2][2];               //!<! *(MC only)* Positively and negatively charged particles in acceptance : [Ps state][Matter-Antimatter]

  /// \cond CLASSDEF
  ClassDef(AliAnalysisTaskPsEfficiency,1)
  /// \endcond
};

#endif /* defined(__AliAnalysisTaskPsEfficiency__) */


text:
emukit.quadrature.interfaces package
====================================

Module contents
---------------

.. automodule:: emukit.quadrature.interfaces
    :members:
    :undoc-members:
    :show-inheritance:


text:
<?php

namespace App\Http\Middleware\Lead;

use Closure;
use App\Models\Setting;
use App\Models\Lead;

class CanLeadUpdateStatus
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $lead = Lead::findOrFail($request->id);
        $isAdmin = Auth()->user()->hasRole('administrator');

        $settings = Setting::all();
        if ($isAdmin) {
            return $next($request);
        }
        $settingscomplete = $settings[0]['lead_complete_allowed'];
        if ($settingscomplete == 1  && Auth()->user()->id == $lead->fk_user_id_assign) {
            Session()->flash('flash_message_warning', 'Chỉ người thực hiện mới có quyền đóng chỉ đạo!');
            return redirect()->back();
        }
        return $next($request);
    }
}


text:
Lua port written in Rust.

[![Build Status](https://travis-ci.org/ahmedcharles/lua-rs.svg?branch=master)]
(https://travis-ci.org/ahmedcharles/lua-rs)

## Usage

Add this to your `Cargo.toml` (crates.io):

```toml
[dependencies]
lua-rs = "*"
```

or (git):

```toml
[dependencies.lua-rs]
git = "https://github.com/ahmedcharles/lua-rs"
```

and this to your crate root:

```rust
extern crate lua_rs;
```

Get the latest version from [GitHub](https://github.com/ahmedcharles/lua-rs).

```
Copyright (C) 2015 Ahmed Charles - acharles@outlook.com
Distributed under the MIT License.
   (See accompanying file LICENSE.txt or copy at
         http://opensource.org/licenses/MIT)
```


text:
#include <aws/glue/model/WorkflowRun.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace Glue
{
namespace Model
{

WorkflowRun::WorkflowRun() :
    m_nameHasBeenSet(false),
    m_workflowRunIdHasBeenSet(false),
    m_previousRunIdHasBeenSet(false),
    m_workflowRunPropertiesHasBeenSet(false),
    m_startedOnHasBeenSet(false),
    m_completedOnHasBeenSet(false),
    m_status(WorkflowRunStatus::NOT_SET),
    m_statusHasBeenSet(false),
    m_errorMessageHasBeenSet(false),
    m_statisticsHasBeenSet(false),
    m_graphHasBeenSet(false),
    m_startingEventBatchConditionHasBeenSet(false)
{
}

WorkflowRun::WorkflowRun(JsonView jsonValue) :
    m_nameHasBeenSet(false),
    m_workflowRunIdHasBeenSet(false),
    m_previousRunIdHasBeenSet(false),
    m_workflowRunPropertiesHasBeenSet(false),
    m_startedOnHasBeenSet(false),
    m_completedOnHasBeenSet(false),
    m_status(WorkflowRunStatus::NOT_SET),
    m_statusHasBeenSet(false),
    m_errorMessageHasBeenSet(false),
    m_statisticsHasBeenSet(false),
    m_graphHasBeenSet(false),
    m_startingEventBatchConditionHasBeenSet(false)
{
  *this = jsonValue;
}

WorkflowRun& WorkflowRun::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("Name"))
  {
    m_name = jsonValue.GetString("Name");

    m_nameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("WorkflowRunId"))
  {
    m_workflowRunId = jsonValue.GetString("WorkflowRunId");

    m_workflowRunIdHasBeenSet = true;
  }

  if(jsonValue.ValueExists("PreviousRunId"))
  {
    m_previousRunId = jsonValue.GetString("PreviousRunId");

    m_previousRunIdHasBeenSet = true;
  }

  if(jsonValue.ValueExists("WorkflowRunProperties"))
  {
    Aws::Map<Aws::String, JsonView> workflowRunPropertiesJsonMap = jsonValue.GetObject("WorkflowRunProperties").GetAllObjects();
    for(auto& workflowRunPropertiesItem : workflowRunPropertiesJsonMap)
    {
      m_workflowRunProperties[workflowRunPropertiesItem.first] = workflowRunPropertiesItem.second.AsString();
    }
    m_workflowRunPropertiesHasBeenSet = true;
  }

  if(jsonValue.ValueExists("StartedOn"))
  {
    m_startedOn = jsonValue.GetDouble("StartedOn");

    m_startedOnHasBeenSet = true;
  }

  if(jsonValue.ValueExists("CompletedOn"))
  {
    m_completedOn = jsonValue.GetDouble("CompletedOn");

    m_completedOnHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Status"))
  {
    m_status = WorkflowRunStatusMapper::GetWorkflowRunStatusForName(jsonValue.GetString("Status"));

    m_statusHasBeenSet = true;
  }

  if(jsonValue.ValueExists("ErrorMessage"))
  {
    m_errorMessage = jsonValue.GetString("ErrorMessage");

    m_errorMessageHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Statistics"))
  {
    m_statistics = jsonValue.GetObject("Statistics");

    m_statisticsHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Graph"))
  {
    m_graph = jsonValue.GetObject("Graph");

    m_graphHasBeenSet = true;
  }

  if(jsonValue.ValueExists("StartingEventBatchCondition"))
  {
    m_startingEventBatchCondition = jsonValue.GetObject("StartingEventBatchCondition");

    m_startingEventBatchConditionHasBeenSet = true;
  }

  return *this;
}

JsonValue WorkflowRun::Jsonize() const
{
  JsonValue payload;

  if(m_nameHasBeenSet)
  {
   payload.WithString("Name", m_name);

  }

  if(m_workflowRunIdHasBeenSet)
  {
   payload.WithString("WorkflowRunId", m_workflowRunId);

  }

  if(m_previousRunIdHasBeenSet)
  {
   payload.WithString("PreviousRunId", m_previousRunId);

  }

  if(m_workflowRunPropertiesHasBeenSet)
  {
   JsonValue workflowRunPropertiesJsonMap;
   for(auto& workflowRunPropertiesItem : m_workflowRunProperties)
   {
     workflowRunPropertiesJsonMap.WithString(workflowRunPropertiesItem.first, workflowRunPropertiesItem.second);
   }
   payload.WithObject("WorkflowRunProperties", std::move(workflowRunPropertiesJsonMap));

  }

  if(m_startedOnHasBeenSet)
  {
   payload.WithDouble("StartedOn", m_startedOn.SecondsWithMSPrecision());
  }

  if(m_completedOnHasBeenSet)
  {
   payload.WithDouble("CompletedOn", m_completedOn.SecondsWithMSPrecision());
  }

  if(m_statusHasBeenSet)
  {
   payload.WithString("Status", WorkflowRunStatusMapper::GetNameForWorkflowRunStatus(m_status));
  }

  if(m_errorMessageHasBeenSet)
  {
   payload.WithString("ErrorMessage", m_errorMessage);

  }

  if(m_statisticsHasBeenSet)
  {
   payload.WithObject("Statistics", m_statistics.Jsonize());

  }

  if(m_graphHasBeenSet)
  {
   payload.WithObject("Graph", m_graph.Jsonize());

  }

  if(m_startingEventBatchConditionHasBeenSet)
  {
   payload.WithObject("StartingEventBatchCondition", m_startingEventBatchCondition.Jsonize());

  }

  return payload;
}

} // namespace Model
} // namespace Glue
} // namespace Aws


text:
 Improve this doc

   View Source

ngCut

      - directive in module ng

Specify custom behavior on cut event.

Directive Info

This directive executes at priority level 0.

Usage

as attribute:

<window, input, select, textarea, a
  ng-cut="expression">
...
</window, input, select, textarea, a>

Arguments

      Param
      Type
      Details

        ngCut

        expression

Expression to evaluate upon
cut. (Event object is available as $event)

Example

 <input ng-cut="cut=true" ng-init="cut=false; value='cut me'" ng-model="value">
 cut: {{cut}}


text:
package com.example.greatbook.local.model.leancloud;

import com.avos.avoscloud.AVClassName;
import com.avos.avoscloud.AVObject;

/**
 * Created by MDove on 2017/8/25.
 */

@AVClassName("LGroupCollects")
public class LGroupCollects extends AVObject{
    private String belongUserId;
    private String groupObjectId;
    private String collectingUserId;

    public String getCollectingUserId() {
        return getString("collectingUserId");
    }

    public void setCollectingUserId(String collectingUserId) {
        put("collectingUserId",collectingUserId);
    }

    public String getGroupObjectId() {
        return getString("groupObjectId");
    }

    public void setGroupObjectId(String groupObjectId) {
        put("groupObjectId",groupObjectId);
    }

    public String getBelongUserId() {
        return getString("belongUserId");
    }

    public void setBelongUserId(String belongUserId) {
        put("belongUserId",belongUserId);
    }

}


text:
layout: page
title: Wise 55th Anniversary
date: 2016-05-24
author: Henry Li
tags: weekly links, java
status: published
summary: Integer ac porta leo, at sagittis justo.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 12/25/2018
  endDate: 12/29/2018
  ctyhocn: SLEORHX
  groupCode: W5A
published: true
---
In eu quam lobortis lectus tempor ullamcorper. Morbi quis efficitur enim, ac cursus mi. Ut nisi lectus, euismod vel metus a, ultricies aliquet nisi. Sed eget lacus auctor, aliquet sem ut, euismod augue. Curabitur venenatis tincidunt ante, vitae efficitur orci pellentesque vitae. Cras mattis elit vel lacus pulvinar euismod. Cras dapibus sem eu sem aliquam, ac iaculis eros placerat. Maecenas gravida at nibh id condimentum. Mauris ac eros aliquet, porttitor nisl malesuada, dapibus sapien. In tempus pulvinar quam eu molestie. In hac habitasse platea dictumst. Fusce vitae feugiat nunc. Integer vitae quam id orci varius fermentum. Nam et facilisis augue. Aenean aliquam urna nunc.

1 Etiam convallis diam blandit, sagittis magna non, malesuada augue.

Nam tellus elit, vulputate ut ipsum quis, dictum sagittis metus. Suspendisse eget nisi vehicula, pellentesque risus nec, volutpat odio. Pellentesque venenatis leo ante, eu aliquet mauris dictum quis. Nam sit amet risus ut nulla vulputate dignissim gravida id massa. Suspendisse vehicula aliquet lectus nec ullamcorper. Fusce dignissim, dolor sed gravida malesuada, ligula purus eleifend elit, in laoreet neque massa in risus. Mauris fringilla, justo vel pellentesque gravida, sapien lacus luctus lacus, a aliquam sem nisl nec quam.
Interdum et malesuada fames ac ante ipsum primis in faucibus. Praesent id orci blandit, finibus nibh nec, finibus ante. Etiam dapibus dui vitae luctus ultrices. Nam tempor dolor nec ante interdum fringilla. Vivamus mi odio, placerat at arcu vel, vulputate scelerisque turpis. Sed ullamcorper commodo purus, eu laoreet justo tincidunt ac. Nulla in lorem id ante bibendum consectetur.


text:
package org.locationtech.geogig.osm.internal.coordcache;

import org.locationtech.geogig.api.Platform;

public class MapdbPointCacheTest extends PointCacheTest {

    @Override
    protected MapdbPointCache createCache(Platform platform) {
        return new MapdbPointCache(platform);
    }

}


text:
<?php

namespace NetSuite\Classes;

class BudgetExchangeRateList {
    /**
     * @var \NetSuite\Classes\BudgetExchangeRate[]
     */
    public $budgetExchangeRate;
    static $paramtypesmap = array(
        "budgetExchangeRate" => "BudgetExchangeRate[]",
    );
}


text:
/**
 * Suppress closure compiler errors about unknown 'Zone' variable
 * @fileoverview
 * @suppress {undefinedVars,globalThis}
 */

// Hack since TypeScript isn't compiling this for a worker.
declare const WorkerGlobalScope: any;

export const zoneSymbol: (name: string) => string = (n) => `__zone_symbol__${n}`;
const _global: any =
    typeof window === 'object' && window || typeof self === 'object' && self || global;

export function bindArguments(args: any[], source: string): any[] {
  for (let i = args.length - 1; i >= 0; i--) {
    if (typeof args[i] === 'function') {
      args[i] = Zone.current.wrap(args[i], source + '_' + i);
    }
  }
  return args;
}

export function patchPrototype(prototype: any, fnNames: string[]) {
  const source = prototype.constructor['name'];
  for (let i = 0; i < fnNames.length; i++) {
    const name = fnNames[i];
    const delegate = prototype[name];
    if (delegate) {
      prototype[name] = ((delegate: Function) => {
        return function() {
          return delegate.apply(this, bindArguments(<any>arguments, source + '.' + name));
        };
      })(delegate);
    }
  }
}

export const isWebWorker: boolean =
    (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope);

export const isNode: boolean =
    (!('nw' in _global) && typeof process !== 'undefined' &&
     {}.toString.call(process) === '[object process]');

export const isBrowser: boolean =
    !isNode && !isWebWorker && !!(typeof window !== 'undefined' && (window as any)['HTMLElement']);

// we are in electron of nw, so we are both browser and nodejs
export const isMix: boolean = typeof process !== 'undefined' &&
    {}.toString.call(process) === '[object process]' && !isWebWorker &&
    !!(typeof window !== 'undefined' && (window as any)['HTMLElement']);

export function patchProperty(obj: any, prop: string) {
  const desc = Object.getOwnPropertyDescriptor(obj, prop) || {enumerable: true, configurable: true};

  const originalDesc = Object.getOwnPropertyDescriptor(obj, 'original' + prop);
  if (!originalDesc && desc.get) {
    Object.defineProperty(
        obj, 'original' + prop, {enumerable: false, configurable: true, get: desc.get});
  }

  // A property descriptor cannot have getter/setter and be writable
  // deleting the writable and value properties avoids this error:
  //
  // TypeError: property descriptors must not specify a value or be writable when a
  // getter or setter has been specified
  delete desc.writable;
  delete desc.value;

  // substr(2) cuz 'onclick' -> 'click', etc
  const eventName = prop.substr(2);
  const _prop = zoneSymbol('_' + prop);

  desc.set = function(fn) {
    if (this[_prop]) {
      this.removeEventListener(eventName, this[_prop]);
    }

    if (typeof fn === 'function') {
      const wrapFn = function(event: Event) {
        let result;
        result = fn.apply(this, arguments);

        if (result != undefined && !result) event.preventDefault();
      };

      this[_prop] = wrapFn;
      this.addEventListener(eventName, wrapFn, false);
    } else {
      this[_prop] = null;
    }
  };

  // The getter would return undefined for unassigned properties but the default value of an
  // unassigned property is null
  desc.get = function() {
    let r = this[_prop] || null;
    // result will be null when use inline event attribute,
    // such as <button onclick="func();">OK</button>
    // because the onclick function is internal raw uncompiled handler
    // the onclick will be evaluated when first time event was triggered or
    // the property is accessed, https://github.com/angular/zone.js/issues/525
    // so we should use original native get to retrieve the handler
    if (r === null) {
      if (originalDesc && originalDesc.get) {
        r = originalDesc.get.apply(this, arguments);
        if (r) {
          desc.set.apply(this, [r]);
          if (typeof this['removeAttribute'] === 'function') {
            this.removeAttribute(prop);
          }
        }
      }
    }
    return this[_prop] || null;
  };

  Object.defineProperty(obj, prop, desc);
};

export function patchOnProperties(obj: any, properties: string[]) {
  const onProperties = [];
  for (const prop in obj) {
    if (prop.substr(0, 2) == 'on') {
      onProperties.push(prop);
    }
  }
  for (let j = 0; j < onProperties.length; j++) {
    patchProperty(obj, onProperties[j]);
  }
  if (properties) {
    for (let i = 0; i < properties.length; i++) {
      patchProperty(obj, 'on' + properties[i]);
    }
  }
};

const EVENT_TASKS = zoneSymbol('eventTasks');

// For EventTarget
const ADD_EVENT_LISTENER = 'addEventListener';
const REMOVE_EVENT_LISTENER = 'removeEventListener';

export interface NestedEventListener { listener?: EventListenerOrEventListenerObject; }

export declare type NestedEventListenerOrEventListenerObject =
    NestedEventListener | EventListener | EventListenerObject;

export interface ListenerTaskMeta extends TaskData {
  useCapturing: boolean;
  eventName: string;
  handler: NestedEventListenerOrEventListenerObject;
  target: any;
  name: string;
  invokeAddFunc: (addFnSymbol: any, delegate: Task|NestedEventListenerOrEventListenerObject) => any;
  invokeRemoveFunc:
      (removeFnSymbol: any, delegate: Task|NestedEventListenerOrEventListenerObject) => any;
}

function findExistingRegisteredTask(
    target: any, handler: any, name: string, capture: boolean, remove: boolean): Task {
  const eventTasks: Task[] = target[EVENT_TASKS];
  if (eventTasks) {
    for (let i = 0; i < eventTasks.length; i++) {
      const eventTask = eventTasks[i];
      const data = <ListenerTaskMeta>eventTask.data;
      const listener = <NestedEventListener>data.handler;
      if ((data.handler === handler || listener.listener === handler) &&
          data.useCapturing === capture && data.eventName === name) {
        if (remove) {
          eventTasks.splice(i, 1);
        }
        return eventTask;
      }
    }
  }
  return null;
}

function findAllExistingRegisteredTasks(
    target: any, name: string, capture: boolean, remove: boolean): Task[] {
  const eventTasks: Task[] = target[EVENT_TASKS];
  if (eventTasks) {
    const result = [];
    for (let i = eventTasks.length - 1; i >= 0; i--) {
      const eventTask = eventTasks[i];
      const data = <ListenerTaskMeta>eventTask.data;
      if (data.eventName === name && data.useCapturing === capture) {
        result.push(eventTask);
        if (remove) {
          eventTasks.splice(i, 1);
        }
      }
    }
    return result;
  }
  return null;
}

function attachRegisteredEvent(target: any, eventTask: Task, isPrepend: boolean): void {
  let eventTasks: Task[] = target[EVENT_TASKS];
  if (!eventTasks) {
    eventTasks = target[EVENT_TASKS] = [];
  }
  if (isPrepend) {
    eventTasks.unshift(eventTask);
  } else {
    eventTasks.push(eventTask);
  }
}

const defaultListenerMetaCreator = (self: any, args: any[]) => {
  return {
    useCapturing: args[2],
    eventName: args[0],
    handler: args[1],
    target: self || _global,
    name: args[0],
    invokeAddFunc: function(
        addFnSymbol: any, delegate: Task|NestedEventListenerOrEventListenerObject) {
      if (delegate && (<Task>delegate).invoke) {
        return this.target[addFnSymbol](this.eventName, (<Task>delegate).invoke, this.useCapturing);
      } else {
        return this.target[addFnSymbol](this.eventName, delegate, this.useCapturing);
      }
    },
    invokeRemoveFunc: function(
        removeFnSymbol: any, delegate: Task|NestedEventListenerOrEventListenerObject) {
      if (delegate && (<Task>delegate).invoke) {
        return this.target[removeFnSymbol](
            this.eventName, (<Task>delegate).invoke, this.useCapturing);
      } else {
        return this.target[removeFnSymbol](this.eventName, delegate, this.useCapturing);
      }
    }
  };
};

export function makeZoneAwareAddListener(
    addFnName: string, removeFnName: string, useCapturingParam: boolean = true,
    allowDuplicates: boolean = false, isPrepend: boolean = false,
    metaCreator: (self: any, args: any[]) => ListenerTaskMeta = defaultListenerMetaCreator) {
  const addFnSymbol = zoneSymbol(addFnName);
  const removeFnSymbol = zoneSymbol(removeFnName);
  const defaultUseCapturing = useCapturingParam ? false : undefined;

  function scheduleEventListener(eventTask: Task): any {
    const meta = <ListenerTaskMeta>eventTask.data;
    attachRegisteredEvent(meta.target, eventTask, isPrepend);
    return meta.invokeAddFunc(addFnSymbol, eventTask);
  }

  function cancelEventListener(eventTask: Task): void {
    const meta = <ListenerTaskMeta>eventTask.data;
    findExistingRegisteredTask(
        meta.target, eventTask.invoke, meta.eventName, meta.useCapturing, true);
    return meta.invokeRemoveFunc(removeFnSymbol, eventTask);
  }

  return function zoneAwareAddListener(self: any, args: any[]) {
    const data: ListenerTaskMeta = metaCreator(self, args);

    data.useCapturing = data.useCapturing || defaultUseCapturing;
    // - Inside a Web Worker, `this` is undefined, the context is `global`
    // - When `addEventListener` is called on the global context in strict mode, `this` is undefined
    // see https://github.com/angular/zone.js/issues/190
    let delegate: EventListener = null;
    if (typeof data.handler == 'function') {
      delegate = <EventListener>data.handler;
    } else if (data.handler && (<EventListenerObject>data.handler).handleEvent) {
      delegate = (event) => (<EventListenerObject>data.handler).handleEvent(event);
    }
    let validZoneHandler = false;
    try {
      // In cross site contexts (such as WebDriver frameworks like Selenium),
      // accessing the handler object here will cause an exception to be thrown which
      // will fail tests prematurely.
      validZoneHandler = data.handler && data.handler.toString() === '[object FunctionWrapper]';
    } catch (error) {
      // Returning nothing here is fine, because objects in a cross-site context are unusable
      return;
    }
    // Ignore special listeners of IE11 & Edge dev tools, see
    // https://github.com/angular/zone.js/issues/150
    if (!delegate || validZoneHandler) {
      return data.invokeAddFunc(addFnSymbol, data.handler);
    }

    if (!allowDuplicates) {
      const eventTask: Task = findExistingRegisteredTask(
          data.target, data.handler, data.eventName, data.useCapturing, false);
      if (eventTask) {
        // we already registered, so this will have noop.
        return data.invokeAddFunc(addFnSymbol, eventTask);
      }
    }

    const zone: Zone = Zone.current;
    const source = data.target.constructor['name'] + '.' + addFnName + ':' + data.eventName;

    zone.scheduleEventTask(source, delegate, data, scheduleEventListener, cancelEventListener);
  };
}

export function makeZoneAwareRemoveListener(
    fnName: string, useCapturingParam: boolean = true,
    metaCreator: (self: any, args: any[]) => ListenerTaskMeta = defaultListenerMetaCreator) {
  const symbol = zoneSymbol(fnName);
  const defaultUseCapturing = useCapturingParam ? false : undefined;

  return function zoneAwareRemoveListener(self: any, args: any[]) {
    const data = metaCreator(self, args);
    data.useCapturing = data.useCapturing || defaultUseCapturing;
    // - Inside a Web Worker, `this` is undefined, the context is `global`
    // - When `addEventListener` is called on the global context in strict mode, `this` is undefined
    // see https://github.com/angular/zone.js/issues/190
    const eventTask = findExistingRegisteredTask(
        data.target, data.handler, data.eventName, data.useCapturing, true);
    if (eventTask) {
      eventTask.zone.cancelTask(eventTask);
    } else {
      data.invokeRemoveFunc(symbol, data.handler);
    }
  };
}

export function makeZoneAwareRemoveAllListeners(fnName: string, useCapturingParam: boolean = true) {
  const symbol = zoneSymbol(fnName);
  const defaultUseCapturing = useCapturingParam ? false : undefined;

  return function zoneAwareRemoveAllListener(self: any, args: any[]) {
    const target = self || _global;
    if (args.length === 0) {
      // remove all listeners without eventName
      target[EVENT_TASKS] = [];
      // we don't cancel Task either, because call native eventEmitter.removeAllListeners will
      // will do remove listener(cancelTask) for us
      target[symbol]();
      return;
    }
    const eventName = args[0];
    const useCapturing = args[1] || defaultUseCapturing;
    // call this function just remove the related eventTask from target[EVENT_TASKS]
    findAllExistingRegisteredTasks(target, eventName, useCapturing, true);
    // we don't need useCapturing here because useCapturing is just for DOM, and
    // removeAllListeners should only be called by node eventEmitter
    // and we don't cancel Task either, because call native eventEmitter.removeAllListeners will
    // will do remove listener(cancelTask) for us
    target[symbol](eventName);
  };
}

export function makeZoneAwareListeners(fnName: string) {
  const symbol = zoneSymbol(fnName);

  return function zoneAwareEventListeners(self: any, args: any[]) {
    const eventName: string = args[0];
    const target = self || _global;
    if (!target[EVENT_TASKS]) {
      return [];
    }
    return target[EVENT_TASKS]
        .filter((task: Task) => (task.data as any)['eventName'] === eventName)
        .map((task: Task) => (task.data as any)['handler']);
  };
}

const zoneAwareAddEventListener =
    makeZoneAwareAddListener(ADD_EVENT_LISTENER, REMOVE_EVENT_LISTENER);
const zoneAwareRemoveEventListener = makeZoneAwareRemoveListener(REMOVE_EVENT_LISTENER);

export function patchEventTargetMethods(
    obj: any, addFnName: string = ADD_EVENT_LISTENER, removeFnName: string = REMOVE_EVENT_LISTENER,
    metaCreator: (self: any, args: any[]) => ListenerTaskMeta =
        defaultListenerMetaCreator): boolean {
  if (obj && obj[addFnName]) {
    patchMethod(
        obj, addFnName,
        () => makeZoneAwareAddListener(addFnName, removeFnName, true, false, false, metaCreator));
    patchMethod(
        obj, removeFnName, () => makeZoneAwareRemoveListener(removeFnName, true, metaCreator));
    return true;
  } else {
    return false;
  }
}

const originalInstanceKey = zoneSymbol('originalInstance');

// wrap some native API on `window`
export function patchClass(className: string) {
  const OriginalClass = _global[className];
  if (!OriginalClass) return;

  _global[className] = function() {
    const a = bindArguments(<any>arguments, className);
    switch (a.length) {
      case 0:
        this[originalInstanceKey] = new OriginalClass();
        break;
      case 1:
        this[originalInstanceKey] = new OriginalClass(a[0]);
        break;
      case 2:
        this[originalInstanceKey] = new OriginalClass(a[0], a[1]);
        break;
      case 3:
        this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);
        break;
      case 4:
        this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);
        break;
      default:
        throw new Error('Arg list too long.');
    }
  };

  const instance = new OriginalClass(function() {});

  let prop;
  for (prop in instance) {
    // https://bugs.webkit.org/show_bug.cgi?id=44721
    if (className === 'XMLHttpRequest' && prop === 'responseBlob') continue;
    (function(prop) {
      if (typeof instance[prop] === 'function') {
        _global[className].prototype[prop] = function() {
          return this[originalInstanceKey][prop].apply(this[originalInstanceKey], arguments);
        };
      } else {
        Object.defineProperty(_global[className].prototype, prop, {
          set: function(fn) {
            if (typeof fn === 'function') {
              this[originalInstanceKey][prop] = Zone.current.wrap(fn, className + '.' + prop);
            } else {
              this[originalInstanceKey][prop] = fn;
            }
          },
          get: function() {
            return this[originalInstanceKey][prop];
          }
        });
      }
    }(prop));
  }

  for (prop in OriginalClass) {
    if (prop !== 'prototype' && OriginalClass.hasOwnProperty(prop)) {
      _global[className][prop] = OriginalClass[prop];
    }
  }
};

export function createNamedFn(name: string, delegate: (self: any, args: any[]) => any): Function {
  try {
    return (Function('f', `return function ${name}(){return f(this, arguments)}`))(delegate);
  } catch (error) {
    // if we fail, we must be CSP, just return delegate.
    return function() {
      return delegate(this, <any>arguments);
    };
  }
}

export function patchMethod(
    target: any, name: string,
    patchFn: (delegate: Function, delegateName: string, name: string) => (self: any, args: any[]) =>
        any): Function {
  let proto = target;
  while (proto && Object.getOwnPropertyNames(proto).indexOf(name) === -1) {
    proto = Object.getPrototypeOf(proto);
  }
  if (!proto && target[name]) {
    // somehow we did not find it, but we can see it. This happens on IE for Window properties.
    proto = target;
  }
  const delegateName = zoneSymbol(name);
  let delegate: Function;
  if (proto && !(delegate = proto[delegateName])) {
    delegate = proto[delegateName] = proto[name];
    proto[name] = createNamedFn(name, patchFn(delegate, delegateName, name));
  }
  return delegate;
}

export interface MacroTaskMeta extends TaskData {
  name: string;
  target: any;
  callbackIndex: number;
  args: any[];
}

// TODO: @JiaLiPassion, support cancel task later if necessary
export function patchMacroTask(
    obj: any, funcName: string, metaCreator: (self: any, args: any[]) => MacroTaskMeta) {
  let setNative: Function = null;

  function scheduleTask(task: Task) {
    const data = <MacroTaskMeta>task.data;
    data.args[data.callbackIndex] = function() {
      task.invoke.apply(this, arguments);
    };
    setNative.apply(data.target, data.args);
    return task;
  }

  setNative = patchMethod(obj, funcName, (delegate: Function) => function(self: any, args: any[]) {
    const meta = metaCreator(self, args);
    if (meta.callbackIndex >= 0 && typeof args[meta.callbackIndex] === 'function') {
      const task = Zone.current.scheduleMacroTask(
          meta.name, args[meta.callbackIndex], meta, scheduleTask, null);
      return task;
    } else {
      // cause an error by calling it directly.
      return delegate.apply(self, args);
    }
  });
}

export interface MicroTaskMeta extends TaskData {
  name: string;
  target: any;
  callbackIndex: number;
  args: any[];
}

export function patchMicroTask(
    obj: any, funcName: string, metaCreator: (self: any, args: any[]) => MicroTaskMeta) {
  let setNative: Function = null;

  function scheduleTask(task: Task) {
    const data = <MacroTaskMeta>task.data;
    data.args[data.callbackIndex] = function() {
      task.invoke.apply(this, arguments);
    };
    setNative.apply(data.target, data.args);
    return task;
  }

  setNative = patchMethod(obj, funcName, (delegate: Function) => function(self: any, args: any[]) {
    const meta = metaCreator(self, args);
    if (meta.callbackIndex >= 0 && typeof args[meta.callbackIndex] === 'function') {
      const task =
          Zone.current.scheduleMicroTask(meta.name, args[meta.callbackIndex], meta, scheduleTask);
      return task;
    } else {
      // cause an error by calling it directly.
      return delegate.apply(self, args);
    }
  });
}

export function findEventTask(target: any, evtName: string): Task[] {
  const eventTasks: Task[] = target[zoneSymbol('eventTasks')];
  const result: Task[] = [];
  if (eventTasks) {
    for (let i = 0; i < eventTasks.length; i++) {
      const eventTask = eventTasks[i];
      const data = eventTask.data;
      const eventName = data && (<any>data).eventName;
      if (eventName === evtName) {
        result.push(eventTask);
      }
    }
  }
  return result;
}

(Zone as any)[zoneSymbol('patchEventTargetMethods')] = patchEventTargetMethods;
(Zone as any)[zoneSymbol('patchOnProperties')] = patchOnProperties;


text:
<polymer-element name="kb-key" extends="kb-key-base" attributes="image keyCode
    keyName shiftModifier sound stretch weight">
  <template>

      <content></content>

{{hintText}}

  </template>
</polymer-element>

<polymer-element name="kb-abc-key" class="symbol dark" char="Invalid"
    extends="kb-key" weight="125">
</polymer-element>

<polymer-element name="kb-hide-keyboard-key" class="hide-keyboard dark"
    align="center" attributes="showMenu" char="Invalid" extends="kb-key">
</polymer-element>


text:
// --- Dependencies
import * as React from 'react'
import PropTypes from 'prop-types'
import { Link } from 'gatsby'

/**
 * Component
 */

const Button = ({ to, children }) => (
  <Link
    to={to}
    className="fw6 dib link ttu bg-spree-blue pv2 ph3 white br2 lh-copy inline-flex items-center"
  >
    {children}
  </Link>
)

Button.propTypes = {
  to: PropTypes.string.isRequired,
  children: PropTypes.node.isRequired
}

export default Button


text:
FROM maven:3.5.4-jdk-10 as maven
WORKDIR /officefloor
COPY src src
WORKDIR /officefloor/src
RUN mvn -q -N clean install
WORKDIR /officefloor/src/woof_benchmark
RUN mvn -q clean install
WORKDIR /officefloor/src/woof_benchmark_rapidoid
RUN mvn -q clean package

FROM openjdk:10
WORKDIR /officefloor
COPY --from=maven /officefloor/src/woof_benchmark_rapidoid/target/woof_benchmark_rapidoid-1.0.0.jar server.jar
CMD ["java", "-server", "-Xms2g", "-Xmx2g", "-XX:+UseNUMA", "-Dhttp.port=8080", "-Dhttp.server.name=OF", "-Dhttp.date.header=true", "-jar", "server.jar"]


text:
class Rte {
public:
  class Name {
    private:
      std::ostringstream name;
    public:
      const char *operator()(const char *base) {
        name << base << std::hex << this;
        LOG(INFO) << "Rte::Name:" << name.str();
        return name.str().c_str();
      }
  };
  int eal_init(int argc, char **argv) { return rte_eal_init(argc, argv); }
  void exit() { rte_exit(EXIT_FAILURE, "Invalid EAL arguments\n"); }
};

std::ostream& operator<<(std::ostream &o, const struct ether_addr &ether_addr);

template <typename C, typename T>
class ToStringJoiner {
  C &c;
  T &s;
  ToStringJoiner(C &&container, T&& sep)
    : c(std::forward<C>(container))
    , s(std::forward<T>(sep)) {
  }
public:
  template <typename CC, typename TT> friend std::ostream& operator<<(std::ostream &o, ToStringJoiner<CC, TT> const &mj);
  template <typename CC, typename TT> friend ToStringJoiner<CC, TT> join(CC &&container, TT&& sep);
};

template<typename T> T * ptr(T & obj) { return &obj; } //turn reference into pointer!

template<typename T> T * ptr(T * obj) { return obj; } //obj is already pointer, return it!

template<typename C, typename T> std::ostream& operator<<(std::ostream &o, ToStringJoiner<C, T> const &mj) {
  const char *sep = "";
  for (auto i : mj.c) {
        o << sep;
        o << ptr(i)->toString();
        sep = mj.s;
  }
  return o;
}

template<typename C, typename T> ToStringJoiner<C, T> join(C &&container, T&& sep) {
    return ToStringJoiner<C, T>(std::forward<C>(container), std::forward<T>(sep));
}

#endif


text:
package com.hazelcast.core;

import java.util.concurrent.Executor;
import java.util.concurrent.Future;

/**
 * A Future where one can asynchronously listen on completion. This functionality is needed for the
 * reactive programming model.
 *

 * For more information see:
 *
 * https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html
 *

 * This class can be dropped once Hazelcast relies on Java8+. It is added to make Hazelcast compatible
 * with Java6/7.
 *
 * @param <V>
 * @since 3.2
 */
public interface ICompletableFuture<V> extends Future<V> {

    /**
     * Registers a callback that will run after this future is completed. If
     * this future is already completed, it runs immediately.
     *
     *
Please note that there is no ordering guarantee for running multiple
     * callbacks. It is also not guaranteed that the callback will run within
     * the same thread that completes the future.
     *
     * @param callback the callback to execute
     */
    void andThen(ExecutionCallback<V> callback);

    /**
     * Registers a callback that will run with the provided executor after this
     * future is completed. If this future is already completed, it runs
     * immediately. The callback is called using the given {@code executor}.
     *
     * Please note that there is no ordering guarantee for executing multiple
     * callbacks.
     *
     * @param callback the callback to execute
     * @param executor the executor in which the callback will be run
     */
    void andThen(ExecutionCallback<V> callback, Executor executor);
}


text:
An Aliased Schema to test against

## Aliased [/aliased]

### Testing route [GET]

Make sure this is working

+ Response 200 (application/json; charset=utf-8)

  + Schema

              {{ schema 'aliasSchema' }}


text:
#if LESSTHAN_NETCOREAPP20 || LESSTHAN_NETSTANDARD20

namespace System.Runtime.ConstrainedExecution
{
    public enum Cer
    {
        None = 0,
        MayFail = 1,
        Success = 2
    }
}

#endif


text:
using System;
using System.Threading;
using ConcurrencyUtils;

namespace SleepingSanta
{
	/// <summary>
	/// 	The Santa class.
	/// </summary>
	public class Santa: ActiveObject
	{
		private State systemState;

		/// <summary>
		/// Initializes a new instance of the Santa class.
		/// </summary>
		/// <param name="systemState">System state.</param>
		public Santa(State systemState) : base()
		{
			this.systemState = systemState;
		}

		/// <summary>
		/// Execute Santa logic.
		/// </summary>
		protected override void Execute()
		{
			while (true)
			{
				systemState.wakeSanta.Acquire();					// Wait for signal to wake up.
				if (systemState.getReindeerCount() == 9)			// Check if reindeer woke me.
				{
					systemState.clearReindeerCount();

					Console.WriteLine("Santa is preparing the sleigh...");
					Thread.Sleep(State.STD_MESSAGE_DELAY);
					systemState.sleigh.Release(9);					// Signal the reindeer to hitch to the sleigh

					while (systemState.getReindeerCount() != 9){}	// Wait until reindeer are hitched

					Console.WriteLine("Delivering gifts");
					Thread.Sleep(State.STD_MESSAGE_DELAY);

					systemState.clearReindeerCount();
					systemState.holidayPermission.Release(9);		// Allow reindeers to leave for holidays.
				}
				else
				{
					/* Help the waiting elves */
					Console.WriteLine("Santa is helping elves");
					Thread.Sleep(State.STD_MESSAGE_DELAY * 2);
					systemState.elfWaitPermission.Release(3);		// Allow elves to wait.
				}

				Console.WriteLine("Santa is going to sleep...");
			}
		}
	}
}


text:
import { Environment } from "react-relay"
import { commitMutation, graphql } from "relay-runtime"
import RelayModernEnvironment from "relay-runtime/lib/store/RelayModernEnvironment"
import { useSystemContext } from "System"
import {
  useUpdateMyUserProfileMutation,
  UpdateMyProfileInput,
} from "__generated__/useUpdateMyUserProfileMutation.graphql"

interface UseUpdateMyUserProfile {
  relayEnvironment?: RelayModernEnvironment | Environment | undefined
}

export const useUpdateMyUserProfile = ({
  relayEnvironment,
}: UseUpdateMyUserProfile = {}) => {
  const { relayEnvironment: defaultRelayEnvironment } = useSystemContext()

  const submitUpdateMyUserProfile = (input: UpdateMyProfileInput = {}) => {
    return new Promise((resolve, reject) => {
      commitMutation<useUpdateMyUserProfileMutation>(
        (relayEnvironment ?? defaultRelayEnvironment)!,
        {
          onError: reject,
          onCompleted: (res, errors) => {
            if (errors !== null) {
              reject(errors)
              return
            }

            resolve(res)
          },
          mutation: graphql`
            mutation useUpdateMyUserProfileMutation(
              $input: UpdateMyProfileInput!
            ) {
              updateMyUserProfile(input: $input) {
                clientMutationId
              }
            }
          `,
          variables: { input },
        }
      )
    })
  }

  return { submitUpdateMyUserProfile }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     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.
-->

<menu
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <item
        android:id="@+id/menu_first"
        android:icon="@drawable/ic_search"
        android:title="@string/action_bar_search"
        app:iconTint="@color/color_sky_night"
        app:showAsAction="always"/>

    <item
        android:id="@+id/menu_second"
        android:icon="@drawable/ic_media_play"
        android:title="@string/action_bar_add"
        app:iconTint="@color/menu_item_color"
        app:iconTintMode="multiply"
        app:showAsAction="always"/>

    <item
        android:id="@+id/menu_third"
        android:icon="@drawable/ic_media_pause"
        android:title="@string/action_bar_edit"
        app:iconTint="@color/color_sky"
        app:iconTintMode="screen"
        app:showAsAction="always"/>

    <item
        android:id="@+id/menu_fourth"
        android:icon="@android:drawable/ic_menu_share"
        android:title="@string/action_bar_share"/>

    <item
        android:id="@+id/menu_fifth"
        android:icon="@android:drawable/ic_menu_sort_by_size"
        android:title="@string/action_bar_sort"/>

</menu>


text:
#ifndef BACKENDS_EBPF_PSA_EBPFPIPELINE_H_
#define BACKENDS_EBPF_PSA_EBPFPIPELINE_H_

#include "backends/ebpf/ebpfProgram.h"
#include "backends/ebpf/target.h"
#include "ebpfPsaControl.h"
#include "ebpfPsaDeparser.h"

namespace EBPF {

/*
 * EBPFPipeline represents a single eBPF program in the TC/XDP hook.
 */
class EBPFPipeline : public EBPFProgram {
 public:
    // a custom name of eBPF program
    cstring name;
    // eBPF section name, which should a concatenation of `classifier/` + a custom name.
    cstring sectionName;
    // Variable name storing pointer to eBPF packet descriptor (e.g., __sk_buff).
    cstring contextVar;
    // Variable name storing current timestamp retrieved from bpf_ktime_get_ns().
    cstring timestampVar;
    // Variable storing ingress interface index.
    cstring ifindexVar;
    // Variable storing skb->priority value (TC only).
    cstring priorityVar;
    // Variables storing global metadata (packet_path & instance).
    cstring packetPathVar, pktInstanceVar;
    // A name of an internal variable storing global metadata.
    cstring compilerGlobalMetadata;
    // A variable name storing "1" value. Used to access BPF array map index.
    cstring oneKey;
    // A unique mark used to differentiate packets processed by P4/eBPF from others.
    unsigned packetMark;

    EBPFControlPSA* control;
    EBPFDeparserPSA* deparser;

    EBPFPipeline(cstring name, const EbpfOptions& options, P4::ReferenceMap* refMap,
                 P4::TypeMap* typeMap)
        : EBPFProgram(options, nullptr, refMap, typeMap, nullptr),
          name(name),
          control(nullptr),
          deparser(nullptr) {
        sectionName = "classifier/" + name;
        functionName = name.replace("-", "_") + "_func";
        errorEnum = "ParserError_t";
        packetStartVar = cstring("pkt");
        contextVar = cstring("skb");
        lengthVar = cstring("pkt_len");
        endLabel = cstring("deparser");
        timestampVar = cstring("tstamp");
        ifindexVar = cstring("skb->ifindex");
        compilerGlobalMetadata = cstring("compiler_meta__");
        packetPathVar = compilerGlobalMetadata + cstring("->packet_path");
        pktInstanceVar = compilerGlobalMetadata + cstring("->instance");
        priorityVar = cstring("skb->priority");
        oneKey = EBPFModel::reserved("one");
        packetMark = 0x99;
    }

    /* Check if pipeline does any processing.
     * Return false if not. */
    bool isEmpty() const;

    virtual cstring dropReturnCode() {
        if (sectionName.startsWith("xdp")) {
            return "XDP_DROP";
        }

        // TC is the default hookpoint
        return "TC_ACT_SHOT";
    }
    virtual cstring forwardReturnCode() {
        if (sectionName.startsWith("xdp")) {
            return "XDP_PASS";
        }

        // TC is the default hookpoint
        return "TC_ACT_OK";
    }

    virtual void emit(CodeBuilder* builder) = 0;
    virtual void emitTrafficManager(CodeBuilder* builder) = 0;
    virtual void emitPSAControlInputMetadata(CodeBuilder* builder) = 0;
    virtual void emitPSAControlOutputMetadata(CodeBuilder* builder) = 0;

    /* Generates a pointer to struct Headers_t and puts it on the BPF program's stack. */
    void emitLocalHeaderInstancesAsPointers(CodeBuilder* builder);
    /* Generates a pointer to struct hdr_md. The pointer is used to access data from per-CPU map. */
    void emitCPUMAPHeadersInitializers(CodeBuilder* builder);
    /* Generates an instance of struct Headers_t,
     * allocated in the per-CPU map. */
    void emitHeaderInstances(CodeBuilder* builder) override;
    /* Generates a set of helper variables that are used during packet processing. */
    void emitLocalVariables(CodeBuilder* builder) override;

    /* Generates and instance of user metadata for a pipeline,
     * allocated in the per-CPU map. */
    void emitUserMetadataInstance(CodeBuilder* builder);

    virtual void emitCPUMAPInitializers(CodeBuilder* builder);
    virtual void emitCPUMAPLookup(CodeBuilder* builder);
    /* Generates a pointer to skb->cb and maps it to
     * psa_global_metadata to access global metadata shared between pipelines. */
    virtual void emitGlobalMetadataInitializer(CodeBuilder* builder);
    virtual void emitPacketLength(CodeBuilder* builder);
    virtual void emitTimestamp(CodeBuilder* builder);

    void emitHeadersFromCPUMAP(CodeBuilder* builder);
    void emitMetadataFromCPUMAP(CodeBuilder* builder);

    bool hasAnyMeter() const {
        auto directMeter = std::find_if(control->tables.begin(), control->tables.end(),
                                        [](std::pair<const cstring, EBPFTable*> elem) {
                                            return !elem.second->to<EBPFTablePSA>()->meters.empty();
                                        });
        bool anyDirectMeter = directMeter != control->tables.end();
        return anyDirectMeter || (!control->meters.empty());
    }
    /*
     * Returns whether the compiler should generate
     * timestamp retrieved by bpf_ktime_get_ns().
     *
     * This allows to avoid overhead introduced by bpf_ktime_get_ns(),
     * if the timestamp field is not used within a pipeline.
     */
    bool shouldEmitTimestamp() const { return hasAnyMeter() || control->timestampIsUsed; }
};

/*
 * EBPFIngressPipeline represents a hook-independent EBPF-based ingress pipeline.
 * It includes common definitions for TC and XDP.
 */
class EBPFIngressPipeline : public EBPFPipeline {
 public:
    unsigned int maxResubmitDepth;
    // actUnspecCode stores the "undefined action" value.
    // It's returned from eBPF program is PSA-eBPF doesn't make any forwarding/drop decision.
    int actUnspecCode;

    EBPFIngressPipeline(cstring name, const EbpfOptions& options, P4::ReferenceMap* refMap,
                        P4::TypeMap* typeMap)
        : EBPFPipeline(name, options, refMap, typeMap) {
        // FIXME: hardcoded
        maxResubmitDepth = 4;
        // actUnspecCode should not collide with TC/XDP return codes,
        // but it's safe to use the same value as TC_ACT_UNSPEC.
        actUnspecCode = -1;
    }

    void emitSharedMetadataInitializer(CodeBuilder* builder);

    void emit(CodeBuilder* builder) override;
    void emitPSAControlInputMetadata(CodeBuilder* builder) override;
    void emitPSAControlOutputMetadata(CodeBuilder* builder) override;
};

/*
 * EBPFEgressPipeline represents a hook-independent EBPF-based egress pipeline.
 * It includes common definitions for TC and XDP.
 */
class EBPFEgressPipeline : public EBPFPipeline {
 public:
    EBPFEgressPipeline(cstring name, const EbpfOptions& options, P4::ReferenceMap* refMap,
                       P4::TypeMap* typeMap)
        : EBPFPipeline(name, options, refMap, typeMap) {}

    void emit(CodeBuilder* builder) override;
    void emitPSAControlInputMetadata(CodeBuilder* builder) override;
    void emitPSAControlOutputMetadata(CodeBuilder* builder) override;
    void emitCPUMAPLookup(CodeBuilder* builder) override;
};

class TCIngressPipeline : public EBPFIngressPipeline {
 public:
    TCIngressPipeline(cstring name, const EbpfOptions& options, P4::ReferenceMap* refMap,
                      P4::TypeMap* typeMap)
        : EBPFIngressPipeline(name, options, refMap, typeMap) {}

    void emitGlobalMetadataInitializer(CodeBuilder* builder) override;
    void emitTrafficManager(CodeBuilder* builder) override;

 private:
    void emitTCWorkaroundUsingMeta(CodeBuilder* builder);
    void emitTCWorkaroundUsingHead(CodeBuilder* builder);
    void emitTCWorkaroundUsingCPUMAP(CodeBuilder* builder);
};

class TCEgressPipeline : public EBPFEgressPipeline {
 public:
    TCEgressPipeline(cstring name, const EbpfOptions& options, P4::ReferenceMap* refMap,
                     P4::TypeMap* typeMap)
        : EBPFEgressPipeline(name, options, refMap, typeMap) {}

    void emitTrafficManager(CodeBuilder* builder) override;
};
}  // namespace EBPF

#endif /* BACKENDS_EBPF_PSA_EBPFPIPELINE_H_ */


text:
<?php

namespace Core\Validator;

class Route extends \Zend_Validate_Abstract
{
    CONST PATH = 'path';
    CONST UNIQUE = 'unique';

    private $_em;

    protected $_messageTemplates = array(
        self::PATH => "may only contain letters, numbers, dash(-), underscore(_), or forward slash(/)",
        self::UNIQUE => "there is another page with the same url.  a unique url is required."
    );

    public function __construct()
    {
        $this->_em = \Zend_Registry::get('doctrine');
    }

    public function isValid($value, $context = null)
    {
        $this->_context = $context;

        $isValid = true;

        if(!$this->isCorrectFormat($value)) {
            $isValid = false;
        }

        if(!$this->isUnique($value, $context)) {
            $isValid = false;
        }

        return $isValid;
    }

    private function isCorrectFormat($value)
    {
        $isValid = true;

        if(strlen(\preg_replace('/[\w-\/]/', '', $value)) != 0) {
            $isValid = false;
            $this->_error(self::PATH);
        }

        return $isValid;
    }

    private function isUnique($value, $context)
    {
        $isValid = true;

        if (\array_key_exists('currentRoute', $context)) {
            if ($value == $context['currentRoute']) {
                return $isValid;
            }
        }

        $route = $this->_em->getRepository('Core\Model\Route')->findByTemplate($value);
        if (count($route) > 0) {
            $isValid = false;
            $this->_error(self::UNIQUE);
        }

        return $isValid;
    }
}


text:
// Provides default renderer for control sap.ui.commons.HorizontalDivider
sap.ui.define(['jquery.sap.global'],
	function(jQuery) {
	"use strict";

	/**
	 * HorizontalDivider renderer.
	 * @namespace
	 */
	var HorizontalDividerRenderer = {
	};

	/**
	 * Renders the HTML for the given control, using the provided {@link sap.ui.fw.RenderManager}.
	 *
	 * @param {sap.ui.fw.RenderManager} oRenderManager The RenderManager that can be used for writing to the Render-Output-Buffer
	 * @param {sap.ui.fw.Control} oControl An object representation of the control that should be rendered
	 */
	HorizontalDividerRenderer.render = function(oRenderManager, oControl){
		var rm = oRenderManager;
		rm.write("<hr");
		rm.writeControlData(oControl);
		rm.writeAttribute("role", "separator"); //ARIA
		if (oControl.getWidth()) {
			rm.writeAttribute("style", "width:" + oControl.getWidth() + ";");
		}
		rm.addClass("sapUiCommonsHoriDiv");
		rm.addClass(oControl.getType() == "Page" ? "sapUiCommonsHoriDivTypePage" : "sapUiCommonsHoriDivTypeArea");
		switch (oControl.getHeight()) {
			case "Ruleheight":
				rm.addClass("sapUiCommonsHoriDivHeightR");
				break;
			case "Small":
				rm.addClass("sapUiCommonsHoriDivHeightS");
				break;
			case "Large":
				rm.addClass("sapUiCommonsHoriDivHeightL");
				break;
			default:
				rm.addClass("sapUiCommonsHoriDivHeightM");
		}
		rm.writeClasses();
		rm.write("/>");
	};

	return HorizontalDividerRenderer;

}, /* bExport= */ true);


text:
import { Version, Environment, EnvironmentType } from '@microsoft/sp-core-library';
import {
  BaseClientSideWebPart,
  IPropertyPaneConfiguration,
  PropertyPaneTextField,
  PropertyPaneDropdown,
  IPropertyPaneField,
  PropertyPaneLabel,
  IPropertyPaneDropdownOption
} from '@microsoft/sp-webpart-base';
import { findIndex } from '@microsoft/sp-lodash-subset';

import Vue from 'vue';
import TodoComponent from './components/todo/Todo.vue';
import { ITodoProps } from './components/todo/ITodoProps';

import * as strings from 'toDoStrings';
import { ITodoWebPartProps } from './ITodoWebPartProps';

import ITodoDataProvider from '../../dataProviders/ITodoDataProvider';
import MockDataProvider from '../../dataProviders//MockDataProvider';
import SharePointDataProvider from '../../dataProviders/SharePointDataProvider';
import { ITaskList } from '../../models/ICommonObjects';
import { Utils } from '../../common/Utils';
export default class TodoWebPart extends BaseClientSideWebPart<ITodoWebPartProps> {

  private _data: ITodoProps;
  private _dropdownOptions: IPropertyPaneDropdownOption[];
  private _dataProvider: ITodoDataProvider;
  private _selectedList: ITaskList;

  private _disableDropdown: boolean;

  protected onInit(): Promise<void> {

    this.context.statusRenderer.displayLoadingIndicator(this.domElement, "Todo");

    /*
    Create the appropriate data provider depending on where the web part is running.
    The DEBUG flag will ensure the mock data provider is not bundled with the web part when you package the solution for distribution, that is, using the --ship flag with the package-solution gulp command.
    */
    if (DEBUG && Environment.type === EnvironmentType.Local) {
      this._dataProvider = new MockDataProvider();
    } else {
      this._dataProvider = new SharePointDataProvider();
      this._dataProvider.webPartContext = this.context;
    }

    /*
      If we have serialized list in the webpart properties, use it
    */
    if (this.properties.SelectedList) {
      this._dataProvider.selectedList = this.properties.SelectedList;
    }

    /*
      Approach 1:
       Get the list of tasks lists from the current site and store them in the variable _dropdownOptions
       _dropdownOptions will be used to populate the property pane dropdown field when pane opens.

       Approach 2:
      Get the list of tasks lists from the current site and load them in the property pane only when the property pane is open.
      For this approach please review the sample: react-custompropertypanecontrols

    */
    this._loadTaskLists()
      .then(() => {
        /*
         If a list is already selected, then we would have stored the list Id in the associated web part property.
         So, check to see if we do have a selected list for the web part. If we do, then we set that as the selected list
         in the property pane dropdown field.
        */
        if (this.properties.SelectedList) {
          this._setSelectedList(this.properties.SelectedList.Id);
          this.context.statusRenderer.clearLoadingIndicator(this.domElement);
        }
      });

    return super.onInit();
  }

  public render(): void {

    this.domElement.innerHTML = `
      <div id="app-${this.context.instanceId}">
      </div>`;

    this._data = {
      dataProvider: this._dataProvider,
      webPartDisplayMode: this.displayMode
    };

    // tslint:disable-next-line:no-unused-expression
    new Vue({
      el: `#app-${this.context.instanceId}`,
      render: h => h(TodoComponent, {
        props: this._data
      })
    });

  }

  protected get dataVersion(): Version {
    return Version.parse('1.0');
  }

  protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
    return {
      pages: [
        {
          header: {
            description: strings.PropertyPaneDescription
          },
          groups: [
            {
              groupName: strings.BasicGroupName,
              groupFields: [
                PropertyPaneDropdown('selectedList', {
                  label: "Select a list",
                  disabled: this._disableDropdown,
                  options: this._dropdownOptions
                })
              ]
            }
          ]
        }
      ]
    };
  }

  protected onPropertyPaneFieldChanged(propertyPath: string, oldValue: any, newValue: any): void {
    /*
    Check the property path to see which property pane feld changed.
    If the property path matches the dropdown, then we set that list as the selected list for the web part.
    */
    if (propertyPath === 'selectedList') {
      this._setSelectedList(newValue);
    }

    /*
    Tell property pane to re-render the web part.
    This is valid for reactive property pane.
    */
    super.onPropertyPaneFieldChanged(propertyPath, oldValue, newValue);
  }

  private _loadTaskLists(): Promise<any> {
    return this._dataProvider.getTaskLists()
      .then((taskLists: ITaskList[]) => {
        // Disable dropdown field if there are no results from the server.
        this._disableDropdown = taskLists.length === 0;
        let utiility: Utils = new Utils();
        if (taskLists.length !== 0) {
          this._dropdownOptions = taskLists.map((list: ITaskList) => {
            return {
              key: utiility.GetKeyFroDropdown(list),
              text: list.Title
            };
          });
        }
      });
  }

  private _setSelectedList(value: string) {

    const selectedIndex: number = findIndex(this._dropdownOptions,
      (item: IPropertyPaneDropdownOption) => item.key === value
    );

    const selectedDropDownOption: IPropertyPaneDropdownOption = this._dropdownOptions[selectedIndex];
    let utiility: Utils = new Utils();

    if (selectedDropDownOption) {
      this._selectedList = {
        Title: selectedDropDownOption.text,
        Id: utiility.GetListId(selectedDropDownOption),
        ListItemEntityTypeFullName: utiility.GetListItemEntityType(selectedDropDownOption)
      };

      this._dataProvider.selectedList = this._selectedList;

      this.properties.SelectedList = this._selectedList;
    }
  }

}


text:
@lombok.Data @lombok.Getter class DataWithGetter {
  private int x;
  private int y;
  private final String z;
  public @java.lang.SuppressWarnings("all") void setX(final int x) {
    this.x = x;
  }
  public @java.lang.SuppressWarnings("all") void setY(final int y) {
    this.y = y;
  }
  public @java.lang.Override @java.lang.SuppressWarnings("all") boolean equals(final java.lang.Object o) {
    if ((o == this))
        return true;
    if ((! (o instanceof DataWithGetter)))
        return false;
    final DataWithGetter other = (DataWithGetter) o;
    if ((! other.canEqual((java.lang.Object) this)))
        return false;
    if ((this.getX() != other.getX()))
        return false;
    if ((this.getY() != other.getY()))
        return false;
    final java.lang.Object this$z = this.getZ();
    final java.lang.Object other$z = other.getZ();
    if (((this$z == null) ? (other$z != null) : (! this$z.equals(other$z))))
        return false;
    return true;
  }
  protected @java.lang.SuppressWarnings("all") boolean canEqual(final java.lang.Object other) {
    return (other instanceof DataWithGetter);
  }
  public @java.lang.Override @java.lang.SuppressWarnings("all") int hashCode() {
    final int PRIME = 59;
    int result = 1;
    result = ((result * PRIME) + this.getX());
    result = ((result * PRIME) + this.getY());
    final java.lang.Object $z = this.getZ();
    result = ((result * PRIME) + (($z == null) ? 43 : $z.hashCode()));
    return result;
  }
  public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() {
    return (((((("DataWithGetter(x=" + this.getX()) + ", y=") + this.getY()) + ", z=") + this.getZ()) + ")");
  }
  public @java.lang.SuppressWarnings("all") DataWithGetter(final String z) {
    super();
    this.z = z;
  }
  public @java.lang.SuppressWarnings("all") int getX() {
    return this.x;
  }
  public @java.lang.SuppressWarnings("all") int getY() {
    return this.y;
  }
  public @java.lang.SuppressWarnings("all") String getZ() {
    return this.z;
  }
}


text:
package org.wso2.carbon.am.tests.rest;

import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.wso2.carbon.am.tests.APIManagerIntegrationTest;
import org.wso2.carbon.automation.core.utils.HttpRequestUtil;
import org.wso2.carbon.automation.core.utils.HttpResponse;
import org.wso2.carbon.automation.utils.httpclient.HttpURLConnectionClient;

import java.io.*;
import java.net.URL;

/**
 * Related to Patch Automation  https://wso2.org/jira/browse/APIMANAGER-769
 * This test class test the Rest URI template patterns like uri-template="/view/*"
 */
public class URLMappingRESTTestCase extends APIManagerIntegrationTest {

    @BeforeClass(alwaysRun = true)
    public void init() throws Exception {
        super.init();
        loadESBConfigurationFromClasspath("artifacts" + File.separator + "AM"
                + File.separator + "synapseconfigs" + File.separator + "rest"
                + File.separator + "url-mapping-synapse.xml");
    }

    @Test(groups = {"wso2.am"}, description = "Sending a Message Via REST to test uri template fix")
    public void testRESTURITemplate() throws Exception {
        // Before apply this patch uri template not recognize localhost:8280/stockquote/test/ and localhost:8280/stockquote/test
        //maps to same resource. It will return correct response only if request hits localhost:8280/stockquote/test
        //after fixing issue both will work.
        HttpResponse response = HttpRequestUtil.sendGetRequest(getApiInvocationURLHttp("stockquote") + "/test/", null);
//        HttpResponse response = HttpRequestUtil.sendGetRequest(getApiInvocationURLHttp("stockquote") + "/test/", null);
        Assert.assertEquals(response.getResponseCode(), 200, "Response code mismatch");
    }

    @AfterClass(alwaysRun = true)
    public void destroy() throws Exception {
        super.cleanup();
    }
}