text:
using System;
using System.Collections.Generic;
using System.Data;
using Microsoft.Data.SqlClient;
using System.Diagnostics;

using Vita.Entities;
using Vita.Entities.Model;
using Vita.Data.Model;
using Vita.Data.Driver;
using Vita.Entities.Locking;
using Vita.Entities.Logging;
using Vita.Data.Linq;
using Vita.Data.Sql;
using Vita.Entities.Utilities;
using System.Threading.Tasks;
using System.Threading;

namespace Vita.Data.MsSql {

  public class MsSqlDbDriver : DbDriver {
    /// A key for the value in DbSettings.CustomSettings dictionary that contains the name of the role in SQL Server
    /// that is granted execution read priviliges to views and sequences. If the value is not present in the dictionary,
    /// privileges are granted to [public] role.
    public const string SettingsKeyGrantExecReadRole = "GrantExecReadRole";
    /// A key for the value in DbSettings.CustomSettings dictionary that contains the name of the role in SQL Server
    /// that is granted execution write priviliges to views and sequences. If the value is not present in the dictionary,
    /// privileges are granted to [public] role.
    public const string SettingsKeyGrantExecWriteRole = "GrantExecWriteRole";

    public const DbOptions DefaultMsSqlDbOptions = DbOptions.UseRefIntegrity | DbOptions.ShareDbModel
                                                 | DbOptions.AutoIndexForeignKeys | DbOptions.UseBatchMode;
    public const DbFeatures MsSql12Features =
      DbFeatures.Schemas | DbFeatures.StoredProcedures | DbFeatures.OutputParameters | DbFeatures.DefaultParameterValues
        | DbFeatures.ReferentialConstraints | DbFeatures.ClusteredIndexes | DbFeatures.DefaultCaseInsensitive
        | DbFeatures.Views | DbFeatures.MaterializedViews | DbFeatures.ArrayParameters | DbFeatures.InsertMany
        | DbFeatures.OrderedColumnsInIndexes | DbFeatures.IncludeColumnsInIndexes | DbFeatures.FilterInIndexes
        | DbFeatures.SkipTakeRequireOrderBy | DbFeatures.AllowsFakeOrderBy
        | DbFeatures.BatchedUpdates | DbFeatures.OutParamsInBatchedUpdates
        | DbFeatures.Paging | DbFeatures.TreatBitAsInt | DbFeatures.UpdateFromSubQuery
        | DbFeatures.HeapTables | DbFeatures.Sequences | DbFeatures.ServerPreservesComments
        | DbFeatures.ExceptOperator | DbFeatures.IntersectOperator;

    public string SystemSchema = "dbo"; //schema used for creating Vita_ArrayAsTable table type
    // User-defined table type, created by VITA to be used to send array-type parameters to SQLs and stored procedures
    public static string ArrayAsTableTypeName = "Vita_ArrayAsTable";

    public override DbOptions GetDefaultOptions() {
      return DefaultMsSqlDbOptions;
    }

    public MsSqlDbDriver() : base(DbServerType.MsSql, MsSql12Features) {
      base.TypeRegistry = new MsSqlTypeRegistry(this);
      base.SqlDialect = new MsSqlDialect(this);
    }

    public override bool IsSystemSchema(string schema) {
      if(string.IsNullOrWhiteSpace(schema))
        return false;
      schema = schema.ToLowerInvariant();
      switch(schema) {
        case "sys": case "information_schema":  case "guest":
          return true;
        default:
          return false;
      }
    }

    public override IDbConnection CreateConnection(string connectionString) {
      return new SqlConnection(connectionString);
    }

    public override DbModelLoader CreateDbModelLoader(DbSettings settings, ILog log) {
      return new MsSqlDbModelLoader(settings, log);
    }

    public override DbModelUpdater CreateDbModelUpdater(DbSettings settings) {
      return new MsSqlDbModelUpdater(settings);
    }

    public override DbCrudSqlBuilder CreateCrudSqlBuilder(DbModel dbModel) {
      return new MsCrudSqlBuilder(dbModel);
    }

    public override DbLinqSqlBuilder CreateLinqSqlBuilder(DbModel dbModel, LinqCommand command) {
      return new MsLinqSqlBuilder(dbModel, command);
    }

    public override IDbCommand CreateCommand() {
      return new SqlCommand();
    }

    public override void ClassifyDatabaseException(DataAccessException dataException, IDbCommand command = null) {
      var sqlEx = dataException.InnerException as SqlException;
      if (sqlEx == null) return;
      dataException.ProviderErrorNumber = sqlEx.Number;
      switch (sqlEx.Number) {
        case 2601: //unique index violation
          //sqlEx.Data contains 6 values which are mostly useless (info about provider)
          // we need to parse index name - stupidly the ex does not provide it as a separate value.
          dataException.SubType = DataAccessException.SubTypeUniqueIndexViolation;
          dataException.Data[DataAccessException.KeyDbKeyName] = ExtractIndexNameFromDuplicateErrorMessage(sqlEx.Message);
          break;
        case 1205: //Transaction deadlock lock, process killed
          dataException.SubType = DataAccessException.SubTypeDeadLock;
          break;
        case 547: // FK constraint violation on delete
          dataException.SubType = DataAccessException.SubTypeIntegrityViolation;
          break;
        case 50000:
          // We raise error with custom message, this results in error# 50000
          // RAISEERROR:  When msg_str is specified, RAISERROR raises an error message with an error number of 50000
          // we put tag into error message
          dataException.SubType = DataAccessException.SubTypeConcurrentUpdate;
          var segms = dataException.Message.Split('/');
          if (segms.Length > 1)
            dataException.Data[DataAccessException.KeyEntityName] = segms[1];
          break;
        default:
          if (sqlEx.Number >= 50000) {
            //this number is for messages that are NOT registered in SQL server Messages table
          }
          break;
      }//switch
    }

    public override void OnDbModelConstructing(DbModel dbModel) {
      base.OnDbModelConstructing(dbModel);
      // it will be added to DbModel by constructor itself
      var arrAsTable = new DbCustomTypeInfo(dbModel, SystemSchema, ArrayAsTableTypeName, DbCustomTypeKind.TableType,
            isNullable: false, size: -1);
    }

    private string ExtractIndexNameFromDuplicateErrorMessage(string message) {
      try {
        // Sample error message (it is two-line string):
        // Cannot insert duplicate key row in object 'books.Publisher' with unique index 'IXU_Publisher_Name'.
        // The statement has been terminated.
        var uniqueIndexTag = "unique index";
        var uiPos = message.IndexOf(uniqueIndexTag);
        var q1Pos = message.IndexOf("'", uiPos);
        var q2Pos = message.IndexOf("'", q1Pos + 1);
        var indexName = message.Substring(q1Pos + 1, q2Pos - q1Pos - 1);
        return indexName;
      } catch (Exception ex) {
        return "(failed to identify index: " + ex.Message + ")"; //
      }
    }

    //MS SQL requires specific isolation mode for transactional load/update to work correctly without deadlocks
    public override IsolationLevel GetIsolationLevel(LockType lockType) {
      switch(lockType) {
        case LockType.ForUpdate: return IsolationLevel.ReadCommitted;
        case LockType.SharedRead: return IsolationLevel.Snapshot;
        default: return IsolationLevel.Unspecified;
      }
    }

    // Probing async methods
    private async Task<object> ExecuteReaderAsync(CancellationToken token) {
      var sqlCmd = new SqlCommand();
      var reader = await sqlCmd.ExecuteReaderAsync(token);
      while (await reader.ReadAsync()) {
        var someValue = reader["someValue"];
      }
      return null;
    }

  }//class
}


text:
package com.amazonaws.services.inspector.model;

import java.io.Serializable;
import javax.annotation.Generated;

/**
 *
 * @see AWS API Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeAssessmentTemplatesResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    /**
     *

     * Information about the assessment templates.
     *

     */
    private java.util.List<AssessmentTemplate> assessmentTemplates;
    /**
     *

     * Assessment template details that cannot be described. An error code is provided for each failed item.
     *

     */
    private java.util.Map<String, FailedItemDetails> failedItems;

    /**
     *

     * Information about the assessment templates.
     *

     *
     * @return Information about the assessment templates.
     */

    public java.util.List<AssessmentTemplate> getAssessmentTemplates() {
        return assessmentTemplates;
    }

    /**
     *

     * Information about the assessment templates.
     *

     *
     * @param assessmentTemplates
     *        Information about the assessment templates.
     */

    public void setAssessmentTemplates(java.util.Collection<AssessmentTemplate> assessmentTemplates) {
        if (assessmentTemplates == null) {
            this.assessmentTemplates = null;
            return;
        }

        this.assessmentTemplates = new java.util.ArrayList<AssessmentTemplate>(assessmentTemplates);
    }

    /**
     *

     * Information about the assessment templates.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setAssessmentTemplates(java.util.Collection)} or {@link #withAssessmentTemplates(java.util.Collection)}
     * if you want to override the existing values.
     *

     *
     * @param assessmentTemplates
     *        Information about the assessment templates.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeAssessmentTemplatesResult withAssessmentTemplates(AssessmentTemplate... assessmentTemplates) {
        if (this.assessmentTemplates == null) {
            setAssessmentTemplates(new java.util.ArrayList<AssessmentTemplate>(assessmentTemplates.length));
        }
        for (AssessmentTemplate ele : assessmentTemplates) {
            this.assessmentTemplates.add(ele);
        }
        return this;
    }

    /**
     *

     * Information about the assessment templates.
     *

     *
     * @param assessmentTemplates
     *        Information about the assessment templates.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeAssessmentTemplatesResult withAssessmentTemplates(java.util.Collection<AssessmentTemplate> assessmentTemplates) {
        setAssessmentTemplates(assessmentTemplates);
        return this;
    }

    /**
     *

     * Assessment template details that cannot be described. An error code is provided for each failed item.
     *

     *
     * @return Assessment template details that cannot be described. An error code is provided for each failed item.
     */

    public java.util.Map<String, FailedItemDetails> getFailedItems() {
        return failedItems;
    }

    /**
     *

     * Assessment template details that cannot be described. An error code is provided for each failed item.
     *

     *
     * @param failedItems
     *        Assessment template details that cannot be described. An error code is provided for each failed item.
     */

    public void setFailedItems(java.util.Map<String, FailedItemDetails> failedItems) {
        this.failedItems = failedItems;
    }

    /**
     *

     * Assessment template details that cannot be described. An error code is provided for each failed item.
     *

     *
     * @param failedItems
     *        Assessment template details that cannot be described. An error code is provided for each failed item.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeAssessmentTemplatesResult withFailedItems(java.util.Map<String, FailedItemDetails> failedItems) {
        setFailedItems(failedItems);
        return this;
    }

    public DescribeAssessmentTemplatesResult addFailedItemsEntry(String key, FailedItemDetails value) {
        if (null == this.failedItems) {
            this.failedItems = new java.util.HashMap<String, FailedItemDetails>();
        }
        if (this.failedItems.containsKey(key))
            throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
        this.failedItems.put(key, value);
        return this;
    }

    /**
     * Removes all the entries added into FailedItems.
     *
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeAssessmentTemplatesResult clearFailedItemsEntries() {
        this.failedItems = null;
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getAssessmentTemplates() != null)
            sb.append("AssessmentTemplates: ").append(getAssessmentTemplates()).append(",");
        if (getFailedItems() != null)
            sb.append("FailedItems: ").append(getFailedItems());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof DescribeAssessmentTemplatesResult == false)
            return false;
        DescribeAssessmentTemplatesResult other = (DescribeAssessmentTemplatesResult) obj;
        if (other.getAssessmentTemplates() == null ^ this.getAssessmentTemplates() == null)
            return false;
        if (other.getAssessmentTemplates() != null && other.getAssessmentTemplates().equals(this.getAssessmentTemplates()) == false)
            return false;
        if (other.getFailedItems() == null ^ this.getFailedItems() == null)
            return false;
        if (other.getFailedItems() != null && other.getFailedItems().equals(this.getFailedItems()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getAssessmentTemplates() == null) ? 0 : getAssessmentTemplates().hashCode());
        hashCode = prime * hashCode + ((getFailedItems() == null) ? 0 : getFailedItems().hashCode());
        return hashCode;
    }

    @Override
    public DescribeAssessmentTemplatesResult clone() {
        try {
            return (DescribeAssessmentTemplatesResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
class Member::Agents::Nodes::PhotoSearchController < ApplicationController
  include Cms::NodeFilter::View

  model Member::Photo

  helper Member::PhotoHelper

  before_action :set_query

  private

  def set_query
    @locations  = Member::Node::PhotoLocation.site(@cur_site).and_public
    @categories = Member::Node::PhotoCategory.site(@cur_site).and_public
    @query      = query
  end

  def query
    location_ids = params[:location_ids].select(&:present?).map(&:to_i) rescue []
    category_ids = params[:category_ids].select(&:present?).map(&:to_i) rescue []
    locations    = @locations.in(id: location_ids)
    categories   = @categories.in(id: category_ids)
    {
      keyword: params[:keyword],
      contributor: params[:contributor],
      location_ids: location_ids,
      category_ids: category_ids,
      locations: locations,
      categories: categories,
    }
  end

  public

  def index
    @items = @model.site(@cur_site).and_public(@cur_date).
      where(@cur_node.condition_hash).
      listable.
      contents_search(@query).
      order_by(@cur_node.sort_hash).
      page(params[:page]).
      per(@cur_node.limit)

    render_with_pagination @items
  end

  def map
    @items = @model.site(@cur_site).and_public(@cur_date).
      where(@cur_node.condition_hash).
      listable.
      where(:map_points.exists => true).
      contents_search(@query).
      order_by(@cur_node.sort_hash).
      page(params[:page]).
      per(@cur_node.limit)

    @markers = @items.map { |item| item.map_points }.flatten

    render_with_pagination @items
  end
end


text:
import type { GetServerSidePropsContext } from 'next';

/**
 * Used to grab the page url from serverside props using host/resolved url
 */
const getPageUrl = (context: GetServerSidePropsContext) => {
  const { host } = context.req.headers;
  if (!context.req.headers.host) {
    throw TypeError('No host to use as URL');
  }
  return `${host}${context.resolvedUrl}`;
};

export default getPageUrl;


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="stan.androiddemo.project.novel.BookmarkActivity">

  <android.support.v7.widget.RecyclerView
      android:scrollbars="vertical"
      android:id="@+id/recycler_bookmark"
      android:layout_width="match_parent"
      android:layout_height="match_parent">

  </android.support.v7.widget.RecyclerView>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/btn_delete_bookmark"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        android:src="@drawable/ic_delete_forever_black_24dp" />

</android.support.design.widget.CoordinatorLayout>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.mayinews.mv.user.activity.SettingActivity">

  <RelativeLayout

      android:layout_width="match_parent"
      android:layout_height="40dp">

    <ImageView
        android:id="@+id/tv_back"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@drawable/setting_title_back_selector"
        android:layout_alignTop="@+id/tv_setting"
        android:layout_alignParentLeft="true"
        />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="设置"
        android:textColor="@color/black"
        android:textSize="16sp"

        android:id="@+id/tv_setting" />
  </RelativeLayout>
  <View
      android:background="@color/gh_gray"
      android:layout_width="match_parent"
      android:layout_height="0.5dp"
     />
  <LinearLayout
      android:id="@+id/tv_aboutWe"
      android:gravity="center_vertical"
      android:padding="14dp"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="50dp">
     <TextView

         android:textSize="15sp"
         android:textColor="@color/black"
         android:text="关于我们"
         android:layout_width="0dp"
         android:layout_weight="1"
         android:layout_height="wrap_content" />
    <ImageView
      android:src="@drawable/right_icon_selector"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" />
  </LinearLayout>
  <View
      android:layout_marginLeft="14dp"
      android:layout_marginRight="14dp"
      android:layout_width="match_parent"
      android:layout_height="0.5dp"
      android:background="@color/gh_gray"/>
  <LinearLayout
      android:id="@+id/tv_clearCache"
      android:gravity="center_vertical"
      android:padding="14dp"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="50dp">

    <TextView

        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="清理缓存"
        android:textColor="@color/black"
        android:textSize="15sp" />

    <TextView
        android:id="@+id/tv_cacheSize"
       android:text="50M"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
    <ImageView
        android:src="@drawable/right_icon_selector"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
  </LinearLayout>
  <View
      android:layout_marginLeft="14dp"
      android:layout_marginRight="14dp"
      android:layout_width="match_parent"
      android:layout_height="0.5dp"
      android:background="@color/gh_gray"/>

  <LinearLayout
      android:gravity="center_vertical"
      android:padding="14dp"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="50dp">
    <TextView
        android:id="@+id/tv_shared"
        android:textSize="15sp"
        android:textColor="@color/black"
        android:text="分享客户端"
        android:layout_width="0dp"
        android:layout_weight="1"
        android:layout_height="wrap_content" />
    <ImageView
        android:src="@drawable/right_icon_selector"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
  </LinearLayout>
  <View
      android:layout_marginLeft="14dp"
      android:layout_marginRight="14dp"
      android:layout_width="match_parent"
      android:layout_height="0.5dp"
      android:background="@color/gh_gray"/>
  <LinearLayout
      android:gravity="center_vertical"
      android:padding="14dp"
      android:orientation="horizontal"
      android:layout_width="match_parent"
      android:layout_height="50dp">

    <TextView

        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="当前版本"
        android:textColor="@color/black"
        android:textSize="15sp" />

    <TextView
        android:id="@+id/tv_versionNumber"
        android:text="当前版本1.0"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />
  </LinearLayout>
  <View
      android:layout_marginLeft="14dp"
      android:layout_marginRight="14dp"
      android:layout_width="match_parent"
      android:layout_height="0.5dp"
      android:background="@color/gh_gray"/>
  <TextView
      android:id="@+id/tv_loginOrLogout"
      android:layout_marginTop="20dp"
      android:gravity="center"
      android:textSize="16sp"
      android:text="登录"
      android:textColor="@color/green"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" />
</LinearLayout>


text:
/* eslint-disable no-unused-expressions */

'use strict';

const chai = require('chai');
const chaiHttp = require('chai-http');
const chaiJson = require('chai-json-schema');
const transactionSchemas = require('./schemas/transactions');
const testData = require('./testData/transactions');
const testBuilder = require('./helper/testBuilder');
const tokens = require('./testData/tokens');
const baseObjectSchemas = require('./schemas/baseObjects');
const userSchemas = require('./schemas/users');
const { appConfig } = require('../../config/defaults/config');
const tools = require('./helper/tools');
const app = require('../../app');

chai.should();
chai.use(chaiHttp);
chai.use(chaiJson);

describe('Transactions', () => {
  const apiPath = '/api/transactions/';
  const objectIdType = 'transactionId';
  const objectType = 'transaction';
  const objectsType = 'transactions';

  before('Create a user on /api/users POST', (done) => {
    const dataToSend = {
      data: {
        user: {
          username: tools.createRandString({ length: appConfig.usernameMaxLength }),
          password: tools.createRandString({ length: appConfig.passwordMaxLength }),
          registerDevice: tools.createRandString({ length: appConfig.deviceIdLength }),
        },
      },
    };

    chai
      .request(app)
      .post('/api/users')
      .set('Authorization', tokens.basicUserOne)
      .send(dataToSend)
      .end((error, response) => {
        response.should.have.status(200);
        response.should.be.json;
        response.body.should.be.jsonSchema(baseObjectSchemas.returnData);
        response.body.data.user.should.be.jsonSchema(userSchemas.liteUser);

        const walletId = response.body.data.user.objectId;

        testData.create.first.fromWalletId = walletId;
        testData.create.second.fromWalletId = walletId;
        testData.update.toUpdate.fromWalletId = walletId;
        testData.remove.toRemove.fromWalletId = walletId;
        testData.remove.secondToRemove.fromWalletId = walletId;

        done();
      });
  });

  before('Create another user on /api/users POST', (done) => {
    const dataToSend = {
      data: {
        user: {
          username: tools.createRandString({ length: appConfig.usernameMaxLength }),
          password: tools.createRandString({ length: appConfig.passwordMaxLength }),
          registerDevice: tools.createRandString({ length: appConfig.deviceIdLength }),
        },
      },
    };

    chai
      .request(app)
      .post('/api/users')
      .set('Authorization', tokens.basicUserOne)
      .send(dataToSend)
      .end((error, response) => {
        response.should.have.status(200);
        response.should.be.json;
        response.body.should.be.jsonSchema(baseObjectSchemas.returnData);
        response.body.data.user.should.be.jsonSchema(userSchemas.liteUser);

        const walletId = response.body.data.user.objectId;

        testData.create.first.toWalletId = walletId;
        testData.create.second.toWalletId = walletId;
        testData.update.toUpdate.toWalletId = walletId;
        testData.remove.toRemove.toWalletId = walletId;
        testData.remove.secondToRemove.toWalletId = walletId;

        done();
      });
  });

  testBuilder.createTestCreate({
    objectType,
    apiPath,
    objectIdType,
    testData: testData.create,
    schema: transactionSchemas.transaction,
  });

  testBuilder.createTestUpdate({
    objectType,
    objectIdType,
    apiPath,
    createByAdmin: true,
    testData: testData.update,
    schema: transactionSchemas.transaction,
  });

  testBuilder.createTestGet({
    objectIdType,
    apiPath,
    objectType,
    objectsType,
    testData: testData.create,
    singleLiteSchema: transactionSchemas.transaction,
    multiLiteSchema: transactionSchemas.transactions,
    singleFullSchema: transactionSchemas.fullTransaction,
    multiFullSchema: transactionSchemas.fullTransactions,
  });

  testBuilder.createTestDelete({
    objectType,
    objectIdType,
    apiPath,
    skipOwner: true,
    createByAdmin: true,
    testData: testData.remove,
  });
});


text:
namespace extensions {

using AccessibilityPrivateApiTest = ExtensionApiTest;

IN_PROC_BROWSER_TEST_F(AccessibilityPrivateApiTest, SendSyntheticKeyEvent) {
  ASSERT_TRUE(RunExtensionSubtest("accessibility_private/",
                                  "send_synthetic_key_event.html"))
      << message_;
}

IN_PROC_BROWSER_TEST_F(AccessibilityPrivateApiTest,
                       GetDisplayNameForLocaleTest) {
  ASSERT_TRUE(
      RunExtensionSubtest("accessibility_private/", "display_locale.html"))
      << message_;
}

// Flaky on a debug build, see crbug.com/1030507.
#if !defined(NDEBUG)
#define MAYBE_OpenSettingsSubpage DISABLED_OpenSettingsSubpage
#else
#define MAYBE_OpenSettingsSubpage OpenSettingsSubpage
#endif
IN_PROC_BROWSER_TEST_F(AccessibilityPrivateApiTest, MAYBE_OpenSettingsSubpage) {
  Profile* profile = chromeos::AccessibilityManager::Get()->profile();

  // Install the Settings App.
  web_app::WebAppProvider::Get(profile)
      ->system_web_app_manager()
      .InstallSystemAppsForTesting();

  ASSERT_TRUE(RunExtensionSubtest("accessibility_private/",
                                  "open_settings_subpage.html"))
      << message_;

  chrome::SettingsWindowManager* settings_manager =
      chrome::SettingsWindowManager::GetInstance();

  Browser* settings_browser = settings_manager->FindBrowserForProfile(profile);
  EXPECT_NE(nullptr, settings_browser);

  content::WebContents* web_contents =
      settings_browser->tab_strip_model()->GetWebContentsAt(0);

  WaitForLoadStop(web_contents);

  EXPECT_EQ(GURL(chrome::GetOSSettingsUrl("manageAccessibility/tts")),
            web_contents->GetLastCommittedURL());
}

IN_PROC_BROWSER_TEST_F(AccessibilityPrivateApiTest,
                       OpenSettingsSubpage_InvalidSubpage) {
  Profile* profile = chromeos::AccessibilityManager::Get()->profile();

  // Install the Settings App.
  web_app::WebAppProvider::Get(profile)
      ->system_web_app_manager()
      .InstallSystemAppsForTesting();

  ASSERT_TRUE(RunExtensionSubtest("accessibility_private/",
                                  "open_settings_subpage_invalid_subpage.html"))
      << message_;

  chrome::SettingsWindowManager* settings_manager =
      chrome::SettingsWindowManager::GetInstance();

  // Invalid subpage should not open settings window.
  Browser* settings_browser = settings_manager->FindBrowserForProfile(profile);
  EXPECT_EQ(nullptr, settings_browser);
}

}  // namespace extensions


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AutoMapper.Mappers;
using Shouldly;
using Xunit;

namespace AutoMapper.UnitTests.MappingInheritance
{
    public class AsShouldWorkOnlyWithDerivedTypesWithGenerics : AutoMapperSpecBase
    {
        class Source<T>
        {
        }

        class Destination<T>
        {
        }

        class Override<T> : Destination<T>
        {
        }

        protected override MapperConfiguration Configuration => new MapperConfiguration(c => c.CreateMap(typeof(Source<>), typeof(Destination<>)).As(typeof(Override<>)));
    }

    public class AsShouldWorkOnlyWithDerivedTypes
    {
        class Source
        {
        }

        class Destination
        {
        }

        [Fact]
        public void Should_detect_unrelated_override()
        {
            new Action(() => new MapperConfiguration(c => c.CreateMap(typeof(Source), typeof(Destination)).As(typeof(Source)))).ShouldThrowException<ArgumentOutOfRangeException>(ex =>
            {
                ex.Message.ShouldStartWith($"{typeof(Source)} is not derived from {typeof(Destination)}.");
            });
        }
    }

    public class DestinationTypePolymorphismTest
    {
        public class Customer
        {
            public int Id { get; set; }
            public string Name { get; set; }
        }

        public class CustomerStubDTO
        {
            public int Id { get; set; }
        }

        public class CustomerDTO : CustomerStubDTO
        {
            public string Name { get; set; }
        }

        public class Order
        {
            public Customer Customer { get; set; }
        }

        public class OrderDTO
        {
            public CustomerStubDTO Customer { get; set; }
        }

        [Fact]
        public void Mapper_Should_Allow_Overriding_Of_Destination_Type()
        {
            var order = new Order() { Customer = new Customer() { Id = 1, Name = "A" } };

            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap<Order, OrderDTO>();
                cfg.CreateMap<Customer, CustomerDTO>();
                cfg.CreateMap<Customer, CustomerStubDTO>().As<CustomerDTO>();
            });
            var orderDto = config.CreateMapper().Map<Order, OrderDTO>(order);

            var customerDto = (CustomerDTO)orderDto.Customer;
            "A".ShouldBe(customerDto.Name);
            1.ShouldBe(customerDto.Id);

        }

    }
    public class DestinationTypePolymorphismTestNonGeneric
    {
        public class Customer
        {
            public int Id { get; set; }
            public string Name { get; set; }
        }

        public class CustomerStubDTO
        {
            public int Id { get; set; }
        }

        public class CustomerDTO : CustomerStubDTO
        {
            public string Name { get; set; }
        }

        public class Order
        {
            public Customer Customer { get; set; }
        }

        public class OrderDTO
        {
            public CustomerStubDTO Customer { get; set; }
        }

        [Fact]
        public void Mapper_Should_Allow_Overriding_Of_Destination_Type()
        {
            var order = new Order() { Customer = new Customer() { Id = 1, Name = "A" } };
            var config = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap(typeof(Order), typeof(OrderDTO));
                cfg.CreateMap(typeof(Customer), typeof(CustomerDTO));
                cfg.CreateMap(typeof(Customer), typeof(CustomerStubDTO)).As(typeof(CustomerDTO));
            });
            var orderDto = config.CreateMapper().Map<Order, OrderDTO>(order);

            var customerDto = (CustomerDTO)orderDto.Customer;
            "A".ShouldBe(customerDto.Name);
            1.ShouldBe(customerDto.Id);

        }

    }

    public class AsWithGenerics : AutoMapperSpecBase
    {
        INodeModel<int> _destination;

        public interface INodeModel<T> : INodeModel where T : struct
        {
            new T? ID { get; set; }
        }

        public interface INodeModel
        {
            object ID { get; set; }
            string Name { get; set; }
        }

        public class NodeModel<T> : INodeModel<T> where T : struct
        {
            public T? ID { get; set; }
            public string Name { get; set; }

            object INodeModel.ID
            {
                get
                {
                    return ID;
                }

                set
                {
                    ID = value as T?;
                }
            }
        }

        public class NodeDto<T> where T : struct
        {
            public T? ID { get; set; }
            public string Name { get; set; }
        }

        protected override MapperConfiguration Configuration
        {
            get
            {
                return new MapperConfiguration(cfg => {
                    cfg.CreateMap(typeof(NodeDto<>), typeof(NodeModel<>));
                    cfg.CreateMap(typeof(NodeDto<>), typeof(INodeModel<>)).As(typeof(NodeModel<>));
                    cfg.CreateMap(typeof(INodeModel<>), typeof(NodeModel<>));
                });
            }
        }

        protected override void Because_of()
        {
            var dto = new NodeDto<int> { ID = 1, Name = "Hi" };
            _destination = Mapper.Map<INodeModel<int>>(dto);
        }

        [Fact]
        public void Should_override_the_map()
        {
            _destination.ShouldBeOfType<NodeModel<int>>();
            _destination.ID.ShouldBe(1);
            _destination.Name.ShouldBe("Hi");
        }
    }
}


text:
include ../vars.mk

.PHONY: test

all: double single circular

core:
	$(CC) $(CFLAGS) -c linkedlist_core.c

double: core
	$(CC) $(CFLAGS) -c double_linkedlist.c

single: core
	$(CC) $(CFLAGS) -c single_linkedlist.c

circular: core
	$(CC) $(CFLAGS) -c circular_linkedlist.c

test:
	cd test && make run

clean:
	rm -f linkedlist_core.o
	rm -f double_linkedlist.o
	rm -f single_linkedlist.o
	rm -f circular_linkedlist.o
	cd test && make clean


text:
<?xml version="1.0"?>
<layout version="1.4.0">
    <banners_adminhtml_banners_index>
        <reference name="content">
            <block type="banners/adminhtml_banners" name="banners" />
        </reference>
    </banners_adminhtml_banners_index>
</layout>


text:
<?php

namespace MattCannon\Blm\Interfaces;

use MattCannon\Blm\Exceptions;
use Illuminate\Support\Collection;

/**
 * Interface ParserInterface
 *
 * To use the parser you should create a new instance of the Parser class, then set the BLM contents, or pass in a file path to a BLM.
 * To access the data in the BLM, you should call ```parseBlm()```.
 *
 * ```php
 * $parser = new \MattCannon\Blm\Parser;
 * $parser->setBlmFilePath('/path/to/blm/file');
 *
 * $data = $parser->parseBlm();
 *
 * foreach ($data as $property) {
 *      var_dump($property);
 * }
 * ```
 *
 * @package MattCannon\Blm\Interfaces
 * @author Matt Cannon
 *
 */
interface ParserInterface extends \Psr\Log\LoggerAwareInterface
{

    /**
     * Parses the BLM and returns a collection of PropertyObjects
     * @return Collection
     * @throws
     * @throws Exceptions\InvalidBLMException
     */
    public function parseBlm();
    /**
     * Sets the BLM data to parse
     * @param string $blmContentString
     */
    public function setBlmContents($blmContentString);
    /**
     * returns the BLM data as a string to be parsed.
     * @return string|null
     */
    public function getBlmContents();

}


text:
<?php

namespace Application\Module;

use Zend\InputFilter\InputFilter;
use Zend\InputFilter\Factory as inputFactory;
use Zend\InputFilter\InputFilterInterface;
use Zend\InputFilter\InputFilterAwareInterface;

class Filmes implements InputFilterAwareInterface {

	public $filmes_id;
	public $filmes_nome;
	public $filmes_descricao;
	public $filmes_preco;
	public $filmes_status;
	public $filmes_foto;
	public $categoria_id;

	protected $inputFilter;

	public function exchangeArray($data) {

		$this->filmes_id = (isset($data['filmes_id'])) ? $data['filmes_id'] : null;
		$this->filmes_nome = (isset($data['filmes_nome'])) ? $data['filmes_nome'] : null;
		$this->filmes_descricao = (isset($data['filmes_descricao'])) ? $data['filmes_descricao'] : null;
		$this->filmes_preco = (isset($data['filmes_preco'])) ? $data['filmes_preco'] : null;
		$this->filmes_status = (isset($data['filmes_status'])) ? $data['filmes_status'] : null;
		$this->filmes_foto = (isset($data['filmes_foto'])) ? $data['filmes_foto'] : null;
		$this->categoria_id = (isset($data['categoria_id'])) ? $data['categoria_id'] : null;
	}

	public function getArrayCopy () {
		return get_object_vars($this);
	}

	public function setInputFilter(InputFilterInterface $inputFilter) {
		throw new \Exception('Not used');
	}

	public function getInputFilter() {
		if(!$this->inputFilter) {
			$inputFilter = new InputFilter();

			$factory = new inputFactory();

			$inputFilter->add($factory->createInput(array(
					'name' => 'filmes_foto',
					'required' => false,
					'filters' => array(
							array('name' => 'StripTags'),
							array('name' => 'StringTrim')
					)
			)));

			$inputFilter->add($factory->createInput(array(
				'name' => 'filmes_nome',
				'required' => true,
				'filters' => array(
						array('name' => 'StripTags'),
						array('name' => 'StringTrim')
				),
				'validators' => array(
						array(
							'name' => 'NotEmpty',
							'options' => array(
								'messages' => array(
									'isEmpty' => 'Nome deve ser diferente de branco.'
								)
							)
						)
				)
			)));

			$inputFilter->add($factory->createInput(array(
				'name' => 'filmes_preco',
				'required' => true,
				'filters' => array(
						array('name' => 'StripTags'),
						array('name' => 'StringTrim')
				),
				'validators' => array(
					array(
						'name' => 'NotEmpty',
						'options' => array(
							'messages' => array(
								'isEmpty' => 'Valor do Aluguel deve ser diferente de branco.'
							)
						)
					)
				)

			)));

			$inputFilter->add($factory->createInput(array(
				'name' => 'categoria_id',
				'required' => true,
				'filters' => array(
						array('name' => 'Digits'),
				),
				'validators' => array(
					array(
						'name' => 'NotEmpty',
						'options' => array(
							'messages' => array(
								'isEmpty' => 'Categoria deve ser setada',
							)
						)
					)
				)

			)));

			$inputFilter->add($factory->createInput(array(
				'name' => 'filmes_descricao',
				'required' => true,
				'filters' => array(
						array('name' => 'StripTags'),
						array('name' => 'StringTrim')
				),
				'validators' => array(
						array(
							'name' => 'NotEmpty',
							'options' => array(
								'messages' => array(
									'isEmpty' => 'Descrição deve ser diferente de branco.'
								)
							)
						),
						array(
								'name' => 'StringLength',
								true,
								'options' => array(
										'ecoding' => 'UTF-8',
										'min' => 10,
										'max' => 500,
										'message' => 'Descrição deve conter entre 10 e 500 caracteres.'
								)
						)
				)
			)));

			$this->inputFilter = $inputFilter;
		}

		return $this->inputFilter;
	}
}


text:
import json
import os

import redis

# initialize redis connection for local and CF deployment
def connect_redis_db(redis_service_name = 'p-redis'):
    if os.environ.get('VCAP_SERVICES') is None: # running locally
        DB_HOST = 'localhost'
        DB_PORT = 6379
        DB_PW = ''
        REDIS_DB = 1
    else:                                       # running on CF
        env_vars = os.environ['VCAP_SERVICES']
        credentials = json.loads(env_vars)[redis_service_name][0]['credentials']
        DB_HOST = credentials['host']
        DB_PORT = credentials['port']
        DB_PW = credentials['password']
        REDIS_DB = 0

    return redis.StrictRedis(host=DB_HOST,
                              port=DB_PORT,
                              password=DB_PW,
                              db=REDIS_DB)


text:
> Thunkify, basically, everything. Generator function, callback-style or synchronous function; sync function that returns child process, stream or observable; directly passed promise, stream or child process.

[![code climate][codeclimate-img]][codeclimate-url] [![standard code style][standard-img]][standard-url] [![travis build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![dependency status][david-img]][david-url]

## Install
```
npm i always-thunk --save
npm test
```

## Usage
> For more use-cases see the [tests](./test.js)

```js
var fs = require('fs')
var alwaysThunk = require('always-thunk')

var readFile = alwaysThunk(fs.readFile)
readFile('./package.json', 'utf8')(function (err, res) {
  console.log(err) //=> null
  console.log(res) //=> package.json content
})

var readFileSync = alwaysThunk(fs.readFileSync)
readFileSync('./package.json', 'utf8')(function (err, res) {
  console.log(err) //=> null
  console.log(res) //=> package.json content
})
```

## Related
- [always-promise](https://github.com/tunnckocore/always-promise#readme): Create Bluebird Promise from given async or synchronous function. It automatically convert sync functions to async, then to promise.
- [always-callback](https://github.com/tunnckocore/always-callback#readme): Create callback api for given sync function. Guarantee that given function (sync or async, no matter) will always have callback api and will handle errors correctly.
- [handle-callback](https://github.com/hybridables/handle-callback#readme): Make promise to have support for callback api, it returns promise in that same time.
- [make-callback](https://github.com/tunnckocore/make-callback#readme): Make synchronous function to support callback api
- [promise2thunk](https://github.com/tunnckocore/promise2thunk#readme): Convert (transform) promise to thunk, just like was in co@3

## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/always-thunk/issues/new).
But before doing anything, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines.

## [Charlike Make Reagent](http://j.mp/1stW47C) [![new message to charlike][new-message-img]][new-message-url] [![freenode #charlike][freenode-img]][freenode-url]

[![tunnckocore.tk][author-www-img]][author-www-url] [![keybase tunnckocore][keybase-img]][keybase-url] [![tunnckoCore npm][author-npm-img]][author-npm-url] [![tunnckoCore twitter][author-twitter-img]][author-twitter-url] [![tunnckoCore github][author-github-img]][author-github-url]

[npmjs-url]: https://www.npmjs.com/package/always-thunk
[npmjs-img]: https://img.shields.io/npm/v/always-thunk.svg?label=always-thunk

[license-url]: https://github.com/tunnckoCore/always-thunk/blob/master/LICENSE.md
[license-img]: https://img.shields.io/badge/license-MIT-blue.svg

[codeclimate-url]: https://codeclimate.com/github/tunnckoCore/always-thunk
[codeclimate-img]: https://img.shields.io/codeclimate/github/tunnckoCore/always-thunk.svg

[travis-url]: https://travis-ci.org/tunnckoCore/always-thunk
[travis-img]: https://img.shields.io/travis/tunnckoCore/always-thunk.svg

[coveralls-url]: https://coveralls.io/r/tunnckoCore/always-thunk
[coveralls-img]: https://img.shields.io/coveralls/tunnckoCore/always-thunk.svg

[david-url]: https://david-dm.org/tunnckoCore/always-thunk
[david-img]: https://img.shields.io/david/tunnckoCore/always-thunk.svg

[standard-url]: https://github.com/feross/standard
[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg

[author-www-url]: http://www.tunnckocore.tk
[author-www-img]: https://img.shields.io/badge/www-tunnckocore.tk-fe7d37.svg

[keybase-url]: https://keybase.io/tunnckocore
[keybase-img]: https://img.shields.io/badge/keybase-tunnckocore-8a7967.svg

[author-npm-url]: https://www.npmjs.com/~tunnckocore
[author-npm-img]: https://img.shields.io/badge/npm-~tunnckocore-cb3837.svg

[author-twitter-url]: https://twitter.com/tunnckoCore
[author-twitter-img]: https://img.shields.io/badge/twitter-@tunnckoCore-55acee.svg

[author-github-url]: https://github.com/tunnckoCore
[author-github-img]: https://img.shields.io/badge/github-@tunnckoCore-4183c4.svg

[freenode-url]: http://webchat.freenode.net/?channels=charlike
[freenode-img]: https://img.shields.io/badge/freenode-%23charlike-5654a4.svg

[new-message-url]: https://github.com/tunnckoCore/messages
[new-message-img]: https://img.shields.io/badge/send%20me-message-green.svg


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <predicate lemma="delude">
        <note>
            Frames file for 'delude' based on dictionary.com.  Verbnet entry 59.
        </note>

        <roleset id="delude.01" name="mislead the mind or judgement of" vncls="59-1">
            <roles>
                <role descr="misleader" n="0">
                    <vnrole vncls="59-1" vntheta="Agent"/>
                </role>
                <role descr="misled to" n="1">
                    <vnrole vncls="59-1" vntheta="Patient"/>
                </role>
                <role descr="misled about" n="2">
                    <vnrole vncls="59-1" vntheta="Proposition"/>
                </role>
            </roles>

            <example name="untrustworthy">
                <text>
                    His conciet deluded him into believing he was important.
                </text>
                <arg n="0">his conciet</arg>
                <rel>deluded</rel>
                <arg n="1">him</arg>
                <arg n="2">into believing he was important</arg>

            </example>
        </roleset>
        <note>frame by Perryn</note>
    </predicate>
</frameset>


text:
Bookmarks (nspopover)

Left

        <a role="button"
            href
            class="btn btn-link btn-link-icon"
            ns-popover
            ns-popover-template="bookmarks"
            ns-popover-trigger="click"
            ns-popover-theme="ns-popover-tooltip-theme"
            ns-popover-timeout="1000"
            ns-popover-hide-on-inside-click="false"
            ns-popover-hide-on-outside-click="true"
            ns-popover-hide-on-button-click="true"
            ns-popover-placement="left"
            tooltip="Bookmarks"
            >

Right

        <a role="button"
            href
            class="btn btn-link btn-link-icon"
            ns-popover
            ns-popover-template="bookmarks"
            ns-popover-trigger="click"
            ns-popover-theme="ns-popover-tooltip-theme"
            ns-popover-timeout="1000"
            ns-popover-hide-on-inside-click="false"
            ns-popover-hide-on-outside-click="true"
            ns-popover-hide-on-button-click="true"
            ns-popover-placement="right"
            tooltip="Bookmarks"
            >


text:
#ifndef __WINDOWS_HANDLE_H
#define __WINDOWS_HANDLE_H

namespace NWindows {

class CHandle
{
protected:
  HANDLE _handle;
public:
  operator HANDLE() { return _handle; }
  CHandle(): _handle(NULL) {}
  ~CHandle() { Close(); }
  bool Close()
  {
    if (_handle == NULL)
      return true;
    if (!::CloseHandle(_handle))
      return false;
    _handle = NULL;
    return true;
  }
  void Attach(HANDLE handle)
    { _handle = handle; }
  HANDLE Detach()
  {
    HANDLE handle = _handle;
    _handle = NULL;
    return handle;
  }
};

}

#endif


text:
package com.orientechnologies.common.exception;

public class OException extends RuntimeException {

  private static final long serialVersionUID = 3882447822497861424L;

  public OException() {
  }

  public OException(final String message) {
    super(message);
  }

  public OException(final Throwable cause) {
    super(cause);
  }

  public OException(final String message, final Throwable cause) {
    super(message, cause);
  }

  @Override
  public boolean equals(final Object obj) {
    if (obj == null || !obj.getClass().equals(getClass()))
      return false;

    final String myMsg = getMessage();
    final String otherMsg = ((OException) obj).getMessage();
    if (myMsg == null || otherMsg == null)
      // UNKNOWN
      return false;

    return myMsg.equals(otherMsg);
  }

  public static Throwable getFirstCause(Throwable iRootException) {
    while (iRootException.getCause() != null)
      iRootException = iRootException.getCause();

    return iRootException;
  }
}


text:
/**
 * @class Oskari.harava.bundle.mapmodule.request.AddControlToMapRequestHandler
 * Handles Oskari.harava.bundle.mapmodule.request.AddControlToMapRequest to add OpenLayers control to map.
 */
Oskari.clazz.define('Oskari.harava.bundle.mapmodule.request.AddControlToMapRequestHandler',
/**
 * @method create called automatically on construction
 * @static
 *
 * @param {Oskari.mapframework.sandbox.Sandbox}
 *            sandbox reference to sandbox
 * @param {Oskari.mapframework.ui.module.common.MapModule}
 *            mapModule reference to mapmodule
 */
function(sandbox, mapModule) {
    this.sandbox = sandbox;
    this.mapModule = mapModule;
}, {
	/**
	 * @method handleRequest
	 * Add control to map
	 * @param {Oskari.mapframework.core.Core} core
	 * 		reference to the application core (reference sandbox core.getSandbox())
	 * @param {Oskari.harava.bundle.havaraInfobox.request.ShowInfoBoxRequest} request
	 * 		request to handle
	 */
    handleRequest : function(core, request) {
    	var openlayersMap = this.mapModule.getMap();
    	var control = request.getControl();
    	if(control!=null){
    		openlayersMap.addControl(control);
    	}
   }
}, {
    /**
     * @property {String[]} protocol array of superclasses as {String}
     * @static
     */
    protocol : ['Oskari.mapframework.core.RequestHandler']
});


text:
from django import forms

from .models import User

class UserForm(forms.ModelForm):

    class Meta:
        # Set this form to use the User model.
        model = User

        # Constrain the UserForm to just these fields.
        fields = ("first_name", "last_name")


text:
<?php
$title = " - Pinnakisapalvelu";
include "application/views/page_elements/header.php";
?>

<?php echo lang('edit_group_heading');?>

<?php echo lang('edit_group_subheading');?>

<?php echo $message;?>

<?php echo form_open(current_url());?>

            <?php echo lang('create_group_name_label', 'group_name');?>

            <?php echo form_input($group_name);?>

            <?php echo lang('edit_group_desc_label', 'description');?>

            <?php echo form_input($group_description);?>

<?php echo form_submit('submit', lang('edit_group_submit_btn'));?>

<?php echo form_close();?>

<?php
include "application/views/page_elements/footer.php";
?>


text:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation,TypographyDashes">
    <string name="gtfs_real_time_agency_url_token">INSERT_AGENCY_REAL_TIME_URL_TOKEN_HERE</string>
    <string name="twitter_consumer_key">INSERT_TWITTER_CONSUMER_KEY_HERE</string>
    <string name="twitter_consumer_secret">INSERT_TWITTER_CONSUMER_SECRET_HERE</string>
    <string name="youtube_api_key">INSERT_YOUTUBE_API_KEY_HERE</string>
</resources>


text:
namespace exec {
namespace bit {

namespace {

const ::google::protobuf::Descriptor* FragmentHandle_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  FragmentHandle_reflection_ = NULL;
const ::google::protobuf::Descriptor* ServerPreparedStatementState_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  ServerPreparedStatementState_reflection_ = NULL;

}  // namespace

void protobuf_AssignDesc_ExecutionProtos_2eproto() {
  protobuf_AddDesc_ExecutionProtos_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "ExecutionProtos.proto");
  GOOGLE_CHECK(file != NULL);
  FragmentHandle_descriptor_ = file->message_type(0);
  static const int FragmentHandle_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FragmentHandle, query_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FragmentHandle, major_fragment_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FragmentHandle, minor_fragment_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FragmentHandle, parent_query_id_),
  };
  FragmentHandle_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      FragmentHandle_descriptor_,
      FragmentHandle::default_instance_,
      FragmentHandle_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FragmentHandle, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(FragmentHandle, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(FragmentHandle));
  ServerPreparedStatementState_descriptor_ = file->message_type(1);
  static const int ServerPreparedStatementState_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerPreparedStatementState, sql_query_),
  };
  ServerPreparedStatementState_reflection_ =
    new ::google::protobuf::internal::GeneratedMessageReflection(
      ServerPreparedStatementState_descriptor_,
      ServerPreparedStatementState::default_instance_,
      ServerPreparedStatementState_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerPreparedStatementState, _has_bits_[0]),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ServerPreparedStatementState, _unknown_fields_),
      -1,
      ::google::protobuf::DescriptorPool::generated_pool(),
      ::google::protobuf::MessageFactory::generated_factory(),
      sizeof(ServerPreparedStatementState));
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_ExecutionProtos_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    FragmentHandle_descriptor_, &FragmentHandle::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
    ServerPreparedStatementState_descriptor_, &ServerPreparedStatementState::default_instance());
}

}  // namespace

void protobuf_ShutdownFile_ExecutionProtos_2eproto() {
  delete FragmentHandle::default_instance_;
  delete FragmentHandle_reflection_;
  delete ServerPreparedStatementState::default_instance_;
  delete ServerPreparedStatementState_reflection_;
}

void protobuf_AddDesc_ExecutionProtos_2eproto() {
  static bool already_here = false;
  if (already_here) return;
  already_here = true;
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::exec::protobuf_AddDesc_Coordination_2eproto();
  ::exec::shared::protobuf_AddDesc_UserBitShared_2eproto();
  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\025ExecutionProtos.proto\022\010exec.bit\032\022Coord"
    "ination.proto\032\023UserBitShared.proto\"\235\001\n\016F"
    "ragmentHandle\022&\n\010query_id\030\001 \001(\0132\024.exec.s"
    "hared.QueryId\022\031\n\021major_fragment_id\030\002 \001(\005"
    "\022\031\n\021minor_fragment_id\030\003 \001(\005\022-\n\017parent_qu"
    "ery_id\030\004 \001(\0132\024.exec.shared.QueryId\"1\n\034Se"
    "rverPreparedStatementState\022\021\n\tsql_query\030"
    "\001 \001(\tB+\n\033org.apache.drill.exec.protoB\nEx"
    "ecProtosH\001", 330);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "ExecutionProtos.proto", &protobuf_RegisterTypes);
  FragmentHandle::default_instance_ = new FragmentHandle();
  ServerPreparedStatementState::default_instance_ = new ServerPreparedStatementState();
  FragmentHandle::default_instance_->InitAsDefaultInstance();
  ServerPreparedStatementState::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_ExecutionProtos_2eproto);
}

// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_ExecutionProtos_2eproto {
  StaticDescriptorInitializer_ExecutionProtos_2eproto() {
    protobuf_AddDesc_ExecutionProtos_2eproto();
  }
} static_descriptor_initializer_ExecutionProtos_2eproto_;

// ===================================================================

#ifndef _MSC_VER
const int FragmentHandle::kQueryIdFieldNumber;
const int FragmentHandle::kMajorFragmentIdFieldNumber;
const int FragmentHandle::kMinorFragmentIdFieldNumber;
const int FragmentHandle::kParentQueryIdFieldNumber;
#endif  // !_MSC_VER

FragmentHandle::FragmentHandle()
  : ::google::protobuf::Message() {
  SharedCtor();
}

void FragmentHandle::InitAsDefaultInstance() {
  query_id_ = const_cast< ::exec::shared::QueryId*>(&::exec::shared::QueryId::default_instance());
  parent_query_id_ = const_cast< ::exec::shared::QueryId*>(&::exec::shared::QueryId::default_instance());
}

FragmentHandle::FragmentHandle(const FragmentHandle& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
}

void FragmentHandle::SharedCtor() {
  _cached_size_ = 0;
  query_id_ = NULL;
  major_fragment_id_ = 0;
  minor_fragment_id_ = 0;
  parent_query_id_ = NULL;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

FragmentHandle::~FragmentHandle() {
  SharedDtor();
}

void FragmentHandle::SharedDtor() {
  if (this != default_instance_) {
    delete query_id_;
    delete parent_query_id_;
  }
}

void FragmentHandle::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* FragmentHandle::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return FragmentHandle_descriptor_;
}

const FragmentHandle& FragmentHandle::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_ExecutionProtos_2eproto();
  return *default_instance_;
}

FragmentHandle* FragmentHandle::default_instance_ = NULL;

FragmentHandle* FragmentHandle::New() const {
  return new FragmentHandle;
}

void FragmentHandle::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (has_query_id()) {
      if (query_id_ != NULL) query_id_->::exec::shared::QueryId::Clear();
    }
    major_fragment_id_ = 0;
    minor_fragment_id_ = 0;
    if (has_parent_query_id()) {
      if (parent_query_id_ != NULL) parent_query_id_->::exec::shared::QueryId::Clear();
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool FragmentHandle::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional .exec.shared.QueryId query_id = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_query_id()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(16)) goto parse_major_fragment_id;
        break;
      }

      // optional int32 major_fragment_id = 2;
      case 2: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_major_fragment_id:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &major_fragment_id_)));
          set_has_major_fragment_id();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(24)) goto parse_minor_fragment_id;
        break;
      }

      // optional int32 minor_fragment_id = 3;
      case 3: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
         parse_minor_fragment_id:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &minor_fragment_id_)));
          set_has_minor_fragment_id();
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectTag(34)) goto parse_parent_query_id;
        break;
      }

      // optional .exec.shared.QueryId parent_query_id = 4;
      case 4: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
         parse_parent_query_id:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_parent_query_id()));
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }

      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void FragmentHandle::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // optional .exec.shared.QueryId query_id = 1;
  if (has_query_id()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, this->query_id(), output);
  }

  // optional int32 major_fragment_id = 2;
  if (has_major_fragment_id()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(2, this->major_fragment_id(), output);
  }

  // optional int32 minor_fragment_id = 3;
  if (has_minor_fragment_id()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->minor_fragment_id(), output);
  }

  // optional .exec.shared.QueryId parent_query_id = 4;
  if (has_parent_query_id()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      4, this->parent_query_id(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}

::google::protobuf::uint8* FragmentHandle::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // optional .exec.shared.QueryId query_id = 1;
  if (has_query_id()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        1, this->query_id(), target);
  }

  // optional int32 major_fragment_id = 2;
  if (has_major_fragment_id()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(2, this->major_fragment_id(), target);
  }

  // optional int32 minor_fragment_id = 3;
  if (has_minor_fragment_id()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->minor_fragment_id(), target);
  }

  // optional .exec.shared.QueryId parent_query_id = 4;
  if (has_parent_query_id()) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteMessageNoVirtualToArray(
        4, this->parent_query_id(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}

int FragmentHandle::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional .exec.shared.QueryId query_id = 1;
    if (has_query_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->query_id());
    }

    // optional int32 major_fragment_id = 2;
    if (has_major_fragment_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->major_fragment_id());
    }

    // optional int32 minor_fragment_id = 3;
    if (has_minor_fragment_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->minor_fragment_id());
    }

    // optional .exec.shared.QueryId parent_query_id = 4;
    if (has_parent_query_id()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          this->parent_query_id());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void FragmentHandle::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const FragmentHandle* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const FragmentHandle*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void FragmentHandle::MergeFrom(const FragmentHandle& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_query_id()) {
      mutable_query_id()->::exec::shared::QueryId::MergeFrom(from.query_id());
    }
    if (from.has_major_fragment_id()) {
      set_major_fragment_id(from.major_fragment_id());
    }
    if (from.has_minor_fragment_id()) {
      set_minor_fragment_id(from.minor_fragment_id());
    }
    if (from.has_parent_query_id()) {
      mutable_parent_query_id()->::exec::shared::QueryId::MergeFrom(from.parent_query_id());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void FragmentHandle::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void FragmentHandle::CopyFrom(const FragmentHandle& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool FragmentHandle::IsInitialized() const {

  return true;
}

void FragmentHandle::Swap(FragmentHandle* other) {
  if (other != this) {
    std::swap(query_id_, other->query_id_);
    std::swap(major_fragment_id_, other->major_fragment_id_);
    std::swap(minor_fragment_id_, other->minor_fragment_id_);
    std::swap(parent_query_id_, other->parent_query_id_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata FragmentHandle::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = FragmentHandle_descriptor_;
  metadata.reflection = FragmentHandle_reflection_;
  return metadata;
}

// ===================================================================

#ifndef _MSC_VER
const int ServerPreparedStatementState::kSqlQueryFieldNumber;
#endif  // !_MSC_VER

ServerPreparedStatementState::ServerPreparedStatementState()
  : ::google::protobuf::Message() {
  SharedCtor();
}

void ServerPreparedStatementState::InitAsDefaultInstance() {
}

ServerPreparedStatementState::ServerPreparedStatementState(const ServerPreparedStatementState& from)
  : ::google::protobuf::Message() {
  SharedCtor();
  MergeFrom(from);
}

void ServerPreparedStatementState::SharedCtor() {
  _cached_size_ = 0;
  sql_query_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

ServerPreparedStatementState::~ServerPreparedStatementState() {
  SharedDtor();
}

void ServerPreparedStatementState::SharedDtor() {
  if (sql_query_ != &::google::protobuf::internal::kEmptyString) {
    delete sql_query_;
  }
  if (this != default_instance_) {
  }
}

void ServerPreparedStatementState::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ServerPreparedStatementState::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ServerPreparedStatementState_descriptor_;
}

const ServerPreparedStatementState& ServerPreparedStatementState::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_ExecutionProtos_2eproto();
  return *default_instance_;
}

ServerPreparedStatementState* ServerPreparedStatementState::default_instance_ = NULL;

ServerPreparedStatementState* ServerPreparedStatementState::New() const {
  return new ServerPreparedStatementState;
}

void ServerPreparedStatementState::Clear() {
  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (has_sql_query()) {
      if (sql_query_ != &::google::protobuf::internal::kEmptyString) {
        sql_query_->clear();
      }
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  mutable_unknown_fields()->Clear();
}

bool ServerPreparedStatementState::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
  ::google::protobuf::uint32 tag;
  while ((tag = input->ReadTag()) != 0) {
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string sql_query = 1;
      case 1: {
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_sql_query()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8String(
            this->sql_query().data(), this->sql_query().length(),
            ::google::protobuf::internal::WireFormat::PARSE);
        } else {
          goto handle_uninterpreted;
        }
        if (input->ExpectAtEnd()) return true;
        break;
      }

      default: {
      handle_uninterpreted:
        if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          return true;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
  return true;
#undef DO_
}

void ServerPreparedStatementState::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // optional string sql_query = 1;
  if (has_sql_query()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
      this->sql_query().data(), this->sql_query().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE);
    ::google::protobuf::internal::WireFormatLite::WriteString(
      1, this->sql_query(), output);
  }

  if (!unknown_fields().empty()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
}

::google::protobuf::uint8* ServerPreparedStatementState::SerializeWithCachedSizesToArray(
    ::google::protobuf::uint8* target) const {
  // optional string sql_query = 1;
  if (has_sql_query()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8String(
      this->sql_query().data(), this->sql_query().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE);
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->sql_query(), target);
  }

  if (!unknown_fields().empty()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  return target;
}

int ServerPreparedStatementState::ByteSize() const {
  int total_size = 0;

  if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    // optional string sql_query = 1;
    if (has_sql_query()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->sql_query());
    }

  }
  if (!unknown_fields().empty()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void ServerPreparedStatementState::MergeFrom(const ::google::protobuf::Message& from) {
  GOOGLE_CHECK_NE(&from, this);
  const ServerPreparedStatementState* source =
    ::google::protobuf::internal::dynamic_cast_if_available<const ServerPreparedStatementState*>(
      &from);
  if (source == NULL) {
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
    MergeFrom(*source);
  }
}

void ServerPreparedStatementState::MergeFrom(const ServerPreparedStatementState& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_sql_query()) {
      set_sql_query(from.sql_query());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}

void ServerPreparedStatementState::CopyFrom(const ::google::protobuf::Message& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void ServerPreparedStatementState::CopyFrom(const ServerPreparedStatementState& from) {
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ServerPreparedStatementState::IsInitialized() const {

  return true;
}

void ServerPreparedStatementState::Swap(ServerPreparedStatementState* other) {
  if (other != this) {
    std::swap(sql_query_, other->sql_query_);
    std::swap(_has_bits_[0], other->_has_bits_[0]);
    _unknown_fields_.Swap(&other->_unknown_fields_);
    std::swap(_cached_size_, other->_cached_size_);
  }
}

::google::protobuf::Metadata ServerPreparedStatementState::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = ServerPreparedStatementState_descriptor_;
  metadata.reflection = ServerPreparedStatementState_reflection_;
  return metadata;
}

// @@protoc_insertion_point(namespace_scope)

}  // namespace bit
}  // namespace exec

// @@protoc_insertion_point(global_scope)


text:
namespace n0
{
	n0MaterialManager* s_instance = NULL;
	n0MaterialManager::n0MaterialManager()
	{

	}

	n0MaterialManager::~n0MaterialManager()
	{
		std::vector<n0Material *>::iterator it;

		for(it = m_MaterialArray.begin(); it != m_MaterialArray.end() ; it++)
		{
			(*it)->Drop();
		}
		m_MaterialArray.clear();
	}
	n0MaterialManager * n0MaterialManager::GetInstance()
	{
		if(!s_instance)
		{
			s_instance = new n0MaterialManager();
		}

		n0_ASSERT(s_instance, "material manager instance is NULL!");
		return s_instance;
	}
	void n0MaterialManager::DestroyInstance()
	{
		n0_ASSERT(s_instance, "material manager instance is NULL!");
		SAFE_DELETE(s_instance);
	}

	n0Material * n0MaterialManager::GetMaterial(u32 matID)
	{
		std::vector<n0Material *>::iterator it;

		for(it = m_MaterialArray.begin(); it != m_MaterialArray.end() ; it++)
		{
			if((*it)->materialName == matID)
			{
				return *it;
			}
		}

		return NULL;
	}
	void n0MaterialManager::AddMaterial(n0Material* _mat)
	{
		if(!GetMaterial(_mat->materialName))
		{
			m_MaterialArray.push_back(_mat);
			_mat->Retain();
		}
	}

}


text:
using System;

namespace MineLib.Core.Data.Anvil
{
    // -- Full  - 12304 bytes.
    // -- Empty - 20    bytes.
    public class Section : IEquatable<Section>
    {
        public static Section Empty => new Section(Position.Zero);

        public const int Width = 16;
        public const int Height = 16;
        public const int Depth = 16;

        public Position ChunkPosition { get; }

        public BlockList Blocks { get; private set; } = new BlockList(0);

        public bool IsFilled => Blocks.XSize * Blocks.YSize * Blocks.ZSize > 0;

        public Section(Position position) { ChunkPosition = position; }

        public override string ToString() => IsFilled ? "Filled" : "Empty";

        private void BuildEmpty()
        {
            if(IsFilled)
                return;

            Blocks = new BlockList(Width, Height, Depth);
        }
        // REWRITE: Big indivilual work
        public void BuildFromNibbleData(byte[] blocks, byte[] blockLights, byte[] blockSkyLights)
        {
            if (IsFilled)
                return;

            Blocks = new BlockList(Width, Height, Depth);

            var blockLight = ToBytePerBlock(blockLights);
            var skyLight = ToBytePerBlock(blockSkyLights);

            for (int i = 0, j = 0; i < Width * Height * Depth; i++)
            {
                //var idMetadata = BitConverter.ToUInt16(new[] { blocks[j], blocks[j + 1] }, 0);
                var idMetadata = ((blocks[j + 1] << 8) | blocks[j]);

                var id = (ushort)(idMetadata >> 4);
                var meta = (byte)(idMetadata & 0x000F); // & 15

                Blocks[i] = new Block(id, meta, blockLight[i], skyLight[i]);

                j = j + 2;
            }
        }
        public void BuildFromBlocks(BlockList list)
        {
            if (IsFilled)
                return;

            Blocks = list;
        }

        public Block GetBlock(Position sectionPos)
        {
            if (!IsFilled)
                throw new IndexOutOfRangeException("Section is empty");

            return Blocks[sectionPos.X, sectionPos.Y, sectionPos.Z];
        }
        public void SetBlock(Position sectionPos, Block block)
        {
            if (!IsFilled)
                BuildEmpty();

            var oldBlock = Blocks[sectionPos.X, sectionPos.Y, sectionPos.Z];

            // REWRITE: Light recalculating or what? Remove it cause of deferred lightning
            block.Light = oldBlock.Light;
            block.SkyLight = oldBlock.SkyLight;

            Blocks[sectionPos.X, sectionPos.Y, sectionPos.Z] = block;
        }

        public byte GetBlockLighting(Position sectionPos)
        {
            if (!IsFilled)
                throw new IndexOutOfRangeException("Section is empty");

            return Blocks[sectionPos.X, sectionPos.Y, sectionPos.Z].Light;
        }
        public void SetBlockLighting(Position sectionPos, byte data)
        {
            if (!IsFilled)
                BuildEmpty();

            var block = Blocks[sectionPos.X, sectionPos.Y, sectionPos.Z];
            block.Light = data;
            Blocks[sectionPos.X, sectionPos.Y, sectionPos.Z] = block;
        }

        public byte GetBlockSkylight(Position sectionPos)
        {
            if (!IsFilled)
                throw new IndexOutOfRangeException("Section is empty");

            return Blocks[sectionPos.X, sectionPos.Y, sectionPos.Z].SkyLight;
        }
        public void SetBlockSkylight(Position sectionPos, byte data)
        {
            if (!IsFilled)
                BuildEmpty();

            var block = Blocks[sectionPos.X, sectionPos.Y, sectionPos.Z];
            block.SkyLight = data;
            Blocks[sectionPos.X, sectionPos.Y, sectionPos.Z] = block;
        }

        #region Helping Methods

        public static Position GetSectionPositionByIndex(int index) => new Position(
            index % 16,
            index / (16 * 16),
            (index / 16) % 16);

        public int GetIndexByPosition(Position pos) => pos.X + ((pos.Y * 16) + pos.Z) * 16;

        public Position GetGlobalPositionByIndex(int index)
        {
            var sectionPos = GetSectionPositionByIndex(index);
            return new Position(
                Width * ChunkPosition.X + sectionPos.X,
                Height * ChunkPosition.Y + sectionPos.Y,
                Depth * ChunkPosition.Z + sectionPos.Z);
        }

        public Position GetGlobalPositionByArrayIndex(int x, int y, int z) => GetGlobalPositionByPosition(new Position(x, y, z));

        public Position GetGlobalPositionByPosition(Position pos) => new Position(
		    Width * ChunkPosition.X + pos.X,
		    Height * ChunkPosition.Y + pos.Y,
		    Depth * ChunkPosition.Z + pos.Z);

        public static byte[] ToBytePerBlock(byte[] halfByteData)
        {
            if (halfByteData.Length != Chunk.HalfByteData)
                throw new ArgumentOutOfRangeException(nameof(halfByteData), "Length != Half Byte Metadata length");

			var newMeta = new byte[Chunk.OneByteData];

			for (var i = 0; i < halfByteData.Length; i++)
            {
                var data = halfByteData[i];
                var block1 = (byte) (data & 0x0F);
				var block2 = (byte) (data >> 4);

				newMeta[(i * 2)] = block1;
                newMeta[(i * 2) + 1] = block2;
            }

            return newMeta;
        }
        public static byte[] ToHalfBytePerBlock(byte[] byteData)
        {
            var newMeta = new byte[Chunk.HalfByteData];

            if (byteData.Length != Chunk.OneByteData)
                throw new ArgumentOutOfRangeException(nameof(byteData), "Length != Full Byte Metadata length");

            for (var i = 0; i < byteData.Length; i++)
            {
                var block1 = newMeta[i];
                var block2 = newMeta[i + 1];

                var halfByteData = (byte) ((block1 & 0x0F) | (block2 >> 4));
                newMeta[i] = halfByteData;
            }

            return newMeta;
        }

        #endregion

        public static bool operator ==(Section a, Section b)
        {
            if (ReferenceEquals(a, b))
                return true;

            if (ReferenceEquals(a, null) || ReferenceEquals(b, null))
                return false;

            return a.IsFilled == b.IsFilled && a.ChunkPosition == b.ChunkPosition && a.Blocks == b.Blocks;
        }
        public static bool operator !=(Section a, Section b) => !(a == b);

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;

            if (obj.GetType() != GetType())
                return false;

            return Equals((Section) obj);
        }
        public bool Equals(Section section) => Blocks.Equals(section.Blocks) && ChunkPosition.Equals(section.ChunkPosition);

        public override int GetHashCode() => Blocks.GetHashCode() ^ ChunkPosition.GetHashCode();
    }
}


text:
#pragma once

#include <functional>
#include <algorithm>
#include <random>
#include <chrono>

#include "PositionComponent.h"
#include "NullComponent.h"
#include "Entity.h"
#include "Console.h"
#include "Map.h"

namespace Game {

  struct WanderComponent : Component {
    PositionComponent* _position;
    Map& _map;

    WanderComponent(Map& map) : _map(map) {}

    void init() override {
      _position = &_entity->getComponent<PositionComponent>();
    }

    void update(float mFT) override {

      // TODO: Make more fancy :-)
      unsigned seed1 = std::chrono::system_clock::now().time_since_epoch().count();
      std::default_random_engine generator(seed1);
      std::uniform_int_distribution<int> distribution(0, 5000);

      auto r = distribution(generator);

      if (r % 500 != 0) { return ; } // Do nothing

      int x = _position->x;
      int y = _position->y;

      switch (r % 4) {
        case 0: x++; break;
        case 1: x--; break;
        case 2: y++; break;
        case 3: y--; break;
      }

      // Check if destination tile is solid
      if (_map.isOccupied({ x, y })) {
        return;
      }

      // Check if destination tile is occupied
      if (_map.isOccupiedByNPC({ x, y })) {
        return;
      }

      _position->x = x;
      _position->y = y;
    }

  };

}


text:
package icurves.algorithm.voronoi;

public class Point
{
    public double x, y;

    public Point()
    {
    }
    public Point(double xValue, double yValue)
    {
    	setPoint(xValue, yValue);
    }

    public void setPoint(double x, double y)
    {
        this.x = x;
        this.y = y;
    }
}


text:
package exceptions;

public class GameSaveReadException extends Exception{

	private static final long serialVersionUID = 1L;

	/**
	 * GameSaveReadException when an exception occurs in the read process
	 * @param message
	 */
	public GameSaveReadException(String message) {
        super(message);
    }

}


text: A very basic app that allows us to verify if the MongoDB Node driver works fine with Node 4.1.0.


text:
package cucumber.java.connectors.wire;

public interface WireResponse {
}


text:
module AWS

end