text:
/**
 *
 * Emerald (kbi/elude @2012)
 *
 */
#ifndef SYSTEM_CONSTANTS_H
#define SYSTEM_CONSTANTS_H

#include "system_types.h"

/* Name of window class that will be used by all engine-spawned windows */
#define EMERALD_WINDOW_CLASS_NAME ("Emerald")

/* Length of a buffer used by variants for forced setters */
#define CONVERSION_BUFFER_LENGTH (32768)

/* Defines amount of ticks representing 1 second. This is used for storing time information, relative
 * to timeline.
 */
#define HZ_PER_SEC (100)

/* Defines amount of webcam entries that will be allocated space in webcam manager on start. */
#define BASE_WEBCAMS_AMOUNT (2)

/* Defines amount of precached entries for threads info storage */
#define BASE_THREADS_CAPACITY (8)

/* Defines amount of precached entries for window handle storage */
#define BASE_WINDOW_STORAGE (2)

/* Defines amount of threads active in thread pool */
#define THREAD_POOL_AMOUNT_OF_THREADS (4)

/* Defines amount of precached task descriptors to be used by thread pool. */
#define THREAD_POOL_PREALLOCATED_TASK_DESCRIPTORS (64)

/* Defines amount of precached task group descriptors to be used by thread pool. */
#define THREAD_POOL_PREALLOCATED_TASK_GROUP_DESCRIPTORS (8)

/* Defines amount of task slots to preallocate for a single task group descriptor */
#define THREAD_POOL_PREALLOCATED_TASK_SLOTS (8)

/* Defines amount of task containers created per-priority */
#define THREAD_POOL_PREALLOCATED_TASK_CONTAINERS (64)

/* Defines amount of preallocated order descriptors */
#define THREAD_POOL_PREALLOCATED_ORDER_DESCRIPTORS (THREAD_POOL_PREALLOCATED_TASK_CONTAINERS * THREAD_POOL_TASK_PRIORITY_COUNT)

/* Defines start capacity for file serializer's writing facility. */
#define FILE_SERIALIZER_START_CAPACITY (65536)

/* Define log level threshold. Logs with level lower than this value will be dropped on pre-processor phase. */
#define LOGLEVEL_BASE (LOGLEVEL_INFORMATION)

/* Defines base capacity for 4x4 matrix storage */
#define MATRIX4X4_BASE_CAPACITY (512)

/* Defines base capacity for variants storage */
#define VARIANTS_BASE_CAPACITY (128)

/* Defines base capacity for container used internally by the assertion module */
#define ASSERTIONS_BASE_CAPACITY (4)

/* Defines maximum length of an assertion failure string. */
#define ASSERTION_FAILURE_MAX_LENGTH (1024)

/* Defines maximum length of a single log entry. */
#define LOG_MAX_LENGTH (32768)

/* Defines default amount of bins used for a single 64-bit hash-map */
#define HASH64MAP_BINS_AMOUNT (16)

/* Defines default amount of entries in a single 64-bit hash-map's bin */
#define HASH64MAP_BIN_ENTRIES_AMOUNT (16)

#endif /* SYSTEM_CONSTANTS_H */


text:
import "reflect-metadata";
import { DateColumnType } from "../../Common/ColumnType";
import { DateColumnMetaData } from "../../MetaData/DateColumnMetaData";
import { IDateColumnOption } from "../Option/IDateColumnOption";
import { Column } from "./Column";

export function DateColumn(option?: IDateColumnOption): PropertyDecorator;
export function DateColumn(name: string, dbtype?: DateColumnType, defaultValue?: () => Date): PropertyDecorator;
export function DateColumn(optionOrName?: IDateColumnOption | string, dbtype?: DateColumnType, defaultValue?: () => Date): PropertyDecorator {
    let option: IDateColumnOption = {};
    if (typeof optionOrName === "string") {
        option.columnName = optionOrName;
        if (defaultValue !== undefined) {
            option.default = defaultValue;
        }
        if (dbtype !== undefined) {
            option.columnType = dbtype;
        }
    }
    else if (optionOrName) {
        option = optionOrName;
    }

    return Column<any, Date>(DateColumnMetaData, option);
}

redpajama_set_name: RedPajamaGithub


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

<title>org.springframework.web.servlet.view.json Class Hierarchy (Spring Framework 4.3.3.RELEASE API)</title>
<meta name="date" content="2016-09-19">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Spring Framework

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package org.springframework.web.servlet.view.json

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

org.springframework.context.support.ApplicationObjectSupport (implements org.springframework.context.ApplicationContextAware)

org.springframework.web.context.support.WebApplicationObjectSupport (implements org.springframework.web.context.ServletContextAware)

org.springframework.web.servlet.view.AbstractView (implements org.springframework.beans.factory.BeanNameAware, org.springframework.web.servlet.View)

org.springframework.web.servlet.view.json.AbstractJackson2View

org.springframework.web.servlet.view.json.MappingJackson2JsonView

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Spring Framework

Prev

Next

Frames

No Frames

All Classes


text:
package collabware.model.internal.ops;

import collabware.api.operations.OperationApplicationException;
import collabware.model.graph.ModifyableNode;

public class UnaryReferenceTargetMismatch extends OperationApplicationException {

	public UnaryReferenceTargetMismatch(SetUnaryReferenceOperation operation, ModifyableNode currentTargetNode) {
		super(renderMessage(operation, currentTargetNode));
	}

	private static String renderMessage(SetUnaryReferenceOperation operation, ModifyableNode currentTargetNode) {
		Object currentTargetNodeId;
		if (currentTargetNode == null) {
			currentTargetNodeId = null;
		} else {
			currentTargetNodeId = currentTargetNode.getId();
		}
		return "Unary reference target mismatch between operation " +
				"and model concerning node '"+operation.getNodeId()+"' and reference '"+operation.getReferenceName()+"'. " +
				"Expected '"+operation.getOldTargetId()+"' but was '"+currentTargetNodeId+"'.";
	}

	private static final long serialVersionUID = 1803154802355979184L;

}


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// アセンブリに関する一般情報は、以下の属性セットによって
// 制御されます。アセンブリに関連付けられている情報を変更するには、
// これらの属性値を変更します。
[assembly: AssemblyTitle("WindowSizeSample.Windows")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WindowSizeSample.Windows")]
[assembly: AssemblyCopyright("Copyright ©  2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// アセンブリのバージョン情報は、以下の 4 つの値で構成されています:
//
//      メジャー バージョン
//      マイナー バージョン
//      ビルド番号
//      リビジョン
//
// すべての値を指定することも、下に示すように '*' を使用してビルドおよびリビジョン番号を
// 既定値にすることもできます。
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]


text:
package com.jgoodies.forms.layout;

public class FormLayout {

}


text:
- Owe to the history, **Rendering engine(渲染引擎)** of different browser is not the same.
- There are 3 pars for rendering:
	- **HTML**
	- **CSS**
	- **JavaScript**
- Difference in rendering engine of browsers:

Browser|HTML|CSS|Javascript
:-----:|:--:|:-:|:--------:
IE|Trident|-|Chakra
Chrome|Webkit|Webcore|V8
Safari|Webkit|Webcore|Javascriptcore
Firefox|Gecko|-|SpiderMonkey
Opera|Presto|-|Carakan

- **Quirks(怪異) Mode**: For viewing pages of old versions.
- **Standard Mode**: Set by *W3C*.


text:
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/albumArt"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:adjustViewBounds="true"
    android:contentDescription="some basic text"
    android:padding="5dp"
    android:scaleType="fitXY"
    android:src="@drawable/blank_album_art" />


text:
class FilePath;

namespace chrome {

class MediaDeviceNotificationsLinux
    : public base::RefCountedThreadSafe<MediaDeviceNotificationsLinux,
          content::BrowserThread::DeleteOnFileThread> {
 public:
  explicit MediaDeviceNotificationsLinux(const FilePath& path);

  // Must be called for MediaDeviceNotificationsLinux to work.
  void Init();

 protected:
  // Avoids code deleting the object while there are references to it.
  // Aside from the base::RefCountedThreadSafe friend class, and derived
  // classes, any attempts to call this dtor will result in a compile-time
  // error.
  virtual ~MediaDeviceNotificationsLinux();

  virtual void OnFilePathChanged(const FilePath& path, bool error);

 private:
  friend class base::RefCountedThreadSafe<MediaDeviceNotificationsLinux>;
  friend class base::DeleteHelper<MediaDeviceNotificationsLinux>;
  friend struct content::BrowserThread::DeleteOnThread<
      content::BrowserThread::FILE>;

  // (mount device, device id)
  typedef std::pair<std::string, std::string> MountDeviceAndId;
  // Mapping of mount points to MountDeviceAndId.
  typedef std::map<std::string, MountDeviceAndId> MountMap;

  void InitOnFileThread();

  // Parse the mtab file and find all changes.
  void UpdateMtab();

  // Read the mtab file entries into |mtab|.
  void ReadMtab(MountMap* mtab);

  // Add a media device with a given device and mount device. Assign it a device
  // id as well.
  void AddNewDevice(const std::string& mount_device,
                    const std::string& mount_point,
                    std::string* device_id);

  // Remove a media device with a given device id.
  void RemoveOldDevice(const std::string& device_id);

  // Whether Init() has been called or not.
  bool initialized_;

  // Mtab file that lists the mount points.
  const FilePath mtab_path_;

  // Watcher for |mtab_path_|.
  base::files::FilePathWatcher file_watcher_;

  // Mapping of relevant mount points and their corresponding mount devices.
  // Keep in mind on Linux, a device can be mounted at multiple mount points,
  // and multiple devices can be mounted at a mount point.
  MountMap mtab_;

  // The lowest available device id number.
  // TODO(thestig) Remove this and use a real per-device unique id instead.
  int current_device_id_;

  // Set of known file systems that we care about.
  std::set<std::string> known_file_systems_;

  DISALLOW_COPY_AND_ASSIGN(MediaDeviceNotificationsLinux);
};

}  // namespace chrome

#endif  // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_LINUX_H_


text:
package com.amazonaws.services.alexaforbusiness.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 *

 * Information related to a user.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UserData implements Serializable, Cloneable, StructuredPojo {

    /**
     *

     * The ARN of a user.
     *

     */
    private String userArn;
    /**
     *

     * The first name of a user.
     *

     */
    private String firstName;
    /**
     *

     * The last name of a user.
     *

     */
    private String lastName;
    /**
     *

     * The email of a user.
     *

     */
    private String email;
    /**
     *

     * The enrollment status of a user.
     *

     */
    private String enrollmentStatus;
    /**
     *

     * The enrollment ARN of a user.
     *

     */
    private String enrollmentId;

    /**
     *

     * The ARN of a user.
     *

     *
     * @param userArn
     *        The ARN of a user.
     */

    public void setUserArn(String userArn) {
        this.userArn = userArn;
    }

    /**
     *

     * The ARN of a user.
     *

     *
     * @return The ARN of a user.
     */

    public String getUserArn() {
        return this.userArn;
    }

    /**
     *

     * The ARN of a user.
     *

     *
     * @param userArn
     *        The ARN of a user.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UserData withUserArn(String userArn) {
        setUserArn(userArn);
        return this;
    }

    /**
     *

     * The first name of a user.
     *

     *
     * @param firstName
     *        The first name of a user.
     */

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     *

     * The first name of a user.
     *

     *
     * @return The first name of a user.
     */

    public String getFirstName() {
        return this.firstName;
    }

    /**
     *

     * The first name of a user.
     *

     *
     * @param firstName
     *        The first name of a user.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UserData withFirstName(String firstName) {
        setFirstName(firstName);
        return this;
    }

    /**
     *

     * The last name of a user.
     *

     *
     * @param lastName
     *        The last name of a user.
     */

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     *

     * The last name of a user.
     *

     *
     * @return The last name of a user.
     */

    public String getLastName() {
        return this.lastName;
    }

    /**
     *

     * The last name of a user.
     *

     *
     * @param lastName
     *        The last name of a user.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UserData withLastName(String lastName) {
        setLastName(lastName);
        return this;
    }

    /**
     *

     * The email of a user.
     *

     *
     * @param email
     *        The email of a user.
     */

    public void setEmail(String email) {
        this.email = email;
    }

    /**
     *

     * The email of a user.
     *

     *
     * @return The email of a user.
     */

    public String getEmail() {
        return this.email;
    }

    /**
     *

     * The email of a user.
     *

     *
     * @param email
     *        The email of a user.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UserData withEmail(String email) {
        setEmail(email);
        return this;
    }

    /**
     *

     * The enrollment status of a user.
     *

     *
     * @param enrollmentStatus
     *        The enrollment status of a user.
     * @see EnrollmentStatus
     */

    public void setEnrollmentStatus(String enrollmentStatus) {
        this.enrollmentStatus = enrollmentStatus;
    }

    /**
     *

     * The enrollment status of a user.
     *

     *
     * @return The enrollment status of a user.
     * @see EnrollmentStatus
     */

    public String getEnrollmentStatus() {
        return this.enrollmentStatus;
    }

    /**
     *

     * The enrollment status of a user.
     *

     *
     * @param enrollmentStatus
     *        The enrollment status of a user.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see EnrollmentStatus
     */

    public UserData withEnrollmentStatus(String enrollmentStatus) {
        setEnrollmentStatus(enrollmentStatus);
        return this;
    }

    /**
     *

     * The enrollment status of a user.
     *

     *
     * @param enrollmentStatus
     *        The enrollment status of a user.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see EnrollmentStatus
     */

    public UserData withEnrollmentStatus(EnrollmentStatus enrollmentStatus) {
        this.enrollmentStatus = enrollmentStatus.toString();
        return this;
    }

    /**
     *

     * The enrollment ARN of a user.
     *

     *
     * @param enrollmentId
     *        The enrollment ARN of a user.
     */

    public void setEnrollmentId(String enrollmentId) {
        this.enrollmentId = enrollmentId;
    }

    /**
     *

     * The enrollment ARN of a user.
     *

     *
     * @return The enrollment ARN of a user.
     */

    public String getEnrollmentId() {
        return this.enrollmentId;
    }

    /**
     *

     * The enrollment ARN of a user.
     *

     *
     * @param enrollmentId
     *        The enrollment ARN of a user.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public UserData withEnrollmentId(String enrollmentId) {
        setEnrollmentId(enrollmentId);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getUserArn() != null)
            sb.append("UserArn: ").append(getUserArn()).append(",");
        if (getFirstName() != null)
            sb.append("FirstName: ").append(getFirstName()).append(",");
        if (getLastName() != null)
            sb.append("LastName: ").append(getLastName()).append(",");
        if (getEmail() != null)
            sb.append("Email: ").append(getEmail()).append(",");
        if (getEnrollmentStatus() != null)
            sb.append("EnrollmentStatus: ").append(getEnrollmentStatus()).append(",");
        if (getEnrollmentId() != null)
            sb.append("EnrollmentId: ").append(getEnrollmentId());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof UserData == false)
            return false;
        UserData other = (UserData) obj;
        if (other.getUserArn() == null ^ this.getUserArn() == null)
            return false;
        if (other.getUserArn() != null && other.getUserArn().equals(this.getUserArn()) == false)
            return false;
        if (other.getFirstName() == null ^ this.getFirstName() == null)
            return false;
        if (other.getFirstName() != null && other.getFirstName().equals(this.getFirstName()) == false)
            return false;
        if (other.getLastName() == null ^ this.getLastName() == null)
            return false;
        if (other.getLastName() != null && other.getLastName().equals(this.getLastName()) == false)
            return false;
        if (other.getEmail() == null ^ this.getEmail() == null)
            return false;
        if (other.getEmail() != null && other.getEmail().equals(this.getEmail()) == false)
            return false;
        if (other.getEnrollmentStatus() == null ^ this.getEnrollmentStatus() == null)
            return false;
        if (other.getEnrollmentStatus() != null && other.getEnrollmentStatus().equals(this.getEnrollmentStatus()) == false)
            return false;
        if (other.getEnrollmentId() == null ^ this.getEnrollmentId() == null)
            return false;
        if (other.getEnrollmentId() != null && other.getEnrollmentId().equals(this.getEnrollmentId()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getUserArn() == null) ? 0 : getUserArn().hashCode());
        hashCode = prime * hashCode + ((getFirstName() == null) ? 0 : getFirstName().hashCode());
        hashCode = prime * hashCode + ((getLastName() == null) ? 0 : getLastName().hashCode());
        hashCode = prime * hashCode + ((getEmail() == null) ? 0 : getEmail().hashCode());
        hashCode = prime * hashCode + ((getEnrollmentStatus() == null) ? 0 : getEnrollmentStatus().hashCode());
        hashCode = prime * hashCode + ((getEnrollmentId() == null) ? 0 : getEnrollmentId().hashCode());
        return hashCode;
    }

    @Override
    public UserData clone() {
        try {
            return (UserData) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.alexaforbusiness.model.transform.UserDataMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="mainImageDAO">

    <resultMap id="mainImage" type="egovframework.com.uss.ion.msi.service.MainImageVO">
        <result property="imageId" column="IMAGE_ID"/>
        <result property="imageNm" column="IMAGE_NM"/>
        <result property="image" column="IMAGE"/>
        <result property="imageFile" column="IMAGE_FILE"/>
        <result property="imageDc" column="IMAGE_DC"/>
        <result property="reflctAt" column="REFLCT_AT"/>
        <result property="userId" column="FRST_REGISTER_ID"/>
        <result property="regDate" column="FRST_REGIST_PNTTM"/>
    </resultMap>

    <resultMap id="image" type="egovframework.com.uss.ion.msi.service.MainImageVO">
        <result property="imageFile" column="IMAGE_FILE"/>
    </resultMap>

    <resultMap id="mainImageFile" type="egovframework.com.cmm.service.FileVO">
        <result property="fileStreCours" column="FILE_STRE_COURS"/>
        <result property="streFileNm" column="STRE_FILE_NM"/>
    </resultMap>

    <select id="selectMainImageList" parameterType="egovframework.com.uss.ion.msi.service.MainImageVO" resultMap="mainImage">
            SELECT IMAGE_ID,
                   IMAGE_NM,
                   IMAGE,
                   IMAGE_FILE,
                   IMAGE_DC,
                   REFLCT_AT,
                   FRST_REGISTER_ID,
                   FRST_REGIST_PNTTM
              FROM COMTNMAINIMAGE
             WHERE 1=1
            <if test="searchCondition == 1">AND
                IMAGE_NM LIKE CONCAT('%' , #{searchKeyword}, '%')
            </if>
            ORDER BY FRST_REGIST_PNTTM DESC
            LIMIT #{recordCountPerPage} OFFSET #{firstIndex}
    </select>

    <select id="selectMainImageListTotCnt" parameterType="egovframework.com.uss.ion.msi.service.MainImageVO" resultType="int">

            SELECT COUNT(*) totcnt
            FROM COMTNMAINIMAGE
            WHERE 1=1
            <if test="searchCondition == 1">AND
                IMAGE_NM LIKE CONCAT('%' , #{searchKeyword}, '%')
            </if>
    </select>

    <select id="selectMainImage" resultMap="mainImage">

            SELECT IMAGE_ID,
                   IMAGE_NM,
                   IMAGE,
                   IMAGE_FILE,
                   IMAGE_DC,
                   REFLCT_AT,
                   FRST_REGISTER_ID,
                   FRST_REGIST_PNTTM
              FROM COMTNMAINIMAGE
             WHERE IMAGE_ID = #{imageId}

    </select>

    <insert id="insertMainImage" parameterType="egovframework.com.uss.ion.msi.service.MainImage">

            INSERT INTO COMTNMAINIMAGE
                       (IMAGE_ID,
                        IMAGE_NM,
                        IMAGE,
                        IMAGE_FILE,
                        IMAGE_DC,
                        REFLCT_AT,
                        FRST_REGISTER_ID,
                        FRST_REGIST_PNTTM)
                VALUES (#{imageId},
                        #{imageNm},
                        #{image},
                        #{imageFile},
                        #{imageDc},
                        #{reflctAt},
                        #{userId},
                        NOW())

    </insert>

    <update id="updateMainImage" parameterType="egovframework.com.uss.ion.msi.service.MainImage">
            UPDATE COMTNMAINIMAGE
               SET IMAGE_NM = #{imageNm},
                   <if test="isAtchFile == true">
                   IMAGE = #{image},
                   IMAGE_FILE = #{imageFile},
                   </if>
                   IMAGE_DC = #{imageDc},
                   REFLCT_AT = #{reflctAt},
                   LAST_UPDUSR_ID = #{userId},
                   LAST_UPDT_PNTTM = NOW()
             WHERE IMAGE_ID = #{imageId}
    </update>

    <delete id="deleteMainImage" parameterType="egovframework.com.uss.ion.msi.service.MainImage">

            DELETE FROM COMTNMAINIMAGE
             WHERE IMAGE_ID = #{imageId}

    </delete>

    <select id="selectMainImageResult" resultMap="image">

            SELECT IMAGE_FILE
              FROM COMTNMAINIMAGE
             WHERE REFLCT_AT = 'Y'

    </select>

    <select id="selectMainImageFile" parameterType="egovframework.com.uss.ion.msi.service.MainImage" resultMap="mainImageFile">

            SELECT B.FILE_STRE_COURS AS FILE_STRE_COURS,
                   B.STRE_FILE_NM AS STRE_FILE_NM
              FROM COMTNMAINIMAGE A,
                   COMTNFILEDETAIL B
             WHERE 1 = 1
               AND IMAGE_ID = #{imageId}
               AND A.IMAGE_FILE = B.ATCH_FILE_ID

    </select>

</mapper>


text:
package logs

import (
	"encoding/json"
	"os"
	"runtime"
	"time"
)

// brush is a color join function
type brush func(string) string

// newBrush return a fix color Brush
func newBrush(color string) brush {
	pre := "\033["
	reset := "\033[0m"
	return func(text string) string {
		return pre + color + "m" + text + reset
	}
}

var colors = []brush{
	newBrush("1;37"), // Emergency          white
	newBrush("1;36"), // Alert              cyan
	newBrush("1;35"), // Critical           magenta
	newBrush("1;31"), // Error              red
	newBrush("1;33"), // Warning            yellow
	newBrush("1;32"), // Notice             green
	newBrush("1;34"), // Informational      blue
	newBrush("1;34"), // Debug              blue
}

// consoleWriter implements LoggerInterface and writes messages to terminal.
type consoleWriter struct {
	lg       *logWriter
	Level    int  `json:"level"`
	Colorful bool `json:"color"` //this filed is useful only when system's terminal supports color
}

// NewConsole create ConsoleWriter returning as LoggerInterface.
func NewConsole() Logger {
	cw := &consoleWriter{
		lg:       newLogWriter(os.Stdout),
		Level:    LevelDebug,
		Colorful: true,
	}
	return cw
}

// Init init console logger.
// jsonConfig like '{"level":LevelTrace}'.
func (c *consoleWriter) Init(jsonConfig string) error {
	if len(jsonConfig) == 0 {
		return nil
	}
	err := json.Unmarshal([]byte(jsonConfig), c)
	if runtime.GOOS == "windows" {
		c.Colorful = false
	}
	return err
}

// WriteMsg write message in console.
func (c *consoleWriter) WriteMsg(when time.Time, msg string, level int) error {
	if level > c.Level {
		return nil
	}
	if c.Colorful {
		msg = colors[level](msg)
	}
	c.lg.println(when, msg)
	return nil
}

// Destroy implementing method. empty.
func (c *consoleWriter) Destroy() {

}

// Flush implementing method. empty.
func (c *consoleWriter) Flush() {

}

func init() {
	Register("console", NewConsole)
}


text:
{% extends "proposals/base.html" %}

{% load bootstrap_tags %}
{% load boxes_tags %}
{% load thumbnail %}
{% load markitup_tags %}
{% load i18n %}

{% block page_title %}Sticker Details{% endblock %}

{% block body %}
    {% box "sticker_review_text" %}

{% for sticker in stickers %}
{% if forloop.counter|divisibleby:4 or forloop.counter == 1 %}

{% endif %}

Vote
Votes: {{ sticker.votes.count }}

{% endfor %}

{% endblock %}


text:
<?php

class MountEndpointTest extends TestCase {
    public function testMounts() {
        $endpoint = $this->api()->mounts();

        $this->assertEndpointUrl( 'v2/mounts', $endpoint );
    }

    public function testMountTypes() {
        $endpoint = $this->api()->mounts()->types();

        $this->assertEndpointIsBulk( $endpoint );
        $this->assertEndpointIsLocalized( $endpoint );
        $this->assertEndpointUrl( 'v2/mounts/types', $endpoint );

        $this->mockResponse('{"id":"raptor","name":"Raptor","default_skin":1,"skins":[21,24,1,29,81,13,32,99,94,58,35,86,17,88,76,48],"skills":[{"id":40409,"slot":"Weapon_1"}]}');
        $this->assertEquals('Raptor', $endpoint->get('raptor')->name);
    }

    public function testMountSkins() {
        $endpoint = $this->api()->mounts()->skins();

        $this->assertEndpointIsBulk( $endpoint );
        $this->assertEndpointIsLocalized( $endpoint );
        $this->assertEndpointUrl( 'v2/mounts/skins', $endpoint );

        $this->mockResponse('{"id":1,"name":"Raptor","icon":"https://render.guildwars2.com/file/2F4AAA52F573C5425BFCD7525FB70C9E6DCAD791/1766903.png","mount":"raptor","dye_slots":[{"color_id":19,"material":"leather"}]}');
        $this->assertEquals('Raptor', $endpoint->get(1)->name);
    }
}


text:
package com.mentatlabs.nsa
package scalac
package options

/* -Yno-load-impl-class
 * ====================
 *   2.11.0 - 2.11.8: Do not load $class.class files.
 *            2.12.0: !! missing !!
 */
case object ScalacYNoLoadImplClass
    extends ScalacOptionBoolean("-Yno-load-impl-class", ScalacVersions.`2.11.0`)


text:
import sys, hashlib, re, time
import evernote.edam.type.ttypes as Types
import evernote.edam.notestore.NoteStore as NoteStore
from evernote.api.client import EvernoteClient

from storage import Storage

class EvernoteController(object):
    def __init__(self, token, isSpecialToken = False, sandbox = False, isInternational = False):
        self.token = token
        if sandbox:
            self.client = EvernoteClient(token=self.token)
        elif isInternational:
            self.client = EvernoteClient(token=self.token, service_host='app.evernote.com')
        else:
            self.client = EvernoteClient(token=self.token, service_host='app.yinxiang.com')
        self.isSpecialToken = isSpecialToken
        self.userStore = self.client.get_user_store()
        self.noteStore = self.client.get_note_store()
        self.storage = Storage()
    def create_notebook(self, title):
        if self.get(title): return False
        notebook = Types.Notebook()
        notebook.name = title
        notebook = self.noteStore.createNotebook(notebook)
        self.storage.create_notebook(notebook)
        return True
    def create_note(self, noteFullPath, content = None, fileDir = None):
        if self.get(noteFullPath): return False
        if '/' in noteFullPath:
            notebook = noteFullPath.split('/')[0]
            title = noteFullPath.split('/')[1]
        else:
            notebook = self.storage.defaultNotebook
            title = noteFullPath
        note = Types.Note()
        note.title = title
        note.content = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">'
        note.content += '<en-note>'
        note.content += content or ''
        if self.get(notebook) is None: self.create_notebook(notebook)
        note.notebookGuid = self.get(notebook).guid
        if not fileDir is None:
            with open(fileDir, 'rb') as f: fileBytes = f.read()
            fileData = Types.Data()
            fileData.bodyHash = self._md5(fileBytes)
            fileData.size = len(fileBytes)
            fileData.body = fileBytes
            fileAttr = Types.ResourceAttributes()
            fileAttr.fileName = title + '.md'
            fileAttr.attachment = True
            fileResource = Types.Resource()
            fileResource.data = fileData
            fileResource.mime = 'application/octet-stream'
            fileResource.attributes = fileAttr
            note.resources = [fileResource]
            note.content += '<en-media type="application/octet-stream" hash="%s"/>'%fileData.bodyHash
        note.content += '</en-note>'
        note = self.noteStore.createNote(note)
        self.storage.create_note(note, notebook)
        return True
    def update_note(self, noteFullPath, content = None, fileDir = None):
        note = self.get(noteFullPath)
        if note is None: return self.create_note(noteFullPath, content or '', fileDir)
        if '/' in noteFullPath:
            notebook = noteFullPath.split('/')[0]
            title = noteFullPath.split('/')[1]
        else:
            notebook = self.storage.defaultNotebook
            title = noteFullPath
        oldContent = self.get_content(noteFullPath)
        header = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">'
        guid = note.guid
        oldContent = re.sub('<en-media.*?/>', '', oldContent)
        note = Types.Note()
        note.guid = guid
        note.title = title
        note.content = header
        note.content += '<en-note>'
        note.content += content or oldContent
        if not fileDir is None:
            with open(fileDir, 'rb') as f: fileBytes = f.read()
            fileData = Types.Data()
            fileData.bodyHash = self._md5(fileBytes)
            fileData.size = len(fileBytes)
            fileData.body = fileBytes
            fileAttr = Types.ResourceAttributes()
            fileAttr.fileName = title + '.md'
            fileAttr.attachment = True
            fileResource = Types.Resource()
            fileResource.data = fileData
            fileResource.mime = 'application/octet-stream'
            fileResource.attributes = fileAttr
            note.resources = [fileResource]
            note.content += '<en-media type="application/octet-stream" hash="%s"/>'%fileData.bodyHash
        note.content += '</en-note>'
        self.noteStore.updateNote(self.token, note)
        self.storage.delete_note(noteFullPath)
        self.storage.create_note(note, notebook)
        return True
    def get_content(self, noteFullPath):
        note = self.get(noteFullPath)
        if note is None: return
        r = self.noteStore.getNoteContent(note.guid)
        try:
            content = re.compile('.*?<en-note>(.*?)</en-note>').findall(r)[0]
        except:
            content = ''
        return content
    def get_attachment(self, noteFullPath):
        note = self.get(noteFullPath)
        return {resource.attributes.fileName: self.noteStore.getResourceData(resource.guid) for resource in (note.resources or {})}
    def move_note(self, noteFullPath, _to):
        if self.get(noteFullPath) is None: return False
        if type(self.get(noteFullPath)) != type(Types.Note()) or type(self.get(_to)) != type(Types.Notebook()): raise Exception('Type Error')
        self.noteStore.copyNote(self.token, self.get(noteFullPath).guid, self.get(_to).guid)
        if self.isSpecialToken:
            self.noteStore.expungeNote(self.token, self.get(noteFullPath).guid)
        else:
            self.noteStore.deleteNote(self.token, self.get(noteFullPath).guid)
        self.storage.move_note(noteFullPath, _to)
        return True
    def delete_note(self, noteFullPath):
        if self.get(noteFullPath) is None: return False
        if type(self.get(noteFullPath)) != type(Types.Note()): raise Exception('Types Error')
        if self.isSpecialToken:
            self.noteStore.expungeNote(self.token, self.get(noteFullPath).guid)
        else:
            self.noteStore.deleteNote(self.token, self.get(noteFullPath).guid)
        self.storage.delete_note(noteFullPath)
        return True
    def delete_notebook(self, notebook):
        if self.get(notebook) or not self.isSpecialToken: return False
        if type(self.get(notebook)) != type(Types.Notebook()): raise Exception('Types Error')
        self.noteStore.expungeNotebook(self.token, self.get(notebook).guid)
        self.storage.delete_notebook(notebook)
        return True
    def get(self, s):
        return self.storage.get(s)
    def show_notebook(self):
        self.storage.show_notebook()
    def show_notes(self, notebook=None):
        self.storage.show_notes(notebook)
    def _md5(self, s):
        m = hashlib.md5()
        m.update(s)
        return m.hexdigest()

if __name__ == '__main__':
    # You can get this from 'https://%s/api/DeveloperToken.action'%SERVICE_HOST >>
    # In China it's https://app.yinxiang.com/api/DeveloperToken.action <<
    token = 'S=s1:U=91eca:E=15be6680420:C=1548eb6d760:P=1cd:A=en-devtoken:V=2:H=026e6ff5f5d0753eb37146a1b4660cc9'
    e = EvernoteController(token, True, True)
    # e.update_note('Hello', 'Test', 'Changed', 'README.md')
    e.create_note('Test/中文', 'Chinese')

if False:
    e.create_notebook('Notebook1')
    e.create_note('Hello', '<en-note>Hello, world!</en-note>', 'Notebook1')
    e.create_notebook('Notebook2')
    e.show_notes()
    e.move_note('Notebook1/Hello', 'Notebook2')
    e.show_notes()
    e.delete_note('Notebook2/Hello')
    # deleting notebook can only be available when you use developer token for you own evernote
    e.delete_notebook('Notebook1')
    e.delete_notebook('Notebook2')
    e.show_notes()


text:
/**
 * ng-draggable.js - v0.1.3 - A lean AngularJS drag and drop directive.
 *
 * @author Ian Kennington Walter (http://ianvonwalter.com)
 */

/* global angular */
angular
  .module('ng-draggable', [])
  .factory('DraggableService', function() {
    return {};
  })
  .directive('ngDrag', ['$document', 'DraggableService', function($document, DraggableService) {
    return {
      restrict: 'A',
      scope: {
        'callback': '&ngDrag',
        'disabled': '&ngDragDisabled'
      },
      link: function($scope, element) {
        var hasTouch = ('ontouchstart' in document.documentElement);
        var pressEvents = 'touchstart mousedown';
        var moveEvents = 'touchmove mousemove';
        var releaseEvents = 'touchend mouseup';

        var pressTimer = null;

        $scope.$watch('disabled()', function(value) {
          if (value) {
            element.addClass('ng-drag-disabled');
          }
        });

        var initialize = function() {
          // Prevent native drag
          element.attr('draggable', 'false');
          element.on(pressEvents, onPress);
        };

        var onPress = function(event) {
          if (!$scope.disabled()) {
            if (hasTouch) {
              cancelPress();
              pressTimer = setTimeout(function() {
                cancelPress();
                onLongPress(event);
              }, 100);
              $document.on(moveEvents, cancelPress);
              $document.on(releaseEvents, cancelPress);
            } else {
              // Disable right click
              if (event.button !== 2) {
                onLongPress(event);
              }
            }
          }
        };

        var cancelPress = function() {
          clearTimeout(pressTimer);
          $document.off(moveEvents, cancelPress);
          $document.off(releaseEvents, cancelPress);
        };

        var updateService = function(e) {
          $scope.$apply(function() {
            DraggableService.x = e.clientX;
            DraggableService.y = e.clientY;
            DraggableService.elementX = e.clientX - element.centerX;
            DraggableService.elementY = e.clientY - element.centerY;
            DraggableService.element = element;
          });
        };

        var onLongPress = function(e) {
          e.preventDefault();

          element[0].style.width = element[0].offsetWidth + 'px';
          element[0].style.height = element[0].offsetHeight + 'px';
          element.centerX = e.offsetX || e.layerX;
          element.centerY = e.offsetY || e.layerY;
          element.addClass('dragging');

          updateService(e);

          moveElement(DraggableService.elementX, DraggableService.elementY);

          $document.on(moveEvents, onMove);
          $document.on(releaseEvents, onRelease);
        };

        var onMove = function(e) {
          if (!$scope.disabled()) {
            e.preventDefault();

            updateService(e);

            moveElement(DraggableService.elementX, DraggableService.elementY);
          }
        };

        var onRelease = function(e) {
          if (!$scope.disabled()) {
            e.preventDefault();

            if (!$scope.disabled() && $scope.callback) {
              DraggableService.data = angular.copy($scope.callback());
            }

            updateService(e);

            element.removeClass('dragging');
            element.css({ left: '', top: '', position: '', 'z-index': '' });

            $document.off(moveEvents, onMove);
            $document.off(releaseEvents, onRelease);
          }
        };

        var moveElement = function(x, y) {
          element.css({ left: x + 'px', top: y + 'px' });
        };

        initialize();
      }
    };
  }])
  .directive('ngDrop', ['DraggableService', function(DraggableService) {
    return {
      restrict: 'A',
      scope: {
        'callback': '&ngDrop',
        'disabled': '&ngDropDisabled'
      },
      link: function($scope, element) {
        $scope.$watch(function() { return DraggableService.x }, function(x) {
          if (x) {
            isTouching(DraggableService.x, DraggableService.y, DraggableService.element);
          }
        });

        $scope.$watch(function() { return DraggableService.data }, function(data) {
          if (data) {
            if (!$scope.disabled() && isTouching(DraggableService.x, DraggableService.y, DraggableService.element)) {
              $scope.callback({ $data: data });
            }
            updateDragStyles(false, DraggableService.element);
          }
        });

        var isTouching = function(mouseX, mouseY, dragElement) {
          var touching = isTouchingElement(mouseX, mouseY);
          updateDragStyles(touching, dragElement);
          return touching;
        };

        var updateDragStyles = function(touching, dragElement) {
          if (touching) {
            element.addClass('ng-drag-enter');
            dragElement.addClass('ng-drag-over');
          } else {
            element.removeClass('ng-drag-enter');
            dragElement.removeClass('ng-drag-over');
          }
        };

        var isTouchingElement = function(x, y) {
          var rect = element[0].getBoundingClientRect();
          return x >= rect.left &&
            x <= rect.right &&
            y <= rect.bottom &&
            y >= rect.top;
        };
      }
    };
  }]);


text:
import { describe, it } from 'mocha';
import AbstractTestLoader, {
  addModuleIncludeMatcher,
} from 'ember-cli-test-loader/test-support/index';

addModuleIncludeMatcher(function(moduleName) {
  return moduleName.match(/\.jshint$/);
});

export class TestLoader extends AbstractTestLoader {
  shouldLoadModule(moduleName) {
    return !moduleName.match(/^ember-mocha\//)
      && (moduleName.match(/[-_]test$/) || moduleName.match(/\.jshint$/));
  }

  moduleLoadFailure(moduleName, error) {
    describe('TestLoader Failures', function() {
      it(moduleName + ': could not be loaded', function() {
        throw error;
      });
    });
  }
}

/**
 * Load tests following the default patterns:
 *
 * - The module name ends with `-test` or `_test`
 * - The module name ends with `.jshint`
 */
export function loadTests() {
  new TestLoader().loadModules();
}


text:
from pony.orm import *
from datetime import datetime
from models.model_group import Group
from models.model_contact import Contact
from pymysql.converters import decoders

class ORMFixture:

    db = Database()

    class ORMGroup(db.Entity):
        _table_ = 'group_list'
        id = PrimaryKey(int, column='group_id')
        name = Optional(str, column='group_name')
        header = Optional(str, column='group_header')
        footer = Optional(str, column='group_footer')
        contacts = Set(lambda: ORMFixture.ORMContact, table='address_in_groups', column='id', reverse='groups', lazy=True)

    class ORMContact(db.Entity):
        _table_ = 'addressbook'
        id = PrimaryKey(int, column='id')
        firstname = Optional(str, column='firstname')
        middlename = Optional(str, column='middlename')
        lastname = Optional(str, column='lastname')
        nickname = Optional(str, column='nickname')
        company = Optional(str, column='company')
        title = Optional(str, column='title')
        address = Optional(str, column='address')
        homephone = Optional(str, column='home')
        mobilephone = Optional(str, column='mobile')
        workphone = Optional(str, column='work')
        fax = Optional(str, column='fax')
        email1 = Optional(str, column='email')
        email2 = Optional(str, column='email2')
        email3 = Optional(str, column='email3')
        homepage = Optional(str, column='homepage')
        notes = Optional(str, column='notes')
        secondaryphone = Optional(str, column='phone2')
        deprecated = Optional(datetime, column='deprecated')
        groups = Set(lambda: ORMFixture.ORMGroup, table='address_in_groups', column='group_id', reverse='contacts', lazy=True)

    def __init__(self, name, user, password, host):
        self.db.bind('mysql', host=host, database=name, user=user, password=password, conv=decoders)
        self.db.generate_mapping()

    def convert_groups_to_models(self, groups):
        def convert(group):
            return Group(group_id=str(group.id), group_name=group.name, group_header=group.header, group_footer=group.footer)
        return list(map(convert, groups))

    def convert_contacts_to_models(self, contacts):
        def convert(contact):
            return Contact(firstname=contact.firstname, lastname=contact.lastname, id=str(contact.id), homephone=contact.homephone,
                       mobilephone=contact.mobilephone, workphone=contact.workphone, secondaryphone=contact.secondaryphone,
                       email1=contact.email1, email2=contact.email2, email3=contact.email3, address=contact.address,
                       middlename=contact.middlename,
                       nickname=contact.nickname, title=contact.title, company=contact.company,
                       homepage=contact.homepage, notes=contact.notes, fax=contact.fax)
        return list(map(convert, contacts))

    @db_session
    def get_group_list(self):
        return self.convert_groups_to_models(select(g for g in ORMFixture.ORMGroup))

    @db_session
    def get_contact_list(self):
        return self.convert_contacts_to_models(select(c for c in ORMFixture.ORMContact if c.deprecated is None))

    @db_session
    def get_contacts_in_group(self, group):
        orm_group = list(select(g for g in ORMFixture.ORMGroup if g.id == group.group_id))[0]
        return self.convert_contacts_to_models(orm_group.contacts)

    @db_session
    def get_contacts_not_in_group(self, group):
        orm_group = list(select(g for g in ORMFixture.ORMGroup if g.id == group.group_id))[0]
        return self.convert_contacts_to_models(
            select(c for c in ORMFixture.ORMContact if c.deprecated is None and orm_group not in c.groups))


text:
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.IO;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Baseline;
using Marten.Linq;
using Marten.Schema;
using Marten.Schema.Identity;
using Marten.Services;
using Marten.Services.Includes;
using Marten.Storage;
using Marten.Util;
using Npgsql;
using NpgsqlTypes;
using Remotion.Linq;

namespace Marten.Events
{
    public abstract class EventMapping : IDocumentMapping, IQueryableDocument
    {
        private readonly StoreOptions _options;
        private readonly EventGraph _parent;
        protected readonly DocumentMapping _inner;

        protected EventMapping(EventGraph parent, Type eventType)
        {
            _options = parent.Options;
            _parent = parent;
            DocumentType = eventType;

            EventTypeName = Alias = DocumentType.Name.ToTableAlias();
            IdMember = DocumentType.GetProperty(nameof(IEvent.Id));

            _inner = new DocumentMapping(eventType, parent.Options);
        }

        public Type DocumentType { get; }
        public string EventTypeName { get; set; }
        public string Alias { get; }
        public MemberInfo IdMember { get; }
        public NpgsqlDbType IdType { get; } = NpgsqlDbType.Uuid;
        public TenancyStyle TenancyStyle { get; } = TenancyStyle.Single;

        Type IDocumentMapping.IdType => typeof(Guid);

        public DbObjectName Table =>  new DbObjectName(_options.Events.DatabaseSchemaName, "mt_events");
        public DuplicatedField[] DuplicatedFields { get; }
        public DeleteStyle DeleteStyle { get; }

        public string DatabaseSchemaName
        {
            get { return _options.Events.DatabaseSchemaName; }
            set { throw new NotSupportedException("The DatabaseSchemaName of Event can't be set."); }
        }

        public PropertySearching PropertySearching { get; } = PropertySearching.JSON_Locator_Only;

        public string[] SelectFields()
        {
            return new[] {"id", "data"};
        }

        public IField FieldFor(IEnumerable<MemberInfo> members)
        {
            return _inner.FieldFor(members);
        }

        public IWhereFragment FilterDocuments(QueryModel model, IWhereFragment query)
        {
            return new CompoundWhereFragment("and", DefaultWhereFragment(), query);
        }

        public IWhereFragment DefaultWhereFragment()
        {
            return new WhereFragment($"d.type = '{EventTypeName}'");
        }

        public abstract IDocumentStorage BuildStorage(StoreOptions options);

        public void DeleteAllDocuments(ITenant factory)
        {
            factory.RunSql($"delete from mt_events where type = '{Alias}'");
        }

        public IdAssignment<T> ToIdAssignment<T>(ITenant tenant)
        {
            throw new NotSupportedException();
        }

        public IQueryableDocument ToQueryableDocument()
        {
            return this;
        }

        public IncludeJoin<TOther> JoinToInclude<TOther>(JoinType joinType, IQueryableDocument other, MemberInfo[] members, Action<TOther> callback)
        {
            return _inner.JoinToInclude<TOther>(joinType, other, members, callback);
        }

    }

    public class EventMapping<T> : EventMapping, IDocumentStorage<T> where T : class
    {
        private readonly string _tableName;

        public EventMapping(EventGraph parent) : base(parent, typeof(T))
        {
            var schemaName = parent.DatabaseSchemaName;
            _tableName = schemaName == StoreOptions.DefaultDatabaseSchemaName ? "mt_events" : $"{schemaName}.mt_events";
        }

        public override IDocumentStorage BuildStorage(StoreOptions options)
        {
            return this;
        }

        public NpgsqlCommand LoaderCommand(object id)
        {
            return new NpgsqlCommand($"select d.data, d.id from {_tableName} as d where id = :id and type = '{Alias}'").With("id", id);
        }

        public NpgsqlCommand LoadByArrayCommand<TKey>(TKey[] ids)
        {
            return new NpgsqlCommand($"select d.data, d.id from {_tableName} as d where id = ANY(:ids) and type = '{Alias}'").With("ids", ids);
        }

        public object Identity(object document)
        {
            return document.As<IEvent>().Id;
        }

        public void RegisterUpdate(string tenantIdOverride, UpdateStyle updateStyle, UpdateBatch batch, object entity)
        {
            // Do nothing
        }

        public void RegisterUpdate(string tenantIdOverride, UpdateStyle updateStyle, UpdateBatch batch, object entity, string json)
        {
            // Do nothing
        }

        public void Remove(IIdentityMap map, object entity)
        {
            throw new InvalidOperationException("Use IDocumentSession.Events for all persistence of IEvent objects");
        }

        public void Delete(IIdentityMap map, object id)
        {
            throw new InvalidOperationException("Use IDocumentSession.Events for all persistence of IEvent objects");
        }

        public void Store(IIdentityMap map, object id, object entity)
        {
            throw new InvalidOperationException("Use IDocumentSession.Events for all persistence of IEvent objects");
        }

        public IStorageOperation DeletionForId(object id)
        {
            throw new NotSupportedException("You cannot delete events at this time");
        }

        public IStorageOperation DeletionForEntity(object entity)
        {
            throw new NotSupportedException("You cannot delete events at this time");
        }

        public IStorageOperation DeletionForWhere(IWhereFragment @where)
        {
            throw new NotSupportedException("You cannot delete events at this time");
        }

        public T Resolve(int startingIndex, DbDataReader reader, IIdentityMap map)
        {
            var id = reader.GetGuid(startingIndex);
            var json = reader.GetTextReader(startingIndex + 1);

            return map.Get<T>(id, json, null);
        }

        public async Task<T> ResolveAsync(int startingIndex, DbDataReader reader, IIdentityMap map, CancellationToken token)
        {
            var id = await reader.GetFieldValueAsync<Guid>(startingIndex, token).ConfigureAwait(false);

            var json = await reader.As<NpgsqlDataReader>().GetTextReaderAsync(startingIndex + 1).ConfigureAwait(false);

            return map.Get<T>(id, json, null);
        }

        public T Resolve(IIdentityMap map, IQuerySession session, object id)
        {
            if (map.Has<T>(id)) return map.Retrieve<T>(id);

            var cmd = LoaderCommand(id);
            cmd.Connection = session.Connection;
            using (var reader = cmd.ExecuteReader())
            {
                if (!reader.Read()) return null;

                var json = reader.GetTextReader(0);
                var doc = session.Serializer.FromJson<T>(json);
                map.Store(id, doc);

                return doc;
            }
        }

        public async Task<T> ResolveAsync(IIdentityMap map, IQuerySession session, CancellationToken token, object id)
        {
            if (map.Has<T>(id)) return map.Retrieve<T>(id);

            var cmd = LoaderCommand(id);
            cmd.Connection = session.Connection;

            using (var reader = await cmd.ExecuteReaderAsync(token).ConfigureAwait(false))
            {
                var found = await reader.ReadAsync(token).ConfigureAwait(false);

                if (!found) return null;

                var json = reader.GetTextReader(0);
                //var json = await reader.GetFieldValueAsync<string>(0, token).ConfigureAwait(false);
                var doc = session.Serializer.FromJson<T>(json);
                map.Store(id, doc);

                return doc;
            }
        }

    }
}


text:
/*
* generated by Xtext
*/
package co.edu.uniandes.mono.gesco.ui.contentassist;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.*;
import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor;
import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext;

/**
 * Represents a generated, default implementation of superclass {@link org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider}.
 * Methods are dynamically dispatched on the first parameter, i.e., you can override them
 * with a more concrete subtype.
 */
@SuppressWarnings("all")
public class AbstractDSLProposalProvider extends org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider {

	public void completeConfiguracion_SistemaOperativo(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSistemaOperativo_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSistemaOperativo_Version(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSistemaOperativo_Descripcion(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSistemaOperativo_Arquitectura(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSistemaOperativo_Fuentes(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSistemaOperativo_Requerimientos(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFuentes_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFuentes_Autor(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFuentes_Fuente(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeFuentes_TipoFuente(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSoftware_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSoftware_Version(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSoftware_Descripcion(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSoftware_Arquitectura(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSoftware_RutaDestino(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor);
	}
	public void completeSoftware_Dependencia(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
	}
	public void completeSoftware_Origen(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		lookupCrossReference(((CrossReference)assignment.getTerminal()), context, acceptor);
	}

	public void complete_Configuracion(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_SistemaOperativo(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_EString(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_Arquitectura(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_Fuentes(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
	public void complete_Software(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
		// subclasses may override
	}
}


text:
<refentry xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:xi="http://www.w3.org/2001/XInclude"
          xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          version="5.0" xml:id="nominal.image.width">
<refmeta>
<refentrytitle>nominal.image.width</refentrytitle>
<refmiscinfo class="other" otherclass="datatype">length</refmiscinfo>
</refmeta>
<refnamediv>
<refname>nominal.image.width</refname>
<refpurpose>The nominal image width</refpurpose>
</refnamediv>

<refsynopsisdiv>
<src:fragment xml:id="nominal.image.width.frag">
<xsl:param name="nominal.image.width" select="6 * $pixels.per.inch"/>
</src:fragment>
</refsynopsisdiv>

<refsection><info><title>Description</title></info>

<para>Graphic widths expressed as a percentage are problematic. In the
following discussion, we speak of width and contentwidth, but
the same issues apply to depth and contentdepth.</para>

<para>A width of 50% means "half of the available space for the image."
That's fine. But note that in HTML, this is a dynamic property and
the image size will vary if the browser window is resized.</para>

<para>A contentwidth of 50% means "half of the actual image width".
But what does that mean if the stylesheets cannot assess the image's
actual size? Treating this as a width of 50% is one possibility, but
it produces behavior (dynamic scaling) that seems entirely out of
character with the meaning.</para>

<para>Instead, the stylesheets define a
<parameter>nominal.image.width</parameter> and convert percentages to
actual values based on that nominal size.</para>

</refsection>
</refentry>


text:
class TempModel
  :public QAbstractTableModel
{
  Q_OBJECT
public:
  explicit TempModel( QObject* parent = 0 );
  virtual int rowCount( const QModelIndex& parent ) const;
  virtual int columnCount( const QModelIndex& parent ) const;
  virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const;
  virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;

  void setValue( const QString& key, float value, int age );

signals:

public slots:

private:
  mutable QMutex _m;

  typedef QMap<QString,float> Values;
  Values _values;

  typedef QVector<Values::iterator> Iterators;
  Iterators _iterators;

  typedef QMap<QString,int> Indicies;
  Indicies _indicies;

};

#endif // TEMPMODEL_H


text:
<?php
namespace Frozennode\Administrator\Fields;

use Illuminate\Database\Query\Builder as QueryBuilder;

class Key extends Field {

	/**
	 * The specific defaults for subclasses to override
	 *
	 * @var array
	 */
	protected $defaults = array(
		'editable' => false,
	);

	/**
	 * Fill a model with input data
	 *
	 * @param \Illuminate\Database\Eloquent\Model	$model
	 *
	 * @return array
	 */
	public function fillModel(&$model, $input) {}

	/**
	 * Filters a query object
	 *
	 * @param \Illuminate\Database\Query\Builder	$query
	 * @param array									$selects
	 *
	 * @return void
	 */
	public function filterQuery(QueryBuilder &$query, &$selects = null)
	{
		//run the parent method
		parent::filterQuery($query, $selects);

		//if there is no value, return
		if (!$this->getOption('value'))
		{
			return;
		}

		$query->where($this->config->getDataModel()->getTable().'.'.$this->getOption('field_name'), '=', $this->getOption('value'));
	}
}


text:
<?php

namespace Event\EventBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\OptionsResolver\OptionsResolver;

class FormEvent extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('titre', 'text', array(
                  'attr' => array(
                      'placeholder' => 'Millenium VS Fnatic',)
                   ))
            ->add('datefinpari', 'datetime')
            ->add('description', 'textarea')
            ->add('coteteam1','number', array(
                  'attr'=> array(
                      'placeholder' => '1,234...'
                  )
            ))
            ->add('coteteam2', 'number', array(
                  'attr'=> array(
                      'placeholder'=> '1,093...'
                  )
            ))
            ->add('jeu', 'entity', array(
                'class' => 'EventEventBundle:jeu',
                'property' => 'nom'
            ))
            ->add('equipe1', 'entity', array(
                  'class' => 'EventEventBundle:equipe',
                  'property' => 'nom'
            ))
            ->add('equipe2', 'entity', array(
                'class' => 'EventEventBundle:equipe',
                'property' => 'nom'
            ))
            ->add('etat', 'choice', array(
            'choices' => array('brouillon' => 'Brouillon', 'valider' => 'Valider', 'parisOuvert' => 'Paris Ouvert', 'parisFerme' => 'Paris Fermé', 'termine' => 'Terminé', 'archive' => 'Archive'),
            'preferred_choices' => array('brouillon'),
        ))
            ->add('valider', 'submit');
    }

    public function getName()
    {
        return 'eventbundle_eventAll';
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Event\EventBundle\Entity\event',
            'data_class2' => 'Event\EventBundle\Entity\equipe'
        ));
    }
}


text:
export default function capitalize() {
    function capitalizeFilter(input) {
        if (input !== null) {
            input = input.toLowerCase();
        }
        return input.substring(0, 1).toUpperCase() + input.substring(1);
    }

    return capitalizeFilter;
};


text:
<?php

namespace LejOrder\Collaboration\Domain\Model;

class ForumClosed
{
}


text:
<?xml version="1.0" encoding="utf-8"?>

<!-- TODO (4) Set the touch selector as the background property for the list item layout -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/list_item_selector">

    <!-- Horizontal linear layout to create a contacts list item -->
    <LinearLayout android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="80dp"
        android:paddingTop="4dp"
        android:paddingBottom="4dp"
        android:gravity="center_vertical">

        <!-- Person icon -->
        <ImageView
            android:id="@+id/personIcon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_person"
            android:paddingRight="4dp"
            android:paddingLeft="4dp"
            android:contentDescription="@string/person_icon"/>

        <!-- Text views for a person's first and last name -->
        <TextView
            android:id="@+id/firstName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textStyle="bold"
            android:textSize="24sp"
            android:textColor="@android:color/black"
            android:text="@string/first"
            android:paddingRight="4dp"
            android:paddingLeft ="4dp"/>

        <TextView
            android:id="@+id/lastName"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="24sp"
            android:textColor="@android:color/darker_gray"
            android:text="@string/last"
            android:paddingRight="4dp"
            android:paddingLeft ="4dp"/>

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@android:color/darker_gray"/>

</LinearLayout>


text:
/**
 * Created by milabobo on 8:42 PM.
 */
public class Main {
    public static void main(String[] args) {
        StateManager manager = new StateManager(new GuestState());

        manager.putToShoppingChar(Product.APPLE);
        manager.login();
        manager.putToShoppingChar(Product.APPLE);
        manager.putToShoppingChar(Product.PEAR);
        manager.putToShoppingChar(Product.BANANA);

        manager.logout();
        manager.putToShoppingChar(Product.BANANA);
    }
}


text:
echo 'Synchronization created backups with a remote repository..'
REMOTE_PATH=$REMOTE_ADDR:$REMOTE_BACKUP_DIR
echo $REMOTE_ADDR
if test $REMOTE_ADDR == 'localhost' || $REMOTE_ADDR == '127.0.0.1'
	then
	REMOTE_PATH=$REMOTE_BACKUP_DIR
fi
rsync -aP $APP_DIRECTORY/$TMP_BACKUP_DIR $REMOTE_PATH


text:
<?php

namespace Rudi\Model;

use Illuminate\Database\Eloquent\Model as Eloquent;

class Rank extends Eloquent {

    protected $fillable = ['shortname', 'longname', 'img_filename', 'ordinal'];
}


text:
// Copyright 2005-2016 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.

#include "../mumble_plugin_win32_x86.h"

static int fetch(float *avatar_pos, float *avatar_front, float *avatar_top, float *camera_pos, float *camera_front, float *camera_top, std::string &, std::wstring &) {
	float viewHor, viewVer;
	char state;

	for (int i=0;i<3;i++)
		avatar_pos[i] = avatar_front[i] = avatar_top[i] = camera_pos[i] = camera_front[i] = camera_top[i] = 0.0f;

	bool ok;

	/*
		This plugin uses the following Variables:

			Address			Type	Description
			===================================
			0x008F0F78		float	Z-Coordinate
			0x008F0F7C		float	X-Coordinate
			0x008F0F80		float	Y-Coordinate
			0x008F0F88		float	Horizontal view (degrees)
			0x008F0F84		float	Vertical view (degrees)

			0x007F7A34		byte	Magical state value
	*/
	ok = peekProc(0x007F8AB4, &state, 1); // Magical state value
	if (! ok)
		return false;
	/*
		state value is:
		0		while not in game
		1		while playing
		5		while spectating

		This value is used for disabling PA for spectators
		or people not on a server.
	*/
	if (state != 1)
		return true; // This results in all vectors beeing zero which tells mumble to ignore them.

	ok = peekProc(0x008F1FF8, avatar_pos+2, 4) &&	//Z
	     peekProc(0x008F1FFC, avatar_pos, 4) &&	//X
	     peekProc(0x008F2000, avatar_pos+1, 4) && //Y
	     peekProc(0x008F2008, &viewHor, 4) && //Hor
	     peekProc(0x008F2004, &viewVer, 4); //Ver

	if (! ok)
		return false;

	// Scale Coordinates
	/*
	   Z-Value is increasing when heading north
				  decreasing when heading south
	   X-Value is increasing when heading west
				  decreasing when heading east
	   Y-Value is increasing when going up
				  decreasing when going down
	   40 units = 1 meter (not confirmed)
	*/
	for (int i=0;i<3;i++)
		avatar_pos[i]/=40.0f; // Scale to meters
	avatar_pos[0]*=(-1.0f); // Convert right to left handed

	avatar_top[2] = -1; // Head movement is in front vector

	// Calculate view unit vector
	/*
	   Vertical view 0° when centered
					85°	when looking down
				   275° when looking up
	   Decreasing when looking up.

	   Horizontal is 0° when facing North
					90° when facing West
				   180° when facing South
				   270° when facing East
	   Increasing when turning left.
	*/
	viewVer *= static_cast<float>(M_PI / 180.0f);
	viewHor *= static_cast<float>(M_PI / 180.0f);

	avatar_front[0] = -sin(viewHor) * cos(viewVer);
	avatar_front[1] = -sin(viewVer);
	avatar_front[2] = cos(viewHor) * cos(viewVer);

	for (int i=0;i<3;i++) {
		camera_pos[i] = avatar_pos[i];
		camera_front[i] = avatar_front[i];
		camera_top[i] = avatar_top[i];
	}

	return true;
}

static int trylock(const std::multimap<std::wstring, unsigned long long int> &pids) {
	if (! initialize(pids, L"iw4mp.exe"))
		return false;

	float apos[3], afront[3], atop[3], cpos[3], cfront[3], ctop[3];
	std::string context;
	std::wstring identity;

	if (fetch(apos, afront, atop, cpos, cfront, ctop, context, identity)) {
		return true;
	} else {
		generic_unlock();
		return false;
	}
}

static const std::wstring longdesc() {
	return std::wstring(L"Supports Call of Duty: Modern Warfare 2 MP v1.2.208 only. No context or identity support yet.");
}

static std::wstring description(L"Call of Duty: Modern Warfare 2 MP v1.2.208");
static std::wstring shortname(L"Call of Duty: Modern Warfare 2 MP");

static int trylock1() {
	return trylock(std::multimap<std::wstring, unsigned long long int>());
}

static MumblePlugin codmw2plug = {
	MUMBLE_PLUGIN_MAGIC,
	description,
	shortname,
	NULL,
	NULL,
	trylock1,
	generic_unlock,
	longdesc,
	fetch
};

static MumblePlugin2 codmw2plug2 = {
	MUMBLE_PLUGIN_MAGIC_2,
	MUMBLE_PLUGIN_VERSION,
	trylock
};

extern "C" __declspec(dllexport) MumblePlugin *getMumblePlugin() {
	return &codmw2plug;
}

extern "C" __declspec(dllexport) MumblePlugin2 *getMumblePlugin2() {
	return &codmw2plug2;
}


text:
<html>
<head>
<style>
body {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: -webkit-flex;
  -webkit-flex-direction: column;
  -webkit-align-items: stretch;
}
.dropping {
  background: #ffcc00;
}
nav {
	display: -webkit-flex;
	-webkit-justify-content: center;
	-webkit-align-items: center;
}
video {
	width: 640px;
	height: 480px;
	background: rgba(0,0,0,0.25);
}
button {
  display: inline-block;
  background: -webkit-linear-gradient(#F9F9F9 40%, #E3E3E3 70%);
  background: linear-gradient(#F9F9F9 40%, #E3E3E3 70%);
  border: 1px solid #999;
  -webkit-border-radius: 3px;
  border-radius: 3px;
  padding: 5px 8px;
  outline: none;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
  text-shadow: 1px 1px #fff;
  font-weight: 700;
  font-size: 10pt;
}
button:not(:disabled):hover {
  border-color: black;
}
button:not(:disabled):active {
  background: -webkit-linear-gradient(#E3E3E3 40%, #F9F9F9 70%);
  background: linear-gradient(#E3E3E3 40%, #F9F9F9 70%);
}
input, textarea {
  box-shadow: 1px 1px 5px #ccc inset;
  border: none;
  padding: .5em;
}
[readonly] {
  background: #eee;
}
[hidden] {
  display: none;
}
textarea {
  width: 100%;
  height: 200px;
  outline: none;
  padding: 1px;
  font-size: 20px;
  padding: 1em;
}
output {
  text-align: center;
  padding: 1em;
  display: block;
}
#image_display {
  -webkit-flex: 1;
  display: -webkit-flex;
  -webkit-align-items: stretch;
}
canvas {
  -webkit-flex: 1;
  border: 1px #aaa solid;
  box-shadow: 0px 2px 10px rgba(0,0,0,0.5) inset;
  background-image: url('assets/work_area_background.png');
  background-repeat: repeat;
}
</style>
</head>
<body>
  <nav>
    <button id="choose_file">Choose File</button>
    <button id="crop" disabled>Apply Crop</button>
    <button id="save_file" disabled>Save As</button>
  </nav>

  <output>Load a file.</output>

  <div id="image_display">
    <canvas></canvas>
  </div>

  <script src="dnd.js"></script>
  <script src="app.js"></script>
</body>
</html>


text:
@interface GSNewViewController : UIViewController

@end


text:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
  <PreferenceCategory android:title="@string/pref_category_stats">
    <ListPreference
        android:title="@string/pref_min_length_title"
        android:key="word_length"
        android:summary=""
        android:entries="@array/word_length_entries"
        android:entryValues="@array/word_length_values"
        android:defaultValue="3"
        />

    <ListPreference
        android:title="@string/pref_most_used_title"
        android:key="most_used_return"
        android:summary=""
        android:entries="@array/most_used_entries"
        android:entryValues="@array/most_used_values"
        android:defaultValue="3"
        />

    <ListPreference
        android:title="@string/pref_reply_title"
        android:key="reply_time"
        android:summary=""
        android:entries="@array/reply_time_entries"
        android:entryValues="@array/reply_time_values"
        android:defaultValue="60"
        />

  </PreferenceCategory>

  <PreferenceCategory android:title="@string/pref_category_ui">

    <SwitchPreference
        android:title="@string/pref_display_photos"
        android:key="display_photos"
        android:defaultValue="true"
        android:summaryOn="Yes"
        android:summaryOff="No"
        />

    <ListPreference
        android:title="@string/pref_set_theme"
        android:key="chosen_theme"
        android:summary=""
        android:entries="@array/theme_entries"
        android:entryValues="@array/theme_values"
        android:defaultValue="0"
        />

  </PreferenceCategory>

  <PreferenceCategory
    android:title="@string/pref_category_etc"
      >
    <Preference
        android:title="@string/pref_rate_title"
        android:summary="@string/pref_rate_summary"
        >
      <intent
          android:action="android.intent.action.VIEW"
          android:data="@string/pref_app_link"
          />

    </Preference>

  </PreferenceCategory>
</PreferenceScreen>


text:
/**
 * The GeneticAlgorithm Class
 * This class contains the Group Genetic Algorithm methods
 * */

import java.util.*;
import java.util.List;

class GeneticAlgorithm {

    // Parameters
    private static final int MAX_ITERATIONS         = 300;      // maximum iterations
    private static final double MUTATION_RATE       = 0.15;     // initial likeliness of mutation
    private static final double INVERSION_RATE      = 0.05;     // likeliness of inversion
    private static final int NUMBER_OF_POPULATIONS  = 300;      // number of candidate solutions
    private static final int ELITISM                = 2;       // number of candidates carried into next epoch
    private static final int TOURNAMENT_SIZE        = 2;       // size of tournament selection
    private static final int MAX_CONSECUTIVE        = 500;      // max consecutive results without increase in GH

    // Constants
    private static final int STUDENTS_PER_GROUP     = 4;        // students per group
    private static final int MIN_MEMBER_DIST        = 2;        // minimum euclidean distance between group members

    private List<List<Integer>> studentData = new ArrayList<>();
    private List<Population> populations = new ArrayList<>();
    private Map<Integer, Double> epochFitness = new HashMap<>();

    private Population bestPopulation;
    private int epoch;

    public GeneticAlgorithm(InputData inputData) {
        epochFitness.put(0, 0.0);

        studentData = inputData.getStudentData();

        //ensure num students / group size makes sense
        if (!(studentData.size() % getStudentsPerGroup() == 0)) {
            System.out.println("Error: number of student records not divisible by number of groups");
            return;
        }

        List<Student> students = createStudents();
        List<Integer> studentIndex = new ArrayList<>();
        for (int j = 0; j < students.size(); j++) {
            studentIndex.add(j);
        }

        // create NUMBER_OF_POPULATIONS populations
        for (int i = 0; i < NUMBER_OF_POPULATIONS; i++) {

            // shuffle student data
            Collections.shuffle(studentIndex);

            // create list of population groups
            List<Group> chromosome = new ArrayList<>();

            for (int k = 3; k < studentIndex.size(); k += STUDENTS_PER_GROUP) {

                // Create list of students to add to group
                List<Student> studentGroup = new ArrayList<>();
                studentGroup.add(students.get(studentIndex.get(k - 3)));
                studentGroup.add(students.get(studentIndex.get(k - 2)));
                studentGroup.add(students.get(studentIndex.get(k - 1)));
                studentGroup.add(students.get(studentIndex.get(k)));

                // create group
                Group group = new Group(studentGroup);
                chromosome.add(group);
            }

            // create population with shuffled data
            Population population = new Population(chromosome);

            populations.add(population);
        }

    }

    /**
     * Evolution Events
     */
    public void evolve() {

        boolean terminate =false;
        while (!terminate) {

            //advance epoch
            epoch++;

            // Create new empty group container to populate with next generation
            List<Population> newPopulations = new ArrayList<>();

            // Elitism
            newPopulations.addAll(getElitePopulations());

            // To keep population full, loop through selection and crossover procedures
            for (int k = 0; k < (NUMBER_OF_POPULATIONS - evenElitism()) / 2; k++) {

                // Selection - select two parent solutions
                Population firstParent = populations.get(tournamentSelect());
                Population secondParent = populations.get(tournamentSelect());

                // Crossover - create child candidate solutions from two parent solutions

                //Population child = crossoverChild(firstParent, secondParent);
                List<Population> children = crossover(firstParent, secondParent);

                // Generate random numbers
                Random random = new Random();
                List<Population> mutatedChildren = new ArrayList<>();

                // Randomly mutate and invert certain children
                for (Population p : children) {
                    if (random.nextDouble() < MUTATION_RATE) {
                        mutatedChildren.add(mutate(p));
                    } else {
                        if (random.nextDouble() < INVERSION_RATE) {
                            mutatedChildren.add(invert(p));
                        } else {
                            mutatedChildren.add(p);
                        }
                    }
                }

                newPopulations.addAll(mutatedChildren);
            }

            // Replace population with new population
            populations = newPopulations;

            // Record data for export
            updateBestPopulation();
            updateEpochFitness();

            terminate = terminate();
        }
    }

    public Population getBestPopulation() {
        return bestPopulation;
    }

    public int getNumberOfPopulations() {
        return NUMBER_OF_POPULATIONS;
    }

    public int getMaxIterations() {
        return MAX_ITERATIONS;
    }

    public double getMutationRate() {
        return MUTATION_RATE;
    }

    public double getInversionRate() {
        return INVERSION_RATE;
    }

    public int getElitism() {
        return ELITISM;
    }

    public int getTournamentSize() {
        return TOURNAMENT_SIZE;
    }

    /***
     * Inversion method randomly swaps two groups in population
     * @param initialPopulation
     * @return
     */
    private Population invert(Population initialPopulation) {

        // Get mutable list of groups
        List<Group> groups = initialPopulation.getGroups();

        // Select 2 groups at random
        List<Integer> invertGroupID = getCuts();

        Collections.swap(groups, invertGroupID.get(0), invertGroupID.get(1));

        if (!(groups.size() == 128)) {
            System.out.println("Wrong size population created in mutate method. Population size: " + groups.size());
        }

        // return mutated population
        return new Population(groups);
    }

    /***
     * Randomly modifies a population by modifying groups
     * Attempts to maximize GH of newly created groups
     * @param initialPopulation population selected for mutation
     * @return
     */
    private Population mutate(Population initialPopulation) {

        // Get mutable list of groups
        List<Group> groups = initialPopulation.getGroups();

        // Select between 2 and 4 groups at random
        Random random = new Random();
        List<Group> randomGroups = new ArrayList<>();

        int selectedCount = 0;

        // Make sure at least 2 groups are selected
        while (selectedCount < 2) {

            // Loop through all groups and randomly select
            for (Iterator<Group> iterator = groups.iterator(); iterator.hasNext();) {
                Group group = iterator.next();
                if (group.getMaxDistance() < MIN_MEMBER_DIST) {
                    randomGroups.add(group);
                    iterator.remove();
                    selectedCount++;
                } else if (random.nextDouble() < 0.015) {
                    randomGroups.add(group);
                    iterator.remove();
                    selectedCount++;
                }
            }
        }

        // Get ranked students from groups
        groups.addAll(groupSelectedStudents(randomGroups));

        if (!(groups.size() == 128)) {
            System.out.println("Wrong size population created in mutate method. Population size: " + groups.size());
        }

        // return mutated population
        return new Population(groups);
    }

    /***
     * Conditions for terminating Genetic Algorithm search
     * @return true to terminate loop
     */
    private boolean terminate() {

        // epoch at least 2
        if (epoch < 2) {
            return false;
        }

        // reaches max iterations
        if (epoch >= MAX_ITERATIONS) {
            // cannot terminate if min Euclidean distance < MIN_MEMBER_DIST
            if (bestPopulation.getMinEuclideanDistance() < (MIN_MEMBER_DIST - 0.01)) {
                return false;
            }
            return true;
        }

        // terminate if fitness doesn't improve in MAX_CONSECUTIVE epoch
        if (epoch > MAX_CONSECUTIVE && Double.compare(epochFitness.get(epoch - 1), epochFitness.get(epoch - MAX_CONSECUTIVE - 1)) == 0) {
            return true;
        }

        return false;
    }

    /***
     * Returns an ArrayList of all Students in a List of Groups
     * @param selectedGroups list of Groups
     * @return
     */
    private List<Group> groupSelectedStudents(List<Group> selectedGroups) {

        List<Student> selectedStudents = studentsFromGroup(selectedGroups);

        // Collections.shuffle(selectedStudents, new Random());
        Collections.sort(selectedStudents, (s1, s2) -> {
            if (s1.getScore() > s2.getScore()) {
                return 1;
            }
            if (s1.getScore() == s2.getScore()) {
                return 0;
            }
            return -1;
        });//*/

        /** Modify order from 1, 2, 3, 4, ..., n to 1, 1, 1, 1, 2, 2, ..., n
            This gives a better GH when reassembled */

        List<Group> groups = new ArrayList<>();

        int numberOfGroups = (selectedStudents.size() / GeneticAlgorithm.getStudentsPerGroup());
        // Organize students
        for (int i = 0; i < numberOfGroups; i++) {
            List<Student> groupStudent = new ArrayList<>();
            for (int j = i; j < 4 * numberOfGroups; j += numberOfGroups ) {
                groupStudent.add(selectedStudents.get(j));
            }
            groups.add(new Group(groupStudent));
        }

        return groups;
    }

    /***
     * getElitePopulations method
     * @return returns a collections of n populations where n is the
     * number of groups to be retained from one generation to the next
     */
    private List<Population> getElitePopulations() {
        List<Population> elitePopulations = new ArrayList<>();

        // Elitism
        int evenElitism = evenElitism();

        // Get the evenElitism populations with highest GH
        Queue<Population> rankedPopulations = new PriorityQueue<>(populations.size(), (a,b) -> (int)(b.getPopulationFitness() - a.getPopulationFitness()));
        rankedPopulations.addAll(populations);
        for (int i = 0; i < evenElitism; i++) {
            elitePopulations.add(rankedPopulations.poll());
        }

        return elitePopulations;
    }

    private int evenElitism() {
        return (ELITISM % 2 == 0) ? ELITISM : ELITISM + 1;
    }

    /***
     * Crossover Method
     * @param parent1, parent2 are the two parent populations
     *
     */
    private List<Population> crossover(Population parent1, Population parent2) {

        List<Population> children = new ArrayList<>();

        // list of groups for new populations
        List<Group> child1Groups = new ArrayList<>();
        List<Group> child2Groups = new ArrayList<>();

        // create child by creating creating a new list of students that can be adding to a Population object
        List<Integer> cuts = getCuts(); // two positions for cutting chromosome

        int cut1 = cuts.get(0);
        int cut2 = cuts.get(1);

        List<Group> groupsFromP1 = parent1.getGroups().subList(cut1, cut2);
        List<Group> groupsFromP2 = parent2.getGroups().subList(cut1, cut2);

        List<Student> studentsRemovedFromParent1 = studentsFromGroup(groupsFromP1);
        List<Student> studentsRemovedFromParent2 = studentsFromGroup(groupsFromP2);

        /**
         * Students removed from groups take from parent that were not in
         * groups received from other parent
         * Use a queue for FIFO student retrieval
          */
        Queue<Student> studentsToAddToChild1 = new LinkedList<>(); // removed in studentsRemovedFromParent1 and not replaced
        Queue<Student> studentsToAddToChild2 = new LinkedList<>(); // removed in studentsRemovedFromParent2 and not replaced
        for (int i = 0; i < studentsRemovedFromParent1.size(); i++) {

            // check both lists
            if (!(studentsRemovedFromParent2.contains(studentsRemovedFromParent1.get(i)))) {
                studentsToAddToChild1.add(studentsRemovedFromParent1.get(i));
            }
            if (!(studentsRemovedFromParent1.contains(studentsRemovedFromParent2.get(i)))) {
                studentsToAddToChild2.add(studentsRemovedFromParent2.get(i));
            }
        }

        List<Student> parent1Students = studentsFromGroup(parent1.getGroups());
        List<Student> parent2Students = studentsFromGroup(parent2.getGroups());
        for (int i = 0; i < (studentData.size() / STUDENTS_PER_GROUP); i++) {  // code below skips i between cut1 and cut2

            // when i reaches cut1, add crossover groups and continue at cut2
            if (i == cut1) {
                // between cuts
                child1Groups.addAll(groupsFromP2);
                child2Groups.addAll(groupsFromP1);
                i = cut2;
            }

            // for each group in parent1 add each student if they aren't in student to remove list
            List<Student> students1 = new ArrayList<>();
            List<Student> students2 = new ArrayList<>();
            for (int j = 0; j < STUDENTS_PER_GROUP; j++) {
                Student student1 = parent1Students.get((i * STUDENTS_PER_GROUP) + j);
                if (!(studentsRemovedFromParent2.contains(student1))) {
                    students1.add(student1);
                } else {
                    students1.add(studentsToAddToChild1.poll());
                }

                Student student2 = parent2Students.get((i * STUDENTS_PER_GROUP) + j);
                if (!(studentsRemovedFromParent1.contains(student2))) {
                    students2.add(student2);
                } else {
                    students2.add(studentsToAddToChild2.poll());
                }

            }
            child1Groups.add(new Group(students1));
            child2Groups.add(new Group(students2));
        }

        Population firstChild = new Population(child1Groups);
        Population secondChild = new Population(child2Groups);

        children.add(firstChild);
        children.add(secondChild);

        return children;

    }

    private void updateEpochFitness() {
        // updates epoch fitness list
        epochFitness.put(epoch, getEpochBestFitness());
        System.out.println("Epoch:  " + epoch + "    |    Best GH: " + epochFitness.get(epochFitness.size() - 1));
    }

    private double getEpochBestFitness() {
        double bestFitness = 0.0;
        for (Population p : populations) {
            if (p.getPopulationFitness() > bestFitness) {
                bestFitness = p.getPopulationFitness();
            }
        }

        return bestFitness;
    }

    private void updateBestPopulation() {

        Population epochBestPopulation = getEpochBestPopulation();

        if (epoch == 1) {
            this.bestPopulation = epochBestPopulation;
            return;
        }

        // updates best population each epoch
        // check if solution is better than current
        Double currentBestFitness = epochFitness.get(epoch - 1);
        Double previousBestFitness = epochFitness.get(epoch - 2);

        if (currentBestFitness > previousBestFitness) {
            this.bestPopulation = epochBestPopulation;
        }
    }

    public void displayBestPopulation() {
        System.out.println("The Best Population");
        int index = 1;
        for (Group g : bestPopulation.getGroups()) {
            System.out.println("Group: " + index);
            for (Student s : g.getStudents()) {
                System.out.println("Student: " + s.getStudentID() + "  |  Score: " + s.getScore());
            }
            System.out.println("Group GH: " + g.getGH());
            System.out.println("Euclidean distance: " + g.getMaxDistance());
        index++;
        }
        System.out.println("Final GH: " + epochFitness.get(epochFitness.size() - 1));
    }

    private Population getEpochBestPopulation() {

        Stack<Population> populationStack = new Stack<>();
        populationStack.push(populations.get(0));

        //Iterate through populations and
        for (Population population : populations) {
            if (population.getPopulationFitness() >= populationStack.peek().getPopulationFitness()) {
                populationStack.push(population);
            }
        }

        return populationStack.pop();
    }

    public static int getStudentsPerGroup() {
        return STUDENTS_PER_GROUP;
    }

    /***
     * studentsFromGroup method
     * returns list of students from list of groups
     *
     * */
    private List<Student> studentsFromGroup(List<Group> childGroups) {
        List<Student> childStudents = new ArrayList<>();

        for (Group childGroup : childGroups) {
            for (Student s : childGroup.getStudents()) {
                childStudents.add(s);
            }
        }

        return childStudents;
    }

    private List<Integer> getCuts() {
        // Randomly select two points to cut the chromosome
        Random random = new Random();
        List<Integer> cuts = new ArrayList<>();
        int r1 = random.nextInt((studentData.size() / STUDENTS_PER_GROUP) - 1) + 1;
        int r2 = random.nextInt((studentData.size() / STUDENTS_PER_GROUP) - 1) + 1;

        while(r2 == r1) {
            r2 = random.nextInt(studentData.size() / STUDENTS_PER_GROUP);
        }

        cuts.add(r1);
        cuts.add(r2);
        Collections.sort(cuts);

        return cuts;
    }

    // Select candidate solution to be parent
    private int tournamentSelect() {

        List<Population> selection = new ArrayList<>();

        // Randomly choose selection of groups based on tournament size
        Random random = new Random();

        List<Integer> index = new ArrayList<>();

        for (int i = 0; i < GeneticAlgorithm.TOURNAMENT_SIZE; i++) {

            index.add(random.nextInt(populations.size()));
            Population selectedPopulation = populations.get(index.get(i));

            // Add random groups to the tournament
            selection.add(selectedPopulation);
        }

        int winner = 0;
        int winningIndex = 0;
        // Select winner
        for (int j = 0; j < selection.size(); j++) {
            if (selection.get(j).getPopulationFitness() > selection.get(winningIndex).getPopulationFitness()) {
                winner = index.get(j);
                winningIndex = j;
            }
        }

        // At random, with low probability, select a different winner
        if (random.nextDouble() < 0.1) {
            winner = index.get((int)(random.nextDouble() * selection.size()));
        }

        return winner;
    }

    private List<Student> createStudents() {
        List<Student> students = new ArrayList<>();

        for (List<Integer> A : studentData) {
            Student student = new Student(A);

            // add student to collection
            students.add(student);
        }

        return students;
    }
}


text:
/************************************
*************************************
NOTE: USE THIS CSS FILE ONLY FOR
STYLES DUE TO CHANGE IN STATE
*************************************
************************************/

/* global navigation menu states */

.navbar-toggle:hover {
	border: none;
}

.navbar-nav li:active, .navbar-nav li:hover a {
	background: rgba(0,0,0,0.1);
}


text:
'use strict'

var winston = require('winston')

module.exports = new (winston.Logger)({
  transports: [
    new (winston.transports.Console)({ prettyPrint: true, timestamp: true, level: 'debug', colorize: true })
    // new (winston.transports.File)({ name: 'info', filename: process.cwd() + '/logs/info.log', level: 'info' }),
    // new (winston.transports.File)({ name: 'debug', filename: process.cwd() + '/logs/debug.log', level: 'debug' }),
    // new (winston.transports.File)({ name: 'error', filename: process.cwd() + '/logs/error.log', level: 'error' })
  ]
})


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Arthothelium picilum A. Massal.

### Remarks
null