text:
package com.consol.citrus.admin.configuration;

import com.consol.citrus.admin.exception.ApplicationRuntimeException;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.Optional;
import java.util.function.Supplier;

/**
 * @author Christoph Deppisch
 */
public class ConfigurationProvider {

    /**
     * Applies configuration to system properties setting {@link SystemProperty} annotated fields as system properties.
     * @param configurationHolder
     */
    public static void apply(Object configurationHolder) {
        SystemConfigurable systemConfigurable = AnnotationUtils.findAnnotation(configurationHolder.getClass(), SystemConfigurable.class);

        ReflectionUtils.doWithFields(configurationHolder.getClass(), field -> {
            if (field.getAnnotation(SystemProperty.class) != null) {
                SystemProperty configProperty = field.getAnnotation(SystemProperty.class);
                if (StringUtils.hasText(configProperty.name())) {
                    Method getter = ReflectionUtils.findMethod(configurationHolder.getClass(), "get" + StringUtils.capitalize(field.getName()));
                    if (getter != null) {
                        System.setProperty((systemConfigurable != null ? systemConfigurable.prefix() : "") + configProperty.name(), String.valueOf(ReflectionUtils.invokeMethod(getter, configurationHolder)));
                    }
                }
            }
        });
    }

    /**
     * Instantiates given configuration target and loads system properties and/or environment variables as field value when applicable.
     *
     * @param configurationTarget
     * @param <T>
     * @return
     */
    public static <T> T load(final Class<T> configurationTarget) {
        try {
            return load(configurationTarget.newInstance());
        } catch (InstantiationException | IllegalAccessException e) {
            throw new ApplicationRuntimeException("Failed to instantiate configurable", e);
        }
    }

    /**
     * Enriches configuration instance with system properties and/or environment variables as field value when applicable.
     *
     * @param configuration
     * @param <T>
     * @return
     */
    public static <T> T load(final T configuration) {
        SystemConfigurable systemConfigurable = AnnotationUtils.findAnnotation(configuration.getClass(), SystemConfigurable.class);

        ReflectionUtils.doWithFields(configuration.getClass(), field -> {
            if (field.getAnnotation(SystemProperty.class) != null) {
                SystemProperty systemProperty = field.getAnnotation(SystemProperty.class);
                Method setter = ReflectionUtils.findMethod(configuration.getClass(), "set" + StringUtils.capitalize(field.getName()), field.getType());

                if (setter != null) {
                    if (StringUtils.hasText(systemProperty.name())) {
                        ReflectionUtils.invokeMethod(setter, configuration, System.getProperty((systemConfigurable != null ? systemConfigurable.prefix() : "") + systemProperty.name(), Optional.ofNullable(System.getenv((systemConfigurable != null ? systemConfigurable.environmentPrefix() : "") + systemProperty.environment()))
                                .orElse(getDefaultValue(configuration.getClass(), field, systemProperty, configuration))));
                    } else if (StringUtils.hasText(systemProperty.environment())) {
                        ReflectionUtils.invokeMethod(setter, configuration, Optional.ofNullable(System.getenv((systemConfigurable != null ? systemConfigurable.environmentPrefix() : "") + systemProperty.environment()))
                                .orElse(getDefaultValue(configuration.getClass(), field, systemProperty, configuration)));
                    } else {
                        ReflectionUtils.invokeMethod(setter, configuration, getDefaultValue(configuration.getClass(), field, systemProperty, configuration));
                    }
                }
            }
        });

        return configuration;
    }

    /**
     * Gets default property value. Either uses default value setting or invokes default value supplier. If non of these is set to return a value other than null the
     * default property member initial value is used.
     *
     * @param configurationTarget
     * @param field
     * @param configProperty
     * @param configuration
     * @return
     */
    private static String getDefaultValue(Class<?> configurationTarget, Field field, SystemProperty configProperty, Object configuration) {
        if (StringUtils.hasText(configProperty.defaultValue())) {
            return configProperty.defaultValue();
        } else {
            try {
                Supplier<String> supplier = configProperty.defaultValueSupplier().newInstance();
                String supplied = supplier.get();

                Method getter = ReflectionUtils.findMethod(configurationTarget, "get" + StringUtils.capitalize(field.getName()));
                if (getter != null && supplied == null) {
                    Object defaultValue = ReflectionUtils.invokeMethod(getter, configuration);
                    if (defaultValue != null) {
                        return String.valueOf(defaultValue);
                    }
                }

                return supplied;
            } catch (InstantiationException |IllegalAccessException e) {
                throw new ApplicationRuntimeException("Failed to instantiate default value supplier", e);
            }
        }
    }
}


text:
package com.codecomb;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.preference.PreferenceManager;

public class SettingsManager implements OnSharedPreferenceChangeListener {

	private static Context context;

	private static final String KEY_USERNMAE = "username";
	private static final String KEY_PASSWORD = "password";
	private static final String KEY_IS_STORE_USER = "storeuser";
	private static final String KEY_ACCESS_TOKEN = "accesstoken";

	public static SettingsManager getInstance(){
		return SingletonCreator.instance;
	}

	private static  class SingletonCreator{
		private static final SettingsManager instance = new SettingsManager();
	}

	private SettingsManager(){
		context = MyApplication.getInstance().getApplicationContext();
	}

	public void setAccessToken(String accessToken){
		setString(KEY_ACCESS_TOKEN, accessToken);
	}

	public String getAccessToken(){
		return getString(KEY_ACCESS_TOKEN, "");

	}

	public void setUsername(String name){
		setString(KEY_USERNMAE, name);
	}

	public void setPassword(String password){
		setString(KEY_PASSWORD, password);
	}

	public void storeUser(String name,String password,String accessToken ){
		setUsername(name);
		setPassword(password);
		setAccessToken(accessToken);
	}

	public boolean isStoreUser(){
		return getBoolean(KEY_IS_STORE_USER);
	}

	public void isStoreUser(boolean value){
		setBoolean(KEY_IS_STORE_USER, value);
	}

	public String getUsername(){
		return getString(KEY_USERNMAE, "");
	}

	public String getPassword(){
		return getString(KEY_PASSWORD, "");
	}

	private static SharedPreferences getSharedPreferences(Context context) {
		return PreferenceManager.getDefaultSharedPreferences(context);
	}

	private static String getString(String key, String def) {
		return getSharedPreferences(context).getString(key, def);
	}

	private static void setString( String key, String value) {
		Editor editor = getSharedPreferences(context).edit();
		editor.putString(key, value);
		editor.commit();
	}

	private static boolean getBoolean(String key) {
		return getSharedPreferences(context).getBoolean(key, false);
	}

	private static void setBoolean( String key, boolean value) {
		Editor editor = getSharedPreferences(context).edit();
		editor.putBoolean(key, value);
		editor.commit();
	}

	private SharedPreferences getSharedPreferences() {
		return PreferenceManager.getDefaultSharedPreferences(MyApplication
				.getInstance());
	}

	private static void setInt(String key, int value) {
		Editor editor = getSharedPreferences(context).edit();
		editor.putInt(key, value);
		editor.commit();
	}

	private String getString(int key, String def) {
		return getSharedPreferences().getString(
				MyApplication.getInstance().getString(key), def);
	}

	private String getString(int key, int def) {
		return getString(key, MyApplication.getInstance().getString(def));
	}

	private void setString(int key, String value) {
		Editor editor = getSharedPreferences().edit();
		editor.putString(MyApplication.getInstance().getString(key), value);
		editor.commit();
	}

	@Override
	public void onSharedPreferenceChanged(SharedPreferences arg0, String arg1) {
		// TODO Auto-generated method stub

	}

}

redpajama_set_name: RedPajamaGithub


text:
namespace gpu {

namespace {

struct GpuDriverBugWorkaroundInfo {
  GpuDriverBugWorkaroundType type;
  const char* name;
};

const GpuDriverBugWorkaroundInfo kFeatureList[] = {
#define GPU_OP(type, name) { type, #name },
  GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
#undef GPU_OP
};

}  // namespace anonymous

GpuDriverBugList::GpuDriverBugList()
    : GpuControlList() {
}

GpuDriverBugList::~GpuDriverBugList() {
}

// static
GpuDriverBugList* GpuDriverBugList::Create() {
  GpuDriverBugList* list = new GpuDriverBugList();

  DCHECK_EQ(static_cast<int>(arraysize(kFeatureList)),
            NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES);
  for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; ++i) {
    list->AddSupportedFeature(kFeatureList[i].name,
                              kFeatureList[i].type);
  }
  return list;
}

std::string GpuDriverBugWorkaroundTypeToString(
    GpuDriverBugWorkaroundType type) {
  if (type < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES)
    return kFeatureList[type].name;
  else
    return "unknown";
}

// static
void GpuDriverBugList::AppendWorkaroundsFromCommandLine(
    std::set<int>* workarounds,
    const base::CommandLine& command_line) {
  DCHECK(workarounds);

  if (command_line.HasSwitch(switches::kGpuDriverBugWorkarounds)) {
    std::string cmd_workarounds_str =
        command_line.GetSwitchValueASCII(switches::kGpuDriverBugWorkarounds);
    std::set<int> cmd_workarounds;
    gpu::StringToFeatureSet(cmd_workarounds_str, &cmd_workarounds);
    workarounds->insert(cmd_workarounds.begin(), cmd_workarounds.end());
  }

  for (int i = 0; i < NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES; i++) {
    if (command_line.HasSwitch(kFeatureList[i].name)) {
      // Check for disabling workaround flag.
      if (command_line.GetSwitchValueASCII(kFeatureList[i].name) == "0") {
        workarounds->erase(kFeatureList[i].type);
        continue;
      }

      // Removing conflicting workarounds.
      switch (kFeatureList[i].type) {
        case FORCE_DISCRETE_GPU:
          workarounds->erase(FORCE_INTEGRATED_GPU);
          workarounds->insert(FORCE_DISCRETE_GPU);
          break;
        case FORCE_INTEGRATED_GPU:
          workarounds->erase(FORCE_DISCRETE_GPU);
          workarounds->insert(FORCE_INTEGRATED_GPU);
          break;
        case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512:
        case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024:
        case MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096:
          workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_512);
          workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024);
          workarounds->erase(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096);
          workarounds->insert(kFeatureList[i].type);
          break;
        default:
          workarounds->insert(kFeatureList[i].type);
          break;
      }
    }
  }
}

}  // namespace gpu


text:
<?php
/** @noinspection ReturnTypeCanBeDeclaredInspection */
/** @noinspection AccessModifierPresentedInspection */

namespace Czim\DataObject\Test;

use Czim\DataObject\Test\Helpers\TestDataObject;

class CastableDataObjectTest extends TestCase
{
    /**
     * @test
     */
    function it_casts_an_attribute_as_a_boolean()
    {
        $data = new Helpers\TestCastDataObject();

        static::assertFalse($data->bool);

        $data->bool = 'boolean value';
        static::assertTrue($data->bool);
    }

    /**
     * @test
     */
    function it_casts_an_attribute_as_an_integer()
    {
        $data = new Helpers\TestCastDataObject();

        static::assertSame(0, $data->int);

        $data->int = 'integer value';
        static::assertSame(0, $data->int);

        $data->int = 40.0;
        static::assertSame(40, $data->int);
    }

    /**
     * @test
     */
    function it_casts_an_attribute_as_a_float()
    {
        $data = new Helpers\TestCastDataObject();

        static::assertSame(0.0, $data->float);

        $data->float = 'float value';
        static::assertSame(0.0, $data->float);

        $data->float = 40;
        static::assertSame(40.0, $data->float);
    }

    /**
     * @test
     */
    function it_casts_an_attribute_as_a_string()
    {
        $data = new Helpers\TestCastDataObject();

        static::assertSame('', $data->string);

        $data->string = 'string value';
        static::assertSame('string value', $data->string);

        $data->string = 40;
        static::assertSame('40', $data->string);
    }

    /**
     * @test
     */
    function it_casts_an_attribute_as_an_array()
    {
        $data = new Helpers\TestCastDataObject();

        static::assertSame([], $data->array);

        $data->array = ['array'];
        static::assertSame(['array'], $data->array);

        $data->array = 'string value';
        static::assertSame(['string value'], $data->array);

        $data->array = new TestDataObject(['test' => 'type']);
        static::assertSame(['test' => 'type'], $data->array);
    }

    /**
     * @test
     */
    function it_casts_an_attribute_as_a_data_object()
    {
        $data = new Helpers\TestCastDataObject();

        $data->object = [
            'test' => 'testing',
        ];

        $object = $data->object;

        static::assertInstanceOf(TestDataObject::class, $object);
        static::assertEquals('testing', $object->test);
    }

    /**
     * @test
     */
    function it_casts_an_attribute_as_a_list_of_data_objects()
    {
        $data = new Helpers\TestCastDataObject();

        static::assertEquals([], $data->objects);

        $data->objects = [
            ['test' => 'testing a'],
            ['test' => 'testing b'],
        ];

        $objects = $data->objects;

        static::assertIsArray($objects);
        static::assertCount(2, $objects);
        static::assertInstanceOf(TestDataObject::class, $objects[0]);
        static::assertInstanceOf(TestDataObject::class, $objects[1]);
        static::assertEquals('testing a', $objects[0]->test);
        static::assertEquals('testing b', $objects[1]->test);
    }

    /**
     * @test
     */
    function it_throws_an_exception_if_it_cannot_cast_to_an_object()
    {
        $this->expectException(\UnexpectedValueException::class);

        $data = new Helpers\TestCastDataObject();

        $data->object = 'not an array';

        $data->object;
    }

    /**
     * @test
     */
    function it_throws_an_exception_if_it_cannot_cast_to_an_object_in_a_list()
    {
        $this->expectException(\UnexpectedValueException::class);

        $data = new Helpers\TestCastDataObject();

        $data->objects = [ ['type' => 'an array'], 444];

        $data->objects;
    }

    /**
     * @test
     */
    function it_returns_null_for_an_unset_attribute_cast_as_an_object()
    {
        $data = new Helpers\TestCastDataObject();

        static::assertNull($data->object);
    }

    /**
     * @test
     */
    function it_returns_empty_objects_for_an_unset_attribute_cast_as_an_object_if_configured_to()
    {
        $data = new Helpers\TestCastDataObjectCastNull();

        static::assertInstanceOf(TestDataObject::class, $data->object);
    }

    /**
     * @test
     */
    function it_returns_null_for_an_unset_attribute_in_an_array_cast_as_a_list_of_objects()
    {
        $data = new Helpers\TestCastDataObject();

        $data->objects = [
            null,
            ['type' => 'test'],
            null,
        ];

        $objects = $data->objects;

        static::assertIsArray($objects);
        static::assertCount(3, $objects);
        static::assertNull($objects[0]);
        static::assertNull($objects[2]);

        static::assertInstanceOf(TestDataObject::class, $objects[1]);
        static::assertEquals('test', $objects[1]->type);
    }

    /**
     * @test
     */
    function it_returns_empty_object_for_an_unset_attribute_in_an_array_cast_as_a_list_of_objects_if_configured_to()
    {
        $data = new Helpers\TestCastDataObjectCastNull();

        $data->objects = [
            null,
            ['type' => 'test'],
        ];

        $objects = $data->objects;

        static::assertIsArray($objects);
        static::assertCount(2, $objects);

        static::assertInstanceOf(TestDataObject::class, $objects[0]);
        static::assertNull($objects[0]->type);
        static::assertInstanceOf(TestDataObject::class, $objects[1]);
        static::assertEquals('test', $objects[1]->type);
    }

    /**
     * @test
     */
    function it_casts_attributes_on_toArray()
    {
        $data = new Helpers\TestCastDataObject();

        $data->int     = '6';
        $data->object  = new TestDataObject(['type' => 'object']);
        $data->objects = [
            ['test' => 'testing a'],
            ['test' => 'testing b'],
        ];

        $array = $data->toArray();

        static::assertIsArray($array);
        static::assertCount(7, $array);
        static::assertArrayHasKey('int', $array);
        static::assertSame(6, $array['int']);
        static::assertArrayHasKey('object', $array);
        static::assertEquals(['type' => 'object'], $array['object']);
        static::assertArrayHasKey('objects', $array);
        static::assertEquals([['test' => 'testing a'], ['test' => 'testing b']], $array['objects']);
        static::assertArrayHasKey('bool', $array);
        static::assertFalse($array['bool']);
        static::assertArrayHasKey('float', $array);
        static::assertSame(0.0, $array['float']);
        static::assertArrayHasKey('string', $array);
        static::assertSame('', $array['string']);
        static::assertArrayHasKey('array', $array);
        static::assertSame([], $array['array']);
    }

    // ------------------------------------------------------------------------------
    //      Use without casts
    // ------------------------------------------------------------------------------

    /**
     * @test
     */
    function it_works_normally_without_casts_set()
    {
        $data = new Helpers\TestCastDataObjectWithoutCasts();

        $data->object = ['test' => 'testing'];
        $data->float = 'not a float';

        static::assertSame(['test' => 'testing'], $data->object);
        static::assertSame('not a float', $data['float']);

        $array = $data->toArray();
        static::assertCount(2, $array);
        static::assertSame(['test' => 'testing'], $array['object']);
        static::assertSame('not a float', $array['float']);
    }

}


text:
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;

namespace Io.Github.Kerwinxu.LibShapes.Core.Shape
{
    /// <summary>
    /// 椭圆弧
    /// </summary>
    public class ShapeArc : ShapeRectangle
    {
        public ShapeArc()
        {
            // 设置默认的角度
            StartAngle = 0;
            SweepAngle = 90;
        }

        [DescriptionAttribute("弧线的起始角度"), DisplayName("弧线的起始角度"), CategoryAttribute("外观")]
        public float StartAngle { get; set; }

        [DescriptionAttribute("startAngle 和弧线末尾之间的角度"), DisplayName("夹角"), CategoryAttribute("外观")]
        public float SweepAngle { get; set; }

        public override ShapeEle DeepClone()
        {
            // 这里用json的方式
            string json = JsonConvert.SerializeObject(this);
            return JsonConvert.DeserializeObject<ShapeArc>(json);
            //throw new NotImplementedException();
        }

        public override System.Drawing.RectangleF GetBounds(Matrix matrix)
        {
            // 这个实际上是矩形的
            GraphicsPath path = base.GetGraphicsPathWithAngle();
            // 这里加上旋转
            Matrix matrix1 = new Matrix();
            // 这里按照中心点旋转,
            var rect = path.GetBounds();
            var centerPoint = new PointF() { X = rect.X + rect.Width / 2, Y = rect.Y + rect.Height / 2 };
            matrix1.RotateAt(Angle, centerPoint);
            Matrix matrix2 = matrix.Clone();
            matrix2.Multiply(matrix1);
            // 应用这个转换
            path.Transform(matrix2);
            return path.GetBounds();
            //return base.GetBounds(matrix);
        }

        public override GraphicsPath GetGraphicsPathWithAngle()
        {
            GraphicsPath path = new GraphicsPath();
            var rect = new System.Drawing.RectangleF()
            {
                X = getX(),
                Y = getY(),
                Width = getWidth(),
                Height = getHeight(),
            };

            var rect2 = correctRectangle(rect);
            path.AddArc(
                   rect2,
                   StartAngle,
                   SweepAngle);

            return path;
            //return base.GetGraphicsPathWithAngle();
        }
    }
}


text:
using Microsoft.Office.Server.Search.Query;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Taxonomy;
using System;

namespace Codeless.SharePoint.ObjectModel {
  /// <summary>
  /// Encapsulates <see cref="SPModelManager{T}"/> when the model type is variable or unknown.
  /// </summary>
  public interface ISPModelManager {
    /// <summary>
    /// Gets the site collection associated with the site that initialized this instance of the <see cref="SPModelManagerBase{T}"/> class.
    /// </summary>
    SPSite Site { get; }

    /// <summary>
    /// Gets the term store connected with the site that initialized this instance of the <see cref="SPModelManagerBase{T}"/> class.
    /// </summary>
    TermStore TermStore { get; }

    /// <summary>
    /// Gets items of the associated content type(s).
    /// </summary>
    /// <returns>A collection containing the returned items.</returns>
    SPModelCollection GetItems();

    /// <summary>
    /// Gets items of the associated content type(s) that satisfy the condition.
    /// </summary>
    /// <param name="query">CAML query expression.</param>
    /// <returns>A collection containing the returned items.</returns>
    SPModelCollection GetItems(CamlExpression query);

    /// <summary>
    /// Gets items of the associated content type(s) that satisfy the condition.
    /// </summary>
    /// <param name="query">CAML query expression.</param>
    /// <param name="limit">Maximum number of items to be returned.</param>
    /// <returns>A collection containing the returned items.</returns>
    SPModelCollection GetItems(CamlExpression query, uint limit);

    /// <summary>
    /// Gets items of the associated content type(s) that satisfy the condition.
    /// </summary>
    /// <param name="query">CAML query expression.</param>
    /// <param name="limit">Maximum number of items to be returned.</param>
    /// <param name="startRow">Number of items to skip from start.</param>
    /// <returns>A collection containing the returned items.</returns>
    SPModelCollection GetItems(CamlExpression query, uint limit, uint startRow);

    /// <summary>
    /// Performs a keyword search against the items of the associated content type(s).
    /// </summary>
    /// <param name="query">CAML query expression.</param>
    /// <param name="limit">Maximum number of items to be returned.</param>
    /// <param name="keywords">A list of keywords to be searched against.</param>
    /// <param name="keywordInclusion">See <see cref="KeywordInclusion"/>.</param>
    /// <returns>A collection containing the returned items.</returns>
    SPModelCollection GetItems(CamlExpression query, uint limit, string[] keywords, KeywordInclusion keywordInclusion);

    /// <summary>
    /// Performs a keyword search against the items of the associated content type(s).
    /// </summary>
    /// <param name="query">CAML query expression.</param>
    /// <param name="limit">Maximum number of items to be returned.</param>
    /// <param name="startRow">Number of items to skip from start.</param>
    /// <param name="keywords">A list of keywords to be searched against.</param>
    /// <param name="refiners">A list of <see cref="SearchRefiner"/> instances. Refinement results are populated to the supplied instances.</param>
    /// <param name="keywordInclusion">See <see cref="KeywordInclusion"/>.</param>
    /// <param name="totalCount">Total number of items.</param>
    /// <returns>A collection containing the returned items.</returns>
    SPModelCollection GetItems(CamlExpression query, uint limit, uint startRow, string[] keywords, SearchRefiner[] refiners, KeywordInclusion keywordInclusion, out int totalCount);

    /// <summary>
    /// Gets the number of items of the associated content type(s).
    /// </summary>
    /// <returns>Number of items.</returns>
    int GetCount();

    /// <summary>
    /// Gets the number of items of the associated content type(s) that satisfy the condition.
    /// </summary>
    /// <param name="query">CAML query expression.</param>with the associated content type(s)
    /// <returns>Number of items.</returns>
    int GetCount(CamlExpression query);

    /// <summary>
    /// Performs a keyword search against the items of the associated content type(s) and returns the number of items.
    /// </summary>
    /// <param name="query">CAML query expression.</param>
    /// <param name="keywords">A list of keywords to be searched against.</param>
    /// <param name="keywordInclusion">See <see cref="KeywordInclusion"/>.</param>
    /// <returns>Number of items.</returns>
    int GetCount(CamlExpression query, string[] keywords, KeywordInclusion keywordInclusion);

    /// <summary>
    /// Creates an item of the associated content type. If the content type derives from File or Folder, a random name is used.
    /// See also <see cref="Create(Type,string)"/>
    /// </summary>
    /// <param name="modelType">Type of item to be created.</param>
    /// <returns>An item of the specified content type.</returns>
    object Create(Type modelType);

    /// <summary>
    /// Creates an item of the associated content type with the given file or folder name.
    /// See also <see cref="Create(Type,string)"/>
    /// </summary>
    /// <param name="modelType">Type of item to be created.</param>
    /// <param name="filename">File or folder name.</param>
    /// <returns>An item of the specified content type.</returns>
    object Create(Type modelType, string filename);

    /// <summary>
    /// Moves the specified item to recycle bin.
    /// </summary>
    /// <param name="model">An item to be recycled.</param>
    void Recycle(object model);

    /// <summary>
    /// Deletes the specified item from a list.
    /// </summary>
    /// <param name="model">An item to be deleted.</param>
    void Delete(object model);

    /// <summary>
    /// Commits changes made to model class instances fetched fromt this manager.
    /// </summary>
    void CommitChanges();

    /// <summary>
    /// Commits changes made to the specified model class instances.
    /// </summary>
    /// <param name="item">An item with changes to be persisted.</param>
    void CommitChanges(object item);

    /// <summary>
    /// Commits changes made to model class instances fetched from this manager with the specified commit option.
    /// </summary>
    /// <param name="mode">An value of <see cref="Codeless.SharePoint.ObjectModel.SPModelCommitMode" /> representing how a list item is updated.</param>
    void CommitChanges(SPModelCommitMode mode);

    /// <summary>
    /// Commits changes made to the specified model class instances with the specified commit option.
    /// </summary>
    /// <param name="item">An item with changes to be persisted.</param>
    /// <param name="mode">An value of <see cref="Codeless.SharePoint.ObjectModel.SPModelCommitMode" /> representing how a list item is updated.</param>
    void CommitChanges(object item, SPModelCommitMode mode);
  }
}


text:
const should = require('chai').should()

const CircularBuffer = require('./../circular-buffer')

describe('Circular Buffer', () => {
    context('#.constructor', () => {
        it('Should throw an Error if the `maxSize` isNaN.', () => {
            (function () {
                new CircularBuffer("isNaN")
            }).should.throw(Error, /isNaN is NaN/)
        })
    })

    context('#.push', () => {
        it('Should append an item to the Circular Buffer.', () => {
            const circularBuffer = new CircularBuffer(4)

            circularBuffer.push('A')
            circularBuffer.push('B')
            circularBuffer.push('C')
            circularBuffer.push('D')

            circularBuffer.size.should.equal(4)
        })

        it('Should append an item to the Circular Buffer and overwrite the oldest value if the `#.maxSize` is surpassed.', () => {
            const circularBuffer = new CircularBuffer(2)

            circularBuffer.push('A')
            circularBuffer.push('B')

            circularBuffer.size.should.equal(2)

            circularBuffer.push('C')
            circularBuffer.push('D')

            circularBuffer.size.should.equal(2)

            circularBuffer.pop().should.equal('D')
            circularBuffer.pop().should.equal('C')
        })
    })

    context('#.pop', () => {
        it('Should return an item from the back of the Circular Buffer.', () => {
            const circularBuffer = new CircularBuffer(4)

            circularBuffer.push('A')

            circularBuffer.push('B')
            circularBuffer.push('C')
            circularBuffer.push('D')

            circularBuffer.pop().should.equal('D')
            circularBuffer.pop().should.equal('C')

            circularBuffer.size.should.equal(2)
        })

        it('Should return "undefined" when the Circular Buffer is empty.', () => {
            const circularBuffer = new CircularBuffer(4)

            should.not.exist(circularBuffer.pop())
        })
    })

    context('#.shift', () => {
        it('Should be possible to retrieve an item from the front of the Circular Buffer.', () => {
            const circularBuffer = new CircularBuffer(4)

            circularBuffer.push('A')
            circularBuffer.push('B')
            circularBuffer.push('C')
            circularBuffer.push('D')

            circularBuffer.shift().should.equal('A')
            circularBuffer.shift().should.equal('B')

            circularBuffer.size.should.equal(2)

            circularBuffer.push('E')
            circularBuffer.push('F')

            circularBuffer.size.should.equal(4)

            circularBuffer.shift().should.equal('C')
            circularBuffer.shift().should.equal('D')
            circularBuffer.shift().should.equal('E')
            circularBuffer.shift().should.equal('F')

            circularBuffer.size.should.equal(0)
        })

        it('Should return "undefined" when the Circular Buffer is empty.', () => {
            const circularBuffer = new CircularBuffer(4)

            should.not.exist(circularBuffer.shift())
        })
    })

    it('Should be able to manage #.pop, #.shift and #.push when used mixed.', () => {
        const circularBuffer = new CircularBuffer(20)

        for (let idxNr = 1, maxNr = circularBuffer.maxSize + 1; idxNr < maxNr; idxNr++) circularBuffer.push(idxNr)

        circularBuffer.shift().should.equal(1)
        circularBuffer.shift().should.equal(2)

        circularBuffer.pop().should.equal(20)
        circularBuffer.pop().should.equal(19)

        circularBuffer.push(19)
        circularBuffer.push(20)
        circularBuffer.push(21)
        circularBuffer.push(22)

        circularBuffer.shift().should.equal(3)
        circularBuffer.shift().should.equal(4)

        circularBuffer.pop().should.equal(22)
        circularBuffer.pop().should.equal(21)

        for (let maxNr = 20, minNr = 4; maxNr > minNr; maxNr--) circularBuffer.pop().should.equal(maxNr)
    })

    context('#.peek', () => {
        it('Should return the item in front of the Circular Buffer.', () => {
            const circularBuffer = new CircularBuffer(4)

            circularBuffer.push('A')
            circularBuffer.push('B')
            circularBuffer.push('C')

            circularBuffer.shift()

            circularBuffer.peek().should.equal(circularBuffer.shift())
        })

        it('Should return "undefined" when using the #.peek method on an empty Circular Buffer.', () => {
            const circularBuffer = new CircularBuffer(4)

            should.not.exist(circularBuffer.peek())
        })
    })

    context('#.peekFront', () => {
        it('Should be an alias for #.peek.', () => {
            const circularBuffer = new CircularBuffer(4)

            circularBuffer.peekFront.should.equal(circularBuffer.peek)
        })
    })

    context('#.peekBack', () => {
        it('Should return the item at the back of the Circular Buffer.', () => {
            const circularBuffer = new CircularBuffer(4)

            circularBuffer.push('A')

            circularBuffer.peekBack().should.equal('A') // idxNr: 0

            circularBuffer.push('B')
            circularBuffer.push('C')
            circularBuffer.push('D')

            circularBuffer.peekBack().should.equal('D') // idxNr: 3

            circularBuffer.pop()
            circularBuffer.pop()

            circularBuffer.peekBack().should.equal('B') // idxNr: 1

            circularBuffer.push('C')
            circularBuffer.push('D')
            circularBuffer.push('E')
            circularBuffer.push('F')
            circularBuffer.push('G')

            circularBuffer.peekBack().should.equal('G') // idxNr: 2
        })

        it('Should become an alias for #.peek when only 1 item is present within the Circular Buffer.', () => {
            const circularBuffer = new CircularBuffer(4)

            circularBuffer.push('A')

            circularBuffer.peekBack().should.equal('A')
        })

        it('Should return "undefined" when the Circular Buffer is empty.', () => {
            const circularBuffer = new CircularBuffer(4)

            should.not.exist(circularBuffer.peekBack())
        })
    })

    context('#.toArray', () => {
        it('Should convert a Circular Buffer into an Array.', () => {
            const circularBuffer = new CircularBuffer(4)

            circularBuffer.push('A')
            circularBuffer.push('B')

            let toArray = circularBuffer.toArray()

            toArray[0].should.equal('A')
            toArray[1].should.equal('B')

            toArray.length.should.equal(2)

            /**
             * Ex. [ A, B, *, * ]
             *
             * --> [ E, B, C, D ] within the Circular Buffer is equal to [ B, C, D, E ]
             */
            circularBuffer.push('C')
            circularBuffer.push('D')
            circularBuffer.push('E')

            toArray = circularBuffer.toArray()

            toArray[0].should.equal('B')
            toArray[1].should.equal('C')
            toArray[2].should.equal('D')
            toArray[3].should.equal('E')

            toArray.length.should.equal(4)

            /**
             * Ex. [ E, B, C, D ] with B as `#._headOffset`
             *
             * --> [ E, *, *, D ] within the Circular Buffer is equal to [ D, E ]
             */
            circularBuffer.shift()
            circularBuffer.shift()

            toArray = circularBuffer.toArray()

            toArray[0].should.equal('D')
            toArray[1].should.equal('E')

            toArray.length.should.equal(2)
        })
    })

    context('#.from', () => {
        it('Should create a Circular Buffer from an Iterable.', () => {
            const circularBuffer = CircularBuffer.from(['A', 'B', 'C', 'D'])

            circularBuffer.size.should.equal(4)

            circularBuffer.shift().should.equal('A')
            circularBuffer.shift().should.equal('B')

            circularBuffer.pop().should.equal('D')
            circularBuffer.pop().should.equal('C')

            circularBuffer.size.should.equal(0)

            circularBuffer.maxSize.should.equal(4)
        })
    })
})


text:
RTTI_DEF1(ossimNitfSensraTag, "ossimNitfSensraTag", ossimNitfRegisteredTag);

ossimNitfSensraTag::ossimNitfSensraTag()
   : ossimNitfRegisteredTag(std::string("SENSRA"), 132)
{
   clearFields();
}

ossimNitfSensraTag::~ossimNitfSensraTag()
{
}

void ossimNitfSensraTag::parseStream(std::istream& in)
{
   clearFields();

   in.read(theRefRow, REF_ROW_SIZE);
   in.read(theRefCol, REF_COL_SIZE);
   in.read(theSensorModel, SENSOR_MODEL_SIZE);
   in.read(theSensorMount, SENSOR_MOUNT_SIZE);
   in.read(theSensorLoc, SENSOR_LOC_SIZE);
   in.read(theSensorAltSrc, SENSOR_ALT_SRC_SIZE);
   in.read(theSensorAlt, SENSOR_ALT_SIZE);
   in.read(theSensorAltUnit, SENSOR_ALT_UNIT_SIZE);
   in.read(theSensorAgl, SENSOR_AGL_SIZE);
   in.read(theSensorPitch, SENSOR_PITCH_SIZE);
   in.read(theSensorRoll, SENSOR_ROLL_SIZE);
   in.read(theSensorYaw, SENSOR_YAW_SIZE);
   in.read(thePlatformPitch, PLATFORM_PITCH_SIZE);
   in.read(thePlatformRoll, PLATFORM_ROLL_SIZE);
   in.read(thePlatformHdg, PLATFORM_HDG_SIZE);
   in.read(theGroundSpdSrc, GROUND_SPD_SRC_SIZE);
   in.read(theGroundSpeed, GROUND_SPEED_SIZE);
   in.read(theGroundSpdUnit, GROUND_SPD_UNIT_SIZE);
   in.read(theGroundTrack, GROUND_TRACK_SIZE);
   in.read(theVerticalVel, VERTICAL_VEL_SIZE);
   in.read(theVertVelUnit, VERT_VEL_UNIT_SIZE);
   in.read(theSwathFrames, SWATH_FRAMES_SIZE);
   in.read(theNSwaths, N_SWATHS_SIZE);
   in.read(theSpotNum, SPOT_NUM_SIZE);
}

void ossimNitfSensraTag::writeStream(std::ostream& out)
{
   out.write(theRefRow, REF_ROW_SIZE);
   out.write(theRefCol, REF_COL_SIZE);
   out.write(theSensorModel, SENSOR_MODEL_SIZE);
   out.write(theSensorMount, SENSOR_MOUNT_SIZE);
   out.write(theSensorLoc, SENSOR_LOC_SIZE);
   out.write(theSensorAltSrc, SENSOR_ALT_SRC_SIZE);
   out.write(theSensorAlt, SENSOR_ALT_SIZE);
   out.write(theSensorAltUnit, SENSOR_ALT_UNIT_SIZE);
   out.write(theSensorAgl, SENSOR_AGL_SIZE);
   out.write(theSensorPitch, SENSOR_PITCH_SIZE);
   out.write(theSensorRoll, SENSOR_ROLL_SIZE);
   out.write(theSensorYaw, SENSOR_YAW_SIZE);
   out.write(thePlatformPitch, PLATFORM_PITCH_SIZE);
   out.write(thePlatformRoll, PLATFORM_ROLL_SIZE);
   out.write(thePlatformHdg, PLATFORM_HDG_SIZE);
   out.write(theGroundSpdSrc, GROUND_SPD_SRC_SIZE);
   out.write(theGroundSpeed, GROUND_SPEED_SIZE);
   out.write(theGroundSpdUnit, GROUND_SPD_UNIT_SIZE);
   out.write(theGroundTrack, GROUND_TRACK_SIZE);
   out.write(theVerticalVel, VERTICAL_VEL_SIZE);
   out.write(theVertVelUnit, VERT_VEL_UNIT_SIZE);
   out.write(theSwathFrames, SWATH_FRAMES_SIZE);
   out.write(theNSwaths, N_SWATHS_SIZE);
   out.write(theSpotNum, SPOT_NUM_SIZE);
}

void ossimNitfSensraTag::clearFields()
{
   memset(theRefRow, ' ', REF_ROW_SIZE);
   memset(theRefCol, ' ', REF_COL_SIZE);
   memset(theSensorModel, ' ', SENSOR_MODEL_SIZE);
   memset(theSensorMount, ' ', SENSOR_MOUNT_SIZE);
   memset(theSensorLoc, ' ', SENSOR_LOC_SIZE);
   memset(theSensorAltSrc, ' ', SENSOR_ALT_SRC_SIZE);
   memset(theSensorAlt, ' ', SENSOR_ALT_SIZE);
   memset(theSensorAltUnit, ' ', SENSOR_ALT_UNIT_SIZE);
   memset(theSensorAgl, ' ', SENSOR_AGL_SIZE);
   memset(theSensorPitch, ' ', SENSOR_PITCH_SIZE);
   memset(theSensorRoll, ' ', SENSOR_ROLL_SIZE);
   memset(theSensorYaw, ' ', SENSOR_YAW_SIZE);
   memset(thePlatformPitch, ' ', PLATFORM_PITCH_SIZE);
   memset(thePlatformRoll, ' ', PLATFORM_ROLL_SIZE);
   memset(thePlatformHdg, ' ', PLATFORM_HDG_SIZE);
   memset(theGroundSpdSrc, ' ', GROUND_SPD_SRC_SIZE);
   memset(theGroundSpeed, ' ', GROUND_SPEED_SIZE);
   memset(theGroundSpdUnit, ' ', GROUND_SPD_UNIT_SIZE);
   memset(theGroundTrack, ' ', GROUND_TRACK_SIZE);
   memset(theVerticalVel, ' ', VERTICAL_VEL_SIZE);
   memset(theVertVelUnit, ' ', VERT_VEL_UNIT_SIZE);
   memset(theSwathFrames, ' ', SWATH_FRAMES_SIZE);
   memset(theNSwaths, ' ', N_SWATHS_SIZE);
   memset(theSpotNum, ' ', SPOT_NUM_SIZE);

   theRefRow[REF_ROW_SIZE] = '\0';
   theRefCol[REF_COL_SIZE] = '\0';
   theSensorModel[SENSOR_MODEL_SIZE] = '\0';
   theSensorMount[SENSOR_MOUNT_SIZE] = '\0';
   theSensorLoc[SENSOR_LOC_SIZE] = '\0';
   theSensorAltSrc[SENSOR_ALT_SRC_SIZE] = '\0';
   theSensorAlt[SENSOR_ALT_SIZE] = '\0';
   theSensorAltUnit[SENSOR_ALT_UNIT_SIZE] = '\0';
   theSensorAgl[SENSOR_AGL_SIZE] = '\0';
   theSensorPitch[SENSOR_PITCH_SIZE] = '\0';
   theSensorRoll[SENSOR_ROLL_SIZE] = '\0';
   theSensorYaw[SENSOR_YAW_SIZE] = '\0';
   thePlatformPitch[PLATFORM_PITCH_SIZE] = '\0';
   thePlatformRoll[PLATFORM_ROLL_SIZE] = '\0';
   thePlatformHdg[PLATFORM_HDG_SIZE] = '\0';
   theGroundSpdSrc[GROUND_SPD_SRC_SIZE] = '\0';
   theGroundSpeed[GROUND_SPEED_SIZE] = '\0';
   theGroundSpdUnit[GROUND_SPD_UNIT_SIZE] = '\0';
   theGroundTrack[GROUND_TRACK_SIZE] = '\0';
   theVerticalVel[VERTICAL_VEL_SIZE] = '\0';
   theVertVelUnit[VERT_VEL_UNIT_SIZE] = '\0';
   theSwathFrames[SWATH_FRAMES_SIZE] = '\0';
   theNSwaths[N_SWATHS_SIZE] = '\0';
   theSpotNum[SPOT_NUM_SIZE] = '\0';
}

std::ostream& ossimNitfSensraTag::print(
   std::ostream& out, const std::string& prefix) const
{
   std::string pfx = prefix;
   pfx += getTagName();
   pfx += ".";

   out << std::setiosflags(std::ios::left)
       << pfx << std::setw(24) << "CETAG:"
       << getTagName() << "\n"
       << pfx << std::setw(24) << "CEL:" << getTagLength() << "\n"
       << pfx << std::setw(24) << "REFROW:" << theRefRow << "\n"
       << pfx << std::setw(24) << "REFCOL:" << theRefCol << "\n"
       << pfx << std::setw(24) << "SENSORMODEL:" << theSensorModel<< "\n"
       << pfx << std::setw(24) << "SENSORMOUNT:" << theSensorMount << "\n"
       << pfx << std::setw(24) << "SENSORLOC:" << theSensorLoc << "\n"
       << pfx << std::setw(24) << "SENSORALTSRC:" << theSensorAltSrc<< "\n"
       << pfx << std::setw(24) << "SENSORALT:" << theSensorAlt << "\n"
       << pfx << std::setw(24) << "SENSORALTUNIT:" << theSensorAltUnit << "\n"
       << pfx << std::setw(24) << "SENSORAGL:" << theSensorAgl << "\n"
       << pfx << std::setw(24) << "SENSORPITCH:" << theSensorPitch << "\n"
       << pfx << std::setw(24) << "SENSORROLL:" << theSensorRoll<< "\n"
       << pfx << std::setw(24) << "SENSORYAW:" << theSensorYaw << "\n"
       << pfx << std::setw(24) << "PLATFORMPITCH:" << thePlatformPitch << "\n"
       << pfx << std::setw(24) << "PLATFORMROLL:" << thePlatformRoll << "\n"
       << pfx << std::setw(24) << "PLATFORMHDG:" << thePlatformHdg << "\n"
       << pfx << std::setw(24) << "GROUNDSPDSRC:" << theGroundSpdSrc << "\n"
       << pfx << std::setw(24) << "GROUNDSPEED:" << theGroundSpeed << "\n"
       << pfx << std::setw(24) << "GROUNDSPDUNIT:" << theGroundSpdUnit << "\n"
       << pfx << std::setw(24) << "GROUNDTRACK:" << theGroundTrack << "\n"
       << pfx << std::setw(24) << "VERTICALVEL:" << theVerticalVel<< "\n"
       << pfx << std::setw(24) << "VERTVELUNIT:" << theVertVelUnit << "\n"
       << pfx << std::setw(24) << "SWATHFRAMES:" << theSwathFrames<< "\n"
       << pfx << std::setw(24) << "NSWATHS:" << theNSwaths << "\n"
       << pfx << std::setw(24) << "SPOTNUM:" << theSpotNum << "\n";

   return out;
}

ossimString ossimNitfSensraTag::getRefRow()const
{
   return theRefRow;
}

void ossimNitfSensraTag::setRefRow(ossimString refRow)
{
   memset(theRefRow, ' ', REF_ROW_SIZE);
   memcpy(theRefRow, refRow.c_str(), std::min((size_t)REF_ROW_SIZE, refRow.length()));
}

ossimString ossimNitfSensraTag::getRefCol()const
{
   return theRefCol;
}

void ossimNitfSensraTag::setRefCol(ossimString refCol)
{
   memset(theRefCol, ' ', REF_COL_SIZE);
   memcpy(theRefCol, refCol.c_str(), std::min((size_t)REF_COL_SIZE, refCol.length()));
}

ossimString ossimNitfSensraTag::getSensorModel()const
{
   return theSensorModel;
}

void ossimNitfSensraTag::setSensorModel(ossimString sensorModel)
{
   memset(theSensorModel, ' ', SENSOR_MODEL_SIZE);
   memcpy(theSensorModel, sensorModel.c_str(), std::min((size_t)SENSOR_MODEL_SIZE, sensorModel.length()));
}

ossimString ossimNitfSensraTag::getSensorMount()const
{
   return theSensorMount;
}

void ossimNitfSensraTag::setSensorMount(ossimString sensorMount)
{
   memset(theSensorMount, ' ', SENSOR_MOUNT_SIZE);
   memcpy(theSensorMount, sensorMount.c_str(), std::min((size_t)SENSOR_MOUNT_SIZE, sensorMount.length()));
}

ossimString ossimNitfSensraTag::getSensorLoc()const
{
   return theSensorLoc;
}

void ossimNitfSensraTag::setSensorLoc(ossimString sensorLoc)
{
   memset(theSensorLoc, ' ', SENSOR_LOC_SIZE);
   memcpy(theSensorLoc, sensorLoc.c_str(), std::min((size_t)SENSOR_LOC_SIZE, sensorLoc.length()));
}

ossimString ossimNitfSensraTag::getSensorAltSrc()const
{
   return theSensorAltSrc;
}

void ossimNitfSensraTag::setSensorAltSrc(ossimString sensorAltSrc)
{
   memset(theSensorAltSrc, ' ', SENSOR_ALT_SRC_SIZE);
   memcpy(theSensorAltSrc, sensorAltSrc.c_str(), std::min((size_t)SENSOR_ALT_SRC_SIZE, sensorAltSrc.length()));
}

ossimString ossimNitfSensraTag::getSensorAlt()const
{
   return theSensorAlt;
}

void ossimNitfSensraTag::setSensorAlt(ossimString sensorAlt)
{
   memset(theSensorAlt, ' ', SENSOR_ALT_SIZE);
   memcpy(theSensorAlt, sensorAlt.c_str(), std::min((size_t)SENSOR_ALT_SIZE, sensorAlt.length()));
}

ossimString ossimNitfSensraTag::getSensorAltUnit()const
{
   return theSensorAltUnit;
}

void ossimNitfSensraTag::setSensorAltUnit(ossimString sensorAltUnit)
{
   memset(theSensorAltUnit, ' ', SENSOR_ALT_UNIT_SIZE);
   memcpy(theSensorAltUnit, sensorAltUnit.c_str(), std::min((size_t)SENSOR_ALT_UNIT_SIZE, sensorAltUnit.length()));
}

ossimString ossimNitfSensraTag::getSensorAgl()const
{
   return theSensorAgl;
}

void ossimNitfSensraTag::setSensorAgl(ossimString sensorAgl)
{
   memset(theSensorAgl, ' ', SENSOR_AGL_SIZE);
   memcpy(theSensorAgl, sensorAgl.c_str(), std::min((size_t)SENSOR_AGL_SIZE, sensorAgl.length()));
}

ossimString ossimNitfSensraTag::getSensorPitch()const
{
   return theSensorPitch;
}

void ossimNitfSensraTag::setSensorPitch(ossimString sensorPitch)
{
   memset(theSensorPitch, ' ', SENSOR_PITCH_SIZE);
   memcpy(theSensorPitch, sensorPitch.c_str(), std::min((size_t)SENSOR_PITCH_SIZE, sensorPitch.length()));
}

ossimString ossimNitfSensraTag::getSensorRoll()const
{
   return theSensorRoll;
}

void ossimNitfSensraTag::setSensorRoll(ossimString sensorRoll)
{
   memset(theSensorRoll, ' ', SENSOR_ROLL_SIZE);
   memcpy(theSensorRoll, sensorRoll.c_str(), std::min((size_t)SENSOR_ROLL_SIZE, sensorRoll.length()));
}

ossimString ossimNitfSensraTag::getSensorYaw()const
{
   return theSensorYaw;
}

void ossimNitfSensraTag::setSensorYaw(ossimString sensorYaw)
{
   memset(theSensorYaw, ' ', SENSOR_YAW_SIZE);
   memcpy(theSensorYaw, sensorYaw.c_str(), std::min((size_t)SENSOR_YAW_SIZE, sensorYaw.length()));
}

ossimString ossimNitfSensraTag::getPlatformPitch()const
{
   return thePlatformPitch;
}

void ossimNitfSensraTag::setPlatformPitch(ossimString platformPitch)
{
   memset(thePlatformPitch, ' ', PLATFORM_PITCH_SIZE);
   memcpy(thePlatformPitch, platformPitch.c_str(), std::min((size_t)PLATFORM_PITCH_SIZE, platformPitch.length()));
}

ossimString ossimNitfSensraTag::getPlatformRoll()const
{
   return thePlatformRoll;
}

void ossimNitfSensraTag::setPlatformRoll(ossimString platformRoll)
{
   memset(thePlatformRoll, ' ', PLATFORM_ROLL_SIZE);
   memcpy(thePlatformRoll, platformRoll.c_str(), std::min((size_t)PLATFORM_ROLL_SIZE, platformRoll.length()));
}

ossimString ossimNitfSensraTag::getPlatformHdg()const
{
   return thePlatformHdg;
}

void ossimNitfSensraTag::setPlatformHdg(ossimString platformHdg)
{
   memset(thePlatformHdg, ' ', PLATFORM_HDG_SIZE);
   memcpy(thePlatformHdg, platformHdg.c_str(), std::min((size_t)PLATFORM_HDG_SIZE, platformHdg.length()));
}

ossimString ossimNitfSensraTag::getGroundSpdSrc()const
{
   return theGroundSpdSrc;
}

void ossimNitfSensraTag::setGroundSpdSrc(ossimString groundSpdSrc)
{
   memset(theGroundSpdSrc, ' ', GROUND_SPD_SRC_SIZE);
   memcpy(theGroundSpdSrc, groundSpdSrc.c_str(), std::min((size_t)GROUND_SPD_SRC_SIZE, groundSpdSrc.length()));
}

ossimString ossimNitfSensraTag::getGroundSpeed()const
{
   return theGroundSpeed;
}

void ossimNitfSensraTag::setGroundSpeed(ossimString groundSpeed)
{
   memset(theGroundSpeed, ' ', GROUND_SPEED_SIZE);
   memcpy(theGroundSpeed, groundSpeed.c_str(), std::min((size_t)GROUND_SPEED_SIZE, groundSpeed.length()));
}

ossimString ossimNitfSensraTag::getGroundSpdUnit()const
{
   return theGroundSpdUnit;
}

void ossimNitfSensraTag::setGroundSpdUnit(ossimString groundSpdUnit)
{
   memset(theGroundSpdUnit, ' ', GROUND_SPD_UNIT_SIZE);
   memcpy(theGroundSpdUnit, groundSpdUnit.c_str(), std::min((size_t)GROUND_SPD_UNIT_SIZE, groundSpdUnit.length()));
}

ossimString ossimNitfSensraTag::getGroundTrack()const
{
   return theGroundTrack;
}

void ossimNitfSensraTag::setGroundTrack(ossimString groundTrack)
{
   memset(theGroundTrack, ' ', GROUND_TRACK_SIZE);
   memcpy(theGroundTrack, groundTrack.c_str(), std::min((size_t)GROUND_TRACK_SIZE, groundTrack.length()));
}

ossimString ossimNitfSensraTag::getVerticalVel()const
{
   return theVerticalVel;
}

void ossimNitfSensraTag::setVerticalVel(ossimString verticalVel)
{
   memset(theVerticalVel, ' ', VERTICAL_VEL_SIZE);
   memcpy(theVerticalVel, verticalVel.c_str(), std::min((size_t)VERTICAL_VEL_SIZE, verticalVel.length()));
}

ossimString ossimNitfSensraTag::getVertVelUnit()const
{
   return theVertVelUnit;
}

void ossimNitfSensraTag::setVertVelUnit(ossimString vertVelUnit)
{
   memset(theVertVelUnit, ' ', VERT_VEL_UNIT_SIZE);
   memcpy(theVertVelUnit, vertVelUnit.c_str(), std::min((size_t)VERT_VEL_UNIT_SIZE, vertVelUnit.length()));
}

ossimString ossimNitfSensraTag::getSwathFrames()const
{
   return theSwathFrames;
}

void ossimNitfSensraTag::setSwathFrames(ossimString swathFrames)
{
   memset(theSwathFrames, ' ', SWATH_FRAMES_SIZE);
   memcpy(theSwathFrames, swathFrames.c_str(), std::min((size_t)SWATH_FRAMES_SIZE, swathFrames.length()));
}

ossimString ossimNitfSensraTag::getNSwaths()const
{
   return theNSwaths;
}

void ossimNitfSensraTag::setNSwaths(ossimString nSwaths)
{
   memset(theNSwaths, ' ', N_SWATHS_SIZE);
   memcpy(theNSwaths, nSwaths.c_str(), std::min((size_t)N_SWATHS_SIZE, nSwaths.length()));
}

ossimString ossimNitfSensraTag::getSpotNum()const
{
   return theSpotNum;
}

void ossimNitfSensraTag::setSpotNum(ossimString spotNum)
{
   memset(theSpotNum, ' ', SPOT_NUM_SIZE);
   memcpy(theSpotNum, spotNum.c_str(), std::min((size_t)SPOT_NUM_SIZE, spotNum.length()));
}


text:
using System;
using Nelibur.ObjectMapper;
using Abp.Collections.Extensions;

namespace Abp.TinyMapper
{
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public class TinyMapFromAttribute : TinyMapAttributeBase
    {

        public TinyMapFromAttribute(params Type[] targetTypes): base(targetTypes)
        {

        }

        public override void CreateMap(Type type)
        {
            if (TargetTypes.IsNullOrEmpty())
            {
                return;
            }

            foreach (var targetType in TargetTypes)
            {
                Nelibur.ObjectMapper.TinyMapper.Bind(targetType, type);
            }
        }
    }
}


text:
"""Classes to generate plain text from a message object tree."""

__all__ = ['Generator', 'DecodedGenerator', 'BytesGenerator']

import re
import sys
import time
import random

from copy import deepcopy
from io import StringIO, BytesIO
from email.utils import _has_surrogates

UNDERSCORE = '_'
NL = '\n'  # XXX: no longer used by the code below.

fcre = re.compile(r'^From ', re.MULTILINE)

class Generator:
    """Generates output from a Message object tree.

    This basic generator writes the message to the given file object as plain
    text.
    """
    #
    # Public interface
    #

    def __init__(self, outfp, mangle_from_=True, maxheaderlen=None, *,
                 policy=None):
        """Create the generator for message flattening.

        outfp is the output file-like object for writing the message to.  It
        must have a write() method.

        Optional mangle_from_ is a flag that, when True (the default), escapes
        From_ lines in the body of the message by putting a `>' in front of
        them.

        Optional maxheaderlen specifies the longest length for a non-continued
        header.  When a header line is longer (in characters, with tabs
        expanded to 8 spaces) than maxheaderlen, the header will split as
        defined in the Header class.  Set maxheaderlen to zero to disable
        header wrapping.  The default is 78, as recommended (but not required)
        by RFC 2822.

        The policy keyword specifies a policy object that controls a number of
        aspects of the generator's operation.  If no policy is specified,
        the policy associated with the Message object passed to the
        flatten method is used.

        """
        self._fp = outfp
        self._mangle_from_ = mangle_from_
        self.maxheaderlen = maxheaderlen
        self.policy = policy

    def write(self, s):
        # Just delegate to the file object
        self._fp.write(s)

    def flatten(self, msg, unixfrom=False, linesep=None):
        r"""Print the message object tree rooted at msg to the output file
        specified when the Generator instance was created.

        unixfrom is a flag that forces the printing of a Unix From_ delimiter
        before the first object in the message tree.  If the original message
        has no From_ delimiter, a `standard' one is crafted.  By default, this
        is False to inhibit the printing of any From_ delimiter.

        Note that for subobjects, no From_ line is printed.

        linesep specifies the characters used to indicate a new line in
        the output.  The default value is determined by the policy specified
        when the Generator instance was created or, if none was specified,
        from the policy associated with the msg.

        """
        # We use the _XXX constants for operating on data that comes directly
        # from the msg, and _encoded_XXX constants for operating on data that
        # has already been converted (to bytes in the BytesGenerator) and
        # inserted into a temporary buffer.
        policy = msg.policy if self.policy is None else self.policy
        if linesep is not None:
            policy = policy.clone(linesep=linesep)
        if self.maxheaderlen is not None:
            policy = policy.clone(max_line_length=self.maxheaderlen)
        self._NL = policy.linesep
        self._encoded_NL = self._encode(self._NL)
        self._EMPTY = ''
        self._encoded_EMTPY = self._encode('')
        # Because we use clone (below) when we recursively process message
        # subparts, and because clone uses the computed policy (not None),
        # submessages will automatically get set to the computed policy when
        # they are processed by this code.
        old_gen_policy = self.policy
        old_msg_policy = msg.policy
        try:
            self.policy = policy
            msg.policy = policy
            if unixfrom:
                ufrom = msg.get_unixfrom()
                if not ufrom:
                    ufrom = 'From nobody ' + time.ctime(time.time())
                self.write(ufrom + self._NL)
            self._write(msg)
        finally:
            self.policy = old_gen_policy
            msg.policy = old_msg_policy

    def clone(self, fp):
        """Clone this generator with the exact same options."""
        return self.__class__(fp,
                              self._mangle_from_,
                              None, # Use policy setting, which we've adjusted
                              policy=self.policy)

    #
    # Protected interface - undocumented ;/
    #

    # Note that we use 'self.write' when what we are writing is coming from
    # the source, and self._fp.write when what we are writing is coming from a
    # buffer (because the Bytes subclass has already had a chance to transform
    # the data in its write method in that case).  This is an entirely
    # pragmatic split determined by experiment; we could be more general by
    # always using write and having the Bytes subclass write method detect when
    # it has already transformed the input; but, since this whole thing is a
    # hack anyway this seems good enough.

    # Similarly, we have _XXX and _encoded_XXX attributes that are used on
    # source and buffer data, respectively.
    _encoded_EMPTY = ''

    def _new_buffer(self):
        # BytesGenerator overrides this to return BytesIO.
        return StringIO()

    def _encode(self, s):
        # BytesGenerator overrides this to encode strings to bytes.
        return s

    def _write_lines(self, lines):
        # We have to transform the line endings.
        if not lines:
            return
        lines = lines.splitlines(True)
        for line in lines[:-1]:
            self.write(line.rstrip('\r\n'))
            self.write(self._NL)
        laststripped = lines[-1].rstrip('\r\n')
        self.write(laststripped)
        if len(lines[-1]) != len(laststripped):
            self.write(self._NL)

    def _write(self, msg):
        # We can't write the headers yet because of the following scenario:
        # say a multipart message includes the boundary string somewhere in
        # its body.  We'd have to calculate the new boundary /before/ we write
        # the headers so that we can write the correct Content-Type:
        # parameter.
        #
        # The way we do this, so as to make the _handle_*() methods simpler,
        # is to cache any subpart writes into a buffer.  The we write the
        # headers and the buffer contents.  That way, subpart handlers can
        # Do The Right Thing, and can still modify the Content-Type: header if
        # necessary.
        oldfp = self._fp
        try:
            self._munge_cte = None
            self._fp = sfp = self._new_buffer()
            self._dispatch(msg)
        finally:
            self._fp = oldfp
            munge_cte = self._munge_cte
            del self._munge_cte
        # If we munged the cte, copy the message again and re-fix the CTE.
        if munge_cte:
            msg = deepcopy(msg)
            msg.replace_header('content-transfer-encoding', munge_cte[0])
            msg.replace_header('content-type', munge_cte[1])
        # Write the headers.  First we see if the message object wants to
        # handle that itself.  If not, we'll do it generically.
        meth = getattr(msg, '_write_headers', None)
        if meth is None:
            self._write_headers(msg)
        else:
            meth(self)
        self._fp.write(sfp.getvalue())

    def _dispatch(self, msg):
        # Get the Content-Type: for the message, then try to dispatch to
        # self._handle_<maintype>_<subtype>().  If there's no handler for the
        # full MIME type, then dispatch to self._handle_<maintype>().  If
        # that's missing too, then dispatch to self._writeBody().
        main = msg.get_content_maintype()
        sub = msg.get_content_subtype()
        specific = UNDERSCORE.join((main, sub)).replace('-', '_')
        meth = getattr(self, '_handle_' + specific, None)
        if meth is None:
            generic = main.replace('-', '_')
            meth = getattr(self, '_handle_' + generic, None)
            if meth is None:
                meth = self._writeBody
        meth(msg)

    #
    # Default handlers
    #

    def _write_headers(self, msg):
        for h, v in msg.raw_items():
            self.write(self.policy.fold(h, v))
        # A blank line always separates headers from body
        self.write(self._NL)

    #
    # Handlers for writing types and subtypes
    #

    def _handle_text(self, msg):
        payload = msg.get_payload()
        if payload is None:
            return
        if not isinstance(payload, str):
            raise TypeError('string payload expected: %s' % type(payload))
        if _has_surrogates(msg._payload):
            charset = msg.get_param('charset')
            if charset is not None:
                # XXX: This copy stuff is an ugly hack to avoid modifying the
                # existing message.
                msg = deepcopy(msg)
                del msg['content-transfer-encoding']
                msg.set_payload(payload, charset)
                payload = msg.get_payload()
                self._munge_cte = (msg['content-transfer-encoding'],
                                   msg['content-type'])
        if self._mangle_from_:
            payload = fcre.sub('>From ', payload)
        self._write_lines(payload)

    # Default body handler
    _writeBody = _handle_text

    def _handle_multipart(self, msg):
        # The trick here is to write out each part separately, merge them all
        # together, and then make sure that the boundary we've chosen isn't
        # present in the payload.
        msgtexts = []
        subparts = msg.get_payload()
        if subparts is None:
            subparts = []
        elif isinstance(subparts, str):
            # e.g. a non-strict parse of a message with no starting boundary.
            self.write(subparts)
            return
        elif not isinstance(subparts, list):
            # Scalar payload
            subparts = [subparts]
        for part in subparts:
            s = self._new_buffer()
            g = self.clone(s)
            g.flatten(part, unixfrom=False, linesep=self._NL)
            msgtexts.append(s.getvalue())
        # BAW: What about boundaries that are wrapped in double-quotes?
        boundary = msg.get_boundary()
        if not boundary:
            # Create a boundary that doesn't appear in any of the
            # message texts.
            alltext = self._encoded_NL.join(msgtexts)
            boundary = self._make_boundary(alltext)
            msg.set_boundary(boundary)
        # If there's a preamble, write it out, with a trailing CRLF
        if msg.preamble is not None:
            if self._mangle_from_:
                preamble = fcre.sub('>From ', msg.preamble)
            else:
                preamble = msg.preamble
            self._write_lines(preamble)
            self.write(self._NL)
        # dash-boundary transport-padding CRLF
        self.write('--' + boundary + self._NL)
        # body-part
        if msgtexts:
            self._fp.write(msgtexts.pop(0))
        # *encapsulation
        # --> delimiter transport-padding
        # --> CRLF body-part
        for body_part in msgtexts:
            # delimiter transport-padding CRLF
            self.write(self._NL + '--' + boundary + self._NL)
            # body-part
            self._fp.write(body_part)
        # close-delimiter transport-padding
        self.write(self._NL + '--' + boundary + '--' + self._NL)
        if msg.epilogue is not None:
            if self._mangle_from_:
                epilogue = fcre.sub('>From ', msg.epilogue)
            else:
                epilogue = msg.epilogue
            self._write_lines(epilogue)

    def _handle_multipart_signed(self, msg):
        # The contents of signed parts has to stay unmodified in order to keep
        # the signature intact per RFC1847 2.1, so we disable header wrapping.
        # RDM: This isn't enough to completely preserve the part, but it helps.
        p = self.policy
        self.policy = p.clone(max_line_length=0)
        try:
            self._handle_multipart(msg)
        finally:
            self.policy = p

    def _handle_message_delivery_status(self, msg):
        # We can't just write the headers directly to self's file object
        # because this will leave an extra newline between the last header
        # block and the boundary.  Sigh.
        blocks = []
        for part in msg.get_payload():
            s = self._new_buffer()
            g = self.clone(s)
            g.flatten(part, unixfrom=False, linesep=self._NL)
            text = s.getvalue()
            lines = text.split(self._encoded_NL)
            # Strip off the unnecessary trailing empty line
            if lines and lines[-1] == self._encoded_EMPTY:
                blocks.append(self._encoded_NL.join(lines[:-1]))
            else:
                blocks.append(text)
        # Now join all the blocks with an empty line.  This has the lovely
        # effect of separating each block with an empty line, but not adding
        # an extra one after the last one.
        self._fp.write(self._encoded_NL.join(blocks))

    def _handle_message(self, msg):
        s = self._new_buffer()
        g = self.clone(s)
        # The payload of a message/rfc822 part should be a multipart sequence
        # of length 1.  The zeroth element of the list should be the Message
        # object for the subpart.  Extract that object, stringify it, and
        # write it out.
        # Except, it turns out, when it's a string instead, which happens when
        # and only when HeaderParser is used on a message of mime type
        # message/rfc822.  Such messages are generated by, for example,
        # Groupwise when forwarding unadorned messages.  (Issue 7970.)  So
        # in that case we just emit the string body.
        payload = msg._payload
        if isinstance(payload, list):
            g.flatten(msg.get_payload(0), unixfrom=False, linesep=self._NL)
            payload = s.getvalue()
        else:
            payload = self._encode(payload)
        self._fp.write(payload)

    # This used to be a module level function; we use a classmethod for this
    # and _compile_re so we can continue to provide the module level function
    # for backward compatibility by doing
    #   _make_boundary = Generator._make_boundary
    # at the end of the module.  It *is* internal, so we could drop that...
    @classmethod
    def _make_boundary(cls, text=None):
        # Craft a random boundary.  If text is given, ensure that the chosen
        # boundary doesn't appear in the text.
        token = random.randrange(sys.maxsize)
        boundary = ('=' * 15) + (_fmt % token) + '=='
        if text is None:
            return boundary
        b = boundary
        counter = 0
        while True:
            cre = cls._compile_re('^--' + re.escape(b) + '(--)?$', re.MULTILINE)
            if not cre.search(text):
                break
            b = boundary + '.' + str(counter)
            counter += 1
        return b

    @classmethod
    def _compile_re(cls, s, flags):
        return re.compile(s, flags)

class BytesGenerator(Generator):
    """Generates a bytes version of a Message object tree.

    Functionally identical to the base Generator except that the output is
    bytes and not string.  When surrogates were used in the input to encode
    bytes, these are decoded back to bytes for output.  If the policy has
    cte_type set to 7bit, then the message is transformed such that the
    non-ASCII bytes are properly content transfer encoded, using the charset
    unknown-8bit.

    The outfp object must accept bytes in its write method.
    """

    # Bytes versions of this constant for use in manipulating data from
    # the BytesIO buffer.
    _encoded_EMPTY = b''

    def write(self, s):
        self._fp.write(s.encode('ascii', 'surrogateescape'))

    def _new_buffer(self):
        return BytesIO()

    def _encode(self, s):
        return s.encode('ascii')

    def _write_headers(self, msg):
        # This is almost the same as the string version, except for handling
        # strings with 8bit bytes.
        for h, v in msg.raw_items():
            self._fp.write(self.policy.fold_binary(h, v))
        # A blank line always separates headers from body
        self.write(self._NL)

    def _handle_text(self, msg):
        # If the string has surrogates the original source was bytes, so
        # just write it back out.
        if msg._payload is None:
            return
        if _has_surrogates(msg._payload) and not self.policy.cte_type=='7bit':
            if self._mangle_from_:
                msg._payload = fcre.sub(">From ", msg._payload)
            self._write_lines(msg._payload)
        else:
            super(BytesGenerator,self)._handle_text(msg)

    # Default body handler
    _writeBody = _handle_text

    @classmethod
    def _compile_re(cls, s, flags):
        return re.compile(s.encode('ascii'), flags)

_FMT = '[Non-text (%(type)s) part of message omitted, filename %(filename)s]'

class DecodedGenerator(Generator):
    """Generates a text representation of a message.

    Like the Generator base class, except that non-text parts are substituted
    with a format string representing the part.
    """
    def __init__(self, outfp, mangle_from_=True, maxheaderlen=78, fmt=None):
        """Like Generator.__init__() except that an additional optional
        argument is allowed.

        Walks through all subparts of a message.  If the subpart is of main
        type `text', then it prints the decoded payload of the subpart.

        Otherwise, fmt is a format string that is used instead of the message
        payload.  fmt is expanded with the following keywords (in
        %(keyword)s format):

        type       : Full MIME type of the non-text part
        maintype   : Main MIME type of the non-text part
        subtype    : Sub-MIME type of the non-text part
        filename   : Filename of the non-text part
        description: Description associated with the non-text part
        encoding   : Content transfer encoding of the non-text part

        The default value for fmt is None, meaning

        [Non-text (%(type)s) part of message omitted, filename %(filename)s]
        """
        Generator.__init__(self, outfp, mangle_from_, maxheaderlen)
        if fmt is None:
            self._fmt = _FMT
        else:
            self._fmt = fmt

    def _dispatch(self, msg):
        for part in msg.walk():
            maintype = part.get_content_maintype()
            if maintype == 'text':
                print(part.get_payload(decode=False), file=self)
            elif maintype == 'multipart':
                # Just skip this
                pass
            else:
                print(self._fmt % {
                    'type'       : part.get_content_type(),
                    'maintype'   : part.get_content_maintype(),
                    'subtype'    : part.get_content_subtype(),
                    'filename'   : part.get_filename('[no filename]'),
                    'description': part.get('Content-Description',
                                            '[no description]'),
                    'encoding'   : part.get('Content-Transfer-Encoding',
                                            '[no encoding]'),
                    }, file=self)

# Helper used by Generator._make_boundary
_width = len(repr(sys.maxsize-1))
_fmt = '%%0%dd' % _width

# Backward compatibility
_make_boundary = Generator._make_boundary


text:
package com.github.devicehive.rest.api;

import com.github.devicehive.rest.model.ApiInfo;
import com.github.devicehive.rest.model.ClusterConfig;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Headers;

public interface ApiInfoApi {
  /**
   * Get API info
   * Returns version of API, server timestamp and WebSocket base uri
   * @return Call<ApiInfo>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("info")
  Call<ApiInfo> getApiInfo();

  /**
   * Get cluster configuration
   * Returns information about cluster (Kafka, Zookeeper etc.)
   * @return Call<ClusterConfig>
   */
  @Headers({
    "Content-Type:application/json"
  })
  @GET("info/config/cluster")
  Call<ClusterConfig> getClusterConfig();

}


text:
package org.waxbee.teensy.extdata;

public class BuildVariant
{
	protected BuildVariant(String name, String description, String[] supports)
	{
		itsName = name;
		itsDescription = description;
		itsSupports = supports;
	}

	String	itsName;
	String	itsDescription;
	String[]	itsSupports;

	public String getDescription() { return itsDescription; }
	public String getName() { return itsName; }
	public String[] getSupports() { return itsSupports; }
}


text:
using System.Collections;
using System.Linq;
using System.Linq.Dynamic.Core;
using System.Threading.Tasks;
using Abp.AspNetCore.Mvc.Authorization;
using Abp.Domain.Repositories;
using Abp.Runtime.Validation;
using Abp.Web.Models;
using AutoMapper.QueryableExtensions;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Repairis.Authorization;
using Repairis.Authorization.Users;
using Repairis.Controllers;
using Repairis.Users;
using Repairis.Users.Dto;
using Syncfusion.JavaScript;
using Syncfusion.JavaScript.DataSources;

namespace Repairis.Web.Controllers
{
    [AbpMvcAuthorize(PermissionNames.Pages_Employees)]
    public class EmployeesController : RepairisControllerBase
    {
        private readonly IUserAppService _userAppService;
        private readonly IRepository<EmployeeInfo, long> _employeeInfoRepository;

        public EmployeesController(IUserAppService userAppService, IRepository<EmployeeInfo, long> employeeInfoRepository)
        {
            _userAppService = userAppService;
            _employeeInfoRepository = employeeInfoRepository;
        }

        // GET: Employees
        public ActionResult Index()
        {
            return View();
        }

        [Route("/api/Employees/")]
        [DontWrapResult]
        public ActionResult EmployeesDataSource([FromBody] DataManager dm)
        {
            var employeesQueryable = _employeeInfoRepository.GetAll();
            int count = employeesQueryable.AsQueryable().Count();
            IEnumerable data = employeesQueryable.ProjectTo<EmployeeBasicEntityDto>();
            DataOperations operation = new DataOperations();
            data = operation.Execute(data, dm);

            return Json(new { result = data.ToDynamicList(), count = count }, new JsonSerializerSettings
            {
                ContractResolver = new DefaultContractResolver()
            });
        }

        // GET: Employees/Create
        public ActionResult Create()
        {
            return View();
        }

        // POST: Employees/Create
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ActionName("Create")]
        [ValidateAntiForgeryToken]
        [DisableValidation]
        public async Task<ActionResult> Create_Post(EmployeeInput input)
        {
            if (input.SalaryValue < 0)
            {
                ModelState.AddModelError(nameof(input.SalaryValue), L("SalaryValueMustBeNonNegativeNumber"));
            }

            if (!input.SalaryIsFlat && input.SalaryValue > 100)
            {
                ModelState.AddModelError(nameof(input.SalaryValue), L("SalaryValueMustBeBetween0And100"));
            }

            if (ModelState.IsValid)
            {
                await _userAppService.CreateEmployeeAsync(input);
                return RedirectToAction("Index");
            }

            return View(input);
        }

        // GET: Employees/Edit/5
        public async Task<ActionResult> Edit(long? id)
        {
            if (id == null)
            {
                return BadRequest();
            }

            var employee = await _employeeInfoRepository.GetAll().Where(x => x.Id == id).ProjectTo<EmployeeBasicEntityDto>().FirstOrDefaultAsync();

            if (employee == null)
            {
                return NotFound();
            }

            return View(employee);
        }

        // POST: Employees/Edit/5
        // To protect from overposting attacks, please enable the specific properties you want to bind to, for
        // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> Edit(EmployeeBasicEntityDto input)
        {
            if (input.SalaryValue < 0)
            {
                ModelState.AddModelError(nameof(input.SalaryValue), L("SalaryValueMustBeNonNegativeNumber"));
            }

            if (!input.SalaryIsFlat && input.SalaryValue > 100)
            {
                ModelState.AddModelError(nameof(input.SalaryValue), L("SalaryValueMustBeBetween0And100"));
            }

            if (ModelState.IsValid)
            {
                var employee = await _employeeInfoRepository.GetAllIncluding(x => x.EmployeeUser).FirstOrDefaultAsync(x => x.Id == input.Id);

                if (employee == null)
                {
                    return NotFound();
                }

                employee.EmployeeUser.Address = input.Address;
                employee.EmployeeUser.Name = input.Name;
                employee.EmployeeUser.Surname = input.Surname;
                employee.EmployeeUser.FatherName = input.FatherName;
                employee.EmployeeUser.EmailAddress = input.EmailAddress;
                employee.EmployeeUser.PhoneNumber = input.PhoneNumber;
                employee.EmployeeUser.SecondaryPhoneNumber = input.SecondaryPhoneNumber;
                employee.SalaryIsFlat = input.SalaryIsFlat;
                employee.SalaryValue = input.SalaryValue;

                await _employeeInfoRepository.UpdateAsync(employee);

                return RedirectToAction("Index");
            }
            return View(input);
        }

        // GET: Employees/Delete/5
        public async Task<ActionResult> Delete(long? id)
        {
            if (id == null)
            {
                return BadRequest();
            }

            var employee = await _employeeInfoRepository.GetAll().Where(x => x.Id == id).ProjectTo<EmployeeBasicEntityDto>().FirstOrDefaultAsync();

            if (employee == null)
            {
                return NotFound();
            }

            return View(employee);
        }

        // POST: Employees/Delete/5
        [HttpPost, ActionName("Delete")]
        [ValidateAntiForgeryToken]
        public async Task<ActionResult> DeleteConfirmed(long id)
        {
            await _userAppService.DeleteEmployeeAsync(id);
            return RedirectToAction("Index");
        }
    }
}


text:
ACCEPTED

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

#### Published in
null

#### Original name
Hysterangium burburianum Rodway, 1918

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:c="http://www.springframework.org/schema/c" xmlns:cache="http://www.springframework.org/schema/cache"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jpa="http://www.springframework.org/schema/data/jpa"
	xmlns:lang="http://www.springframework.org/schema/lang" xmlns:p="http://www.springframework.org/schema/p"
	xmlns:repository="http://www.springframework.org/schema/data/repository"
	xmlns:task="http://www.springframework.org/schema/task" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
		http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
		http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
		http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
		http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
		http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data/repository/spring-repository.xsd">

	<bean id="javaMailSenderImpl" class="org.springframework.mail.javamail.JavaMailSenderImpl">
		<property name="host" value="${mail.host}" />
		<property name="port" value="${mail.port}" />
		<property name="username" value="${mail.username}" />
		<property name="password" value="${mail.password}" />
		<property name="javaMailProperties">
			<props>
				<prop key="mail.smtp.auth">${mail.smtp.auth}</prop>
				<prop key="mail.smtp.timeout">${mail.smtp.timeout}</prop>
			</props>
		</property>
	</bean>

	<bean id="freeMarkerConfigurer" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
		<property name="templateLoaderPath" value="classpath:template_freemarker" />
		<property name="defaultEncoding" value="utf-8" />
		<property name="freemarkerSettings">
			<props>
				<prop key="template_update_delay">300</prop><!--刷新模板的周期,单位为秒 -->
				<prop key="default_encoding">UTF-8</prop><!--模板的编码格式 -->
				<prop key="locale">zh_CN</prop><!-- 本地化设置 -->
			</props>
		</property>
	</bean>

	<bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean">
		<property name="velocityProperties">
			<props>
				<prop key="resource.loader">class</prop>
				<prop key="class.resource.loader.class">org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
				</prop>
			</props>
		</property>
	</bean>

</beans>


text:
using System;
using System.Drawing;
using MonoTouch.CoreFoundation;
using MonoTouch.UIKit;
using MonoTouch.Foundation;
using VirtualSales.iOS.DraggableList;
using System.Collections.Generic;
using VirtualSales.Core.ViewModels.Tools;
using ReactiveUI;
using System.Reactive.Linq;
using VirtualSales.Core.ViewModels;
using System.Windows.Input;

namespace VirtualSales.iOS.ViewControllers
{

    public partial class SelectedToolsViewController : UICollectionViewController, IDraggableDataSource
    {
        public class SelectedToolViewModel : ReactiveObject
        {
            private bool _isEmpty;

            public ICommand ShowAvailableToolsCommand { get; private set; }
            public ICommand SetActiveToolCommand { get; private set; }
            public IReactiveList<IToolViewModel> SelectedTools { get; private set; }

            public bool IsEmpty
            {
                get { return _isEmpty; }
                set { this.RaiseAndSetIfChanged(ref _isEmpty, value); }
            }

            public SelectedToolViewModel(UIView toolboxView, AvailableToolsContainerViewController container, MeetingViewModel meeting, IReactiveList<IToolViewModel> selectedTools, NavigationPaneViewModel navigationPane)
            {
                SelectedTools = selectedTools;

                IsEmpty = SelectedTools.Count == 0;
                SelectedTools.Changed.ObserveOn(RxApp.MainThreadScheduler)
                             .Subscribe(p =>
                                        {
                                            IsEmpty = SelectedTools.Count == 0;
                                        });

                var showAvailableToolsCommand = new ReactiveCommand();
                showAvailableToolsCommand.ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
                {
                    UIView.BeginAnimations(null);
                    UIView.SetAnimationDuration(0.25);
                    toolboxView.Alpha = 1.0f;
                    UIView.CommitAnimations();
                });

                container.CloseToolboxRequested += (s, e) =>
                                                   {
                                                       UIView.BeginAnimations(null);
                                                       UIView.SetAnimationDuration(0.25);
                                                       toolboxView.Alpha = 0.0f;
                                                       UIView.CommitAnimations();
                                                   };
                ShowAvailableToolsCommand = showAvailableToolsCommand;
                navigationPane.ShowToolLibraryAction = () => ShowAvailableToolsCommand.Execute(null);

                var setActiveToolsCommand = new ReactiveCommand();
                setActiveToolsCommand.ObserveOn(RxApp.MainThreadScheduler)
                    .Subscribe(tool => meeting.ActiveTool = (IToolViewModel)tool);
                SetActiveToolCommand = setActiveToolsCommand;
            }

        }
        private SelectedToolViewModel _viewModel;
        public SelectedToolViewModel ViewModel
        {
            get { return _viewModel; }
            set
            {
                _viewModel = value;
                HookupViewModel();
            }
        }

        internal DraggableListTargetFlowLayout DraggableLayout
        {
            get { return (DraggableListTargetFlowLayout)Layout; }
        }

        private void HookupViewModel()
        {
            CollectionView.ReloadData();
            ViewModel.WhenAnyValue(p => p.IsEmpty, p => p)
                     .ObserveOn(RxApp.MainThreadScheduler)
                     .Subscribe(p =>
                                {
                                    dragItemsIntoHereLabel.Hidden = !p;
                                });
        }

        public SelectedToolsViewController(IntPtr handle)
            : base(handle)
        {
        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            DraggableLayout.DataSource = this;
            DraggableLayout.SetupCollectionView();

            CollectionView.AllowsSelection = true;
            CollectionView.AllowsMultipleSelection = false;

            CollectionView.RegisterNibForCell(ToolCell.Nib, ToolCell.Key);
        }

        public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var tool = ViewModel.SelectedTools[indexPath.Item];
            ViewModel.SetActiveToolCommand.Execute(tool);
        }

        public override int NumberOfSections(UICollectionView collectionView)
        {
            return 1;
        }

        public override int GetItemsCount(UICollectionView collectionView, int section)
        {
            if (ViewModel == null) return 0;
            return ViewModel.SelectedTools.Count;
        }

        public override UICollectionViewCell GetCell(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var cell = collectionView.DequeueReusableCell(ToolCell.Key, indexPath) as ToolCell;
            cell.Text = ViewModel.SelectedTools[indexPath.Item].Name;
            cell.SetBorder();
            return cell;
        }

        #region IDraggableDataSource Implementation
        public void ItemWillMoveToIndexPath(NSIndexPath fromIndexPath, NSIndexPath toIndexPath)
        {
            if (ViewModel == null) return;

            var item = ViewModel.SelectedTools[fromIndexPath.Item];
            ViewModel.SelectedTools.RemoveAt(fromIndexPath.Item);
            ViewModel.SelectedTools.Insert(toIndexPath.Item, item);
        }

        public void ItemDidMoveToIndexPath(NSIndexPath fromIndexPath, NSIndexPath toIndexPath)
        {
        }

        public object ItemAtIndexPath(NSIndexPath path)
        {
            if (ViewModel == null) return null;

            return ViewModel.SelectedTools[path.Item];
        }

        public void ItemWillRemoveFromIndexPath(NSIndexPath path)
        {
            if (ViewModel == null) return;

            ViewModel.SelectedTools.RemoveAt(path.Item);
        }

        public void ItemDidRemoveFromIndexPath(NSIndexPath path)
        {
        }

        public void ItemWillAddToIndexPath(NSIndexPath path, object data)
        {
            if (ViewModel == null) return;

            var item = data as IToolViewModel;
            if (item != null)
            {
                ViewModel.SelectedTools.Insert(path.Item, item);
            }
        }

        public void ItemDidAddToIndexPath(NSIndexPath path, object data)
        {

        }

        public bool CanMoveItemAtIndexPath(NSIndexPath path)
        {
            return true;
        }
        #endregion
    }
}


text:
from gpiozero import LED
import time

# GPIO 24 ... LED ... 470 ohm resistor ... GND

led = LED(24)
try:
    led.blink()
    time.sleep(20)
except KeyboardInterrupt:
    led.off()
print "done"


text:
package com.afwsamples.testdpc.policy.utils;

import java.io.UnsupportedEncodingException;
import java.security.cert.CertificateParsingException;
import org.bouncycastle.asn1.ASN1Encodable;
import org.bouncycastle.asn1.ASN1Sequence;

@SuppressWarnings("EqualsHashCode")
public class AttestationPackageInfo implements java.lang.Comparable<AttestationPackageInfo> {
  private static final int PACKAGE_NAME_INDEX = 0;
  private static final int VERSION_INDEX = 1;

  private final String packageName;
  private final long version;

  public AttestationPackageInfo(String packageName, long version) {
    this.packageName = packageName;
    this.version = version;
  }

  public AttestationPackageInfo(ASN1Encodable asn1Encodable) throws CertificateParsingException {
    if (!(asn1Encodable instanceof ASN1Sequence)) {
      throw new CertificateParsingException(
          "Expected sequence for AttestationPackageInfo, found "
              + asn1Encodable.getClass().getName());
    }

    ASN1Sequence sequence = (ASN1Sequence) asn1Encodable;
    try {
      packageName =
          Asn1Utils.getStringFromAsn1OctetStreamAssumingUTF8(
              sequence.getObjectAt(PACKAGE_NAME_INDEX));
    } catch (UnsupportedEncodingException e) {
      throw new CertificateParsingException(
          "Converting octet stream to String triggered an UnsupportedEncodingException", e);
    }
    version = Asn1Utils.getLongFromAsn1(sequence.getObjectAt(VERSION_INDEX));
  }

  public String getPackageName() {
    return packageName;
  }

  public long getVersion() {
    return version;
  }

  @Override
  public String toString() {
    return new StringBuilder()
        .append("Package name: ")
        .append(getPackageName())
        .append("\nVersion: " + getVersion())
        .toString();
  }

  @Override
  public int compareTo(AttestationPackageInfo other) {
    int res = packageName.compareTo(other.packageName);
    if (res != 0) return res;
    res = Long.compare(version, other.version);
    if (res != 0) return res;
    return res;
  }

  @Override
  public boolean equals(Object o) {
    return (o instanceof AttestationPackageInfo) && (0 == compareTo((AttestationPackageInfo) o));
  }
}


text:
package org.cbsa.api.controller.metadata;

import java.util.Comparator;

import org.cbsa.api.model.KeywordDetails;

public class FrequencyComparator implements Comparator<KeywordDetails> {

    @Override
    public int compare(KeywordDetails firstKeyword, KeywordDetails secondKeyword) {
        return -firstKeyword.getFrequency().compareTo(
                secondKeyword.getFrequency());
    }

}


text:
/*
 * Translated default messages for bootstrap-select.
 * Locale: RO (Romanian)
 * Region: RO (Romania)
 * Alex Florea <alecz.fia@gmail.com>
 */
(function ($) {
  $.fn.selectpicker.defaults = {
    noneSelectedText: 'Nu a fost selectat nimic',
    noneResultsText: 'Nu exista niciun rezultat',
    countSelectedText: '{0} din {1} selectat(e)',
    maxOptionsText: ['Limita a fost atinsa ({n} {var} max)', 'Limita de grup a fost atinsa ({n} {var} max)', ['iteme', 'item']],
    multipleSeparator: ', '
  };
}(jQuery));


text:
import Building from 'react-icons/lib/fa/building';
import Folder from 'react-icons/lib/fa/folder';
import Cog from 'react-icons/lib/fa/cog';
import Paperclip from 'react-icons/lib/fa/paperclip';
//import FaUsers from 'react-icons/lib/fa/users';
import Question from 'react-icons/lib/fa/question';
import Bullseye from 'react-icons/lib/fa/bullseye';
import Rocket from 'react-icons/lib/fa/rocket';
import Archive from 'react-icons/lib/fa/archive';
import Eye from 'react-icons/lib/fa/eye'
import Bell from 'react-icons/lib/fa/bell';

export const Organizations = Building
export const Projects = Folder
export const Technologies = Cog
export const Attachments = Paperclip
//export const Users = FaUsers
export const Default = Question
export const Readiness = Bullseye
export const Impact = Rocket
export const Collections = Archive
export const ViewEntry = Eye
export const RecentUpdates = Bell

export Loading from 'react-icons/lib/fa/spinner'
export Search from 'react-icons/lib/fa/search'
export Error from 'react-icons/lib/fa/bug'
export Filter from 'react-icons/lib/fa/filter'
export SortAscendent from 'react-icons/lib/fa/sort-asc'
export SortDescendent from 'react-icons/lib/fa/sort-desc'
export BuildRelation from 'react-icons/lib/fa/plus'
export Add from 'react-icons/lib/fa/plus'
export ArrowRight from 'react-icons/lib/fa/arrow-right';
export Remove from 'react-icons/lib/fa/trash';
export File from 'react-icons/lib/fa/file'
export Download from 'react-icons/lib/fa/download';


text:
<!DOCTYPE html>
<html>
  <head>
    <title>autosize-input</title>
    <meta charset="utf-8">
  </head>
  <body>
    <input type="text" id="foo" value="Nice">
    <input type="text" id="bar" placeholder="People">
    <input type="text" id="baz" placeholder="Matter">
    <script src="/bundle.js"></script>
    <script>
      autosizeInput(document.querySelector('#foo'));
      autosizeInput(document.querySelector('#bar'));
      autosizeInput(document.querySelector('#baz'), { minWidth: true });
    </script>
  </body>
</html>


text:
using UnityEngine;
using System.Collections;

public class AlphaClipping : MonoBehaviour
{
    public float AlphaClipPercentage = 0;

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        if (AlphaClipPercentage < 2)
        {
            AlphaClipPercentage += Time.deltaTime;
            SpriteRenderer s = GetComponent<SpriteRenderer>();
            s.material.SetFloat("_AlphaClip", AlphaClipPercentage * 0.75f);
        }
    }
}


text:
console.log("Hello from before.js!");

window.BeforeJs = { value: 77 };


text:
require 'spec_helper'

require_relative '../../../lib/locomotive/steam/middlewares/thread_safe'
require_relative '../../../lib/locomotive/steam/middlewares/concerns/helpers'
require_relative '../../../lib/locomotive/steam/middlewares/concerns/liquid_context'
require_relative '../../../lib/locomotive/steam/middlewares/concerns/rendering'
require_relative '../../../lib/locomotive/steam/middlewares/page_not_found'

describe Locomotive::Steam::Middlewares::PageNotFound do

  let(:site)            { instance_double('Site', asset_host: nil) }
  let(:url)             { 'http://models.example.com/about-us' }
  let(:page_finder)     { instance_double('PageFinder') }
  let(:locomotive_path) { nil }
  let(:app)             { ->(env) { [200, env, ['Hello world']] } }
  let(:middleware)      { described_class.new(app) }

  subject do
    env = env_for(url, 'steam.site' => site)
    env['steam.request']    = Rack::Request.new(env)
    env['steam.services']   = instance_double('Services', page_finder: page_finder)
    env['locomotive.path']  = locomotive_path
    code, _, body = middleware.call(env)
    [code, body]
  end

  describe 'no page not found exception raised' do

    it { is_expected.to eq [200, ['Hello world']] }

  end

  describe 'page not found exception raised' do

    let(:page)  { instance_double('PageNotFound',not_found?: true, response_type: 'text/html') }
    let(:app)   { ->(env) { raise Locomotive::Steam::PageNotFoundException.new } }

    it 'renders the 404 error page' do
      expect(page_finder).to receive(:find).with('404').and_return(page)
      expect_any_instance_of(described_class).to receive(:parse_and_render_liquid).and_return("We're sorry")
      is_expected.to eq [404, ["We're sorry"]]
    end

  end

end


text:
<?php

	if (!($reg = $this->getChannelReg($chan_name))) {
		$bot->noticef($user, '%s is not registered!', $chan_name);
		return false;
	}
	if (!($chan = $this->getChannel($chan_name))) {
		$bot->noticef($user, 'Nobody is in %s.', $chan_name);
		return false;
	}
	if (!$chan->isOn($bot->getNumeric())) {
		$bot->noticef($user, 'I am not on %s.', $chan->getName());
		return false;
	}

	$numerics = array();
	foreach ($chan->users as $numeric => $chanuser) {
		$tmpuser = $this->getUser($numeric);

		if ($chanuser->isOp() && !$tmpuser->isBot())
			$numerics[] = $numeric;
	}

	if (empty($numerics)) {
		$bot->noticef($user, 'Nobody in %s is opped.', $chan->getName());
		return false;
	}

	$bot->deop($chan->getName(), $numerics);


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

<title>Database Connection Handle</title>

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

Small. Fast. Reliable.
Choose any three.

    About
    Sitemap
    Documentation
    Download
    License
    News
    Developers
    Support

SQLite C Interface

Database Connection Handle

typedef struct sqlite3 sqlite3;

Each open SQLite database is represented by a pointer to an instance of
the opaque structure named "sqlite3".  It is useful to think of an sqlite3
pointer as an object.  The sqlite3_open(), sqlite3_open16(), and
sqlite3_open_v2() interfaces are its constructors, and sqlite3_close()
is its destructor.  There are many other interfaces (such as
sqlite3_prepare_v2(), sqlite3_create_function(), and
sqlite3_busy_timeout() to name but three) that are methods on an
sqlite3 object.

See also lists of
  Objects,
  Constants, and
  Functions.

This page last modified 2009/02/18 18:03:35 UTC