text:
using System;
using System.Xml;

namespace Intacct.SDK.Xml.Request
{
    public class LoginAuthentication: IAuthentication
    {
        private string _userId;

        public string UserId
        {
            get => this._userId;
            set
            {
                if (string.IsNullOrEmpty(value))
                {
                    throw new ArgumentException("User ID is required and cannot be blank");
                }
                this._userId = value;
            }
        }

        private string _companyId;

        public string CompanyId
        {
            get => this._companyId;
            set
            {
                if (string.IsNullOrEmpty(value))
                {
                    throw new ArgumentException("Company ID is required and cannot be blank");
                }
                this._companyId = value;
            }
        }

        private string _entityId;

        public string EntityId
        {
            get => this._entityId;
            set => _entityId = value;
        }

        private string _password;

        public string Password
        {
            get => this._password;
            set
            {
                if (string.IsNullOrEmpty(value))
                {
                    throw new ArgumentException("User Password is required and cannot be blank");
                }
                this._password = value;
            }
        }

        public LoginAuthentication(string userId, string companyId, string password, string entityId = null)
        {
            this.UserId = userId;
            this.CompanyId = companyId;
            this.Password = password;
            this.EntityId = entityId;
        }

        public void WriteXml(ref IaXmlWriter xml)
        {
            xml.WriteStartElement("authentication");
            xml.WriteStartElement("login");
            xml.WriteElementString("userid", this.UserId);
            xml.WriteElementString("companyid", this.CompanyId);
            xml.WriteElementString("password", this.Password);
            if (this.EntityId != null)
            {
                xml.WriteElementString("locationid", this.EntityId);
            }
            xml.WriteEndElement(); // login
            xml.WriteEndElement(); // authentication
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <title>FNXUI</title>
    <meta name="description" content="">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="stylesheet" href="css/fnx_ui.css">
    <link rel="stylesheet" href="css/demo.css">

Panels

Panel

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad adipisci amet consectetur deleniti doloremque dolores dolorum ipsum neque nulla praesentium reprehenderit, similique, sint temporibus. Aut dicta id molestias nobis voluptatum?

Card without padding

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab amet aspernatur delectus dolore ducimus ea excepturi expedita hic magnam neque nobis nostrum officia quibusdam reiciendis sint suscipit totam vel, vitae!

Card

qwertyuio potrewq

Lorem ipsum dolor sit amet, consectetur adipisicing elit. A adipisci aspernatur consectetur cumque deleniti eaque error illum iusto magnam obcaecati praesentium quasi quo reiciendis sapiente ullam unde veritatis voluptas, voluptatum.

Colored card

qwertyuio potrewq

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab adipisci aut autem, consequatur consequuntur doloremque eos explicabo illo labore laboriosam laudantium necessitatibus numquam pariatur praesentium reprehenderit sapiente temporibus totam vel.

lkjhgfdsazxcvbnm

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aspernatur assumenda eligendi ipsam quaerat quasi ratione repudiandae sint temporibus. Aliquam consectetur est excepturi ipsa iusto molestias praesentium quaerat quo reiciendis vero!

Card with layout--header inside

Looooremmmm ipsuuuuuum dóóóóóóóóólóóóór sit amet.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur corporis deleniti dignissimos illum ipsam, iure laborum minus nihil pariatur perferendis perspiciatis provident, quia tempora tenetur ullam ut, voluptate. Beatae, repellat.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam, consequatur deleniti error fugit labore modi tempore. Aspernatur, assumenda corporis eligendi exercitationem illum ipsam omnis quidem, quis quisquam voluptate voluptates voluptatum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi maxime quibusdam repellat. Aspernatur doloribus fugiat iure molestias necessitatibus reiciendis repudiandae? Aliquam consectetur et magni quasi quos reiciendis unde velit, voluptatibus.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae eligendi et hic impedit inventore maiores saepe, unde! Ad consequatur deserunt itaque laborum, maxime necessitatibus officia officiis quo sed veniam voluptatem.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab architecto consectetur delectus molestiae praesentium saepe vel? Ad animi cupiditate est laborum obcaecati? Amet, culpa nostrum numquam odio quisquam sint unde.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequuntur corporis deleniti dignissimos illum ipsam, iure laborum minus nihil pariatur perferendis perspiciatis provident, quia tempora tenetur ullam ut, voluptate. Beatae, repellat.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam, consequatur deleniti error fugit labore modi tempore. Aspernatur, assumenda corporis eligendi exercitationem illum ipsam omnis quidem, quis quisquam voluptate voluptates voluptatum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi maxime quibusdam repellat. Aspernatur doloribus fugiat iure molestias necessitatibus reiciendis repudiandae? Aliquam consectetur et magni quasi quos reiciendis unde velit, voluptatibus.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Beatae eligendi et hic impedit inventore maiores saepe, unde! Ad consequatur deserunt itaque laborum, maxime necessitatibus officia officiis quo sed veniam voluptatem.

Panel with header

Panel headline

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis cumque esse est maiores nobis non odio quod, repudiandae tempore. Ad architecto debitis doloremque natus nesciunt nihil officiis quae qui vitae.

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque dolores harum nostrum nulla. Consequuntur dicta enim error itaque iure magnam maxime molestias quibusdam sapiente sunt? Dicta non porro tempora ut.

Panel headline

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque dolores harum nostrum nulla. Consequuntur dicta enim error itaque iure magnam maxime molestias quibusdam sapiente sunt? Dicta non porro tempora ut.

Panel headline

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis cumque esse est maiores nobis non odio quod, repudiandae tempore. Ad architecto debitis doloremque natus nesciunt nihil officiis quae qui vitae.

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque dolores harum nostrum nulla. Consequuntur dicta enim error itaque iure magnam maxime molestias quibusdam sapiente sunt? Dicta non porro tempora ut.

Panel with header - small

Panel headline

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis cumque esse est maiores nobis non odio quod, repudiandae tempore. Ad architecto debitis doloremque natus nesciunt nihil officiis quae qui vitae.

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque dolores harum nostrum nulla. Consequuntur dicta enim error itaque iure magnam maxime molestias quibusdam sapiente sunt? Dicta non porro tempora ut.

Panel headline

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque dolores harum nostrum nulla. Consequuntur dicta enim error itaque iure magnam maxime molestias quibusdam sapiente sunt? Dicta non porro tempora ut.

Panel headline

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis cumque esse est maiores nobis non odio quod, repudiandae tempore. Ad architecto debitis doloremque natus nesciunt nihil officiis quae qui vitae.

            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Doloremque dolores harum nostrum nulla. Consequuntur dicta enim error itaque iure magnam maxime molestias quibusdam sapiente sunt? Dicta non porro tempora ut.


text:
package com.example.mydemo.mobile;

import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.example.mydemo.R;

import java.util.List;

/**
 * PackageManager //在安卓系统中负责管理所有已经安装的APP
 * ApplicationInfo //一种bean,用来存储应用程序的信息
 *

 * 还有就是ApplicationInfo类里面有个标志属性,可以根据它跟一些内置的常量作位运算来判断
 *

 * app.flags & ApplicationInfo.FLAG_SYSTEM == 1 //系统应用,反之是第三方
 * app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP == 1 //通过升级,从系统应用变成第三方应用
 * app.flags & ApplicationInfo.) == 1 //安装在外置SD卡,反之安装在内置SD卡
 */
public class PackageManagerActivity extends AppCompatActivity {
    List<ApplicationInfo> listApplications;
    ListView mListView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_package_manager);
        mListView = findViewById(R.id.mListView);
        listApplications = getPackageManager().getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
        mListView.setAdapter(new PMAdapter());
    }

    class PMAdapter extends BaseAdapter {

        @Override
        public int getCount() {
            return listApplications.size();
        }

        @Override
        public Object getItem(int position) {
            return listApplications.get(position);
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        @Override
        public View getView(final int position, View convertView, ViewGroup parent) {
            ViewHolder holder = null;
            if (convertView == null) {
                convertView = getLayoutInflater().inflate(R.layout.item_package, parent, false);
                holder = new ViewHolder();
                holder.icon = convertView.findViewById(R.id.icon);
                holder.logo = convertView.findViewById(R.id.logo);
                holder.packageName = convertView.findViewById(R.id.packageName);
                holder.labelName = convertView.findViewById(R.id.labelName);
                convertView.setTag(holder);
            } else {
                holder = (ViewHolder) convertView.getTag();
            }
            holder.icon.setImageDrawable(listApplications.get(position).loadIcon(getPackageManager()));
            holder.logo.setImageDrawable(listApplications.get(position).loadLogo(getPackageManager()));
            holder.packageName.setText(listApplications.get(position).packageName);

            String source = "";
            if ((listApplications.get(position).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
                source = "系统";
            } else {
                source = "第三方";
            }

            if ((listApplications.get(position).flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 1) {
                source = source + ",Upldate->No-System";
            }

            if ((listApplications.get(position).flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == 1) {
                source = source + ",In External SD";
            } else {
                source = source + ",In Internal SD";
            }

            holder.labelName
                    .setText(listApplications.get(position).loadLabel(getPackageManager()) + "(" + source + ")");

            Log.i("INFOTAG", (String) listApplications.get(position).loadLabel(getPackageManager()));
            Log.i("INFOTAG", "-----backupAgentName:" + listApplications.get(position).backupAgentName);
            Log.i("INFOTAG", "-----compatibleWidthLimitDp:" + listApplications.get(position).compatibleWidthLimitDp);
            Log.i("INFOTAG", "-----className:" + listApplications.get(position).className);
            Log.i("INFOTAG", "-----dataDir:" + listApplications.get(position).dataDir);
            Log.i("INFOTAG", "-----descriptionRes:" + listApplications.get(position).descriptionRes);
            Log.i("INFOTAG", "-----flags:" + listApplications.get(position).flags);
            Log.i("INFOTAG", "-----labelRes:" + listApplications.get(position).labelRes);
            Log.i("INFOTAG", "-----largestWidthLimitDp:" + listApplications.get(position).largestWidthLimitDp);
            Log.i("INFOTAG", "-----manageSpaceActivityName:" + listApplications.get(position).manageSpaceActivityName);
            Log.i("INFOTAG", "-----name:" + listApplications.get(position).name);
            Log.i("INFOTAG", "-----nativeLibraryDir:" + listApplications.get(position).nativeLibraryDir);
            Log.i("INFOTAG", "-----permission:" + listApplications.get(position).permission);
            Log.i("INFOTAG", "-----processName:" + listApplications.get(position).processName);
            Log.i("INFOTAG", "-----publicSourceDir:" + listApplications.get(position).publicSourceDir);
            Log.i("INFOTAG", "-----requiresSmallestWidthDp:" + listApplications.get(position).requiresSmallestWidthDp);
            Log.i("INFOTAG", "-----sourceDir:" + listApplications.get(position).sourceDir);
            Log.i("INFOTAG", "-----targetSdkVersion:" + listApplications.get(position).targetSdkVersion);
            Log.i("INFOTAG", "-----taskAffinity:" + listApplications.get(position).taskAffinity);
            Log.i("INFOTAG", "-----uid:" + listApplications.get(position).uid);
            Log.i("INFOTAG", "-----theme:" + listApplications.get(position).theme);
            Log.i("INFOTAG", "-----uiOptions:" + listApplications.get(position).uiOptions);
            Log.i("INFOTAG", "");
            return convertView;
        }

        class ViewHolder {
            ImageView logo;
            ImageView icon;
            TextView packageName;
            TextView labelName;
        }

    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:tag="0,0,360,255"
    app:layout_optimizationLevel="none">

    <tag android:id="@+id/wrap_horizontal" android:value="0,0,360,1920 96,1665,264,144 0,0,0,0"/>
    <tag android:id="@+id/wrap_vertical" android:value="0,0,1080,255 876,0,264,144 780,0,0,0"/>

    <Button
        android:id="@+id/button17"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="37dp"
        android:layout_marginLeft="32dp"
        android:tag="876,1665,264,144"
        android:text="Button"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="@+id/guideline6" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:tag="780,0,0,0"
        app:layout_constraintGuide_end="100dp" />

</androidx.constraintlayout.widget.ConstraintLayout>


text:
package server;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.util.concurrent.Semaphore;

public class ServerInputThread implements Runnable {

	private int player;
	private int receivePort;
	private Semaphore semNewMessage;
	private Server server;
	private GameEngine gameEngine;

	/**
	 * assigns specified paramters to field variables
	 * @param port
	 * @param player
	 * @param semNewMessage
	 */
	public ServerInputThread(int port, int player, Semaphore semNewMessage, Server server, GameEngine gameEngine) {
		this.gameEngine = gameEngine;
		this.server = server;
		receivePort = port;
		this.player = player;
		this.semNewMessage = semNewMessage;
	}

	@Override
	/**
	 * Runs the Servers Input Thread by initializing sockets and packets alike.
	 * Checks if the players are able to get in game. If yes, then the communication
	 * link is established and packets are sent through.
	 */
	public void run() {
		// TODO Auto-generated method stub
		DatagramSocket serverSocket = null;
		DatagramPacket receivePacket = null;
		byte[] receivedData = new byte[1024];

		try {
			serverSocket = new DatagramSocket(receivePort);
			serverSocket.setReuseAddress(true);
			receivePacket = new DatagramPacket(receivedData,
					receivedData.length);
			serverSocket.receive(receivePacket);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			serverSocket.close();
			e.printStackTrace();
		}
		gameEngine = server.getGameEngine();
		while (server.getInGame()) {
			receivedData = new byte[1024];

			semNewMessage.release();
			synchronized (gameEngine.command){
				gameEngine.command = new String(receivePacket.getData()).trim()+","+player;
			}
			try {
				receivePacket = new DatagramPacket(receivedData,
						receivedData.length);
				serverSocket.receive(receivePacket);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		serverSocket.close();
	}
}


text:
namespace OrdrIn.Api.Utilities
{
	using System;
	using System.Collections.Generic;

	public static class DictionaryExtensions
	{
		public static TConvert GetValueOrDefault<TKey, TValue, TConvert>(
			this IDictionary<TKey, TValue> dictionary,
			TKey key,
			Func<TValue, TConvert> conversionFunc)
		{
		    TValue ret;
    		dictionary.TryGetValue(key, out ret);
			return conversionFunc(ret);
		}
	}
}


text:
package org.hcjf.layers.crud.command;

import org.hcjf.layers.LayerInterface;

import java.util.Map;

/**
 * Represents a single command to be executed when a PUT request is sent to a resource.<br/>
 * It should be associated with a specific resource and carry a single task, returning its corresponding result.
 */
public interface ResourceCommandLayerInterface extends LayerInterface {

    Map<String, Object> execute(Object payload);

}


text:
Knowledge Skills

Academic

            {{skill}} {{pc.stats.logic + rating}}

Professional

            {{skill}} {{pc.stats.logic + rating}}

Interest

            {{skill}} {{pc.stats.intuition + rating}}

Street

            {{skill}} {{pc.stats.intuition + rating}}

Language

            {{skill}} N
            {{skill}} {{pc.stats.intuition + rating}}


text:
class PreparedGraphicsObjects;
class IndexBufferContext;
class GraphicsStateGuardianBase;
class FactoryParams;
class GeomPrimitivePipelineReader;

////////////////////////////////////////////////////////////////////
//       Class : GeomPrimitive
// Description : This is an abstract base class for a family of
//               classes that represent the fundamental geometry
//               primitives that may be stored in a Geom.
//
//               They all have in common the fact that they are
//               defined by tables of vertex data stored in a
//               GeomVertexData object.  Each GeomPrimitive object
//               contains an ordered list of integers, which index
//               into the vertex array defined by the GeomVertexData
//               and define the particular vertices of the
//               GeomVertexData that are used for this primitive.
//
//               The meaning of a given arrangement of vertices is
//               defined by each individual primitive type; for
//               instance, a GeomTriangle renders a triangle from each
//               three consecutive vertices, while a GeomTriangleStrip
//               renders a strip of (n - 2) connected triangles from
//               each sequence of n vertices.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA_GOBJ GeomPrimitive : public CopyOnWriteObject, public GeomEnums {
protected:
  GeomPrimitive();
  virtual PT(CopyOnWriteObject) make_cow_copy();

PUBLISHED:
  GeomPrimitive(UsageHint usage_hint);
  GeomPrimitive(const GeomPrimitive &copy);
  void operator = (const GeomPrimitive &copy);
  virtual ~GeomPrimitive();
  ALLOC_DELETED_CHAIN(GeomPrimitive);

  virtual PT(GeomPrimitive) make_copy() const=0;

  virtual PrimitiveType get_primitive_type() const=0;
  virtual int get_geom_rendering() const;

  INLINE ShadeModel get_shade_model() const;
  INLINE void set_shade_model(ShadeModel shade_model);

  INLINE UsageHint get_usage_hint() const;
  void set_usage_hint(UsageHint usage_hint);

  INLINE NumericType get_index_type() const;
  void set_index_type(NumericType index_type);

  // The following published methods are provided for safe, high-level
  // iteration through the vertices and sub-primitives within the
  // GeomPrimitive class.  These work correctly regardless of the
  // primitive type and without depending on knowledge about the way
  // primitives' lengths are encoded.  You can also safely build up a
  // composite primitive using these methods.

  INLINE bool is_composite() const;
  INLINE bool is_indexed() const;
  INLINE int get_first_vertex() const;
  INLINE int get_num_vertices() const;
  INLINE int get_vertex(int i) const;
  MAKE_SEQ(get_vertex_list, get_num_vertices, get_vertex);
  void add_vertex(int vertex);
  INLINE void add_vertices(int v1, int v2);
  INLINE void add_vertices(int v1, int v2, int v3);
  INLINE void add_vertices(int v1, int v2, int v3, int v4);
  void add_consecutive_vertices(int start, int num_vertices);
  void add_next_vertices(int num_vertices);
  void reserve_num_vertices(int num_vertices);
  bool close_primitive();
  void clear_vertices();
  void offset_vertices(int offset);
  void offset_vertices(int offset, int begin_row, int end_row);
  void make_nonindexed(GeomVertexData *dest, const GeomVertexData *source);
  void pack_vertices(GeomVertexData *dest, const GeomVertexData *source);
  void make_indexed();

  INLINE int get_num_primitives() const;
  int get_primitive_start(int n) const;
  int get_primitive_end(int n) const;
  int get_primitive_num_vertices(int n) const;
  int get_num_used_vertices() const;

  INLINE int get_num_faces() const;
  INLINE int get_primitive_num_faces(int n) const;

  INLINE int get_min_vertex() const;
  int get_primitive_min_vertex(int n) const;
  INLINE int get_max_vertex() const;
  int get_primitive_max_vertex(int n) const;

  CPT(GeomPrimitive) decompose() const;
  CPT(GeomPrimitive) rotate() const;
  CPT(GeomPrimitive) doubleside() const;
  CPT(GeomPrimitive) reverse() const;
  CPT(GeomPrimitive) match_shade_model(ShadeModel shade_model) const;
  CPT(GeomPrimitive) make_points() const;
  CPT(GeomPrimitive) make_lines() const;
  CPT(GeomPrimitive) make_patches() const;

  int get_num_bytes() const;
  INLINE int get_data_size_bytes() const;
  INLINE UpdateSeq get_modified() const;

  bool request_resident() const;

  INLINE bool check_valid(const GeomVertexData *vertex_data) const;

  virtual void output(ostream &out) const;
  virtual void write(ostream &out, int indent_level) const;

PUBLISHED:
  // These public methods are not intended for high-level usage.  They
  // are public so that low-level code that absolutely needs fast
  // access to the primitive data can get to it, but using them
  // requires knowledge about how the component primitives are encoded
  // within the GeomPrimitive class, and it's easy to screw something
  // up.  Also, if too many code samples depend on this internal
  // knowledge, it may make it difficult to extend this class later.
  // It is recommended that application-level code use the above
  // interfaces instead.

  INLINE CPT(GeomVertexArrayData) get_vertices() const;
  PT(GeomVertexArrayData) modify_vertices(int num_vertices = -1);
  void set_vertices(const GeomVertexArrayData *vertices, int num_vertices = -1);
  void set_nonindexed_vertices(int first_vertex, int num_vertices);

  INLINE int get_index_stride() const;
  INLINE int get_strip_cut_index() const;

  INLINE CPTA_int get_ends() const;
  PTA_int modify_ends();
  void set_ends(CPTA_int ends);

  INLINE CPT(GeomVertexArrayData) get_mins() const;
  INLINE CPT(GeomVertexArrayData) get_maxs() const;

  void set_minmax(int min_vertex, int max_vertex,
                  GeomVertexArrayData *mins, GeomVertexArrayData *maxs);
  void clear_minmax();

  virtual int get_num_vertices_per_primitive() const;
  virtual int get_min_num_vertices_per_primitive() const;
  virtual int get_num_unused_vertices_per_primitive() const;

public:
  void prepare(PreparedGraphicsObjects *prepared_objects);
  bool is_prepared(PreparedGraphicsObjects *prepared_objects) const;

  IndexBufferContext *prepare_now(PreparedGraphicsObjects *prepared_objects,
                                  GraphicsStateGuardianBase *gsg);
  bool release(PreparedGraphicsObjects *prepared_objects);
  int release_all();

  static const GeomVertexArrayFormat *get_index_format(NumericType index_type);
  INLINE const GeomVertexArrayFormat *get_index_format() const;
  INLINE PT(GeomVertexArrayData) make_index_data() const;

private:
  static CPT(GeomVertexArrayFormat) make_index_format(NumericType index_type);

  void clear_prepared(PreparedGraphicsObjects *prepared_objects);
  static int get_highest_index_value(NumericType index_type);
  static int get_strip_cut_index(NumericType index_type);

public:
  virtual bool draw(GraphicsStateGuardianBase *gsg,
                    const GeomPrimitivePipelineReader *reader,
                    bool force) const=0;

  void calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point,
                         PN_stdfloat &sq_center_dist, bool &found_any,
                         const GeomVertexData *vertex_data,
                         bool got_mat, const LMatrix4 &mat,
                         const InternalName *column_name,
                         Thread *current_thread) const;

  void calc_sphere_radius(const LPoint3 &center,
                          PN_stdfloat &sq_radius, bool &found_any,
                          const GeomVertexData *vertex_data,
                          Thread *current_thread) const;

protected:
  virtual CPT(GeomPrimitive) decompose_impl() const;
  virtual CPT(GeomVertexArrayData) rotate_impl() const;
  virtual CPT(GeomPrimitive) doubleside_impl() const;
  virtual CPT(GeomPrimitive) reverse_impl() const;
  virtual bool requires_unused_vertices() const;
  virtual void append_unused_vertices(GeomVertexArrayData *vertices,
                                      int vertex);

private:
  class CData;

  void recompute_minmax(CData *cdata);
  void do_make_indexed(CData *cdata);
  void consider_elevate_index_type(CData *cdata, int vertex);
  void do_set_index_type(CData *cdata, NumericType index_type);
  PT(GeomVertexArrayData) do_modify_vertices(CData *cdata);

private:
  // A GeomPrimitive keeps a list (actually, a map) of all the
  // PreparedGraphicsObjects tables that it has been prepared into.
  // Each PGO conversely keeps a list (a set) of all the Geoms that
  // have been prepared there.  When either destructs, it removes
  // itself from the other's list.
  typedef pmap<PreparedGraphicsObjects *, IndexBufferContext *> Contexts;
  Contexts _contexts;

  // This is the data that must be cycled between pipeline stages.
  class EXPCL_PANDA_GOBJ CData : public CycleData {
  public:
    INLINE CData();
    INLINE CData(const CData &copy);
    ALLOC_DELETED_CHAIN(CData);

    virtual CycleData *make_copy() const;
    virtual void write_datagram(BamWriter *manager, Datagram &dg) const;
    virtual int complete_pointers(TypedWritable **plist, BamReader *manager);
    virtual void fillin(DatagramIterator &scan, BamReader *manager);
    virtual TypeHandle get_parent_type() const {
      return GeomPrimitive::get_class_type();
    }

    ShadeModel _shade_model;
    int _first_vertex;
    int _num_vertices;
    NumericType _index_type;
    UsageHint _usage_hint;
    COWPT(GeomVertexArrayData) _vertices;
    PTA_int _ends;
    COWPT(GeomVertexArrayData) _mins;
    COWPT(GeomVertexArrayData) _maxs;
    UpdateSeq _modified;

    bool _got_minmax;
    unsigned int _min_vertex;
    unsigned int _max_vertex;

  public:
    static TypeHandle get_class_type() {
      return _type_handle;
    }
    static void init_type() {
      register_type(_type_handle, "GeomPrimitive::CData");
    }

  private:
    static TypeHandle _type_handle;

    friend class GeomPrimitive;
  };

  PipelineCycler<CData> _cycler;
  typedef CycleDataReader<CData> CDReader;
  typedef CycleDataWriter<CData> CDWriter;
  typedef CycleDataStageReader<CData> CDStageReader;
  typedef CycleDataStageWriter<CData> CDStageWriter;

private:
  static PStatCollector _decompose_pcollector;
  static PStatCollector _doubleside_pcollector;
  static PStatCollector _reverse_pcollector;
  static PStatCollector _rotate_pcollector;

public:
  virtual void write_datagram(BamWriter *manager, Datagram &dg);

  virtual void finalize(BamReader *manager);

protected:
  void fillin(DatagramIterator &scan, BamReader *manager);

public:
  static TypeHandle get_class_type() {
    return _type_handle;
  }
  static void init_type() {
    CopyOnWriteObject::init_type();
    register_type(_type_handle, "GeomPrimitive",
                  CopyOnWriteObject::get_class_type());
    CData::init_type();
  }
  virtual TypeHandle get_type() const {
    return get_class_type();
  }
  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}

private:
  static TypeHandle _type_handle;

  friend class Geom;
  friend class PreparedGraphicsObjects;
  friend class GeomPrimitivePipelineReader;
};

////////////////////////////////////////////////////////////////////
//       Class : GeomPrimitivePipelineReader
// Description : Encapsulates the data from a GeomPrimitive,
//               pre-fetched for one stage of the pipeline.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA_GOBJ GeomPrimitivePipelineReader : public GeomEnums {
public:
  INLINE GeomPrimitivePipelineReader(const GeomPrimitive *object, Thread *current_thread);
private:
  INLINE GeomPrimitivePipelineReader(const GeomPrimitivePipelineReader &copy);
  INLINE void operator = (const GeomPrimitivePipelineReader &copy);

public:
  INLINE ~GeomPrimitivePipelineReader();
  ALLOC_DELETED_CHAIN(GeomPrimitivePipelineReader);

  INLINE const GeomPrimitive *get_object() const;
  INLINE Thread *get_current_thread() const;

  void check_minmax() const;

  INLINE ShadeModel get_shade_model() const;
  INLINE UsageHint get_usage_hint() const;
  INLINE NumericType get_index_type() const;
  INLINE bool is_indexed() const;
  int get_first_vertex() const;
  INLINE int get_num_vertices() const;
  int get_vertex(int i) const;
  int get_num_primitives() const;
  INLINE int get_min_vertex() const;
  INLINE int get_max_vertex() const;
  INLINE int get_data_size_bytes() const;
  INLINE UpdateSeq get_modified() const;
  bool check_valid(const GeomVertexDataPipelineReader *data_reader) const;
  INLINE int get_index_stride() const;
  INLINE const GeomVertexArrayDataHandle *get_vertices_reader() const;
  INLINE const unsigned char *get_read_pointer(bool force) const;
  INLINE int get_strip_cut_index() const;
  INLINE CPTA_int get_ends() const;
  INLINE CPT(GeomVertexArrayData) get_mins() const;
  INLINE CPT(GeomVertexArrayData) get_maxs() const;

  INLINE IndexBufferContext *prepare_now(PreparedGraphicsObjects *prepared_objects,
                                         GraphicsStateGuardianBase *gsg) const;

private:
  CPT(GeomPrimitive) _object;
  Thread *_current_thread;
  const GeomPrimitive::CData *_cdata;

  CPT(GeomVertexArrayDataHandle) _vertices_reader;

public:
  static TypeHandle get_class_type() {
    return _type_handle;
  }
  static void init_type() {
    register_type(_type_handle, "GeomPrimitivePipelineReader");
  }

private:
  static TypeHandle _type_handle;
};

INLINE ostream &operator << (ostream &out, const GeomPrimitive &obj);

#include "geomPrimitive.I"

#endif


text:
module.exports = {
    create: function(){
    //This is just like any other Phaser create function

    	game.state.start('play');
    },
    update: function(){
    //Game logic goes here
    },
};


text:
import unittest
from datetime import timedelta
from time import sleep

import pytest

from reactivex.internal.basic import default_now
from reactivex.scheduler.mainloop import WxScheduler

wx = pytest.importorskip("wx")

def make_app():
    app = wx.App()
    wx.Frame(None)  # We need this for some reason, or the loop won't run
    return app

class AppExit(wx.Timer):
    def __init__(self, app) -> None:
        super().__init__()
        self.app = app

    def Notify(self):
        self.app.ExitMainLoop()

class TestWxScheduler(unittest.TestCase):
    def test_wx_schedule_now(self):
        scheduler = WxScheduler(wx)
        diff = scheduler.now - default_now()
        assert abs(diff) < timedelta(milliseconds=1)

    def test_wx_schedule_now_units(self):
        scheduler = WxScheduler(wx)
        diff = scheduler.now
        sleep(0.1)
        diff = scheduler.now - diff
        assert timedelta(milliseconds=80) < diff < timedelta(milliseconds=180)

    def test_wx_schedule_action(self):
        app = make_app()
        exit = AppExit(app)
        scheduler = WxScheduler(wx)
        ran = False

        def action(scheduler, state):
            nonlocal ran
            ran = True

        scheduler.schedule(action)
        exit.Start(100, wx.TIMER_ONE_SHOT)
        app.MainLoop()
        scheduler.cancel_all()

        assert ran is True

    def test_wx_schedule_action_relative(self):
        app = make_app()
        exit = AppExit(app)
        scheduler = WxScheduler(wx)
        starttime = default_now()
        endtime = None

        def action(scheduler, state):
            nonlocal endtime
            endtime = default_now()

        scheduler.schedule_relative(0.1, action)
        exit.Start(200, wx.TIMER_ONE_SHOT)
        app.MainLoop()
        scheduler.cancel_all()

        assert endtime is not None
        diff = endtime - starttime
        assert timedelta(milliseconds=80) < diff < timedelta(milliseconds=180)

    def test_wx_schedule_action_absolute(self):
        app = make_app()
        exit = AppExit(app)
        scheduler = WxScheduler(wx)
        starttime = default_now()
        endtime = None

        def action(scheduler, state):
            nonlocal endtime
            endtime = default_now()

        due = scheduler.now + timedelta(milliseconds=100)
        scheduler.schedule_absolute(due, action)
        exit.Start(200, wx.TIMER_ONE_SHOT)
        app.MainLoop()
        scheduler.cancel_all()

        assert endtime is not None
        diff = endtime - starttime
        assert timedelta(milliseconds=80) < diff < timedelta(milliseconds=180)

    def test_wx_schedule_action_cancel(self):
        app = make_app()
        exit = AppExit(app)
        scheduler = WxScheduler(wx)
        ran = False

        def action(scheduler, state):
            nonlocal ran
            ran = True

        d = scheduler.schedule_relative(0.1, action)
        d.dispose()
        exit.Start(200, wx.TIMER_ONE_SHOT)
        app.MainLoop()
        scheduler.cancel_all()

        assert ran is False

    def test_wx_schedule_action_periodic(self):
        app = make_app()
        exit = AppExit(app)
        scheduler = WxScheduler(wx)
        period = 0.05
        counter = 3

        def action(state):
            nonlocal counter
            if state:
                counter -= 1
                return state - 1

        scheduler.schedule_periodic(period, action, counter)
        exit.Start(500, wx.TIMER_ONE_SHOT)
        app.MainLoop()
        scheduler.cancel_all()

        assert counter == 0


text:
package de.dhbw.humbuch.view;

import org.junit.runner.RunWith;

import com.google.inject.Inject;

import de.dhbw.humbuch.guice.GuiceJUnitRunner;
import de.dhbw.humbuch.guice.GuiceJUnitRunner.GuiceModules;
import de.dhbw.humbuch.guice.TestModule;
import de.dhbw.humbuch.model.DAO;
import de.dhbw.humbuch.model.entity.TestPersistenceInitialiser;
import de.dhbw.humbuch.model.entity.User;
import de.dhbw.humbuch.viewmodel.Properties;

@RunWith(GuiceJUnitRunner.class)
@GuiceModules({ TestModule.class })
public class DunningViewTest extends BaseTest {

	@Inject
	public void setInjected(MVVMConfig mvvmConfig,
			TestPersistenceInitialiser testPersistenceInitialiser,
			DunningView view,
			Properties properties,
			DAO<User> daoUser) {
		super.setInjected(mvvmConfig, testPersistenceInitialiser, view, properties, daoUser);
	}
}


text:
;(function($, window, document, undefined) {

"use strict";

/* *****************************************************************************
 * Private functions and variables
 */
var logMsg = $.ui.fancytree.debug,
	didRegisterDnd = false;

/* Convert number to string and prepend +/-; return empty string for 0.*/
function offsetString(n){
	return n === 0 ? "" : (( n > 0 ) ? ("+" + n) : ("" + n));
}

/* *****************************************************************************
 * Drag and drop support
 */
function _initDragAndDrop(tree) {
	var dnd = tree.options.dnd || null;
	// Register 'connectToFancytree' option with ui.draggable
	if(dnd /*&& (dnd.onDragStart || dnd.onDrop)*/) {
		_registerDnd();
	}
	// Attach ui.draggable to this Fancytree instance
	if(dnd && dnd.onDragStart ) {
		tree.widget.element.draggable({
			addClasses: false,
			appendTo: "body",
			containment: false,
			delay: 0,
			distance: 4,
			// TODO: merge Dynatree issue 419
			revert: false,
			scroll: true, // issue 244: enable scrolling (if ul.fancytree-container)
			scrollSpeed: 7,
			scrollSensitivity: 10,
			// Delegate draggable.start, drag, and stop events to our handler
			connectToFancytree: true,
			// Let source tree create the helper element
			helper: function(event) {
				var sourceNode = $.ui.fancytree.getNode(event.target);
				if(!sourceNode){ // issue 211
					// TODO: remove this hint, when we understand when it happens
					// happens on a drag on a scroll bar that causes movement of
					// the fancytree list - escaping this now
					// return "
ERROR?: helper requested but sourceNode not found
";
				}
				return sourceNode.tree.ext.dnd._onDragEvent("helper", sourceNode, null, event, null, null);
			},
			start: function(event, ui) {
//              var sourceNode = $.ui.fancytree.getNode(event.target);
				// don't return false if sourceNode == null (see issue 268)
			}
		});
	}
	// Attach ui.droppable to this Fancytree instance
	if(dnd && dnd.onDrop) {
		tree.widget.element.droppable({
			addClasses: false,
			tolerance: "intersect",
			greedy: false
			/*
			,
			activate: function(event, ui) {
				logMsg("droppable - activate", event, ui, this);
			},
			create: function(event, ui) {
				logMsg("droppable - create", event, ui);
			},
			deactivate: function(event, ui) {
				logMsg("droppable - deactivate", event, ui);
			},
			drop: function(event, ui) {
				logMsg("droppable - drop", event, ui);
			},
			out: function(event, ui) {
				logMsg("droppable - out", event, ui);
			},
			over: function(event, ui) {
				logMsg("droppable - over", event, ui);
			}
*/
		});
	}
}

//--- Extend ui.draggable event handling --------------------------------------

function _registerDnd() {
	if(didRegisterDnd){
		return;
	}

	// Register proxy-functions for draggable.start/drag/stop

	$.ui.plugin.add("draggable", "connectToFancytree", {
		start: function(event, ui) {
			// 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10
			var draggable = $(this).data("ui-draggable") || $(this).data("draggable"),
				sourceNode = ui.helper.data("ftSourceNode") || null;
//          logMsg("draggable-connectToFancytree.start, %s", sourceNode);
//          logMsg("    this: %o", this);
//          logMsg("    event: %o", event);
//          logMsg("    draggable: %o", draggable);
//          logMsg("    ui: %o", ui);

			if(sourceNode) {
				// Adjust helper offset, so cursor is slightly outside top/left corner
				draggable.offset.click.top = -2;
				draggable.offset.click.left = + 16;
//              logMsg("    draggable2: %o", draggable);
//              logMsg("    draggable.offset.click FIXED: %s/%s", draggable.offset.click.left, draggable.offset.click.top);
				// Trigger onDragStart event
				// TODO: when called as connectTo..., the return value is ignored(?)
				return sourceNode.tree.ext.dnd._onDragEvent("start", sourceNode, null, event, ui, draggable);
			}
		},
		drag: function(event, ui) {
			// 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10
			var isHelper,
				draggable = $(this).data("ui-draggable") || $(this).data("draggable"),
				sourceNode = ui.helper.data("ftSourceNode") || null,
				prevTargetNode = ui.helper.data("ftTargetNode") || null,
				targetNode = $.ui.fancytree.getNode(event.target);
//            logMsg("$.ui.fancytree.getNode(%o): %s", event.target, targetNode);
//            logMsg("connectToFancytree.drag: helper: %o", ui.helper[0]);
			if(event.target && !targetNode){
				// We got a drag event, but the targetNode could not be found
				// at the event location. This may happen,
				// 1. if the mouse jumped over the drag helper,
				// 2. or if a non-fancytree element is dragged
				// We ignore it:
				isHelper = $(event.target).closest("div.fancytree-drag-helper,#fancytree-drop-marker").length > 0;
				if(isHelper){
					logMsg("Drag event over helper: ignored.");
					return;
				}
			}
//            logMsg("draggable-connectToFancytree.drag: targetNode(from event): %s, ftTargetNode: %s", targetNode, ui.helper.data("ftTargetNode"));
			ui.helper.data("ftTargetNode", targetNode);
			// Leaving a tree node
			if(prevTargetNode && prevTargetNode !== targetNode ) {
				prevTargetNode.tree.ext.dnd._onDragEvent("leave", prevTargetNode, sourceNode, event, ui, draggable);
			}
			if(targetNode){
				if(!targetNode.tree.options.dnd.onDrop) {
					// not enabled as drop target
				} else if(targetNode === prevTargetNode) {
					// Moving over same node
					targetNode.tree.ext.dnd._onDragEvent("over", targetNode, sourceNode, event, ui, draggable);
				}else{
					// Entering this node first time
					targetNode.tree.ext.dnd._onDragEvent("enter", targetNode, sourceNode, event, ui, draggable);
				}
			}
			// else go ahead with standard event handling
		},
		stop: function(event, ui) {
			// 'draggable' was renamed to 'ui-draggable' since jQueryUI 1.10
			var draggable = $(this).data("ui-draggable") || $(this).data("draggable"),
				sourceNode = ui.helper.data("ftSourceNode") || null,
				targetNode = ui.helper.data("ftTargetNode") || null,
//				mouseDownEvent = draggable._mouseDownEvent,
				eventType = event.type,
				dropped = (eventType === "mouseup" && event.which === 1);
//            logMsg("draggable-connectToFancytree.stop: targetNode(from event): %s, ftTargetNode: %s", targetNode, ui.helper.data("ftTargetNode"));
//            logMsg("draggable-connectToFancytree.stop, %s", sourceNode);
//            logMsg("    type: %o, downEvent: %o, upEvent: %o", eventType, mouseDownEvent, event);
//            logMsg("    targetNode: %o", targetNode);
			if(!dropped){
				logMsg("Drag was cancelled");
			}
			if(targetNode) {
				if(dropped){
					targetNode.tree.ext.dnd._onDragEvent("drop", targetNode, sourceNode, event, ui, draggable);
				}
				targetNode.tree.ext.dnd._onDragEvent("leave", targetNode, sourceNode, event, ui, draggable);
			}
			if(sourceNode){
				sourceNode.tree.ext.dnd._onDragEvent("stop", sourceNode, null, event, ui, draggable);
			}
		}
	});

	didRegisterDnd = true;
}

/* *****************************************************************************
 *
 */
/** @namespace $.ui.fancytree.ext.dnd */
$.ui.fancytree.registerExtension("dnd",
	/** @scope ui_fancytree
	 * @lends $.ui.fancytree.ext.dnd.prototype
	 */
	{
	version: "0.0.1",
	// Default options for this extension.
	options: {
		// Make tree nodes draggable:
		onDragStart: null, // Callback(sourceNode), return true, to enable dnd
		onDragStop: null, // Callback(sourceNode)
//      helper: null,
		// Make tree nodes accept draggables
		autoExpandMS: 1000, // Expand nodes after n milliseconds of hovering.
		preventVoidMoves: true, // Prevent dropping nodes 'before self', etc.
		preventRecursiveMoves: true, // Prevent dropping nodes on own descendants
		onDragEnter: null, // Callback(targetNode, sourceNode)
		onDragOver: null, // Callback(targetNode, sourceNode, hitMode)
		onDrop: null, // Callback(targetNode, sourceNode, hitMode)
		onDragLeave: null // Callback(targetNode, sourceNode)
	},
	// Override virtual methods for this extension.
	// `this`       : Fancytree instance
	// `this._super`: the virtual function that was overriden (member of prev. extension or Fancytree)
	treeInit: function(ctx){
		var tree = ctx.tree;
		this._super(ctx);
		_initDragAndDrop(tree);
	},
	/* Override key handler in order to cancel dnd on escape.*/
	nodeKeydown: function(ctx) {
		var event = ctx.originalEvent;
		if( event.which === $.ui.keyCode.ESCAPE) {
			this._local._cancelDrag();
		}
		this._super(ctx);
	},
	/* Display drop marker according to hitMode ('after', 'before', 'over', 'out', 'start', 'stop'). */
	_setDndStatus: function(sourceNode, targetNode, helper, hitMode, accept) {
		var posOpts,
			markerOffsetX = 0,
			markerAt = "center",
			instData = this._local,
			$source = sourceNode ? $(sourceNode.span) : null,
			$target = $(targetNode.span);

		if( !instData.$dropMarker ) {
			instData.$dropMarker = $("

")
				.hide()
				.css({"z-index": 1000})
				.prependTo($(this.$div).parent());
//                .prependTo("body");
//          logMsg("Creating marker: %o", this.$dropMarker);
		}
/*
		if(hitMode === "start"){
		}
		if(hitMode === "stop"){
//          sourceNode.removeClass("fancytree-drop-target");
		}
*/
//      this.$dropMarker.attr("class", hitMode);
		if(hitMode === "after" || hitMode === "before" || hitMode === "over"){
//          $source && $source.addClass("fancytree-drag-source");

//          $target.addClass("fancytree-drop-target");

			switch(hitMode){
			case "before":
				instData.$dropMarker.removeClass("fancytree-drop-after fancytree-drop-over");
				instData.$dropMarker.addClass("fancytree-drop-before");
				markerAt = "top";
				break;
			case "after":
				instData.$dropMarker.removeClass("fancytree-drop-before fancytree-drop-over");
				instData.$dropMarker.addClass("fancytree-drop-after");
				markerAt = "bottom";
				break;
			default:
				instData.$dropMarker.removeClass("fancytree-drop-after fancytree-drop-before");
				instData.$dropMarker.addClass("fancytree-drop-over");
				$target.addClass("fancytree-drop-target");
				markerOffsetX = 8;
			}

			if( $.ui.fancytree.jquerySupports.positionMyOfs ){
				posOpts = {
					my: "left" + offsetString(markerOffsetX) + " center",
					at: "left " + markerAt,
					of: $target
				};
			} else {
				posOpts = {
					my: "left center",
					at: "left " + markerAt,
					of: $target,
					offset: "" + markerOffsetX + " 0"
				};
			}
			instData.$dropMarker
				.show()
				.position(posOpts);
//          helper.addClass("fancytree-drop-hover");
		} else {
//          $source && $source.removeClass("fancytree-drag-source");
			$target.removeClass("fancytree-drop-target");
			instData.$dropMarker.hide();
//          helper.removeClass("fancytree-drop-hover");
		}
		if(hitMode === "after"){
			$target.addClass("fancytree-drop-after");
		} else {
			$target.removeClass("fancytree-drop-after");
		}
		if(hitMode === "before"){
			$target.addClass("fancytree-drop-before");
		} else {
			$target.removeClass("fancytree-drop-before");
		}
		if(accept === true){
			if($source){
				$source.addClass("fancytree-drop-accept");
			}
			$target.addClass("fancytree-drop-accept");
			helper.addClass("fancytree-drop-accept");
		}else{
			if($source){
				$source.removeClass("fancytree-drop-accept");
			}
			$target.removeClass("fancytree-drop-accept");
			helper.removeClass("fancytree-drop-accept");
		}
		if(accept === false){
			if($source){
				$source.addClass("fancytree-drop-reject");
			}
			$target.addClass("fancytree-drop-reject");
			helper.addClass("fancytree-drop-reject");
		}else{
			if($source){
				$source.removeClass("fancytree-drop-reject");
			}
			$target.removeClass("fancytree-drop-reject");
			helper.removeClass("fancytree-drop-reject");
		}
	},

	/*
	 * Handles drag'n'drop functionality.
	 *
	 * A standard jQuery drag-and-drop process may generate these calls:
	 *
	 * draggable helper():
	 *     _onDragEvent("helper", sourceNode, null, event, null, null);
	 * start:
	 *     _onDragEvent("start", sourceNode, null, event, ui, draggable);
	 * drag:
	 *     _onDragEvent("leave", prevTargetNode, sourceNode, event, ui, draggable);
	 *     _onDragEvent("over", targetNode, sourceNode, event, ui, draggable);
	 *     _onDragEvent("enter", targetNode, sourceNode, event, ui, draggable);
	 * stop:
	 *     _onDragEvent("drop", targetNode, sourceNode, event, ui, draggable);
	 *     _onDragEvent("leave", targetNode, sourceNode, event, ui, draggable);
	 *     _onDragEvent("stop", sourceNode, null, event, ui, draggable);
	 */
	_onDragEvent: function(eventName, node, otherNode, event, ui, draggable) {
		if(eventName !== "over"){
			logMsg("tree.ext.dnd._onDragEvent(%s, %o, %o) - %o", eventName, node, otherNode, this);
		}
		var $helper, nodeOfs, relPos, relPos2,
			enterResponse, hitMode, r,
			opts = this.options,
			dnd = opts.dnd,
			res = null,
			nodeTag = $(node.span);

		switch (eventName) {
		case "helper":
			// Only event and node argument is available
			$helper = $("

")
//                .append($(event.target).closest("a").clone());
				.append($(event.target).closest("span.fancytree-title").clone());
			// issue 244: helper should be child of scrollParent
			$("ul.fancytree-container", node.tree.$div).append($helper);
//          $(node.tree.divTree).append($helper);
			// Attach node reference to helper object
			$helper.data("ftSourceNode", node);
			logMsg("helper=%o", $helper);
			logMsg("helper.sourceNode=%o", $helper.data("ftSourceNode"));
			res = $helper;
			break;
		case "start":
			if( node.isStatusNode ) {
				res = false;
			} else if(dnd.onDragStart) {
				res = dnd.onDragStart(node);
			}
			if(res === false) {
				this.debug("tree.onDragStart() cancelled");
				//draggable._clear();
				// NOTE: the return value seems to be ignored (drag is not canceled, when false is returned)
				// TODO: call this._cancelDrag()?
				ui.helper.trigger("mouseup");
				ui.helper.hide();
			} else {
				nodeTag.addClass("fancytree-drag-source");
			}
			break;
		case "enter":
			if(dnd.preventRecursiveMoves && node.isDescendantOf(otherNode)){
				r = false;
			}else{
				r = dnd.onDragEnter ? dnd.onDragEnter(node, otherNode, ui, draggable) : null;
			}
			if(!r){
				// convert null, undefined, false to false
				res = false;
			}else if ( $.isArray(r) ) {
				// TODO: also accept passing an object of this format directly
				res = {
					over: ($.inArray("over", r) >= 0),
					before: ($.inArray("before", r) >= 0),
					after: ($.inArray("after", r) >= 0)
				};
			}else{
				res = {
					over: ((r === true) || (r === "over")),
					before: ((r === true) || (r === "before")),
					after: ((r === true) || (r === "after"))
				};
			}
			ui.helper.data("enterResponse", res);
			logMsg("helper.enterResponse: %o", res);
			break;
		case "over":
			enterResponse = ui.helper.data("enterResponse");
			hitMode = null;
			if(enterResponse === false){
				// Don't call onDragOver if onEnter returned false.
//                break;
			} else if(typeof enterResponse === "string") {
				// Use hitMode from onEnter if provided.
				hitMode = enterResponse;
			} else {
				// Calculate hitMode from relative cursor position.
				nodeOfs = nodeTag.offset();
				relPos = { x: event.pageX - nodeOfs.left,
						   y: event.pageY - nodeOfs.top };
				relPos2 = { x: relPos.x / nodeTag.width(),
							y: relPos.y / nodeTag.height() };

				if( enterResponse.after && relPos2.y > 0.75 ){
					hitMode = "after";
				} else if(!enterResponse.over && enterResponse.after && relPos2.y > 0.5 ){
					hitMode = "after";
				} else if(enterResponse.before && relPos2.y <= 0.25) {
					hitMode = "before";
				} else if(!enterResponse.over && enterResponse.before && relPos2.y <= 0.5) {
					hitMode = "before";
				} else if(enterResponse.over) {
					hitMode = "over";
				}
				// Prevent no-ops like 'before source node'
				// TODO: these are no-ops when moving nodes, but not in copy mode
				if( dnd.preventVoidMoves ){
					if(node === otherNode){
						logMsg("    drop over source node prevented");
						hitMode = null;
					}else if(hitMode === "before" && otherNode && node === otherNode.getNextSibling()){
						logMsg("    drop after source node prevented");
						hitMode = null;
					}else if(hitMode === "after" && otherNode && node === otherNode.getPrevSibling()){
						logMsg("    drop before source node prevented");
						hitMode = null;
					}else if(hitMode === "over" && otherNode && otherNode.parent === node && otherNode.isLastSibling() ){
						logMsg("    drop last child over own parent prevented");
						hitMode = null;
					}
				}
//                logMsg("hitMode: %s - %s - %s", hitMode, (node.parent === otherNode), node.isLastSibling());
				ui.helper.data("hitMode", hitMode);
			}
			// Auto-expand node (only when 'over' the node, not 'before', or 'after')
			if(hitMode === "over" && dnd.autoExpandMS && node.hasChildren() !== false && !node.expanded) {
				node.scheduleAction("expand", dnd.autoExpandMS);
			}
			if(hitMode && dnd.onDragOver){
				// TODO: http://code.google.com/p/dynatree/source/detail?r=625
				res = dnd.onDragOver(node, otherNode, hitMode, ui, draggable);
			}
			// issue 332
//			this._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false);
			this._local._setDndStatus(otherNode, node, ui.helper, hitMode, res!==false && hitMode !== null);
			break;
		case "drop":
			hitMode = ui.helper.data("hitMode");
			if(hitMode && dnd.onDrop){
				dnd.onDrop(node, otherNode, hitMode, ui, draggable);
			}
			break;
		case "leave":
			// Cancel pending expand request
			node.scheduleAction("cancel");
			ui.helper.data("enterResponse", null);
			ui.helper.data("hitMode", null);
			this._local._setDndStatus(otherNode, node, ui.helper, "out", undefined);
			if(dnd.onDragLeave){
				dnd.onDragLeave(node, otherNode, ui, draggable);
			}
			break;
		case "stop":
			nodeTag.removeClass("fancytree-drag-source");
			if(dnd.onDragStop){
				dnd.onDragStop(node);
			}
			break;
		default:
			throw "Unsupported drag event: " + eventName;
		}
		return res;
	},

	_cancelDrag: function() {
		 var dd = $.ui.ddmanager.current;
		 if(dd){
			 dd.cancel();
		 }
	}
});
}(jQuery, window, document));


text:
"""Support for KNX/IP switches."""
from xknx.devices import Switch as XknxSwitch

from homeassistant.components.switch import SwitchEntity
from homeassistant.core import callback

from . import DATA_KNX

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Set up switch(es) for KNX platform."""
    entities = []
    for device in hass.data[DATA_KNX].xknx.devices:
        if isinstance(device, XknxSwitch):
            entities.append(KNXSwitch(device))
    async_add_entities(entities)

class KNXSwitch(SwitchEntity):
    """Representation of a KNX switch."""

    def __init__(self, device: XknxSwitch):
        """Initialize of KNX switch."""
        self.device = device

    @callback
    def async_register_callbacks(self):
        """Register callbacks to update hass after device was changed."""

        async def after_update_callback(device):
            """Call after device was updated."""
            self.async_write_ha_state()

        self.device.register_device_updated_cb(after_update_callback)

    async def async_added_to_hass(self):
        """Store register state change callback."""
        self.async_register_callbacks()

    async def async_update(self):
        """Request a state update from KNX bus."""
        await self.device.sync()

    @property
    def name(self):
        """Return the name of the KNX device."""
        return self.device.name

    @property
    def available(self):
        """Return true if entity is available."""
        return self.hass.data[DATA_KNX].connected

    @property
    def should_poll(self):
        """Return the polling state. Not needed within KNX."""
        return False

    @property
    def is_on(self):
        """Return true if device is on."""
        return self.device.state

    async def async_turn_on(self, **kwargs):
        """Turn the device on."""
        await self.device.set_on()

    async def async_turn_off(self, **kwargs):
        """Turn the device off."""
        await self.device.set_off()


text:
package eu.hyvar.dataValues.resource.hydatavalue.ui;

import org.eclipse.core.resources.IResource;

public class HydatavalueUIMetaInformation extends eu.hyvar.dataValues.resource.hydatavalue.mopp.HydatavalueMetaInformation {

	public eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueHoverTextProvider getHoverTextProvider() {
		return new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueHoverTextProvider();
	}

	public eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueImageProvider getImageProvider() {
		return eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueImageProvider.INSTANCE;
	}

	public eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueColorManager createColorManager() {
		return new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueColorManager();
	}

	/**
	 * @deprecated this method is only provided to preserve API compatibility. Use
	 * createTokenScanner(eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTextReso
	 * urce, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueColorManager)
	 * instead.
	 */
	public eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueTokenScanner createTokenScanner(eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueColorManager colorManager) {
		return (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueTokenScanner) createTokenScanner(null, colorManager);
	}

	public eu.hyvar.dataValues.resource.hydatavalue.ui.IHydatavalueTokenScanner createTokenScanner(eu.hyvar.dataValues.resource.hydatavalue.IHydatavalueTextResource resource, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueColorManager colorManager) {
		return new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueTokenScanner(resource, colorManager);
	}

	public eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueCodeCompletionHelper createCodeCompletionHelper() {
		return new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueCodeCompletionHelper();
	}

	@SuppressWarnings("rawtypes")
	public Object createResourceAdapter(Object adaptableObject, Class adapterType, IResource resource) {
		return new eu.hyvar.dataValues.resource.hydatavalue.ui.debug.HydatavalueLineBreakpointAdapter();
	}

}


text:
package com.cango.palmcartreasure.document;

import android.graphics.Color;
import android.os.Build;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.cango.palmcartreasure.R;
import com.cango.palmcartreasure.base.BaseActivity;
import com.cango.palmcartreasure.util.CommUtil;

public class ContactActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_contact);
        if (Build.VERSION.SDK_INT >= 21) {
            View decorView = getWindow().getDecorView();
            int option = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
                    | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
            decorView.setSystemUiVisibility(option);
            getWindow().setStatusBarColor(Color.TRANSPARENT);
        } else {

        }

        ContactFragment contactFragment = (ContactFragment) getSupportFragmentManager().findFragmentById(R.id.fl_contact_contains);
        if (CommUtil.checkIsNull(contactFragment)) {
            contactFragment = ContactFragment.newInstance();
            FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
            transaction.add(R.id.fl_contact_contains, contactFragment);
            transaction.commit();
        }
    }
}


text:
package com.fishercoder;

import com.fishercoder.common.classes.ListNode;
import com.fishercoder.common.utils.LinkedListUtils;
import com.fishercoder.solutions._24;
import org.junit.BeforeClass;
import org.junit.Test;

import java.util.Arrays;

import static org.junit.Assert.assertEquals;

public class _24Test {
    private static _24.Solution1 solution1;
    private static _24.Solution2 solution2;
    private static ListNode head;
    private static ListNode expected;

    @BeforeClass
    public static void setup() {
        solution1 = new _24.Solution1();
        solution2 = new _24.Solution2();
    }

    @Test
    public void test1() {
        head = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 2, 3, 4));
        expected = LinkedListUtils.createSinglyLinkedList(Arrays.asList(2, 1, 4, 3));
        assertEquals(expected, solution1.swapPairs(head));
    }

    @Test
    public void test2() {
        head = LinkedListUtils.createSinglyLinkedList(Arrays.asList(1, 2, 3, 4));
        expected = LinkedListUtils.createSinglyLinkedList(Arrays.asList(2, 1, 4, 3));
        assertEquals(expected, solution2.swapPairs(head));
    }

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GuebotEntities
{
    //status: El estado del brazo, puede tomar los siguientes valores: UP_OPEN, UP_CLOSE, DOWN_OPEN, DOWN_CLOSE.
    //code: El código de respuesta, valores válidos: '00' ejecutada exitosamente, '50' problemas de comunicación, '80' petición invalida, '90' petición encolada, '99' error desconocido.
    //message: Mensaje de respuesta, opcional.

    public class JSONStatusEntity
    {
        public consult consult { get; set; }
    }

    public class consult
    {
        public string status { get; set; }
        public response response { get; set; }
    }

    public class response
    {
        public string code { get; set; }
        public string message { get; set; }
    }
}


text:
using System;
using System.Collections.Generic;

namespace Atomiv.Core.Domain
{
    public class PageReadModel<T>
    {
        public PageReadModel(IEnumerable<T> records, long totalRecords, long totalPages)
        {
            Records = records;
            TotalPages = totalPages;
            TotalRecords = totalRecords;
        }

        public IEnumerable<T> Records { get; }

        public long TotalRecords { get; }

        public long TotalPages { get; }

        public static PageReadModel<T> Create(PageQuery pageQuery, IEnumerable<T> records, long totalRecords)
        {
            var size = pageQuery.Size;

            var totalPagesDecimal = (decimal)totalRecords / size;
            var totalPages = (long)Math.Ceiling(totalPagesDecimal);

            return new PageReadModel<T>(records, totalRecords, totalPages);
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.AppBarLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        app:titleTextColor="@android:color/white"
        android:theme="@style/AppTheme.AppBarOverlay"/>

</com.google.android.material.appbar.AppBarLayout>


text:
package org.apache.ibatis.type;

import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.Mockito.*;

import java.sql.Timestamp;
import java.time.Instant;

import org.junit.jupiter.api.Test;

class InstantTypeHandlerTest extends BaseTypeHandlerTest {

  private static final TypeHandler<Instant> TYPE_HANDLER = new InstantTypeHandler();
  private static final Instant INSTANT = Instant.now();
  private static final Timestamp TIMESTAMP = Timestamp.from(INSTANT);

  @Override
  @Test
  public void shouldSetParameter() throws Exception {
    TYPE_HANDLER.setParameter(ps, 1, INSTANT, null);
    verify(ps).setTimestamp(1, TIMESTAMP);
  }

  @Override
  @Test
  public void shouldGetResultFromResultSetByName() throws Exception {
    when(rs.getTimestamp("column")).thenReturn(TIMESTAMP);
    assertEquals(INSTANT, TYPE_HANDLER.getResult(rs, "column"));
    verify(rs, never()).wasNull();
  }

  @Override
  @Test
  public void shouldGetResultNullFromResultSetByName() throws Exception {
    when(rs.getTimestamp("column")).thenReturn(null);
    assertNull(TYPE_HANDLER.getResult(rs, "column"));
    verify(rs, never()).wasNull();
  }

  @Override
  @Test
  public void shouldGetResultFromResultSetByPosition() throws Exception {
    when(rs.getTimestamp(1)).thenReturn(TIMESTAMP);
    assertEquals(INSTANT, TYPE_HANDLER.getResult(rs, 1));
    verify(rs, never()).wasNull();
  }

  @Override
  @Test
  public void shouldGetResultNullFromResultSetByPosition() throws Exception {
    when(rs.getTimestamp(1)).thenReturn(null);
    assertNull(TYPE_HANDLER.getResult(rs, 1));
    verify(rs, never()).wasNull();
  }

  @Override
  @Test
  public void shouldGetResultFromCallableStatement() throws Exception {
    when(cs.getTimestamp(1)).thenReturn(TIMESTAMP);
    assertEquals(INSTANT, TYPE_HANDLER.getResult(cs, 1));
    verify(cs, never()).wasNull();
  }

  @Override
  @Test
  public void shouldGetResultNullFromCallableStatement() throws Exception {
    when(cs.getTimestamp(1)).thenReturn(null);
    assertNull(TYPE_HANDLER.getResult(cs, 1));
    verify(cs, never()).wasNull();
  }
}


text:
package io.vertx.ext.configuration.impl.spi;

import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.json.JsonObject;
import io.vertx.ext.configuration.spi.ConfigurationProcessor;

/**
 * @author Clement Escoffier
 */
public class RawProcessor implements ConfigurationProcessor {
  @Override
  public String name() {
    return "raw";
  }

  @Override
  public void process(Vertx vertx, JsonObject configuration, Buffer input, Handler<AsyncResult<JsonObject>> handler) {
    String key = configuration.getString("raw.key");
    String type = configuration.getString("raw.type", "string");
    if (key == null) {
      handler.handle(Future.failedFuture("The `raw.key` is required in the configuration when using the `raw` " +
          "processor."));
    } else {
      JsonObject json = new JsonObject();
      try {
        switch (type) {
          case "string":
            json.put(key, input.toString(configuration.getString("raw.encoding", "utf-8")));
            handler.handle(Future.succeededFuture(json));
            break;
          case "json-object":
            json.put(key, input.toJsonObject());
            handler.handle(Future.succeededFuture(json));
            break;
          case "json-array":
            json.put(key, input.toJsonArray());
            handler.handle(Future.succeededFuture(json));
            break;
          case "binary":
            json.put(key, input.getBytes());
            handler.handle(Future.succeededFuture(json));
            break;
          default:
            handler.handle(Future.failedFuture("Unrecognized `raw.type` : " + type));
        }
      } catch (Exception e) {
        handler.handle(Future.failedFuture(e));
      }
    }
  }
}


text:
<template name="meteo">

       	keyboard_arrow_left

      		 {{dataName}}

			{{> c3 myChartData}}

</template>


text: A coming soon landing page theme for WebsiteMixer!


text:
from six.moves import urllib_parse as urlparse

import jsonpointer

from flex.exceptions import (
    ValidationError,
)
from flex.datastructures import (
    ValidationDict,
)
from flex.error_messages import MESSAGES
from flex.constants import (
    OBJECT,
    STRING,
)
from flex.decorators import (
    skip_if_not_of_type,
)
from flex.validation.common import (
    generate_object_validator,
)

reference_object_schema = {
    'type': OBJECT,
    'additionalProperties': False,
    'required': [
        '$ref',
    ],
    'properties': {
        '$ref': {
            'type': STRING,
        },
    },
}

@skip_if_not_of_type(STRING)
def validate_reference_pointer(reference, context, **kwargs):
    parts = urlparse.urlparse(reference)
    if any((parts.scheme, parts.netloc, parts.path, parts.params, parts.query)):
        raise ValidationError(
            MESSAGES['reference']['unsupported'].format(reference),
        )

    try:
        jsonpointer.resolve_pointer(context, parts.fragment)
    except jsonpointer.JsonPointerException:
        raise ValidationError(
            MESSAGES['reference']['undefined'].format(reference),
        )

non_field_validators = ValidationDict()
non_field_validators.add_property_validator('$ref', validate_reference_pointer)

reference_object_validator = generate_object_validator(
    schema=reference_object_schema,
    non_field_validators=non_field_validators,
)


text:
[![official project](http://jb.gg/badges/official.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub)
# Kotlin/Native  #

The development of Kotlin/Native was moved to https://github.com/JetBrains/kotlin.
Because of that, this repository was archived.

Instead of creating new issues in this repository or commenting the existing ones,
please use other ways to communicate: https://github.com/JetBrains/kotlin-native/issues/4079


text:
package org.opencb.opencga.storage.hadoop.utils;

import org.apache.hadoop.hbase.io.compress.Compression;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.rules.ExternalResource;
import org.opencb.opencga.storage.core.variant.VariantStorageManagerTestUtils;
import org.opencb.opencga.storage.hadoop.variant.HadoopVariantStorageManagerTestUtils;

import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

/**
 * Created on 18/05/16
 *
 * @author Jacobo Coll <jacobo167@gmail.com>
 */
public class HBaseLockTest extends VariantStorageManagerTestUtils implements HadoopVariantStorageManagerTestUtils {

    @ClassRule
    public static ExternalResource externalResource = new HadoopExternalResource();

    private HBaseLock hbaseLock;

    @BeforeClass
    public static void setUpClass() throws Exception {
    }

    @Before
    public void setUp() throws Exception {
        clearDB(DB_NAME);
        HBaseManager hbaseManager = new HBaseManager(configuration.get());
        hbaseManager.createTableIfNeeded(DB_NAME, Bytes.toBytes("0"), Compression.Algorithm.NONE);
        hbaseLock = new HBaseLock(hbaseManager, DB_NAME, Bytes.toBytes("0"), Bytes.toBytes("R"));
    }

    @Test
    public void testLock() throws Exception {
        int lockId = 1;
        for (int i = 0; i < 10; i++) {
            System.out.println("i = " + i);
            long lock = hbaseLock.lock(getColumn(lockId), 10, 10);
            System.out.println("lock = " + lock);
            hbaseLock.unlock(getColumn(lockId), lock);
        }
    }

    @Test
    public void testConcurrentLock() throws Exception {
        int lockId = 2;

        AtomicInteger counter = new AtomicInteger(0);
        Set<String> threadWithLock = Collections.synchronizedSet(new HashSet<>());

        int nThreads = 20;
        ExecutorService executorService = Executors.newFixedThreadPool(nThreads);
        List<Future> futures = new ArrayList<>();
        for (int t = 0; t < nThreads; t++) {
            futures.add(executorService.submit(() -> {
                try {
                    for (int i = 0; i < 5; i++) {
                        System.out.println("i = " + i);
                        long lock = hbaseLock.lock(getColumn(lockId), 1000, 20000);
                        System.out.println("[" + Thread.currentThread().getName() + "] Enter LOCK");
                        assertEquals(threadWithLock.toString(), 0, threadWithLock.size());
                        threadWithLock.add(Thread.currentThread().getName());
                        assertEquals(threadWithLock.toString(), 1, threadWithLock.size());
                        int value = counter.addAndGet(1);
                        Thread.sleep(100);
                        assertEquals(threadWithLock.toString(), 1, threadWithLock.size());
                        assertEquals(threadWithLock.toString(), value, counter.get());
                        threadWithLock.remove(Thread.currentThread().getName());
                        System.out.println("lock = " + lock);
                        System.out.println("[" + Thread.currentThread().getName() + "] Exit LOCK");
                        hbaseLock.unlock(getColumn(lockId), lock);
                    }
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }));
        }
        executorService.shutdown();
        executorService.awaitTermination(2000, TimeUnit.SECONDS);

        for (Future future : futures) {
            assertTrue(future.isDone());
            future.get();
        }

    }

    public byte[] getColumn(int lockId) {
        return Bytes.toBytes(lockId);
    }

    @Test
    public void testLockAndLock() throws Exception {
        int lockId = 3;
        long lock = hbaseLock.lock(getColumn(lockId), 1000, 2000);
        System.out.println("lock = " + lock);

        thrown.expect(TimeoutException.class);
        hbaseLock.lock(getColumn(lockId), 1000, 1000);

    }

    @Test
    public void testLockAfterExpiring() throws Exception {
        int lockId = 4;
        long lock = hbaseLock.lock(getColumn(lockId), 1000, 1000);
        System.out.println("lock = " + lock);

        Thread.sleep(2000);
        System.out.println("Expired lock = " + lock);

        lock = hbaseLock.lock(getColumn(lockId), 1000, 1000);
        System.out.println("Unlock = " + lock);
        hbaseLock.unlock(getColumn(lockId), lock);

    }
}


text:
"""Test the aiohttp client helper."""
import asyncio
import unittest

import aiohttp

from homeassistant.core import EVENT_HOMEASSISTANT_CLOSE
from homeassistant.setup import async_setup_component
import homeassistant.helpers.aiohttp_client as client
from homeassistant.util.async import run_callback_threadsafe

from tests.common import get_test_home_assistant

class TestHelpersAiohttpClient(unittest.TestCase):
    """Test homeassistant.helpers.aiohttp_client module."""

    def setup_method(self, method):
        """Setup things to be run when tests are started."""
        self.hass = get_test_home_assistant()

    def teardown_method(self, method):
        """Stop everything that was started."""
        self.hass.stop()

    def test_get_clientsession_with_ssl(self):
        """Test init clientsession with ssl."""
        run_callback_threadsafe(self.hass.loop, client.async_get_clientsession,
                                self.hass).result()

        assert isinstance(
            self.hass.data[client.DATA_CLIENTSESSION], aiohttp.ClientSession)
        assert isinstance(
            self.hass.data[client.DATA_CONNECTOR], aiohttp.TCPConnector)

    def test_get_clientsession_without_ssl(self):
        """Test init clientsession without ssl."""
        run_callback_threadsafe(self.hass.loop, client.async_get_clientsession,
                                self.hass, False).result()

        assert isinstance(
            self.hass.data[client.DATA_CLIENTSESSION_NOTVERIFY],
            aiohttp.ClientSession)
        assert isinstance(
            self.hass.data[client.DATA_CONNECTOR_NOTVERIFY],
            aiohttp.TCPConnector)

    def test_create_clientsession_with_ssl_and_cookies(self):
        """Test create clientsession with ssl."""
        def _async_helper():
            return client.async_create_clientsession(
                self.hass,
                cookies={'bla': True}
            )

        session = run_callback_threadsafe(
            self.hass.loop,
            _async_helper,
        ).result()

        assert isinstance(
            session, aiohttp.ClientSession)
        assert isinstance(
            self.hass.data[client.DATA_CONNECTOR], aiohttp.TCPConnector)

    def test_create_clientsession_without_ssl_and_cookies(self):
        """Test create clientsession without ssl."""
        def _async_helper():
            return client.async_create_clientsession(
                self.hass,
                False,
                cookies={'bla': True}
            )

        session = run_callback_threadsafe(
            self.hass.loop,
            _async_helper,
        ).result()

        assert isinstance(
            session, aiohttp.ClientSession)
        assert isinstance(
            self.hass.data[client.DATA_CONNECTOR_NOTVERIFY],
            aiohttp.TCPConnector)

    def test_get_clientsession_cleanup(self):
        """Test init clientsession with ssl."""
        run_callback_threadsafe(self.hass.loop, client.async_get_clientsession,
                                self.hass).result()

        assert isinstance(
            self.hass.data[client.DATA_CLIENTSESSION], aiohttp.ClientSession)
        assert isinstance(
            self.hass.data[client.DATA_CONNECTOR], aiohttp.TCPConnector)

        self.hass.bus.fire(EVENT_HOMEASSISTANT_CLOSE)
        self.hass.block_till_done()

        assert self.hass.data[client.DATA_CLIENTSESSION].closed
        assert self.hass.data[client.DATA_CONNECTOR].closed

    def test_get_clientsession_cleanup_without_ssl(self):
        """Test init clientsession with ssl."""
        run_callback_threadsafe(self.hass.loop, client.async_get_clientsession,
                                self.hass, False).result()

        assert isinstance(
            self.hass.data[client.DATA_CLIENTSESSION_NOTVERIFY],
            aiohttp.ClientSession)
        assert isinstance(
            self.hass.data[client.DATA_CONNECTOR_NOTVERIFY],
            aiohttp.TCPConnector)

        self.hass.bus.fire(EVENT_HOMEASSISTANT_CLOSE)
        self.hass.block_till_done()

        assert self.hass.data[client.DATA_CLIENTSESSION_NOTVERIFY].closed
        assert self.hass.data[client.DATA_CONNECTOR_NOTVERIFY].closed

@asyncio.coroutine
def test_async_aiohttp_proxy_stream(aioclient_mock, hass, test_client):
    """Test that it fetches the given url."""
    aioclient_mock.get('http://example.com/mjpeg_stream', content=[
        b'Frame1', b'Frame2', b'Frame3'
    ])

    result = yield from async_setup_component(hass, 'camera', {
        'camera': {
            'name': 'config_test',
            'platform': 'mjpeg',
            'mjpeg_url': 'http://example.com/mjpeg_stream',
        }})
    assert result, 'Failed to setup camera'

    client = yield from test_client(hass.http.app)

    resp = yield from client.get('/api/camera_proxy_stream/camera.config_test')

    assert resp.status == 200
    assert aioclient_mock.call_count == 1
    body = yield from resp.text()
    assert body == 'Frame3Frame2Frame1'

    aioclient_mock.clear_requests()
    aioclient_mock.get(
        'http://example.com/mjpeg_stream', exc=asyncio.TimeoutError(),
        content=[b'Frame1', b'Frame2', b'Frame3'])

    resp = yield from client.get('/api/camera_proxy_stream/camera.config_test')
    assert resp.status == 504

    aioclient_mock.clear_requests()
    aioclient_mock.get(
        'http://example.com/mjpeg_stream', exc=aiohttp.ClientError(),
        content=[b'Frame1', b'Frame2', b'Frame3'])

    resp = yield from client.get('/api/camera_proxy_stream/camera.config_test')
    assert resp.status == 502


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Lucr. stiint. , Inst. agron. Bucuresti 94 (1962)

#### Original name
Cercospora petuniae Sandu & Serea

### Remarks
null


text:
'use strict';

exports.passport = {
  enable: true,
  package: 'egg-passport',
};


text:
<Alloy>
	<Window class="container" layout="horizontal">

		<View class="box" backgroundColor="{{colors.idx0}}">0</View>
		<View class="box" backgroundColor="{{colors.idx1}}">1</View>
		<View class="box" backgroundColor="{{colors.idx2}}">2</View>
		<View class="box" backgroundColor="{{colors.idx3}}">3</View>
		<View class="box" backgroundColor="{{colors.idx4}}">4</View>
		<View class="box" backgroundColor="{{colors.idx5}}">5</View>
		<View class="box" backgroundColor="{{colors.idx6}}">6</View>
		<View class="box" backgroundColor="{{colors.idx7}}">7</View>
		<View class="box" backgroundColor="{{colors.idx8}}">8</View>
		<View class="box" backgroundColor="{{colors.idx9}}">9</View>

		<View class="box" backgroundColor="{{colors.idx10}}">0</View>
		<View class="box" backgroundColor="{{colors.idx11}}">1</View>
		<View class="box" backgroundColor="{{colors.idx12}}">2</View>
		<View class="box" backgroundColor="{{colors.idx13}}">3</View>
		<View class="box" backgroundColor="{{colors.idx14}}">4</View>
		<View class="box" backgroundColor="{{colors.idx15}}">5</View>
		<View class="box" backgroundColor="{{colors.idx16}}">6</View>
		<View class="box" backgroundColor="{{colors.idx17}}">7</View>
		<View class="box" backgroundColor="{{colors.idx18}}">8</View>
		<View class="box" backgroundColor="{{colors.idx19}}">9</View>

		<View class="box" backgroundColor="{{colors.idx20}}">0</View>
		<View class="box" backgroundColor="{{colors.idx21}}">1</View>
		<View class="box" backgroundColor="{{colors.idx22}}">2</View>
		<View class="box" backgroundColor="{{colors.idx23}}">3</View>
		<View class="box" backgroundColor="{{colors.idx24}}">4</View>
		<View class="box" backgroundColor="{{colors.idx25}}">5</View>
		<View class="box" backgroundColor="{{colors.idx26}}">6</View>
		<View class="box" backgroundColor="{{colors.idx27}}">7</View>
		<View class="box" backgroundColor="{{colors.idx28}}">8</View>
		<View class="box" backgroundColor="{{colors.idx29}}">9</View>

		<View class="box" backgroundColor="{{colors.idx30}}">0</View>
		<View class="box" backgroundColor="{{colors.idx31}}">1</View>
		<View class="box" backgroundColor="{{colors.idx32}}">2</View>
		<View class="box" backgroundColor="{{colors.idx33}}">3</View>
		<View class="box" backgroundColor="{{colors.idx34}}">4</View>
		<View class="box" backgroundColor="{{colors.idx35}}">5</View>
		<View class="box" backgroundColor="{{colors.idx36}}">6</View>
		<View class="box" backgroundColor="{{colors.idx37}}">7</View>
		<View class="box" backgroundColor="{{colors.idx38}}">8</View>
		<View class="box" backgroundColor="{{colors.idx39}}">9</View>

		<View class="box" backgroundColor="{{colors.idx40}}">0</View>
		<View class="box" backgroundColor="{{colors.idx41}}">1</View>
		<View class="box" backgroundColor="{{colors.idx42}}">2</View>
		<View class="box" backgroundColor="{{colors.idx43}}">3</View>
		<View class="box" backgroundColor="{{colors.idx44}}">4</View>
		<View class="box" backgroundColor="{{colors.idx45}}">5</View>
		<View class="box" backgroundColor="{{colors.idx46}}">6</View>
		<View class="box" backgroundColor="{{colors.idx47}}">7</View>
		<View class="box" backgroundColor="{{colors.idx48}}">8</View>
		<View class="box" backgroundColor="{{colors.idx49}}">9</View>

		<View class="box" backgroundColor="{{colors.idx50}}">0</View>
		<View class="box" backgroundColor="{{colors.idx51}}">1</View>
		<View class="box" backgroundColor="{{colors.idx52}}">2</View>
		<View class="box" backgroundColor="{{colors.idx53}}">3</View>
		<View class="box" backgroundColor="{{colors.idx54}}">4</View>
		<View class="box" backgroundColor="{{colors.idx55}}">5</View>
		<View class="box" backgroundColor="{{colors.idx56}}">6</View>
		<View class="box" backgroundColor="{{colors.idx57}}">7</View>
		<View class="box" backgroundColor="{{colors.idx58}}">8</View>
		<View class="box" backgroundColor="{{colors.idx59}}">9</View>

		<View class="box" backgroundColor="{{colors.idx60}}">0</View>
		<View class="box" backgroundColor="{{colors.idx61}}">1</View>
		<View class="box" backgroundColor="{{colors.idx62}}">2</View>
		<View class="box" backgroundColor="{{colors.idx63}}">3</View>
		<View class="box" backgroundColor="{{colors.idx64}}">4</View>
		<View class="box" backgroundColor="{{colors.idx65}}">5</View>
		<View class="box" backgroundColor="{{colors.idx66}}">6</View>
		<View class="box" backgroundColor="{{colors.idx67}}">7</View>
		<View class="box" backgroundColor="{{colors.idx68}}">8</View>
		<View class="box" backgroundColor="{{colors.idx69}}">9</View>

		<View class="box" backgroundColor="{{colors.idx70}}">0</View>
		<View class="box" backgroundColor="{{colors.idx71}}">1</View>
		<View class="box" backgroundColor="{{colors.idx72}}">2</View>
		<View class="box" backgroundColor="{{colors.idx73}}">3</View>
		<View class="box" backgroundColor="{{colors.idx74}}">4</View>
		<View class="box" backgroundColor="{{colors.idx75}}">5</View>
		<View class="box" backgroundColor="{{colors.idx76}}">6</View>
		<View class="box" backgroundColor="{{colors.idx77}}">7</View>
		<View class="box" backgroundColor="{{colors.idx78}}">8</View>
		<View class="box" backgroundColor="{{colors.idx79}}">9</View>

		<View class="box" backgroundColor="{{colors.idx80}}">0</View>
		<View class="box" backgroundColor="{{colors.idx81}}">1</View>
		<View class="box" backgroundColor="{{colors.idx82}}">2</View>
		<View class="box" backgroundColor="{{colors.idx83}}">3</View>
		<View class="box" backgroundColor="{{colors.idx84}}">4</View>
		<View class="box" backgroundColor="{{colors.idx85}}">5</View>
		<View class="box" backgroundColor="{{colors.idx86}}">6</View>
		<View class="box" backgroundColor="{{colors.idx87}}">7</View>
		<View class="box" backgroundColor="{{colors.idx88}}">8</View>
		<View class="box" backgroundColor="{{colors.idx89}}">9</View>

		<View class="box" backgroundColor="{{colors.idx90}}">0</View>
		<View class="box" backgroundColor="{{colors.idx91}}">1</View>
		<View class="box" backgroundColor="{{colors.idx92}}">2</View>
		<View class="box" backgroundColor="{{colors.idx93}}">3</View>
		<View class="box" backgroundColor="{{colors.idx94}}">4</View>
		<View class="box" backgroundColor="{{colors.idx95}}">5</View>
		<View class="box" backgroundColor="{{colors.idx96}}">6</View>
		<View class="box" backgroundColor="{{colors.idx97}}">7</View>
		<View class="box" backgroundColor="{{colors.idx98}}">8</View>
		<View class="box" backgroundColor="{{colors.idx99}}">9</View>

	</Window>
</Alloy>


text:
Type.registerNamespace("Sys.Extended.UI");

Sys.Extended.UI.TimeSpan = function() {
    // Represents a period of time
    if (arguments.length == 0) this._ctor$0.apply(this, arguments);
    else if (arguments.length == 1) this._ctor$1.apply(this, arguments);
    else if (arguments.length == 3) this._ctor$2.apply(this, arguments);
    else if (arguments.length == 4) this._ctor$3.apply(this, arguments);
    else if (arguments.length == 5) this._ctor$4.apply(this, arguments);
    else throw Error.parameterCount();
}
Sys.Extended.UI.TimeSpan.prototype = {

    _ctor$0 : function() {
        this._ticks = 0;
    },
    _ctor$1 : function(ticks) {
        this._ctor$0();
        this._ticks = ticks;
    },
    _ctor$2 : function(hours, minutes, seconds) {
        this._ctor$0();
        this._ticks =
            (hours * Sys.Extended.UI.TimeSpan.TicksPerHour) +
            (minutes * Sys.Extended.UI.TimeSpan.TicksPerMinute) +
            (seconds * Sys.Extended.UI.TimeSpan.TicksPerSecond);
    },
    _ctor$3 : function(days, hours, minutes, seconds) {
        this._ctor$0();
        this._ticks =
            (days * Sys.Extended.UI.TimeSpan.TicksPerDay) +
            (hours * Sys.Extended.UI.TimeSpan.TicksPerHour) +
            (minutes * Sys.Extended.UI.TimeSpan.TicksPerMinute) +
            (seconds * Sys.Extended.UI.TimeSpan.TicksPerSecond);
    },
    _ctor$4 : function(days, hours, minutes, seconds, milliseconds) {
        this._ctor$0();
        this._ticks =
            (days * Sys.Extended.UI.TimeSpan.TicksPerDay) +
            (hours * Sys.Extended.UI.TimeSpan.TicksPerHour) +
            (minutes * Sys.Extended.UI.TimeSpan.TicksPerMinute) +
            (seconds * Sys.Extended.UI.TimeSpan.TicksPerSecond) +
            (milliseconds * Sys.Extended.UI.TimeSpan.TicksPerMillisecond);
    },

    getDays : function() {
        return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerDay);
    },
    getHours : function() {
        return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerHour) % 24;
    },
    getMinutes : function() {
        return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerMinute) % 60;
    },
    getSeconds : function() {
        return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerSecond) % 60;
    },
    getMilliseconds : function() {
        return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerMillisecond) % 1000;
    },
    getDuration : function() {
        return new Sys.Extended.UI.TimeSpan(Math.abs(this._ticks));
    },
    getTicks : function() {
        return this._ticks;
    },
    getTotalDays : function() {
        Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerDay);
    },
    getTotalHours : function() {
        return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerHour);
    },
    getTotalMinutes : function() {
        return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerMinute);
    },
    getTotalSeconds : function() {
        return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerSecond);
    },
    getTotalMilliseconds : function() {
        return Math.floor(this._ticks / Sys.Extended.UI.TimeSpan.TicksPerMillisecond);
    },
    add : function(value) {
        // Adds the supplied TimeSpan to this TimeSpan
        return new Sys.Extended.UI.TimeSpan(this._ticks + value.getTicks());
    },
    subtract : function(value) {
        // Subtracts the supplied TimeSpan to this TimeSpan
        return new Sys.Extended.UI.TimeSpan(this._ticks - value.getTicks());
    },
    negate : function() {
        // Negates the TimeSpan
        return new Sys.Extended.UI.TimeSpan(-this._ticks);
    },
    equals : function(value) {
        // Whether this TimeSpan equals another TimeSpan
        return this._ticks == value.getTicks();
    },
    compareTo : function(value) {
        // Whether this TimeSpan greater or less than another TimeSpan
        if(this._ticks > value.getTicks())
            return 1;
        else if(this._ticks < value.getTicks())
            return -1;
        else
            return 0;
    },
    toString : function() {
        return this.format("F");
    },
    format : function(format) {
        if (!format) {
            format = "F";
        }
        if (format.length == 1) {
            switch (format) {
                case "t": format = Sys.Extended.UI.TimeSpan.ShortTimeSpanPattern; break;
                case "T": format = Sys.Extended.UI.TimeSpan.LongTimeSpanPattern; break;
                case "F": format = Sys.Extended.UI.TimeSpan.FullTimeSpanPattern; break;
                default: throw Error.createError(String.format(Sys.Extended.UI.Resources.Common_DateTime_InvalidTimeSpan, format));
            }
        }
        var regex = /dd|d|hh|h|mm|m|ss|s|nnnn|nnn|nn|n/g;
        var builder = new Sys.StringBuilder();
        var ticks = this._ticks;
        if (ticks < 0) {
            builder.append("-");
            ticks = -ticks;
        }
        for (;;) {
            var index = regex.lastIndex;
            var ar = regex.exec(format);
            builder.append(format.slice(index, ar ? ar.index : format.length));
            if (!ar) break;
            switch (ar[0]) {
                case "dd":
                case "d":
                    builder.append($common.padLeft(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerDay, ar[0].length, '0')));
                    break;
                case "hh":
                case "h":
                    builder.append($common.padLeft(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerHour) % 24, ar[0].length, '0'));
                    break;
                case "mm":
                case "m":
                    builder.append($common.padLeft(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerMinute) % 60, ar[0].length, '0'));
                    break;
                case "ss":
                case "s":
                    builder.append($common.padLeft(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerSecond) % 60, ar[0].length, '0'));
                    break;
                case "nnnn":
                case "nnn":
                case "nn":
                case "n":
                    builder.append($common.padRight(Math.floor(ticks / Sys.Extended.UI.TimeSpan.TicksPerMillisecond) % 1000, ar[0].length, '0', true));
                    break;
                default:
                    Sys.Debug.assert(false);
            }
        }
        return builder.toString();
    }
}
Sys.Extended.UI.TimeSpan.parse = function(text) {
    // Parses a text value into a TimeSpan
    var parts = text.split(":");
    var d = 0;
    var h = 0;
    var m = 0;
    var s = 0;
    var n = 0;
    var ticks = 0;
    switch(parts.length) {
        case 1:
            if (parts[0].indexOf(".") != -1) {
                var parts2 = parts[0].split(".");
                s = parseInt(parts2[0]);
                n = parseInt(parts2[1]);
            } else {
                ticks = parseInt(parts[0]);
            }
            break;
        case 2:
            h = parseInt(parts[0]);
            m = parseInt(parts[1]);
            break;
        case 3:
            h = parseInt(parts[0]);
            m = parseInt(parts[1]);
            if (parts[2].indexOf(".") != -1) {
                var parts2 = parts[2].split(".");
                s = parseInt(parts2[0]);
                n = parseInt(parts2[1]);
            } else {
                s = parseInt(parts[2]);
            }
            break;
        case 4:
            d = parseInt(parts[0]);
            h = parseInt(parts[1]);
            m = parseInt(parts[2]);
            if (parts[3].indexOf(".") != -1) {
                var parts2 = parts[3].split(".");
                s = parseInt(parts2[0]);
                n = parseInt(parts2[1]);
            } else {
                s = parseInt(parts[3]);
            }
            break;
    }
    ticks += (d * Sys.Extended.UI.TimeSpan.TicksPerDay) +
             (h * Sys.Extended.UI.TimeSpan.TicksPerHour) +
             (m * Sys.Extended.UI.TimeSpan.TicksPerMinute) +
             (s * Sys.Extended.UI.TimeSpan.TicksPerSecond) +
             (n * Sys.Extended.UI.TimeSpan.TicksPerMillisecond);
    if(!isNaN(ticks)) {
        return new Sys.Extended.UI.TimeSpan(ticks);
    }
    throw Error.create(Sys.Extended.UI.Resources.Common_DateTime_InvalidFormat);
}
Sys.Extended.UI.TimeSpan.fromTicks = function(ticks) {
    // Creates a TimeSpan for the specified number of ticks
    return new Sys.Extended.UI.TimeSpan(ticks);
}
Sys.Extended.UI.TimeSpan.fromDays = function(days) {
    // Creates a TimeSpan for the specified number of days
    return new Sys.Extended.UI.TimeSpan(days * Sys.Extended.UI.TimeSpan.TicksPerDay);
}
Sys.Extended.UI.TimeSpan.fromHours = function(hours) {
    // Creates a TimeSpan for the specified number of hours
    return new Sys.Extended.UI.TimeSpan(hours * Sys.Extended.UI.TimeSpan.TicksPerHour);
}
Sys.Extended.UI.TimeSpan.fromMinutes = function(minutes) {
    // Creates a TimeSpan for the specified number of minutes
    return new Sys.Extended.UI.TimeSpan(minutes * Sys.Extended.UI.TimeSpan.TicksPerMinute);
}
Sys.Extended.UI.TimeSpan.fromSeconds = function(seconds) {
    // Creates a TimeSpan for the specified number of seconds
    return new Sys.Extended.UI.TimeSpan(minutes * Sys.Extended.UI.TimeSpan.TicksPerSecond);
}
Sys.Extended.UI.TimeSpan.fromMilliseconds = function(milliseconds) {
    // Creates a TimeSpan for the specified number of milliseconds
    return new Sys.Extended.UI.TimeSpan(minutes * Sys.Extended.UI.TimeSpan.TicksPerMillisecond);
}
Sys.Extended.UI.TimeSpan.TicksPerDay = 864000000000;
Sys.Extended.UI.TimeSpan.TicksPerHour = 36000000000;
Sys.Extended.UI.TimeSpan.TicksPerMinute = 600000000;
Sys.Extended.UI.TimeSpan.TicksPerSecond = 10000000;
Sys.Extended.UI.TimeSpan.TicksPerMillisecond = 10000;
Sys.Extended.UI.TimeSpan.FullTimeSpanPattern = "dd:hh:mm:ss.nnnn";
Sys.Extended.UI.TimeSpan.ShortTimeSpanPattern = "hh:mm";
Sys.Extended.UI.TimeSpan.LongTimeSpanPattern = "hh:mm:ss";

Date.prototype.getTimeOfDay = function Date$getTimeOfDay() {
    // Gets a TimeSpan representing the current time of the Date
    return new Sys.Extended.UI.TimeSpan(
        0,
        this.getHours(),
        this.getMinutes(),
        this.getSeconds(),
        this.getMilliseconds());
}
Date.prototype.getDateOnly = function Date$getDateOnly() {
    // Gets a Date representing the Date only part of the Date and Adjusts for DST switch at midnight.
    var tempDate = new Date(this.getFullYear(), this.getMonth(), this.getDate());

    if (!((this.getMonth() === tempDate.getMonth()) && (this.getDate() === tempDate.getDate()))) {

        tempDate.setMinutes(120);

    }

    return tempDate;
}
Date.prototype.add = function Date$add(span) {
    // Adds a TimeSpan to the current Date
    // param "span"is the amount of time to add to the date

    return new Date(this.getTime() + span.getTotalMilliseconds());
}
Date.prototype.subtract = function Date$subtract(span) {
    // Subtracts a TimeSpan to the current Date
    // param "span" is the amount of time to subtract from the date
    return this.add(span.negate());
}
Date.prototype.getTicks = function Date$getTicks() {
    return this.getTime() * Sys.Extended.UI.TimeSpan.TicksPerMillisecond;
}

Sys.Extended.UI.FirstDayOfWeek = function() {
}
Sys.Extended.UI.FirstDayOfWeek.prototype = {
    Sunday : 0,
    Monday : 1,
    Tuesday : 2,
    Wednesday : 3,
    Thursday : 4,
    Friday : 5,
    Saturday : 6,
    Default : 7
}
Sys.Extended.UI.FirstDayOfWeek.registerEnum("Sys.Extended.UI.FirstDayOfWeek");


text:
all: schedule two

schedule: schedule.c schedule.h
	gcc -Wall -Werror -g -o $@ schedule.c schedule.h

two: two.c
	gcc -Wall -Werror -g -o $@ two.c

clean:
	rm -f schedule two