text:
package org.ofbiz.content.webapp.ftl;

import java.io.IOException;
import java.io.Writer;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilDateTime;
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.template.FreeMarkerWorker;
import org.ofbiz.content.content.ContentWorker;
import org.ofbiz.entity.Delegator;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.webapp.website.WebSiteWorker;

import freemarker.core.Environment;
import freemarker.template.TemplateTransformModel;

/**
 * RenderSubContentTransform - Freemarker Transform for Content rendering
 * This transform cannot be called recursively (at this time).
 */
public class RenderSubContentTransform implements TemplateTransformModel {

    private static final Debug.OfbizLogger module = Debug.getOfbizLogger(java.lang.invoke.MethodHandles.lookup().lookupClass());

    /**
     * @deprecated use FreeMarkerWorker.getArg()
     *
Does a conditional search to return a value for a parameter with the passed name. Looks first to see if it was passed as an argument to the transform.
     * Secondly, it looks to see if it is passed as a parameter in the template context object.

     *
Note that this is different from the getArg method of EditRenderDataResourceTransform, which checks the request object instead of the template context
     * object.

     */
    @Deprecated
    public static String getArg(Map<String, Object> args, String key, Environment env) {
        return FreeMarkerWorker.getArg(args, key, env);
    }

    /**
     * @deprecated use FreeMarkerWorker.getArg()
     */
    @Deprecated
    public static String getArg(Map<String, Object> args, String key, Map<String, Object> ctx) {
        return FreeMarkerWorker.getArg(args, key, ctx);
    }

    @SuppressWarnings("unchecked")
    public Writer getWriter(final Writer out, @SuppressWarnings("rawtypes") Map args) {
        final Environment env = FreeMarkerWorker.getCurrentEnvironment();
        Map<String, Object> ctx = FreeMarkerWorker.getWrappedObject("context", env);
        if (ctx == null) {
            ctx = new HashMap<String, Object>();
        }
        final String mapKey = FreeMarkerWorker.getArg(args, "mapKey", ctx);
        final String subContentId = FreeMarkerWorker.getArg(args, "subContentId", ctx);
        final String contentId = FreeMarkerWorker.getArg(args, "contentId", ctx);
        final String mimeTypeId = FreeMarkerWorker.getArg(args, "mimeTypeId", ctx);
        final String throwExceptionOnError = FreeMarkerWorker.getArg(args, "throwExceptionOnError", ctx);
        final Locale locale = FreeMarkerWorker.getWrappedObject("locale", env);
        final HttpServletRequest request = FreeMarkerWorker.getWrappedObject("request", env);
        final LocalDispatcher dispatcher = FreeMarkerWorker.getWrappedObject("dispatcher", env);
        final Delegator delegator = FreeMarkerWorker.getWrappedObject("delegator", env);
        final GenericValue userLogin = FreeMarkerWorker.getWrappedObject("userLogin", env);
        GenericValue subContentDataResourceViewTemp = FreeMarkerWorker.getWrappedObject("subContentDataResourceView", env);
        if (subContentDataResourceViewTemp == null) {
            List<String> assocTypes = UtilMisc.toList("SUB_CONTENT");
            Timestamp fromDate = UtilDateTime.nowTimestamp();
            try {
                subContentDataResourceViewTemp = ContentWorker.getSubContent(delegator, contentId, mapKey, subContentId, userLogin, assocTypes, fromDate);
            } catch (IOException e) {
                throw new RuntimeException(e.getMessage());
            }
        }

        final GenericValue subContentDataResourceView = subContentDataResourceViewTemp;

        final Map<String, Object> templateContext = ctx;

        return new Writer(out) {

            @Override
            public void write(char cbuf[], int off, int len) {
            }

            @Override
            public void flush() throws IOException {
                out.flush();
            }

            @Override
            public void close() throws IOException {
                try {
                    renderSubContent();
                } catch (IOException e) {
                    if (!"false".equals(throwExceptionOnError)) {
                        throw new IOException(e.getMessage());
                    }
                }
            }

            public void renderSubContent() throws IOException {
                ServletContext servletContext = request.getServletContext(); // SCIPIO: NOTE: no longer need getSession() for getServletContext(), since servlet API 3.0
                String rootDir = servletContext.getRealPath("/");
                String webSiteId = WebSiteWorker.getWebSiteId(request);
                String https = (String) servletContext.getAttribute("https");
                templateContext.put("webSiteId", webSiteId);
                templateContext.put("https", https);
                templateContext.put("rootDir", rootDir);

                Map<String, Object> templateRoot = FreeMarkerWorker.createEnvironmentMap(env);

                templateRoot.put("context", templateContext);
                if (subContentDataResourceView != null) {
                }
                try {
                    if (subContentId != null) {
                        ContentWorker.renderContentAsText(dispatcher, delegator, subContentId, out, templateRoot, locale, mimeTypeId, null, null, false);
                    } else {
                        ContentWorker.renderSubContentAsText(dispatcher, delegator, contentId, out, mapKey, templateRoot, locale, mimeTypeId, false);
                    }
                } catch (GeneralException e) {
                    Debug.logError(e, "Error rendering content", module);
                    throw new IOException("Error rendering content" + e.toString());
                }
                templateContext.put("mapKey", null);
                templateContext.put("subContentId", null);
                templateContext.put("subDataResourceTypeId", null);
                templateContext.put("contentId", contentId);
                templateContext.put("mimeTypeId", null);
                templateContext.put("locale", locale);
            }
        };
    }
}


text:
from musicdb.utils.test import TestCase

from .models import Artist

class SmokeTests(TestCase):
    def setUp(self):
        super(SmokeTests, self).setUp()

        self.artist = Artist.objects.create(
            name="Test artist",
            slug='test-artist',
        )

        self.album = self.artist.albums.create(
            title="Test album",
            slug='test-album',
        )

        self.cd = self.album.cds.create(num=1)

    def test_view(self):
        self.assertHTTP302('albums:view')
        self.assertHTTP200('albums:view', 'a')

    def test_artist(self):
        self.assertHTTP200(self.artist.get_absolute_url())

    def test_album(self):
        self.assertHTTP200(self.album.get_absolute_url())

    def test_play_album(self):
        self.assertHTTP200('albums:play-album', self.album.pk)

    def test_play_cd(self):
        self.assertHTTP200('albums:play-cd', self.album.pk, self.cd.pk)

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width">

        <title>Serenata</title>

	<link href="css/video.css" rel="stylesheet">

      <audio controls="controls" src="audio/IB_NSK_Serenata.mp3">
      </audio>

Serenata

Audio File. Sound on Ipad. 6'54". 2017

A suitcase sings a Serenata to its owner. The song adresses the following questions, posed by the artist group IRWIN:
What do you want to take with you from European heritage (as you understand it) to help build a new and better world?
What do you want to forget or delete from European heritage (as you understand it) to avoid repeating mistakes of the past?
What do you want to take with you from the heritage of your own country (as you understand it) to help build a new and better world?
What do you want to forget or delete from the heritage of your own country (as you understand it) to avoid repeating mistakes of the past?
Commissioned by NSK Pavilion, 57th Venice Biennale


text:
package extensions

import (
	"strconv"
	"testing"

	base "github.com/rackspace/gophercloud/acceptance/openstack/networking/v2"
	"github.com/rackspace/gophercloud/openstack/networking/v2/networks"
	"github.com/rackspace/gophercloud/pagination"
	th "github.com/rackspace/gophercloud/testhelper"
)

func TestNetworkCRUDOperations(t *testing.T) {
	base.Setup(t)
	defer base.Teardown()

	// Create a network
	n, err := networks.Create(base.Client, networks.CreateOpts{Name: "sample_network", AdminStateUp: networks.Up}).Extract()
	th.AssertNoErr(t, err)
	th.AssertEquals(t, n.Name, "sample_network")
	th.AssertEquals(t, n.AdminStateUp, true)
	networkID := n.ID

	// List networks
	pager := networks.List(base.Client, networks.ListOpts{Limit: 2})
	err = pager.EachPage(func(page pagination.Page) (bool, error) {
		t.Logf("--- Page ---")

		networkList, err := networks.ExtractNetworks(page)
		th.AssertNoErr(t, err)

		for _, n := range networkList {
			t.Logf("Network: ID [%s] Name [%s] Status [%s] Is shared? [%s]",
				n.ID, n.Name, n.Status, strconv.FormatBool(n.Shared))
		}

		return true, nil
	})
	th.CheckNoErr(t, err)

	// Get a network
	if networkID == "" {
		t.Fatalf("In order to retrieve a network, the NetworkID must be set")
	}
	n, err = networks.Get(base.Client, networkID).Extract()
	th.AssertNoErr(t, err)
	th.AssertEquals(t, n.Status, "ACTIVE")
	th.AssertDeepEquals(t, n.Subnets, []string{})
	th.AssertEquals(t, n.Name, "sample_network")
	th.AssertEquals(t, n.AdminStateUp, true)
	th.AssertEquals(t, n.Shared, false)
	th.AssertEquals(t, n.ID, networkID)

	// Update network
	n, err = networks.Update(base.Client, networkID, networks.UpdateOpts{Name: "new_network_name"}).Extract()
	th.AssertNoErr(t, err)
	th.AssertEquals(t, n.Name, "new_network_name")

	// Delete network
	res := networks.Delete(base.Client, networkID)
	th.AssertNoErr(t, res.Err)
}

func TestCreateMultipleNetworks(t *testing.T) {
	//networks.CreateMany()
}


text:
from django.contrib.messages.tests.cookie import CookieTest
from django.contrib.messages.tests.fallback import FallbackTest
from django.contrib.messages.tests.middleware import MiddlewareTest
from django.contrib.messages.tests.session import SessionTest
from django.contrib.messages.tests.user_messages import \
                                           UserMessagesTest, LegacyFallbackTest


text:
using System.Linq;
using FluentNHibernate.Testing.DomainModel.Mapping;
using NUnit.Framework;

namespace FluentNHibernate.Testing.FluentInterfaceTests
{
    [TestFixture]
    public class CompositeIdMutablePropertyModelGenerationTests : BaseModelFixture
    {
        [Test]
        public void AccessShouldSetModelAccessPropertyToValue()
        {
            CompositeId<IdentityTarget>()
                .Mapping(m => m.Access.Field())
                .ModelShouldMatch(x => x.Access.ShouldEqual("field"));
        }

        [Test]
        public void WithKeyPropertyShouldAddToModelKeyPropertiesCollection()
        {
            CompositeId<IdentityTarget>()
                .Mapping(m => m.KeyProperty(x => x.IntId))
                .ModelShouldMatch(x => x.Keys.Count().ShouldEqual(1));
        }

        [Test]
        public void WithKeyReferenceShouldAddToModelKeyManyToOnesCollection()
        {
            CompositeId<IdentityTarget>()
                .Mapping(m => m.KeyReference(x => x.IntId))
                .ModelShouldMatch(x => x.Keys.Count().ShouldEqual(1));
        }

        [Test]
        public void MappedShouldSetModelMappedToTrue()
        {
            CompositeId<IdentityTarget>()
                .Mapping(m => m.Mapped())
                .ModelShouldMatch(x => x.Mapped.ShouldBeTrue());
        }

        [Test]
        public void NotMappedShouldSetModelMappedToFalse()
        {
            CompositeId<IdentityTarget>()
                .Mapping(m => m.Not.Mapped())
                .ModelShouldMatch(x => x.Mapped.ShouldBeFalse());
        }

        [Test]
        public void UnsavedValueShouldSetModelUnsavedValueToValue()
        {
            CompositeId<IdentityTarget>()
                .Mapping(m => m.UnsavedValue("unsaved"))
                .ModelShouldMatch(x => x.UnsavedValue.ShouldEqual("unsaved"));
        }

        [Test, Ignore]
        public void ShouldAllowSeparateClassRepresentingCompositeId()
        {
            Assert.Fail();
        }
    }
}


text:
/** PURE_IMPORTS_START .._.._Observable,.._.._observable_forkJoin PURE_IMPORTS_END */
import { Observable } from '../../Observable';
import { forkJoin as staticForkJoin } from '../../observable/forkJoin';
Observable.forkJoin = staticForkJoin;
//# sourceMappingURL=forkJoin.js.map


text:
using System;

namespace Dungeon.Core.Entities
{
    public interface IEntity
    {
        /// <summary>
        /// Gets or sets the identifier of the entity.
        /// </summary>
        /// <value>
        /// The identifier of the entity.
        /// </value>
        Guid Id { get; set; }
        /// <summary>
        /// Gets or sets the name of the entity.
        /// </summary>
        /// <value>
        /// The name of the entity.
        /// </value>
        string Name { get; set; }
        /// <summary>
        /// Gets or sets the armor class of the entity.
        /// </summary>
        /// <value>
        /// The armor class of the entity.
        /// </value>
        int ArmorClass { get; set; }

        /// <summary>
        /// Gets or sets the hit points of the entity.
        /// </summary>
        /// <value>
        /// The hit points of the entity.
        /// </value>
        int HitPoints { get; set; }
    }
}


text:
namespace ArchiveStation
{
    partial class FormBorrowBackList
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
            this.panel1 = new System.Windows.Forms.Panel();
            this.txtKey = new UILibrary.TCTextBox();
            this.btnQuery = new UILibrary.SkinButtom();
            this.panel2 = new System.Windows.Forms.Panel();
            this.pageControl1 = new ArchiveStation.PageControl();
            this.dataGridView1 = new System.Windows.Forms.DataGridView();
            this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();
            this.boxid = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.title = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.number = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.manager = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.statusname = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.borrowername = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.idcard = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.boxnumber = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.department = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.createtimestring = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.position = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.boxname = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.rfid = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.panelLoading.SuspendLayout();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
            this.SuspendLayout();
            //
            // panel1
            //
            this.panel1.Controls.Add(this.txtKey);
            this.panel1.Controls.Add(this.btnQuery);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(3, 30);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(1003, 100);
            this.panel1.TabIndex = 11;
            //
            // txtKey
            //
            this.txtKey.BackColor = System.Drawing.Color.Transparent;
            this.txtKey.Cursor = System.Windows.Forms.Cursors.IBeam;
            this.txtKey.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.txtKey.Location = new System.Drawing.Point(127, 36);
            this.txtKey.Margin = new System.Windows.Forms.Padding(0);
            this.txtKey.MinimumSize = new System.Drawing.Size(0, 28);
            this.txtKey.MouseHoverImage = null;
            this.txtKey.MouseNormalImage = null;
            this.txtKey.Name = "txtKey";
            this.txtKey.Padding = new System.Windows.Forms.Padding(5);
            this.txtKey.PasswordChar = '\0';
            this.txtKey.ReadOnly = false;
            this.txtKey.Size = new System.Drawing.Size(478, 32);
            this.txtKey.TabIndex = 16;
            this.txtKey.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
            this.txtKey.WaterColor = System.Drawing.Color.DarkGray;
            this.txtKey.WaterText = "请输入查询条件";
            this.txtKey.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtKey_KeyDown);
            //
            // btnQuery
            //
            this.btnQuery.BackColor = System.Drawing.Color.Transparent;
            this.btnQuery.ControlState = UILibrary.ControlState.Normal;
            this.btnQuery.DialogResult = System.Windows.Forms.DialogResult.OK;
            this.btnQuery.DownBack = null;
            this.btnQuery.ForeColor = System.Drawing.Color.White;
            this.btnQuery.Location = new System.Drawing.Point(649, 35);
            this.btnQuery.MouseBack = null;
            this.btnQuery.Name = "btnQuery";
            this.btnQuery.NormlBack = null;
            this.btnQuery.Size = new System.Drawing.Size(81, 34);
            this.btnQuery.TabIndex = 15;
            this.btnQuery.Text = "查询";
            this.btnQuery.UseVisualStyleBackColor = false;
            this.btnQuery.Click += new System.EventHandler(this.btnQuery_Click);
            //
            // panel2
            //
            this.panel2.Controls.Add(this.pageControl1);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel2.Location = new System.Drawing.Point(3, 465);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(1003, 50);
            this.panel2.TabIndex = 12;
            //
            // pageControl1
            //
            this.pageControl1.Location = new System.Drawing.Point(127, 3);
            this.pageControl1.Name = "pageControl1";
            this.pageControl1.Size = new System.Drawing.Size(559, 39);
            this.pageControl1.TabIndex = 7;
            this.pageControl1.onFirst += new System.EventHandler(this.pageControl1_onFirst);
            this.pageControl1.onPre += new System.EventHandler<ArchiveStation.PageEventArgs>(this.pageControl1_onPre);
            this.pageControl1.onNext += new System.EventHandler<ArchiveStation.PageEventArgs>(this.pageControl1_onNext);
            this.pageControl1.onLast += new System.EventHandler<ArchiveStation.PageEventArgs>(this.pageControl1_onLast);
            this.pageControl1.onGo += new System.EventHandler<ArchiveStation.PageEventArgs>(this.pageControl1_onGo);
            //
            // dataGridView1
            //
            this.dataGridView1.AllowUserToAddRows = false;
            this.dataGridView1.AllowUserToDeleteRows = false;
            dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
            this.dataGridView1.BackgroundColor = System.Drawing.Color.White;
            this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
            this.dataGridView1.ColumnHeadersHeight = 28;
            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.boxid,
            this.title,
            this.number,
            this.manager,
            this.statusname,
            this.borrowername,
            this.idcard,
            this.boxnumber,
            this.department,
            this.createtimestring,
            this.position,
            this.boxname,
            this.rfid});
            this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.dataGridView1.Location = new System.Drawing.Point(3, 130);
            this.dataGridView1.Name = "dataGridView1";
            this.dataGridView1.RowTemplate.Height = 23;
            this.dataGridView1.ShowCellErrors = false;
            this.dataGridView1.Size = new System.Drawing.Size(1003, 335);
            this.dataGridView1.TabIndex = 13;
            //
            // backgroundWorker1
            //
            this.backgroundWorker1.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker1_DoWork);
            this.backgroundWorker1.RunWorkerCompleted += new System.ComponentModel.RunWorkerCompletedEventHandler(this.backgroundWorker1_RunWorkerCompleted);
            //
            // boxid
            //
            this.boxid.DataPropertyName = "boxid";
            this.boxid.HeaderText = "boxid";
            this.boxid.Name = "boxid";
            this.boxid.Visible = false;
            this.boxid.Width = 80;
            //
            // title
            //
            this.title.DataPropertyName = "title";
            this.title.HeaderText = "文件题目";
            this.title.Name = "title";
            this.title.Width = 180;
            //
            // number
            //
            this.number.DataPropertyName = "number";
            this.number.HeaderText = "文件编号";
            this.number.Name = "number";
            this.number.Width = 130;
            //
            // manager
            //
            this.manager.DataPropertyName = "manager";
            this.manager.HeaderText = "负责人";
            this.manager.Name = "manager";
            this.manager.Width = 120;
            //
            // statusname
            //
            this.statusname.DataPropertyName = "statusname";
            dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            this.statusname.DefaultCellStyle = dataGridViewCellStyle3;
            this.statusname.HeaderText = "状态";
            this.statusname.Name = "statusname";
            this.statusname.Width = 70;
            //
            // borrowername
            //
            this.borrowername.DataPropertyName = "borrowername";
            this.borrowername.HeaderText = "借阅人";
            this.borrowername.MinimumWidth = 80;
            this.borrowername.Name = "borrowername";
            //
            // idcard
            //
            this.idcard.DataPropertyName = "idcard";
            this.idcard.HeaderText = "身份证";
            this.idcard.Name = "idcard";
            this.idcard.Width = 130;
            //
            // boxnumber
            //
            this.boxnumber.DataPropertyName = "boxnumber";
            this.boxnumber.HeaderText = "盒编号";
            this.boxnumber.Name = "boxnumber";
            this.boxnumber.Width = 150;
            //
            // department
            //
            this.department.DataPropertyName = "department";
            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            this.department.DefaultCellStyle = dataGridViewCellStyle4;
            this.department.HeaderText = "部门";
            this.department.Name = "department";
            //
            // createtimestring
            //
            this.createtimestring.DataPropertyName = "createtimestring";
            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
            this.createtimestring.DefaultCellStyle = dataGridViewCellStyle5;
            this.createtimestring.HeaderText = "时间";
            this.createtimestring.Name = "createtimestring";
            this.createtimestring.Width = 120;
            //
            // position
            //
            this.position.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
            this.position.DataPropertyName = "position";
            this.position.HeaderText = "位置";
            this.position.MinimumWidth = 100;
            this.position.Name = "position";
            //
            // boxname
            //
            this.boxname.DataPropertyName = "boxname";
            this.boxname.HeaderText = "盒名称";
            this.boxname.Name = "boxname";
            this.boxname.Visible = false;
            this.boxname.Width = 130;
            //
            // rfid
            //
            this.rfid.DataPropertyName = "rfid";
            this.rfid.HeaderText = "rfid";
            this.rfid.Name = "rfid";
            this.rfid.Visible = false;
            //
            // FormBorrowBackList
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(1009, 518);
            this.Controls.Add(this.dataGridView1);
            this.Controls.Add(this.panel1);
            this.Controls.Add(this.panel2);
            this.Name = "FormBorrowBackList";
            this.Text = "借阅查询";
            this.Shown += new System.EventHandler(this.FormBorrowBackList_Shown);
            this.SizeChanged += new System.EventHandler(this.FormBorrowBackList_SizeChanged);
            this.Controls.SetChildIndex(this.panel2, 0);
            this.Controls.SetChildIndex(this.panel1, 0);
            this.Controls.SetChildIndex(this.dataGridView1, 0);
            this.Controls.SetChildIndex(this.panelLoading, 0);
            this.panelLoading.ResumeLayout(false);
            this.panel1.ResumeLayout(false);
            this.panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Panel panel2;
        private PageControl pageControl1;
        private System.Windows.Forms.DataGridView dataGridView1;
        private UILibrary.SkinButtom btnQuery;
        private UILibrary.TCTextBox txtKey;
        private System.ComponentModel.BackgroundWorker backgroundWorker1;
        private System.Windows.Forms.DataGridViewTextBoxColumn boxid;
        private System.Windows.Forms.DataGridViewTextBoxColumn title;
        private System.Windows.Forms.DataGridViewTextBoxColumn number;
        private System.Windows.Forms.DataGridViewTextBoxColumn manager;
        private System.Windows.Forms.DataGridViewTextBoxColumn statusname;
        private System.Windows.Forms.DataGridViewTextBoxColumn borrowername;
        private System.Windows.Forms.DataGridViewTextBoxColumn idcard;
        private System.Windows.Forms.DataGridViewTextBoxColumn boxnumber;
        private System.Windows.Forms.DataGridViewTextBoxColumn department;
        private System.Windows.Forms.DataGridViewTextBoxColumn createtimestring;
        private System.Windows.Forms.DataGridViewTextBoxColumn position;
        private System.Windows.Forms.DataGridViewTextBoxColumn boxname;
        private System.Windows.Forms.DataGridViewTextBoxColumn rfid;
    }
}


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

<title>com.stylepoints.habittracker.viewmodel.Profile Class Hierarchy</title>
<meta name="date" content="2017-12-04">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package com.stylepoints.habittracker.viewmodel.Profile

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

android.content.Context

android.content.ContextWrapper

android.view.ContextThemeWrapper

android.app.Activity (implements android.content.ComponentCallbacks2, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory2, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback)

android.support.v4.app.SupportActivity (implements android.arch.lifecycle.LifecycleOwner)

android.support.v4.app.FragmentActivity (implements android.support.v4.app.ActivityCompat.OnRequestPermissionsResultCallback, android.support.v4.app.ActivityCompat.RequestPermissionsRequestCodeValidator)

android.support.v7.app.AppCompatActivity (implements android.support.v7.app.ActionBarDrawerToggle.DelegateProvider, android.support.v7.app.AppCompatCallback, android.support.v4.app.TaskStackBuilder.SupportParentable)

com.stylepoints.habittracker.viewmodel.Profile.Achievements

com.stylepoints.habittracker.viewmodel.Profile.ProfileMain

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
#include <stdio.h>
#include <propeller.h>

/* This is a list of all drivers we can use in the
 * program. The default _InitIO function opens stdin,
 * stdout, and stderr based on the first driver in
 * the list (the serial driver, for us)
 */

extern _Driver _SimpleSerialDriver;
extern _Driver TvDriver;
extern _Driver _FileDriver;

_Driver *_driverlist[] = {
    &_SimpleSerialDriver,
    &TvDriver,
    &_FileDriver,
    NULL
};


text:
#pragma once
#include <aws/xray/XRay_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace XRay
{
namespace Model
{

  /**
   *
A map that contains tag keys and tag values to attach to an AWS X-Ray group
   * or sampling rule. For more information about ways to use tags, see Tagging
   * AWS resources in the AWS General Reference.

The following
   * restrictions apply to tags:

Maximum number of user-applied tags
   * per resource: 50

Tag keys and values are case sensitive.

   *

Don't use aws: as a prefix for keys; it's reserved
   * for AWS use. You cannot edit or delete system tags.

See
   * Also:
   AWS API
   * Reference

   */
  class AWS_XRAY_API Tag
  {
  public:
    Tag();
    Tag(Aws::Utils::Json::JsonView jsonValue);
    Tag& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
A tag key, such as Stage or Name. A tag key cannot
     * be empty. The key can be a maximum of 128 characters, and can contain only
     * Unicode letters, numbers, or separators, or the following special characters:
     * + - = . _ : /

     */
    inline const Aws::String& GetKey() const{ return m_key; }

    /**
     *
A tag key, such as Stage or Name. A tag key cannot
     * be empty. The key can be a maximum of 128 characters, and can contain only
     * Unicode letters, numbers, or separators, or the following special characters:
     * + - = . _ : /

     */
    inline bool KeyHasBeenSet() const { return m_keyHasBeenSet; }

    /**
     *
A tag key, such as Stage or Name. A tag key cannot
     * be empty. The key can be a maximum of 128 characters, and can contain only
     * Unicode letters, numbers, or separators, or the following special characters:
     * + - = . _ : /

     */
    inline void SetKey(const Aws::String& value) { m_keyHasBeenSet = true; m_key = value; }

    /**
     *
A tag key, such as Stage or Name. A tag key cannot
     * be empty. The key can be a maximum of 128 characters, and can contain only
     * Unicode letters, numbers, or separators, or the following special characters:
     * + - = . _ : /

     */
    inline void SetKey(Aws::String&& value) { m_keyHasBeenSet = true; m_key = std::move(value); }

    /**
     *
A tag key, such as Stage or Name. A tag key cannot
     * be empty. The key can be a maximum of 128 characters, and can contain only
     * Unicode letters, numbers, or separators, or the following special characters:
     * + - = . _ : /

     */
    inline void SetKey(const char* value) { m_keyHasBeenSet = true; m_key.assign(value); }

    /**
     *
A tag key, such as Stage or Name. A tag key cannot
     * be empty. The key can be a maximum of 128 characters, and can contain only
     * Unicode letters, numbers, or separators, or the following special characters:
     * + - = . _ : /

     */
    inline Tag& WithKey(const Aws::String& value) { SetKey(value); return *this;}

    /**
     *
A tag key, such as Stage or Name. A tag key cannot
     * be empty. The key can be a maximum of 128 characters, and can contain only
     * Unicode letters, numbers, or separators, or the following special characters:
     * + - = . _ : /

     */
    inline Tag& WithKey(Aws::String&& value) { SetKey(std::move(value)); return *this;}

    /**
     *
A tag key, such as Stage or Name. A tag key cannot
     * be empty. The key can be a maximum of 128 characters, and can contain only
     * Unicode letters, numbers, or separators, or the following special characters:
     * + - = . _ : /

     */
    inline Tag& WithKey(const char* value) { SetKey(value); return *this;}

    /**
     *
An optional tag value, such as Production or
     * test-only. The value can be a maximum of 255 characters, and
     * contain only Unicode letters, numbers, or separators, or the following special
     * characters: + - = . _ : /

     */
    inline const Aws::String& GetValue() const{ return m_value; }

    /**
     *
An optional tag value, such as Production or
     * test-only. The value can be a maximum of 255 characters, and
     * contain only Unicode letters, numbers, or separators, or the following special
     * characters: + - = . _ : /

     */
    inline bool ValueHasBeenSet() const { return m_valueHasBeenSet; }

    /**
     *
An optional tag value, such as Production or
     * test-only. The value can be a maximum of 255 characters, and
     * contain only Unicode letters, numbers, or separators, or the following special
     * characters: + - = . _ : /

     */
    inline void SetValue(const Aws::String& value) { m_valueHasBeenSet = true; m_value = value; }

    /**
     *
An optional tag value, such as Production or
     * test-only. The value can be a maximum of 255 characters, and
     * contain only Unicode letters, numbers, or separators, or the following special
     * characters: + - = . _ : /

     */
    inline void SetValue(Aws::String&& value) { m_valueHasBeenSet = true; m_value = std::move(value); }

    /**
     *
An optional tag value, such as Production or
     * test-only. The value can be a maximum of 255 characters, and
     * contain only Unicode letters, numbers, or separators, or the following special
     * characters: + - = . _ : /

     */
    inline void SetValue(const char* value) { m_valueHasBeenSet = true; m_value.assign(value); }

    /**
     *
An optional tag value, such as Production or
     * test-only. The value can be a maximum of 255 characters, and
     * contain only Unicode letters, numbers, or separators, or the following special
     * characters: + - = . _ : /

     */
    inline Tag& WithValue(const Aws::String& value) { SetValue(value); return *this;}

    /**
     *
An optional tag value, such as Production or
     * test-only. The value can be a maximum of 255 characters, and
     * contain only Unicode letters, numbers, or separators, or the following special
     * characters: + - = . _ : /

     */
    inline Tag& WithValue(Aws::String&& value) { SetValue(std::move(value)); return *this;}

    /**
     *
An optional tag value, such as Production or
     * test-only. The value can be a maximum of 255 characters, and
     * contain only Unicode letters, numbers, or separators, or the following special
     * characters: + - = . _ : /

     */
    inline Tag& WithValue(const char* value) { SetValue(value); return *this;}

  private:

    Aws::String m_key;
    bool m_keyHasBeenSet;

    Aws::String m_value;
    bool m_valueHasBeenSet;
  };

} // namespace Model
} // namespace XRay
} // namespace Aws


text:
<?php

namespace Mascame\Artificer\Fields\Types;

use Form;
use Mascame\Artificer\Fields\Field;

class Password extends Field
{
    public $filterable = false;

    protected function input()
    {
        return Form::password($this->name, $this->attributes);
    }

    public function show()
    {
        return 'hidden';
    }
}


text:
/**
 * LuceneRecordIterator.java
 *
 * Created on October 20, 2006, 3:03 PM
 */

package org.oclc.os.SRW.Lucene;

import gov.loc.www.zing.srw.ExtraDataType;
import java.util.NoSuchElementException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.lucene.document.Document;
import org.apache.lucene.search.Hits;
import org.oclc.os.SRW.Record;
import org.oclc.os.SRW.RecordIterator;

/**
 *
 * @author levan
 */
public class LuceneRecordIterator implements RecordIterator {
    static final Log log=LogFactory.getLog(LuceneRecordIterator.class);

    ExtraDataType edt;
    int numRecs;
    long whichRec;
    LuceneQueryResult result;
    RecordResolver resolver;
    String schemaId;

    /** Creates a new instance of LuceneRecordIterator */
    public LuceneRecordIterator(long whichRec, String schemaId,
      LuceneQueryResult result, RecordResolver resolver, ExtraDataType edt) {
        log.debug("whichRec="+whichRec+", schemaId="+schemaId+", result="+result+", resolver="+resolver+", edt="+edt);
        this.whichRec=whichRec;
        this.schemaId=schemaId;
        this.result=result;
        this.resolver=resolver;
        this.edt=edt;
    }

    public void close() {
    }

    public boolean hasNext() {
        log.debug("whichRec="+whichRec+", result.getNumberOfRecords()="+result.getNumberOfRecords());
        if(whichRec<=result.getNumberOfRecords())
            return true;
        return false;
    }

    public Object next() throws NoSuchElementException {
        return nextRecord();
    }

    public Record nextRecord() throws NoSuchElementException {
        Hits hits=result.getHits();
        try {
            Document doc=hits.doc((int)whichRec-1);
            log.debug("doc="+doc);
            return resolver.resolve(doc, result.ldb.idFieldName, edt);
        }
        catch(Exception e) {
            log.error(e, e);
            log.error("whichRec="+whichRec+", hits.length()="+hits.length());
            throw new NoSuchElementException(e.getMessage());
        }
        finally {
            whichRec++;
        }
    }

    public void remove() {
    }
}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using PokemonUnity;
using PokemonUnity.Attack;
using PokemonUnity.Inventory;
using PokemonUnity.Monster;
using PokemonUnity.Overworld;
using PokemonEssentials.Interface;
using PokemonEssentials.Interface.EventArg;
using PokemonEssentials.Interface.PokeBattle;

namespace PokemonUnity.Character
{
	/// <summary>
	/// </summary>
	//ToDo: Also need to record the number of levels gained...
	public class DayCare : PokemonEssentials.Interface.Field.IDayCare
	{
		#region Variables
		/// <summary>
		/// </summary>
		// KeyValuePair<IPokemon,steps>[]
		public KeyValuePair<IPokemon, int>[] Slot	{ get; private set; }
		public bool HasEgg	{ get; }
		public int Egg	{ get; }
		public IPokemon this[int index]
		{
			get { return Slot[index].Key; }
			set { Slot[index] = new KeyValuePair<IPokemon, int>(value, 0); } //ToDo: Add if/else null?
		}
		#endregion

		#region Constructor
		public DayCare(int slots)
		{
			Slot = new KeyValuePair<IPokemon, int>[slots];
		}
		#endregion

		#region Methods
		public bool pbEggGenerated() {
			if (pbDayCareDeposited()!=2) return false;
			return Game.GameData.Global.daycareEgg;//==1;
		}

		public int pbDayCareDeposited() {
			int ret=0;
			for (int i = 0; i < 2; i++) {
				if (this[i].IsNotNullOrNone()) ret+=1;//[0]
			}
			return ret;
		}

		public void pbDayCareDeposit(int index) {
			for (int i = 0; i < 2; i++) {
				if (!this[i].IsNotNullOrNone()) {//[0]
					this[i]=Game.GameData.Trainer.party[index];//[0]
					//this[i][1]=Game.GameData.Trainer.party[index].Level;
					this[i].Heal();//[0]
					Game.GameData.Trainer.party[index]=null;
					//Game.GameData.Trainer.party.compact()!;
					Game.GameData.Trainer.party.PackParty();
					Game.GameData.Global.daycareEgg=false;//0;
					Game.GameData.Global.daycareEggSteps=0;
					return;
				}
			}
			//raise Game._INTL("No room to deposit a Pokémon");
			//throw new Exception(Game._INTL("No room to deposit a Pokémon"));
			GameDebug.LogError(Game._INTL("No room to deposit a Pokémon"));
		}

		public bool pbDayCareGetLevelGain(int index,int nameVariable,int levelVariable) {
			IPokemon pkmn=this[index];//[0];
			if (!pkmn.IsNotNullOrNone()) return false;
			Game.GameData.GameVariables[nameVariable]=pkmn.Name;
			Game.GameData.GameVariables[levelVariable]=pkmn.Level-this[index].Level;//[1];
			return true;
		}

		public void pbDayCareGetDeposited(int index,int nameVariable,int costVariable) {
			for (int i = 0; i < 2; i++) {
				if ((index<0||i==index) && this[i].IsNotNullOrNone()) {//[0]
					int cost=this[i].Level-this[i].Level;//[0]|[1] ToDo: Levels raised since drop-off
					cost+=1;
					cost*=100;
					if (costVariable>=0) Game.GameData.GameVariables[costVariable]=cost;
					if (nameVariable>=0) Game.GameData.GameVariables[nameVariable]=this[i].Name;//[0]
					return;
				}
			}
			//raise Game._INTL("Can't find deposited Pokémon");
			//throw new Exception(Game._INTL("Can't find deposited Pokémon"));
			GameDebug.LogError(Game._INTL("Can't find deposited Pokémon"));
		}

		public bool pbIsDitto (IPokemon pokemon) {
			//dexdata=pbOpenDexData();
			//pbDexDataOffset(dexdata,pokemon.Species,31);
			EggGroups compat10=Kernal.PokemonData[pokemon.Species].EggGroup[0]; //dexdata.fgetb();
			EggGroups compat11=Kernal.PokemonData[pokemon.Species].EggGroup[1]; //dexdata.fgetb();
			//dexdata.close();
			return compat10 == EggGroups.DITTO ||
					compat11 == EggGroups.DITTO;
		}

		public bool pbDayCareCompatibleGender(IPokemon pokemon1,IPokemon pokemon2) {
			if ((pokemon1.IsFemale && pokemon2.IsMale) ||
				(pokemon1.IsMale && pokemon2.IsFemale)) {
				return true;
			}
			bool ditto1=pbIsDitto(pokemon1);
			bool ditto2=pbIsDitto(pokemon2);
			if (ditto1 && !ditto2) return true;
			if (ditto2 && !ditto1) return true;
			return false;
		}

		public int pbDayCareGetCompat() {
			if (pbDayCareDeposited()==2) {
				IPokemon pokemon1=this[0];//[0];
				IPokemon pokemon2=this[1];//[0];
				if (pokemon1 is IPokemonShadowPokemon s0 && s0.isShadow) return 0; //? rescue false
				if (pokemon2 is IPokemonShadowPokemon s1 && s1.isShadow) return 0; //? rescue false
				//dexdata=pbOpenDexData();
				//pbDexDataOffset(dexdata,pokemon1.Species,31);
				EggGroups compat10=Kernal.PokemonData[pokemon1.Species].EggGroup[0]; //dexdata.fgetb();
				EggGroups compat11=Kernal.PokemonData[pokemon1.Species].EggGroup[1]; //dexdata.fgetb();
				//pbDexDataOffset(dexdata,pokemon2.Species,31);
				EggGroups compat20=Kernal.PokemonData[pokemon1.Species].EggGroup[0]; //dexdata.fgetb();
				EggGroups compat21=Kernal.PokemonData[pokemon1.Species].EggGroup[1]; //dexdata.fgetb();
				//dexdata.close();
				if (compat10 != EggGroups.UNDISCOVERED &&
					compat11 != EggGroups.UNDISCOVERED &&
					compat20 != EggGroups.UNDISCOVERED &&
					compat21 != EggGroups.UNDISCOVERED) {
					if (compat10==compat20 || compat11==compat20 ||
						compat10==compat21 || compat11==compat21 ||
						compat10 == EggGroups.DITTO ||
						compat11 == EggGroups.DITTO ||
						compat20 == EggGroups.DITTO ||
						compat21 == EggGroups.DITTO) {
						if (pbDayCareCompatibleGender(pokemon1,pokemon2)) {
							int ret=1;
							if (pokemon1.Species==pokemon2.Species) ret+=1;
							if (pokemon1.publicID!=pokemon2.publicID) ret+=1;
							return ret;
						}
					}
				}
			}
			return 0;
		}

		public void pbDayCareGetCompatibility(int variable) {
			Game.GameData.GameVariables[variable]=pbDayCareGetCompat();
		}

		public void pbDayCareWithdraw(int index) {
			if (!this[index].IsNotNullOrNone()) {//[0]
				//raise Game._INTL("There's no Pokémon here...");
				//throw new Exception(Game._INTL("There's no Pokémon here..."));
				GameDebug.LogError(Game._INTL("There's no Pokémon here..."));
			} else if (Game.GameData.Trainer.party.Length>=6) {
				//raise Game._INTL("Can't store the Pokémon...");
				//throw new Exception(Game._INTL("Can't store the Pokémon..."));
				GameDebug.LogError(Game._INTL("Can't store the Pokémon..."));
			} else {
				Game.GameData.Trainer.party[Game.GameData.Trainer.party.Length]=this[index];//[0];
				this[index]=null;//[0]
				//this[index][1]=0;
				Game.GameData.Global.daycareEgg=false;//0;
			}
		}

		public void pbDayCareChoose(string text,int variable) {
			int count=pbDayCareDeposited();
			if (count==0) {
				//raise Game._INTL("There's no Pokémon here...");
				//throw new Exception(Game._INTL("There's no Pokémon here..."));
				GameDebug.LogError(Game._INTL("There's no Pokémon here..."));
			} else if (count==1) {
				Game.GameData.GameVariables[variable]=this[0].IsNotNullOrNone() ? 0 : 1;//[0]
			} else {
				List<string> choices=new List<string>();
				for (int i = 0; i < 2; i++) {
					IPokemon pokemon=this[i];//[0]
					if (pokemon.IsMale) {
						choices.Add(Game._INTL("{1} (♂, Lv{2})",pokemon.Name,pokemon.Level));
					} else if (pokemon.IsFemale) {
						choices.Add(Game._INTL("{1} (♀, Lv{2})",pokemon.Name,pokemon.Level));
					} else {
						choices.Add(Game._INTL("{1} (Lv{2})",pokemon.Name,pokemon.Level));
					}
				}
				choices.Add(Game._INTL("CANCEL"));
				int command=Game.GameData is IGameMessage m ? m.pbMessage(text,choices.ToArray(),choices.Count) : -1;
				Game.GameData.GameVariables[variable]=(command==2) ? -1 : command;
			}
		}

		public void pbDayCareGenerateEgg() {
			if (pbDayCareDeposited()!=2) {
				return;
			} else if (Game.GameData.Trainer.party.Length>=6) {
				//raise Game._INTL("Can't store the egg");
				//throw new Exception(Game._INTL("Can't store the egg"));
				GameDebug.LogError(Game._INTL("Can't store the egg"));
			}
			IPokemon pokemon0=this[0];//[0]
			IPokemon pokemon1=this[1];//[0]
			IPokemon mother=null;
			IPokemon father=null;
			Pokemons babyspecies=0;
			bool ditto0=pbIsDitto(pokemon0);
			bool ditto1=pbIsDitto(pokemon1);
			if ((pokemon0.IsFemale || ditto0)) {
				babyspecies=(ditto0) ? pokemon1.Species : pokemon0.Species;
				mother=pokemon0;
				father=pokemon1;
			} else {
				babyspecies=(ditto1) ? pokemon0.Species : pokemon1.Species;
				mother=pokemon1;
				father=pokemon0;
			}
			babyspecies= EvolutionHelper.pbGetBabySpecies(babyspecies,mother.Item,father.Item);
			if (babyspecies == Pokemons.MANAPHY) {				//&& hasConst?(PBSpecies,:PHIONE)
				babyspecies=Pokemons.PHIONE;
			} else if ((babyspecies == Pokemons.NIDORAN_F) ||	//&& hasConst?(PBSpecies,:NIDORANmA)
				(babyspecies == Pokemons.NIDORAN_M)) {			//&& hasConst?(PBSpecies,:NIDORANfE)
				babyspecies=new Pokemons[]{	Pokemons.NIDORAN_M,
											Pokemons.NIDORAN_F }[Core.Rand.Next(2)];
			} else if ((babyspecies == Pokemons.VOLBEAT) ||		//&& hasConst?(PBSpecies,:ILLUMISE)
				(babyspecies == Pokemons.ILLUMISE)) {			//&& hasConst?(PBSpecies,:VOLBEAT)
				babyspecies=new Pokemons[] {	Pokemons.VOLBEAT,
												Pokemons.ILLUMISE }[Core.Rand.Next(2)];
			}
			//Generate egg
			//IPokemon egg=new PokeBattle_Pokemon(babyspecies,Core.EGGINITIALLEVEL,Game.GameData.Player);
			IPokemon egg=new Pokemon(babyspecies,Core.EGGINITIALLEVEL,isEgg: true);//,Game.GameData.Player
			//Randomise personal ID
			int pid=Core.Rand.Next(65536);
			pid|=(Core.Rand.Next(65536)<<16);
			//egg.PersonalId=pid;
			//Inheriting form
			if ((egg is IPokemonMultipleForms e && mother is IPokemonMultipleForms m) && (
				babyspecies == Pokemons.BURMY ||
				babyspecies == Pokemons.SHELLOS ||
				babyspecies == Pokemons.BASCULIN)) {
				e.form=m.form;
				//egg.SetForm(mother.FormId);
			}
			//Inheriting Moves
			HashSet<Moves> moves=new HashSet<Moves>();
			HashSet<Moves> othermoves=new HashSet<Moves>();
			IPokemon movefather=father;IPokemon movemother=mother;
			if (pbIsDitto(movefather) && !mother.IsFemale) {
				movefather=mother; movemother=father;
			}
			//Initial Moves
			Moves[] initialmoves=egg.getMoveList(); //Level|Moves
			//foreach (Moves k in initialmoves) { //Key: Level | Value: Move
			foreach (KeyValuePair<Moves,int> k in Kernal.PokemonMovesData[egg.Species].LevelUp) {
				if (k.Value<=Core.EGGINITIALLEVEL) {
					moves.Add(k.Key);
				} else {
					if (mother.hasMove(k.Key) && father.hasMove(k.Key)) othermoves.Add(k.Key);
					//if (mother.hasMove(k) && father.hasMove(k)) othermoves.Add(k);
				}
			}
			//Inheriting Natural Moves
			foreach (var move in othermoves) {
				moves.Add(move);
			}
			//Inheriting Machine Moves
			if (!Core.USENEWBATTLEMECHANICS) {
				//Loop through every item in the game?...
				//for (int i = 0; i < ItemData.Length; i++) {
				for (int i = 0; i < egg.getMoveList(LearnMethod.machine).Length; i++) {
					//if (!$ItemData[i]) continue;
					//Moves atk=$ItemData[i][Core.ITEMMACHINE];
					Moves atk=egg.getMoveList(LearnMethod.machine)[i];
					//if (!atk || atk==0) continue;
					if (egg.isCompatibleWithMove(atk)) {
					if (movefather.hasMove(atk)) moves.Add(atk);
					}
				}
			}
			//  Inheriting Egg Moves
			if (movefather.IsMale) {
				//pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
				//	f.pos=(babyspecies-1)*8;
				//	int offset=f.fgetdw;
				//	int length=f.fgetdw;
				//	if (length>0) {
				//		f.pos=offset;
						int i=0; do { //unless (i<length) break; //loop
							Moves atk=egg.getMoveList(LearnMethod.egg)[i]; //f.fgetw();
							if (movefather.hasMove(atk)) moves.Add(atk);
							i+=1;
						} while (i>=egg.getMoveList(LearnMethod.egg).Length);
				//	}
				//}
			}
			if (Core.USENEWBATTLEMECHANICS) {
			//pbRgssOpen("Data/eggEmerald.dat","rb"){|f|
			//	f.pos=(babyspecies-1)*8;
			//	offset=f.fgetdw;
			//	length=f.fgetdw;
			//	if (length>0) {
			//		f.pos=offset;
					int i=0; do { //unless (i<length) break; //loop
						Moves atk=egg.getMoveList(LearnMethod.egg)[i]; //f.fgetw;
						if (movemother.hasMove(atk)) moves.Add(atk);
						i+=1;
					} while (i>=egg.getMoveList(LearnMethod.egg).Length);
			//	}
			//}
			}
			//  Volt Tackle
			bool lightball=false;
			if ((father.Species == Pokemons.PIKACHU ||
				father.Species == Pokemons.RAICHU) &&
				father.Item == Items.LIGHT_BALL) {
				lightball=true;
			}
			if ((mother.Species == Pokemons.PIKACHU ||
				mother.Species == Pokemons.RAICHU) &&
				mother.Item == Items.LIGHT_BALL) {
				lightball=true;
			}
			if (lightball && babyspecies == Pokemons.PICHU
				) { //&& hasConst?(PBMoves,:VOLTTACKLE)
				moves.Add(Moves.VOLT_TACKLE);
			}
			//moves|=[]; // remove duplicates
			//Assembling move list
			Move[] finalmoves=new Move[4];
			int listend=moves.Count-4;
			if (listend<0) listend=0;
			int j=0;
			for (int i = listend; i < listend+3; i++) {
				Moves moveid=(i>=moves.Count) ? 0 : moves.ElementAt(i);
				finalmoves[j]=new Move(moveid);
				j+=1;
			}
			//  Inheriting Individual Values
			int[] ivs=new int[6];
			for (int i = 0; i < 6; i++) {
				ivs[i]=Core.Rand.Next(32);
			}
			List<int?> ivinherit=new List<int?>(2);
			for (int i = 0; i < 2; i++) {
				IPokemon parent=new IPokemon[] {mother,father}[i];
				if (parent.Item == Items.POWER_WEIGHT)  ivinherit[i]=(int)Stats.HP;
				if (parent.Item == Items.POWER_BRACER)  ivinherit[i]=(int)Stats.ATTACK;
				if (parent.Item == Items.POWER_BELT)    ivinherit[i]=(int)Stats.DEFENSE;
				if (parent.Item == Items.POWER_ANKLET)  ivinherit[i]=(int)Stats.SPEED;
				if (parent.Item == Items.POWER_LENS)    ivinherit[i]=(int)Stats.SPATK;
				if (parent.Item == Items.POWER_BAND)    ivinherit[i]=(int)Stats.SPDEF;
			}
			int num=0;int r=Core.Rand.Next(2);
			for (int i = 0; i < 2; i++) {
				if (ivinherit[r]!=null) {
					IPokemon parent=new IPokemon[] { mother, father }[r];
					ivs[ivinherit[r].Value]=parent.IV[ivinherit[r].Value];
					num+=1;
					break;
				}
				r=(r+1)%2;
			}
			Stats[] stats=new Stats[] { Stats.HP,Stats.ATTACK,Stats.DEFENSE,
					Stats.SPEED,Stats.SPATK,Stats.SPDEF };
			int limit=(Core.USENEWBATTLEMECHANICS && (mother.Item == Items.DESTINY_KNOT ||
					father.Item == Items.DESTINY_KNOT)) ? 5 : 3;
			do { //;loop
				List<int> freestats=new List<int>();
				foreach (Stats i in stats) {
					if (!ivinherit.Contains((int)i)) freestats.Add((int)i);
				}
				if (freestats.Count==0) break;
				r=freestats[Core.Rand.Next(freestats.Count)];
				IPokemon parent=new IPokemon[] { mother, father }[Core.Rand.Next(2)];
				ivs[r]=parent.IV[r];
				ivinherit.Add(r);
				num+=1;
				if (num>=limit) break;
			} while (true);
			//  Inheriting nature
			List<Natures> newnatures=new List<Natures>();
			if (mother.Item == Items.EVERSTONE) newnatures.Add(mother.Nature);
			if (father.Item == Items.EVERSTONE) newnatures.Add(father.Nature);
			if (newnatures.Count>0) {
				egg.setNature(newnatures[Core.Rand.Next(newnatures.Count)]);
			}
			//  Masuda method and Shiny Charm
			int shinyretries=0;
			//if (father.language!=mother.language) shinyretries+=5;
			if (//hasConst?(PBItems,:SHINYCHARM) &&
				Game.GameData.Bag.pbQuantity(Items.SHINY_CHARM)>0) shinyretries+=2;
			if (shinyretries>0) {
				for (int i = 0; i < shinyretries; i++) {
					if (egg.IsShiny) break;
					//egg.PersonalId=Core.Rand.Next(65536)|(Core.Rand.Next(65536)<<16);
					(egg as Pokemon).shuffleShiny();
				}
			}
			//  Inheriting ability from the mother
			if ((!ditto0 && !ditto1)) {
				if (mother.hasHiddenAbility()) {
					if (Core.Rand.Next(10)<6) egg.setAbility(mother.abilityIndex);
				} else {
					if (Core.Rand.Next(10)<8) {
						egg.setAbility(mother.abilityIndex);
					} else {
						egg.setAbility((mother.abilityIndex+1)%2);
					}
				}
			} else if (((!ditto0 && ditto1) || (!ditto1 && ditto0)) && Core.USENEWBATTLEMECHANICS) {
				IPokemon parent=(!ditto0) ? mother : father;
				if (parent.hasHiddenAbility()) {
					if (Core.Rand.Next(10)<6) egg.setAbility(parent.abilityIndex);
				}
			}
			//  Inheriting Poké Ball from the mother
			if (mother.IsFemale &&
				mother.ballUsed != Items.MASTER_BALL && //!pbBallTypeToBall(mother.ballUsed)
				mother.ballUsed != Items.CHERISH_BALL){ //!pbBallTypeToBall(mother.ballUsed)
				egg.ballUsed=mother.ballUsed;
			}
			egg.IV[0]=(byte)ivs[0];
			egg.IV[1]=(byte)ivs[1];
			egg.IV[2]=(byte)ivs[2];
			egg.IV[3]=(byte)ivs[3];
			egg.IV[4]=(byte)ivs[4];
			egg.IV[5]=(byte)ivs[5];
			egg.moves[0]=finalmoves[0];
			egg.moves[1]=finalmoves[1];
			egg.moves[2]=finalmoves[2];
			egg.moves[3]=finalmoves[3];
			//egg.calcStats();
			//egg.obtainText=Game._INTL("Day-Care Couple"); //ToDo: Set obtain for daycare
			//egg.Name=Game._INTL("Egg");
			//dexdata=pbOpenDexData();
			//pbDexDataOffset(dexdata,babyspecies,21);
			//int eggsteps=dexdata.fgetw;
			//dexdata.close();
			//egg.eggsteps=eggsteps;
			if (Core.Rand.Next(65536)<Core.POKERUSCHANCE) {
				egg.GivePokerus();
			}
			Game.GameData.Trainer.party[Game.GameData.Trainer.party.Length]=egg;
		}

		//Events.onStepTaken+=delegate(object sender, EventArgs e) {
		public void OnStepTakenEventHandler(object sender, IOnStepTakenFieldMovementEventArgs e) {
			if (Game.GameData.Player == null) return;
			int deposited= this.pbDayCareDeposited();
			if (deposited==2 && !Game.GameData.Global.daycareEgg) {//==0
				if (Game.GameData.Global.daycareEggSteps == null) Game.GameData.Global.daycareEggSteps=0;
					Game.GameData.Global.daycareEggSteps+=1;
				if (Game.GameData.Global.daycareEggSteps==256) {
					Game.GameData.Global.daycareEggSteps=0;
					int compatval=new int[] {0,20,50,70}[this.pbDayCareGetCompat()];
					if (Game.GameData.Bag.pbQuantity(Items.OVAL_CHARM)>0) { //hasConst?(PBItems,:OVALCHARM) &&
						compatval=new int[] {0,40,80,88}[this.pbDayCareGetCompat()];
					}
					int rnd=Core.Rand.Next(100);
					if (rnd<compatval) {
						//  Egg is generated
						Game.GameData.Global.daycareEgg=true; //+=1; try adding one instead of setting to one?
					}
				}
			}
			for (int i = 0; i < 2; i++) {
				IPokemon pkmn=this.Slot[i].Key;
				if (!pkmn.IsNotNullOrNone()) return;
				int maxexp=Monster.Data.Experience.GetMaxExperience(pkmn.GrowthRate);
				if (pkmn.Exp < maxexp) {
					int oldlevel=pkmn.Level;
					pkmn.Exp += 1;
					if (pkmn.Level!=oldlevel) {
						pkmn.calcStats();
						//Moves[] movelist=pkmn.getMoveList();
						var movelist=Kernal.PokemonMovesData[pkmn.Species].LevelUp;
						foreach (KeyValuePair<Moves,int> j in movelist) {
							if (j.Value==pkmn.Level) pkmn.pbLearnMove(j.Key);	// Learned a new move
						}
					}
				}
			}
		}
		#endregion

		#region Explicit Operators
		/*public bool operator ==(DayCare x, DayCare y)
		{
			return ((x.Gender == y.Gender) && (x.TrainerID == y.TrainerID) && (x.SecretID == y.SecretID)) & (x.Name == y.Name);
		}
		public bool operator !=(DayCare x, DayCare y)
		{
			return ((x.Gender != y.Gender) || (x.TrainerID != y.TrainerID) || (x.SecretID != y.SecretID)) | (x.Name == y.Name);
		}
		public bool Equals(DayCare obj)
		{
			if (obj == null) return false;
			return this == obj;
		}
		public bool Equals(Character.Player obj)
		{
			if (obj == null) return false;
			return this == obj;
		}
		public override bool Equals(object obj)
		{
			if (obj == null) return false;
			if (obj.GetType() == typeof(Player))
				return Equals((Player)obj);
			if (obj.GetType() == typeof(TrainerId))
				return Equals((TrainerId)obj);
			return base.Equals(obj);
		}
		public override int GetHashCode()
		{
			return ((ulong)(TrainerID + SecretID * 65536)).GetHashCode();
		}
		bool IEquatable<DayCare>.Equals(DayCare other)
		{
			return Equals(obj: (object)other);
		}
		bool IEqualityComparer<DayCare>.Equals(DayCare x, DayCare y)
		{
			return x == y;
		}
		int IEqualityComparer<DayCare>.GetHashCode(DayCare obj)
		{
			return obj.GetHashCode();
		}*/
		#endregion
	}
}


text:
Mach 3 to Smooth Stepper Ethernet Pick and Place software
====================
This application is a work in progress build to run a DIY pick and place machine via Mach3 to a SmoothStepper Ethernet control board and Arduino Mini.

Full details of this project are on my blog at http://www.briandorey.com/

The project was built under Visual Studio 2013 and you need to have Mach3 installed and add a reference to the Mach3.exe in Visual Studio

Mach3 and this application need to be run with Administrator user rights otherwise the API often crashes.


text:
<meta charset="UTF-8">
<title>XmiWriter.<init> - biomedicus-uima</title>
<link rel="stylesheet" href="../../../style.css">

biomedicus-uima / edu.umn.biomedicus.uima.xmi / XmiWriter / <init>

<init>

XmiWriter()

A UIMA analysis engine that writes the contents of CASes to a files in a folder.


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.frontdoor.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.frontdoor.fluent.models.FrontendEndpointInner;
import com.azure.resourcemanager.frontdoor.models.CustomHttpsConfiguration;

/** An instance of this class provides access to all the operations defined in FrontendEndpointsClient. */
public interface FrontendEndpointsClient {
    /**
     * Lists all of the frontend endpoints within a Front Door.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return result of the request to list frontend endpoints.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<FrontendEndpointInner> listByFrontDoor(String resourceGroupName, String frontDoorName);

    /**
     * Lists all of the frontend endpoints within a Front Door.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return result of the request to list frontend endpoints.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<FrontendEndpointInner> listByFrontDoor(
        String resourceGroupName, String frontDoorName, Context context);

    /**
     * Gets a Frontend endpoint with the specified name within the specified Front Door.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Frontend endpoint with the specified name within the specified Front Door.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    FrontendEndpointInner get(String resourceGroupName, String frontDoorName, String frontendEndpointName);

    /**
     * Gets a Frontend endpoint with the specified name within the specified Front Door.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return a Frontend endpoint with the specified name within the specified Front Door.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<FrontendEndpointInner> getWithResponse(
        String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context);

    /**
     * Enables a frontendEndpoint for HTTPS traffic.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @param customHttpsConfiguration The configuration specifying how to enable HTTPS.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginEnableHttps(
        String resourceGroupName,
        String frontDoorName,
        String frontendEndpointName,
        CustomHttpsConfiguration customHttpsConfiguration);

    /**
     * Enables a frontendEndpoint for HTTPS traffic.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @param customHttpsConfiguration The configuration specifying how to enable HTTPS.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginEnableHttps(
        String resourceGroupName,
        String frontDoorName,
        String frontendEndpointName,
        CustomHttpsConfiguration customHttpsConfiguration,
        Context context);

    /**
     * Enables a frontendEndpoint for HTTPS traffic.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @param customHttpsConfiguration The configuration specifying how to enable HTTPS.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void enableHttps(
        String resourceGroupName,
        String frontDoorName,
        String frontendEndpointName,
        CustomHttpsConfiguration customHttpsConfiguration);

    /**
     * Enables a frontendEndpoint for HTTPS traffic.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @param customHttpsConfiguration The configuration specifying how to enable HTTPS.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void enableHttps(
        String resourceGroupName,
        String frontDoorName,
        String frontendEndpointName,
        CustomHttpsConfiguration customHttpsConfiguration,
        Context context);

    /**
     * Disables a frontendEndpoint for HTTPS traffic.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginDisableHttps(
        String resourceGroupName, String frontDoorName, String frontendEndpointName);

    /**
     * Disables a frontendEndpoint for HTTPS traffic.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginDisableHttps(
        String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context);

    /**
     * Disables a frontendEndpoint for HTTPS traffic.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void disableHttps(String resourceGroupName, String frontDoorName, String frontendEndpointName);

    /**
     * Disables a frontendEndpoint for HTTPS traffic.
     *
     * @param resourceGroupName Name of the Resource group within the Azure subscription.
     * @param frontDoorName Name of the Front Door which is globally unique.
     * @param frontendEndpointName Name of the Frontend endpoint which is unique within the Front Door.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void disableHttps(String resourceGroupName, String frontDoorName, String frontendEndpointName, Context context);
}


text:
include Atlassian::Util::TextUtil

class TextUtilTest < Minitest::Test

  context "to_sentence_case" do
    should "work with an empty string" do
      assert_equal "", to_sentence_case("")
    end

    should "work with a single letter" do
      assert_equal "A", to_sentence_case("a")
    end

    should "work with a single number" do
      assert_equal "1", to_sentence_case("1")
    end

    should "work with multichar" do
      assert_equal "Abc def", to_sentence_case("abc def")
    end

    should "coerce boolean false" do
      assert_equal "False", to_sentence_case(false)
    end

    should "coerce boolean true" do
      assert_equal "True", to_sentence_case(true)
    end

    should "coerce nil" do
      assert_equal "", to_sentence_case(nil)
    end

    should "coerce 0" do
      assert_equal "0", to_sentence_case(0)
    end

    should "coerce 1" do
      assert_equal "1", to_sentence_case(1)
    end
  end

  context "convert_branch_name_to_sentence" do

    should "work with branch name with leading issue key" do
      assert_equal "STASHDEV-1234 branch name", convert_branch_name_to_sentence("STASHDEV-1234-branch-name")
    end

    should "work with branch name with trailing issue key" do
      assert_equal "Branch name STASHDEV-1234", convert_branch_name_to_sentence("branch-name-STASHDEV-1234")
    end

    should "work with branch name with issue key in middle" do
      assert_equal "Branch STASHDEV-1234 name", convert_branch_name_to_sentence("branch-STASHDEV-1234-name")
    end

    should "work with branch name with multiple adjacent issue keys" do
      assert_equal "Branch name STASHDEV-1234 STASHDEV-1234", convert_branch_name_to_sentence("branch-name-STASHDEV-1234-STASHDEV-1234")
    end

    should "work with branch name with no issue keys" do
      assert_equal "Tests branch name", convert_branch_name_to_sentence("tests-branch-name")
    end

    should "work with branch name with underscore delimiter" do
      assert_equal "Tests branch name", convert_branch_name_to_sentence("tests_branch_name")
    end

    should "work with branch name with mixed delimiter" do
      assert_equal "Tests branch name", convert_branch_name_to_sentence("tests-branch_name")
    end

    should "work with single word branch name" do
      assert_equal "Branchname", convert_branch_name_to_sentence("branchname")
    end

    should "work with slash delimited branch name" do
      assert_equal "Feature/tests/STASHDEV-1234 branch name", convert_branch_name_to_sentence("feature/tests/STASHDEV-1234-branch-name")
    end

    should "work with slash delimited branch name with issue key component" do
      assert_equal "Feature/STASHDEV-1234/branch name", convert_branch_name_to_sentence("feature/STASHDEV-1234/branch-name")
    end

    should "work with branch name with invalid issue key (punctuation)" do
      assert_equal "STASHDEV! 1234 branch name", convert_branch_name_to_sentence("STASHDEV!-1234-branch-name")
    end

    should "work with branch name with invalid issue key (lowercase)" do
      assert_equal "Stashdev 1234 branch name", convert_branch_name_to_sentence("stashdev-1234-branch-name")
    end

    should "work with branch name with invalid issue key (numbers in project key)" do
      assert_equal "STASHDEV1 1234 branch name", convert_branch_name_to_sentence("STASHDEV1-1234-branch-name")
    end

    should "work with empty branch name" do
      assert_equal "", convert_branch_name_to_sentence("")
    end
  end

end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="MatchAuto">
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">1.0px</item>
    </style>
</resources>


text:
describe("select formatting buttons when selection has style applied", function(){
  var STYLES = ['italic', 'bold', 'underline', 'strikethrough'];
  var SHORTCUT_KEYS = ['I', 'B', 'U', '5']; // italic, bold, underline, strikethrough
  var FIRST_LINE = 0;

  before(function(cb){
    helper.newPad(cb);
    this.timeout(60000);
  });

  var applyStyleOnLine = function(style, line) {
    var chrome$ = helper.padChrome$;
    selectLine(line);
    var $formattingButton = chrome$('.buttonicon-' + style);
    $formattingButton.click();
  }

  var isButtonSelected = function(style) {
    var chrome$ = helper.padChrome$;
    var $formattingButton = chrome$('.buttonicon-' + style);
   return $formattingButton.parent().hasClass('selected');
  }

  var selectLine = function(lineNumber, offsetStart, offsetEnd) {
    var inner$ = helper.padInner$;
    var $line = inner$("div").eq(lineNumber);
    helper.selectLines($line, $line, offsetStart, offsetEnd);
  }

  var placeCaretOnLine = function(lineNumber) {
    var inner$ = helper.padInner$;
    var $line = inner$("div").eq(lineNumber);
    $line.sendkeys('{leftarrow}');
  }

  var undo = function() {
    var $undoButton = helper.padChrome$(".buttonicon-undo");
    $undoButton.click();
  }

  var testIfFormattingButtonIsDeselected = function(style) {
    it('deselects the ' + style + ' button', function(done) {
      helper.waitFor(function(){
        return isButtonSelected(style) === false;
      }).done(done)
    });
  }

  var testIfFormattingButtonIsSelected = function(style) {
    it('selects the ' + style + ' button', function(done) {
      helper.waitFor(function(){
        return isButtonSelected(style);
      }).done(done)
    });
  }

  var applyStyleOnLineAndSelectIt = function(line, style, cb) {
    applyStyleOnLineOnFullLineAndRemoveSelection(line, style, selectLine, cb);
  }

  var applyStyleOnLineAndPlaceCaretOnit = function(line, style, cb) {
    applyStyleOnLineOnFullLineAndRemoveSelection(line, style, placeCaretOnLine, cb);
  }

  var applyStyleOnLineOnFullLineAndRemoveSelection = function(line, style, selectTarget, cb) {
    applyStyleOnLine(style, line);

    // we have to give some time to Etherpad detects the selection changed
    setTimeout(function() {
      // remove selection from previous line
      selectLine(line + 1);
      setTimeout(function() {
        // select the text or place the caret on a position that
        // has the formatting text applied previously
        selectTarget(line);
        cb();
      }, 1000);
    }, 1000);
  }

  var pressFormattingShortcutOnSelection = function(key) {
    var inner$ = helper.padInner$;
    var chrome$ = helper.padChrome$;

    //get the first text element out of the inner iframe
    var $firstTextElement = inner$("div").first();

    //select this text element
    $firstTextElement.sendkeys('{selectall}');

    var e = inner$.Event(helper.evtType);
    e.ctrlKey = true; // Control key
    e.which = key.charCodeAt(0); // I, U, B, 5
    inner$("#innerdocbody").trigger(e);
  }

  STYLES.forEach(function(style){
    context('when selection is in a text with ' + style + ' applied', function(){
      before(function (done) {
        this.timeout(4000);
        applyStyleOnLineAndSelectIt(FIRST_LINE, style, done);
      });

      after(function () {
        undo();
      });

      testIfFormattingButtonIsSelected(style);
    });

    context('when caret is in a position with ' + style + ' applied', function(){
      before(function (done) {
        this.timeout(4000);
        applyStyleOnLineAndPlaceCaretOnit(FIRST_LINE, style, done);
      });

      after(function () {
        undo();
      });

      testIfFormattingButtonIsSelected(style)
    });
  });

  context('when user applies a style and the selection does not change', function() {
    var style = STYLES[0]; // italic
    before(function () {
      applyStyleOnLine(style, FIRST_LINE);
    });

    // clean the style applied
    after(function () {
      applyStyleOnLine(style, FIRST_LINE);
    });

    it('selects the style button', function (done) {
      expect(isButtonSelected(style)).to.be(true);
      done();
    });
  });

  SHORTCUT_KEYS.forEach(function(key, index){
    var styleOfTheShortcut = STYLES[index]; // italic, bold, ...
    context('when user presses CMD + ' + key, function() {
      before(function () {
        pressFormattingShortcutOnSelection(key);
      });

      testIfFormattingButtonIsSelected(styleOfTheShortcut);

      context('and user presses CMD + ' + key + ' again', function() {
        before(function () {
          pressFormattingShortcutOnSelection(key);
        });

        testIfFormattingButtonIsDeselected(styleOfTheShortcut);
      });
    });
  });
});


text:
package nl.tudelft.watchdog.eclipse.ui.wizards.userregistration;

import nl.tudelft.watchdog.core.logic.network.JsonTransferer;
import nl.tudelft.watchdog.core.logic.network.ServerCommunicationException;
import nl.tudelft.watchdog.core.ui.wizards.User;
import nl.tudelft.watchdog.eclipse.ui.preferences.Preferences;
import nl.tudelft.watchdog.eclipse.ui.util.UIUtils;
import nl.tudelft.watchdog.eclipse.ui.wizards.FinishableWizardPage;
import nl.tudelft.watchdog.eclipse.ui.wizards.FormValidationListener;
import nl.tudelft.watchdog.eclipse.ui.wizards.RegistrationEndingPageBase;
import nl.tudelft.watchdog.eclipse.util.WatchDogUtils;

import org.apache.commons.validator.routines.EmailValidator;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

/** The Page on which new users can register themselves. */
public class UserRegistrationPage extends RegistrationEndingPageBase {

	private static final String USER_REGISTRATION_TEXT = "User Registration (2/5)";

	/** The email address entered by the user. */
	private Text emailInput;

	/** The organization entered by the user. */
	private Text organizationInput;

	/** User may be contacted. */
	private Button mayContactButton;

	private Combo experienceDropDown;

	/** Constructor. */
	protected UserRegistrationPage(int pageNumber) {
		super(USER_REGISTRATION_TEXT, pageNumber);
		setTitle(USER_REGISTRATION_TEXT);
		setDescription("Only if you participate, can you win.");
	}

	@Override
	public void createControl(Composite parent) {
		Composite topComposite = createRegistrationComposite(parent);
		setControl(topComposite);
		setPageComplete(false);
	}

	/** Creates and returns the form of the registration. */
	private Composite createRegistrationComposite(Composite parent) {
		Composite innerParent = UIUtils.createGridedComposite(parent, 1);
		innerParent.setLayoutData(UIUtils.createFullGridUsageData());

		Composite introductionText = UIUtils.createGridedComposite(innerParent,
				1);
		UIUtils.createBoldLabel(
				"We keep your data private. From everybody. Always.",
				introductionText);
		UIUtils.createLabel(
				"By filling out this form, you help us a lot with our research. And you participate in our lottery.",
				introductionText);

		Composite composite = UIUtils.createGridedComposite(innerParent, 2);
		composite.setLayoutData(UIUtils.createFullGridUsageData());

		emailInput = UIUtils
				.createLinkedFieldInput(
						"Your eMail: ",
						"We contact you via this address, if you win one of our amazing prices. So make sure it's correct.",
						composite);
		organizationInput = UIUtils.createLinkedFieldInput(
				"Your Organization/Company: ",
				"You can include your organization's website here.", composite);

		FormValidationListener formValidator = new FormValidationListener(this);
		emailInput.addModifyListener(formValidator);

		UIUtils.createLabel("Your Programming Experience: ", composite);
		experienceDropDown = UIUtils.createComboList(composite, formValidator,
				new String[] { "", "< 1 year", "1-2 years", "3-6 years",
						"7-10 years", "> 10 years" }, 0);

		mayContactButton = new Button(innerParent, SWT.CHECK);
		mayContactButton
				.setText("I want to win prizes! The lovely TestRoots team from TU Delft may contact me.");
		mayContactButton.addSelectionListener(formValidator);
		mayContactButton.setSelection(true);

		UIUtils.createLabel("", innerParent);
		UIUtils.createLabel(
				"You can stay anonymous. But please consider registering, you can win prizes!",
				innerParent);

		return innerParent;
	}

	@Override
	public void validateFormInputs() {
		setErrorMessageAndPageComplete(null);
		if (WatchDogUtils
				.isEmptyOrHasOnlyWhitespaces(getProgrammingExperience())) {
			setErrorMessageAndPageComplete("Please fill in your years of programming experience");
		}

		if (!WatchDogUtils.isEmpty(emailInput.getText())) {
			if (!EmailValidator.getInstance(false)
					.isValid(emailInput.getText())) {
				setErrorMessageAndPageComplete("Your mail address is not valid!");
			}
		}

		if (WatchDogUtils.isEmpty(emailInput.getText())
				&& mayContactButton.getSelection()) {
			setErrorMessageAndPageComplete("You can only participate in the lottery if you enter your email address.");
		}

		getWizard().getContainer().updateButtons();
	}

	protected void makeRegistration() {
		User user = new User();
		user.email = getEmailInput().getText();
		user.organization = getOrganizationInput().getText();
		user.mayContactUser = getMayContactUser();
		user.programmingExperience = getProgrammingExperience();
		user.operatingSystem = Platform.getOS();

		try {
			id = new JsonTransferer().registerNewUser(user);
		} catch (ServerCommunicationException exception) {
			successfulRegistration = false;
			messageTitle = "Problem creating new user!";
			messageBody = exception.getMessage();
			return;
		}

		successfulRegistration = true;
		((UserProjectRegistrationWizard) getWizard()).userid = id;
		messageTitle = "New user registered!";
		messageBody = "Your new user id is registered: ";

		Preferences preferences = Preferences.getInstance();
		preferences.setUserid(id);
		preferences.registerProjectId(WatchDogUtils.getWorkspaceName(), "");
	}

	/**
	 * Creates report of the user registration to the {@link Composite} parent.
	 */
	public void createUserRegistrationSummary(Composite parent) {
		if (successfulRegistration) {
			FinishableWizardPage.createSuccessMessage(parent, messageTitle,
					messageBody, id);
		} else {
			FinishableWizardPage.createFailureMessage(parent, messageTitle,
					messageBody);
		}
	}

	/** @return the email */
	public Text getEmailInput() {
		return emailInput;
	}

	/** @return the organization */
	public Text getOrganizationInput() {
		return organizationInput;
	}

	/** @return the programming experience in years. */
	public String getProgrammingExperience() {
		return experienceDropDown.getText();
	}

	/**
	 * @return whether the user may be contacted. (If this is false, no lottery
	 *         participation.)
	 */
	public boolean getMayContactUser() {
		return mayContactButton.getSelection();
	}

	@Override
	public boolean canFinish() {
		return false;
	}

	@Override
	public void setVisible(boolean visible) {
		super.setVisible(visible);
		if (visible) {
			validateFormInputs();
		} else {
			if (isPageComplete()
					&& getWizard().getStartingPage() != getWizard()
							.getContainer().getCurrentPage()) {
				makeRegistration();
			}
		}
	}
}


text:
package utils

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
	"time"
)

// rpcStatus is a type, used to parse the json format of google.rpc.Status,
// https://github.com/googleapis/googleapis/blob/master/google/rpc/status.proto.
type rpcStatus struct {
	Code    uint16
	Message string
}

func (r rpcStatus) toString() string {
	return fmt.Sprintf("{\"code\":%v,\"message\":\"%s\"}", r.Code, r.Message)
}

// RpcStatusDeterministicJsonFormat converts the unordered json format of
// rpcStatus to an ordered one.
func RpcStatusDeterministicJsonFormat(jsonBytes []byte) string {
	var jsonErr rpcStatus
	_ = json.Unmarshal(jsonBytes, &jsonErr)
	return jsonErr.toString()
}

// DoWithHeaders performs a GET/POST/PUT/DELETE/PATCH request to a specified url
// with given headers and message(if provided).
func DoWithHeaders(url, method, message string, headers map[string]string) (http.Header, []byte, error) {
	return DoWithHeadersAndTimeout(url, method, message, headers, 0)
}

// DoWithHeadersAndTimeout performs a GET/POST/PUT/DELETE/PATCH request to a
// specified url with given headers and message(if provided).
// If a non-0 timeout is provided, the client will cancel the request when the
// time limit is reached.
func DoWithHeadersAndTimeout(url, method, message string, headers map[string]string, timeout time.Duration) (http.Header, []byte, error) {
	var request *http.Request
	var err error
	if method == "DELETE" || method == "GET" {
		request, err = http.NewRequest(method, url, nil)
	} else {
		msg := map[string]string{
			"message": message,
		}
		var buf bytes.Buffer
		if err := json.NewEncoder(&buf).Encode(msg); err != nil {
			return nil, nil, err
		}
		request, err = http.NewRequest(method, url, &buf)
	}

	if err != nil {
		return nil, nil, fmt.Errorf("create request error: %v", err)
	}

	if message != "" {
		request.Header.Set("Content-Type", "application/json")
	}

	for k, v := range headers {
		request.Header.Set(k, v)
	}

	client := &http.Client{
		CheckRedirect: func(req *http.Request, via []*http.Request) error {
			return http.ErrUseLastResponse
		},
		Timeout: timeout,
	}

	resp, err := client.Do(request)
	if err != nil {
		return nil, nil, fmt.Errorf("http %s error: %v", method, err)
	}
	defer resp.Body.Close()

	bodyBytes, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, nil, fmt.Errorf("http got error: %v", err)
	}

	if resp.StatusCode != http.StatusOK {
		if resp.Header.Get("Content-Type") == "application/json" {
			return resp.Header, bodyBytes, fmt.Errorf("http response status is not 200 OK: %s, %s", resp.Status, RpcStatusDeterministicJsonFormat(bodyBytes))
		}
		return resp.Header, bodyBytes, fmt.Errorf("http response status is not 200 OK: %s, %s", resp.Status, bodyBytes)
	}
	return resp.Header, bodyBytes, err
}

type HeaderValueChecker func(gotHeaderVal string) bool

// CheckHeaderExist will check for the given header name in the headers.
// If a value is provided, it will check the value is contained in the original header value.
func CheckHeaderExist(headers http.Header, wantHeaderName string, valueChecker HeaderValueChecker) bool {
	for headerName, headerVals := range headers {
		if headerName == wantHeaderName {
			if valueChecker(strings.Join(headerVals, ";")) {
				return true
			}
		}
	}
	return false
}


text:
namespace SimplePhotoViewer.UI.Views
{
    public partial class ShellView
    {
        public ShellView()
        {
            InitializeComponent();
        }
    }
}


text:
package org.flexiblepower.runtime.ui.server.pages;

import java.util.Arrays;
import java.util.Locale;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;

import javax.servlet.http.HttpServlet;

import org.flexiblepower.runtime.ui.server.widgets.AbstractWidgetManager;
import org.flexiblepower.runtime.ui.server.widgets.WidgetRegistration;
import org.flexiblepower.runtime.ui.server.widgets.WidgetRegistry;
import org.flexiblepower.ui.Widget;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import aQute.bnd.annotation.component.Activate;
import aQute.bnd.annotation.component.Component;
import aQute.bnd.annotation.component.ConfigurationPolicy;
import aQute.bnd.annotation.component.Reference;
import aQute.bnd.annotation.metatype.Configurable;
import aQute.bnd.annotation.metatype.Meta.AD;
import aQute.bnd.annotation.metatype.Meta.OCD;

@Component(designate = DashboardPage.Config.class,
           configurationPolicy = ConfigurationPolicy.optional,
           immediate = true,
           provide = { Widget.class },
           properties = { "widget.type=full", "widget.name=dashboard", "widget.ranking=1000000" })
public class DashboardPage extends AbstractWidgetManager implements Widget {
    private static final Logger logger = LoggerFactory.getLogger(DashboardPage.class);

    @OCD(description = "Configuration of the Dashboard Servlet", name = "Dashboard Configuration")
    public interface Config {
        @AD(deflt = "31536000",
            description = "Expiration time of static content (in seconds)",
            name = "Expiration time",
            optionLabels = { "No caching", "A minute", "An hour", "A day", "A year" },
            optionValues = { "0", "60", "3600", "86400", "31536000" },
            required = false)
        long expireTime();
    }

    private long expirationTime = 31536000000L;

    @Activate
    public void activate(Map<String, Object> properties) {
        logger.trace("Entering activate, properties = " + properties);
        Config config = Configurable.createConfigurable(Config.class, properties);
        expirationTime = config.expireTime() * 1000;
        logger.trace("Leaving activate");
    }

    @Override
    @Reference(dynamic = true, multiple = true, optional = true, target = "(!(" + WidgetRegistry.KEY_TYPE
                                                                          + "="
                                                                          + WidgetRegistry.VALUE_TYPE_FULL
                                                                          + "))")
    public synchronized void addWidget(Widget widget, Map<String, Object> properties) {
        super.addWidget(widget, properties);
        notifyAll();
    }

    @Override
    public synchronized void removeWidget(Widget widget) {
        super.removeWidget(widget);
        notifyAll();
    }

    @Override
    public String createPath(WidgetRegistration registration) {
        return "/widget/" + registration.getId();
    }

    @Override
    public HttpServlet createServlet(WidgetRegistration registration) {
        return new DashboardWidgetServlet(registration, expirationTime);
    }

    // Full-size widget functions

    @Override
    public String getTitle(Locale locale) {
        return "Dashboard";
    }

    public synchronized SortedMap<Integer, String> getWidgets(Locale locale, Integer[] currentWidgets) {
        logger.trace("Entering getWidgets, locale = {}, currentWidgets = {}", locale, currentWidgets);
        SortedMap<Integer, String> widgetInfo = getWidgetInfo(locale);

        if (Arrays.equals(widgetInfo.keySet().toArray(new Integer[widgetInfo.size()]), currentWidgets)) {
            logger.trace("No change, waiting...");
            try {
                wait(30000);
            } catch (InterruptedException ex) {
                // Expected
            }

            widgetInfo = getWidgetInfo(locale);
        }

        logger.trace("Leaving getWidgets, result = {}", widgetInfo);
        return widgetInfo;
    }

    private SortedMap<Integer, String> getWidgetInfo(Locale locale) {
        SortedMap<Integer, String> widgetInfo = new TreeMap<Integer, String>();
        for (WidgetRegistration reg : getRegistrations()) {
            widgetInfo.put(reg.getId(), reg.getWidget().getTitle(locale));
        }
        return widgetInfo;
    }
}