text:
package org.onosproject.ovsdb.controller.impl;

import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.buffer.PooledByteBufAllocator;
import io.netty.channel.Channel;
import io.netty.channel.ChannelDuplexHandler;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelOption;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoop;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.ServerChannel;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.string.StringEncoder;
import io.netty.handler.timeout.IdleState;
import io.netty.handler.timeout.IdleStateEvent;
import io.netty.handler.timeout.IdleStateHandler;
import io.netty.util.CharsetUtil;

import static org.onlab.util.Tools.groupedThreads;

import java.net.InetSocketAddress;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

import org.onlab.packet.IpAddress;
import org.onlab.packet.TpPort;
import org.onlab.util.Tools;
import org.onosproject.ovsdb.controller.OvsdbConstant;
import org.onosproject.ovsdb.controller.OvsdbNodeId;
import org.onosproject.ovsdb.controller.driver.DefaultOvsdbClient;
import org.onosproject.ovsdb.controller.driver.OvsdbAgent;
import org.onosproject.ovsdb.controller.driver.OvsdbProviderService;
import org.onosproject.ovsdb.rfc.jsonrpc.Callback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * The main controller class. Handles all setup and network listeners -
 * distributed OVSDBClient.
 */
public class Controller {
    protected static final Logger log = LoggerFactory
            .getLogger(Controller.class);

    private int ovsdbPort = OvsdbConstant.OVSDBPORT;

    private OvsdbAgent agent;
    private Callback monitorCallback;

    private final ExecutorService executorService = Executors
            .newFixedThreadPool(10, groupedThreads("OVSDB-C", "executor-%d", log));

    private EventLoopGroup bossGroup;
    private EventLoopGroup workerGroup;
    private Class<? extends ServerChannel> serverChannelClass;

    private static final int MAX_RETRY = 5;
    private static final int IDLE_TIMEOUT_SEC = 10;

    /**
     * Initialization.
     */
    private void initEventLoopGroup() {
        bossGroup = new NioEventLoopGroup(0, Tools.groupedThreads("OVSDB-C", "boss-%d", log));
        workerGroup = new NioEventLoopGroup(0, Tools.groupedThreads("OVSDB-C", "worker-%d", log));
        serverChannelClass = NioServerSocketChannel.class;
    }

    /**
     * Accepts incoming connections.
     */
    private void startAcceptingConnections() throws InterruptedException {
        ServerBootstrap b = new ServerBootstrap();

        b.group(bossGroup, workerGroup).channel(serverChannelClass)
                .childHandler(new OnosCommunicationChannelInitializer());
        b.option(ChannelOption.SO_BACKLOG, 128);
        b.option(ChannelOption.WRITE_BUFFER_HIGH_WATER_MARK, 32 * 1024);
        b.option(ChannelOption.WRITE_BUFFER_LOW_WATER_MARK, 8 * 1024);
        b.option(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT);
        b.childOption(ChannelOption.SO_KEEPALIVE, true);
        b.bind(ovsdbPort).sync();
    }

    /**
     * Tells controller that we're ready to accept OVSDB node loop.
     * @throws InterruptedException if thread is interrupted
     */
    public void run() throws InterruptedException {
        initEventLoopGroup();
        startAcceptingConnections();
    }

    /**
     * Adds channel pipeline to handle a new connected node.
     */
    private class OnosCommunicationChannelInitializer
            extends ChannelInitializer<SocketChannel> {
        @Override
        protected void initChannel(SocketChannel channel) throws Exception {
            log.info("New channel created");
            channel.pipeline().addLast(new StringEncoder(CharsetUtil.UTF_8));
            channel.pipeline().addLast(new MessageDecoder());
            handleNewNodeConnection(channel);

        }
    }

    /**
     * Handles the new connection of node.
     *
     * @param channel the channel to use.
     */
    private void handleNewNodeConnection(final Channel channel) {
        executorService.execute(new Runnable() {
            @Override
            public void run() {
                log.info("Handle new node connection");

                IpAddress ipAddress = IpAddress
                        .valueOf(((InetSocketAddress) channel.remoteAddress())
                                .getAddress().getHostAddress());
                long port = ((InetSocketAddress) channel.remoteAddress())
                        .getPort();

                log.info("Get connection from ip address {} : {}",
                         ipAddress.toString(), port);

                OvsdbNodeId nodeId = new OvsdbNodeId(ipAddress, port);
                OvsdbProviderService ovsdbProviderService = getNodeInstance(nodeId,
                                                                            agent,
                                                                            monitorCallback,
                                                                            channel);
                ovsdbProviderService.setConnection(true);
                OvsdbJsonRpcHandler ovsdbJsonRpcHandler = new OvsdbJsonRpcHandler(
                                                                                nodeId);
                ovsdbJsonRpcHandler
                        .setOvsdbProviderService(ovsdbProviderService);
                channel.pipeline().addLast(ovsdbJsonRpcHandler);

                ovsdbProviderService.nodeAdded();
                ChannelFuture closeFuture = channel.closeFuture();
                closeFuture
                        .addListener(new ChannelConnectionListener(
                                                                   ovsdbProviderService));
            }
        });
    }

    /**
     * Gets an OVSDB client instance.
     *
     * @param nodeId data OVSDB node id
     * @param agent OvsdbAgent
     * @param monitorCallback Callback
     * @param channel Channel
     * @return OvsdbProviderService instance
     */
    protected OvsdbProviderService getNodeInstance(OvsdbNodeId nodeId,
                                                   OvsdbAgent agent,
                                                   Callback monitorCallback,
                                                   Channel channel) {
        OvsdbProviderService ovsdbProviderService = new DefaultOvsdbClient(
                                                                           nodeId);
        ovsdbProviderService.setAgent(agent);
        ovsdbProviderService.setCallback(monitorCallback);
        ovsdbProviderService.setChannel(channel);
        return ovsdbProviderService;
    }

    /**
     * Starts controller.
     *
     * @param agent OvsdbAgent
     * @param monitorCallback Callback
     */
    public void start(OvsdbAgent agent, Callback monitorCallback) {
        this.agent = agent;
        this.monitorCallback = monitorCallback;
        try {
            this.run();
        } catch (InterruptedException e) {
            log.warn("Interrupted while waiting to start");
            Thread.currentThread().interrupt();
        }
    }

    /**
     * Stops controller.
     *
     */
    public void stop() {
        workerGroup.shutdownGracefully();
        bossGroup.shutdownGracefully();
    }

    /**
     * Connect to the ovsdb server with given ip address and port number.
     *
     * @param ip ip address
     * @param port port number
     */
    public void connect(IpAddress ip, TpPort port) {
        ChannelFutureListener listener = new ConnectionListener(this, ip, port);
        connectRetry(ip, port, listener);
    }

    private void connectRetry(IpAddress ip, TpPort port, ChannelFutureListener listener) {
        try {
            Bootstrap b = new Bootstrap();
            b.group(workerGroup)
                    .channel(NioSocketChannel.class)
                    .option(ChannelOption.TCP_NODELAY, true)
                    .handler(new ChannelInitializer<SocketChannel>() {

                        @Override
                        protected void initChannel(SocketChannel channel) throws Exception {
                            ChannelPipeline p = channel.pipeline();
                            p.addLast(new MessageDecoder(),
                                      new StringEncoder(CharsetUtil.UTF_8),
                                      new IdleStateHandler(IDLE_TIMEOUT_SEC, 0, 0),
                                      new ConnectionHandler());
                        }
                    });
            b.remoteAddress(ip.toString(), port.toInt());
            b.connect().addListener(listener);
        } catch (Exception e) {
            log.warn("Connection to the ovsdb server {}:{} failed", ip.toString(), port.toString());
        }
    }

    private class ConnectionListener implements ChannelFutureListener {
        private Controller controller;
        private IpAddress ip;
        private TpPort port;
        private AtomicInteger count = new AtomicInteger();

        public ConnectionListener(Controller controller,
                                  IpAddress ip,
                                  TpPort port) {
            this.controller = controller;
            this.ip = ip;
            this.port = port;
        }

        @Override
        public void operationComplete(ChannelFuture channelFuture) throws Exception {
            if (!channelFuture.isSuccess()) {
                channelFuture.channel().close();

                if (count.incrementAndGet() < MAX_RETRY) {
                    final EventLoop loop = channelFuture.channel().eventLoop();

                    loop.schedule(() -> {
                        controller.connectRetry(this.ip, this.port, this);
                    }, 1L, TimeUnit.SECONDS);
                } else {
                    log.info("Connection to the ovsdb {}:{} failed",
                             this.ip.toString(), this.port.toString());
                }
            } else {
                handleNewNodeConnection(channelFuture.channel());
            }
        }
    }

    private class ConnectionHandler extends ChannelDuplexHandler {

        @Override
        public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
            IdleStateEvent e = (IdleStateEvent) evt;

            if (e.state() == IdleState.READER_IDLE) {
                ctx.close();
            }
        }
    }
}


text:
package com.vmware.vim25;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for StorageDrsCannotMoveVmWithMountedCDROM complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="StorageDrsCannotMoveVmWithMountedCDROM">
 *   <complexContent>
 *     <extension base="{urn:vim25}VimFault">
 *       <sequence>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "StorageDrsCannotMoveVmWithMountedCDROM")
public class StorageDrsCannotMoveVmWithMountedCDROM
    extends VimFault
{

}

redpajama_set_name: RedPajamaGithub


text:
<div data-module="Search">
  <gui-expander data-label="Search Options">
    <gui-fragment data-fragment-id="ModuleSearchOptionsFragment"></gui-fragment>
  </gui-expander>
  <gui-expander data-label="Search Locations">
    <gui-fragment data-fragment-id="ModuleSearchLocationsFragment"></gui-fragment>
  </gui-expander>
</div>

<application-fragment data-id="ModuleSearchOptionsFragment">
  <gui-vbox class="block-label">
    <gui-vbox-container data-shrink="1" data-expand="true">
      <gui-label>Enable Application Search</gui-label>
      <gui-switch data-id="SearchEnableApplications"></gui-switch>
    </gui-vbox-container>
    <gui-vbox-container data-shrink="1" data-expand="true">
      <gui-label>Enable File Search</gui-label>
      <gui-switch data-id="SearchEnableFiles"></gui-switch>
    </gui-vbox-container>
  </gui-vbox>
</application-fragment>

<application-fragment data-id="ModuleSearchLocationsFragment">
  <gui-vbox class="block-label">
    <gui-vbox-container data-shrink="1" data-grow="1">
      <gui-list-view data-id="SearchPaths" data-multiple="false"></gui-list-view>
    </gui-vbox-container>

    <gui-vbox-container data-shrink="1" data-expand="true">
      <gui-button-bar>
        <gui-button data-id="SearchAdd" data-icon="stock://16x16/actions/list-add.png"></gui-button>
        <gui-button data-id="SearchRemove" data-icon="stock://16x16/actions/list-remove.png"></gui-button>
      </gui-button-bar>
    </gui-vbox-container>
  </gui-vbox>
</application-fragment>


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

<title>net.happybrackets.core.scheduling Class Hierarchy (HappyBrackets API)</title>
<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 net.happybrackets.core.scheduling

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

net.happybrackets.core.scheduling.AverageCalculator

net.happybrackets.core.scheduling.Clock (implements net.happybrackets.core.scheduling.ScheduledEventListener)

net.happybrackets.core.scheduling.ClockAdjustment (implements net.happybrackets.core.control.CustomGlobalEncoder)

net.happybrackets.core.scheduling.Delay (implements net.happybrackets.core.scheduling.ScheduledEventListener)

net.happybrackets.core.scheduling.DeviceSchedulerValue (implements java.lang.Comparable<T>, net.happybrackets.core.control.CustomGlobalEncoder)

net.happybrackets.core.scheduling.DeviceSchedules

net.happybrackets.core.scheduling.DeviceStratumMessage (implements net.happybrackets.core.control.CustomGlobalEncoder)

net.happybrackets.core.scheduling.HBScheduler

net.happybrackets.core.scheduling.ScheduledObject (implements java.lang.Comparable<T>)

Interface Hierarchy

net.happybrackets.core.scheduling.Clock.ClockTickListener

net.happybrackets.core.scheduling.Delay.DelayListener

net.happybrackets.core.scheduling.ScheduleAdjustmentListener

net.happybrackets.core.scheduling.ScheduledEventListener

Enum Hierarchy

java.lang.Object

java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable)

net.happybrackets.core.scheduling.HBScheduler.MESSAGE_PARAMS

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
using CakeMail.RestClient.Models;
using CakeMail.RestClient.Utilities;
using Pathoschild.Http.Client;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;

namespace CakeMail.RestClient.Resources
{
	/// <summary>
	/// Allows you to manage Campaigns.
	/// </summary>
	/// <seealso cref="CakeMail.RestClient.Resources.ICampaigns" />
	public class Campaigns : ICampaigns
	{
		#region Fields

		private readonly IClient _client;

		#endregion

		#region Constructor

		/// <summary>
		/// Initializes a new instance of the <see cref="Campaigns" /> class.
		/// </summary>
		/// <param name="client">The HTTP client.</param>
		internal Campaigns(IClient client)
		{
			_client = client;
		}

		#endregion

		#region Public Methods

		/// <summary>
		/// Create a new campaign.
		/// </summary>
		/// <param name="userKey">User Key of the user who initiates the call.</param>
		/// <param name="name">Name of the campaign.</param>
		/// <param name="clientId">Client ID of the client in which the campaign is created.</param>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <returns>ID of the new campaign.</returns>
		public Task<long> CreateAsync(string userKey, string name, long? clientId = null, CancellationToken cancellationToken = default)
		{
			var parameters = new List<KeyValuePair<string, object>>
			{
				new KeyValuePair<string, object>("user_key", userKey),
				new KeyValuePair<string, object>("name", name)
			};
			if (clientId.HasValue) parameters.Add(new KeyValuePair<string, object>("client_id", clientId.Value));

			return _client
				.PostAsync("Campaign/Create")
				.WithFormUrlEncodedBody(parameters)
				.WithCancellationToken(cancellationToken)
				.AsCakeMailObject<long>();
		}

		/// <summary>
		/// Delete a campaign.
		/// </summary>
		/// <param name="userKey">User Key of the user who initiates the call.</param>
		/// <param name="campaignId">ID of the campaign to delete.</param>
		/// <param name="clientId">Client ID of the client in which the campaign is located.</param>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <returns>True if the campaign is deleted.</returns>
		public Task<bool> DeleteAsync(string userKey, long campaignId, long? clientId = null, CancellationToken cancellationToken = default)
		{
			var parameters = new List<KeyValuePair<string, object>>
			{
				new KeyValuePair<string, object>("user_key", userKey),
				new KeyValuePair<string, object>("campaign_id", campaignId)
			};
			if (clientId.HasValue) parameters.Add(new KeyValuePair<string, object>("client_id", clientId.Value));

			return _client
				.PostAsync("Campaign/Delete")
				.WithFormUrlEncodedBody(parameters)
				.WithCancellationToken(cancellationToken)
				.AsCakeMailObject<bool>();
		}

		/// <summary>
		/// Retrieve a campaign.
		/// </summary>
		/// <param name="userKey">User Key of the user who initiates the call.</param>
		/// <param name="campaignId">ID of the campaign.</param>
		/// <param name="clientId">Client ID of the client in which the campaign is located.</param>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <returns>The <see cref="Campaign">campaign</see>.</returns>
		public Task<Campaign> GetAsync(string userKey, long campaignId, long? clientId = null, CancellationToken cancellationToken = default)
		{
			var parameters = new List<KeyValuePair<string, object>>
			{
				new KeyValuePair<string, object>("user_key", userKey),
				new KeyValuePair<string, object>("campaign_id", campaignId)
			};
			if (clientId.HasValue) parameters.Add(new KeyValuePair<string, object>("client_id", clientId.Value));

			return _client
				.PostAsync("Campaign/GetInfo")
				.WithFormUrlEncodedBody(parameters)
				.WithCancellationToken(cancellationToken)
				.AsCakeMailObject<Campaign>();
		}

		/// <summary>
		/// Retrieve the campaigns matching the filtering criteria.
		/// </summary>
		/// <param name="userKey">User Key of the user who initiates the call.</param>
		/// <param name="status">Filter using the campaign status. Possible value 'ongoing', 'closed'.</param>
		/// <param name="name">Filter using the campaign name.</param>
		/// <param name="sortBy">Sort resulting campaigns. Possible value 'created_on', 'name'.</param>
		/// <param name="sortDirection">Direction of the sorting. Possible value 'asc', 'desc'.</param>
		/// <param name="limit">Limit the number of resulting campaigns.</param>
		/// <param name="offset">Offset the beginning of resulting campaigns.</param>
		/// <param name="clientId">Client ID of the client in which the campaign is located.</param>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <returns>Array of <see cref="Campaign">campaigns</see> matching the filtering criteria.</returns>
		public Task<Campaign[]> GetListAsync(string userKey, CampaignStatus? status = null, string name = null, CampaignsSortBy? sortBy = null, SortDirection? sortDirection = null, int? limit = 0, int? offset = 0, long? clientId = null, CancellationToken cancellationToken = default)
		{
			var parameters = new List<KeyValuePair<string, object>>
			{
				new KeyValuePair<string, object>("user_key", userKey),
				new KeyValuePair<string, object>("count", "false")
			};
			if (status.HasValue) parameters.Add(new KeyValuePair<string, object>("status", status.Value.GetEnumMemberValue()));
			if (name != null) parameters.Add(new KeyValuePair<string, object>("name", name));
			if (sortBy.HasValue) parameters.Add(new KeyValuePair<string, object>("sort_by", sortBy.Value.GetEnumMemberValue()));
			if (sortDirection.HasValue) parameters.Add(new KeyValuePair<string, object>("direction", sortDirection.Value.GetEnumMemberValue()));
			if (limit > 0) parameters.Add(new KeyValuePair<string, object>("limit", limit));
			if (offset > 0) parameters.Add(new KeyValuePair<string, object>("offset", offset));
			if (clientId.HasValue) parameters.Add(new KeyValuePair<string, object>("client_id", clientId.Value));

			return _client
				.PostAsync("Campaign/GetList")
				.WithFormUrlEncodedBody(parameters)
				.WithCancellationToken(cancellationToken)
				.AsCakeMailObject<Campaign[]>("campaigns");
		}

		/// <summary>
		/// Get a count of campaigns matching the filtering criteria.
		/// </summary>
		/// <param name="userKey">User Key of the user who initiates the call.</param>
		/// <param name="status">Filter using the campaign status. Possible value 'ongoing', 'closed'.</param>
		/// <param name="name">Filter using the campaign name.</param>
		/// <param name="clientId">Client ID of the client in which the campaign is located.</param>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <returns>The count of campaigns matching the filtering criteria.</returns>
		public Task<long> GetCountAsync(string userKey, CampaignStatus? status = null, string name = null, long? clientId = null, CancellationToken cancellationToken = default)
		{
			var parameters = new List<KeyValuePair<string, object>>
			{
				new KeyValuePair<string, object>("user_key", userKey),
				new KeyValuePair<string, object>("count", "true")
			};
			if (status.HasValue) parameters.Add(new KeyValuePair<string, object>("status", status.Value.GetEnumMemberValue()));
			if (name != null) parameters.Add(new KeyValuePair<string, object>("name", name));
			if (clientId.HasValue) parameters.Add(new KeyValuePair<string, object>("client_id", clientId.Value));

			return _client
				.PostAsync("Campaign/GetList")
				.WithFormUrlEncodedBody(parameters)
				.WithCancellationToken(cancellationToken)
				.AsCakeMailObject<long>("count");
		}

		/// <summary>
		/// Update a campaign.
		/// </summary>
		/// <param name="userKey">User Key of the user who initiates the call.</param>
		/// <param name="campaignId">ID of the campaign.</param>
		/// <param name="status">The status of the campaign. Possible value 'ongoing', 'closed'.</param>
		/// <param name="name">The name of the campaign.</param>
		/// <param name="clientId">Client ID of the client in which the campaign is located.</param>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <returns>True if the record was updated.</returns>
		public Task<bool> UpdateAsync(string userKey, long campaignId, CampaignStatus? status = null, string name = null, long? clientId = null, CancellationToken cancellationToken = default)
		{
			var parameters = new List<KeyValuePair<string, object>>
			{
				new KeyValuePair<string, object>("user_key", userKey),
				new KeyValuePair<string, object>("campaign_id", campaignId),
			};
			if (status.HasValue) parameters.Add(new KeyValuePair<string, object>("status", status.Value.GetEnumMemberValue()));
			if (!string.IsNullOrEmpty(name)) parameters.Add(new KeyValuePair<string, object>("name", name));
			if (clientId.HasValue) parameters.Add(new KeyValuePair<string, object>("client_id", clientId.Value));

			return _client
				.PostAsync("Campaign/SetInfo")
				.WithFormUrlEncodedBody(parameters)
				.WithCancellationToken(cancellationToken)
				.AsCakeMailObject<bool>();
		}

		#endregion
	}
}


text:
using Pirate.PiVote.Gui;

namespace Pirate.PiVote.Circle.CreateVoting
{
  partial class EnterDataControl
  {
    /// <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 Component 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()
    {
      this.components = new System.ComponentModel.Container();
      this.urlTextBox = new MultiLanguageTextBox();
      this.questionLabel = new System.Windows.Forms.Label();
      this.questionListView = new System.Windows.Forms.ListView();
      this.textColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
      this.descriptionColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
      this.questionContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
      this.addToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
      this.removeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
      this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
      this.descriptionBox = new MultiLanguageTextBox();
      this.descriptionLabel = new System.Windows.Forms.Label();
      this.titleBox = new MultiLanguageTextBox();
      this.titleLabel = new System.Windows.Forms.Label();
      this.horizontalSplit = new System.Windows.Forms.SplitContainer();
      this.urlLabel = new System.Windows.Forms.Label();
      this.cancelButton = new System.Windows.Forms.Button();
      this.nextButton = new System.Windows.Forms.Button();
      this.clearButton = new System.Windows.Forms.Button();
      this.questionContextMenu.SuspendLayout();
      this.horizontalSplit.Panel1.SuspendLayout();
      this.horizontalSplit.Panel2.SuspendLayout();
      this.horizontalSplit.SuspendLayout();
      this.SuspendLayout();
      //
      // urlTextBox
      //
      this.urlTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.urlTextBox.Location = new System.Drawing.Point(101, 206);
      this.urlTextBox.Multiline = false;
      this.urlTextBox.Name = "urlTextBox";
      this.urlTextBox.ScrollBars = System.Windows.Forms.ScrollBars.None;
      this.urlTextBox.Size = new System.Drawing.Size(567, 24);
      this.urlTextBox.TabIndex = 46;
      this.urlTextBox.TextChanged += new System.EventHandler(this.UrlBox_TextChanged);
      //
      // questionLabel
      //
      this.questionLabel.AutoSize = true;
      this.questionLabel.Location = new System.Drawing.Point(1, 5);
      this.questionLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
      this.questionLabel.Name = "questionLabel";
      this.questionLabel.Size = new System.Drawing.Size(56, 14);
      this.questionLabel.TabIndex = 50;
      this.questionLabel.Text = "Questions";
      //
      // questionListView
      //
      this.questionListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                  | System.Windows.Forms.AnchorStyles.Left)
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.questionListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
            this.textColumnHeader,
            this.descriptionColumnHeader});
      this.questionListView.ContextMenuStrip = this.questionContextMenu;
      this.questionListView.FullRowSelect = true;
      this.questionListView.Location = new System.Drawing.Point(101, 2);
      this.questionListView.Margin = new System.Windows.Forms.Padding(2);
      this.questionListView.MultiSelect = false;
      this.questionListView.Name = "questionListView";
      this.questionListView.Size = new System.Drawing.Size(566, 225);
      this.questionListView.TabIndex = 47;
      this.questionListView.UseCompatibleStateImageBehavior = false;
      this.questionListView.View = System.Windows.Forms.View.Details;
      //
      // textColumnHeader
      //
      this.textColumnHeader.Text = "Text";
      this.textColumnHeader.Width = 150;
      //
      // descriptionColumnHeader
      //
      this.descriptionColumnHeader.Text = "Description";
      this.descriptionColumnHeader.Width = 390;
      //
      // questionContextMenu
      //
      this.questionContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
            this.addToolStripMenuItem,
            this.removeToolStripMenuItem,
            this.editToolStripMenuItem});
      this.questionContextMenu.Name = "questionContextMenu";
      this.questionContextMenu.Size = new System.Drawing.Size(114, 70);
      this.questionContextMenu.Opening += new System.ComponentModel.CancelEventHandler(this.questionContextMenu_Opening);
      //
      // addToolStripMenuItem
      //
      this.addToolStripMenuItem.Name = "addToolStripMenuItem";
      this.addToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
      this.addToolStripMenuItem.Text = "&Add";
      this.addToolStripMenuItem.Click += new System.EventHandler(this.addToolStripMenuItem_Click);
      //
      // removeToolStripMenuItem
      //
      this.removeToolStripMenuItem.Name = "removeToolStripMenuItem";
      this.removeToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
      this.removeToolStripMenuItem.Text = "&Remove";
      this.removeToolStripMenuItem.Click += new System.EventHandler(this.removeToolStripMenuItem_Click);
      //
      // editToolStripMenuItem
      //
      this.editToolStripMenuItem.Name = "editToolStripMenuItem";
      this.editToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
      this.editToolStripMenuItem.Text = "&Edit";
      this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click);
      //
      // descriptionBox
      //
      this.descriptionBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                  | System.Windows.Forms.AnchorStyles.Left)
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.descriptionBox.Location = new System.Drawing.Point(102, 31);
      this.descriptionBox.Multiline = true;
      this.descriptionBox.Name = "descriptionBox";
      this.descriptionBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
      this.descriptionBox.Size = new System.Drawing.Size(566, 169);
      this.descriptionBox.TabIndex = 45;
      this.descriptionBox.TextChanged += new System.EventHandler(this.DescriptionBox_TextChanged);
      //
      // descriptionLabel
      //
      this.descriptionLabel.AutoSize = true;
      this.descriptionLabel.Location = new System.Drawing.Point(2, 34);
      this.descriptionLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
      this.descriptionLabel.Name = "descriptionLabel";
      this.descriptionLabel.Size = new System.Drawing.Size(61, 14);
      this.descriptionLabel.TabIndex = 49;
      this.descriptionLabel.Text = "Description";
      //
      // titleBox
      //
      this.titleBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.titleBox.Location = new System.Drawing.Point(101, 3);
      this.titleBox.Multiline = false;
      this.titleBox.Name = "titleBox";
      this.titleBox.ScrollBars = System.Windows.Forms.ScrollBars.None;
      this.titleBox.Size = new System.Drawing.Size(566, 22);
      this.titleBox.TabIndex = 44;
      this.titleBox.TextChanged += new System.EventHandler(this.TitleBox_TextChanged);
      //
      // titleLabel
      //
      this.titleLabel.AutoSize = true;
      this.titleLabel.Location = new System.Drawing.Point(2, 6);
      this.titleLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
      this.titleLabel.Name = "titleLabel";
      this.titleLabel.Size = new System.Drawing.Size(26, 14);
      this.titleLabel.TabIndex = 48;
      this.titleLabel.Text = "Title";
      //
      // horizontalSplit
      //
      this.horizontalSplit.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                  | System.Windows.Forms.AnchorStyles.Left)
                  | System.Windows.Forms.AnchorStyles.Right)));
      this.horizontalSplit.Location = new System.Drawing.Point(3, 0);
      this.horizontalSplit.Name = "horizontalSplit";
      this.horizontalSplit.Orientation = System.Windows.Forms.Orientation.Horizontal;
      //
      // horizontalSplit.Panel1
      //
      this.horizontalSplit.Panel1.Controls.Add(this.urlLabel);
      this.horizontalSplit.Panel1.Controls.Add(this.urlTextBox);
      this.horizontalSplit.Panel1.Controls.Add(this.titleLabel);
      this.horizontalSplit.Panel1.Controls.Add(this.descriptionLabel);
      this.horizontalSplit.Panel1.Controls.Add(this.descriptionBox);
      this.horizontalSplit.Panel1.Controls.Add(this.titleBox);
      //
      // horizontalSplit.Panel2
      //
      this.horizontalSplit.Panel2.Controls.Add(this.questionListView);
      this.horizontalSplit.Panel2.Controls.Add(this.questionLabel);
      this.horizontalSplit.Size = new System.Drawing.Size(670, 466);
      this.horizontalSplit.SplitterDistance = 233;
      this.horizontalSplit.TabIndex = 51;
      //
      // urlLabel
      //
      this.urlLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
      this.urlLabel.AutoSize = true;
      this.urlLabel.Location = new System.Drawing.Point(2, 209);
      this.urlLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
      this.urlLabel.Name = "urlLabel";
      this.urlLabel.Size = new System.Drawing.Size(23, 14);
      this.urlLabel.TabIndex = 50;
      this.urlLabel.Text = "Url:";
      //
      // cancelButton
      //
      this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
      this.cancelButton.Location = new System.Drawing.Point(411, 472);
      this.cancelButton.Name = "cancelButton";
      this.cancelButton.Size = new System.Drawing.Size(128, 28);
      this.cancelButton.TabIndex = 53;
      this.cancelButton.Text = "&Cancel";
      this.cancelButton.UseVisualStyleBackColor = true;
      this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
      //
      // nextButton
      //
      this.nextButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
      this.nextButton.Font = new System.Drawing.Font("Arial", 8.25F);
      this.nextButton.Location = new System.Drawing.Point(545, 472);
      this.nextButton.Name = "nextButton";
      this.nextButton.Size = new System.Drawing.Size(128, 28);
      this.nextButton.TabIndex = 52;
      this.nextButton.Text = "&Next";
      this.nextButton.UseVisualStyleBackColor = true;
      this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
      //
      // clearButton
      //
      this.clearButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
      this.clearButton.Location = new System.Drawing.Point(277, 472);
      this.clearButton.Name = "clearButton";
      this.clearButton.Size = new System.Drawing.Size(128, 28);
      this.clearButton.TabIndex = 54;
      this.clearButton.Text = "&Clear";
      this.clearButton.UseVisualStyleBackColor = true;
      this.clearButton.Click += new System.EventHandler(this.clearButton_Click);
      //
      // EnterDataControl
      //
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 14F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.Controls.Add(this.clearButton);
      this.Controls.Add(this.cancelButton);
      this.Controls.Add(this.nextButton);
      this.Controls.Add(this.horizontalSplit);
      this.Name = "EnterDataControl";
      this.Size = new System.Drawing.Size(676, 503);
      this.questionContextMenu.ResumeLayout(false);
      this.horizontalSplit.Panel1.ResumeLayout(false);
      this.horizontalSplit.Panel1.PerformLayout();
      this.horizontalSplit.Panel2.ResumeLayout(false);
      this.horizontalSplit.Panel2.PerformLayout();
      this.horizontalSplit.ResumeLayout(false);
      this.ResumeLayout(false);

    }
    #endregion

    private MultiLanguageTextBox urlTextBox;
    private System.Windows.Forms.Label questionLabel;
    private System.Windows.Forms.ListView questionListView;
    private System.Windows.Forms.ColumnHeader textColumnHeader;
    private System.Windows.Forms.ColumnHeader descriptionColumnHeader;
    private MultiLanguageTextBox descriptionBox;
    private System.Windows.Forms.Label descriptionLabel;
    private MultiLanguageTextBox titleBox;
    private System.Windows.Forms.Label titleLabel;
    private System.Windows.Forms.SplitContainer horizontalSplit;
    private System.Windows.Forms.Button cancelButton;
    private System.Windows.Forms.Button nextButton;
    private System.Windows.Forms.Button clearButton;
    private System.Windows.Forms.ContextMenuStrip questionContextMenu;
    private System.Windows.Forms.ToolStripMenuItem addToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem;
    private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
    private System.Windows.Forms.Label urlLabel;
  }
}


text:
package no.acntech.sandbox;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class SpringBootWebServiceEndpointCxfApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootWebServiceEndpointCxfApplication.class, args);
    }
}


text:
package com.coolweather.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import org.json.JSONException;
import org.json.JSONObject;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.text.TextUtils;

import com.coolweather.db.CoolWeatherDB;
import com.coolweather.model.City;
import com.coolweather.model.Country;
import com.coolweather.model.Province;

public class Utility {
	/**
	 * ½âÎö·þÎñÆ÷·µ»ØµÄÊ¡¼¶Êý¾Ý
	 * @param coolWeatherDB
	 * @param response
	 * @return
	 */
	public synchronized static boolean handleProvinceResponse(CoolWeatherDB coolWeatherDB,String response){

		if(!TextUtils.isEmpty(response)){
			String[] allProvince=response.split(",");
			if(allProvince!=null&&allProvince.length>0){
				for(String p:allProvince){
					String[] array=p.split("\\|");
					Province province=new Province();
					province.setProvinceName(array[1]);
					province.setProvinceCode(array[0]);
					coolWeatherDB.saveProvince(province);
				}
				return true;
			}
		}
		return false;
	}

	/**
	 * ½«Êý¾Ý±£´æµ½Êý¾Ý¿â
	 * @param coolWeatherDB
	 * @param response
	 * @param provinceId
	 * @return
	 */
	public synchronized static boolean handleCityResponse(CoolWeatherDB coolWeatherDB,String response,int provinceId){

		if(!TextUtils.isEmpty(response)){
			String[] allCity=response.split(",");
			if(allCity!=null&&allCity.length>0){
				for(String c:allCity){
					String[] array=c.split("\\|");
					City city=new City();
					city.setCityName(array[1]);
					city.setCityCode(array[0]);
					city.setProvinceId(provinceId);
					coolWeatherDB.saveCity(city);
				}
				return true;
			}
		}
		return false;
	}

	public synchronized static boolean handleCountryResponse(CoolWeatherDB coolWeatherDB,String response,int cityId){

		if(!TextUtils.isEmpty(response)){
			String[] allCountry=response.split(",");
			if(allCountry!=null&&allCountry.length>0){
				for(String c:allCountry){
					String[] array=c.split("\\|");
					Country country=new Country();
					country.setCountryName(array[1]);
					country.setCountryCode(array[0]);
					country.setCityId(cityId);
					coolWeatherDB.saveCountry(country);
				}
				return true;
			}
		}
		return false;
	}

	public static void handleWeatherResponse(Context context,String response){
		try {
			JSONObject jsonObject=new JSONObject(response);
			JSONObject weatherInfo=jsonObject.getJSONObject("weatherinfo");
			String cityName=weatherInfo.getString("city");
			String weatherCode=weatherInfo.getString("cityid");
			String minTemp=weatherInfo.getString("temp1");
			String maxTemp=weatherInfo.getString("temp2");
			String weatherDesp=weatherInfo.getString("weather");
			String publishTime=weatherInfo.getString("ptime");
			saveWeatherInfo(context,cityName,weatherCode,minTemp,maxTemp,weatherDesp,publishTime);
		} catch (JSONException e) {

			e.printStackTrace();
		}
	}

	private static void saveWeatherInfo(Context context, String cityName,
			String weatherCode, String minTemp, String maxTemp,
			String weatherDesp, String publishTime) {
		SimpleDateFormat sdf=new SimpleDateFormat("yyyyÄêMÔÂdÈÕ",Locale.CHINA);
		SharedPreferences.Editor editor=PreferenceManager.getDefaultSharedPreferences(context).edit();
		editor.putBoolean("city_selected", true);
		editor.putString("city_name", cityName);
		editor.putString("weather_code", weatherCode);
		editor.putString("minTemp", minTemp);
		editor.putString("maxTemp", maxTemp);
		editor.putString("weather_desp",weatherDesp);
		editor.putString("publish_time", publishTime);
		editor.putString("current_date",sdf.format(new Date()));
		editor.commit();

	}
}


text:
/* ** GENEREATED FILE - DO NOT MODIFY ** */
package com.wilutions.mslib.outlook;
import com.wilutions.com.*;

/**
 * OlMatchEntry.
 *
 */
@SuppressWarnings("all")
@CoInterface(guid="{73628D00-B812-419F-8212-3D62079E22DB}")
public class OlMatchEntry implements ComEnum {
  static boolean __typelib__loaded = __TypeLib.load();

  // Typed constants
  public final static OlMatchEntry olMatchEntryFirstLetter = new OlMatchEntry(0);
  public final static OlMatchEntry olMatchEntryComplete = new OlMatchEntry(1);
  public final static OlMatchEntry olMatchEntryNone = new OlMatchEntry(2);

  // Integer constants for bitsets and switch statements
  public final static int _olMatchEntryFirstLetter = 0;
  public final static int _olMatchEntryComplete = 1;
  public final static int _olMatchEntryNone = 2;

  // Value, readonly field.
  public final int value;

  // Private constructor, use valueOf to create an instance.
  private OlMatchEntry(int value) { this.value = value; }

  // Return one of the predefined typed constants for the given value or create a new object.
  public static  OlMatchEntry valueOf(int value) {
    switch(value) {
    case 0: return olMatchEntryFirstLetter;
    case 1: return olMatchEntryComplete;
    case 2: return olMatchEntryNone;
    default: return new OlMatchEntry(value);
    }
  }

  public String toString() {
    switch(value) {
    case 0: return "olMatchEntryFirstLetter";
    case 1: return "olMatchEntryComplete";
    case 2: return "olMatchEntryNone";
    default: {
      StringBuilder sbuf = new StringBuilder();
      sbuf.append("[").append(value).append("=");
      if ((value & 0) != 0) sbuf.append("|olMatchEntryFirstLetter");
      if ((value & 1) != 0) sbuf.append("|olMatchEntryComplete");
      if ((value & 2) != 0) sbuf.append("|olMatchEntryNone");
      return sbuf.toString();
      }
    }
  }
}


text:
package java.time.calendrical;

import static java.time.DayOfWeek.THURSDAY;
import static java.time.DayOfWeek.WEDNESDAY;
import static java.time.calendrical.ChronoField.DAY_OF_WEEK;
import static java.time.calendrical.ChronoField.EPOCH_DAY;
import static java.time.calendrical.ChronoField.YEAR;
import static java.time.calendrical.ChronoUnit.FOREVER;
import static java.time.calendrical.ChronoUnit.WEEKS;
import static java.time.calendrical.ChronoUnit.YEARS;

import java.time.Duration;
import java.time.LocalDate;
import java.time.calendrical.PeriodUnit.PeriodBetween;
import java.time.jdk8.Jdk8Methods;

/**
 * Fields and units supporting the week-based-year defined by ISO-8601.
 *

 * The ISO-8601 standard was originally intended as a data interchange format, defining a string format for
 * dates and times. However, it also defines an alternate way of expressing the date, based on the concept of
 * week-based-year.
 *

 * The date is expressed using three fields:
 *

 *

 *
{@link ChronoField#DAY_OF_WEEK DAY_OF_WEEK} - the standard field defining the day-of-week from Monday
 * (1) to Sunday (7)
 *
{@link #WEEK_OF_WEEK_BASED_YEAR} - the week within the week-based-year
 *
{@link #WEEK_BASED_YEAR WEEK_BASED_YEAR} - the week-based-year
 *

 *

 * The week-based-year itself is defined relative to the standard ISO proleptic year. It differs from the
 * standard year in that it always starts on a Monday.
 *

 * The first week of a week-based-year is the first Monday-based week of the standard ISO year that has at
 * least 4 days in the new year.
 *

 *

 *
If January 1st is Monday then week 1 starts on January 1st
 *
If January 1st is Tuesday then week 1 starts on December 31st of the previous standard year
 *
If January 1st is Wednesday then week 1 starts on December 30th of the previous standard year
 *
If January 1st is Thursday then week 1 starts on December 29th of the previous standard year
 *
If January 1st is Friday then week 1 starts on January 4th
 *
If January 1st is Saturday then week 1 starts on January 3rd
 *
If January 1st is Sunday then week 1 starts on January 2nd
 *

 *

 * There are 52 weeks in most week-based years, however on occasion there are 53 weeks.
 *

 * For example:
 *

 *

 *

 * Date
 * Day-of-week
 * Field values
 *

 *

 * 2008-12-28
 * Sunday
 * Week 52 of week-based-year 2008
 *

 *

 * 2008-12-29
 * Monday
 * Week 1 of week-based-year 2009
 *

 *

 * 2008-12-31
 * Wednesday
 * Week 1 of week-based-year 2009
 *

 *

 * 2009-01-01
 * Thursday
 * Week 1 of week-based-year 2009
 *

 *

 * 2009-01-04
 * Sunday
 * Week 1 of week-based-year 2009
 *

 *

 * 2009-01-05
 * Monday
 * Week 2 of week-based-year 2009
 *

 *

 *

 * This class is immutable and thread-safe.
 */
public final class ISOWeeks {

  /**
   * The field that represents the week-of-week-based-year.
   *

   * This field allows the week of the week-based-year value to be queried and set.
   *

   * This unit is an immutable and thread-safe enum.
   */
  public static final DateTimeField WEEK_OF_WEEK_BASED_YEAR = Field.WEEK_OF_WEEK_BASED_YEAR;

  /**
   * The field that represents the week-based-year.
   *

   * This field allows the week-based-year value to be queried and set.
   *

   * This unit is an immutable and thread-safe enum.
   */
  public static final DateTimeField WEEK_BASED_YEAR = Field.WEEK_BASED_YEAR;

  /**
   * The unit that represents week-based-years for the purpose of addition and subtraction.
   *

   * This allows a number of week-based-years to be added to, or subtracted from, a date. The unit is equal to
   * either 52 or 53 weeks. The estimated duration of a week-based-year is the same as that of a standard ISO
   * year at {@code 365.2425 Days}.
   *

   * The rules for addition add the number of week-based-years to the existing value for the week-based-year
   * field. If the resulting week-based-year only has 52 weeks, then the date will be in week 1 of the
   * following week-based-year.
   *

   * This unit is an immutable and thread-safe enum.
   */
  public static final PeriodUnit WEEK_BASED_YEARS = Unit.WEEK_BASED_YEARS;

  /**
   * Restricted constructor.
   */
  private ISOWeeks() {

    throw new AssertionError("Not instantiable");
  }

  // -----------------------------------------------------------------------
  /**
   * Implementation of the field.
   */
  private static enum Field implements DateTimeField {
    WEEK_OF_WEEK_BASED_YEAR {

      @Override
      public String getName() {

        return "WeekOfWeekBasedYear";
      }

      @Override
      public PeriodUnit getBaseUnit() {

        return WEEKS;
      }

      @Override
      public PeriodUnit getRangeUnit() {

        return WEEK_BASED_YEARS;
      }

      @Override
      public DateTimeValueRange range() {

        return DateTimeValueRange.of(1, 52, 53);
      }

      @Override
      public boolean doIsSupported(DateTimeAccessor dateTime) {

        return dateTime.isSupported(EPOCH_DAY);
      }

      @Override
      public DateTimeValueRange doRange(DateTimeAccessor dateTime) {

        return getWeekRange(LocalDate.from(dateTime));
      }

      @Override
      public long doGet(DateTimeAccessor dateTime) {

        return getWeek(LocalDate.from(dateTime));
      }

      @Override
      public <R extends DateTime> R doWith(R dateTime, long newValue) {

        DateTimeValueRange.of(1, 53).checkValidValue(newValue, this);
        return (R) dateTime.plus(Jdk8Methods.safeSubtract(newValue, doGet(dateTime)), WEEKS);
      }
    },
    WEEK_BASED_YEAR {

      @Override
      public String getName() {

        return "WeekBasedYear";
      }

      @Override
      public PeriodUnit getBaseUnit() {

        return WEEK_BASED_YEARS;
      }

      @Override
      public PeriodUnit getRangeUnit() {

        return FOREVER;
      }

      @Override
      public DateTimeValueRange range() {

        return YEAR.range();
      }

      @Override
      public boolean doIsSupported(DateTimeAccessor dateTime) {

        return dateTime.isSupported(EPOCH_DAY);
      }

      @Override
      public DateTimeValueRange doRange(DateTimeAccessor dateTime) {

        return YEAR.range();
      }

      @Override
      public long doGet(DateTimeAccessor dateTime) {

        return getWeekBasedYear(LocalDate.from(dateTime));
      }

      @Override
      public <R extends DateTime> R doWith(R dateTime, long newValue) {

        int newVal = range().checkValidIntValue(newValue, WEEK_BASED_YEAR);
        LocalDate date = LocalDate.from(dateTime);
        int week = getWeek(date);
        date = date.withDayOfYear(180).withYear(newVal).with(WEEK_OF_WEEK_BASED_YEAR, week);
        return (R) date.with(date);
      }
    };

    @Override
    public boolean resolve(DateTimeBuilder builder, long value) {

      Long[] values = builder.queryFieldValues(WEEK_BASED_YEAR, WEEK_OF_WEEK_BASED_YEAR, DAY_OF_WEEK);
      if (values[0] != null && values[1] != null && values[2] != null) {
        int wby = WEEK_BASED_YEAR.range().checkValidIntValue(values[0], WEEK_BASED_YEAR);
        int week = WEEK_OF_WEEK_BASED_YEAR.range().checkValidIntValue(values[1], WEEK_OF_WEEK_BASED_YEAR);
        int dow = DAY_OF_WEEK.range().checkValidIntValue(values[2], DAY_OF_WEEK);
        LocalDate date = LocalDate.of(wby, 2, 1).with(WEEK_OF_WEEK_BASED_YEAR, week).with(DAY_OF_WEEK, dow);
        builder.addFieldValue(EPOCH_DAY, date.toEpochDay());
        builder.removeFieldValues(WEEK_BASED_YEAR, WEEK_OF_WEEK_BASED_YEAR, DAY_OF_WEEK);
      }
      return false;
    }

    // JDK8 default interface
    // -------------------------------------------------------------------------
    @Override
    public int compare(DateTimeAccessor dateTime1, DateTimeAccessor dateTime2) {

      // return Long.compare(dateTime1.getLong(this), dateTime2.getLong(this));
      long x = dateTime1.getLong(this);
      long y = dateTime2.getLong(this);
      return (x < y) ? -1 : ((x == y) ? 0 : 1);
    }

    private static DateTimeValueRange getWeekRange(LocalDate date) {

      int wby = getWeekBasedYear(date);
      date = date.withDayOfYear(1).withYear(wby);
      // 53 weeks if standard year starts on Thursday, or Wed in a leap year
      if (date.getDayOfWeek() == THURSDAY || (date.getDayOfWeek() == WEDNESDAY && date.isLeapYear())) {
        return DateTimeValueRange.of(1, 53);
      }
      return DateTimeValueRange.of(1, 52);
    }

    private static int getWeek(LocalDate date) {

      int dow0 = date.getDayOfWeek().ordinal();
      int doy0 = date.getDayOfYear() - 1;
      int doyThu0 = doy0 + (3 - dow0); // adjust to mid-week Thursday (which is 3 indexed from zero)
      int alignedWeek = doyThu0 / 7;
      int firstThuDoy0 = doyThu0 - (alignedWeek * 7);
      int firstMonDoy0 = firstThuDoy0 - 3;
      if (firstMonDoy0 < -3) {
        firstMonDoy0 += 7;
      }
      if (doy0 < firstMonDoy0) {
        return (int) getWeekRange(date.withDayOfYear(180).minusYears(1)).getMaximum();
      }
      int week = ((doy0 - firstMonDoy0) / 7) + 1;
      if (week == 53) {
        if ((firstMonDoy0 == -3 || (firstMonDoy0 == -2 && date.isLeapYear())) == false) {
          week = 1;
        }
      }
      return week;
    }

    private static int getWeekBasedYear(LocalDate date) {

      int year = date.getYear();
      int doy = date.getDayOfYear();
      if (doy <= 3) {
        int dow = date.getDayOfWeek().ordinal();
        if (doy - dow < -2) {
          year--;
        }
      } else if (doy >= 363) {
        int dow = date.getDayOfWeek().ordinal();
        doy = doy - 363 - (date.isLeapYear() ? 1 : 0);
        if (doy - dow >= 0) {
          year++;
        }
      }
      return year;
    }
  }

  // -----------------------------------------------------------------------
  /**
   * Implementation of the period unit.
   */
  private static enum Unit implements PeriodUnit {
    WEEK_BASED_YEARS;

    @Override
    public String getName() {

      return "WeekBasedYears";
    }

    @Override
    public Duration getDuration() {

      return YEARS.getDuration();
    }

    @Override
    public boolean isDurationEstimated() {

      return true;
    }

    @Override
    public boolean isSupported(DateTime dateTime) {

      return dateTime.isSupported(EPOCH_DAY);
    }

    @Override
    public <R extends DateTime> R doPlus(R dateTime, long periodToAdd) {

      return (R) dateTime.with(WEEK_BASED_YEAR, Jdk8Methods.safeAdd(dateTime.get(WEEK_BASED_YEAR), periodToAdd));
    }

    @Override
    public <R extends DateTime> PeriodBetween between(R dateTime1, R dateTime2) {

      long period = Jdk8Methods.safeSubtract(dateTime2.getLong(WEEK_BASED_YEAR), dateTime1.getLong(WEEK_BASED_YEAR));
      return new Between(period, WEEK_BASED_YEARS);
    }
  }

  // -----------------------------------------------------------------------
  /**
   * Implementation of {@code PeriodBetween}.
   */
  private static final class Between implements PeriodBetween {

    private final long amount;

    private final PeriodUnit unit;

    Between(long amount, PeriodUnit unit) {

      this.amount = amount;
      this.unit = unit;
    }

    @Override
    public long getAmount() {

      return this.amount;
    }

    @Override
    public PeriodUnit getUnit() {

      return this.unit;
    }

    @Override
    public DateTime doPlusAdjustment(DateTime dateTime) {

      return dateTime.plus(this.amount, this.unit);
    }

    @Override
    public DateTime doMinusAdjustment(DateTime dateTime) {

      return dateTime.minus(this.amount, this.unit);
    }

    @Override
    public boolean equals(Object obj) {

      if (obj instanceof Between) {
        Between other = (Between) obj;
        return this.amount == other.amount && this.unit.equals(other.unit);
      }
      return false;
    }

    @Override
    public int hashCode() {

      return ((int) (this.amount ^ (this.amount >>> 32))) ^ this.unit.hashCode();
    };

    @Override
    public String toString() {

      return this.amount + " " + this.unit;
    }
  }

}


text:
use ast::Statement;
use grammar::{parse_Program, parse_Stmt};
use lalrpop_util;
use token::{Error, Token, Tokenizer};

pub type ParseError<'input> = lalrpop_util::ParseError<usize, Token<'input>, Error>;

pub fn parse_program(input: &str) -> Result<Vec<Statement>, ParseError> {
    let tokenizer = Tokenizer::new(input, 0);
    parse_Program(input, tokenizer)
}

pub fn parse_stmt(input: &str) -> Result<Statement, ParseError> {
    let tokenizer = Tokenizer::new(input, 0);
    parse_Stmt(input, tokenizer)
}


text:
package org.apache.servicecomb.core.invocation.endpoint;

import org.apache.servicecomb.core.Endpoint;

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;

public final class EndpointCacheUtils {
  private static final LoadingCache<String, Endpoint> CACHE = CacheBuilder.newBuilder()
      .maximumSize(10000)
      .build(new CacheLoader<String, Endpoint>() {
        @Override
        public Endpoint load(String uri) {
          return EndpointCacheUtils.create(uri);
        }
      });

  /**
   * @param uri https://www.abc.com:12345
   * @return endpoint
   */
  public static Endpoint getOrCreate(String uri) {
    return CACHE.getUnchecked(uri);
  }

  public static Endpoint create(String uri) {
    return EndpointUtils.parse(EndpointUtils.formatFromUri(uri));
  }
}


text:
require_relative '../item'

module Gemwarrior
  class Bed < Item
    # CONSTANTS
    USE_TEXT = '** ZZZZZ **'

    def initialize
      super

      self.name         = 'bed'
      self.name_display = 'Bed'
      self.description  = 'The place where you sleep when you are not adventuring.'
    end

    def use(world)
      if world.player.at_full_hp?
        puts 'You feel perfectly healthy and decide not to actually use the bed. Besides, the trail of fire ants currently leading up to and around the furniture seem somehow uninviting.'
        { type: nil, data: nil }
      else
        Animation.run(phrase: USE_TEXT)
        puts 'You unmake the bed, get under the covers, close your eyes, and begin to think about all the things you need to do today. You realize sleep is not one of them and quickly get back up, remake the bed, and get on about your day.'
        puts '>> You regain all of your hit points.'.colorize(:green)
        { type: 'rest', data: world.player.hp_max-world.player.hp_cur }
      end
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using ObjectSerialization.Builders.Types;

namespace ObjectSerialization.Builders
{
    internal class BuildContext<T>
    {
        public readonly LabelTarget ReadReturnLabel = Expression.Label(typeof(object), "ret");
        public readonly ParameterExpression ReaderObject = Expression.Parameter(typeof(BinaryReader), "r");

        public readonly ParameterExpression WriteObject = Expression.Variable(typeof(T), "v");
        public readonly ParameterExpression WriterObject = Expression.Parameter(typeof(BinaryWriter), "w");
        private readonly List<Expression> _readExpressions = new List<Expression>();
        private readonly List<Expression> _writeExpressions = new List<Expression>();
        private readonly ParameterExpression _writeParameter = Expression.Parameter(typeof(object), "o");
        public ParameterExpression ReadResultObject { get; private set; }

        public BuildContext()
        {
            _writeExpressions.Add(Expression.Assign(WriteObject, Expression.Convert(_writeParameter, typeof(T))));
        }

        public BuildContext(ParameterExpression readResult)
            : this()
        {
            ReadResultObject = readResult;
            _readExpressions.Add(Expression.Assign(ReadResultObject, BaseTypeSerializer.InstantiateNew(typeof(T))));
        }

        public void AddReadExpression(Expression expr)
        {
            _readExpressions.Add(expr);
        }

        public void AddWriteExpression(Expression expr)
        {
            _writeExpressions.Add(expr);
        }

        public Func<BinaryReader, object> GetDeserializeFn()
        {
            if (ReadResultObject != null)
                _readExpressions.Add(ReturnValue(ReadResultObject));

            List<Expression> expressions = _readExpressions.ToList();

            expressions.Add(Expression.Label(ReadReturnLabel, Expression.Convert(Expression.Default(typeof(T)), typeof(object))));
            Expression body = Expression.Block(ReadResultObject == null ? null : new[] { ReadResultObject }, expressions);
            Expression<Func<BinaryReader, object>> expression = Expression.Lambda<Func<BinaryReader, object>>(body, ReaderObject);
#if DEBUG
			DumpExpression("Deserialize", expression);
#endif
            return expression.Compile();
        }

        public Action<BinaryWriter, object> GetSerializeFn()
        {
            BlockExpression blockExpression = Expression.Block(new[] { WriteObject }, _writeExpressions);
            Expression<Action<BinaryWriter, object>> expression = Expression.Lambda<Action<BinaryWriter, object>>(blockExpression, WriterObject, _writeParameter);
#if DEBUG
			DumpExpression("Serialize", expression);
#endif
            return expression.Compile();
        }

        public Expression ReturnValue(Expression result)
        {
            return Expression.Return(ReadReturnLabel, Expression.Convert(result, typeof(object)), typeof(object));
        }

        private void DumpExpression(string operation, Expression expression)
        {
            object value = typeof(Expression).GetProperty("DebugView", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)
                      .GetValue(expression, null);
            Console.Write("{0} {1}: {2}\n", typeof(T).Name, operation, value);
        }
    }
}


text:
module.exports = {
  client: 'sqlite3',
  debug: false,
  connection: {
    filename: ':memory:'
  },
  directory: __dirname + '/migrations',
  pool: {
    afterCreate: function (conn, cb) {
      conn.run('PRAGMA foreign_keys = ON', cb);
    }
  }
};


text:
package org.lwjgl.ovr;

import javax.annotation.*;

import java.nio.*;

import org.lwjgl.*;
import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;

/**
 * Field Of View (FOV) in tangent of the angle units. As an example, for a standard 90 degree vertical FOV, we would have:
 *
 *

 * { UpTan = tan(90 degrees / 2), DownTan = tan(90 degrees / 2) }

 *
 *
Layout

 *
 *

 * struct ovrFovPort {
 *     float {@link #UpTan};
 *     float {@link #DownTan};
 *     float {@link #LeftTan};
 *     float {@link #RightTan};
 * }

 */
@NativeType("struct ovrFovPort")
public class OVRFovPort extends Struct implements NativeResource {

    /** The struct size in bytes. */
    public static final int SIZEOF;

    /** The struct alignment in bytes. */
    public static final int ALIGNOF;

    /** The struct member offsets. */
    public static final int
        UPTAN,
        DOWNTAN,
        LEFTTAN,
        RIGHTTAN;

    static {
        Layout layout = __struct(
            __member(4),
            __member(4),
            __member(4),
            __member(4)
        );

        SIZEOF = layout.getSize();
        ALIGNOF = layout.getAlignment();

        UPTAN = layout.offsetof(0);
        DOWNTAN = layout.offsetof(1);
        LEFTTAN = layout.offsetof(2);
        RIGHTTAN = layout.offsetof(3);
    }

    /**
     * Creates a {@code OVRFovPort} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be
     * visible to the struct instance and vice versa.
     *
     *
The created instance holds a strong reference to the container object.

     */
    public OVRFovPort(ByteBuffer container) {
        super(memAddress(container), __checkContainer(container, SIZEOF));
    }

    @Override
    public int sizeof() { return SIZEOF; }

    /** tangent of the angle between the viewing vector and top edge of the FOV */
    public float UpTan() { return nUpTan(address()); }
    /** tangent of the angle between the viewing vector and bottom edge of the FOV */
    public float DownTan() { return nDownTan(address()); }
    /** tangent of the angle between the viewing vector and left edge of the FOV */
    public float LeftTan() { return nLeftTan(address()); }
    /** tangent of the angle between the viewing vector and right edge of the FOV */
    public float RightTan() { return nRightTan(address()); }

    /** Sets the specified value to the {@link #UpTan} field. */
    public OVRFovPort UpTan(float value) { nUpTan(address(), value); return this; }
    /** Sets the specified value to the {@link #DownTan} field. */
    public OVRFovPort DownTan(float value) { nDownTan(address(), value); return this; }
    /** Sets the specified value to the {@link #LeftTan} field. */
    public OVRFovPort LeftTan(float value) { nLeftTan(address(), value); return this; }
    /** Sets the specified value to the {@link #RightTan} field. */
    public OVRFovPort RightTan(float value) { nRightTan(address(), value); return this; }

    /** Initializes this struct with the specified values. */
    public OVRFovPort set(
        float UpTan,
        float DownTan,
        float LeftTan,
        float RightTan
    ) {
        UpTan(UpTan);
        DownTan(DownTan);
        LeftTan(LeftTan);
        RightTan(RightTan);

        return this;
    }

    /**
     * Copies the specified struct data to this struct.
     *
     * @param src the source struct
     *
     * @return this struct
     */
    public OVRFovPort set(OVRFovPort src) {
        memCopy(src.address(), address(), SIZEOF);
        return this;
    }

    // -----------------------------------

    /** Returns a new {@code OVRFovPort} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
    public static OVRFovPort malloc() {
        return wrap(OVRFovPort.class, nmemAllocChecked(SIZEOF));
    }

    /** Returns a new {@code OVRFovPort} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
    public static OVRFovPort calloc() {
        return wrap(OVRFovPort.class, nmemCallocChecked(1, SIZEOF));
    }

    /** Returns a new {@code OVRFovPort} instance allocated with {@link BufferUtils}. */
    public static OVRFovPort create() {
        ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
        return wrap(OVRFovPort.class, memAddress(container), container);
    }

    /** Returns a new {@code OVRFovPort} instance for the specified memory address. */
    public static OVRFovPort create(long address) {
        return wrap(OVRFovPort.class, address);
    }

    /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
    @Nullable
    public static OVRFovPort createSafe(long address) {
        return address == NULL ? null : wrap(OVRFovPort.class, address);
    }

    /**
     * Returns a new {@link OVRFovPort.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
     *
     * @param capacity the buffer capacity
     */
    public static OVRFovPort.Buffer malloc(int capacity) {
        return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
    }

    /**
     * Returns a new {@link OVRFovPort.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
     *
     * @param capacity the buffer capacity
     */
    public static OVRFovPort.Buffer calloc(int capacity) {
        return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity);
    }

    /**
     * Returns a new {@link OVRFovPort.Buffer} instance allocated with {@link BufferUtils}.
     *
     * @param capacity the buffer capacity
     */
    public static OVRFovPort.Buffer create(int capacity) {
        ByteBuffer container = __create(capacity, SIZEOF);
        return wrap(Buffer.class, memAddress(container), capacity, container);
    }

    /**
     * Create a {@link OVRFovPort.Buffer} instance at the specified memory.
     *
     * @param address  the memory address
     * @param capacity the buffer capacity
     */
    public static OVRFovPort.Buffer create(long address, int capacity) {
        return wrap(Buffer.class, address, capacity);
    }

    /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
    @Nullable
    public static OVRFovPort.Buffer createSafe(long address, int capacity) {
        return address == NULL ? null : wrap(Buffer.class, address, capacity);
    }

    // -----------------------------------

    /** Deprecated for removal in 3.4.0. Use {@link #malloc(MemoryStack)} instead. */
    @Deprecated public static OVRFovPort mallocStack() { return malloc(stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(MemoryStack)} instead. */
    @Deprecated public static OVRFovPort callocStack() { return calloc(stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #malloc(MemoryStack)} instead. */
    @Deprecated public static OVRFovPort mallocStack(MemoryStack stack) { return malloc(stack); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(MemoryStack)} instead. */
    @Deprecated public static OVRFovPort callocStack(MemoryStack stack) { return calloc(stack); }
    /** Deprecated for removal in 3.4.0. Use {@link #malloc(int, MemoryStack)} instead. */
    @Deprecated public static OVRFovPort.Buffer mallocStack(int capacity) { return malloc(capacity, stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(int, MemoryStack)} instead. */
    @Deprecated public static OVRFovPort.Buffer callocStack(int capacity) { return calloc(capacity, stackGet()); }
    /** Deprecated for removal in 3.4.0. Use {@link #malloc(int, MemoryStack)} instead. */
    @Deprecated public static OVRFovPort.Buffer mallocStack(int capacity, MemoryStack stack) { return malloc(capacity, stack); }
    /** Deprecated for removal in 3.4.0. Use {@link #calloc(int, MemoryStack)} instead. */
    @Deprecated public static OVRFovPort.Buffer callocStack(int capacity, MemoryStack stack) { return calloc(capacity, stack); }

    /**
     * Returns a new {@code OVRFovPort} instance allocated on the specified {@link MemoryStack}.
     *
     * @param stack the stack from which to allocate
     */
    public static OVRFovPort malloc(MemoryStack stack) {
        return wrap(OVRFovPort.class, stack.nmalloc(ALIGNOF, SIZEOF));
    }

    /**
     * Returns a new {@code OVRFovPort} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
     *
     * @param stack the stack from which to allocate
     */
    public static OVRFovPort calloc(MemoryStack stack) {
        return wrap(OVRFovPort.class, stack.ncalloc(ALIGNOF, 1, SIZEOF));
    }

    /**
     * Returns a new {@link OVRFovPort.Buffer} instance allocated on the specified {@link MemoryStack}.
     *
     * @param stack    the stack from which to allocate
     * @param capacity the buffer capacity
     */
    public static OVRFovPort.Buffer malloc(int capacity, MemoryStack stack) {
        return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
    }

    /**
     * Returns a new {@link OVRFovPort.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
     *
     * @param stack    the stack from which to allocate
     * @param capacity the buffer capacity
     */
    public static OVRFovPort.Buffer calloc(int capacity, MemoryStack stack) {
        return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
    }

    // -----------------------------------

    /** Unsafe version of {@link #UpTan}. */
    public static float nUpTan(long struct) { return UNSAFE.getFloat(null, struct + OVRFovPort.UPTAN); }
    /** Unsafe version of {@link #DownTan}. */
    public static float nDownTan(long struct) { return UNSAFE.getFloat(null, struct + OVRFovPort.DOWNTAN); }
    /** Unsafe version of {@link #LeftTan}. */
    public static float nLeftTan(long struct) { return UNSAFE.getFloat(null, struct + OVRFovPort.LEFTTAN); }
    /** Unsafe version of {@link #RightTan}. */
    public static float nRightTan(long struct) { return UNSAFE.getFloat(null, struct + OVRFovPort.RIGHTTAN); }

    /** Unsafe version of {@link #UpTan(float) UpTan}. */
    public static void nUpTan(long struct, float value) { UNSAFE.putFloat(null, struct + OVRFovPort.UPTAN, value); }
    /** Unsafe version of {@link #DownTan(float) DownTan}. */
    public static void nDownTan(long struct, float value) { UNSAFE.putFloat(null, struct + OVRFovPort.DOWNTAN, value); }
    /** Unsafe version of {@link #LeftTan(float) LeftTan}. */
    public static void nLeftTan(long struct, float value) { UNSAFE.putFloat(null, struct + OVRFovPort.LEFTTAN, value); }
    /** Unsafe version of {@link #RightTan(float) RightTan}. */
    public static void nRightTan(long struct, float value) { UNSAFE.putFloat(null, struct + OVRFovPort.RIGHTTAN, value); }

    // -----------------------------------

    /** An array of {@link OVRFovPort} structs. */
    public static class Buffer extends StructBuffer<OVRFovPort, Buffer> implements NativeResource {

        private static final OVRFovPort ELEMENT_FACTORY = OVRFovPort.create(-1L);

        /**
         * Creates a new {@code OVRFovPort.Buffer} instance backed by the specified container.
         *
         * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
         * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
         * by {@link OVRFovPort#SIZEOF}, and its mark will be undefined.
         *
         *
The created buffer instance holds a strong reference to the container object.

         */
        public Buffer(ByteBuffer container) {
            super(container, container.remaining() / SIZEOF);
        }

        public Buffer(long address, int cap) {
            super(address, null, -1, 0, cap, cap);
        }

        Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
            super(address, container, mark, pos, lim, cap);
        }

        @Override
        protected Buffer self() {
            return this;
        }

        @Override
        protected OVRFovPort getElementFactory() {
            return ELEMENT_FACTORY;
        }

        /** @return the value of the {@link OVRFovPort#UpTan} field. */
        public float UpTan() { return OVRFovPort.nUpTan(address()); }
        /** @return the value of the {@link OVRFovPort#DownTan} field. */
        public float DownTan() { return OVRFovPort.nDownTan(address()); }
        /** @return the value of the {@link OVRFovPort#LeftTan} field. */
        public float LeftTan() { return OVRFovPort.nLeftTan(address()); }
        /** @return the value of the {@link OVRFovPort#RightTan} field. */
        public float RightTan() { return OVRFovPort.nRightTan(address()); }

        /** Sets the specified value to the {@link OVRFovPort#UpTan} field. */
        public OVRFovPort.Buffer UpTan(float value) { OVRFovPort.nUpTan(address(), value); return this; }
        /** Sets the specified value to the {@link OVRFovPort#DownTan} field. */
        public OVRFovPort.Buffer DownTan(float value) { OVRFovPort.nDownTan(address(), value); return this; }
        /** Sets the specified value to the {@link OVRFovPort#LeftTan} field. */
        public OVRFovPort.Buffer LeftTan(float value) { OVRFovPort.nLeftTan(address(), value); return this; }
        /** Sets the specified value to the {@link OVRFovPort#RightTan} field. */
        public OVRFovPort.Buffer RightTan(float value) { OVRFovPort.nRightTan(address(), value); return this; }

    }

}


text:
#ifndef FROG_COMMAND_HPP
#define FROG_COMMAND_HPP

#include <memory>

namespace frog{

  /*!
   * Command handles an action. This class is abstract and should be inherited
   * while defining execute().
   */
  class Command
  {

  public:
    typedef std::shared_ptr<Command> PTR;

    //// operations ////
  public:

    Command();

    virtual ~Command();

    /*!
     * @brief Performs the command.
     */
    virtual void execute() = 0;

    /*!
     * @brief Shortcut for execute()
     */
    void operator()();

    /*!
     * @brief Undoes the action trigger by execution
     * @detail If not overloaded, does nothing
     */
    void undo();

  };

}

#endif


text:
namespace NanoByte.Common.Undo;

/// <summary>
/// Contains test methods for <see cref="AddToCollection{T}"/> and <see cref="RemoveFromCollection{T}"/>.
/// </summary>
public class CollectionTest
{
    [Fact]
    public void TestAddToCollection()
    {
        var collection = new List<string> {"a", "b", "c"};
        var command = new AddToCollection<string>(collection, "d");

        command.Execute();
        collection.Should().Contain("d");

        command.Undo();
        collection.Should().NotContain("d");
    }

    [Fact]
    public void TestRemoveFromCollection()
    {
        var collection = new List<string> {"a", "b", "c"};
        var command = new RemoveFromCollection<string>(collection, "b");

        command.Execute();
        collection.Should().Contain("a");
        collection.Should().NotContain("b");
        collection.Should().Contain("c");

        command.Undo();
        collection.Should().Contain("a");
        collection.Should().Contain("b");
        collection.Should().Contain("c");
    }
}


text:
Function Remove-IBLease{
    [CmdletBinding(DefaultParameterSetName='byObject',SupportsShouldProcess=$True,ConfirmImpact="High")]
    Param(
        [Parameter(Mandatory=$False,ValueFromPipelinebyPropertyName=$True,ParameterSetName='byRef')]
        [ValidateScript({If($_){Test-IBGridmaster $_ -quiet}})]
        [String]$Gridmaster,

        [Parameter(Mandatory=$False,ValueFromPipelinebyPropertyName=$True,ParameterSetName='byRef')]
		[System.Management.Automation.PSCredential]
		[System.Management.Automation.Credential()]
		$Credential,

        [Parameter(Mandatory=$True,ValueFromPipelinebyPropertyName=$True,ParameterSetName='byRef')]
        [ValidateNotNullorEmpty()]
        [String]$_Ref,

        [Parameter(Mandatory=$True,ParameterSetName='byObject',ValueFromPipeline=$True)]
        [IB_Lease[]]$Record
    )
    BEGIN{
        $FunctionName = $pscmdlet.MyInvocation.InvocationName.ToUpper()
        write-verbose "$FunctionName`:  Beginning Function"
		If (! $script:IBSession){
			write-verbose "Existing session to infoblox gridmaster does not exist."
			If ($gridmaster -and $Credential){
				write-verbose "Creating session to $gridmaster with user $($credential.username)"
				New-IBWebSession -gridmaster $Gridmaster -Credential $Credential -erroraction Stop  | out-null
			} else {
				write-error "Missing required parameters to connect to Gridmaster" -ea Stop
			}
		} else {
			write-verbose "Existing session to $script:IBGridmaster found"
		}
    }
    PROCESS{
            If ($pscmdlet.ParameterSetName -eq 'byRef'){
            $Record = [IB_Lease]::Get($Script:IBGridmaster,$Script:IBSession,$Script:IBWapiVersion,$_Ref)
            If ($Record){
                $Record | Remove-IBLease
            }
        }else {
			Foreach ($Item in $Record){
				If ($pscmdlet.ShouldProcess($Item)) {
					Write-Verbose "$FunctionName`:  Deleting Record $Item"
					$Item.Delete($Script:IBGridmaster,$Script:IBSession,$Script:IBWapiVersion)
				}
			}
		}
	}
    END{}
}


text:
using System.Text.Json;
using Azure.Core;

namespace Azure.ResourceManager.CosmosDB.Models
{
    public partial class TableResource : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            writer.WritePropertyName("id");
            writer.WriteStringValue(Id);
            writer.WriteEndObject();
        }

        internal static TableResource DeserializeTableResource(JsonElement element)
        {
            string id = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
            }
            return new TableResource(id);
        }
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package restaurant;
import facility.Facility;
/**
 *
 * @author Aya Aurora
 */
public class Restaurant extends Facility {
    //Constructor tanpa parameter
    public Restaurant() {
        setNilaiCell(-3);
    }

    //Copy Constructor
    public Restaurant(Restaurant r) {
        setNilaiCell(r.getNilaiCell());
    }
    @Override
    public void render() {
        System.out.print("&");
    }
}


text:
class WebContentRunner;

// Base component implementation for web-based content Runners. Each instance
// manages the lifetime of its own fuchsia::web::Frame, including associated
// resources and service bindings.  Runners for specialized web-based content
// (e.g. Cast applications) can extend this class to configure the Frame to
// their needs, publish additional APIs, etc.
class WebComponent : public fuchsia::sys::ComponentController,
                     public fuchsia::ui::app::ViewProvider,
                     public fuchsia::web::NavigationEventListener {
 public:
  // Creates a WebComponent encapsulating a web.Frame.
  // |debug_name| may be empty, or specified a name to use to uniquely identify
  //   the Frame in log output.
  // |runner| must out-live |this|.
  // [context| will be retained to provide component-specific services.
  //   If |context| includes an outgoing-directory request then the component
  //   will publish ViewProvider and Lifecycle services.
  // |controller_request| may optionally be supplied and used to control the
  //   lifetime of this component instance.
  WebComponent(base::StringPiece debug_name,
               WebContentRunner* runner,
               std::unique_ptr<base::StartupContext> context,
               fidl::InterfaceRequest<fuchsia::sys::ComponentController>
                   controller_request);

  WebComponent(const WebComponent&) = delete;
  WebComponent& operator=(const WebComponent&) = delete;

  ~WebComponent() override;

  // Enables remote debugging on this WebComponent. Must be called before
  // StartComponent().
  void EnableRemoteDebugging();

  // Starts this component. Must be called before LoadUrl().
  virtual void StartComponent();

  // Navigates this component's Frame to |url| and passes |extra_headers|.
  // May not be called until after StartComponent().
  void LoadUrl(const GURL& url,
               std::vector<fuchsia::net::http::Header> extra_headers);

  fuchsia::web::Frame* frame() const { return frame_.get(); }

  WebContentRunner* runner() const { return runner_; }

 protected:
  // Returns the component's startup context (e.g. incoming services, public
  // service directory, etc).
  base::StartupContext* startup_context() const {
    return startup_context_.get();
  }

  // fuchsia::sys::ComponentController implementation.
  void Kill() override;
  void Detach() override;

  // fuchsia::ui::app::ViewProvider implementation.
  void CreateView(
      zx::eventpair view_token,
      fidl::InterfaceRequest<fuchsia::sys::ServiceProvider> incoming_services,
      fidl::InterfaceHandle<fuchsia::sys::ServiceProvider> outgoing_services)
      override;
  void CreateViewWithViewRef(zx::eventpair view_token,
                             fuchsia::ui::views::ViewRefControl control_ref,
                             fuchsia::ui::views::ViewRef view_ref) override;
  void CreateView2(fuchsia::ui::app::CreateView2Args view_args) override;

  // fuchsia::web::NavigationEventListener implementation.
  // Used to detect when the Frame enters an error state (e.g. the top-level
  // content's Renderer process crashes).
  void OnNavigationStateChanged(
      fuchsia::web::NavigationState change,
      OnNavigationStateChangedCallback callback) override;

  // Reports the supplied exit-code and reason to the |controller_binding_| and
  // requests that the |runner_| delete this component. The EXITED |reason| is
  // used to indicate Frame disconnection, in which case the |exit_code| is set
  // to the status reported by the FramePtr's error handler.
  virtual void DestroyComponent(int64_t exit_code,
                                fuchsia::sys::TerminationReason reason);

 private:
  // Optional name with which to tag console log output from the Frame.
  const std::string debug_name_;

  // Refers to the owner of the web.Context hosting this component instance.
  WebContentRunner* const runner_ = nullptr;

  // Component context for this instance, including incoming services.
  const std::unique_ptr<base::StartupContext> startup_context_;

  fuchsia::web::FramePtr frame_;

  // Bindings used to manage the lifetime of this component instance.
  fidl::Binding<fuchsia::sys::ComponentController> controller_binding_;
  std::unique_ptr<cr_fuchsia::LifecycleImpl> lifecycle_;

  // If running as a Mod then these are used to e.g. RemoveSelfFromStory().
  fuchsia::modular::ModuleContextPtr module_context_;

  // Objects used for binding and exporting the ViewProvider service.
  std::unique_ptr<base::ScopedServiceBinding<fuchsia::ui::app::ViewProvider>>
      view_provider_binding_;

  // Termination reason and exit-code to be reported via the
  // sys::ComponentController::OnTerminated event.
  fuchsia::sys::TerminationReason termination_reason_ =
      fuchsia::sys::TerminationReason::UNKNOWN;
  int64_t termination_exit_code_ = 0;

  bool view_is_bound_ = false;

  bool component_started_ = false;
  bool enable_remote_debugging_ = false;

  // Used to watch for failures of the Frame's web content, including Renderer
  // process crashes.
  fidl::Binding<fuchsia::web::NavigationEventListener>
      navigation_listener_binding_;
};

#endif  // FUCHSIA_RUNNERS_COMMON_WEB_COMPONENT_H_


text:
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace AccessBridgeExplorer.Utils {
  public class WindowsHotKeyHandler : IWindowsHotKeyHandler, IMessageFilter {
    private readonly IWin32Window _control;
    private readonly int _id;
    private readonly Keys _keys;
    private bool _isActive;

    // ReSharper disable once InconsistentNaming
    private const uint WM_HOTKEY = 0x312;

    public WindowsHotKeyHandler(IWin32Window owner, int id, Keys keys) {
      _control = owner;
      _id = id;
      _keys = keys;
    }

    public event EventHandler KeyPressed;

    public bool IsRegistered {
      get { return _isActive; }
      set {
        if (value) {
          Register();
        } else {
          Unregister();
        }
      }
    }

    public void Dispose() {
      Unregister();
    }

    private void Register() {
      if (_isActive)
        return;

      Application.AddMessageFilter(this);
      try {
        var modifiers = default(Modifiers);
        if ((_keys & Keys.Shift) != 0) modifiers |= Modifiers.MOD_SHIFT;
        if ((_keys & Keys.Control) != 0) modifiers |= Modifiers.MOD_CONTROL;
        if ((_keys & Keys.Alt) != 0) modifiers |= Modifiers.MOD_ALT;
        //if ((key & Keys.Win) != 0) modifiers |= Modifiers.MOD_WIN;

        // Register the hotkey
        if (RegisterHotKey(_control.Handle, _id, (uint)modifiers, _keys & Keys.KeyCode) == 0) {
          ThrowLastWin32Error("Error registering global hotkey");
        }
        _isActive = true;
      } catch {
        Application.RemoveMessageFilter(this);
        throw;
      }
    }

    private void Unregister() {
      if (!_isActive)
        return;

      if (UnregisterHotKey(_control.Handle, _id) == 0) {
        ThrowLastWin32Error("Error unregistering global hotkey");
      }
      _isActive = false;

      Application.RemoveMessageFilter(this);
    }

    private static void ThrowLastWin32Error(string message) {
      // ReSharper disable once InconsistentNaming
      const int E_FAIL = (unchecked((int)0x80004005));
      try {
        var hr = Marshal.GetHRForLastWin32Error();
        if (hr >= 0)
          hr = E_FAIL;
        Marshal.ThrowExceptionForHR(hr);
      } catch (Exception e) {
        throw new ApplicationException(message, e);
      }
    }

    [DllImport("user32.dll", SetLastError = true)]
    private static extern int RegisterHotKey(IntPtr hWnd, int id, uint fsModifiers, Keys vk);

    [DllImport("user32.dll", SetLastError = true)]
    private static extern int UnregisterHotKey(IntPtr hWnd, int id);

    protected virtual void OnKeyPressed() {
      var handler = KeyPressed;
      if (handler != null) handler(this, EventArgs.Empty);
    }

    public bool PreFilterMessage(ref Message m) {
      // Only process WM_HOTKEY
      if (m.Msg != WM_HOTKEY)
        return false;

      // Only process our "id".
      var id = m.WParam.ToInt32();
      if (_control == null || _id != id)
        return false;

      OnKeyPressed();
      // TODO: Never eat the keystroke?
      return false;
    }

    [Flags]
    [SuppressMessage("ReSharper", "InconsistentNaming")]
    public enum Modifiers : uint {
      MOD_ALT = 0x1,
      MOD_CONTROL = 0x2,
      MOD_SHIFT = 0x4,
      MOD_WIN = 0x8,
    }
  }
}


text:
$("#loginBtn").parent().prepend(" <button id='dev' type='button' class='btn btn-sm btn-primary'>Dev v37.0</button>");
$("#loginBtn").parent().prepend(" <button id='prod' type='button' class='btn btn-sm btn-primary'>Prod v37.0</button>");

$("#prod").click(function() {
  $("#oauth_env").val("login.salesforce.com");
  $("#termsAccepted").prop("checked", true);
  $("#loginBtn").click();
});

$("#dev").click(function() {
  $("#oauth_env").val("test.salesforce.com");
  $("#termsAccepted").prop("checked", true);
  $("#loginBtn").click();
});


text:
'use strict';

var indexTest  = require('tad/lib/utils/index-test')

  , dirPath = require('path').resolve(__dirname, '../../../lib/ignore-modes');

module.exports = indexTest(dirPath, ['tad']);


text:
There is number of utilites for zakupki.gov.ru.

Catalog structure:

How to parse data from server:

Download and install PostgreSQL database.
1)Create User zakupki/zakupki in following way. You may choose any username as you wish.
Please create database for this user as well.
[dmitry@project26-as01 zakpars]$ psql -U postgres
postgres=# CREATE USER zakupki WITH PASSWORD 'zakupki';
postgres=# create database zakupki owner zakupki encoding 'UTF-8' template template0;
CREATE DATABASE

2) Prepare database for data loading:

Please execute scripts in catalog in following sequence:
./sql/01create_files_list.sql
./sql/02create_logs.sql
./sql/create_contracts.sql
./sql/create_notifications.sql
./sql/create_protocols.sql

with command

psql -U zakupki < <script_name.sql>

Please check that there is not postgres errors in output.
If all goes smooth at the end you wil have postgres database with empty schema and ready for data load.

Data loading from FTP::

In directory parallel_python you can find some scripts for data loading from FTP to postgres.
There are 2 main scrtipts which you can use:
./parallel_python/get_files_list.py for fill table files list with actual file names on FTP server, you should re-run sctipt for update fileslist on ftp.

./parallel_python/parseFilesFromFtp.py this is parser file. It shuld be run after some date will be inserted in files_list table.

Database connection credentials are stored in:
./parellel_python/settings.py

If you have any question please contact with me by mail: dixon3@yandex.ru


text:
topic: "IDEs for Python"
desc: "Development Environments, Alternatives to IDLE"
---

Python comes with an Integrated Development Environment (IDE) called IDLE.  The name IDLE is a tribute to Eric Idle,
who was an original member of the Monty Python comedy act that Python is named for—his name contains three of the letters in IDE.

Some folks like IDLE, and others don't.   Here are some alternatives to using IDLE:

* Using plain text editors such as vim, emacs, Sublime Text, along with using the Python interpreter at the command line.
* [Spyder](https://github.com/spyder-ide) the Scientific Python Development Environment.
* [PyCharm Edu](https://www.jetbrains.com/pycharm-edu/) A free and open-source tool for Python Educaton from [JetBrains](https://www.jetbrains.com), a for-profit
   company that makes IntelliJ, RubyMine, CLion and other professional IDEs.


text:
  Campneuseville est
       un village
       géographiquement positionné dans le département de Seine-Maritime en Haute-Normandie. On dénombrait 529 habitants en 2008.

Si vous envisagez de venir habiter à Campneuseville, vous pourrez aisément trouver une maison à vendre.

À coté de Campneuseville sont positionnées géographiquement les communes de
Réalcamp localisée à 2 km, 653 habitants,
Pierrecourt à 4 km, 461 habitants,
Saint-Léger-aux-Bois localisée à 4 km, 479 habitants,
Hodeng-au-Bosc à 3 km, 580 habitants,
Senarpont localisée à 5 km, 718 habitants,
Richemont située à 5 km, 468 habitants,
 entre autres. De plus, Campneuseville est située à seulement 27 km de Eu.

À Campneuseville, la valorisation moyenne à l'achat d'un appartement s'évalue à zero € du m² en vente. la valorisation moyenne d'une maison à l'achat se situe à 1 373 € du m². À la location la valorisation moyenne se situe à 0 € du m² mensuel.

La ville compte quelques  aménagements, elle dispose, entre autres, de un terrain de sport.

Le parc de logements, à Campneuseville, était réparti en 2011 en zero appartements et 228 maisons soit
 un marché plutôt équilibré.


text:
<?php

namespace DeliciousBrains\WP_Offload_Media\Gcp\Google\Cloud\Storage\Connection;

/**
 * Represents a connection to
 * [Cloud Storage](https://cloud.google.com/storage/).
 */
interface ConnectionInterface
{
    /**
     * @param array $args
     */
    public function deleteAcl(array $args = []);
    /**
     * @param array $args
     */
    public function getAcl(array $args = []);
    /**
     * @param array $args
     */
    public function listAcl(array $args = []);
    /**
     * @param array $args
     */
    public function insertAcl(array $args = []);
    /**
     * @param array $args
     */
    public function patchAcl(array $args = []);
    /**
     * @param array $args
     */
    public function deleteBucket(array $args = []);
    /**
     * @param array $args
     */
    public function getBucket(array $args = []);
    /**
     * @param array $args
     */
    public function listBuckets(array $args = []);
    /**
     * @param array $args
     */
    public function insertBucket(array $args = []);
    /**
     * @param  array $args
     */
    public function getBucketIamPolicy(array $args);
    /**
     * @param  array $args
     */
    public function setBucketIamPolicy(array $args);
    /**
     * @param  array $args
     */
    public function testBucketIamPermissions(array $args);
    /**
     * @param array $args
     */
    public function patchBucket(array $args = []);
    /**
     * @param array $args
     */
    public function deleteObject(array $args = []);
    /**
     * @param array $args
     */
    public function copyObject(array $args = []);
    /**
     * @param array $args
     */
    public function rewriteObject(array $args = []);
    /**
     * @param array $args
     */
    public function composeObject(array $args = []);
    /**
     * @param array $args
     */
    public function getObject(array $args = []);
    /**
     * @param array $args
     */
    public function listObjects(array $args = []);
    /**
     * @param array $args
     */
    public function patchObject(array $args = []);
    /**
     * @param array $args
     */
    public function downloadObject(array $args = []);
    /**
     * @param array $args
     */
    public function insertObject(array $args = []);
    /**
     * @param array $args
     */
    public function getNotification(array $args = []);
    /**
     * @param array $args
     */
    public function deleteNotification(array $args = []);
    /**
     * @param array $args
     */
    public function insertNotification(array $args = []);
    /**
     * @param array $args
     */
    public function listNotifications(array $args = []);
    /**
     * @param array $args
     */
    public function getServiceAccount(array $args = []);
    /**
     * @param array $args
     */
    public function lockRetentionPolicy(array $args = []);
}


text:
package cqrs

type EventPublisher interface {
	Publish(e Event)
}