text:
package akkit
package testkit

import akka.actor._
import akka.testkit._

import org.scalatest._

import scala.concurrent.duration._

class KitSpec extends UnitSpec {
  implicit val system = ActorSystem("kit-spec")

  "Kit" should "provide local implicit sender for a test" in new Kit {
    self ! "test"
    expectMsg("test")
  }

  it should "[1/2]: prevent messages from leaking between test cases" in new Kit {
    self ! "leaked"
  }

  it should "[2/2]: prevent messages from leaking between test cases" in new Kit {
    // make sure messages do not leak
    expectNoMsg(3.seconds)
  }

  new TestKit(system) with ImplicitSender {
    "Akka TestKit with ImplicitSender" should "be created" in {}

    it should "process all messages via a single mailbox" in {
      self ! "leaked"
    }

    it should "possibly leak messages between test cases" in {
      expectMsg("leaked")
    }
  }
}

// vim: set ts=2 sw=2 et sts=2:

redpajama_set_name: RedPajamaGithub


text:
@interface GroupListTableViewController : UITableViewController <RespokeClientDelegate, UIActionSheetDelegate> {
    NSMutableArray *groupsToJoin;
}

@property (weak) IBOutlet UIButton *statusButton;
@property (weak) IBOutlet UIActivityIndicatorView *activityIndicator;

- (IBAction)logoutAction;
- (IBAction)statusAction;

@end


text: windeployqt.exe --release --qmldir qml/ --no-translations --compiler-runtime release/2048-qt.exe


text:
"""Unit tests for ebs-supported APIs."""
import boto3
import hashlib
import sure  # noqa # pylint: disable=unused-import
from moto import mock_ebs, mock_ec2
from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID

# See our Development Tips on writing tests for hints on how to write good tests:
# http://docs.getmoto.org/en/latest/docs/contributing/development_tips/tests.html

@mock_ebs
def test_start_snapshot__minimal():
    client = boto3.client("ebs", region_name="eu-west-1")
    resp = client.start_snapshot(VolumeSize=720)

    resp.should.have.key("SnapshotId")
    resp.should.have.key("OwnerId").equals(ACCOUNT_ID)
    resp.should.have.key("Status").equals("pending")
    resp.should.have.key("StartTime")
    resp.should.have.key("VolumeSize").equals(720)
    resp.should.have.key("BlockSize").equals(512)

@mock_ebs
def test_start_snapshot():
    client = boto3.client("ebs", region_name="eu-west-1")
    resp = client.start_snapshot(
        VolumeSize=120,
        Tags=[{"Key": "kt", "Value": "vt"}],
        Description="my fancy snapshot",
    )

    resp.should.have.key("SnapshotId")
    resp.should.have.key("OwnerId").equals(ACCOUNT_ID)
    resp.should.have.key("Status").equals("pending")
    resp.should.have.key("StartTime")
    resp.should.have.key("VolumeSize").equals(120)
    resp.should.have.key("BlockSize").equals(512)
    resp.should.have.key("Tags").equals([{"Key": "kt", "Value": "vt"}])
    resp.should.have.key("Description").equals("my fancy snapshot")

@mock_ebs
def test_complete_snapshot():
    client = boto3.client("ebs", region_name="ap-southeast-1")
    snapshot_id = client.start_snapshot(VolumeSize=720)["SnapshotId"]

    resp = client.complete_snapshot(SnapshotId=snapshot_id, ChangedBlocksCount=0)
    resp.should.have.key("Status").equals("completed")

@mock_ebs
def test_put_snapshot_block():
    data = b"data for this specific block"
    checksum = hashlib.sha256(data).hexdigest()
    client = boto3.client("ebs", region_name="eu-west-1")
    snapshot_id = client.start_snapshot(VolumeSize=720)["SnapshotId"]
    resp = client.put_snapshot_block(
        SnapshotId=snapshot_id,
        BlockIndex=5,
        BlockData=data,
        DataLength=524288,
        Checksum=checksum,
        ChecksumAlgorithm="SHA256",
    )

    resp.should.have.key("Checksum").equals(checksum)
    resp.should.have.key("ChecksumAlgorithm").equals("SHA256")

@mock_ebs
def test_get_snapshot_block():
    client = boto3.client("ebs", region_name="eu-west-1")
    snapshot_id = client.start_snapshot(VolumeSize=720)["SnapshotId"]
    for idx, data in [(1, b"data 1"), (2, b"data 2"), (3, b"data 3")]:
        checksum = hashlib.sha256(data).hexdigest()
        client.put_snapshot_block(
            SnapshotId=snapshot_id,
            BlockIndex=idx,
            BlockData=data,
            DataLength=524288,
            Checksum=checksum,
            ChecksumAlgorithm="SHA256",
        )

    resp = client.get_snapshot_block(
        SnapshotId=snapshot_id, BlockIndex=2, BlockToken="n/a"
    )

    resp.should.have.key("DataLength").equals(524288)
    resp.should.have.key("BlockData")
    resp["BlockData"].read().should.equal(b"data 2")
    resp.should.have.key("Checksum")
    resp.should.have.key("ChecksumAlgorithm").equals("SHA256")

@mock_ebs
def test_list_changed_blocks():
    client = boto3.client("ebs", region_name="ap-southeast-1")
    snapshot_id1 = client.start_snapshot(VolumeSize=415)["SnapshotId"]
    snapshot_id2 = client.start_snapshot(VolumeSize=415)["SnapshotId"]
    for idx, data in [(1, b"data 1"), (2, b"data 2"), (3, b"data 3")]:
        checksum = hashlib.sha256(data).hexdigest()
        client.put_snapshot_block(
            SnapshotId=snapshot_id1,
            BlockIndex=idx,
            BlockData=data,
            DataLength=524288,
            Checksum=checksum,
            ChecksumAlgorithm="SHA256",
        )
    for idx, data in [(1, b"data 1.1"), (2, b"data 2"), (4, b"data 3.1")]:
        checksum = hashlib.sha256(data).hexdigest()
        client.put_snapshot_block(
            SnapshotId=snapshot_id2,
            BlockIndex=idx,
            BlockData=data,
            DataLength=524288,
            Checksum=checksum,
            ChecksumAlgorithm="SHA256",
        )
    resp = client.list_changed_blocks(
        FirstSnapshotId=snapshot_id1, SecondSnapshotId=snapshot_id2
    )
    changed_blocks = resp["ChangedBlocks"]
    changed_idxes = [b["BlockIndex"] for b in changed_blocks]
    changed_idxes.should.equal([1, 3])

    changed_blocks[0].should.have.key("FirstBlockToken")
    changed_blocks[0].should.have.key("SecondBlockToken")

    changed_blocks[1].should.have.key("FirstBlockToken")
    changed_blocks[1].shouldnt.have.key("SecondBlockToken")

@mock_ebs
def test_list_snapshot_blocks():
    client = boto3.client("ebs", region_name="ap-southeast-1")
    snapshot_id = client.start_snapshot(VolumeSize=415)["SnapshotId"]
    for idx, data in [(1, b"data 1"), (2, b"data 2"), (3, b"data 3")]:
        checksum = hashlib.sha256(data).hexdigest()
        client.put_snapshot_block(
            SnapshotId=snapshot_id,
            BlockIndex=idx,
            BlockData=data,
            DataLength=524288,
            Checksum=checksum,
            ChecksumAlgorithm="SHA256",
        )

    resp = client.list_snapshot_blocks(SnapshotId=snapshot_id)

    resp.should.have.key("VolumeSize").equals(415)
    resp.should.have.key("BlockSize").equals(512)
    resp.should.have.key("Blocks").length_of(3)

    [b["BlockIndex"] for b in resp["Blocks"]].should.equal([1, 2, 3])

@mock_ebs
@mock_ec2
def test_start_snapshot__should_be_created_in_ec2():
    ebs = boto3.client("ebs", region_name="eu-north-1")
    ec2 = boto3.client("ec2", region_name="eu-north-1")
    snapshot_id = ebs.start_snapshot(VolumeSize=720)["SnapshotId"]
    resp = ec2.describe_snapshots(SnapshotIds=[snapshot_id])["Snapshots"]
    resp.should.have.length_of(1)

    resp[0].should.have.key("VolumeSize").equals(720)


text:
.class Lcom/htc/opensense/social/SocialManager$1;
.super Lcom/htc/opensense/social/SocialManager$BaseFutureTask;
.source "SocialManager.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/htc/opensense/social/SocialManager;->hasFeatures(Landroid/accounts/Account;[Ljava/lang/String;Lcom/htc/opensense/social/SocialManagerCallback;Landroid/os/Handler;)Lcom/htc/opensense/social/SocialManagerFuture;
.end annotation

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

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/htc/opensense/social/SocialManager$BaseFutureTask",
        "<",
        "Ljava/lang/Boolean;",
        ">;"
    }
.end annotation

# instance fields
.field final synthetic this$0:Lcom/htc/opensense/social/SocialManager;

.field final synthetic val$account:Landroid/accounts/Account;

.field final synthetic val$features:[Ljava/lang/String;

# direct methods
.method constructor <init>(Lcom/htc/opensense/social/SocialManager;Landroid/os/Handler;Lcom/htc/opensense/social/SocialManagerCallback;Landroid/accounts/Account;[Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter "x0"
    .parameter
    .parameter
    .parameter

    .prologue
    .line 316
    .local p3, x1:Lcom/htc/opensense/social/SocialManagerCallback;,"Lcom/htc/opensense/social/SocialManagerCallback<Ljava/lang/Boolean;>;"
    iput-object p1, p0, Lcom/htc/opensense/social/SocialManager$1;->this$0:Lcom/htc/opensense/social/SocialManager;

    iput-object p4, p0, Lcom/htc/opensense/social/SocialManager$1;->val$account:Landroid/accounts/Account;

    iput-object p5, p0, Lcom/htc/opensense/social/SocialManager$1;->val$features:[Ljava/lang/String;

    invoke-direct {p0, p1, p2, p3}, Lcom/htc/opensense/social/SocialManager$BaseFutureTask;-><init>(Lcom/htc/opensense/social/SocialManager;Landroid/os/Handler;Lcom/htc/opensense/social/SocialManagerCallback;)V

    return-void
.end method

# virtual methods
.method public bundleToResult(Landroid/os/Bundle;)Ljava/lang/Boolean;
    .locals 2
    .parameter "bundle"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/htc/opensense/social/PluginException;
        }
    .end annotation

    .prologue
    .line 325
    if-eqz p1, :cond_0

    const-string v0, "booleanResult"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->containsKey(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_1

    .line 326
    :cond_0
    new-instance v0, Lcom/htc/opensense/social/PluginException;

    const-string v1, "no result in response"

    invoke-direct {v0, v1}, Lcom/htc/opensense/social/PluginException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 328
    :cond_1
    const-string v0, "booleanResult"

    invoke-virtual {p1, v0}, Landroid/os/Bundle;->getBoolean(Ljava/lang/String;)Z

    move-result v0

    invoke-static {v0}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

    move-result-object v0

    return-object v0
.end method

.method public bridge synthetic bundleToResult(Landroid/os/Bundle;)Ljava/lang/Object;
    .locals 1
    .parameter "x0"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lcom/htc/opensense/social/PluginException;
        }
    .end annotation

    .prologue
    .line 316
    invoke-virtual {p0, p1}, Lcom/htc/opensense/social/SocialManager$1;->bundleToResult(Landroid/os/Bundle;)Ljava/lang/Boolean;

    move-result-object v0

    return-object v0
.end method

.method public doWork()V
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Landroid/os/RemoteException;
        }
    .end annotation

    .prologue
    .line 320
    iget-object v0, p0, Lcom/htc/opensense/social/SocialManager$1;->this$0:Lcom/htc/opensense/social/SocialManager;

    #getter for: Lcom/htc/opensense/social/SocialManager;->mService:Lcom/htc/opensense/social/ISocialManager;
    invoke-static {v0}, Lcom/htc/opensense/social/SocialManager;->access$000(Lcom/htc/opensense/social/SocialManager;)Lcom/htc/opensense/social/ISocialManager;

    move-result-object v0

    iget-object v1, p0, Lcom/htc/opensense/social/SocialManager$BaseFutureTask;->mResponse:Lcom/htc/opensense/social/ISocialManagerResponse;

    iget-object v2, p0, Lcom/htc/opensense/social/SocialManager$1;->val$account:Landroid/accounts/Account;

    iget-object v3, p0, Lcom/htc/opensense/social/SocialManager$1;->val$features:[Ljava/lang/String;

    invoke-interface {v0, v1, v2, v3}, Lcom/htc/opensense/social/ISocialManager;->hasFeatures(Lcom/htc/opensense/social/ISocialManagerResponse;Landroid/accounts/Account;[Ljava/lang/String;)V

    .line 321
    return-void
.end method


text:
#ifndef FLATBUFFERS_HASH_H_
#define FLATBUFFERS_HASH_H_

#include <cstdint>
#include <cstring>

#include "flatbuffers/flatbuffers.h"

namespace flatbuffers {

template<typename T> struct FnvTraits {
  static const T kFnvPrime;
  static const T kOffsetBasis;
};

template<> struct FnvTraits<uint32_t> {
  static const uint32_t kFnvPrime = 0x01000193;
  static const uint32_t kOffsetBasis = 0x811C9DC5;
};

template<> struct FnvTraits<uint64_t> {
  static const uint64_t kFnvPrime = 0x00000100000001b3ULL;
  static const uint64_t kOffsetBasis = 0xcbf29ce484222645ULL;
};

template<typename T> FLATBUFFERS_CONSTEXPR_CPP14 T HashFnv1(const char *input) {
  T hash = FnvTraits<T>::kOffsetBasis;
  for (const char *c = input; *c; ++c) {
    hash *= FnvTraits<T>::kFnvPrime;
    hash ^= static_cast<unsigned char>(*c);
  }
  return hash;
}

template<typename T> FLATBUFFERS_CONSTEXPR_CPP14 T HashFnv1a(const char *input) {
  T hash = FnvTraits<T>::kOffsetBasis;
  for (const char *c = input; *c; ++c) {
    hash ^= static_cast<unsigned char>(*c);
    hash *= FnvTraits<T>::kFnvPrime;
  }
  return hash;
}

template <> FLATBUFFERS_CONSTEXPR_CPP14 inline uint16_t HashFnv1<uint16_t>(const char *input) {
  uint32_t hash = HashFnv1<uint32_t>(input);
  return (hash >> 16) ^ (hash & 0xffff);
}

template <> FLATBUFFERS_CONSTEXPR_CPP14 inline uint16_t HashFnv1a<uint16_t>(const char *input) {
  uint32_t hash = HashFnv1a<uint32_t>(input);
  return (hash >> 16) ^ (hash & 0xffff);
}

template <typename T> struct NamedHashFunction {
  const char *name;

  typedef T (*HashFunction)(const char *);
  HashFunction function;
};

const NamedHashFunction<uint16_t> kHashFunctions16[] = {
  { "fnv1_16",  HashFnv1<uint16_t> },
  { "fnv1a_16", HashFnv1a<uint16_t> },
};

const NamedHashFunction<uint32_t> kHashFunctions32[] = {
  { "fnv1_32", HashFnv1<uint32_t> },
  { "fnv1a_32", HashFnv1a<uint32_t> },
};

const NamedHashFunction<uint64_t> kHashFunctions64[] = {
  { "fnv1_64", HashFnv1<uint64_t> },
  { "fnv1a_64", HashFnv1a<uint64_t> },
};

inline NamedHashFunction<uint16_t>::HashFunction FindHashFunction16(
    const char *name) {
  std::size_t size = sizeof(kHashFunctions16) / sizeof(kHashFunctions16[0]);
  for (std::size_t i = 0; i < size; ++i) {
    if (std::strcmp(name, kHashFunctions16[i].name) == 0) {
      return kHashFunctions16[i].function;
    }
  }
  return nullptr;
}

inline NamedHashFunction<uint32_t>::HashFunction FindHashFunction32(
    const char *name) {
  std::size_t size = sizeof(kHashFunctions32) / sizeof(kHashFunctions32[0]);
  for (std::size_t i = 0; i < size; ++i) {
    if (std::strcmp(name, kHashFunctions32[i].name) == 0) {
      return kHashFunctions32[i].function;
    }
  }
  return nullptr;
}

inline NamedHashFunction<uint64_t>::HashFunction FindHashFunction64(
    const char *name) {
  std::size_t size = sizeof(kHashFunctions64) / sizeof(kHashFunctions64[0]);
  for (std::size_t i = 0; i < size; ++i) {
    if (std::strcmp(name, kHashFunctions64[i].name) == 0) {
      return kHashFunctions64[i].function;
    }
  }
  return nullptr;
}

}  // namespace flatbuffers

#endif  // FLATBUFFERS_HASH_H_


text:
package app.enums;

public enum Role {
    ADMIN, USER
}


text:
"""
Copyright 2015 Reverb Technologies, Inc.

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

class V1beta3_EndpointSubset(object):
    """NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually."""

    def __init__(self):
        """
        Attributes:
          swaggerTypes (dict): The key is attribute name and the value is attribute type.
          attributeMap (dict): The key is attribute name and the value is json key in definition.
        """
        self.swaggerTypes = {

            'addresses': 'list[V1beta3_EndpointAddress]',

            'ports': 'list[V1beta3_EndpointPort]'

        }

        self.attributeMap = {

            'addresses': 'addresses',

            'ports': 'ports'

        }

        #IP addresses which offer the related ports

        self.addresses = None # list[V1beta3_EndpointAddress]

        #port numbers available on the related IP addresses

        self.ports = None # list[V1beta3_EndpointPort]


text:
				Question

<textarea rows="1" style="min-height:17px;" type="text" name="quest_text" id="quest_text"/>

				Difficulty

					<select class="span4" name="difficulty" id="difficulty">
						<option value="0,2">Very easy</option>
						<option value="0,4">Easy</option>
						<option value="0,6">Middle</option>
						<option value="0,8">Difficult</option>
						<option value="1">Very difficult</option>
					</select>

		<button class="btn primary" onclick="saveQuestion('<?php echo $id;?>')">Save</button>

				Answers
					<button class="btn small answerRow" quest_id="<?php echo $quest_id;?>" id="addAnswer" onclick="addMoreAnswer()">+</button>

Answer	Correct?	Explanation	Delete

		<button class="btn primary" id="save_all_answers" name="save_all_answers" quest_id="<?php echo $quest_id;?>" onclick="saveAllAnswers('<?php echo $quest_id;?>')">Save answers</button>


text:
'use strict';

angular.module('fiveApi.docs.traps', [])
  .controller('DocsTrapsController', function() {
  })
  .config(function($stateProvider) {
    $stateProvider
      .state('docs.traps', {
        url: '/traps',
        templateUrl: 'app/docs/traps/traps.html',
        controller: 'DocsTrapsController'
      });
  });


text:
.outer_face {
    position: relative;
    width: 180px; /* width of clock */
    height: 180px; /* height of clock */
    border-radius: 180px; /* clock round corner radius */
    background: white;
    box-shadow: 0 0 20px 1px gray inset;
    border: 2px solid gray; /* thickness of outer border */
}

.outer_face::before, .outer_face::after, .outer_face .marker { /* time markers syle */
    content: "";
    position: absolute;
    width: 8px; /* width of 12-6 and 3-9 markers */
    height: 100%;
    background: #666;
    z-index: 0;
    left: 50%;
    margin-left: -4px; /* set this value of 1/2 marker width */
    top: 0
}

.outer_face::after {
    -moz-transform: rotate(90deg);
    -ms-transform: rotate(90deg);
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg)
}

.outer_face .marker {
    background: gray;
    width: 4px; /* width of all other markers */
    margin-left: -3px /* set this value of 1/2 marker width */
}

.outer_face .marker.oneseven {
    -moz-transform: rotate(30deg);
    -ms-transform: rotate(30deg);
    -webkit-transform: rotate(30deg);
    transform: rotate(30deg)
}

.outer_face .marker.twoeight {
    -moz-transform: rotate(60deg);
    -ms-transform: rotate(60deg);
    -webkit-transform: rotate(60deg);
    transform: rotate(60deg)
}

.outer_face .marker.fourten {
    -moz-transform: rotate(120deg);
    -ms-transform: rotate(120deg);
    -webkit-transform: rotate(120deg);
    transform: rotate(120deg)
}

.outer_face .marker.fiveeleven {
    -moz-transform: rotate(150deg);
    -ms-transform: rotate(150deg);
    -webkit-transform: rotate(150deg);
    transform: rotate(150deg)
}

.inner_face {
    position: relative;
    width: 88%;
    height: 88%;
    background: white;
    -moz-border-radius: 1000px;
    -webkit-border-radius: 1000px;
    border-radius: 1000px;
    z-index: 1000;
    left: 6%; /* set this value of 1/2 width value*/
    top: 6% /* set this value of 1/2 height value*/
}

.inner_face::before {
    /* clock center circle small */
    content: "";
    width: 18px; /* width of inner circle */
    height: 18px; /* height of inner circle */
    border-radius: 18px;
    margin-left: -9px; /* set this value of 1/2 width value*/
    margin-top: -9px; /* set this value of 1/2 height value*/
    background: #333;
    position: absolute;
    top: 50%;
    left: 50%;
    box-shadow: 0 0 30px purple;
}

.inner_face::after {
    content: "GRAPECITY";
    position: absolute;
    width: 100%;
    font: normal 0.8em Arial;
    color: gray;
    text-align: center;
    top: 75%
}

.hand, .hand.hour {
    position: absolute;
    width: 4px; /* width of hour hand */
    height: 30%; /* height of hour hand */
    top: 20%; /* set top to 50% - height */
    left: 50%;
    margin-left: -2px; /* set this value to 1/2 width */
    background: #333;
    -moz-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
    -moz-transform-origin: bottom;
    -ms-transform-origin: bottom;
    -webkit-transform-origin: bottom;
    transform-origin: bottom;
    z-index: -1;
    -moz-box-shadow: 0 0 3px gray;
    -webkit-box-shadow: 0 0 3px gray;
    box-shadow: 0 0 3px gray
}

.hand.minute {
    height: 45%; /* height of min hand */
    top: 5%; /* set top to 50% - height */
    width: 5px; /* width of min hand */
    margin-left: -2.5px; /* set this value to 1/2 width */
}

.hand.second {
    height: 50%; /* height of sec hand */
    width: 2px; /* width of sec hand */
    margin-left: -1px; /* set this value to 1/2 width */
    top: 0;
    background: red
}


text:
template< class DmeType, bool Counted = false >
class CDmeHandle : public CDmeElementRefHelper
{
public:
	CDmeHandle() : m_handle( DMELEMENT_HANDLE_INVALID )
	{
	}

	explicit CDmeHandle( CDmElement *pObject ) : m_handle( DMELEMENT_HANDLE_INVALID )
	{
		Set( pObject );
	}

	CDmeHandle( DmElementHandle_t h ) : m_handle( DMELEMENT_HANDLE_INVALID )
	{
		Set( h );
	}

	CDmeHandle( const CDmeHandle< DmeType, Counted > &handle ) : m_handle( DMELEMENT_HANDLE_INVALID )
	{
		Set( handle.m_handle );
	}

	template < class T, bool B >
	CDmeHandle( const CDmeHandle< T, B > &handle ) : m_handle( DMELEMENT_HANDLE_INVALID )
	{
		DmeType *p = ( T* )NULL; // triggers compiler error if converting from invalid handle type
		NOTE_UNUSED( p );

		Set( handle.GetHandle() );
	}

	~CDmeHandle()
	{
		if ( !g_pDataModel )
			return; // some handles are static, and don't get destroyed until program termination

		Unref( m_handle, Counted );
	}

	template < class T, bool B >
	CDmeHandle& operator=( const CDmeHandle< T, B > &handle )
	{
		DmeType *p = ( T* )NULL; // triggers compiler error if converting from invalid handle type
		NOTE_UNUSED( p );

		Set( handle.GetHandle() );
		return *this;
	}

	DmeType *Get()
	{
		return static_cast< DmeType* >( g_pDataModel->GetElement( m_handle ) );
	}

	const DmeType *Get() const
	{
		return static_cast< DmeType* >( g_pDataModel->GetElement( m_handle ) );
	}

	DmElementHandle_t GetHandle() const
	{
		return m_handle;
	}

	void Set( CDmElement *pObject )
	{
		Set( pObject ? pObject->GetHandle() : DMELEMENT_HANDLE_INVALID );
	}

	void Set( DmElementHandle_t h )
	{
		if ( h == m_handle )
			return;

		Unref( m_handle, Counted );

		m_handle = h;
		if ( h != DMELEMENT_HANDLE_INVALID )
		{
			CDmElement *pElement = g_pDataModel->GetElement( m_handle );
			Assert( pElement );
			if ( pElement && !pElement->IsA( DmeType::GetStaticTypeSymbol() ) )
			{
				m_handle = DMELEMENT_HANDLE_INVALID;
			}
		}

		Ref( m_handle, Counted );
	}

	operator DmeType*()
	{
		return Get();
	}

	operator const DmeType*() const
	{
		return Get();
	}

	operator DmElementHandle_t() const
	{
		return m_handle;
	}

	DmeType* operator->()
	{
		return Get();
	}

	const DmeType* operator->() const
	{
		return Get();
	}

	CDmeHandle& operator=( DmElementHandle_t h )
	{
		Set( h );
		return *this;
	}

	CDmeHandle& operator=( CDmElement *pObject )
	{
		Set( pObject );
		return *this;
	}

	bool operator==( const CDmeHandle< DmeType > &h ) const
	{
		return m_handle == h.m_handle;
	}

	bool operator!=( const CDmeHandle< DmeType > &h ) const
	{
		return !operator==( h );
	}

	bool operator<( const CDmeHandle< DmeType > &h ) const
	{
		return m_handle < h.m_handle;
	}

	bool operator==( DmeType *pObject )	const
	{
		DmElementHandle_t h = pObject ? pObject->GetHandle() : DMELEMENT_HANDLE_INVALID;
		return m_handle == h;
	}

	bool operator!=( DmeType *pObject )	const
	{
		return !operator==( pObject );
	}

	bool operator==( DmElementHandle_t h ) const
	{
		return ( m_handle == h );
	}

	bool operator!=( DmElementHandle_t h ) const
	{
		return ( m_handle != h );
	}

	operator bool() const
	{
		return ( Get() != NULL );
	}

	bool operator!() const
	{
		return ( Get() == NULL );
	}

private:
	DmElementHandle_t m_handle;
};

typedef CDmeHandle< CDmElement, true > CDmeCountedHandle;

//-----------------------------------------------------------------------------
// Vector of element handles
//-----------------------------------------------------------------------------
typedef CUtlVector< CDmeHandle<CDmElement> > DmeHandleVec_t;

//-----------------------------------------------------------------------------
// helper class for undo classes to allow them to hold onto refcounted element handles
//-----------------------------------------------------------------------------

template< typename T >
class CDmAttributeUndoStorageType
{
public:
	typedef T UndoStorageType;
};

template<>
class CDmAttributeUndoStorageType< DmElementHandle_t >
{
public:
	typedef CDmeCountedHandle UndoStorageType;
};

template<>
class CDmAttributeUndoStorageType< CUtlVector< DmElementHandle_t > >
{
public:
	typedef CUtlVector< CDmeCountedHandle > UndoStorageType;
};

#endif // DMEHANDLE_H


text:
function polys = contourMatrixToPolylines(C)
%CONTOURMATRIXTOPOLYLINES Converts a contour matrix array into a polyline set.
%
%   POLYS = contourMatrixToPolylines(C)
%   Converts the contour matrix array, as given as the result of the
%   contourc function, into a set of polylines.
%
%   Example
%     img = imread('circles.png');
%     C = contourc(img, 1);
%     polys = contourMatrixToPolylines(C);
%     imshow(img); hold on;
%     drawPolyline(polys, 'Color', 'r', 'LineWidth', 2);
%
%   See also
%     polygons2d, contour, contourc

% ------
% Author: David Legland
% e-mail: david.legland@grignon.inra.fr
% Created: 2013-08-22,    using Matlab 7.9.0.529 (R2009b)
% Copyright 2013 INRA - Cepia Software Platform.

% size of the contour matrix array
nCoords = size(C, 2);

% first, compute the number of contours
nContours = 0;
offset = 1;
while offset < nCoords
    nContours = nContours + 1;
    offset = offset + C(2, offset) + 1;
end

% extract each contour as a polygon or polyline
polys = cell(nContours, 1);
offset = 1;
for iContour = 1:nContours
    nv = C(2, offset);
    polys{iContour} = C(:, offset + (1:nv))';
    offset = offset + nv + 1;
end


text:
<?php
/**
 * Created by PhpStorm.
 * User: jonasse
 * Date: 22.10.14
 * Time: 12:01
 */

namespace Tixi\ApiBundle\Controller\Export;

use APY\BreadcrumbTrailBundle\Annotation\Breadcrumb;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Config\Definition\Exception\Exception;
use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Tixi\ApiBundle\Form\Export\DownloadType;
use Tixi\ApiBundle\Menu\MenuService;
use Tixi\ApiBundle\Tile\Core\PanelTile;
use Tixi\ApiBundle\Form\Export\BillingType;
use Tixi\ApiBundle\Tile\Export\BillingTile;
use Tixi\ApiBundle\Tile\Export\ExportFormTile;
use Tixi\ApiBundle\Tile\Core\RootPanel;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Filesystem\Exception\IOException;
use Tixi\ApiBundle\Controller\Export\DownloadController;
use Tixi\App\AppBundle\Export\BillingWrapperDTO;

/**
 * Class BillingController
 * @package Tixi\ApiBundle\Controller\Export
 * @Route("/export/billing")
 * @Breadcrumb("billing.panel.name", route="tixiapi_export_billing")
 * @throws \Exception
 */
class BillingController extends Controller {

    protected $menuId;
    protected $errorMessage;

    public function __construct()
    {
        $this->menuId = MenuService::$menuExportBillingId;
    }

    private function getPostfix() {
        /** output: yyyymmddhhmmss.mmm */
        list($usec, $sec) = explode(' ', microtime());
        $usec = str_replace('0.', '.', round($usec, 3));
        return date('.Ymd.His', $sec).$usec;
    }

    /**
     * @Route("",name="tixiapi_export_billing")
     * @Method({"GET","POST"})
     * @param Request $request
     * @param bool $embeddedState
     * @throws AccessDeniedException
     * @return \Symfony\Component\HttpFoundation\RedirectResponse | Response
     */
    public function getBillingAction(
                        Request $request,
                        $embeddedState = false)
    {
        /**
         * select the billing information to download
         * create an Excel file with billing information
         */
        $form = $this->createForm(new BillingType($this->menuId));
        $form->handleRequest($request);
        $content = $this->get('request')->request->all();
        $tr = $this->get('translator');

        if ($content != array()){
            /* OK: received data from user */
            if ($form->isValid()){
                $formdata = reset($content);
                if ($formdata['ctrlWorkingMonthId'] != ''){

                    /* OK: create fully qualified filename */
                    $subFolder = 'download';
                    $tenant = $this->container->getParameter('tixi_parameter_client_name');
                    $tenant = ucwords(strtolower($tenant));
                    $filename = $tr->trans('billing.panel.name');
                    $extension = $formdata['ctrlFileType'];
                    $folderService = $this->get('tixi_app.folderservice');
                    $path = $folderService->getPath($subFolder);
                    $path .= '/'.$tenant.'.'.$filename.$this->getPostfix().'.'.$extension;
                    $path = $folderService->filenameToAscii($path);

                    /* OK: create download file */
                    $download = new BillingWrapperDTO();
                    $download->setContainer($this->container);
                    $download->setProperties($formdata);
                    $download->createFile($path);

                    /* OK: redirect to download page */
                    return $this->redirect($this->generateUrl(
                                'tixiapi_export_download',
                                array( 'filename' => urlencode($path))));
                } else {
                    $form->addError(
                        new FormError($tr->trans('billing.error.pleaseChoose')));
                }
            } else {
                $form->addError(
                    new FormError($tr->trans('drivingconfig.message.software')));
            }
        } else {
            /* OK: no user data present yet */
        }

        $rootPanel = new RootPanel($this->menuId, 'billing.panel.fullname');
        $rootPanel->add(new ExportFormTile($form, true));

        $tileRenderer = $this->get('tixi_api.tilerenderer');
        return new Response($tileRenderer->render($rootPanel));
    }
}


text:
// ReSharper disable InheritdocConsiderUsage
namespace NExpect.Interfaces
{
    /// <summary>
    /// Provides the initial ".To" grammar extension
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface ITo<T> : ICanAddMatcher<T>
    {
        /// <summary>
        /// Negates the expectation
        /// </summary>
        INotAfterTo<T> Not { get; }
        /// <summary>
        /// Starts an expectation some kind of similarity
        /// </summary>
        IBe<T> Be { get; }
        /// <summary>
        /// Starts an expectation for some property
        /// </summary>
        IHave<T> Have { get; }
        /// <summary>
        /// Starts an expectation for a deep equality test
        /// </summary>
        IDeep<T> Deep { get; }
        /// <summary>
        /// Starts an expectation for an intersection equality test
        /// -> only tests properties and fields with the same name and type
        /// </summary>
        IIntersection<T> Intersection { get; }
    }
}


text:
<!-- use this template only to report a bug or ask a question -->
<!-- fill this part for bugs reporting or questions -->
### Configuration

 - **Operating system with version** :
 - **Node version** :
 - **Hexo version** :
 - **Hexo-cli version** :
 - **Tranquilpeak version** : <!-- Does the theme is original or modified? -->

<!-- fill this part for bugs reporting if needed  -->
### Actual behavior

<!-- fill this part for bugs reporting if needed  -->
### Expected behavior

<!-- fill this part for bugs reporting if needed -->
### Steps to reproduce the behavior


text:
<?php

namespace Cercanias\HttpAdapter;

/**
 * Based on https://github.com/geocoder-php/Geocoder
 * @author Rober Martín H <rmh.dev@gmail.com>
 */
interface HttpAdapterInterface
{
    /**
     * Returns content from a given url
     * @param string $url
     * @return string
     */
    public function getContent($url);

    /**
     * Returns the name of the HttpAdapter
     * @return string
     */
    public function getName();
}


text:
<?php

/**
 * Product search result block
 *
 * @category   Mage
 * @package    Mage_CatalogSearch
 * @module     Catalog
 */
class Mage_CatalogSearch_Block_Result extends Mage_Core_Block_Template
{
    /**
     * Catalog Product collection
     *
     * @var Mage_CatalogSearch_Model_Resource_Fulltext_Collection
     */
    protected $_productCollection;

    /**
     * Retrieve query model object
     *
     * @return Mage_CatalogSearch_Model_Query
     */
    protected function _getQuery()
    {
        return $this->helper('catalogsearch')->getQuery();
    }

    /**
     * Prepare layout
     *
     * @return Mage_CatalogSearch_Block_Result
     */
    protected function _prepareLayout()
    {
        // add Home breadcrumb
        $breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
        if ($breadcrumbs) {
            $title = $this->__("Search results for: '%s'", $this->helper('catalogsearch')->getQueryText());

            $breadcrumbs->addCrumb('home', array(
                'label' => $this->__('Home'),
                'title' => $this->__('Go to Home Page'),
                'link'  => Mage::getBaseUrl()
            ))->addCrumb('search', array(
                'label' => $title,
                'title' => $title
            ));
        }

        // modify page title
        $title = $this->__("Search results for: '%s'", $this->helper('catalogsearch')->getEscapedQueryText());
        $this->getLayout()->getBlock('head')->setTitle($title);

        return parent::_prepareLayout();
    }

    /**
     * Retrieve additional blocks html
     *
     * @return string
     */
    public function getAdditionalHtml()
    {
        return $this->getLayout()->getBlock('search_result_list')->getChildHtml('additional');
    }

    /**
     * Retrieve search list toolbar block
     *
     * @return Mage_Catalog_Block_Product_List
     */
    public function getListBlock()
    {
        return $this->getChild('search_result_list');
    }

    /**
     * Set search available list orders
     *
     * @return Mage_CatalogSearch_Block_Result
     */
    public function setListOrders()
    {
        $category = Mage::getSingleton('catalog/layer')
            ->getCurrentCategory();
        /* @var $category Mage_Catalog_Model_Category */
        $availableOrders = $category->getAvailableSortByOptions();
        unset($availableOrders['position']);
        $availableOrders = array_merge(array(
            'relevance' => $this->__('Relevance')
        ), $availableOrders);

        $this->getListBlock()
            ->setAvailableOrders($availableOrders)
            ->setDefaultDirection('desc')
            ->setSortBy('relevance');

        return $this;
    }

    /**
     * Set available view mode
     *
     * @return Mage_CatalogSearch_Block_Result
     */
    public function setListModes()
    {
        $this->getListBlock()
            ->setModes(array(
                'grid' => $this->__('Grid'),
                'list' => $this->__('List'))
            );
        return $this;
    }

    /**
     * Set Search Result collection
     *
     * @return Mage_CatalogSearch_Block_Result
     */
    public function setListCollection()
    {
//        $this->getListBlock()
//           ->setCollection($this->_getProductCollection());
       return $this;
    }

    /**
     * Retrieve Search result list HTML output
     *
     * @return string
     */
    public function getProductListHtml()
    {
        return $this->getChildHtml('search_result_list');
    }

    /**
     * Retrieve loaded category collection
     *
     * @return Mage_CatalogSearch_Model_Resource_Fulltext_Collection
     */
    protected function _getProductCollection()
    {
        if (is_null($this->_productCollection)) {
            $this->_productCollection = $this->getListBlock()->getLoadedProductCollection();
        }

        return $this->_productCollection;
    }

    /**
     * Retrieve search result count
     *
     * @return string
     */
    public function getResultCount()
    {
        if (!$this->getData('result_count')) {
            $size = $this->_getProductCollection()->getSize();
            $this->_getQuery()->setNumResults($size);
            $this->setResultCount($size);
        }
        return $this->getData('result_count');
    }

    /**
     * Retrieve No Result or Minimum query length Text
     *
     * @return string
     */
    public function getNoResultText()
    {
        if (Mage::helper('catalogsearch')->isMinQueryLength()) {
            return Mage::helper('catalogsearch')->__('Minimum Search query length is %s', $this->_getQuery()->getMinQueryLength());
        }
        return $this->_getData('no_result_text');
    }

    /**
     * Retrieve Note messages
     *
     * @return array
     */
    public function getNoteMessages()
    {
        return Mage::helper('catalogsearch')->getNoteMessages();
    }
}


text:
<?php

require_once 'phing/Task.php';
require_once 'phing/system/io/PhingFile.php';
require_once 'phing/system/io/FileWriter.php';
require_once 'phing/util/ExtendedFileStream.php';

/**
 * Transform a PHPUnit xml report using XSLT.
 * This transformation generates an html report in either framed or non-framed
 * style. The non-framed style is convenient to have a concise report via mail,
 * the framed report is much more convenient if you want to browse into
 * different packages or testcases since it is a Javadoc like report.
 *
 * @author Michiel Rook <mrook@php.net>
 * @version $Id: b88d6fa4ca4717177b562a0475c81d92c161d9b4 $
 * @package phing.tasks.ext.phpunit
 * @since 2.1.0
 */
class PHPUnitReportTask extends Task
{
    private $format = "noframes";
    private $styleDir = "";
    private $toDir = "";

    /**
     * Whether to use the sorttable JavaScript library, defaults to false
     * See {@link http://www.kryogenix.org/code/browser/sorttable/)}
     *
     * @var boolean
     */
    private $useSortTable = false;

    /** the directory where the results XML can be found */
    private $inFile = "testsuites.xml";

    /**
     * Set the filename of the XML results file to use.
     */
    public function setInFile(PhingFile $inFile)
    {
        $this->inFile = $inFile;
    }

    /**
     * Set the format of the generated report. Must be noframes or frames.
     */
    public function setFormat($format)
    {
        $this->format = $format;
    }

    /**
     * Set the directory where the stylesheets are located.
     */
    public function setStyleDir($styleDir)
    {
        $this->styleDir = $styleDir;
    }

    /**
     * Set the directory where the files resulting from the
     * transformation should be written to.
     */
    public function setToDir(PhingFile $toDir)
    {
        $this->toDir = $toDir;
    }

    /**
     * Sets whether to use the sorttable JavaScript library, defaults to false
     * See {@link http://www.kryogenix.org/code/browser/sorttable/)}
     *
     * @param boolean $useSortTable
     */
    public function setUseSortTable($useSortTable)
    {
        $this->useSortTable = (boolean) $useSortTable;
    }

    /**
     * Returns the path to the XSL stylesheet
     */
    protected function getStyleSheet()
    {
        $xslname = "phpunit-" . $this->format . ".xsl";

        if ($this->styleDir)
        {
            $file = new PhingFile($this->styleDir, $xslname);
        }
        else
        {
            $path = Phing::getResourcePath("phing/etc/$xslname");

            if ($path === NULL)
            {
                $path = Phing::getResourcePath("etc/$xslname");

                if ($path === NULL)
                {
                    throw new BuildException("Could not find $xslname in resource path");
                }
            }

            $file = new PhingFile($path);
        }

        if (!$file->exists())
        {
            throw new BuildException("Could not find file " . $file->getPath());
        }

        return $file;
    }

    /**
     * Transforms the DOM document
     */
    protected function transform(DOMDocument $document)
    {
        if (!$this->toDir->exists())
        {
            throw new BuildException("Directory '" . $this->toDir . "' does not exist");
        }

        $xslfile = $this->getStyleSheet();

        $xsl = new DOMDocument();
        $xsl->load($xslfile->getAbsolutePath());

        $proc = new XSLTProcessor();
        if (defined('XSL_SECPREF_WRITE_FILE'))
        {
            if (version_compare(PHP_VERSION,'5.4',"<"))
            {
                ini_set("xsl.security_prefs", XSL_SECPREF_WRITE_FILE | XSL_SECPREF_CREATE_DIRECTORY);
            }
            else
            {
                $proc->setSecurityPrefs(XSL_SECPREF_WRITE_FILE | XSL_SECPREF_CREATE_DIRECTORY);
            }
        }

        $proc->importStyleSheet($xsl);
        $proc->setParameter('', 'output.sorttable', $this->useSortTable);

        if ($this->format == "noframes")
        {
            $writer = new FileWriter(new PhingFile($this->toDir, "phpunit-noframes.html"));
            $writer->write($proc->transformToXML($document));
            $writer->close();
        }
        else
        {
            ExtendedFileStream::registerStream();

            $toDir = (string) $this->toDir;

            // urlencode() the path if we're on Windows
            if (FileSystem::getFileSystem()->getSeparator() == '\\') {
                $toDir = urlencode($toDir);
            }

            // no output for the framed report
            // it's all done by extension...
            $proc->setParameter('', 'output.dir', $toDir);
            $proc->transformToXML($document);

            ExtendedFileStream::unregisterStream();
        }
    }

    /**
     * Fixes DOM document tree:
     *   - adds package="default" to 'testsuite' elements without
     *     package attribute
     *   - removes outer 'testsuite' container(s)
     */
    protected function fixDocument(DOMDocument $document)
    {
        $rootElement = $document->firstChild;

        $xp = new DOMXPath($document);

        $nodes = $xp->query("/testsuites/testsuite");

        foreach ($nodes as $node) {
            $children = $xp->query("./testsuite", $node);

            if ($children->length) {
                foreach ($children as $child) {
                    if (!$child->hasAttribute('package'))
                    {
                        $child->setAttribute('package', 'default');
                    }
                    $rootElement->appendChild($child);
                }

                $rootElement->removeChild($node);
            }
        }
    }

    /**
     * Initialize the task
     */
    public function init()
    {
        if (!class_exists('XSLTProcessor')) {
            throw new BuildException("PHPUnitReportTask requires the XSL extension");
        }
    }

    /**
     * The main entry point
     *
     * @throws BuildException
     */
    public function main()
    {
        $testSuitesDoc = new DOMDocument();
        $testSuitesDoc->load((string) $this->inFile);

        $this->fixDocument($testSuitesDoc);

        $this->transform($testSuitesDoc);
    }
}


text:
package com.mygdx.bulgar.client;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.ui.Button;
import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.TextField;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.utils.Align;
import com.mygdx.bulgar.controleur.ClientImpl;

/**
 * Created by Link2 on 04/02/2016.
 */
public class MainScreen extends BaseScreen {
    public MainScreen(final UiApp app) {
        super(app);
        configUI(100);
        final TextButton buttonConnect = new TextButton("Connect", app.skin);
        Label labelPseudo = new Label("Pseudo : ", app.skin);
        final TextField textFieldPseudo = new TextField("Unnamed", app.skin);
        buttonConnect.addListener(new ClickListener() {
            @Override
            public void clicked(InputEvent event, float x, float y) {
                app.switchScreens(new GameScreen(app, new ClientImpl("", 2, "jean")));
                /*ClientImpl client = new ClientImpl("192.168.0.105",2000,textFieldPseudo.getText());
                RoomScreen roomScreen = new RoomScreen(app, client);
                client.getGestionMess().addObserver(roomScreen);
                client.connect();
                app.switchScreens(roomScreen);
                buttonConnect.setChecked(false);*/
            }
        });
        mainTable.defaults().pad(6f);
        mainTable.add(label("Bulgard", Color.GREEN)).fill().expand().center();
        mainTable.row();
        Table tablePseudo = new Table();
        tablePseudo.add(labelPseudo);
        tablePseudo.add(textFieldPseudo).expandX().fillX();
        mainTable.add(tablePseudo).expandX().fillX();
        mainTable.row();
        mainTable.add(buttonConnect).colspan(mainTable.getColumns());

    }

    private void configUI(int size){
        Label label = new Label("",app.skin);
        TextField textField = new TextField("", app.skin);
        TextButton textButton = new TextButton("", app.skin);
        FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("cardigan.ttf"));
        FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
        parameter.size = size;
        textField.getStyle().font = generator.generateFont(parameter);
        label.getStyle().font = generator.generateFont(parameter);
        textButton.getStyle().font = generator.generateFont(parameter);
        generator.dispose();
    }

    /** used to tidy up the label adding a bit for the how to play description */
    private Label label(String text, Color color) {
        Label label = new Label(text, app.skin);
        label.setAlignment(Align.center, Align.center);
        label.setColor(color);
        return label;
    }

    @Override
    public void onBackPress() {
        Gdx.app.exit();
    }

}


text:
using Microsoft.Xna.Framework;
using System;
using System.Linq;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ObjectData;

namespace Castleroid.Tiles
{
    public class WiringSundial : ModTile
    {
        public override void SetDefaults()
        {
            // For some reason, setting tileFrameImportant will cause world gen to fail. Stack Overflow
            //Main.tileFrameImportant[Type] = true;

            Main.tileObsidianKill[Type] = true;
            TileObjectData.newTile.CopyFrom(TileObjectData.Style2xX);
            TileObjectData.addTile(Type);
            AddMapEntry(new Color(190, 230, 190), "WiringSundial");
            dustType = 11;
            disableSmartCursor = true;
        }

        public override void KillMultiTile(int i, int j, int frameX, int frameY)
        {
            Item.NewItem(i * 16, j * 16, 32, 48, mod.ItemType("WiringSundialItem"));
        }

        public override void HitWire(int i, int j)
        {
            // Find the coordinates of top left tile square through math
            int y = j - (Main.tile[i, j].frameY / 18);
            int x = i - (Main.tile[i, j].frameX / 18);

            Wiring.SkipWire(x, y);
            Wiring.SkipWire(x, y + 1);
            Wiring.SkipWire(x, y + 2);
            Wiring.SkipWire(x + 1, y);
            Wiring.SkipWire(x + 1, y + 1);
            Wiring.SkipWire(x + 1, y + 2);

            if (Wiring.CheckMech(x, y, 30))
            {

				Main.time = 32000.1;

            }
        }
    }

    public class WiringSundialItem : ModItem
    {
        public override void SetDefaults()
        {
            item.CloneDefaults(ItemID.Actuator);
            item.name = "WiringSundial";
            item.createTile = mod.TileType("WiringSundial");
            item.placeStyle = 0;
        }
    }

}


text:
export default {
  add: 'add',
  quoteRight: 'format_quote',
  undo: 'undo',
  arrowForward: 'arrow_forward',
  arrowBackward: 'arrow_back',
  arrowForwardBigAssVersion: 'forward',
  done: 'done',
  clear: 'clear',
  thumbUp: 'thumb_up',
  thumbDown: 'thumb_down',
  quote: 'format_quote',
  link: 'link',
  search: 'search',
  fingerprint: 'fingerprint',
  refresh: 'refresh',
  gesture: 'gesture',
  keyboardArrowDown: 'keyboard_arrow_down',
  cancel: 'cancel',
};


text:
PROJECT=demo
NODE_BIN=./node_modules/.bin
SRC = index.js $(wildcard lib/*.js)
CSS = \
	${PROJECT}.css

all: check compile

check: lint

compile: build/build.js build/build.css

build:
	mkdir -p $@

build/build.css: $(CSS) | build
	cat $^ > $@

build/build.js: node_modules $(SRC) | build
	$(NODE_BIN)/browserify \
		--debug \
    --transform envlocalify \
		--require ./index.js:$(PROJECT) \
		--outfile $@

.DELETE_ON_ERROR: build/build.js

node_modules: package.json
	yarn && touch $@

lint:
	../node_modules/.bin/jshint $(SRC)

clean:
	rm -fr build

distclean: clean
	rm -fr node_modules

.PHONY: clean lint check all compile test


text:
/* rsa.hpp provides RSA ES encrypt/decrypt, SSL (block type 1) sign and verify
*/

#ifndef TAO_CRYPT_RSA_HPP
#define TAO_CRYPT_RSA_HPP

#include "integer.hpp"
#include "random.hpp"

namespace TaoCrypt {

class Source;

// Public Key Length helper
class PK_Lengths {
    const Integer& image_;
public:
    explicit PK_Lengths(const Integer& i) : image_(i) {}

    word32 PaddedBlockBitLength()  const {return image_.BitCount() - 1;}
    word32 PaddedBlockByteLength() const
                {return BitsToBytes(PaddedBlockBitLength());}

    word32 FixedCiphertextLength()   const {return image_.ByteCount();}
    word32 FixedMaxPlaintextLength() const
                {return SaturatingSubtract(PaddedBlockBitLength() / 8, 10U); }
};

// RSA Public Key
class RSA_PublicKey {
protected:
    Integer n_;
    Integer e_;
public:
    RSA_PublicKey() {}
    explicit RSA_PublicKey(Source&);

    void Initialize(const Integer& n, const Integer& e) {n_ = n; e_ = e;}
    void Initialize(Source&);

    Integer ApplyFunction(const Integer& x) const;

    const Integer& GetModulus() const {return n_;}
    const Integer& GetPublicExponent() const {return e_;}

    void SetModulus(const Integer& n) {n_ = n;}
    void SetPublicExponent(const Integer& e) {e_ = e;}

    word32 FixedCiphertextLength()
    {
        return PK_Lengths(n_).FixedCiphertextLength();
    }

    RSA_PublicKey(const RSA_PublicKey& other) : n_(other.n_), e_(other.e_) {}
    RSA_PublicKey& operator=(const RSA_PublicKey& that)
    {
        RSA_PublicKey tmp(that);
        Swap(tmp);
        return *this;
    }

    void Swap(RSA_PublicKey& other)
    {
        n_.Swap(other.n_);
        e_.Swap(other.e_);
    }
};

// RSA Private Key
class RSA_PrivateKey : public RSA_PublicKey {
    Integer d_;
    Integer p_;
    Integer q_;
    Integer dp_;
    Integer dq_;
    Integer u_;
public:
    RSA_PrivateKey() {}
    explicit RSA_PrivateKey(Source&);

    void Initialize(const Integer& n,  const Integer& e, const Integer& d,
                    const Integer& p,  const Integer& q, const Integer& dp,
                    const Integer& dq, const Integer& u)
        {n_ = n; e_ = e; d_ = d; p_ = p; q_ = q; dp_ = dp; dq_ = dq; u_ = u;}
    void Initialize(Source&);

    Integer CalculateInverse(RandomNumberGenerator&, const Integer&) const;

    const Integer& GetPrime1() const {return p_;}
    const Integer& GetPrime2() const {return q_;}
    const Integer& GetPrivateExponent() const {return d_;}
    const Integer& GetModPrime1PrivateExponent() const {return dp_;}
    const Integer& GetModPrime2PrivateExponent() const {return dq_;}
    const Integer& GetMultiplicativeInverseOfPrime2ModPrime1() const
                   {return u_;}

    void SetPrime1(const Integer& p) {p_ = p;}
    void SetPrime2(const Integer& q) {q_ = q;}
    void SetPrivateExponent(const Integer& d) {d_ = d;}
    void SetModPrime1PrivateExponent(const Integer& dp) {dp_ = dp;}
    void SetModPrime2PrivateExponent(const Integer& dq) {dq_ = dq;}
    void SetMultiplicativeInverseOfPrime2ModPrime1(const Integer& u) {u_ = u;}
private:
    RSA_PrivateKey(const RSA_PrivateKey&);              // hide copy
    RSA_PrivateKey& operator=(const RSA_PrivateKey&);   // and assign
};

// block type 2 padding
class RSA_BlockType2  {
public:
    void   Pad(const byte*, word32, byte*, word32,
               RandomNumberGenerator&) const;
    word32 UnPad(const byte*, word32, byte*) const;
};

// block type 1 padding
class RSA_BlockType1  {
public:
    void   Pad(const byte*, word32, byte*, word32,
               RandomNumberGenerator&) const;
    word32 UnPad(const byte*, word32, byte*) const;
};

// RSA Encryptor, can use any padding
template<class Pad = RSA_BlockType2>
class RSA_Encryptor {
    const RSA_PublicKey& key_;
    Pad                  padding_;
public:
    explicit RSA_Encryptor(const RSA_PublicKey& k) : key_(k) {}

    void Encrypt(const byte*, word32, byte*, RandomNumberGenerator&);
    bool SSL_Verify(const byte* msg, word32 sz, const byte* sig);
};

// RSA Decryptor, can use any padding
template<class Pad = RSA_BlockType2>
class RSA_Decryptor {
    const RSA_PrivateKey& key_;
    Pad                   padding_;
public:
    explicit RSA_Decryptor(const RSA_PrivateKey& k) : key_(k) {}

    word32 Decrypt(const byte*, word32, byte*, RandomNumberGenerator&);
    void   SSL_Sign(const byte*, word32, byte*, RandomNumberGenerator&);
};

// Public Encrypt
template<class Pad>
void RSA_Encryptor<Pad>::Encrypt(const byte* plain, word32 sz, byte* cipher,
                                 RandomNumberGenerator& rng)
{
    PK_Lengths lengths(key_.GetModulus());
    if (sz > lengths.FixedMaxPlaintextLength())
        return;

    ByteBlock paddedBlock(lengths.PaddedBlockByteLength());
    padding_.Pad(plain, sz, paddedBlock.get_buffer(),
                 lengths.PaddedBlockBitLength(), rng);

    key_.ApplyFunction(Integer(paddedBlock.get_buffer(), paddedBlock.size())).
        Encode(cipher, lengths.FixedCiphertextLength());
}

// Private Decrypt
template<class Pad>
word32 RSA_Decryptor<Pad>::Decrypt(const byte* cipher, word32 sz, byte* plain,
                                   RandomNumberGenerator& rng)
{
    PK_Lengths lengths(key_.GetModulus());

    if (sz != lengths.FixedCiphertextLength())
        return 0;

    ByteBlock paddedBlock(lengths.PaddedBlockByteLength());
    Integer x = key_.CalculateInverse(rng, Integer(cipher,
                                      lengths.FixedCiphertextLength()).Ref());
    if (x.ByteCount() > paddedBlock.size())
        x = Integer::Zero();	// don't return false, prevents timing attack
    x.Encode(paddedBlock.get_buffer(), paddedBlock.size());
    return padding_.UnPad(paddedBlock.get_buffer(),
                          lengths.PaddedBlockBitLength(), plain);
}

// Private SSL type (block 1) Encrypt
template<class Pad>
void RSA_Decryptor<Pad>::SSL_Sign(const byte* message, word32 sz, byte* sig,
                                  RandomNumberGenerator& rng)
{
    RSA_PublicKey inverse;
    inverse.Initialize(key_.GetModulus(), key_.GetPrivateExponent());
    RSA_Encryptor<RSA_BlockType1> enc(inverse); // SSL Type
    enc.Encrypt(message, sz, sig, rng);
}

word32 SSL_Decrypt(const RSA_PublicKey& key, const byte* sig, byte* plain);

// Public SSL type (block 1) Decrypt
template<class Pad>
bool RSA_Encryptor<Pad>::SSL_Verify(const byte* message, word32 sz,
                                    const byte* sig)
{
    ByteBlock plain(PK_Lengths(key_.GetModulus()).FixedMaxPlaintextLength());
    if (SSL_Decrypt(key_, sig, plain.get_buffer()) != sz)
        return false;   // not right justified or bad padding

    if ( (memcmp(plain.get_buffer(), message, sz)) == 0)
        return true;
    return false;
}

typedef RSA_Encryptor<> RSAES_Encryptor;
typedef RSA_Decryptor<> RSAES_Decryptor;

} // namespace

#endif // TAO_CRYPT_RSA_HPP


text:
puppet-n1k-vxlangw
==================

Puppet code for N1k VXLAN gateway deployment.


text:
import numpy as np

from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from HPOlibConfigSpace.hyperparameters import UniformIntegerHyperparameter

from autosklearn.pipeline.components.base import AutoSklearnPreprocessingAlgorithm
from autosklearn.pipeline.constants import *

class TruncatedSVD(AutoSklearnPreprocessingAlgorithm):
    def __init__(self, target_dim, random_state=None):
        self.target_dim = int(target_dim)
        self.random_state = random_state
        self.preprocessor = None

    def fit(self, X, Y):
        import sklearn.decomposition

        target_dim = min(self.target_dim, X.shape[1] - 1)
        self.preprocessor = sklearn.decomposition.TruncatedSVD(
            target_dim, algorithm='randomized')
        # TODO: remove when migrating to sklearn 0.16
        # Circumvents a bug in sklearn
        # https://github.com/scikit-learn/scikit-learn/commit/f08b8c8e52663167819f242f605db39f3b5a6d0c
        # X = X.astype(np.float64)
        self.preprocessor.fit(X, Y)

        return self

    def transform(self, X):
        if self.preprocessor is None:
            raise NotImplementedError()
        return self.preprocessor.transform(X)

    @staticmethod
    def get_properties(dataset_properties=None):
        return {'shortname': 'TSVD',
                'name': 'Truncated Singular Value Decomposition',
                'handles_regression': True,
                'handles_classification': True,
                'handles_multiclass': True,
                'handles_multilabel': True,
                'is_deterministic': True,
                'input': (SPARSE, UNSIGNED_DATA),
                'output': (DENSE, INPUT)}

    @staticmethod
    def get_hyperparameter_search_space(dataset_properties=None):
        target_dim = UniformIntegerHyperparameter(
            "target_dim", 10, 256, default=128)
        cs = ConfigurationSpace()
        cs.add_hyperparameter(target_dim)
        return cs


text:
package monitor

import (
	_ "expvar"
	"fmt"
	"github.com/ooyala/go-dogstatsd"
	"net"
	"net/http"
)

// DataDogAgent client is the implementation of a client to talk with
// the datadog agent
type DataDogAgentClient struct {
	client *dogstatsd.Client
	conf   *MConf
}

// Init initialises a datadog client for agent
func (d *DataDogAgentClient) Init(conf *MConf) (err error) {
	defer recoverFromPanic(&err)
	d.conf = conf
	if !d.conf.Enabled {
		return nil
	}
	d.client, err = dogstatsd.New(conf.AgentServer)
	if err != nil {
		logMsg(errMsgTag, err, d.conf)
		return err
	}
	d.client.Namespace = conf.APPName
	return nil
}

// Info logs an info alert type event to datadog event stream
func (d *DataDogAgentClient) Info(data *MData) (err error) {
	defer recoverFromPanic(&err)

	if !d.conf.Enabled {
		return nil
	}
	title := d.getNamespacedEventTitle(data.Title)
	err = d.client.Info(title, data.Body, getTagsArray(data.Tags))
	if err != nil {
		logMsg(errMsgTag, err, d.conf)
		return err
	}
	return nil
}

// Success logs  an success alert type event to datadog event stream
func (d *DataDogAgentClient) Success(data *MData) (err error) {
	defer recoverFromPanic(&err)

	if !d.conf.Enabled {
		return nil
	}
	title := d.getNamespacedEventTitle(data.Title)
	err = d.client.Success(title, data.Body, getTagsArray(data.Tags))
	if err != nil {
		logMsg(errMsgTag, err, d.conf)
		return err
	}
	return nil
}

// Warning logs an warning alert type event to datadog event stream
func (d *DataDogAgentClient) Warning(data *MData) (err error) {
	defer recoverFromPanic(&err)

	if !d.conf.Enabled {
		return nil
	}
	title := d.getNamespacedEventTitle(data.Title)
	err = d.client.Warning(title, data.Body, getTagsArray(data.Tags))
	if err != nil {
		logMsg(errMsgTag, err, d.conf)
		return err
	}
	return nil
}

// Error logs an error alert type event to datadog event stream
func (d *DataDogAgentClient) Error(data *MData) (err error) {
	defer recoverFromPanic(&err)

	if !d.conf.Enabled {
		return nil
	}
	title := d.getNamespacedEventTitle(data.Title)
	err = d.client.Error(title, data.Body, getTagsArray(data.Tags))
	if err != nil {
		logMsg(errMsgTag, err, d.conf)
		return err
	}
	return nil
}

// Gauge records a gauge metric in datadog server. Gauges measure the value of a particular thing over
// time.
func (d *DataDogAgentClient) Gauge(name string, value float64, tags []string, rate float64) (err error) {
	defer recoverFromPanic(&err)

	if !d.conf.Enabled {
		return nil
	}
	err = d.client.Gauge(name, value, tags, rate)
	if err != nil {
		logMsg(errMsgTag, err, d.conf)
		return err
	}
	return nil
}

// Count records a count metric in datadog server. Counters are used to (ahem) count things.
func (d *DataDogAgentClient) Count(name string, value int64, tags []string, rate float64) (err error) {
	defer recoverFromPanic(&err)

	if !d.conf.Enabled {
		return nil
	}
	err = d.client.Count(name, value, tags, rate)
	if err != nil {
		logMsg(errMsgTag, err, d.conf)
		return err
	}
	return nil
}

// Histogram records a histrogram metric in datadog server. Histograms measure the statistical
// distribution of a set of values.
func (d *DataDogAgentClient) Histogram(name string, value float64, tags []string, rate float64) (err error) {
	defer recoverFromPanic(&err)

	if !d.conf.Enabled {
		return nil
	}
	err = d.client.Histogram(name, value, tags, rate)
	if err != nil {
		logMsg(errMsgTag, err, d.conf)
		return err
	}
	return nil
}

// Set records a set metric in datadog server. Sets are used to count the number of unique elements
// in a group. If you want to track the number of unique visitor to your site, sets are a great way
// to do that.
func (d *DataDogAgentClient) Set(name string, value string, tags []string, rate float64) (err error) {
	defer recoverFromPanic(&err)

	if !d.conf.Enabled {
		return nil
	}
	err = d.client.Set(name, value, tags, rate)
	if err != nil {
		logMsg(errMsgTag, err, d.conf)
		return err
	}
	return nil
}

// SendAppMetrics starts sending AppMetrics exposed through expvar. By default go exposes the
// Memstats. For seeing the expvar stats in datadog follow the steps below:-
// i)   Modify go_expvar.yaml placed in conf.d directory of dd-agent. For ubuntu this is
//      etc/conf.d/dd-agent. For other OS please refer the datadog doc. If go_expvar.yaml does not exist
//      ,copy it from go_expvar.yaml.example
// ii)  Modify the expvar_url to match the serverIP. ServerIP should be of the form "serverAddr:port"
// iii) Restart the dd-agent
func (d *DataDogAgentClient) SendAppMetrics(serverIP string) (err error) {
	defer recoverFromPanic(&err)
	if !d.conf.Enabled {
		return nil
	}
	sock, err := net.Listen("tcp", serverIP)
	if err != nil {
		return err
	}
	go func() {
		logMsg(infoMsgtag, fmt.Sprintf("App Metrics available at %s", serverIP), d.conf)
		http.Serve(sock, nil)
	}()
	return nil
}

// getNamespacedEventName prefixes the appName with  each event name
func (d *DataDogAgentClient) getNamespacedEventTitle(n string) string {
	return d.client.Namespace + n
}

// newDogstatsdAgent creates a new instance of DataDogAgentClient
func newDogstatsdAgent(conf *MConf) (d *DataDogAgentClient, err error) {
	defer recoverFromPanic(&err)

	d = new(DataDogAgentClient)
	err = d.Init(conf)
	if err != nil {
		logMsg(errMsgTag, err, conf)
		return nil, err
	}
	return d, err
}

// getTagsArray returns a string array from a map by joining each key, value in a
// map with ':'
func getTagsArray(tags map[string]string) []string {
	arr := make([]string, len(tags))
	i := 0
	for k, v := range tags {
		arr[i] = k + ":" + v
		i++
	}
	return arr
}


text:
import { CliTrackerController } from 'azk/cli/cli_tracker_controller.js';
import { Helpers } from 'azk/cli/helpers';
import { config, lazy_require } from 'azk';
import { async } from 'azk/utils/promises';
import { deviceInfo } from 'azk/utils';
import Azk from 'azk';

var lazy = lazy_require({
  Client : ['azk/agent/client'],
  VM     : ['azk/agent/vm'],
  osName : 'os-name',
  docker : ['azk/docker', 'default'],
});

export default class Version extends CliTrackerController {
  constructor(...args) {
    super(...args);
    this.require_terms = false;
  }

  // get version, commit id and commit date to create output
  index() {
    var options = this.normalized_params.options;
    return (options.full) ? this.full(options) : this.short();
  }

  short() {
    return Azk.fullVersion().then((version) => {
      this.ui.output(version);
      return 0;
    });
  }

  full(opts) {
    return async(this, function* () {
      // Get agent status
      var agent = yield lazy.Client.status();
      var require_vm = config("agent:requires_vm");

      let docker_version = null;

      // Load configs from agent
      if (agent.agent) {
        yield Helpers.requireAgent(this.ui);
        docker_version = yield lazy.docker.version();
      }

      // Mount data to render
      let device = deviceInfo();

      if (device.os.match(/^Linux\ /) && !docker_version) {
        docker_version = yield this._getDockerVersionByCli();
      }

      let data = {
        os     : `${device.os} (${device.proc_arch}), Memory: ${device.total_memory}MB`,
        version: yield Azk.fullVersion(),
        docker : docker_version || { Version: "Down" },
        use_vm : require_vm ? "Yes" : "No",
        agent_running: agent.agent ? "Running" : "Stopped",
        vbox_version : require_vm ? yield lazy.VM.version() : "N/A",
      };

      if (require_vm && agent.agent) {
        let ip = config('agent:vm:ip');
        data.use_vm = `${data.use_vm}, IP: ${ip}`;
      }

      // Show doctor info
      this.view('version').render(data, opts.logo);

      return 0;
    });
  }

  _getDockerVersionByCli() {
    let cmd   = 'docker --version';
    let regex = /^Docker\ version\ (\d+.\d+.\d+)/;

    return this.ui.execSh(cmd, true).then((result) => {
      if (!result.stdout) {
        return null;
      }
      let match = result.stdout.match(regex);
      return match ? { Version: `${match[1]} (CLI)` } : null;
    });
  }
}


text: python ./src/average_degree_draw.py ./tweet_input/tweets.txt ./tweet_output/output.txt 5


text:
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />

<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=UTF-8"><META HTTP-EQUIV="Refresh" CONTENT="0; URL=2005/08/01/frommelt-pioneering-web-standards-in-higher-ed/index.html"><TITLE>Page has moved</TITLE>

Click here...


text:
import os
import re
from setuptools import setup

NAME = 'kfp'
#VERSION = .... Change the version in kfp/__init__.py

REQUIRES = [
    'PyYAML',
    'google-cloud-storage>=1.13.0',
    'kubernetes>=8.0.0, <12.0.0',
    'google-auth>=1.6.1',
    'requests_toolbelt>=0.8.0',
    'cloudpickle',
    # Update the upper version whenever a new major version of the
    # kfp-server-api package is released. Update the lower version when there is
    # a breaking change in kfp-server-api, or kfp sdk depends on new api changes
    # in kfp-server-api.
    'kfp-server-api>=0.2.5, <0.6.0',
    'jsonschema >= 3.0.1',
    'tabulate',
    'click',
    'Deprecated',
    'strip-hints',
]

def find_version(*file_path_parts):
  here = os.path.abspath(os.path.dirname(__file__))
  with open(os.path.join(here, *file_path_parts), 'r') as fp:
    version_file_text = fp.read()

  version_match = re.search(
      r"^__version__ = ['\"]([^'\"]*)['\"]",
      version_file_text,
      re.M,
  )
  if version_match:
    return version_match.group(1)

  raise RuntimeError('Unable to find version string.')

setup(
    name=NAME,
    version=find_version('kfp', '__init__.py'),
    description='KubeFlow Pipelines SDK',
    author='google',
    install_requires=REQUIRES,
    packages=[
        'kfp',
        'kfp.cli',
        'kfp.cli.diagnose_me',
        'kfp.compiler',
        'kfp.components',
        'kfp.components.structures',
        'kfp.components.structures.kubernetes',
        'kfp.containers',
        'kfp.dsl',
        'kfp.dsl.extensions',
        'kfp.notebook',
    ],
    classifiers=[
        'Intended Audience :: Developers',
        'Intended Audience :: Education',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: Apache Software License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Topic :: Scientific/Engineering',
        'Topic :: Scientific/Engineering :: Artificial Intelligence',
        'Topic :: Software Development',
        'Topic :: Software Development :: Libraries',
        'Topic :: Software Development :: Libraries :: Python Modules',
    ],
    python_requires='>=3.5.3',
    include_package_data=True,
    entry_points={
        'console_scripts': [
            'dsl-compile = kfp.compiler.main:main', 'kfp=kfp.__main__:main'
        ]
    })


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using NUnit.Framework;

[TestFixture]
public class HeroInventoryTests
{
    private HeroInventory sut;

    [SetUp]
    public void TestInit()
    {
        this.sut = new HeroInventory();
    }

    [Test]
    public void AddCommonItem()
    {
        CommonItem item = new CommonItem("item", 1, 2, 3, 4, 5);

        this.sut.AddCommonItem(item);
        Type clazz = typeof(HeroInventory);
        var field = clazz.GetFields(BindingFlags.Instance | BindingFlags.NonPublic)
            .FirstOrDefault(f => f.GetCustomAttributes(typeof(ItemAttribute)) != null);
        var collection = (Dictionary<string, IItem>)field.GetValue(this.sut);

        Assert.AreEqual(1, collection.Count);
    }

    [Test]
    public void AddRecipeItem()
    {
        RecipeItem item = new RecipeItem("item", 1, 2, 3, 4, 5, new List<string>());

        this.sut.AddRecipeItem(item);
        Type clazz = typeof(HeroInventory);
        var field = clazz.GetField("recipeItems", BindingFlags.Instance | BindingFlags.NonPublic);

        var collection = (Dictionary<string, IRecipe>)field.GetValue(this.sut);

        Assert.AreEqual(1, collection.Count);
    }

    [Test]
    public void StrengthBonusFromItems()
    {
        CommonItem item = new CommonItem("item", 1, 2, 3, 4, 5);

        this.sut.AddCommonItem(item);

        Assert.AreEqual(1, this.sut.TotalStrengthBonus);
    }

    [Test]
    public void AgilityBonusFromItems()
    {
        CommonItem item = new CommonItem("item", 1, 2, 3, 4, 5);

        this.sut.AddCommonItem(item);

        Assert.AreEqual(2, this.sut.TotalAgilityBonus);
    }

    [Test]
    public void IntelligenceBonusFromItems()
    {
        CommonItem item = new CommonItem("item", 1, 2, 3, 4, 5);

        this.sut.AddCommonItem(item);

        Assert.AreEqual(3, this.sut.TotalIntelligenceBonus);
    }

    [Test]
    public void HitPointsBonusFromItems()
    {
        CommonItem item = new CommonItem("item", 1, 2, 3, 4, 5);

        this.sut.AddCommonItem(item);

        Assert.AreEqual(4, this.sut.TotalHitPointsBonus);
    }

    [Test]
    public void DamageBonusFromItems()
    {
        CommonItem item = new CommonItem("item", 1, 2, 3, 4, 5);

        this.sut.AddCommonItem(item);

        Assert.AreEqual(5, this.sut.TotalDamageBonus);
    }

    [Test]
    public void TotalStatsBonus()
    {
        var item1 = new CommonItem("Sword", 1, 2, 3, 4, 5);

        this.sut.AddCommonItem(item1);

        long totalStatsBonus = sut.TotalAgilityBonus +
                               sut.TotalDamageBonus +
                               sut.TotalHitPointsBonus +
                               sut.TotalIntelligenceBonus +
                               sut.TotalStrengthBonus;

        Assert.AreEqual(15, totalStatsBonus);
    }

    [Test]
    public void NewInventoryStatsAreZero()
    {
        this.sut = new HeroInventory();

        long totalStatsBonus = this.sut.TotalAgilityBonus
                               + this.sut.TotalStrengthBonus
                               + this.sut.TotalIntelligenceBonus
                               + this.sut.TotalHitPointsBonus
                               + this.sut.TotalDamageBonus;

        Assert.AreEqual(0, totalStatsBonus);
    }

    [Test]
    public void CreatingNewHeroInventoryIsSuccessful()
    {
        this.sut = new HeroInventory();

        Assert.Pass();
    }

    [Test]
    public void AddCommonItemIsSuccessful()
    {
        IItem item = new CommonItem("Axe", 10, 12, 13, 14, 15);

        this.sut.AddCommonItem(item);

        Assert.Pass();
    }

    [Test]
    public void RecipeCompletionChangesStats()
    {
        List<string> requiredItems = new List<string>() { "Axe", "Shield" };
        IRecipe recipe = new RecipeItem("MegaWeapon", 100, 100, 100, 100, 100, requiredItems);
        IItem axe = new CommonItem("Axe", 10, 10, 10, 10, 10);
        IItem shield = new CommonItem("Shield", 20, 20, 20, 20, 20);

        this.sut.AddCommonItem(axe);
        this.sut.AddCommonItem(shield);
        this.sut.AddRecipeItem(recipe);
        long totalStatsBonus = this.sut.TotalAgilityBonus
                               + this.sut.TotalStrengthBonus
                               + this.sut.TotalIntelligenceBonus
                               + this.sut.TotalHitPointsBonus
                               + this.sut.TotalDamageBonus;

        Assert.AreEqual(500, totalStatsBonus);
    }

    [Test]
    public void AddingNullItemThrowsException()
    {
        IItem item = null;

        Assert.Throws<NullReferenceException>(() => this.sut.AddCommonItem(item));
    }

    [Test]
    public void AddingNullRecipeThrowsException()
    {
        IRecipe recipe = null;

        Assert.Throws<NullReferenceException>(() => this.sut.AddRecipeItem(recipe));
    }

    [Test]
    public void DuplicatingCommonItemThrowsException()
    {
        IItem item = new CommonItem("BootsOfTravell", 100, 100, 100, 100, 100);

        this.sut.AddCommonItem(item);

        Assert.Throws<ArgumentException>(() => this.sut.AddCommonItem(item));
    }

    [Test]
    public void DuplicatingRecipeThrowsException()
    {
        List<string> recipeComponents1 = new List<string> { "BootsOfSpeed" };
        IRecipe recipe1 = new RecipeItem("BootsOfTravell", 100, 100, 100, 100, 100, recipeComponents1);

        this.sut.AddRecipeItem(recipe1);

        Assert.Throws<ArgumentException>(() => this.sut.AddRecipeItem(recipe1));
    }

    [Test]
    public void ChainingRecipes()
    {
        List<string> recipeComponents1 = new List<string> { "BootsOfSpeed" };
        IRecipe recipe1 = new RecipeItem("BootsOfTravell", 100, 100, 100, 100, 100, recipeComponents1);
        IItem boots = new CommonItem("BootsOfSpeed", 10, 10, 10, 10, 10);

        List<string> recipeComponents2 = new List<string> { "BootsOfTravell" };
        IRecipe recipe2 = new RecipeItem("BootsOfTravell2", 200, 200, 200, 200, 200, recipeComponents2);

        this.sut.AddCommonItem(boots);
        this.sut.AddRecipeItem(recipe1);
        this.sut.AddRecipeItem(recipe2);
        long totalStatsBonus = this.sut.TotalAgilityBonus
                               + this.sut.TotalStrengthBonus
                               + this.sut.TotalIntelligenceBonus
                               + this.sut.TotalHitPointsBonus
                               + this.sut.TotalDamageBonus;

        Assert.AreEqual(1000, totalStatsBonus);
    }

    [Test]
    public void AddingCommonItemsChangesTotalDamage()
    {
        IItem item1 = new CommonItem("Axe", 11, 12, 13, 14, 15);
        IItem item2 = new CommonItem("Fork", 31, 32, 33, 34, 35);

        this.sut.AddCommonItem(item1);
        this.sut.AddCommonItem(item2);

        Assert.AreEqual(50, this.sut.TotalDamageBonus);
    }

    [Test]
    public void CompleteRecipeForNewItem()
    {
        IItem relic = new CommonItem("SacredRelic", 0, 0, 0, 0, 60);
        List<string> recipeComponents = new List<string> { "SacredRelic", "RadianceRecipe" };
        IRecipe recipe = new RecipeItem("Radiance", 0, 0, 0, 0, 80, recipeComponents);
        IItem radianceRecipe = new CommonItem("RadianceRecipe", 0, 0, 0, 0, 0);

        this.sut.AddCommonItem(relic);
        this.sut.AddRecipeItem(recipe);
        this.sut.AddCommonItem(radianceRecipe);

        Assert.AreEqual(80, this.sut.TotalDamageBonus);
    }
}


text:
package template

const Etcd3AttachDepService = `
[Unit]
Description=Attach etcd dependencies
Requires=network.target
After=network.target
Before=k8s-kubelet.service

[Service]
# image is from https://github.com/giantswarm/aws-attach-etcd-dep
Environment="IMAGE={{ .RegistryDomain }}/giantswarm/aws-attach-etcd-dep:0.4.0"
Environment="NAME=%p.service"
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/bash -c "docker run --rm -i \
      -v /dev:/dev \
      -v /etc/systemd/network:/etc/systemd/network \
      --privileged \
      --name ${NAME} \
      ${IMAGE} \
      --eni-device-index=1 \
      --eni-tag-key=Name \
      --eni-tag-value={{ .MasterENIName }} \
      --volume-device-name=/dev/xvdh \
      --volume-device-filesystem-type=ext4 \
      --volume-device-label=etcd \
      --volume-tag-key=Name \
      --volume-tag-value={{ .MasterEtcdVolumeName }}"
# use 'networkctl reload' instead of restarting systemd-networkd to avoid bug in systemd
# https://github.com/systemd/systemd/issues/18108
ExecStartPost=/usr/bin/networkctl reload

[Install]
WantedBy=multi-user.target
`


text:
package com.marcohc.architecture.app.data.datastore.user;

import android.support.annotation.NonNull;

import com.marcohc.architecture.app.data.cache.UserCache;
import com.marcohc.architecture.app.domain.entity.UserEntity;

import java.util.List;
import java.util.concurrent.Callable;

import rx.Observable;

/**
 * User disk data store. It uses the android cache to get the data from.
 *
 * @author Marco Hernaiz
 * @since 08/08/16
 */
public class UserCacheDataStore implements UserDiskDataStore {

    @Override
    public Observable<List<UserEntity>> getUsersWithPicture() {
        return Observable.fromCallable(new SaveInCacheCallable(ALL_WITH_PICTURE));
    }

    @Override
    public Observable<List<UserEntity>> getUsersWithoutPicture() {
        return Observable.fromCallable(new SaveInCacheCallable(ALL_WITHOUT_PICTURE));
    }

    @Override
    public boolean isCached(@NonNull String cacheKey) {
        return UserCache.getInstance().isCached(cacheKey);
    }

    @Override
    public void put(@NonNull String cacheKey, @NonNull List<UserEntity> entityList) {
        UserCache.getInstance().put(cacheKey, entityList);
    }

    private static class SaveInCacheCallable implements Callable<List<UserEntity>> {

        private String mKey;

        SaveInCacheCallable(String key) {
            this.mKey = key;
        }

        @Override
        public List<UserEntity> call() throws Exception {
            return UserCache.getInstance().get(mKey);
        }
    }
}


text:
from django.db import models
from django.db.models.fields.related import ManyToOneRel
from django.db.models.fields import AutoField

# Create your models here.
class ManualUpdateModel(models.Model):
    class Meta:
        abstract = True

    def auto_save(self):
        updated_fields = []
        for field in type(self)._meta.get_fields():
            if (not field.name.startswith("m_") and
                    not isinstance(field, ManyToOneRel) and
                    not isinstance(field, AutoField)):
                try:
                    if not getattr(self, "m_" + field.name):
                        updated_fields.append(field.name)
                except AttributeError:
                    updated_fields.append(field.name)
        try:
            return self.save(update_fields=updated_fields)
        except ValueError:
            return self.save()

class TaggableModel(models.Model):
    taggable = models.BooleanField(default=True)

    class Meta:
        abstract = True

    def get_tags(self):
        """
        Takes a model, and returns its tags. MUST be implemented to take advantage of automatic tagging
        :return: Tuple with 2 elements, Element 0 is the name of the tag and Element 1 is a List/Tuple with strings of
        possible tags
        """
        raise NotImplementedError


text:
from gppylib.mainUtils import *

from gppylib.gplog import *
from gppylib.commands import unix
import pickle, base64
from gppylib import gparray
from gppylib.gpparseopts import OptChecker,OptParser,OptParser
from gppylib.operations.buildMirrorSegments import gDatabaseDirectories, gDatabaseFiles

logger = get_default_logger()

class GpCleanSegmentDirectoryProgram:
    """
    Clean up segment directories on a single host

    The caller should have already stopped the segments before calling this.
    """

    def __init__(self, options):
        self.__options = options

    def run(self):
        if self.__options.pickledArguments is None:
            raise ProgramArgumentValidationException("-p argument is missing")

        segments = pickle.loads(base64.urlsafe_b64decode(self.__options.pickledArguments))

        logger.info("Cleaning main data directories")
        for segment in segments:
            segmentdir = segment.getSegmentDataDirectory()
            logger.info("Cleaning %s" % segmentdir)

            unix.RemoveDirectoryContents('clean segment', segmentdir).run(validateAfter=True)

    def cleanup(self):
        pass

    #-------------------------------------------------------------------------
    @staticmethod
    def createParser():

        description = ("""
        Clean segment directories.
        """)

        help = ["""
          To be used internally only.
        """]

        parser = OptParser(option_class=OptChecker,
                    description=' '.join(description.split()),
                    version='%prog version $Revision: #1 $')
        parser.setHelp(help)

        addStandardLoggingAndHelpOptions(parser, True)

        addTo = OptionGroup(parser, "Clean Segment Options")
        parser.add_option_group(addTo)
        addTo.add_option('-p', None, dest="pickledArguments",
                         type='string', default=None, metavar="<pickledArguments>",
                       help="The arguments passed from the original script")

        parser.set_defaults()
        return parser

    @staticmethod
    def createProgram(options, args):
        if len(args) > 0 :
            raise ProgramArgumentValidationException("too many arguments: only options may be specified")
        return GpCleanSegmentDirectoryProgram(options)

#-------------------------------------------------------------------------
if __name__ == '__main__':
    mainOptions = { 'setNonuserOnToolLogger': True}
    simple_main( GpCleanSegmentDirectoryProgram.createParser, GpCleanSegmentDirectoryProgram.createProgram, mainOptions)


text:
require 'twitter/enumerable'
require 'twitter/utils'

module Twitter
  class Cursor
    include Twitter::Enumerable
    include Twitter::Utils
    # @return [Hash]
    attr_reader :attrs
    alias_method :to_h, :attrs
    alias_method :to_hash, :to_h
    deprecate_alias :to_hsh, :to_hash

    # Initializes a new Cursor
    #
    # @param attrs [Hash]
    # @param key [String, Symbol] The key to fetch the data from the response
    # @param klass [Class] The class to instantiate objects in the response
    # @param request [Twitter::Request]
    # @return [Twitter::Cursor]
    def initialize(attrs, key, klass, request)
      @key = key.to_sym
      @klass = klass
      @client = request.client
      @request_method = request.verb
      @path = request.path
      @options = request.options
      @collection = []
      self.attrs = attrs
    end

  private

    # @return [Integer]
    def next_cursor
      @attrs[:next_cursor] || -1
    end
    alias_method :next, :next_cursor

    # @return [Boolean]
    def last?
      next_cursor.zero?
    end

    # @return [Hash]
    def fetch_next_page
      response = @client.send(@request_method, @path, @options.merge(:cursor => next_cursor)).body
      self.attrs = response
    end

    # @param attrs [Hash]
    # @return [Hash]
    def attrs=(attrs)
      @attrs = attrs
      @attrs.fetch(@key, []).each do |element|
        @collection << (@klass ? @klass.new(element) : element)
      end
      @attrs
    end
  end
end


text:
import Dispatcher from '../dispatcher/Dispatcher.js';
import TopicConstants from '../constants/TopicConstants.js';

class TopicAction {
    static loadAllTopics() {
        "use strict";
        Dispatcher.dispatch({
            actionType: TopicConstants.LOAD_ALL_TOPICS
        });
    }

    static changeTopic(topicName) {
        "use strict";
        Dispatcher.dispatch({
            actionType: TopicConstants.CHANGE_TOPIC,
            name: topicName
        });
    }
}

export default TopicAction;


text:
![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png)![5 stars](../../images/ic_star_black_18dp_1x.png) 1

To use the Durango Mexico facts skill, try saying...

* *Alexa Open Durango Facts*

* *tell me a Durango fact*

* *give me some Durango information*

The state of Durango, Mexico is one of the most beautiful in the country. It has been a location for more than a hundred Hollywood movies, yet not everybody knows much about it. Here's your opportunity to get some facts that may surprise you.

***

### Skill Details

* **Invocation Name:** durango facts
* **Category:** null
* **ID:** amzn1.ask.skill.08378502-e808-4ff8-bfc9-58aad7f26a6d
* **ASIN:** B01M4NAIUX
* **Author:** Enrique Rodriguez
* **Release Date:** October 29, 2016 @ 12:12:43
* **Privacy Policy:** https://www.amazon.com/gp/help/customer/display.html/ref=footer_privacy?ie=UTF8&nodeId=468496
* **Terms of Use:** https://aws.amazon.com/service-terms/
* **In-App Purchasing:** No


text:
import React, {Component} from 'react';
import {Button, Classes, Dialog, Intent, TextArea, Tooltip} from "@blueprintjs/core";
import {fetchSeeds, saveSeedURLs} from "../../actions";
import {connect} from "react-redux";

class SeedURLDialog extends Component {

    constructor(props) {
        super(props);
        this.state = {
            value: ''
        }
        this.handleChange = this.handleChange.bind(this);
        this.handleOkay = this.handleOkay.bind(this);

    }

    componentDidUpdate(prevProps, prevState, snapshot) {
        if (this.props.seed_urls !== prevProps.seed_urls) {
            this.handleClose()
        }

    }

    componentDidMount() {
    }

    handleClose = () => this.setState({isOpen: false});
    handleOpen = () => this.setState({isOpen: true});

    handleChange(event) {
        this.setState({value: event.target.value});
    }

    handleOkay() {
        this.props.saveSeedURLs(this.props.current_model, this.state.value)
        this.handleClose()
    }

    shouldComponentUpdate(nextProps, nextState, nextContext) {
        debugger;
        if (nextProps.current_model !== undefined && nextProps.current_model !== this.props.current_model) {
            this.props.fetchSeeds(nextProps.current_model);
            return true
        }
        if (this.props.seeds !== nextProps.seeds) {
            this.state.value = "";
            return true;
        }
        if (this.state.isOpen !== nextState.isOpen) {
            return true;
        }

        if (nextState.value !== this.state.value) {
            return true
        }

        return false
    }

    render() {
        return (
            <Dialog
                icon="search-text"
                onClose={this.handleClose}
                title="Seed URLs"
                {...this.state}
            >

                    <TextArea style={{minHeight: "200px"}}
                              growVertically={true}
                              large={true}
                              intent={Intent.PRIMARY}
                              onChange={this.handleChange}
                              value={this.state.value}
                              fill={true}
                    />

Existing Seeds

                    <TextArea growVertically={true}
                              large={true}
                              intent={Intent.PRIMARY} disabled={true} fill={true} value={this.props.seeds}/>

                        <Tooltip content="This button is hooked up to close the dialog.">
                            <Button onClick={this.handleClose}>Cancel</Button>
                        </Tooltip>
                        <Button
                            intent={Intent.PRIMARY}
                            onClick={this.handleOkay}
                        >
                            Save
                        </Button>

            </Dialog>
        )
    }

}

const mapDispatchToProps = dispatch => ({
    saveSeedURLs: (m, s) => dispatch(saveSeedURLs(m, s)),
    fetchSeeds: (m) => dispatch(fetchSeeds(m))
})

const mapStateToProps = state => {
    return {
        current_model: state.modelreducer.current_model,
        seed_urls: state.modelreducer.seed_urls,
        seeds: state.modelreducer.seeds
    }
}

export default connect(mapStateToProps, mapDispatchToProps, null, {forwardRef: true})(SeedURLDialog)


text:
require "zabbix-ruby-client/logger"

module ZabbixRubyClient
  module Plugins
    module Mysql
      extend self
      extend ZabbixRubyClient::PluginBase

      def collect(*args)
        host = args[0]
        mysqlargs = args[1]
        mysqlstatus = `mysqladmin #{mysqlargs} extended-status`
        if $?.to_i == 0
          status = get_status(mysqlstatus)
        else
          Log.warn "The connection failed."
          return []
        end

        back = []
        back << "#{host} mysql.status[Aborted_clients] #{time} #{status["Aborted_clients"]}"
        back << "#{host} mysql.status[Aborted_connects] #{time} #{status["Aborted_connects"]}"
        back << "#{host} mysql.status[Bytes_received] #{time} #{status["Bytes_received"]}"
        back << "#{host} mysql.status[Bytes_sent] #{time} #{status["Bytes_sent"]}"
        back << "#{host} mysql.status[Com_admin_commands] #{time} #{status["Com_admin_commands"]}"
        back << "#{host} mysql.status[Com_begin] #{time} #{status["Com_begin"]}"
        back << "#{host} mysql.status[Com_change_db] #{time} #{status["Com_change_db"]}"
        back << "#{host} mysql.status[Com_check] #{time} #{status["Com_check"]}"
        back << "#{host} mysql.status[Com_commit] #{time} #{status["Com_commit"]}"
        back << "#{host} mysql.status[Com_delete] #{time} #{status["Com_delete"]}"
        back << "#{host} mysql.status[Com_insert] #{time} #{status["Com_insert"]}"
        back << "#{host} mysql.status[Com_rollback] #{time} #{status["Com_rollback"]}"
        back << "#{host} mysql.status[Com_lock_tables] #{time} #{status["Com_lock_tables"]}"
        back << "#{host} mysql.status[Com_select] #{time} #{status["Com_select"]}"
        back << "#{host} mysql.status[Com_show_fields] #{time} #{status["Com_show_fields"]}"
        back << "#{host} mysql.status[Com_unlock_tables] #{time} #{status["Com_unlock_tables"]}"
        back << "#{host} mysql.status[Com_update] #{time} #{status["Com_update"]}"
        back << "#{host} mysql.status[Connections] #{time} #{status["Connections"]}"
        back << "#{host} mysql.status[Created_tmp_disk_tables] #{time} #{status["Created_tmp_disk_tables"]}"
        back << "#{host} mysql.status[Created_tmp_tables] #{time} #{status["Created_tmp_tables"]}"
        back << "#{host} mysql.status[Slave_running] #{time} #{status["Slave_running"]}"
        back << "#{host} mysql.status[Slow_queries] #{time} #{status["Slow_queries"]}"
        back << "#{host} mysql.status[Uptime] #{time} #{status["Uptime"]}"
        back << "#{host} mysql.status[Questions] #{time} #{status["Questions"]}"
        return back
      end

      def get_status(status)
        ret = {}
        status.each_line do |l|
          if l[0] == "|"
            _, k, v = l.split "|"
            ret[k.strip] = v.strip
          end
        end
        ret
      end

    end
  end
end

ZabbixRubyClient::Plugins.register('mysql', ZabbixRubyClient::Plugins::Mysql)


text:
\chapter[Introdução]{Introdução}

No decorrer do desenvolvimento de um projeto de \textit{software}, podem ocorrer eventos
em que a qualidade do código é negligenciada devido a restrições de custo/tempo,
ou decisões estratégicas, para ganhar oportunidades de mercado. O débito técnico
é uma metáfora, proposta por \cite{cunningham}, que faz alusão a esses eventos.

Essa metáfora faz analogia ao débito financeiro, onde a qualidade do \textit{software}
é comprometida para atender uma restrição ou obter um benefício a curto prazo. O não
pagamento dessa dívida acarretará em juros, que é o aumento do esforço para
saudar essa dívida, devido ao aumento da complexidade do software ou mudanças
do projeto no futuro.

Assim como uma dívida financeira, é importante também gerenciar o débito técnico
em um projeto de \textit{software}. De acordo com \cite{mapping}, das atividades de
gerenciamento de débito técnico, as mais estudadas são: Identificação, Medição,
e Pagamento.

Dos trabalhos apresentados até o momento, observa-se propostas para identificação de
débito técnico, como análise estática de código, \cite{siebra}, medição do débito
através de fórmulas que resultam valores financeiros \cite{principal}, e
propostas de utilização de estratégias como o SQALE para definição e medição de
débito técnico em projetos, definido por \cite{letouzey}.

\cite{schmid} debate sobre os limites dessa metáfora: até onde o débito técnico pode ser comparado
com o débito financeiro.

Além destes, não existem estudos sobre a aplicação de débito técnico para
atestar qualidade dos \textit{softwares} entregues por fábricas de \textit{softwares} e outros
fornecedores, bem como sua aplicação na administração pública.

\section{Justificativa da Pesquisa}
Num contexto específico, o Ministério das Comunicações (MC), em parceria com a
Universidade de Brasília (UnB), tem buscado adotar os métodos Ágeis para a
definição de um processo de gestão da contratação de fábrica de \textit{software} para o
desenvolvimento e manutenção de \textit{software}.
Os trabalhos se aliam à legislação pública federal. A Instrução Normativa 04,
que rege as contratações de Soluções de Tecnologia da Informação no
 Brasil em órgãos governamentais, impõe restrições que devem ser respeitadas por
 parte da contratada para a contratante e vice-versa. Uma delas, o inciso III do
 art. 20, tange sobre a qualidade do código fornecido, afirmando que pode haver
 punição caso os níveis mínimos fixados nos critérios de aceitação não sejam
 cumpridos. Observa-se o quão necessário é identificar meios de se verificar a
 qualidade do código fornecido.

\section{Objetivo Geral}
 Este trabalho objetiva propor uma estratégia de verificação da qualidade dos
 códigos de \textit{softwares} entregues pelas fábricas de \textit{software} para o Ministério
 das Comunicações, pela análise da quantidade de débito técnico a ser identificado
 nas aplicações entregues.

 O trabalho está organizado em cinco seções. Na Seção II, apresenta-se o
 referencial teórico, com conceito de débito técnico, medição e análise e GQM
 além de algumas técnicas apresentadas na literatura, e pequena contextualização da Contratação de
 Serviços de TI na Administração Pública Federal. Na Seção III, apresenta-se
 os materiais e métodos, onde são abordados, a metodologia utilizada bem como o
 objeto de estudo, o Ministério das Comunicações e seus processos. Na Seção IV,
 apresenta-se a proposta de medição de débito técnico utilizando GQM para o objeto de estudo.
 Finalizando, na Seção V, as considerações finais e trabalhos futuros.