text:
var PixiBitmapText = require('../../lib/pixi/src/extras/BitmapText'),
    Container = require('./Container'),
    Sprite = require('./Sprite'),
    utils = require('../core/utils'),
    math = require('../../lib/pixi/src/core/math'),
    CONST = require('../core/const');

function BitmapText(text, style){
    this._init(text, style);
}

BitmapText.prototype = Object.create(PixiBitmapText.prototype);
BitmapText.prototype.constructor = BitmapText;

BitmapText.prototype.containerUpdateTransform = Container.prototype.updateTransform;
BitmapText.prototype.displayObjectUpdateTransform = Container.prototype.displayObjectUpdateTransform;

BitmapText.prototype._init = function(text, style){
    text = text || ' ';
    this.wordWrap = style.wordWrap || false;
    this.wordWrapWidth = style.wordWrapWidth || 100;

    this.anchor = new math.Point(0.5, 0.5);
    this.pivot = new math.Point(0.5,0.5);
    this.speed = new math.Point();

    PixiBitmapText.call(this, text, style);
};

BitmapText.prototype.setStyle = function(style){
    if(style.font)this.font = style.font;
    if(style.align)this.align = style.align;
    if(style.tint)this.tint = style.tint;
    this.wordWrap = style.wordWrap || false;
    this.wordWrapWidth = style.wordWrapWidth || 100;

    this.dirty = true;
    return this;
};

BitmapText.prototype.setText = function(text, keys){
    if(keys)text = utils.parseTextKeys(text, keys);
    this.text = text;
    return this;
};

BitmapText.prototype.setWordWrap = function(value){
    if(value === false){
        this.wordWrap = value;
    }else{
        this.wordWrap = true;
        this.wordWrapWidth = value;
    }

    this.dirty = true;
    return this;
};

BitmapText.prototype.updateText = function (){
    var data = BitmapText.fonts[this._font.name];
    var pos = new math.Point();
    var prevCharCode = null;
    var chars = [];
    var lastLineWidth = 0;
    var maxLineWidth = 0;
    var lineWidths = [];
    var line = 0;
    var scale = this._font.size / data.size;
    var lastSpace = -1;

    var outputText = this.wordWrap ? wordWrap(this.text, this.wordWrapWidth, this._font) : this.text;

    for (var i = 0; i < outputText.length; i++)
    {
        var charCode = outputText.charCodeAt(i);
        lastSpace = /(\s)/.test(outputText.charAt(i)) ? i : lastSpace;

        if (/(?:\r\n|\r|\n)/.test(outputText.charAt(i)))
        {
            lineWidths.push(lastLineWidth);
            maxLineWidth = Math.max(maxLineWidth, lastLineWidth);
            line++;

            pos.x = 0;
            pos.y += data.lineHeight;
            prevCharCode = null;
            continue;
        }

        if (lastSpace !== -1 && this.maxWidth > 0 && pos.x * scale > this.maxWidth)
        {
            chars.splice(lastSpace, i - lastSpace);
            i = lastSpace;
            lastSpace = -1;

            lineWidths.push(lastLineWidth);
            maxLineWidth = Math.max(maxLineWidth, lastLineWidth);
            line++;

            pos.x = 0;
            pos.y += data.lineHeight;
            prevCharCode = null;
            continue;
        }

        var charData = data.chars[charCode];

        if (!charData)
        {
            continue;
        }

        if (prevCharCode && charData.kerning[prevCharCode])
        {
            pos.x += charData.kerning[prevCharCode];
        }

        chars.push({texture:charData.texture, line: line, charCode: charCode, position: new math.Point(pos.x + charData.xOffset, pos.y + charData.yOffset)});
        lastLineWidth = pos.x + (charData.texture.width + charData.xOffset);
        pos.x += charData.xAdvance;

        prevCharCode = charCode;
    }

    lineWidths.push(lastLineWidth);
    maxLineWidth = Math.max(maxLineWidth, lastLineWidth);

    var lineAlignOffsets = [];

    for (i = 0; i <= line; i++)
    {
        var alignOffset = 0;

        if (this._font.align === 'right')
        {
            alignOffset = maxLineWidth - lineWidths[i];
        }
        else if (this._font.align === 'center')
        {
            alignOffset = (maxLineWidth - lineWidths[i]) / 2;
        }

        lineAlignOffsets.push(alignOffset);
    }

    var lenChars = chars.length;
    var tint = this.tint;

    for (i = 0; i < lenChars; i++)
    {
        var c = this._glyphs[i]; // get the next glyph sprite

        if (c)
        {
            c.texture = chars[i].texture;
        }
        else
        {
            c = new Sprite(chars[i].texture);
            this._glyphs.push(c);
        }

        c.anchor.x = 0;
        c.anchor.y = 0;
        c.position.x = (chars[i].position.x + lineAlignOffsets[chars[i].line]) * scale;
        c.position.y = chars[i].position.y * scale;
        c.scale.x = c.scale.y = scale;
        c.tint = tint;

        if (!c.parent)
        {
            this.addChild(c);
        }
    }

    // remove unnecessary children.
    for (i = lenChars; i < this._glyphs.length; ++i)
    {
        this.removeChild(this._glyphs[i]);
    }

    this.textWidth = maxLineWidth * scale;
    this.textHeight = (pos.y + data.lineHeight) * scale;
};

Object.defineProperties(BitmapText.prototype, {
    font: {
        get: function ()
        {
            return this._font;
        },
        set: function (value)
        {
            if (typeof value === 'string') {
                value = value.split(' ');

                this._font.name = value.length === 1 ? value[0] : value.slice(1).join(' ');
                this._font.size = value.length >= 2 ? parseInt(value[0], 10) : BitmapText.fonts[this._font.name].size;
            }
            else {
                this._font.name = value.name;
                this._font.size = typeof value.size === 'number' ? value.size : parseInt(value.size, 10);
            }

            this.dirty = true;
        }
    }
});

BitmapText.fonts = {};
module.exports = BitmapText;

function wordWrap(text, width, font){
    var result = '';
    var lines = text.split('\n');
    for (var i = 0; i < lines.length; i++)
    {
        var spaceLeft = width;
        var words = lines[i].split(' ');
        for (var j = 0; j < words.length; j++)
        {

            var wordData = getWordWidth(words[j], font);
            var wordWidth = wordData.wordWidth;
            var wordWidthWithSpace = wordWidth + wordData.spaceWidth;

            if(j === 0 || wordWidthWithSpace > spaceLeft)
            {
                // Skip printing the newline if it's the first word of the line that is
                // greater than the word wrap width.
                if(j > 0)
                {
                    result += '\n';
                }
                result += words[j];
                spaceLeft = width - wordWidth;
            }
            else
            {
                spaceLeft -= wordWidthWithSpace;
                result += ' ' + words[j];
            }
        }

        if (i < lines.length-1)
        {
            result += '\n';
        }
    }
    return result;
}

function getWordWidth(word, font){
    var data = BitmapText.fonts[font.name];
    var scale = font.size / data.size;
    var prevCharCode = null;
    var ww = 0;
    var charCode, charData;

    for(var i = 0; i < word.length; i++){
        charCode = word.charCodeAt(i);
        charData = data.chars[charCode];
        if(!charData) continue;

        if(prevCharCode && charData.kerning[prevCharCode])
        {
            ww += charData.kerning[prevCharCode];
        }

        ww += charData.xAdvance;

        prevCharCode = charCode;
    }

    var spaceWidth = 0;
    charData = data.chars[(' ').charCodeAt(0)];
    if(prevCharCode && charData.kerning[prevCharCode])
    {
        spaceWidth += charData.kerning[prevCharCode];
    }
    spaceWidth += charData.xAdvance;
    return {
        wordWidth : ww*scale,
        spaceWidth: spaceWidth*scale
    };
}

//TODO: IMPORTANTE getLocalBounds no devuelve height, por es complicado setear anchors o medir para maquetar


text:
/** @lends jDoc.engines.OXML.prototype */
jDoc.engines.OXML.prototype._parseEmphasis = function (attribute) {
    var result = "";

    if (attribute) {
        switch (attribute.value) {
            case "dot":
                result = "dotted";
                break;
            case "comma":
                result = "comma";
                break;
            case "circle":
                result = "circle";
                break;
            case "underDot":
                result = "underDotted";
                break;
        }
    }
    return result;
};

redpajama_set_name: RedPajamaGithub


text:
Upon a signup of a new user to a website with any social credential, we want to:

1. Record a __SignUp__ event on [MixPanel](https://mixpanel.com).
2. __Augment the user profile__ with additional public information through [FullContact](http://www.fullcontact.com/).
3. Record the new signup as a __New Lead__ on [Salesforce](http://www.salesforce.com/) for follow-up.

Implementing this with Auth0 is very easy. You just need 3 [Rules](/rules) in your pipeline:

![](https://docs.google.com/drawings/d/16Xz2h0OaNDyGUCmV_NCTjzL38jetrZEmDVdUBd9jJcA/pub?w=869&h=377)

### 1. Recording a __SignUp__ in MixPanel:

This first rule checks whether the user has already signed up before or not. If he has, it simply skips everything. If not, it calls __MixPanel__ to record the event. In the example below we are simply using a property `application` that you can then use in MixPanel to filter information. But the full `context` and `user` properties are available as sources of more information (e.g. IP addresses, agent, etc.).

We also call this event `Sign Up`:

```
function (user, context, callback) {

  if(user.signedUp) return callback(null,user,context);

  var mixPanelEvent = {
    "event": "Sign Up",
    "properties": {
        "distinct_id": user.user_id,
        "token": YOUR_MIXPANEL_TOKEN,
        "application": context.clientName
    }
  };

  var base64Event = new Buffer(JSON.stringify(mixPanelEvent)).toString('base64');

  request('http://api.mixpanel.com/track/?data=' + base64Event,
           function(e,r,b){
              	if(e) return callback(e);
                return callback(null,user,context);
              });
}

```

### 2.Augment __User Profile__ with FullContact:

The 2nd step is to obtain more information about this user using his email address. __FullContact__ provides an API to retrieve public information about a user using the email as input. We store this additional information in a property called `fullContactInfo`:

>Note we are ignoring certain conditions that exist in the API and only doing this when there's a successful call (`statusCode=200`).

```
function (user, context, callback) {

  if(user.signedUp) return callback(null,user,context);

  var fullContactAPIKey = 'YOUR FULLCONTACT API KEY';

  if(user.email){
    request('https://api.fullcontact.com/v2/person.json?email=' + encodeURIComponent(user.email) + '&apiKey=' + fullContactAPIKey,
            function(e,r,b){
              if(e) return callback(e);
              if(r.statusCode===200){
                user.fullContactInfo = JSON.parse(b);
              }
              return callback(null, user, context);
            });
  }
  else{
    return callback(null, user, context);
  }
}
```

### 3.Create a __New Lead__ in Salesforce:

In the last step we record the information as a __New Lead__ in Salesforce, so the sales department can followup. This __Rule__ has some interesting things:

1. The Salesforce REST API uses an OAuth `access_token`. We are using the OAuth2 `Resource Owner Password Credential Grant` to obtain such `access_token`. This is the `getToken` function hat uses credentials as input as opposed to an `API-KEY` as the previous rules.
2. We are just recording the user name and a fixed company name. We would of course us anything available in the enriched user profile we obtained in step 2, to record more information and have better context for the sales representative.
3. If everything went well, we use a __persistent__ property: `user.signedUp` and set it to `true`. So next time this same users logs in, none of these rules will do anything.

```
function (user, context, callback) {

  if(user.signedUp) return callback(null,user,callback);

  getAccessToken(SFCOM_CLIENT_ID, SFCOM_CLIENT_SECRET, USERNAME, PASSWORD,
            function(e,r){
                    if( e ) return callback(e);

                    createLead(r.instance_url, r.access_token, function(e,result){
                        if(e) return callback(e);
              			    //Everyhting worked fine. We signal this signup was succesful.
                        user.persistent.signedUp = true;
                        return callback(null,user,context);
                    });
                });

  function createLead(url,access_token, callback){

    //Just a few fields. The Lead object is much richer
    var data = {
        LastName: user.name,
        Company: 'Web channel signups'
    };

    request.post({
        url: url + "/services/data/v20.0/sobjects/Lead/",
        headers: {
            "Authorization": "OAuth " + access_token,
            "Content-type": "application/json"
        },
        body: JSON.stringify(data)
        }, function(e,r,b){
            if(e) return callback(e);
            return callback(null,b);
        });
  }

  function getAccessToken(client_id, client_secret, username, password, callback){
    request.post({
        url: 'https://login.salesforce.com/services/oauth2/token',
        form: {
            grant_type: 'password',
            client_id: client_id,
            client_secret: client_secret,
            username: username,
            password: password
        }}, function(e,r,b){
            if(e) return callback(e);
            return callback(null,JSON.parse(b));
        });
  }
}
```

Check out our [repository of Auth0 Rules](https://github.com/auth0/rules) for more great examples:

* Rules for access control
* Integration with other services: [Firebase](http://firebase.com), [Rapleaf](http://rapleaf.com)


text:
[![Build Status](https://travis-ci.org/falsecz/beer-script.png?branch=master)](undefined)

                                      ____
                                     |  _ \
     .- ----------- -.               | |_) | ___  ___ _ __
    (  (.} {.} {.} }  )              |  _ < / _ \/ _ \ '__|
    |`-..________ ..-'|              | |_) |  __/  __/ |
    |                 |              |____/ \___|\___|_|
    |                 ;--.
    |                (__  \            _____           _       _
    |                 | )  )          / ____|         (_)     | |
    |                 |/  /          | (___   ___ _ __ _ _ __ | |_
    |                 (  /            \___ \ / __| '__| | '_ \| __|
    |                 |/              ____) | (__| |  | | |_) | |_
    |                 |              |_____/ \___|_|  |_| .__/ \__|
     `-.._________..-'                                  | |
                                                        |_|

  * support for @_private
  * support for @[$private + 'private']
  * support for goog.provide via --goog switch
  * include goog.dom as dom via --goog switch
  * auto include base class
  * support for enumeration
  * support for uses (mixins) [experimental]

```coffee
include goog.dom as dom
include builder.ui.Component as bui

class builder.ui.ColumnLayout extends goog.ui.Component
  constructor: ->
    dom.getElementByClass 'xxx'

enumeration builder.ui.ColumnLayout.ORIENTATION
   VERTICAL: 'vertical'
   HORIZONTAL: 'horizontal'

class builder.ui.Tree extends goog.ui.Component uses builder.mixins.repository

```

```javascript
goog.provide('builder.ui.ColumnLayout');
goog.provide('builder.ui.ColumnLayout.ORIENTATION');

goog.require('builder.ui.Component');
goog.require('goog.dom');

goog.scope(function () {
    var bui = builder.ui.Component;
    var dom = goog.dom;

    builder.ui.ColumnLayout = (function (_super) {
        var $private;

        __extends(ColumnLayout, _super);

        $private = '$builder_ui_ColumnLayout_';

        function ColumnLayout() {
            dom.getElementByClass('xxx');
        }

        return ColumnLayout;

    })(goog.ui.Component);

    builder.ui.ColumnLayout.ORIENTATION = {
        VERTICAL: 'vertical',
        HORIZONTAL: 'horizontal'
    };

}); // close goog.scope()
```

  ----------------------------------------------------------------

  CoffeeScript is a little language that compiles into JavaScript.

  Install Node.js, and then the CoffeeScript compiler:
  sudo bin/cake install

  Or, if you have the Node Package Manager installed:
  npm install -g coffee-script
  (Leave off the -g if you don't wish to install globally.)

  Execute a script:
  coffee /path/to/script.coffee

  Compile a script:
  coffee -c /path/to/script.coffee

  For documentation, usage, and examples, see:
  http://coffeescript.org/

  To suggest a feature, report a bug, or general discussion:
  http://github.com/jashkenas/coffee-script/issues/

  If you'd like to chat, drop by #coffeescript on Freenode IRC,
  or on webchat.freenode.net.

  The source repository:
  git://github.com/jashkenas/coffee-script.git

  All contributors are listed here:
  http://github.com/jashkenas/coffee-script/contributors


text:
Product Details

Images

Attributes

Discounts

	<form>

Global Details

		    Name:
		    <input type="text" name="details_name" value="" />
		    SKU:
		    <input type="text" name="details_sku" value="" />
		    Warehouse Location:
		    <select name="details_warehouse">
			<option>Charolette, NC</option>
		    </select>
		    Manufacturer:
		    <select name="details_manufacturer">
			<option>American Apparel</option>
		    </select>

		    Quantity In Stock:
		    <input type="text" name="details_stockqty" value="" />
		    Wholesale Price:

			$<input type="text" name="details_wholesaleprice" value="" />

		    Tax Rule:
		    <select name="details_taxrule">
			<option>Connecticut - 6%</option>
		    </select>
		    Retail Price:

			$<input type="text" name="details_retailprice" value="" />

		    Unit Price:

			    $<input type="text" name="details_unitprice" value="" class="span8" />

			    per<input type="text" name="details_unitpriceper" value="" class="span8" />

		    Tags

Package Info

			    <input type="text" name="details_unitpriceper" value="" class="span6" />
			    IN

			    <input type="text" name="details_unitpriceper" value="" class="span6" />
			    IN

			    <input type="text" name="details_unitpriceper" value="" class="span6" />
			    IN

			    <input type="text" name="details_unitpriceper" value="" class="span6" />
			    lbs

Options

Details

Attachments

	</form>

...

...

...


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Deprecated List (appsensor-parent 2.2.0 API)</title>
<meta name="date" content="2015-10-02">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Deprecated API

Contents

Copyright © 2015 The Open Web Application Security Project (OWASP). All rights reserved.


text:
<?php

namespace Oro\Bundle\DashboardBundle\Provider\Converters;

use Doctrine\ORM\EntityManager;

use Oro\Bundle\DashboardBundle\Provider\ConfigValueConverterAbstract;
use Oro\Bundle\UserBundle\Entity\User;

/**
 * Class WidgetUserMultiselectConverter
 * @package Oro\Bundle\DashboardBundle\Provider\Converters
 */
class WidgetUserMultiselectConverter extends ConfigValueConverterAbstract
{
    /**
     * @var EntityManager
     */
    protected $entityManager;

    /**
     * @param EntityManager $entityManager
     */
    public function __construct(EntityManager $entityManager)
    {
        $this->entityManager = $entityManager;
    }

    /**
     * {@inheritdoc}
     */
    public function getFormValue(array $converterAttributes, $value)
    {
        return $this->getUsersFullData($value);
    }

    /**
     * {@inheritdoc}
     */
    public function getViewValue($value)
    {
        $users = $this->getUsersFullData($value);

        $names = [];
        /** @var User $user */
        foreach ($users as $user) {
            $names[] = $user->getFirstName() . ' ' . $user->getLastName();
        }

        return empty($names) ? null : implode('; ', $names);
    }

    /**
     * @param mixed $value
     * @return mixed
     */
    protected function getUsersFullData($value)
    {
        $value = is_array($value) ? $value : array($value);

        $ids = [];
        foreach ($value as $item) {
            if (is_object($item)) {
                $ids[] = $item->getId();
            }
        }

        return $this->entityManager->getRepository('OroUserBundle:User')->findById($ids);
    }
}


text:
var models = require('./app/models');

models(function (err, db) {
  if (err) {
      if (err.message.indexOf('ECONNREFUSED') > 0) {
          throw new Error("Could not connect to database: " + settings.database.host);
      }
      else {
        console.log(err);
          return next(err);
      }
  }
  else {
    console.log('models synced.');
    process.exit();
  }
}, true); //true calls 'syncModel');


text:
<ivy-module version="1.0">
	<info organisation="jayasoft"
	       module="resolve-latest"
	       revision="1.0"
	       status="release"
	/>
	<dependencies>
		<dependency org="org1" name="mod1.2" rev="latest.integration"/>
	</dependencies>
</ivy-module>


text:
from c7n.filters import MetricsFilter
from c7n.manager import resources
from c7n.query import QueryResourceManager

@resources.register('distribution')
class Distribution(QueryResourceManager):

    class resource_type(object):
        service = 'cloudfront'
        enum_spec = ('list_distributions', 'DistributionList.Items', None)
        id = 'Id'
        name = 'DomainName'
        date = 'LastModifiedTime'
        dimension = "DistributionId"

@resources.register('streaming-distribution')
class StreamingDistribution(QueryResourceManager):

    class resource_type(object):
        service = 'cloudfront'
        enum_spec = ('list_streaming_distributions',
                     'StreamingDistributionList.Items',
                     None)
        id = 'Id'
        name = 'DomainName'
        date = 'LastModifiedTime'
        dimension = "DistributionId"

@Distribution.filter_registry.register('metrics')
@StreamingDistribution.filter_registry.register('metrics')
class DistributionMetrics(MetricsFilter):

    def get_dimensions(self, resource):
        return [{'Name': self.model.dimension,
                 'Value': resource[self.model.id]},
                {'Name': 'Region', 'Value': 'Global'}]


text:
namespace ntp_snippets {

int64_t SerializeTime(const base::Time& time) {
  return (time - base::Time()).InMicroseconds();
}

base::Time DeserializeTime(int64_t serialized_time) {
  return base::Time() + base::Microseconds(serialized_time);
}

}  // namespace ntp_snippets


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<!--
        You'll find the "Writing a Kate Highlighting XML File HOWTO" at http://kate.kde.org/doc/hlhowto.php
        This is a template for the XML format used for syntax highlight descriptions
        for the Kate text editor (http://kate.kde.org), which is part of the KDE
        desktop environment (http://www.kde.org).

        Use it as the base for your own syntax files.

        Look at language.dtd for some documentation of the allowed elements and their attributes.
        There is also a description of how to validate your syntax file.

        You'll find the "Writing a Kate Highlighting XML File HOWTO" at http://kate.kde.org/doc/hlhowto.php
-->
<language name="ASN.1" section="Markup" version="3" kateversion="2.3" extensions="*.asn;*.asn1" mimetype="" author="Philippe Rigault" license="GPL">
  <highlighting>
    <list name="keywords">
      <item>DEFINITIONS</item>
      <item>BEGIN</item>
      <item>END</item>
      <item>EXPORTS</item>
      <item>IMPORTS</item>
      <item>FROM</item>
      <item>APPLICATION</item>
      <item>PRIVATE</item>
      <item>UNIVERSAL</item>
      <item>DEFAULT</item>
      <item>OPTIONAL</item>
      <item>FALSE</item>
      <item>TRUE</item>
    </list>
    <list name="types">
      <item>BOOLEAN</item>
      <item>INTEGER</item>
      <item>OCTET</item>
      <item>STRING</item>
      <item>NULL</item>
      <item>REAL</item>
      <item>ENUMERATED</item>
      <item>SEQUENCE</item>
      <item>SET</item>
      <item>CHOICE</item>
      <item>OF</item>
      <item>VisibleString</item>
      <item>StringStore</item>
    </list>

    <contexts>
      <context name="Normal Text" attribute="Normal Text" lineEndContext="#stay">
        <keyword attribute="Keyword" context="#stay" String="keywords" />
        <keyword attribute="Data Type" context="#stay" String="types" />
        <Detect2Chars attribute="Comment" context="Comment" char="-" char1="-"/>
      </context>

      <context attribute="Comment" lineEndContext="#pop" name="Comment">
      </context>
    </contexts>

    <itemDatas>
      <itemData name="Normal Text" defStyleNum="dsNormal"/>
      <itemData name="Keyword"     defStyleNum="dsKeyword"/>
      <itemData name="Comment"     defStyleNum="dsComment"/>
      <itemData name="Data Type"   defStyleNum="dsDataType"/>
    </itemDatas>
  </highlighting>
</language>
<!--
// kate: space-indent on; indent-width 2; replace-tabs on;
-->


text:
//-----------------------------------------------------------------------
// <copyright file="MainWindowModel.cs" company="NSwag">
//     Copyright (c) Rico Suter. All rights reserved.
// </copyright>
// <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license>
// <author>Rico Suter, mail@rsuter.com</author>
//-----------------------------------------------------------------------

using System;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using NJsonSchema.CodeGeneration.CSharp;
using NSwag;
using NSwag.CodeGeneration.CodeGenerators;
using NSwag.Commands;

namespace NSwagStudio.ViewModels.CodeGenerators
{
    public class SwaggerToCSharpControllerGeneratorViewModel : ViewModelBase
    {
        private string _clientCode;
        private SwaggerToCSharpControllerCommand _command = new SwaggerToCSharpControllerCommand();

        /// <summary>Gets the settings.</summary>
        public SwaggerToCSharpControllerCommand Command
        {
            get { return _command; }
            set
            {
                if (Set(ref _command, value))
                    RaiseAllPropertiesChanged();
            }
        }

        /// <summary>Gets the list of operation modes. </summary>
        public OperationGenerationMode[] OperationGenerationModes
        {
            get
            {
                return Enum.GetNames(typeof(OperationGenerationMode))
                    .Select(t => (OperationGenerationMode)Enum.Parse(typeof(OperationGenerationMode), t))
                    .ToArray();
            }
        }

        /// <summary>Gets the list of class styles. </summary>
        public CSharpClassStyle[] ClassStyles
        {
            get
            {
                return Enum.GetNames(typeof(CSharpClassStyle))
                    .Select(t => (CSharpClassStyle)Enum.Parse(typeof(CSharpClassStyle), t))
                    .ToArray();
            }
        }

        /// <summary>Gets or sets the namespace usages (comma separated). </summary>
        public string AdditionalNamespaceUsages
        {
            get
            {
                return Command.AdditionalNamespaceUsages != null ? string.Join(",", Command.AdditionalNamespaceUsages) : "";
            }
            set
            {
                if (!string.IsNullOrEmpty(value))
                    Command.AdditionalNamespaceUsages = value.Split(',').Select(n => n.Trim()).Where(n => !string.IsNullOrEmpty(n)).ToArray();
                else
                    Command.AdditionalNamespaceUsages = new string[] { };
                RaisePropertyChanged(() => AdditionalNamespaceUsages);
            }
        }

        /// <summary>Gets or sets the client code. </summary>
        public string ClientCode
        {
            get { return _clientCode; }
            set { Set(ref _clientCode, value); }
        }

        public Task GenerateClientAsync(string swaggerData, string documentPath)
        {
            return RunTaskAsync(async () =>
            {
                var code = string.Empty;
                await Task.Run(async () =>
                {
                    if (!string.IsNullOrEmpty(swaggerData))
                    {
                        Command.Input = await SwaggerDocument.FromJsonAsync(swaggerData, documentPath);
                        code = await Command.RunAsync();
                        Command.Input = null;
                    }
                });

                ClientCode = code ?? string.Empty;
            });
        }

        public override void HandleException(Exception exception)
        {
            MessageBox.Show(exception.Message);
        }
    }
}


text:
#ifndef TIPAREA_H
#define TIPAREA_H

#include <QGraphicsObject>
#include <QComboBox>
#include <QGraphicsProxyWidget>
#include "widget/CardItem.h"
#include "data/SafeList.h"
class TipArea : public QGraphicsObject
{
    Q_OBJECT
public:
    TipArea();
    QRectF boundingRect() const;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
    void setMsg(QString msg);
    void addBoxItem(QString text);
    void reset();
    void clearStatus();
    void showBox();
    void showStatus(int id);
    void adjustCards();
    int getBoxCurrentIndex(){return box->currentIndex();}
    QString getBoxCurrentText(){return box->currentText();}
    int getSelectedCardID(){return selectedCard->getID();}
    void win(int team);
    int getWidth() { return width; }
    int getHeight() { return height; }

public slots:
    void onCardSelected(int id);
    void onCardUnselected(int id);
private:
    int width;
    int height;
    bool winflag;
    QPixmap background;
    QPixmap winpix;
    QString msg;
    QComboBox *box;
    QGraphicsProxyWidget *boxItem;
    SafeList<CardItem*> cardItems;
    Card* selectedCard;
};

#endif // TIPAREA_H


text:
package org.fit.vutbr.relaxdms.data.db.system.configuration;

import java.util.Properties;
import javax.ejb.Stateless;
import javax.inject.Inject;
import org.fit.vutbr.relaxdms.data.system.configuration.ConfigurationService;

/**
 *
 * @author Martin Kanis
 */
@Stateless
public class ConfigurationServiceImpl implements ConfigurationService {

    @Inject
    private ConfigurationLoader config;

    @Override
    public String getDbHost() {
        Properties p = config.getProperties();
        return p.getProperty("dbHost");
    }

    @Override
    public String getDbName() {
        Properties p = config.getProperties();
        return p.getProperty("dbName");
    }

    @Override
    public String getDbShowPath() {
        Properties p = config.getProperties();
        return p.getProperty("dbShowPath");
    }
}


text:
package com.outworkers.phantom.finagle

import com.twitter.util.{Future, Return, Throw}
import org.scalatest.concurrent.{ScalaFutures, Waiters}

trait TwitterFutures extends Waiters with ScalaFutures {

  implicit def twitterFutureToConcept[T](f: Future[T]): FutureConcept[T] = new FutureConcept[T] {
    override def eitherValue: Option[Either[Throwable, T]] = f.poll match {
      case Some(Return(ret)) => Some(Right(ret))
      case Some(Throw(err)) => Some(Left(err))
      case None => None
    }

    override def isExpired: Boolean = false

    override def isCanceled: Boolean = false
  }
}


text:
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>ProxyEventRequire</title>
    <script src="http://requirejs.org/docs/release/2.1.16/minified/require.js" data-main="app.js"></script>
</head>
<body>
    <button class="js-test-copyright">©</button>
    <button class="js-test-register">®</button>
    <button class="js-test-together">&</button>

    <button class="js-test-copyright">©</button>
    <button class="js-test-register">®</button>
    <button class="js-test-together">&</button>
</body>
</html>


text:
package kamon.netty

import kamon.netty.Clients.withNioClient
import kamon.netty.Metrics.{registeredChannelsMetric, taskProcessingTimeMetric, taskQueueSizeMetric, taskWaitingTimeMetric}
import kamon.netty.Servers.{withEpollServer, withNioServer}
import kamon.testkit.MetricInspection
import org.scalatest.{Matchers, WordSpec}

class NettyMetricsSpec extends WordSpec with Matchers with MetricInspection  {

  "The NettyMetrics" should {

    "track the NioEventLoop in boss-group and worker-group" in {
      withNioServer() { port =>
        withNioClient(port) { httpClient =>
          val httpGet = httpClient.get(s"http://localhost:$port/route?param=123")
          httpClient.execute(httpGet)

          registeredChannelsMetric.valuesForTag("name") should contain atLeastOneOf("boss-group-nio-event-loop", "worker-group-nio-event-loop")
          taskProcessingTimeMetric.valuesForTag("name") should contain atLeastOneOf("boss-group-nio-event-loop", "worker-group-nio-event-loop")
          taskQueueSizeMetric.valuesForTag("name") should contain atLeastOneOf("boss-group-nio-event-loop", "worker-group-nio-event-loop")
          taskWaitingTimeMetric.valuesForTag("name") should contain atLeastOneOf("boss-group-nio-event-loop", "worker-group-nio-event-loop")
        }
      }
    }

    "track the EpollEventLoop in boss-group and worker-group" in {
      withEpollServer() { port =>
        withNioClient(port) { httpClient =>
          val httpGet = httpClient.get(s"http://localhost:$port/route?param=123")
          httpClient.execute(httpGet)

          registeredChannelsMetric.valuesForTag("name") should contain atLeastOneOf("boss-group-epoll-event-loop", "worker-group-epoll-event-loop")
          taskProcessingTimeMetric.valuesForTag("name") should contain atLeastOneOf("boss-group-epoll-event-loop", "worker-group-epoll-event-loop")
          taskQueueSizeMetric.valuesForTag("name") should contain atLeastOneOf("boss-group-epoll-event-loop", "worker-group-epoll-event-loop")
          taskWaitingTimeMetric.valuesForTag("name") should contain atLeastOneOf("boss-group-epoll-event-loop", "worker-group-epoll-event-loop")
        }
      }
    }

    "track the registered channels, task processing time and task queue size for NioEventLoop" in {
      withNioServer() { port =>
        withNioClient(port) { httpClient =>
          val httpGet = httpClient.get(s"http://localhost:$port/route?param=123")
          val response = httpClient.execute(httpGet)
          response.getStatus.code() should be(200)

          registeredChannelsMetric.valuesForTag("name") should contain("boss-group-nio-event-loop")

          val metrics = Metrics.forEventLoop("boss-group-nio-event-loop")

          metrics.registeredChannels.distribution().max should be > 0L
          metrics.taskProcessingTime.distribution().max should be > 0L
          metrics.taskQueueSize.distribution().max should be > 0L
          metrics.taskWaitingTime.distribution().max should be > 0L
        }
      }
    }

    "track the registered channels, task processing time and task queue size for EpollEventLoop" in {
      withEpollServer() { port =>
        withNioClient(port) { httpClient =>
          val httpGet = httpClient.get(s"http://localhost:$port/route?param=123")
          val response = httpClient.execute(httpGet)
          response.getStatus.code() should be(200)

          registeredChannelsMetric.valuesForTag("name") should contain("boss-group-epoll-event-loop")

          val metrics = Metrics.forEventLoop("boss-group-epoll-event-loop")

          metrics.registeredChannels.distribution().max should be >= 0L
          metrics.taskProcessingTime.distribution().max should be > 0L
          metrics.taskQueueSize.distribution().max should be >= 0L
          metrics.taskWaitingTime.distribution().max should be > 0L
        }
      }
    }
  }
}


text:
package org.sakaiproject.tool.section.facade.sakai;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.sakaiproject.section.api.facade.manager.Authn;
import org.sakaiproject.tool.api.Session;
import org.sakaiproject.tool.cover.SessionManager;

/**
 * Uses Sakai's SessionManager to determine the current user's uuid.
 *
 * @author Josh Holtzman
 */
public class AuthnSakaiImpl implements Authn {
    private static final Log log = LogFactory.getLog(AuthnSakaiImpl.class);

    /**
     * @see org.sakaiproject.section.api.facade.managers.Authn#getUserUid()
     */
    public String getUserUid(Object request) {
        Session session = SessionManager.getCurrentSession();
        String userId = session.getUserId();
        if(log.isDebugEnabled()) log.debug("current user id is " + userId);
        return userId;
    }

}


text:
a18n
====
i18n library for Arduino

Usage
-----
a18n is a small library to manage i18n on your Arduino projects. It accepts a json string in this format:
```
{
    "item_id": {
        "language_code_1":"translation_1",
        "language_code_2":"translation_2",
        ...
        "language_code_N":"translation_N"
    }
}
```
For example:
```
#include <a18n.h>
char* data = "{\"limit\":{\"en\":\"Limit\",\"it\":\"Limite\"}}";
a18n* imanager = new a18n("en", data);
imanager->getTranslation("limit"); //will return "Limit"
```
-------
Relased under MIT license, Copyright (c) 2013 Andrea Stagi <stagi.andrea@gmail.com>


text:
module = {}

function module.allwords()
  print("please a sentence:")
  local line = io.read()
  local pos = 1
  return function()
    while line do
      local s, e = string.find(line, "%w+", pos)
      if s then
        pos = e + 1
        return string.sub(line, s, e)
      else
        break
      end
    end
    return nil
  end
end

function module.prefix(w1 ,w2)
  return w1 .. " " .. w2
end

module.statetab = {}

function module.insert(index, value)
  local list = module.statetab[index]
  if list == nil then
    module.statetab[index] = value
  else
    module.statetab[#list + 1] = value
  end
end

return module


text:
import pinproc
import time
import os

class Frame(pinproc.DMDBuffer):
	"""DMD frame/bitmap.

	Subclass of :class:`pinproc.DMDBuffer`.
	"""

	width = 0
	"""Width of the frame in dots."""
	height = 0
	"""Height of the frame in dots."""

	def __init__(self, width, height):
		"""Initializes the frame to the given `width` and `height`."""
		super(Frame, self).__init__(width, height)
		self.width = width
		self.height = height

	def copy_rect(dst, dst_x, dst_y, src, src_x, src_y, width, height, op="copy"):
		"""Static method which performs some type checking before calling :meth:`pinproc.DMDBuffer.copy_to_rect`."""
		if not (issubclass(type(dst), pinproc.DMDBuffer) and issubclass(type(src), pinproc.DMDBuffer)):
			raise ValueError, "Incorrect types"
		src.copy_to_rect(dst, int(dst_x), int(dst_y), int(src_x), int(src_y), int(width), int(height), op)
	copy_rect = staticmethod(copy_rect)

	def subframe(self, x, y, width, height):
		"""Generates a new frame based on a sub rectangle of this frame."""
		subframe = Frame(width, height)
		Frame.copy_rect(subframe, 0, 0, self, x, y, width, height, 'copy')
		return subframe

	def copy(self):
		"""Returns a copy of itself."""
		frame = Frame(self.width, self.height)
		frame.set_data(self.get_data())
		return frame

	def ascii(self):
		"""Returns an ASCII representation of itself."""
		output = ''
		table = [' ', '.', '.', '.', ',', ',', ',', '-', '-', '=', '=', '=', '*', '*', '#', '#',]
		for y in range(self.height):
			for x in range(self.width):
				dot = self.get_dot(x, y)
				output += table[dot & 0xf]
			output += "\n"
		return output

	def create_with_text(lines, palette = {' ':0, '*':15}):
		"""Create a frame based on text.

		This class method can be used to generate small sprites within the game's source code::

			frame = Frame.create_with_text(lines=[ \\
			    '*+++*', \\
			    ' *+* ', \\
			    '  *  '], palette={' ':0, '+':7, '*':15})
		"""
		height = len(lines)
		if height > 0:
			width = len(lines[0])
		else:
			width = 0
		frame = Frame(width, height)
		for y in range(height):
			for x in range(width):
				char = lines[y][x]
				frame.set_dot(x, y, palette[char])
		return frame
	create_with_text = staticmethod(create_with_text)

	def create_frames_from_grid( self, num_cols, num_rows ):
		frames = []
		width = self.width / num_cols
		height = self.height / num_rows

		# Use nested loops to step through each column of each row, creating a new frame at each iteration and copying in the appropriate data.
		for row_index in range(0,num_rows):
			for col_index in range(0,num_cols):
				new_frame = Frame(width, height)
				Frame.copy_rect(dst=new_frame, dst_x=0, dst_y=0, src=self, src_x=width*col_index, src_y=height*row_index, width=width, height=height, op='copy')
				frames += [new_frame]
		return frames

class Layer(object):
	"""
	The ``Layer`` class is the basis for the pyprocgame display architecture.
	Subclasses override :meth:`next_frame` to provide a frame for the current moment in time.
	Handles compositing of provided frames and applying transitions within a :class:`DisplayController` context.
	"""

	opaque = False
	"""Determines whether layers below this one will be rendered.
	If `True`, the :class:`DisplayController` will not render any layers after this one
	(such as from modes with lower priorities -- see :class:`DisplayController` for more information).
	"""

	target_x = 0
	"""Base `x` component of the coordinates at which this layer will be composited upon a target buffer."""
	target_y = 0
	"""Base `y` component of the coordinates at which this layer will be composited upon a target buffer."""
	target_x_offset = 0
	"""Translation component used in addition to :attr:`target_x` as this layer's final compositing position."""
	target_y_offset = 0
	"""Translation component used in addition to :attr:`target_y` as this layer's final compositing position."""
	enabled = True
	"""If `False`, :class:`DisplayController` will ignore this layer."""
	composite_op = 'copy'
	"""Composite operation used by :meth:`composite_next` when calling :meth:`~pinproc.DMDBuffer.copy_rect`."""
	transition = None
	"""Transition which :meth:`composite_next` applies to the result of :meth:`next_frame` prior to compositing upon the output."""

	def __init__(self, opaque=False):
		"""Initialize a new Layer object."""
		super(Layer, self).__init__()
		self.opaque = opaque
		self.set_target_position(0, 0)

	def reset(self):
		# To be overridden
		pass

	def set_target_position(self, x, y):
		"""Setter for :attr:`target_x` and :attr:`target_y`."""
		self.target_x = x
		self.target_y = y
	def next_frame(self):
		"""Returns an instance of a Frame object to be shown, or None if there is no frame.
		The default implementation returns ``None``; subclasses should implement this method."""
		return None
	def composite_next(self, target):
		"""Composites the next frame of this layer onto the given target buffer.
		Called by :meth:`DisplayController.update`.
		Generally subclasses should not override this method; implementing :meth:`next_frame` is recommended instead.
		"""
		src = self.next_frame()
		if src != None:
			if self.transition != None:
				src = self.transition.next_frame(from_frame=target, to_frame=src)
			Frame.copy_rect(dst=target, dst_x=self.target_x+self.target_x_offset, dst_y=self.target_y+self.target_y_offset, src=src, src_x=0, src_y=0, width=src.width, height=src.height, op=self.composite_op)
		return src


text:
package ch.heigvd.amt.amtproject.rest.resources;

import ch.heigvd.amt.amtproject.entities.ApiKey;
import ch.heigvd.amt.amtproject.entities.Application;
import ch.heigvd.amt.amtproject.entities.Level;
import ch.heigvd.amt.amtproject.rest.dto.LevelCreationDTO;
import ch.heigvd.amt.amtproject.rest.dto.LevelDTO;
import ch.heigvd.amt.amtproject.services.dao.ApplicationDAOLocal;
import ch.heigvd.amt.amtproject.services.dao.rest.LevelDAOLocal;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;

@Stateless
@Path("levels")
public class LevelRessource {

    @EJB
    private LevelDAOLocal levelDAO;

    @EJB
    private ApplicationDAOLocal applicationDAO;

    @Context
    UriInfo uriInfo;

    @GET
    @Produces("application/json")
    public List<LevelDTO> getLevels(@HeaderParam("apiKey") String apiKey) {
        List<LevelDTO> dtos = new ArrayList<>();
        List<Level> levels = levelDAO.getLevels(apiKey);

        for (Level lvl : levels) {
            LevelDTO dto = new LevelDTO(lvl);
            URI href = uriInfo
                    .getBaseUriBuilder()
                    .path(LevelRessource.class)
                    .path(LevelRessource.class, "getLevel")
                    .build(lvl.getId());
            dto.setHref(href);
            dtos.add(dto);
        }

        return dtos;
    }

    @GET
    @Path("/{id}")
    @Produces("application/json")
    public LevelDTO getLevel(@PathParam(value = "id") long id) {
        Level level = levelDAO.findById(id);
        LevelDTO dto = new LevelDTO(level);

        return dto;
    }

    @POST
    @Consumes("application/json")
    public Response createLevel(LevelCreationDTO newLevel, @HeaderParam("apiKey") String apiKey) {
        Application app = applicationDAO.getAppByApiKey(new ApiKey(apiKey));

        Level level = new Level();
        level.setApplication(app);
        level.setName(newLevel.getName());
        level.setRequiredPoints(newLevel.getRequiredPoints());

        long id = levelDAO.create(level);

        URI href = uriInfo
                .getBaseUriBuilder()
                .path(LevelRessource.class)
                .path(LevelRessource.class, "deleteLevel")
                .build(id);

        return Response.created(href).build();
    }

    @DELETE
    @Path("/{id}")
    public Response deleteLevel(@PathParam(value = "id") long id) {
        Level level = levelDAO.findById(id);
        levelDAO.delete(level);
        return Response.ok().build();
    }
}


text:
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using Cresce.WebApp.Views.HtmlHelpers.HtmlModels;

namespace Cresce.WebApp.Views.HtmlHelpers
{
    public static class FormsHelper
    {
        private static readonly HtmlInputBuilders Builders = new HtmlInputBuilders();

        private static void AddCssClass(this TagBuilder tagBuilder, params string[] classes)
        {
            foreach (var cssClass in classes)
            {
                tagBuilder.AddCssClass(cssClass);
            }
        }

        private static void AddAllColumnSizes(this TagBuilder tagBuilder, int columnSize)
        {
            var cssClasses = new[] { "col-md-", "col-sm-", "col-xs-" };

            var classes = cssClasses
                .Reverse()
                .Select(cssClass => cssClass + columnSize)
                .ToArray();

            tagBuilder.AddCssClass(classes);
        }

        public static MvcHtmlString RadioButtonWithImage(string id, string name, string field)
        {
            var html = new ResourceWithImageHtmlRadioButton(id, name, field).ToString();
            return MvcHtmlString.Create(html);
        }

        public static MvcHtmlString RadioButton(string id, string name, string field)
        {
            var html = new ResourceHtmlRadioButton(id, name, field).ToString();
            return MvcHtmlString.Create(html);
        }

        public static MvcHtmlString RadioButtons<T>(IEnumerable<T> data, string field)
        {
            var div = new TagBuilder("div")
            {
                InnerHtml = MakeRadioButtons(data, Builders.Get<T>(), field)
            };

            div.MergeAttribute("data-toggle", "buttons");
            div.AddAllColumnSizes(12);
            div.AddCssClass("btn-group");

            var htmlString = div.ToString();

            return MvcHtmlString.Create(htmlString);
        }

        private static string MakeRadioButtons<T>(IEnumerable<T> data, IHtmlInputBuilder<T> builder, string field)
        {
            return data.Select(element => builder.Build(element, field))
                .Aggregate(new StringBuilder(), (sb, elemHtml) => sb.AppendLine(elemHtml.ToString()))
                .ToString();
        }

        public static MvcHtmlString MakeNavBar(MenuType menu = 0)
        {
            var ul = new TagBuilder("ul")
            {
                InnerHtml = MakeNavBarMenu(menu)
            };

            ul.AddCssClass("nav nav-pills nav-justified");

            return new MvcHtmlString(ul.ToString());
        }

        private static string MakeNavBarMenu(MenuType menu)
        {
            switch (menu)
            {
                case MenuType.Evaluations: return MakeNavBarItemsForEvaluations();
                default: return MakeNavBarItemsForSessions();
            }
        }

        private static string MakeNavBarItemsForSessions()
        {
            var items = new[]
            {
                MakeNavBarItem("Nova Sessão", "/"),
                MakeNavBarItem("Consultar Sessões", "/Appointments/TodaysAppointments"),
                MakeNavBarItem("Criar Contrato", "/Contract"),
                MakeNavBarItem("Consultar Contratos", "/Contract/GetAllContracts"),
            };

            return items
                .Aggregate(new StringBuilder(), (builder, item) => builder.AppendLine(item))
                .ToString();
        }

        private static string MakeNavBarItemsForEvaluations()
        {
            var items = new[]
            {
                MakeNavBarItem("Nova Avaliação", "/Goals/QualityAssurance"),
                MakeNavBarItem("Objectivos", "/Goals/Goals"),
                MakeNavBarItem("Avaliações", "/Goals/Evaluation"),
            };

            return items
                .Aggregate(new StringBuilder(), (builder, item) => builder.AppendLine(item))
                .ToString();
        }

        private static string MakeNavBarItem(string label, string uri)
        {
            var anchor = new TagBuilder("a");
            anchor.MergeAttribute("href", uri);
            anchor.SetInnerText(label);

            var li = new TagBuilder("li")
            {
                InnerHtml = anchor.ToString()
            };

            li.MergeAttribute("role", "presentation");

            if (GetCurrentWebsiteRoot().EndsWith(uri))
            {
                li.AddCssClass("active");
            }
            return li.ToString();
        }

        public static MvcHtmlString MakeButton(string label, string uri)
        {
            if (GetCurrentWebsiteRoot().EndsWith(uri))
            {
                return MakeActiveButton(label, uri);
            }

            return MakeDefaultButton(label, uri);
        }

        private static MvcHtmlString MakeDefaultButton(string label, string uri)
        {
            var anchor = new TagBuilder("a");
            anchor.AddCssClass("btn-lg");
            anchor.AddCssClass("btn-default");
            anchor.AddCssClass("btn");

            anchor.MergeAttribute("role", "button");
            anchor.MergeAttribute("href", uri);
            anchor.SetInnerText(label);

            var htmlString = anchor.ToString();

            return MvcHtmlString.Create(htmlString);
        }

        public static string GetCurrentWebsiteRoot()
        {
            return HttpContext.Current.Request.Url.AbsolutePath;
        }

        public static MvcHtmlString MakeActiveButton(string label, string uri)
        {
            var anchor = new TagBuilder("a");
            anchor.AddCssClass("active");
            anchor.AddCssClass("btn-lg");
            anchor.AddCssClass("btn-primary");
            anchor.AddCssClass("btn");

            anchor.MergeAttribute("role", "button");
            anchor.MergeAttribute("href", uri);
            anchor.SetInnerText(label);

            var htmlString = anchor.ToString();

            return MvcHtmlString.Create(htmlString);
        }
    }

    public enum MenuType
    {
        Sessions = 0,
        Evaluations = 1
    }
}


text:
```javascript
// codeblock one: 2 errors
var message = 'Where did my semicolon go'

undefinedFunctionIsUndefined();
```

```js
// Another codeblock: 1 error
if ( 'we compare with null with not-threequals' == null ) {
  console.log( 'this will fail' );
}
```

```html
<script>
  var message = [
    'since this is html, this will',
    'not be evaluated and the missing',
    'semi-colon will (still) not be caught'
  ]
</script>
```


text:
phpnats
=======

**Travis**

* Master: [![Build Status](https://travis-ci.org/repejota/phpnats.png?branch=master)](https://travis-ci.org/repejota/phpnats)
* Develop: [![Build Status](https://travis-ci.org/repejota/phpnats.png?branch=develop)](https://travis-ci.org/repejota/phpnats)

**Coverage**

* Master: [![Coverage Status](https://coveralls.io/repos/repejota/phpnats/badge.svg?branch=master)](https://coveralls.io/r/repejota/phpnats?branch=master)
* Develop: [![Coverage Status](https://coveralls.io/repos/repejota/phpnats/badge.svg?branch=develop)](https://coveralls.io/r/repejota/phpnats?branch=develop)

Introduction
------------

A PHP client for the [NATS messaging system](https://nats.io).

>  Note: phpnats is under heavy development.

Requirements
------------

* php ~5.4
* [nats](https://github.com/derekcollison/nats) or [gnatsd](https://github.com/apcera/gnatsd)

Usage
-----

### Basic Usage

```php
$client = new \Nats\Connection();
$client->connect();

# Simple Publisher
$client->publish("foo", "foo bar");

# Simple Subscriber
$callback = function($payload)
{
    printf("Data: %s\r\n", $payload);
};
$client->subscribe("foo", $callback);

# Wait for 1 message
$client->wait(1);
```

Developer's Information
-----------------------

### Tests

Tests are in the `tests` folder.
To run them, you need `PHPUnit` and execute `make test`.

### Code Quality

We are using [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer/docs)
to ensure our code follow an high quality standard.

To perform an analysis of the code execute `make cs`.

Creators
--------

**Raül Pérez**

- <https://twitter.com/repejota>
- <https://github.com/repejota>

**Adrià Cidre**

- <https://twitter.com/adriacidre>
- <https://github.com/adriacidre>

**José Gil**

- <https://twitter.com/josgilmo>
- <https://github.com/josgilmo>

**Gorka López de Torre**

- <https://twitter.com/glopezdetorre>
- <https://github.com/glopezdetorre>

License
-------

MIT, see [LICENSE](LICENSE)


text:
package br.com.concretesolutions.audience.core;

import org.hamcrest.CoreMatchers;
import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;

public class UtilsTest {

    interface SAMType {
        void doSmt();
    }

    @Test
    public void messageClass_canMatchOnAnonymousClass() {
        SAMType instance = new SAMType() {
            @Override
            public void doSmt() {
            }
        };

        assertThat(Utils.messageClass(instance),
                CoreMatchers.<Class<?>>equalTo(SAMType.class));
    }
}


text:
<md-dialog>
    <form name="dataform">
        <md-toolbar>

Add an address
                    Address

                <md-button class="md-icon-button" ng-click="cancel()">
                    <md-icon md-svg-src="assets/img/ic_close_24px.svg" aria-label translate-attr="{ 'aria-label': 'closedialog' }"></md-icon>
                </md-button>

        </md-toolbar>
        <md-dialog-content>

                <md-input-container>
                    Label
                    <md-select ng-model="data.label" required name="labelinput">
                        <md-option ng-repeat="label in preFilledLabels" ng-value="label">
                            {{label | translate}}</md-option>
                        <md-option ng-value="::originalLabel" ng-if="::isCustomlabel(originalLabel)">{{originalLabel}}</md-option>
                    </md-select>

This field is required

                </md-input-container>

                    <md-input-container flex>
                        Street
                        <input ng-model="data.street" required type="text" maxlength="50" name="street">

This field is required

                    </md-input-container>
                    <md-input-container>
                        Nr
                        <input ng-model="data.nr" required type="text" maxlength="10" name="nr">

This field is required

                    </md-input-container>

                    <md-input-container>
                        Postal code
                        <input ng-model="data.postalcode" required type="text" maxlength="20" name="postalcode">

This field is required

                    </md-input-container>
                    <md-input-container>
                        City
                        <input ng-model="data.city" required type="text" maxlength="30" name="city">

This field is required

                    </md-input-container>
                    <md-input-container>
                        Country
                        <input ng-model="data.country" required type="text" maxlength="40" name="country">

This field is required

                    </md-input-container>

                <md-input-container>
                    Remarks
                    <input ng-model="data.other" type="text" maxlength="30" name="other">
                </md-input-container>

        </md-dialog-content>
        <md-dialog-actions layout="row" layout-align="space-between center">
            <md-button class="md-warn" ng-click="remove(originalLabel)" ng-if="::originalLabel" translate='delete'>
                Delete
            </md-button>

            <md-button ng-click="cancel()" translate='cancel'>
                Cancel
            </md-button>
            <md-button class="md-primary" ng-click="create(data)" ng-if="::!originalLabel" translate='add' type='submit'>
                Add
            </md-button>
            <md-button class="md-primary" ng-click="update(originalLabel, data)" ng-if="::originalLabel" translate='save' type='submit'>
                Save
            </md-button>
        </md-dialog-actions>
    </form>
</md-dialog>


text: from v2 import *


text:
namespace boost {
namespace container {

using ::boost::intrusive::iterator_traits;
using ::boost::intrusive::iter_difference;
using ::boost::intrusive::iter_category;
using ::boost::intrusive::iter_value;
using ::boost::intrusive::iter_size;
using ::boost::intrusive::iterator_distance;
using ::boost::intrusive::iterator_udistance;
using ::boost::intrusive::iterator_advance;
using ::boost::intrusive::iterator_uadvance;
using ::boost::intrusive::iterator;
using ::boost::intrusive::iterator_enable_if_tag;
using ::boost::intrusive::iterator_disable_if_tag;
using ::boost::intrusive::iterator_arrow_result;

template <class Container>
class back_emplacer
{
   private:
   Container& container;

   public:
   typedef std::output_iterator_tag iterator_category;
   typedef void                     value_type;
   typedef void                     difference_type;
   typedef void                     pointer;
   typedef void                     reference;

   back_emplacer(Container& x)
      : container(x)
   {}

   template<class U>
   back_emplacer& operator=(BOOST_FWD_REF(U) value)
   {
      container.emplace_back(boost::forward<U>(value));
      return *this;
   }
   back_emplacer& operator*()    { return *this; }
   back_emplacer& operator++()   { return *this; }
   back_emplacer& operator++(int){ return *this; }
};

#ifndef BOOST_CONTAINER_NO_CXX17_CTAD

template<class InputIterator>
using it_based_non_const_first_type_t = typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type;

template<class InputIterator>
using it_based_const_first_type_t = const typename dtl::remove_const<typename iterator_traits<InputIterator>::value_type::first_type>::type;

template<class InputIterator>
using it_based_second_type_t = typename iterator_traits<InputIterator>::value_type::second_type;

template<class InputIterator>
using it_based_value_type_t = typename iterator_traits<InputIterator>::value_type;

#endif

}  //namespace container {
}  //namespace boost {

#endif   //#ifndef BOOST_CONTAINER_DETAIL_ITERATORS_HPP


text:
Agent 47, you have a new task! Among citizens of the city X are hidden 2 dangerous criminal twins. You task is to identify them and eliminate!

Given an array of integers, your task is to find two same numbers and return one of them, for example in array ```[2, 3, 6, 34, 7, 8, 2]``` answer is ```2```. If there are no twins in the city - return ```None```.
```python
def elimination(arr):
    for n in arr:
        if arr.count(n) > 1:
            return n
    return None
```
```python
def elimination(arr):
    s = set()
    for i in arr:
        if i in s:
            return i
        s.add(i)
    return None
```


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Mycologia 40(6): 643 (1948)

#### Original name
Hymenogaster globosus Harkn.

### Remarks
null


text:
def generate_zulip_bots_static_files() -> None:
    import glob
    import os
    import sys
    import shutil

    ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
    if ZULIP_PATH not in sys.path:
        sys.path.append(ZULIP_PATH)

    from typing import List
    from zproject import settings
    from zulip_bots.lib import get_bots_directory_path

    bots_dir = os.path.join(settings.STATIC_ROOT, 'generated/bots')
    if os.path.isdir(bots_dir):
        # delete old static files, they could be outdated
        try:
            shutil.rmtree(bots_dir)
        except OSError:
            print("There was a permission error with Vagrant's NFS file      sharing on old versions of " +
                  "OSX. You can fix this by upgrading to the latest OSX High Sierra, or work around it " +
                  "by giving read/write permissions to your /zulip folder to everyone.")
            sys.exit(1)

    os.makedirs(bots_dir, exist_ok=True)

    def copyfiles(paths):
        # type: (List[str]) -> None
        for src_path in paths:
            bot_name = os.path.basename(os.path.dirname(src_path))

            bot_dir = os.path.join(bots_dir, bot_name)
            os.makedirs(bot_dir, exist_ok=True)

            dst_path = os.path.join(bot_dir, os.path.basename(src_path))
            if not os.path.isfile(dst_path):
                shutil.copyfile(src_path, dst_path)

    package_bots_dir = get_bots_directory_path()

    logo_glob_pattern = os.path.join(package_bots_dir, '*/logo.*')
    logos = glob.glob(logo_glob_pattern)
    copyfiles(logos)

    doc_glob_pattern = os.path.join(package_bots_dir, '*/doc.md')
    docs = glob.glob(doc_glob_pattern)
    copyfiles(docs)

if __name__ == "__main__":
    generate_zulip_bots_static_files()


text:
package org.zstack.test.storage.primary.local;

import junit.framework.Assert;
import org.junit.Before;
import org.junit.Test;
import org.zstack.core.cloudbus.CloudBus;
import org.zstack.core.componentloader.ComponentLoader;
import org.zstack.core.db.DatabaseFacade;
import org.zstack.core.db.Q;
import org.zstack.header.host.HostInventory;
import org.zstack.header.host.MigrateVmOnHypervisorMsg.StorageMigrationPolicy;
import org.zstack.header.identity.SessionInventory;
import org.zstack.header.message.AbstractBeforeDeliveryMessageInterceptor;
import org.zstack.header.message.Message;
import org.zstack.header.storage.primary.DownloadImageToPrimaryStorageCacheMsg;
import org.zstack.header.storage.primary.ImageCacheVO;
import org.zstack.header.storage.primary.PrimaryStorageInventory;
import org.zstack.header.storage.primary.PrimaryStorageOverProvisioningManager;
import org.zstack.header.vm.VmInstanceInventory;
import org.zstack.header.vm.VmInstanceState;
import org.zstack.header.vm.VmInstanceVO;
import org.zstack.header.volume.VolumeInventory;
import org.zstack.header.volume.VolumeType;
import org.zstack.header.volume.VolumeVO;
import org.zstack.kvm.KVMAgentCommands.MigrateVmCmd;
import org.zstack.simulator.kvm.KVMSimulatorConfig;
import org.zstack.storage.primary.local.*;
import org.zstack.storage.primary.local.LocalStorageKvmBackend.CacheInstallPath;
import org.zstack.storage.primary.local.LocalStorageKvmBackend.CreateEmptyVolumeCmd;
import org.zstack.storage.primary.local.LocalStorageKvmBackend.DeleteBitsCmd;
import org.zstack.storage.primary.local.LocalStorageSimulatorConfig.Capacity;
import org.zstack.test.Api;
import org.zstack.test.ApiSenderException;
import org.zstack.test.DBUtil;
import org.zstack.test.WebBeanConstructor;
import org.zstack.test.deployer.Deployer;
import org.zstack.utils.CollectionUtils;
import org.zstack.utils.Utils;
import org.zstack.utils.data.SizeUnit;
import org.zstack.utils.function.Function;
import org.zstack.utils.logging.CLogger;

import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * 1. migrate a vm with storage
 *

 * confirm all related commands sent
 * confirm the volumes are referenced on the dst host
 * confirm the capacity of the src host and dst host are correct
 *

 * 2. get migration target host
 *

 * confirm only host1 is the target
 *

 * 3. migrate the vm to a simulator host
 *

 * confirm the migration failed
 *

 * 4. put the host2 to the maintenance mode
 *

 * confirm the vm stopped
 */
public class TestLocalStorage28 {
    CLogger logger = Utils.getLogger(TestLocalStorage28.class);
    Deployer deployer;
    Api api;
    ComponentLoader loader;
    CloudBus bus;
    DatabaseFacade dbf;
    SessionInventory session;
    KVMSimulatorConfig kconfig;
    LocalStorageSimulatorConfig config;
    PrimaryStorageOverProvisioningManager ratioMgr;
    long totalSize = SizeUnit.GIGABYTE.toByte(100);
    boolean downloadImageCalled = false;

    @Before
    public void setUp() throws Exception {
        DBUtil.reDeployDB();
        WebBeanConstructor con = new WebBeanConstructor();
        deployer = new Deployer("deployerXml/localStorage/TestLocalStorage28.xml", con);
        deployer.addSpringConfig("KVMRelated.xml");
        deployer.addSpringConfig("localStorageSimulator.xml");
        deployer.addSpringConfig("localStorage.xml");
        deployer.load();

        loader = deployer.getComponentLoader();
        bus = loader.getComponent(CloudBus.class);
        dbf = loader.getComponent(DatabaseFacade.class);
        config = loader.getComponent(LocalStorageSimulatorConfig.class);
        kconfig = loader.getComponent(KVMSimulatorConfig.class);
        ratioMgr = loader.getComponent(PrimaryStorageOverProvisioningManager.class);

        Capacity c = new Capacity();
        c.total = totalSize;
        c.avail = totalSize;

        config.capacityMap.put("host1", c);
        config.capacityMap.put("host2", c);

        deployer.build();
        api = deployer.getApi();
        session = api.loginAsAdmin();
    }

    @Test
    public void test() throws ApiSenderException, InterruptedException {
        PrimaryStorageInventory local = deployer.primaryStorages.get("local");
        HostInventory host2 = deployer.hosts.get("host2");
        HostInventory host1 = deployer.hosts.get("host1");
        VmInstanceInventory vm = deployer.vms.get("TestVm");

        ImageCacheVO cacheVO = dbf.listAll(ImageCacheVO.class).get(0);
        long imageSize = cacheVO.getSize();
        long usedVolumeSize = 0;
        for (VolumeVO vol : dbf.listAll(VolumeVO.class)) {
            usedVolumeSize += ratioMgr.calculateByRatio(vol.getPrimaryStorageUuid(), vol.getSize());
        }

        CacheInstallPath cp = new CacheInstallPath();
        cp.fullPath = cacheVO.getInstallUrl();
        cp.disassemble();

        bus.installBeforeDeliveryMessageInterceptor(new AbstractBeforeDeliveryMessageInterceptor() {
            @Override
            public void beforeDeliveryMessage(Message msg) {
                if (msg instanceof DownloadImageToPrimaryStorageCacheMsg) {
                    downloadImageCalled = true;
                }
            }
        }, DownloadImageToPrimaryStorageCacheMsg.class);

        config.createEmptyVolumeCmds.clear();
        config.deleteBitsCmds.clear();
        vm = api.migrateVmInstance(vm.getUuid(), host2.getUuid());
        TimeUnit.SECONDS.sleep(5);

        Assert.assertTrue(downloadImageCalled);

        LocalStorageHostRefVO ref1 = new LocalStorageHostRefVOFinder().findByPrimaryKey(host1.getUuid(), local.getUuid());
        Assert.assertEquals(ref1.getTotalCapacity() - imageSize, ref1.getAvailableCapacity());
        LocalStorageHostRefVO ref2 = new LocalStorageHostRefVOFinder().findByPrimaryKey(host2.getUuid(), local.getUuid());
        Assert.assertEquals(ref2.getTotalCapacity() - imageSize - usedVolumeSize, ref2.getAvailableCapacity());

        Assert.assertEquals(vm.getAllVolumes().size(), config.createEmptyVolumeCmds.size());
        for (final VolumeInventory vol : vm.getAllVolumes()) {
            // volumes are created on dst host
            CreateEmptyVolumeCmd cmd = CollectionUtils.find(config.createEmptyVolumeCmds, new Function<CreateEmptyVolumeCmd, CreateEmptyVolumeCmd>() {
                @Override
                public CreateEmptyVolumeCmd call(CreateEmptyVolumeCmd arg) {
                    return arg.getVolumeUuid().equals(vol.getUuid()) ? arg : null;
                }
            });
            Assert.assertNotNull(cmd);
            Assert.assertEquals(vol.getInstallPath(), cmd.getInstallUrl());

            if (VolumeType.Root.toString().equals(vol.getType())) {
                Assert.assertEquals(cp.installPath, cmd.getBackingFile());
            }

            LocalStorageResourceRefVO r = Q.New(LocalStorageResourceRefVO.class)
                    .eq(LocalStorageResourceRefVO_.resourceUuid, vol.getUuid())
                    .find();
            Assert.assertEquals(host2.getUuid(), r.getHostUuid());

            // volumes are deleted on src host
            DeleteBitsCmd dcmd = CollectionUtils.find(config.deleteBitsCmds, new Function<DeleteBitsCmd, DeleteBitsCmd>() {
                @Override
                public DeleteBitsCmd call(DeleteBitsCmd arg) {
                    return arg.getPath().equals(vol.getInstallPath()) ? arg : null;
                }
            });
            Assert.assertNotNull(String.format("no delete command for volume[uuid:%s, path:%s]", vol.getUuid(), vol.getInstallPath()), dcmd);
        }

        Assert.assertFalse(kconfig.migrateVmCmds.isEmpty());
        MigrateVmCmd mcmd = kconfig.migrateVmCmds.get(0);
        Assert.assertEquals(host2.getManagementIp(), mcmd.getDestHostIp());
        Assert.assertEquals(vm.getUuid(), mcmd.getVmUuid());
        Assert.assertEquals(StorageMigrationPolicy.IncCopy.toString(), mcmd.getStorageMigrationPolicy());

        List<HostInventory> hosts = api.getMigrationTargetHost(vm.getUuid());
        Assert.assertFalse(hosts.isEmpty());
        HostInventory thost = hosts.get(0);
        Assert.assertEquals(host1.getUuid(), thost.getUuid());

        HostInventory simHost = deployer.hosts.get("TestHost1");
        boolean s = false;
        try {
            api.migrateVmInstance(vm.getUuid(), simHost.getUuid());
        } catch (ApiSenderException e) {
            s = true;
        }
        Assert.assertTrue(s);

        api.maintainHost(host2.getUuid());
        VmInstanceVO vmvo = dbf.findByUuid(vm.getUuid(), VmInstanceVO.class);
        Assert.assertEquals(VmInstanceState.Stopped, vmvo.getState());
    }
}


text:
/* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package com.ssaurel.clocklw;

public final class R {
    public static final class attr {
    }
    public static final class drawable {
        public static final int ic_launcher=0x7f020000;
        public static final int widgetdial=0x7f020001;
    }
    public static final class layout {
        public static final int main=0x7f030000;
    }
    public static final class string {
        public static final int app_name=0x7f050000;
        public static final int copy_ssaurel=0x7f05000b;
        public static final int disabled=0x7f050007;
        public static final int display_hand_sec=0x7f050003;
        public static final int display_hand_sec_txt=0x7f050005;
        public static final int enabled=0x7f050006;
        public static final int other_apps=0x7f05000a;
        public static final int set_clock_lw=0x7f050004;
        public static final int show_screencast=0x7f050008;
        public static final int show_source=0x7f050009;
        public static final int wallpaper_description=0x7f050001;
        public static final int wallpaper_lbl=0x7f050002;
    }
    public static final class style {
        /**
        Base application theme, dependent on API level. This theme is replaced
        by AppBaseTheme from res/values-vXX/styles.xml on newer devices.

            Theme customizations available in newer API levels can go in
            res/values-vXX/styles.xml, while customizations related to
            backward-compatibility can go here.

        Base application theme for API 11+. This theme completely replaces
        AppBaseTheme from res/values/styles.xml on API 11+ devices.

 API 11 theme customizations can go here.

        Base application theme for API 14+. This theme completely replaces
        AppBaseTheme from BOTH res/values/styles.xml and
        res/values-v11/styles.xml on API 14+ devices.

 API 14 theme customizations can go here.
         */
        public static final int AppBaseTheme=0x7f060000;
        /**  Application theme.
 All customizations that are NOT specific to a particular API-level can go here.
         */
        public static final int AppTheme=0x7f060001;
    }
    public static final class xml {
        public static final int clock_wallpaper=0x7f040000;
        public static final int prefs=0x7f040001;
    }
}


text:
#ifndef T_STRUCT_H
#define T_STRUCT_H

#include <algorithm>
#include <vector>
#include <utility>
#include <string>

#include <thrift/compiler/parse/t_type.h>
#include <thrift/compiler/parse/t_field.h>

// Forward declare that puppy
class t_program;

/**
 * A struct is a container for a set of member fields that has a name. Structs
 * are also used to implement exception types.
 *
 */
class t_struct : public t_type {
 public:
  typedef std::vector<t_field*> members_type;

  explicit t_struct(t_program* program) :
    t_type(program),
    is_xception_(false),
    is_union_(false),
    view_parent_(nullptr),
    xsd_all_(false) {}

  t_struct(t_program* program, const std::string& name) :
    t_type(program, name),
    is_xception_(false),
    is_union_(false),
    view_parent_(nullptr),
    xsd_all_(false) {}

  void set_name(const std::string& name) override { name_ = name; }

  void set_xception(bool is_xception) {
    is_xception_ = is_xception;
  }

  void set_union(bool is_union) {
    is_union_ = is_union;
  }

  void set_xsd_all(bool xsd_all) {
    xsd_all_ = xsd_all;
  }

  bool get_xsd_all() const {
    return xsd_all_;
  }

  bool append(t_field* elem) {
    members_.push_back(elem);

    typedef members_type::iterator iter_type;
    std::pair<iter_type, iter_type> bounds = std::equal_range(
        members_in_id_order_.begin(),
        members_in_id_order_.end(),
        elem,
        t_field::key_compare()
    );
    if (bounds.first != bounds.second) {
      return false;
    }
    members_in_id_order_.insert(bounds.second, elem);
    return true;
  }

  const std::vector<t_field*>& get_members() const {
    return members_;
  }

  const t_field* get_member(const std::string& name) const {
    auto const result = std::find_if(
      members_.begin(), members_.end(),
      [&name](const t_field* m) { return m->get_name() == name; }
    );
    return result == members_.end() ? nullptr : *result;
  }

  const members_type& get_sorted_members() const {
    return members_in_id_order_;
  }

  bool is_union() const {
    return is_union_;
  }

  const t_field* get_field_named(const char* name) const {
    assert(has_field_named(name));
    for (auto& member: members_) {
      if (member->get_name() == name) {
        return member;
      }
    }

    assert(false);
    return nullptr;
  }

  bool is_struct() const override { return !is_xception_; }

  bool is_xception() const override { return is_xception_; }

  void set_view_parent(const t_struct* p) {
    view_parent_ = p;
  }

  const t_struct* get_view_parent() const {
    if (view_parent_ != nullptr) {
      return view_parent_->get_view_parent();
    } else {
      return this;
    }
  }

  bool is_view() const {
    return view_parent_ != nullptr;
  }

  bool has_field_named(const char* name) const {
    std::vector<t_field*>::const_iterator m_iter;
    for (m_iter = members_.begin(); m_iter != members_.end(); ++m_iter) {
      if ((*m_iter)->get_name() == name) {
        return true;
      }
    }

    return false;
  }

  bool validate_field(t_field* field) {
    int key = field->get_key();
    std::vector<t_field*>::const_iterator m_iter;
    for (m_iter = members_.begin(); m_iter != members_.end(); ++m_iter) {
      if ((*m_iter)->get_key() == key) {
        return false;
      }
    }
    return true;
  }

  std::string get_full_name() const override {
    return make_full_name("struct");
  }

  std::string get_impl_full_name() const override {
    return get_view_parent()->get_full_name();
  }

  TypeValue get_type_value() const override { return t_types::TYPE_STRUCT; }

 private:

  members_type members_;
  members_type members_in_id_order_;
  bool is_xception_;
  bool is_union_;

  const t_struct* view_parent_;

  bool xsd_all_;
};

#endif