text:
require_relative "../config/environment"
require 'rails_helper'
require 'mongo'
require 'utils'
Mongo::Logger.logger.level = ::Logger::INFO

feature "Module 1 Summative - CRUD Model Tests" do

    !let(:data_file) { "race_results.json" }

    before :each do
        @db = Racer.mongo_client
        @db[:racers].drop
        hash = JSON.parse(File.read(data_file))
        @db[:racers].insert_many(hash)
        @num_records = Racer.collection.count
    end

    context "rq01" do
        it "Racer implements a class method called all" do
            expect(Racer).to respond_to(:all)
        end

        it "class method all takes 4 optional parameters and no required parameters" do
            expect((Racer.method(:all).parameters.flatten - [:opt]).count).to eq 4
            expect(Racer.method(:all).parameters.flatten).to_not include (:req)
        end

        it "class method all default parameters return all records sorted by number ascending" do
            results = Racer.all
            expect(results.count).to eq(@num_records)
            num = -1
            results.each do |r|
                expect(r[:number]).to be > num
                num = r[:number]
            end
        end

        it "class method all returns filtered records according to user parameters" do
            result = Racer.all.to_a
            filter_count = 0
            result.each do |ar|
                if ar[:gender] == "F" && ar[:group] == "50 to 59"
                    filter_count += 1
                end
            end
            result = Racer.all({group:"50 to 59", gender:"F"}, {last_name:-1},0, nil).to_a
            expect(result.count).to eq(filter_count)

            result = Racer.all({group:"50 to 59", gender:"F"}, {last_name:-1},0,10).to_a
            cur_lname = "ZZZZZZZZZZ"
            count = 0
            result.each do |r|
                expect(r[:group]).to eq("50 to 59")
                expect(r[:gender]).to eq("F")
                expect(r[:last_name]).to be < cur_lname
                cur_lname = r[:last_name]
                count += 1
            end
            expect(count).to eq(10)
            result2 = Racer.all({group:"50 to 59", gender:"F"}, {last_name:-1},3,10).to_a
            expect(result2.first).to eq(result[3])
        end
    end

    context "rq02" do
        it "Racer has accessors for id, number, first_name, last_name, gender, group and secs" do
            racer = Racer.new({number:1, first_name:"Bill", last_name:"Gates", gender:"M", group:"50 to 59", secs:5000})
            expect(racer).to respond_to(:id)
            expect(racer).to respond_to(:number)
            expect(racer).to respond_to(:first_name)
            expect(racer).to respond_to(:last_name)
            expect(racer).to respond_to(:gender)
            expect(racer).to respond_to(:group)
            expect(racer).to respond_to(:secs)
        end
    end

    context "rq03" do
        it "Racer has an initializer of the class using racers document keys" do
            dbRacer = Racer.all.find.first
            racer_obj = Racer.new(dbRacer)
            expect(racer_obj.id).to_not be_nil
            expect(racer_obj.id).to eq(dbRacer[:_id].to_s)
            expect(racer_obj.number).to_not be_nil
            expect(racer_obj.number).to eq(dbRacer[:number])
            expect(racer_obj.first_name).to_not be_nil
            expect(racer_obj.first_name).to eq(dbRacer[:first_name])
            expect(racer_obj.last_name).to_not be_nil
            expect(racer_obj.last_name).to eq(dbRacer[:last_name])
            expect(racer_obj.gender).to_not be_nil
            expect(racer_obj.gender).to eq(dbRacer[:gender])
            expect(racer_obj.group).to_not be_nil
            expect(racer_obj.group).to eq(dbRacer[:group])
            expect(racer_obj.secs).to_not be_nil
            expect(racer_obj.secs).to eq(dbRacer[:secs])
        end
    end

    context "rq04" do
        it "Racer implements a class method called find" do
            expect(Racer).to respond_to(:find)
        end

        it "class method find takes a single id parameter" do
            expect((Racer.method(:find).parameters.flatten - [:opt, :req]).count).to eq 1
            expect(Racer.method(:find).parameters.flatten).to_not include (:opt)
        end

        it "find method returns racer document represented by specified id" do
            data_record = Racer.collection.find(number: 300).first
            idval = data_record[:_id]
            acc_record = Racer.find(idval)
            expect(acc_record).to be_a(Racer)
            expect(acc_record.id).to eq(data_record[:_id].to_s)
            expect(acc_record.number).to eq(data_record[:number])
            expect(acc_record.first_name).to eq(data_record[:first_name])
            expect(acc_record.last_name).to eq(data_record[:last_name])
            expect(acc_record.gender).to eq(data_record[:gender])
            expect(acc_record.group).to eq(data_record[:group])
            expect(acc_record.secs).to eq(data_record[:secs])
            bad_id = "563daabbe301fffffff00999"
            expect(Racer.find(bad_id)).to be_nil
        end
    end

    context "rq05" do
        let (:racer) { Racer.new({ number: 2000, first_name: "Bill", last_name: "Gates", gender: "M", group: "50 to 59", secs: 5000 }) }

        it "Racer implements an instance method called save" do
            expect(racer).to respond_to(:save)
        end

        it "Method save takes no parameters" do
            expect(racer.method(:save).parameters.flatten.count).to eq 0
        end

        it "save method inserts racer into database and returns with id" do
            racer.save()
            expect(racer.id).to_not be_nil
            db_result = Racer.collection.find(_id: BSON::ObjectId.from_string(racer.id)).first
            expect(racer.first_name).to eq db_result[:first_name]
            expect(racer.last_name).to eq db_result[:last_name]
            expect(racer.number).to eq db_result[:number]
            expect(racer.gender).to eq db_result[:gender]
            expect(racer.group).to eq db_result[:group]
            expect(racer.secs).to eq db_result[:secs]
        end
    end

    context "rq06" do
        before :each do
            db_rec = Racer.collection.find(number: 300).first
            @id = db_rec[:_id].to_s
            @racer = Racer.find(@id)
        end

        it "Racer implements an instance method called update" do
            expect(@racer).to respond_to(:update)
        end

        it "Method update takes a single hash as a parameters" do
            expect((@racer.method(:update).parameters.flatten - [:opt, :req]).count).to eq 1
            expect(@racer.method(:update).parameters.flatten).to_not include(:opt)
        end

        it "update method updates object with supplied hash and overwrites other parameters" do
            old_racer = @racer
            @racer.update(first_name:"thing", last_name:"one", group:"15 to 19", number: old_racer.number, secs: old_racer.secs)
            expect(@racer.first_name).to eq "thing"
            expect(@racer.last_name).to eq "one"
            expect(@racer.group).to eq "15 to 19"
            expect(@racer.id).to eq(@id)
            expect(@racer.gender).to be_nil
            expect(@racer.secs).to eq old_racer.secs
            expect(@racer.number).to eq old_racer.number
            db_test_rec = Racer.collection.find(_id: BSON::ObjectId.from_string(@id)).first
            expect(db_test_rec).to_not be_nil
            expect(@racer.first_name).to eq(db_test_rec[:first_name])
            expect(@racer.last_name).to eq(db_test_rec[:last_name])
            expect(@racer.gender).to eq(db_test_rec[:gender])
            expect(@racer.number).to eq(db_test_rec[:number])
            expect(@racer.group).to eq(db_test_rec[:group])
            expect(@racer.secs).to eq(db_test_rec[:secs])
        end
    end

    context "rq07" do
        before :each do
            db_rec = Racer.collection.find(number: 350).first
            @id = db_rec[:_id].to_s
            @racer = Racer.find(@id)
        end

        it "Racer implements an instance method called destroy" do
            expect(@racer).to respond_to(:destroy)
        end

        it "Method destroy takes no parameters" do
            expect((@racer.method(:destroy).parameters.flatten).count).to eq 0
        end

        it "destroy method deletes a document from the database" do
            expect(@racer).to_not be_nil
            expect(@racer.first_name).to_not be_nil
            @racer.destroy
            next_racer = Racer.find(@id)
            expect(next_racer).to be_nil
        end
    end
end


text:
package org.quuux.plasma;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

// EffectVIew is a View that

public abstract class EffectView extends View implements Effect {

    static {
        System.loadLibrary("plasma");
    }

    private Bitmap mBitmap;
    private int mWidth;
    private int mHeight;
    private long mStartTime;
    private final Paint mPaint = new Paint();
    private final Matrix mMatrix = new Matrix();

    private int mFactor = 1;

    public EffectView(final Context context) {
        super(context);
        init(context);
    }

    public EffectView(final Context context, final AttributeSet attrs) {
        super(context, attrs);
        init(context);
    }

    public EffectView(final Context context, final AttributeSet attrs, final int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        init(context);
    }

    private void init(final Context context) {
        mFactor = getScale();
        mStartTime = System.currentTimeMillis();
    }

    @Override
    protected void onSizeChanged(final int w, final int h, final int oldw, final int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        mWidth = w;
        mHeight = h;
        recycle();
        allocate();
    }

    @Override
    public void onDraw(final Canvas canvas) {

        mMatrix.reset();
        mMatrix.postScale((float)canvas.getWidth() / (float)mBitmap.getWidth(), (float)canvas.getHeight() / (float)mBitmap.getHeight());

        final long now = System.currentTimeMillis();
        render(mBitmap, now - mStartTime);
        canvas.drawBitmap(mBitmap, mMatrix, mPaint);

        invalidate();
    }

    protected abstract void render(final Bitmap bitmap, long t);
    protected abstract int getScale();

    private void allocate() {
        mBitmap = Bitmap.createBitmap(mWidth / mFactor, mHeight / mFactor, Bitmap.Config.RGB_565);
    }

    public void recycle() {
        if (mBitmap != null) {
            mBitmap.recycle();
            mBitmap = null;
        }
    }

    public void setResolutionFactor(final int resolutionFactor) {
        if (resolutionFactor != mFactor) {
            mFactor = resolutionFactor;
            allocate();
        }
    }

    public int getResolutionFactor() {
        return mFactor;
    }

}

redpajama_set_name: RedPajamaGithub


text:
package org.apache.flume.interceptor.service;

import org.apache.flume.Event;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Component;

@Component
public class FlumeCacheService implements ICacheService<Event> {

    private static final Logger logger = LoggerFactory.getLogger(FlumeCacheService.class);

    @Override
    @Cacheable(value = "FlumeCachedEvent")
    public Event intercept(Event d) {
        // TODO: implement!
        logger.info("Flume cache Service intercepting: " + d.toString());
        return d;
    }
}


text:
package cn.edu.nuc.acmicpc.dto;

import java.sql.Timestamp;
import java.util.List;

/**
 * Created with IDEA
 * User: chuninsane
 * Date: 2016/3/13
 * Contest dto.
 */
public class ContestDto {

    private Long contestId;
    private String title;
    private String description;
    private Timestamp time;
    private Byte type;
    private Integer length;
    private boolean isVisible;
    private String password;
    private String passwordRepeat;
    private Integer frozenTime;
    private String action;
    private Integer lengthDays;
    private Integer lengthHours;
    private Integer lengthMinutes;
    private String problemList;
    private Boolean needFrozen;
    private Integer frozenLengthMinutes;
    private Integer frozenLengthHours;
    private Integer frozenLengthDays;
    private List<UserDto> userDtos;
    private String typeName;
    private String status;
    private Timestamp startTime;
    private Timestamp endTime;
    private Timestamp currentTime;
    private Long timeLeft;

    @Override
    public String toString() {
        return "ContestDto{" +
                "contestId=" + contestId +
                ", title='" + title + '\'' +
                ", description='" + description + '\'' +
                ", time=" + time +
                ", type=" + type +
                ", length=" + length +
                ", isVisible=" + isVisible +
                ", password='" + password + '\'' +
                ", passwordRepeat='" + passwordRepeat + '\'' +
                ", frozenTime=" + frozenTime +
                ", action='" + action + '\'' +
                ", lengthDays=" + lengthDays +
                ", lengthHours=" + lengthHours +
                ", lengthMinutes=" + lengthMinutes +
                ", problemList='" + problemList + '\'' +
                ", needFrozen=" + needFrozen +
                ", frozenLengthMinutes=" + frozenLengthMinutes +
                ", frozenLengthHours=" + frozenLengthHours +
                ", frozenLengthDays=" + frozenLengthDays +
                ", userDtos=" + userDtos +
                ", typeName='" + typeName + '\'' +
                ", status='" + status + '\'' +
                ", startTime=" + startTime +
                ", endTime=" + endTime +
                ", currentTime=" + currentTime +
                ", timeLeft=" + timeLeft +
                '}';
    }

    public Long getContestId() {
        return contestId;
    }

    public void setContestId(Long contestId) {
        this.contestId = contestId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Timestamp getTime() {
        return time;
    }

    public void setTime(Timestamp time) {
        this.time = time;
    }

    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }

    public boolean isVisible() {
        return isVisible;
    }

    public void setIsVisible(boolean isVisible) {
        this.isVisible = isVisible;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPasswordRepeat() {
        return passwordRepeat;
    }

    public void setPasswordRepeat(String passwordRepeat) {
        this.passwordRepeat = passwordRepeat;
    }

    public Integer getFrozenTime() {
        return frozenTime;
    }

    public void setFrozenTime(Integer frozenTime) {
        this.frozenTime = frozenTime;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public Integer getLengthDays() {
        return lengthDays;
    }

    public void setLengthDays(Integer lengthDays) {
        this.lengthDays = lengthDays;
    }

    public Integer getLengthHours() {
        return lengthHours;
    }

    public void setLengthHours(Integer lengthHours) {
        this.lengthHours = lengthHours;
    }

    public Integer getLengthMinutes() {
        return lengthMinutes;
    }

    public void setLengthMinutes(Integer lengthMinutes) {
        this.lengthMinutes = lengthMinutes;
    }

    public String getProblemList() {
        return problemList;
    }

    public void setProblemList(String problemList) {
        this.problemList = problemList;
    }

    public Boolean getNeedFrozen() {
        return needFrozen;
    }

    public void setNeedFrozen(Boolean needFrozen) {
        this.needFrozen = needFrozen;
    }

    public Integer getFrozenLengthMinutes() {
        return frozenLengthMinutes;
    }

    public void setFrozenLengthMinutes(Integer frozenLengthMinutes) {
        this.frozenLengthMinutes = frozenLengthMinutes;
    }

    public Integer getFrozenLengthHours() {
        return frozenLengthHours;
    }

    public void setFrozenLengthHours(Integer frozenLengthHours) {
        this.frozenLengthHours = frozenLengthHours;
    }

    public Integer getFrozenLengthDays() {
        return frozenLengthDays;
    }

    public void setFrozenLengthDays(Integer frozenLengthDays) {
        this.frozenLengthDays = frozenLengthDays;
    }

    public List<UserDto> getUserDtos() {
        return userDtos;
    }

    public void setUserDtos(List<UserDto> userDtos) {
        this.userDtos = userDtos;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Timestamp getStartTime() {
        return startTime;
    }

    public void setStartTime(Timestamp startTime) {
        this.startTime = startTime;
    }

    public Timestamp getEndTime() {
        return endTime;
    }

    public void setEndTime(Timestamp endTime) {
        this.endTime = endTime;
    }

    public Timestamp getCurrentTime() {
        return currentTime;
    }

    public void setCurrentTime(Timestamp currentTime) {
        this.currentTime = currentTime;
    }

    public Long getTimeLeft() {
        return timeLeft;
    }

    public void setTimeLeft(Long timeLeft) {
        this.timeLeft = timeLeft;
    }
}


text:
#include <Core/Algorithms/Visualization/RenderFieldState.h>
#include <Modules/Visualization/ShowMeshBoundingBox.h>
#include <Core/Datatypes/Legacy/Field/Field.h>
#include <Core/Datatypes/Legacy/Field/VField.h>
#include <Core/Datatypes/Legacy/Field/VMesh.h>
#include <Core/GeometryPrimitives/BBox.h>
#include <Core/GeometryPrimitives/Point.h>
#include <Core/GeometryPrimitives/Vector.h>
#include <Graphics/Datatypes/GeometryImpl.h>
#include <Graphics/Glyphs/GlyphGeom.h>

using namespace SCIRun;
using namespace Modules::Visualization;
using namespace Dataflow::Networks;
using namespace Core;
using namespace Core::Algorithms;
using namespace Core::Datatypes;
using namespace Core::Geometry;
using namespace Graphics;
using namespace Graphics::Datatypes;

MODULE_INFO_DEF(ShowMeshBoundingBox, Visualization, SCIRun);

namespace SCIRun {
namespace Modules {
namespace Visualization {
  class ShowMeshBoundingBoxImpl
  {
  public:
    ShowMeshBoundingBoxImpl();
    void setSize(int x, int y, int z);
    void setBBox(const BBox& bbox);
    GeometryHandle makeGeometry(const GeometryIDGenerator& id);
  private:
    RenderState getRenderState();
    void addLineToAxis(GlyphGeom& glyphs, const Point& base, const Vector& axis, const ColorRGB& col);
    void addLinesToAxisEachFace(GlyphGeom& glyphs, const Point& base, const Vector& axis,
                                const Vector& dir1, const Vector& dir2, double offset,
                                const ColorRGB& col);
    void addLinesToAxis(GlyphGeom& glyphs, int count, const Point& base, const Vector& axis,
                        const Vector& dir1, const Vector& dir2, const ColorRGB& col);
    BBox bbox_;
    int x_ = 2;
    int y_ = 2;
    int z_ = 2;
  };
}}}

ShowMeshBoundingBoxImpl::ShowMeshBoundingBoxImpl()
{}

void ShowMeshBoundingBoxImpl::setSize(int x, int y, int z)
{
  x_ = x;
  y_ = y;
  z_ = z;
}

void ShowMeshBoundingBoxImpl::setBBox(const BBox& bbox)
{
  bbox_ = bbox;
}

void ShowMeshBoundingBoxImpl::addLineToAxis(GlyphGeom& glyphs, const Point& base, const Vector& axis,
                                            const ColorRGB& col)
{
  glyphs.addLine(base, base + axis, col, col);
}

void ShowMeshBoundingBoxImpl::addLinesToAxisEachFace(GlyphGeom& glyphs, const Point& base,
                                                     const Vector& axis, const Vector& dir1,
                                                     const Vector& dir2, double offset,
                                                     const ColorRGB& col)
{
  Vector off1 = offset * dir1;
  Vector off2 = offset * dir2;
  addLineToAxis(glyphs, base + off1,        axis, col);
  addLineToAxis(glyphs, base + off1 + dir2, axis, col);
  addLineToAxis(glyphs, base + off2,        axis, col);
  addLineToAxis(glyphs, base + off2 + dir1, axis, col);
}

void ShowMeshBoundingBoxImpl::addLinesToAxis(GlyphGeom& glyphs, int count, const Point& base,
                                             const Vector& axis, const Vector& dir1,
                                             const Vector& dir2, const ColorRGB& col)
{
  if (count == 1)
    addLinesToAxisEachFace(glyphs, base, axis, dir1, dir2, 0.5, col);
  else if (count > 1)
  {
    addLineToAxis(glyphs, base, axis, col);
    addLineToAxis(glyphs, base + dir1, axis, col);
    addLineToAxis(glyphs, base + dir2, axis, col);
    addLineToAxis(glyphs, base + dir1 + dir2, axis, col);

    for (int i = 1; i < count-1; ++i)
    {
      double offset = double(i) / double(count-1);
      addLinesToAxisEachFace(glyphs, base, axis, dir1, dir2, offset, col);
    }
  }
}

RenderState ShowMeshBoundingBoxImpl::getRenderState()
{
  RenderState renState;
  renState.set(RenderState::USE_NORMALS, false);
  renState.set(RenderState::IS_ON, true);
  renState.set(RenderState::USE_TRANSPARENCY, false);
  renState.mGlyphType = RenderState::GlyphType::LINE_GLYPH;
  renState.set(RenderState::USE_DEFAULT_COLOR, false);
  return renState;
}

GeometryHandle ShowMeshBoundingBoxImpl::makeGeometry(const GeometryIDGenerator& idGen)
{
  auto min = bbox_.get_min();
  auto x = Vector(bbox_.x_length(), 0, 0);
  auto y = Vector(0, bbox_.y_length(), 0);
  auto z = Vector(0, 0, bbox_.z_length());

  GlyphGeom glyphs;
  addLinesToAxis(glyphs, x_, min, x, y, z, ColorRGB(1,0,0));
  addLinesToAxis(glyphs, y_, min, y, x, z, ColorRGB(0,1,0));
  addLinesToAxis(glyphs, z_, min, z, x, y, ColorRGB(0,0,1));

  auto geom(boost::make_shared<GeometryObjectSpire>(idGen, "ShowMeshBoundingBox", true));
  glyphs.buildObject(*geom, geom->uniqueID(), false, 1.0, ColorScheme::COLOR_IN_SITU,
                     getRenderState(), SpireIBO::PRIMITIVE::LINES, bbox_, true, nullptr);
  return geom;
}

ShowMeshBoundingBox::ShowMeshBoundingBox() : GeometryGeneratingModule(staticInfo_),
                                             impl_(new ShowMeshBoundingBoxImpl)
{
  INITIALIZE_PORT(InputField);
  INITIALIZE_PORT(OutputGeom);
}

void ShowMeshBoundingBox::setStateDefaults()
{
  auto state = get_state();
  state->setValue(XSize, 2);
  state->setValue(YSize, 2);
  state->setValue(ZSize, 2);
}

void
ShowMeshBoundingBox::execute()
{
  auto input = getRequiredInput(InputField);
  if (needToExecute())
  {
    if (inputsChanged())
      impl_->setBBox(input->vmesh()->get_bounding_box());

    auto state = get_state();
    impl_->setSize(state->getValue(XSize).toInt(), state->getValue(YSize).toInt(),
                   state->getValue(ZSize).toInt());

    sendOutput(OutputGeom, impl_->makeGeometry(*this));
  }
}

const AlgorithmParameterName ShowMeshBoundingBox::XSize("XSize");
const AlgorithmParameterName ShowMeshBoundingBox::YSize("YSize");
const AlgorithmParameterName ShowMeshBoundingBox::ZSize("ZSize");


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.Azure.Test.HttpRecorder;
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.Rest.ClientRuntime.Azure.TestFramework;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.Azure.Management.Synapse.Models;
using Microsoft.Rest.Azure;

namespace Microsoft.Azure.Management.Synapse.Tests
{
    /// <summary>
    /// Test utilities
    /// </summary>
    public static class SynapseManagementTestUtilities
    {
        /// <summary>
        /// Determine whether the current test mode is record mode
        /// </summary>
        /// <returns></returns>
        public static bool IsRecordMode()
        {
            return HttpMockServer.Mode == HttpRecorderMode.Record;
        }

        /// <summary>
        /// Determine whether the current test mode is playback mode
        /// </summary>
        /// <returns></returns>
        public static bool IsPlaybackMode()
        {
            return HttpMockServer.Mode == HttpRecorderMode.Playback;
        }

        /// <summary>
        /// Get current subscription Id from test configurations(Environment variables).
        /// </summary>
        /// <returns></returns>
        public static string GetSubscriptionId()
        {
            string subscriptionId = null;
            if (IsRecordMode())
            {
                var environment = TestEnvironmentFactory.GetTestEnvironment();
                HttpMockServer.Variables[ConnectionStringKeys.SubscriptionIdKey] = environment.SubscriptionId;
                subscriptionId = environment.SubscriptionId;
            }
            else if (IsPlaybackMode())
            {
                subscriptionId = HttpMockServer.Variables[ConnectionStringKeys.SubscriptionIdKey];
            }

            return subscriptionId;
        }

        /// <summary>
        /// Get current tenant Id from test configurations(Environment variables).
        /// </summary>
        /// <returns></returns>
        public static string GetTenantId()
        {
            string tenantId = null;
            if (IsRecordMode())
            {
                var environment = TestEnvironmentFactory.GetTestEnvironment();
                HttpMockServer.Variables[ConnectionStringKeys.AADTenantKey] = environment.Tenant;
                tenantId = environment.Tenant;
            }
            else if (IsPlaybackMode())
            {
                tenantId = HttpMockServer.Variables[ConnectionStringKeys.AADTenantKey];
            }
            return tenantId;
        }

        /// <summary>
        /// Get service principal Id from test configurations(Environment variables).
        /// </summary>
        /// <returns></returns>
        public static string GetServicePrincipalId()
        {
            string servicePrincipalId = null;
            if (HttpMockServer.Mode == HttpRecorderMode.Record)
            {
                var environment = TestEnvironmentFactory.GetTestEnvironment();
                HttpMockServer.Variables[ConnectionStringKeys.ServicePrincipalKey] = environment.ConnectionString.KeyValuePairs.GetValueUsingCaseInsensitiveKey(ConnectionStringKeys.ServicePrincipalKey);
                servicePrincipalId = HttpMockServer.Variables[ConnectionStringKeys.ServicePrincipalKey];
            }
            else if (HttpMockServer.Mode == HttpRecorderMode.Playback)
            {
                servicePrincipalId = HttpMockServer.Variables[ConnectionStringKeys.ServicePrincipalKey];
            }
            return servicePrincipalId;
        }

        /// <summary>
        /// Get service principal secret from test configurations(Environment variables).
        /// </summary>
        /// <returns></returns>
        public static string GetServicePrincipalSecret()
        {
            string servicePrincipalSecret = null;
            if (IsRecordMode())
            {
                var environment = TestEnvironmentFactory.GetTestEnvironment();
                servicePrincipalSecret = environment.ConnectionString.KeyValuePairs.GetValueUsingCaseInsensitiveKey(ConnectionStringKeys.ServicePrincipalSecretKey);
            }
            else if (IsPlaybackMode())
            {
                servicePrincipalSecret = "xyz";
            }
            return servicePrincipalSecret;
        }

        /// <summary>
        /// Get service principal object id from test configurations(Environment variables).
        /// </summary>
        /// <returns></returns>
        public static string GetServicePrincipalObjectId()
        {
            string servicePrincipalObjectId = null;
            if (IsRecordMode())
            {
                var environment = TestEnvironmentFactory.GetTestEnvironment();
                HttpMockServer.Variables[ConnectionStringKeys.AADClientIdKey] = environment.ConnectionString.KeyValuePairs.GetValueUsingCaseInsensitiveKey(ConnectionStringKeys.AADClientIdKey);
                servicePrincipalObjectId = HttpMockServer.Variables[ConnectionStringKeys.AADClientIdKey];
            }
            else if (IsPlaybackMode())
            {
                servicePrincipalObjectId = HttpMockServer.Variables[ConnectionStringKeys.AADClientIdKey];
            }
            return servicePrincipalObjectId;
        }

        /// <summary>
        /// Get access token
        /// </summary>
        /// <param name="authority"></param>
        /// <param name="resource"></param>
        /// <param name="scope"></param>
        /// <returns></returns>
        public static async Task<string> GetAccessToken(string authority, string resource, string scope)
        {
            string accessToken = null;
            if (IsRecordMode())
            {
                var context = new AuthenticationContext(authority, TokenCache.DefaultShared);
                string authClientId = GetServicePrincipalId();
                string authSecret = GetServicePrincipalSecret();
                var clientCredential = new ClientCredential(authClientId, authSecret);
                var result = await context.AcquireTokenAsync(resource, clientCredential).ConfigureAwait(false);
                accessToken = result.AccessToken;
            }
            else if (IsPlaybackMode())
            {
                accessToken = "fake-token";
            }

            return accessToken;
        }

        /// <summary>
        /// Get delegating handlers
        /// </summary>
        /// <returns></returns>
        public static DelegatingHandler[] GetHandlers()
        {
            HttpMockServer server = HttpMockServer.CreateInstance();
            return new DelegatingHandler[] { server };
        }

        /// <summary>
        /// Create workspace create parameters.
        /// </summary>
        /// <param name="commonData"></param>
        /// <returns></returns>
        public static Workspace PrepareWorkspaceCreateParams(this CommonTestFixture commonData)
        {
            return new Workspace
            {
                Location = commonData.Location,
                Identity = new ManagedIdentity
                {
                    Type = ResourceIdentityType.SystemAssigned
                },
                DefaultDataLakeStorage = new DataLakeStorageAccountDetails
                {
                    AccountUrl = commonData.DefaultDataLakeStorageAccountUrl,
                    Filesystem = commonData.DefaultDataLakeStorageFilesystem
                },
                SqlAdministratorLogin = commonData.SshUsername,
                SqlAdministratorLoginPassword = commonData.SshPassword
            };
        }

        /// <summary>
        /// Create sqlpool create parameters.
        /// </summary>
        /// <param name="commonData"></param>
        /// <returns></returns>
        public static SqlPool PrepareSqlpoolCreateParams(this CommonTestFixture commonData)
        {
            return new SqlPool
            {
                Location = commonData.Location,
                Sku = new Sku
                {
                    Name = commonData.PerformanceLevel
                }
            };
        }

        /// <summary>
        /// Create sqlpool create parameters.
        /// </summary>
        /// <param name="commonData"></param>
        /// <returns></returns>
        public static SqlPoolV3 PrepareSqlPoolV3CreateParams(this CommonTestFixture commonData)
        {
            return new SqlPoolV3
            {
                Location = commonData.Location,
                Sku = new SkuV3
                {
                    Name = commonData.PerformanceLevel
                }
            };
        }

        /// <summary>
        /// Create spark create parameters.
        /// </summary>
        /// <param name="commonData"></param>
        /// <param name="enableAutoScale"></param>
        /// <param name="enableAutoPause"></param>
        /// <returns></returns>
        public static BigDataPoolResourceInfo PrepareSparkpoolCreateParams(this CommonTestFixture commonData, bool enableAutoScale, bool enableAutoPause)
        {
            return new BigDataPoolResourceInfo
            {
                Location = commonData.Location,
                NodeCount = enableAutoScale ? (int?)null : commonData.NodeCount,
                NodeSizeFamily = NodeSizeFamily.MemoryOptimized,
                NodeSize = commonData.NodeSize,
                AutoScale = new AutoScaleProperties
                {
                    Enabled = enableAutoScale,
                    MinNodeCount = commonData.AutoScaleMinNodeCount,
                    MaxNodeCount = commonData.AutoScaleMaxNodeCount
                },
                AutoPause = new AutoPauseProperties
                {
                    Enabled = enableAutoPause,
                    DelayInMinutes = commonData.AutoPauseDelayInMinute
                },
                SparkVersion = commonData.SparkVersion
            };
        }

        /// <summary>
        /// Create fire wall rule create parameters.
        /// </summary>
        /// <param name="commonData"></param>
        /// <param name="startIpAddress"></param>
        /// <param name="endIpAddress"></param>
        /// <returns></returns>
        public static IpFirewallRuleInfo PrepareFirewallRuleParams(this CommonTestFixture commonData, string startIpAddress, string endIpAddress)
        {
            return new IpFirewallRuleInfo
            {
                StartIpAddress = startIpAddress,
                EndIpAddress = endIpAddress
            };
        }

        /// <summary>
        /// Create kustopool create parameters.
        /// </summary>
        /// <param name="commonData"></param>
        /// <returns></returns>
        public static KustoPool PrepareKustopoolCreateParams(this CommonTestFixture commonData)
        {
            return new KustoPool
            {
                Location = commonData.Location,
                Sku = commonData.KustoSku
            };
        }

        public static ReadWriteDatabase PrepareKustoDatabaseCreateParams(this CommonTestFixture commonData)
        {
            return new ReadWriteDatabase
            {
                Location = commonData.Location,
                SoftDeletePeriod = commonData.SoftDeletePeriod,
                HotCachePeriod = commonData.HotCachePeriod
            };
        }

        /// <summary>
        /// List resources from IPage to List.
        /// </summary>
        /// <param name="firstPage"></param>
        /// <param name="listNext"></param>
        /// <returns></returns>
        public static List<T> ListResources<T>(IPage<T> firstPage, Func<string, IPage<T>> listNext)
        {
            var resourceList = new List<T>();
            var response = firstPage;
            resourceList.AddRange(response);

            while (!string.IsNullOrEmpty(response.NextPageLink))
            {
                response = listNext(response.NextPageLink);
                resourceList.AddRange(response);
            }

            return resourceList;
        }
    }
}


text:
#include <stdexcept>
#include "metadata/metadata_api.h"
#include "util/util_api.h"

namespace MR4C {

class MetadataFieldImpl {

	friend class MetadataField;

	private :

		Primitive::Type m_type;

		union FieldData {
			bool m_boolean;
			char m_byte;
			int m_int;
			float m_float;
			double m_double;
			long double m_long_double;
			size_t m_size_t;
		} m_val;

		std::string m_string;

		MetadataFieldImpl() {}

		MetadataFieldImpl(const MetadataFieldImpl& field) {
			initFrom(field);
		}

		void initFrom(const MetadataFieldImpl& field) {
			m_type = field.m_type;
			switch ( field.m_type ) {
				case Primitive::BOOLEAN:
					m_val.m_boolean = field.m_val.m_boolean;
					break;
				case Primitive::BYTE:
					m_val.m_byte = field.m_val.m_byte;
					break;
				case Primitive::INTEGER:
					m_val.m_int = field.m_val.m_int;
					break;
				case Primitive::FLOAT:
					m_val.m_float = field.m_val.m_float;
					break;
				case Primitive::DOUBLE:
					m_val.m_double = field.m_val.m_double;
					break;
				case Primitive::LONG_DOUBLE:
					m_val.m_long_double = field.m_val.m_long_double;
					break;
				case Primitive::STRING:
					m_string = field.m_string;
					break;
				case Primitive::SIZE_T:
					m_val.m_size_t = field.m_val.m_size_t;
					break;
				default:
					MR4C_THROW(std::range_error, "unknown primitive type [" << m_type << "]");
			}
		}

		static MetadataFieldImpl* createBoolean(const bool val) {
			MetadataFieldImpl* field = new MetadataFieldImpl();
			field->m_type = Primitive::BOOLEAN;
			field->m_val.m_boolean = val;
			return field;
		}

		static MetadataFieldImpl* createInteger(const int val) {
			MetadataFieldImpl* field = new MetadataFieldImpl();
			field->m_type = Primitive::INTEGER;
			field->m_val.m_int = val;
			return field;
		}

		static MetadataFieldImpl* createByte(const char val) {
			MetadataFieldImpl* field = new MetadataFieldImpl();
			field->m_type = Primitive::BYTE;
			field->m_val.m_byte = val;
			return field;
		}

		static MetadataFieldImpl* createFloat(const float val) {
			MetadataFieldImpl* field = new MetadataFieldImpl();
			field->m_type = Primitive::FLOAT;
			field->m_val.m_float = val;
			return field;
		}

		static MetadataFieldImpl* createDouble(const double val) {
			MetadataFieldImpl* field = new MetadataFieldImpl();
			field->m_type = Primitive::DOUBLE;
			field->m_val.m_double = val;
			return field;
		}

		static MetadataFieldImpl* createLongDouble(const long double val) {
			MetadataFieldImpl* field = new MetadataFieldImpl();
			field->m_type = Primitive::LONG_DOUBLE;
			field->m_val.m_long_double = val;
			return field;
		}

		static MetadataFieldImpl* createString(const char* val) {
			return createString(std::string(val));
		}

		static MetadataFieldImpl* createString(const std::string& val) {
			MetadataFieldImpl* field = new MetadataFieldImpl();
			field->m_type = Primitive::STRING;
			field->m_string = val;
			return field;
		}

		static MetadataFieldImpl* createSize_t(const size_t val) {
			MetadataFieldImpl* field = new MetadataFieldImpl();
			field->m_type = Primitive::SIZE_T;
			field->m_val.m_size_t = val;
			return field;
		}

		bool getBooleanValue() const {
			assertType(Primitive::BOOLEAN);
			return m_val.m_boolean;
		}

		char getByteValue() const {
			assertType(Primitive::BYTE);
			return m_val.m_byte;
		}

		int getIntegerValue() const {
			assertType(Primitive::INTEGER);
			return m_val.m_int;
		}

		float getFloatValue() const {
			assertType(Primitive::FLOAT);
			return m_val.m_float;
		}

		double getDoubleValue() const {
			assertType(Primitive::DOUBLE);
			return m_val.m_double;
		}

		long double getLongDoubleValue() const {
			assertType(Primitive::LONG_DOUBLE);
			return m_val.m_long_double;
		}

		std::string getStringValue() const {
			assertType(Primitive::STRING);
			return m_string;
		}

		size_t getSize_tValue() const {
			assertType(Primitive::SIZE_T);
			return m_val.m_size_t;
		}

		Primitive::Type getPrimitiveType() const {
			return m_type;
		}

		bool operator==(const MetadataFieldImpl& field) const {
			if ( m_type!=field.m_type ) return false;
			switch ( m_type ) {
				case Primitive::BOOLEAN:
					return m_val.m_boolean==field.m_val.m_boolean;
				case Primitive::BYTE:
					return m_val.m_byte==field.m_val.m_byte;
				case Primitive::INTEGER:
					return m_val.m_int==field.m_val.m_int;
				case Primitive::FLOAT:
					return m_val.m_float==field.m_val.m_float;
				case Primitive::DOUBLE:
					return m_val.m_double==field.m_val.m_double;
				case Primitive::LONG_DOUBLE:
					return m_val.m_long_double==field.m_val.m_long_double;
				case Primitive::STRING:
					return m_string==field.m_string;
				case Primitive::SIZE_T:
					return m_val.m_size_t==field.m_val.m_size_t;
				default:
					MR4C_THROW(std::range_error, "unknown primitive type [" << m_type << "]");
			}
		}

		void assertType(Primitive::Type type) const {
			if ( m_type!=type ) {
				MR4C_THROW(std::logic_error, "Requested type [" << Primitive::enumToString(type) << "] from field of type [" << Primitive::enumToString(m_type) << "]");
			}
		}

		static MetadataFieldImpl* parseField(const std::string& str, Primitive::Type type) {
			switch ( type ) {
				case Primitive::BOOLEAN:
					return parseBoolean(str);
				case Primitive::BYTE:
					return parseByte(str);
				case Primitive::INTEGER:
					return parseInteger(str);
				case Primitive::FLOAT:
					return parseFloat(str);
				case Primitive::DOUBLE:
					return parseDouble(str);
				case Primitive::LONG_DOUBLE:
					return parseLongDouble(str);
				case Primitive::STRING:
					return parseString(str);
				case Primitive::SIZE_T:
					return parseSize_t(str);
				default:
					MR4C_THROW(std::range_error, "unknown primitive type [" << type << "]");
			}
		}

		static MetadataFieldImpl* parseBoolean(const std::string& str) {
			bool val = Primitive::fromString<bool>(str);
			return createBoolean(val);
		}

		static MetadataFieldImpl* parseByte(const std::string& str) {
			char val = Primitive::fromString<char>(str);
			return createByte(val);
		}

		static MetadataFieldImpl* parseInteger(const std::string& str) {
			int val = Primitive::fromString<int>(str);
			return createInteger(val);
		}

		static MetadataFieldImpl* parseFloat(const std::string& str) {
			float val = Primitive::fromString<float>(str);
			return createFloat(val);
		}

		static MetadataFieldImpl* parseDouble(const std::string& str) {
			double val = Primitive::fromString<double>(str);
			return createDouble(val);
		}

		static MetadataFieldImpl* parseLongDouble(const std::string& str) {
			long double val = Primitive::fromString<long double>(str);
			return createLongDouble(val);
		}

		static MetadataFieldImpl* parseString(const std::string& str) {
			return createString(str);
		}

		static MetadataFieldImpl* parseSize_t(const std::string& str) {
			size_t val = Primitive::fromString<size_t>(str);
			return createSize_t(val);
		}

		std::string toString() const {
			switch ( m_type ) {
				case Primitive::BOOLEAN:
					return Primitive::toString<bool>(m_val.m_boolean);
				case Primitive::BYTE:
					return Primitive::toString<char>(m_val.m_byte);
				case Primitive::INTEGER:
					return Primitive::toString<int>(m_val.m_int);
				case Primitive::FLOAT:
					return Primitive::toString<float>(m_val.m_float);
				case Primitive::DOUBLE:
					return Primitive::toString<double>(m_val.m_double);
				case Primitive::LONG_DOUBLE:
					return Primitive::toString<long double>(m_val.m_long_double);
				case Primitive::STRING:
					return m_string;
				case Primitive::SIZE_T:
					return Primitive::toString<size_t>(m_val.m_size_t);
				default:
					MR4C_THROW(std::range_error, "unknown primitive type [" << m_type << "]");
			}
		}

		std::string str() {
			MR4C_RETURN_STRING("type = " << Primitive::enumToString(m_type) << "; value = " << toString());
		}

};

MetadataField::MetadataField() {
	m_impl = new MetadataFieldImpl();
}

MetadataField::MetadataField(const MetadataField& field) {
	m_impl = new MetadataFieldImpl(*field.m_impl);
}

MetadataField MetadataField::createBoolean(const bool val) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::createBoolean(val);
	return field;
}

MetadataField MetadataField::createInteger(const int val) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::createInteger(val);
	return field;
}

MetadataField MetadataField::createByte(const char val) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::createByte(val);
	return field;
}

MetadataField MetadataField::createFloat(const float val) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::createFloat(val);
	return field;
}

MetadataField MetadataField::createDouble(const double val) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::createDouble(val);
	return field;
}

MetadataField MetadataField::createLongDouble(const long double val) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::createLongDouble(val);
	return field;
}

MetadataField MetadataField::createString(const char* val) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::createString(val);
	return field;
}

MetadataField MetadataField::createString(const std::string& val) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::createString(val);
	return field;
}

MetadataField MetadataField::createSize_t(const size_t val) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::createSize_t(val);
	return field;
}

bool MetadataField::getBooleanValue() const {
	return m_impl->getBooleanValue();
}

char MetadataField::getByteValue() const {
	return m_impl->getByteValue();
}

int MetadataField::getIntegerValue() const {
	return m_impl->getIntegerValue();
}

float MetadataField::getFloatValue() const {
	return m_impl->getFloatValue();
}

double MetadataField::getDoubleValue() const {
	return m_impl->getDoubleValue();
}

long double MetadataField::getLongDoubleValue() const {
	return m_impl->getLongDoubleValue();
}

std::string MetadataField::getStringValue() const {
	return m_impl->getStringValue();
}

size_t MetadataField::getSize_tValue() const {
	return m_impl->getSize_tValue();
}

Primitive::Type MetadataField::getPrimitiveType() const {
	return m_impl->getPrimitiveType();
}

MetadataElement::Type MetadataField::getMetadataElementType() const {
	return MetadataElement::FIELD;
}

CloneableMetadataElement* MetadataField::clone() const {
	return new MetadataField(*this);
}

MetadataField& MetadataField::operator=(const MetadataField& field) {
	m_impl->initFrom(*field.m_impl);
	return *this;
}

bool MetadataField::operator==(const MetadataField& field) const {
	return *m_impl==*field.m_impl;
}

bool MetadataField::operator==(const MetadataElement& element) const {
	if ( element.getMetadataElementType()!=MetadataElement::FIELD) {
		return false;
	}
	const MetadataField& field = castToField(element);
	return operator==(field);
}

bool MetadataField::operator!=(const MetadataField& field) const {
	return !operator==(field);
}

bool MetadataField::operator!=(const MetadataElement& element) const {
	return !operator==(element);
}

std::string MetadataField::str() {
	return m_impl->str();
}

MetadataField::~MetadataField() {
	delete m_impl;
}

MetadataField MetadataField::parseField(const std::string& str, Primitive::Type type) {
	MetadataField field;
	delete field.m_impl;
	field.m_impl = MetadataFieldImpl::parseField(str, type);
	return field;
}

std::string MetadataField::toString() const {
	return m_impl->toString();
}

MetadataField* MetadataField::castToField(MetadataElement* element) {
	return MetadataElement::castElement<MetadataField>(element, MetadataElement::FIELD);
}

const MetadataField* MetadataField::castToField(const MetadataElement* element) {
	return MetadataElement::castElement<MetadataField>(element, MetadataElement::FIELD);
}

MetadataField& MetadataField::castToField(MetadataElement& element) {
	return MetadataElement::castElement<MetadataField>(element, MetadataElement::FIELD);
}

const MetadataField& MetadataField::castToField(const MetadataElement& element) {
	return MetadataElement::castElement<MetadataField>(element, MetadataElement::FIELD);
}

}


text:
package com.SentimentAnalysis;
/**
 * The class represents a sentence of a document
 */
public class Sentence {
    private String idSentnece;
    private String text;

    public void setIdSentnece(String idSentnece) {
        this.idSentnece = idSentnece;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getIdSentnece() {
        return idSentnece;
    }

    public String getText() {
        return text;
    }

    @Override
    public String toString() {
        return "Sentence{" + "idSentnece=" + idSentnece + ", text=" + text + '}';
    }

}


text:
@interface PodsDummy_Pods_kkUITests : NSObject
@end
@implementation PodsDummy_Pods_kkUITests
@end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/white"
    android:orientation="horizontal">
    <!--在线咨询-->
    <LinearLayout
        android:id="@+id/contact_customer_service_layout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="@color/lightgrey"
        android:layout_centerVertical="true"
        android:padding="5dp"
        android:layout_weight="1">
        <ImageView
            android:layout_width="25dp"
            android:layout_height="25dp"
            android:background="@drawable/contact"
            android:layout_gravity="center_horizontal" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:text="咨询"
            android:textSize="10sp"
            android:textColor="@color/grey" />
    </LinearLayout>
    <!--收藏-->
    <LinearLayout
        android:id="@+id/add_collection_layout"
        android:background="@color/lightgrey"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:layout_centerVertical="true"
        android:padding="5dp"
        android:layout_weight="1">
        <ImageView
            android:layout_width="25dp"
            android:layout_height="25dp"
            android:background="@drawable/love"
            android:layout_gravity="center_horizontal" />
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:textSize="10sp"
            android:text="收藏"
            android:textColor="@color/grey" />
    </LinearLayout>
    <!--添加至购物车-->
    <LinearLayout
        android:id="@+id/add_shopping_cart_layout"
        android:gravity="center"
        android:layout_width="0dp"
        android:layout_weight="3"
        android:background="@color/white"
        android:layout_height="match_parent"
        android:layout_centerVertical="true">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="加入购物车"
            android:textColor="@color/main_color"/>
    </LinearLayout>
    <!--立即购买-->
    <LinearLayout
        android:id="@+id/purchase_now_layout"
        android:gravity="center"
        android:layout_width="0dp"
        android:layout_weight="3"
        android:background="@color/main_color"
        android:layout_height="match_parent"
        android:layout_centerVertical="true">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="立即购买"
            android:textColor="@color/white"/>
    </LinearLayout>
</LinearLayout>


text:
namespace Microsoft.Azure.Management.MixedReality.Models
{
    using Microsoft.Rest;
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Response on Error
    /// </summary>
    public partial class ErrorResponse
    {
        /// <summary>
        /// Initializes a new instance of the ErrorResponse class.
        /// </summary>
        public ErrorResponse()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the ErrorResponse class.
        /// </summary>
        /// <param name="message">Describes the error in detail and provides
        /// debugging information</param>
        /// <param name="code">String that can be used to programmatically
        /// identify the error.</param>
        /// <param name="target">The target of the particular error</param>
        /// <param name="details">An array of JSON objects that MUST contain
        /// name/value pairs for code and message, and MAY contain a name/value
        /// pair for target, as described above.The contents of this section
        /// are service-defined but must adhere to the aforementioned
        /// schema.</param>
        public ErrorResponse(string message, string code, string target = default(string), string details = default(string))
        {
            Message = message;
            Code = code;
            Target = target;
            Details = details;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets describes the error in detail and provides debugging
        /// information
        /// </summary>
        [JsonProperty(PropertyName = "message")]
        public string Message { get; set; }

        /// <summary>
        /// Gets or sets string that can be used to programmatically identify
        /// the error.
        /// </summary>
        [JsonProperty(PropertyName = "code")]
        public string Code { get; set; }

        /// <summary>
        /// Gets or sets the target of the particular error
        /// </summary>
        [JsonProperty(PropertyName = "target")]
        public string Target { get; set; }

        /// <summary>
        /// Gets or sets an array of JSON objects that MUST contain name/value
        /// pairs for code and message, and MAY contain a name/value pair for
        /// target, as described above.The contents of this section are
        /// service-defined but must adhere to the aforementioned schema.
        /// </summary>
        [JsonProperty(PropertyName = "details")]
        public string Details { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (Message == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Message");
            }
            if (Code == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "Code");
            }
        }
    }
}


text:
package main

import (
	"os"
	"strings"
)

var (
	debugNet = strings.Contains(os.Getenv("STTRACE"), "net") || os.Getenv("STTRACE") == "all"
)


text:
<?xml version="1.0"?>
<project name="Start Rio UI" default="rio-ui" basedir="">
    <dirname file="${basedir}/.." property="sorcer.basedir"/>
    <import file="${sorcer.basedir}/bin/common-run.xml" />

    <target name="rio-ui" description="Starts the Rio UI">
        <java classname="org.rioproject.tools.ui.Main" fork="yes">
        	<classpath>
        	    <pathelement location="${rio.home}/lib/rio-ui-${rio.version}.jar" />
                <pathelement location="${sorcer.lib}/sorcer-platform-${sorcer.version}.jar" />
                <pathelement location="${sorcer.lib}/sorcer-resolving-loader-${sorcer.version}.jar" />
        	</classpath>
            <env key="SORCER_HOME" value="${sorcer.home}"/>
            <sysproperty key="java.rmi.server.useCodebaseOnly" value="false" />
            <sysproperty key="java.security.policy" value="${rio.home}/policy/policy.all" />
            <sysproperty key="java.protocol.handler.pkgs" value="net.jini.url|sorcer.util.url|org.rioproject.url" />
            <sysproperty key="java.rmi.server.RMIClassLoaderSpi" value="sorcer.rio.rmi.SorcerResolvingLoader" />
            <sysproperty key="rio.home" value="${rio.home}"/>
            <sysproperty key="java.rmi.server.useCodebaseOnly" value="false" />
        </java>
    </target>

    <target name="spawn" description="Starts the Rio UI">
        <java classname="org.rioproject.tools.ui.Main" fork="yes" spawn="yes">
        	<classpath>
        	    <pathelement location="${rio.home}/lib/rio-ui-${rio.version}.jar" />
                <pathelement location="${sorcer.lib}/sorcer-platform-${sorcer.version}.jar" />
                <pathelement location="${sorcer.lib}/sorcer-resolving-loader-${sorcer.version}.jar" />
        	</classpath>
            <env key="SORCER_HOME" value="${sorcer.home}"/>
            <sysproperty key="java.rmi.server.useCodebaseOnly" value="false" />
            <sysproperty key="java.security.policy" value="${rio.home}/policy/policy.all" />
            <sysproperty key="java.protocol.handler.pkgs" value="net.jini.url|sorcer.util.url|org.rioproject.url" />
            <sysproperty key="rio.home" value="${rio.home}"/>
            <sysproperty key="java.rmi.server.useCodebaseOnly" value="false" />
        </java>
    </target>

</project>


text:
import { Component, OnInit, AfterViewInit, Input } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { PackageCreationDataService } from '../../services/data/package-creation.data.service';
import { TreeNode, FileType, TreeNodeParams } from '../fix-tree-folder/tree-node.model';
import { OS, findIconContainer } from '../../models/domain/container.model';
import { IPackageConfig } from '../../models/domain/package-config.model';

declare let jQuery: any;

enum ConfigType {
  YAML = 'YAML',
  FORM = 'FORM'
}

/**
 * This class represents the lazy loaded PackageDetailsComponent.
 */
@Component({
  moduleId: module.id,
  selector: 'fix-package-details',
  templateUrl: 'package-details.component.html',
  styleUrls: ['package-details.component.css']
})
export class PackageDetailsComponent implements OnInit {

  dir: TreeNode;
  data: string;

  @Input()
  packageConfig: Observable<IPackageConfig>;

  configType: ConfigType;

  constructor() {
    this.intitializeFilesTree();
  }

  ngOnInit() {
    //this.packageConfig = this.packageConfigDataService.config;
    //console.log(this.packageConfig);
    this.configType = ConfigType.FORM;
  }

  onChangeConfigType(type: any) {
    this.configType = type;
  }

  intitializeFilesTree() {
    const treeNodeParam: TreeNodeParams = {
      name: 'photos',
      type: FileType.dir,
      children: [
        {
          name: 'summer',
          type: FileType.dir,
          focus: true,
          children: [
            {
              name: 'june',
              type: FileType.dir,
              children: [
                { name: 'abc.jpg', type: FileType.file },
                { name: 'def.jpg', type: FileType.file },
                { name: 'test.jpg', type: FileType.file },
                { name: 'test2.jpg', type: FileType.file, edit: true },
                { name: 'zzzz.jpg', type: FileType.file },
              ]
            }
          ]
        },
        { name: 'global.jpg', type: FileType.file }
      ]
    };

    this.dir = new TreeNode(treeNodeParam);
  }

  updateData(node: TreeNode) {
    console.log(node);
    this.data = node.stringify();
  }
  editData(node: TreeNode) {
    console.log(node);
    this.data = node.stringify();
  }
  deleteData(node: TreeNode) {
    console.log(node);
    this.data = node.stringify();
  }

  getContainerIcon(os: OS): string {
    return findIconContainer(os);
  }

}


text:
package org.polygonize.ats.operators;

import org.polygonize.ats.core.operator.AtsOperatorMetadata;
import org.polygonize.ats.core.operator.AtsProceduralTexture;
import org.polygonize.ats.core.operator.AtsProcessOperator;
import org.polygonize.ats.util.AtsPropertyContainer;
import org.polygonize.ats.util.PropertyContainer;

@AtsOperatorMetadata(operatorDesignation = "tile", author = "Johannes Diemke", version = "1.0", description = "This operator generates a XOR texture.", date = "2008-08-08", sourceOfSupply = "http://informatik.uni-oldenburg.de/~trigger")

public class AtsTileOperator extends AtsProcessOperator {

    public void edit(AtsPropertyContainer container) {
    }

    public void edit(PropertyContainer propertyContainer) {
    }

    public boolean isInputAccepted() {
        return inputs_.size() == 1;
    }

    public void process() {
        AtsProceduralTexture source = inputs_.get(0).getTexture();

        for (int y = 0; y < 256; y++)
            for (int x = 0; x < 256; x++) {
                int filteredTexel = source.getBilinearFilteredPixel(x * 2 - 0.5f, y * 2 - 0.5f);
                texture_.setPixel(x, y, filteredTexel);
            }
    }

}