text:
package com.beenoisy.utils.string;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.lang.reflect.Array;
import java.nio.channels.FileChannel;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;

/**
 * utils for string

 * 2014年10月24日:下午2:50:19
 *
 * @author Keen | jacks808@163.com

 */
public class StringUtils {
    public static float checkToDefaultValue(final Float n) {
        return checkToDefaultValue(n, 0f);
    }

    public static int[] checkToDefaultValue(final int[] arrays) {
        return arrays == null ? EMPTY_INT_ARRAY : arrays;
    }

    public static int checkToDefaultValue(final Integer n) {
        return checkToDefaultValue(n, 0);
    }

    public static String checkToDefaultValue(final String n) {
        return checkToDefaultValue(n, "");
    }

    @SuppressWarnings("unchecked")
    public static <T extends Collection<?>> T checkToDefaultValue(T collection) {
        if (collection == null) {
            collection = (T) Collections.emptyList();
        }
        return collection;
    }

    @SuppressWarnings("unchecked")
    public static <T extends List<?>> T checkToDefaultValue(T collection) {
        if (collection == null) {
            collection = (T) Collections.emptyList();
        }
        return collection;
    }

    @SuppressWarnings("unchecked")
    public static <T extends Set<?>> T checkToDefaultValue(T collection) {
        if (collection == null) {
            collection = (T) Collections.emptySet();
        }
        return collection;
    }

    @SuppressWarnings("unchecked")
    public static <T extends Map<?, ?>> T checkToDefaultValue(T collection) {
        if (collection == null) {
            collection = (T) Collections.emptyMap();
        }
        return collection;
    }

    /**
     * 检测参数,若参数为null,则返回默认值
     *
     * @param n
     * @param defaultValue
     *            指定的默认值
     * @return
     */
    public static <T> T checkToDefaultValue(final T n, final T defaultValue) {
        return n == null ? defaultValue : n;
    }

    public static boolean copyFile(final File src, final File target) {
        try {
            final FileInputStream fin = new FileInputStream(src);
            final FileOutputStream fout = new FileOutputStream(target);
            final FileChannel in = fin.getChannel(), out = fout.getChannel();
            out.transferFrom(in, 0, src.length());
            in.close();
            out.close();
            fin.close();
            fout.close();
            return true;
        } catch (final Exception e) {
            e.printStackTrace();
            return false;
        }
    }

    public static String getExtention(final String fileName) {
        final int pos = fileName.lastIndexOf(".");
        return fileName.substring(pos).toLowerCase();
    }

    public static String getPasswordString(final int length) {
        if (length > 0) {
            final char[] result = new char[length];
            int index = 0, rand = RANDOM.nextInt();
            for (int i = 0; i < length % 5; i++) {
                result[index++] = ch[(byte) rand & 63];
                rand >>= 6;
            }
            for (int i = length / 5; i > 0; i--) {
                rand = RANDOM.nextInt();
                for (int j = 0; j < 5; j++) {
                    result[index++] = ch[(byte) rand & 63];
                    rand >>= 6;
                }
            }
            return new String(result, 0, length);
        } else if (length == 0) {
            return "";
        } else {
            throw new IllegalArgumentException();
        }
    }

    /**
     * 用Joiner吧.
     *
     * @param <T>
     * @param o
     * @return
     */
    public static <T> String join(final Collection<T> o) {
        if (o != null) {
            final StringBuilder sb = new StringBuilder();
            boolean s = false;
            for (final T i : o) {
                if (s) {
                    sb.append(",");
                } else {
                    s = true;
                }
                sb.append(i);
            }
            return sb.toString();
        } else {
            return "";
        }
    }

    /**
     * 将一个数组转换为字符串连接
     *
     * @param array
     *            必须是数组
     * @return
     */
    public static String join(Object array) {
        if (array != null) {
            if (array instanceof Collection) {
                array = ((Collection<?>) array).toArray();
            }

            final StringBuilder sb = new StringBuilder();
            final int len = Array.getLength(array);
            for (int index = 0; index < len; index++) {
                if (index != 0) {
                    sb.append(",");
                }
                sb.append(Array.get(array, index));
            }
            return sb.toString();
        } else {
            return "";
        }
    }

    public static boolean maskTaskByBit(final long source, final int bit) {
        final long mask = 1 << (bit - 1);
        return maskTest(source, mask);
    }

    public static boolean maskTest(final int source, final int mask) {
        return (source & mask) == mask;
    }

    public static boolean maskTest(final long source, final long mask) {
        return (source & mask) == mask;
    }

    public static String md5(final byte b[]) {
        int i;
        final StringBuffer buf = new StringBuffer("");
        for (final byte element : b) {
            i = element;
            if (i < 0) {
                i += 256;
            }
            if (i < 16) {
                buf.append("0");
            }
            buf.append(Integer.toHexString(i));
        }
        return buf.toString();
    }

    public static String md5(final File file) {
        FileInputStream fin = null;
        try {
            fin = new FileInputStream(file);
            final byte[] b = new byte[8192];
            int length = -1;
            final MessageDigest md = MessageDigest.getInstance("MD5");
            while ((length = fin.read(b)) != -1) {
                md.update(b, 0, length);
            }
            return md5(md.digest());
        } catch (final Exception e) {
            e.printStackTrace();
        } finally {
            if (fin != null) {
                try {
                    fin.close();
                } catch (final IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return null;
    }

    public static String md5(final Object... objects) {
        return md5(Arrays.toString(objects));
    }

    public static String md5(final String plainText) {
        if (plainText != null) {
            try {
                final MessageDigest md = MessageDigest.getInstance("MD5");
                md.update(plainText.getBytes());
                final byte b[] = md.digest();
                return md5(b);
            } catch (final NoSuchAlgorithmException e) {
                e.printStackTrace();
            }
        }
        return null;
    }

    private static int rand(final int lo, final int hi) {
        final int n = hi - lo + 1;
        int i = RANDOM.nextInt() % n;
        if (i < 0) {
            i = -i;
        }
        return lo + i;
    }

    public static String randomstring(final int lo, final int hi) {
        final int len = rand(lo, hi);
        final byte b[] = new byte[len];
        for (int i = 0; i < len; i++) {
            int mux = RANDOM.nextInt() % 3;
            if (mux < 0) {
                mux = -mux;
            }
            switch (mux) {
            case 0:
                b[i] = (byte) rand('a', 'z');
                break;
            case 1:
                b[i] = (byte) rand('A', 'Z');
                break;
            case 2:
                b[i] = (byte) rand('0', '9');
                break;
            }
        }
        return new String(b, 0, len);
    }

    public static String randomString(final int len) {
        return randomstring(len, len);
    }

    public static int[] splitToInt(final String string, final String delimiter) {
        final String[] source = string.split(delimiter);
        if (source != null) {
            final int length = source.length;
            final int[] result = new int[length];
            for (int i = 0; i < length; i++) {
                result[i] = Integer.valueOf(source[i]);
            }
            return result;
        }
        return null;
    }

    /**
     * @param string
     * @param delimiter
     * @return
     */
    public static Integer[] splitToInteger(final String string, final String delimiter) {
        final String[] source = string.split(delimiter);
        if (source != null) {
            final int length = source.length;
            final Integer[] result = new Integer[length];
            for (int i = 0; i < length; i++) {
                result[i] = Integer.valueOf(source[i]);
            }
            return result;
        }
        return null;
    }

    public static String str2unicode(final String s) {
        final StringBuilder uStr = new StringBuilder("");
        if (s == null) {
            return "";
        }
        final int size = s.length();
        for (int i = 0; i < size; i++) {
            final int iValue = s.codePointAt(i);
            if (iValue < 16) {
                uStr.append("\\u000").append(Integer.toHexString(iValue));
            } else if (iValue < 256) {
                uStr.append("\\u00").append(Integer.toHexString(iValue));
            } else if (iValue < 4096) {
                uStr.append("\\u0").append(Integer.toHexString(iValue));
            } else {
                uStr.append("\\u").append(Integer.toHexString(iValue));
            }
        }
        return uStr.toString();
    }

    public static int strlen(String s) {
        if (s == null) {
            return 0;
        }
        int len = 0;
        s = s.trim();
        for (int i = 0; i < s.length(); i++) {
            if (s.codePointAt(i) > 255) {
                len += 2;
            } else {
                ++len;
            }
        }
        return len;
    }

    public static int strlen2(String s) {
        if (s == null) {
            return 0;
        }
        int len = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.codePointAt(i) > 255) {
                len += 2;
            } else {
                ++len;
            }
        }
        return len;
    }

    public static final Random RANDOM = new Random(System.currentTimeMillis());

    private static char ch[] = {//
    '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',//
                    'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',//
                    'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',//
                    'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',//
                    'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',//
                    '0', '1' };

    private static final int[] EMPTY_INT_ARRAY = new int[] {};
}


text:
<!DOCTYPE html>

	<meta charset="utf-8">

	<title>JMSGChatRoomEvent Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">

				JMessage-iOS-SDK

				HXHG

Index

Hierarchy

							On This Page

							<select id="jump-to">
	<option value="top">Jump To…</option>

	<option value="tasks">Tasks</option>

	<optgroup label="Properties">

		<option value="//api/name/chatRoom">chatRoom</option>

		<option value="//api/name/fromUser">fromUser</option>

		<option value="//api/name/targetList">targetList</option>

	</optgroup>

</select>

JMSGChatRoomEvent Class Reference

	Inherits from
	JMSGNotificationEvent : NSObject

	Declared in
	JMSGNotificationEvent.h

  chatRoom

聊天室

@property (nonatomic, strong, readonly) JMSGChatRoom *chatRoom

Declared In

JMSGNotificationEvent.h

  fromUser

事件操作者

@property (nonatomic, strong, readonly) JMSGUser *fromUser

Declared In

JMSGNotificationEvent.h

  targetList

事件作用的用户列表

@property (nonatomic, strong, readonly) NSArray<__kindofJMSGUser*> *targetList

Declared In

JMSGNotificationEvent.h

Copyright © 2019 HXHG. All rights reserved. Updated: 2019-05-06

Generated by appledoc 2.2.1 (build 1334).

redpajama_set_name: RedPajamaGithub


text:
var operater = module.exports;
var mysqlClient = require('../routes/mysql/mysqlclient').init();

operater.getRecordList = function(uid,type,cb){
    var sql = "select * from pay_record_table where uid=? and type=?";
    mysqlClient.query(sql, [uid,type], function (err,res) {
        cb(err,res);
    });
};

operater.getRecord = function(uid,cb){
    var sql = "select * from pay_record_table where uid=?";
    mysqlClient.query(sql, [uid], function (err,res) {
        cb(err,res);
    });
};

operater.checkRecord = function(uid,type,value,cb){
    var sql = "select * from pay_record_table where uid=? and type=? and value=?";
    mysqlClient.query(sql, [uid,type,value], function (err,res) {
        cb(err,res);
    });
};

operater.addRecord = function(uid,type,value,flower,cb){
    sql = "insert pay_record_table (uid,type,value,flower) value(?,?,?,?)";
    console.log(sql);
    mysqlClient.insert(sql, [uid,type,value,flower], function (err) {
        if (cb) {
            cb.call(err);
        }
    });
};


text:
import hunting.server as server

server.start_server(8888)


text:
package edu.gslis.docaccumulators;

import java.util.Iterator;
import java.util.Set;

import edu.gslis.eval.Qrels;
import edu.gslis.indexes.IndexWrapper;
import edu.gslis.queries.GQuery;
import edu.gslis.searchhits.SearchHit;
import edu.gslis.searchhits.SearchHits;

public class OracleDocAccumulator {

	public static SearchHits getAllRelDocs(GQuery query, IndexWrapper index, Qrels qrels) {
		SearchHits relDocs = new SearchHits();
		Set<String> docnos = qrels.getRelDocs(query.getTitle());
		if(docnos == null || docnos.size() == 0)
			return relDocs;
		Iterator<String> docIt = docnos.iterator();
		while(docIt.hasNext()) {
			String docno = docIt.next();
			int docId = index.getDocId(docno);
			if(docId < 1)
				continue;
			double score = Double.NEGATIVE_INFINITY;
			SearchHit doc = new SearchHit();
			doc.setDocID(docId);
			doc.setDocno(docno);
			doc.setScore(score);
			relDocs.add(doc);
		}
		return relDocs;
	}
}


text:
import path

class Graph(object):
    """Graph is a graph object operating on Dictionary object."""
    def __init__(self, dictionary):
        """Graph maintains three internal data structures.

        1) visited with words already visited.
        2) _dictionary: instance of Dictionary object
        3) word_to_path: dictionary (in Python sense) where each word is
        a key and maitains chain of Path objects to the first word.

        """
        self._visited = set([])
        self._dictionary = dictionary
        self.word_to_path = {}
        self.q = []

    @property
    def visited(self):
        return self._visited

    def bfs(self, start_word, stop_word):
        """Implementation of Binary Search Tree.

        :param start_word: Starting word
        :param stop_word: Stopping word
        :returns path between start and stop words, None if not found.
        :rtype: list or None

        """
        self.q = []
        self._visited.clear()
        self.word_to_path = {}

        self.q.append(start_word)
        self._visited.add(start_word)
        node = path.Path(start_word, None)
        self.word_to_path[start_word] = node

        while self.q:
            layer_size = len(self.q)
            while layer_size:
                word = self.q.pop(0)
                layer_size -= 1

                node = self.word_to_path[word]
                if word == stop_word:
                    return node.get_path()

                words_distance_awa = self._dictionary.get_corresponding_words(
                    word)

                words_distance_awa = words_distance_awa - self._visited
                self._visited.update(words_distance_awa)

                for word in words_distance_awa:
                    self.word_to_path[word] = path.Path(word, node)

                self.q.extend(list(words_distance_awa))

        return None


text:
Più Bella
=========

M1 Webdev project to use Nantes Open Data on trash disposal.
Goal is to have a running app by 04/12/2013.

App is live at https://piu-bella.appspot.com/

Doc is live at http://atalm2.github.io/piu-bella/

Maven 3 is required and should be usable directly:

    mvn verify
to check that everything is fine after a `git clone` or `git pull`.

    mvn appengine:devserver
to make the app accessible on `http://localhost:8080/`

    mvn appengine:update
to upload the app to https://piu-bella.appspot/com/

Any IDE should be fine to open this project and contribute: Netbeans, Eclipse and IntelliJ all have maven support at this point.


text:
(function ($){

	$.fn.mcDropdown = function(list, options) {
		// track the dropdown object
		var dd;

		// create a dropdown for each match
		this.each(function() {
			dd = $.data(this, "mcDropdown");

			// we're already a dropdown, return a reference to myself
			if( dd ) return false;

			new $.mcDropDownMenu(this, list, options);
		});

		// return either the dropdown object or the jQuery object reference
		return dd || this;
	};

	// set default options
	$.mcDropdown = {
		version: "1.2.10",
		setDefaults: function(options){
			$.extend(defaults, options);
		}
	};

	// set the defaults
	var defaults = {
		  minRows: 8                   // specify the minimum rows before creating a new column
		, maxRows: 25                  // specify the maximum rows in a column
		, targetColumnSize: 2          // specify the default target column size (it'll attempt to create this many columns by default, unless the min/max row rules are not being met)
		, openFx: "slideDown"          // the fx to use for showing the root menu
		, openSpeed: 250               // the speed of the openFx
		, closeFx: "slideUp"           // the fx to use for hiding the root menu
		, closeSpeed: 250              // the speed of the closeFx
		, hoverOverDelay: 200          // the delay before opening a submenu
		, hoverOutDelay: 0             // the delay before closing a submenu
		, showFx: "show"               // the fx to use when showing a submenu
		, showSpeed: 0                 // the speed of the showFx
		, hideFx: "hide"               // the fx to use when closing a submenu
		, hideSpeed: 0                 // the speed of the hideFx
		, dropShadow: true             // determine whether drop shadows should be shown on the submenus
		, autoHeight: true             // always uses the lineHeight options (much faster than calculating height)
		, lineHeight: 19               // the base height of each list item (li) this is normally calculated automatically, but in some cases the value can't be determined and you'll need to set it manually
		, screenPadding: 10            // the padding to use around the border of the screen -- this is used to make sure items stay on the screen
		, allowParentSelect: false     // determines if parent items are allowed to be selected (by default only end nodes can be selected)
		, delim: ":"                   // the delimited to use when showing the display string
		, showACOnEmptyFocus: false    // show the autocomplete box on focus when input is empty
		, valueAttr: "rel"             // the attribute that contains the value to use in the hidden field
		, click: null                  // callback that occurs when the user clicks on a menu item
		, select: null                 // callback that occurs when a value is selected
		, init: null                   // callback that occurs when the control is fully initialized
	};

	// check to see if the browser is IE6
	var isIE6 = ($.browser.version && $.browser.version <= 6);

	$.mcDropDownMenu = function(el, list, options){
		var $self, thismenu = this, $list, $divInput, settings, typedText = "", matchesCache, oldCache, $keylist, $keylistiframe, bInput, bDisabled = false;

		// create a reference to the dropdown
		$self = $(el);

		// is the field and input element
		bInput = $self.is(":input");

		// get the settings for this instance
		settings = $.extend({}, defaults, options);

		// set the default click behavior
		if( settings.click == null ) settings.click = function (e, dropdown, settings){ dropdown.setValue(this.attr(settings.valueAttr)); }

		// attach window behaviors
		$(document)
			// Bind a click event to hide all visible menus when the document is clicked
			.bind("click", function(e){
				// get the target that was clicked
				var $target = $(e.target);
				var $ul = $target.parents().filter(function (){ return this === $list[0] || (!!$keylist && $keylist[0] === this); });
				// check to make sure the clicked element was inside the list
				if( $ul.length ){
					var bIsParent = $target.is(".mc_parent");

					// if we've clicked a parent item in the autocomplete box, we must adjust the current value
					if( bIsParent && $keylist && $ul[0] === $keylist[0] ){
						// prevent the blur code from running
						clearTimeout(iBlurTimeout);
						updateValue($target.find("> ul > li:first"), false);
						e.stopPropagation();
						return false;
					}
					// check to see if the user can click on parent items
					else if( !settings.allowParentSelect && bIsParent ) return false;

					// make sure to hide the parent branch if we're not the root
					if( $target.not(".mc_root") ) hideBranch.apply($target.parent().parent()[0], [e]);

					if( settings.click != null && settings.click.apply($target, [e, thismenu, settings]) == false ){
						return false;
					}
				}

				// close the menu
				thismenu.closeMenu();
			});

		// store a reference to the list, if it's not already a jQuery object make it one
		$list = (((typeof list == "object") && !!list.jquery)) ? list : $(list);

		// we need to calculate the visual width for each nested list
		$list
			// move list to body -- this allows us to always calculate the correct position & width of the elements
			.appendTo("body")
			// move the list way off screen
			.css({position: "absolute", top: -10000, left: -10000})
			// find all the ul tags
			.find("ul")
			// add the root ul tag to the array
			.andSelf()
			// make all the nodes visible
			.css("display", "block")
			// loop through each node
			.each(function (){
				var $el = $(this);
				// calculate the width of the element -- using clientWidth is 2x as fast as width()
				$el.data("width", $el[0].clientWidth);
			})
			// now that we've gotten the widths, hide all the lists and move them to x:0, y:0
			.css({top: 0, left: 0, display: "none"});

		// mark the root children items
		$list.find("> li").addClass("mc_root");
		// add parent class
		$("li > ul", $list).parent().addClass("mc_parent");

		// create the div to wrap everything in
		$divInput = $('
<input type="hidden" name="' + (el.name || el.id) + '" id="' + (el.id || el.name) + '" />
')
			.appendTo($('

'))
			.parent();

		// get a reference to the input element and remove it from the DOM
		var $input = $self.replaceWith($divInput).attr({id: "", name: ""});
		// get a reference to the hidden form field
		var $hidden = $divInput.find(":input");

		// put the input element back in the div.mcdropdown layer
		$divInput = $divInput.find(".mcdropdown").prepend($input);

		// make a visible copy of the element so we can get the correct sizes, then delete it
		var $divInputClone = $divInput.clone().css({position: "absolute", top: -9999999, left: -999999, visibility: "visible"}).show().appendTo("body");
		var di = {width: $divInputClone.width() - $("a", $divInputClone).width(), height: $divInputClone.outerHeight()}
		$divInputClone.remove();

		// store a reference to this link select
		$.data($hidden[0], "mcDropdown", thismenu);

		// update the height of the outer relative div, this allows us to
		// correctly anchor the dropdown
		$divInput.parent().height(di.height);

		// safari will not get the correct width until after everything has rendered
		if( $.browser.safari ){
			setTimeout(function (){
				$self
				.width($divInput.width() - $("a", $divInput).width());
			}, 100);
		}

		// adjust the width of the new input element
		$self
			.width(di.width)
			// make sure we only attach the next events if we're in input element
			.filter(":input")
			// turn autocomplete off
			.attr("autocomplete", "off")
			// add key stroke bindings (IE6 requires keydown)
			.bind("keypress", checkKeypress)
			// prevent user from selecting text
			.bind("mousedown", function (e){ $(this).triggerHandler("focus"); e.stopPropagation(); return false; })
			// disable context menu
			.bind("contextmenu", function (){ return false; })
			// select the text when the cursor is placed in the field
			.bind("focus", onFocus)
			// when the user leaves the text field
			.bind("blur", onBlur);

		// IE6 doesn't register certain keypress events, so we must catch them during the keydown event
		if( $.browser.msie || $.browser.safari) $self.bind("keydown", function (e){
			// check to see if a key was pressed that IE6 doesn't trigger a keypress event for
			if( ",8,9,37,38,39,40,".indexOf("," + e.keyCode + ",") > -1 ) return checkKeypress(e);
		});

		// attach a click event to the anchor
		$("a", $divInput).bind("click", function (e){
			// if disabled, skip processing
			if( bDisabled ) return false;
			thismenu.openMenu(e);
			return false;
		});

		// set the value of the field
		this.setValue = function (value, skipCallback){
			// update the hidden value
			$hidden.val(value);
			// get the display name
			var name = displayString(value);

			// run the select callback (some keyboard entry methods will manage this callback manually)
			if( settings.select != null && skipCallback != true ) settings.select.apply(thismenu, [value, name]);

			// update the display value and return the jQuery object
			return $self[bInput ? "val" : "text"](name);
		};

		// set the default value (but don't run callback)
		if( bInput ) this.setValue($self.attr("defaultValue"), true);

		// get the value of the field (returns array)
		this.getValue = function (value){
			return [$hidden.val(), $self[bInput ? "val" : "text"]()];
		};

		// open the menu programmatically
		this.openMenu = function (e){
			// if the menu is open, kill processing
			if( $list.is(":visible") ){
				// on a mouse click, close the menu, otherwise just cancel
				return (!!e) ? thismenu.closeMenu() : false;
			}

			function open(){
				// columnize the root list
				columnizeList($list).hide();
				// add the bindings to the menu
				addBindings($list);

				// anchor the menu relative parent
				anchorTo($divInput.parent(), $list, true);

				// remove existing hover classes, which might exist from keyboard entry
				$list.find(".mc_hover").removeClass("mc_hover");

				// show the menu
				$list[settings.openFx](settings.openSpeed, function (){
					// scroll the list into view
					scrollToView($list);
				});

				// if the bgIframe exists, use the plug-in
				if( isIE6 && !!$.fn.bgIframe ) $list.bgIframe();
			}

			// if this is triggered via an event, just open the menu
			if( e ) open();
			// otherwise we need to open the menu asynchronously to avoid collision with $(document).click event
			else setTimeout(open, 1);
		};

		// close the menu programmatically
		this.closeMenu = function (e){
			// hide any open menus
			$list.find("ul:visible").parent().each(function (){
				hideBranch.apply(this);
			});

			// remove the bindings
			removeBindings($list);

			// close the menu
			$list[settings.closeFx](settings.closeSpeed);
		};

		// place focus in the input box
		this.focus = function (){
			$self.focus();
		};

		// disable the element
		this.disable = function (status){
			// change the disabled status
			bDisabled = !!status;

			$divInput[bDisabled ? "addClass" : "removeClass"]("mcdropdownDisabled");
			$input.attr("disabled", bDisabled ? "disabled" : "");
		};

		function getNodeText($el){
			// return either an empty string or the node's value
			return $el.contents()[0] ? $.trim($el.contents()[0].nodeValue) : "";
		};

		function getTreePath($li){
			if( $li.length == 0 ) return [];

			var name = [getNodeText($li)];
			// loop through the parents and get the value
			$li.parents().each(function (){
				var $el = $(this);
				// break when we get to the main list element
				if( this === $list[0] ) return false;
				else if( $el.is("li") ) name.push(getNodeText($el));
			});

			// return the display name
			return name.reverse();
		};

		function displayValue(value){
			// return the path as an array
			return getTreePath(getListItem(value));
		};

		function displayString(value){
			// return the display name
			return displayValue(value).join(settings.delim);
		};

		function parseTree($selector){
			var s = [], level = (arguments.length > 1) ? ++arguments[1] : 1;

			// loop through all the children and store information about the tree
			$("> li", $selector).each(
				function (){
					// get a reference to the current object
					var $self = $(this);

					// look for a ul tag as a direct child
					var $ul = $("> ul", this);

					// push a reference to the element to the tree array
					s.push({
						// get the name of the node
						  name:     getNodeText($self)
						// store a reference to the current element
						, element:  this
						// parse and store any children items
						, children: ($ul.length) ? parseTree($ul, level) : []
					});

				}
			);

			return s;
		};

		function addBindings(el){
			removeBindings(el);
			$("> li", el)
				.bind("mouseover", hoverOver)
				.bind("mouseout", hoverOut);
		};

		function removeBindings(el){
			$("> li", el)
				.unbind("mouseover", hoverOver)
				.unbind("mouseout", hoverOut);
		};

		// scroll the current element into view
		function scrollToView($el){
			// get the current position
			var p = position($el, true);
			// get the screen dimensions
			var sd = getScreenDimensions();

			// if we're hidden off the bottom of the page, move up
			if( p.bottom > sd.y ){
				$("html,body").animate({"scrollTop": "+=" + ((p.bottom - sd.y) + settings.screenPadding) + "px" })
			}
		};

		function hoverOver(e){
			var self = this;
			var timer = $.data(self, "timer");

			// if the timer exists, clear it
			if( !isNaN(timer) ) clearTimeout(timer);

			// if IE6, add the hover class
			$(this).addClass("mc_hover");

			// show the branch
			$.data(self, "timer", setTimeout(function(){
					showBranch.apply(self);
				}, settings.hoverOverDelay)
			);
	  };

		function hoverOut(e){
			var self = this;
			var timer = $.data(self, "timer");

			// if the timer exists, clear it
			if( !isNaN(timer) ) clearTimeout(timer);

			// if IE6, remove the hover class
			$(this).removeClass("mc_hover");

			// hide the branch
			$.data(self, "timer", setTimeout(function(){
					var $li = $(self);
					setTimeout(function (){
						// if no children selected, we must close the parent menus
						if( $li.parent().find("> li.mc_hover").length == 0 ){
							$li.parents("li").each(function (){
								var self = this;
								clearTimeout($.data(self, "timer"));
								hideBranch.apply(self);
								// check to see if we've hovered over a parent item
								if( $(this).siblings().filter(".mc_hover").length > 0 ) return false;
							});
					}

					}, settings.hoverOverDelay);

					hideBranch.apply(self);
				}, settings.hoverOutDelay)
			);

			// this will stop flickering in IE6, but it leaves mc_hover classes behind
			if( isIE6 ) e.stopPropagation();
	  };

		function getShadow(depth){
			var shadows = $self.data("shadows");

			// if the shadows don't exist, create an object to track them
			if( !shadows )
				shadows = {};

			// if the shadow doesn't exist, create it
			if( !shadows[depth] ){
				// create shadow
				shadows[depth] = $('

').appendTo('body');
				// if the bgIframe exists, use the plug-in
				if( !!$.fn.bgIframe ) shadows[depth].bgIframe();
				// update the shadows cache
				$self.data("shadows", shadows);
			}

			return shadows[depth];
		};

		function showBranch(){
			var self = this;
			// the child menu
			var $ul = $("> ul", this);

			// if the menu is already visible or there is no submenu, cancel
			if( $ul.is(":visible") || ($ul.length == 0) ) return false;

			// hide any visible sibling menus
			$(this).parent().find('> li ul:visible').not($ul).parent().each(function(){
				hideBranch.apply(this);
			});

			// columnize the list
			columnizeList($ul);

			// add new bindings
			addBindings($ul);

			var depth = $ul.parents("ul").length;

			// get the screen dimensions
			var sd = getScreenDimensions();

			// get the coordinates for the menu item
			var li_coords = position($(this));

			// move the menu to the correct position and show the menu || ((depth)*2)
			$ul.css({top: li_coords.bottom, left: li_coords.marginLeft/*, zIndex: settings.baseZIndex + ((depth)*2)*/}).show();

			// get the bottom of the menu
			var menuBottom = $ul.outerHeight() + $ul.offset().top;

			// if we're hidden off the bottom of the page, move up
			if( menuBottom > sd.y ){
				// adjust the menu by subtracting the bottom edge by the screen offset
				$ul.css("top", li_coords.bottom - (menuBottom - sd.y) - settings.screenPadding);
			}

			var showShadow = function (){
				// if using drop shadows, then show them
				if( settings.dropShadow ){
					// get a reference to the current shadow
					var $shadow = getShadow(depth);
					// get the position of the parent element
					var pos = position($ul);

					// move the shadow to the correct visual & DOM position
					$shadow.css({
						  top: pos.top + pos.marginTop
						, left: pos.left + pos.marginLeft
						, width: pos.width
						, height: pos.height
						/*, zIndex: settings.baseZIndex + ((2*depth)-1)*/
					}).insertAfter($ul).show();

					// store a reference to the shadow so we can hide it
					$.data(self, "shadow", $shadow);
				}
			}

			// columnize the list and then show it using the defined effect
			// if the menu has a zero delay, just open it and then draw the
			// shadow, otherwise show the effect and the draw the shadow
			// after you're done.
			if( settings.showSpeed <= 0 ){
				showShadow();
			} else {
				$ul.hide()[settings.showFx](settings.showSpeed, showShadow);
			}
		};

		function hideBranch(){
			var $ul = $("> ul", this);
			// if the menu is already visible or there is no submenu, cancel
			if( $ul.is(":hidden") || ($ul.length == 0) ) return false;

			// if using drop shadows, then hide
			if( settings.dropShadow && $.data(this, "shadow") ) $.data(this, "shadow").hide();

			// if we're IE6, we need to set the visiblity to "hidden" so child
			// menus are correctly hidden and remove the .mc_hover class due to
			// the e.stopPropagation() call in the hoverOut() call
			if( isIE6 )
				$ul.css("visibility", "hidden").parent().removeClass("mc_hover");

			// hide the menu
			$ul.stop()[settings.hideFx](settings.hideSpeed);
		};

		function position($el, bUseOffset){
			var bHidden = false;
			// if the element is hidden we must make it visible to the DOM to get
			if ($el.is(":hidden")) {
				bHidden = !!$el.css("visibility", "hidden").show();
			}

			var pos = $.extend($el[bUseOffset === true ? "offset" : "position"](),{
				  width: $el.outerWidth()
				, height: $el.outerHeight()
				, marginLeft: parseInt($.curCSS($el[0], "marginLeft", true), 10) || 0
				, marginRight: parseInt($.curCSS($el[0], "marginRight", true), 10) || 0
				, marginTop: parseInt($.curCSS($el[0], "marginTop", true), 10) || 0
				, marginBottom: parseInt($.curCSS($el[0], "marginBottom", true), 10) || 0
			});

			if( pos.marginTop < 0 ) pos.top += pos.marginTop;
			if( pos.marginLeft < 0 ) pos.left += pos.marginLeft;

			pos["bottom"] = pos.top + pos.height;
			pos["right"] = pos.left + pos.width;

			// hide the element again
			if( bHidden ) $el.hide().css("visibility", "visible");

			return pos;
		};

		function anchorTo($anchor, $target, bUseOffset){
			var pos = position($anchor, bUseOffset);

			$target.css({
				  position: "absolute"
				, top: pos.bottom
				, left: pos.left
			});

			/*
			 * we need to return the top edge of the core drop down menu, because
			 * the top:0 starts at this point when repositioning items absolutely
			 * this means we have to offset everything by the offset of the top menu
			 */

			return pos.bottom;
		};

		function getScreenDimensions(){
			var d = {
				  scrollLeft: $(window).scrollLeft()
				, scrollTop:  $(window).scrollTop()
				, width:      $(window).width()     // changed from innerWidth
				, height:     $(window).height()    // changed from innerHeight
			};

			// calculate the correct x/y positions
			d.x = d.scrollLeft + d.width;
			d.y = d.scrollTop + d.height;

			return d;
		};

		function getPadding(el, name){
			var torl = name == 'height' ? 'Top'    : 'Left',  // top or left
			    borr = name == 'height' ? 'Bottom' : 'Right'; // bottom or right

			return (
				// we add "0" to each string to make sure parseInt() returns a number
			    parseInt("0"+$.curCSS(el, "border"+torl+"Width", true), 10)
				+ parseInt("0"+$.curCSS(el, "border"+borr+"Width", true), 10)
				+ parseInt("0"+$.curCSS(el, "padding"+torl, true), 10)
				+ parseInt("0"+$.curCSS(el, "padding"+borr, true), 10)
				+ parseInt("0"+$.curCSS(el, "margin"+torl, true), 10)
				+ parseInt("0"+$.curCSS(el, "margin"+borr, true), 10)
			);
		};

		function getListDimensions($el, cols){
			if( !$el.data("dimensions") ){
				// get the width of the dropdown menu
				var ddWidth = $divInput.outerWidth();
				// if showing the root item, then try to make sure the width of the menu is sized to the drop down menu
				var width = ( ($el === $list) && ($el.data("width") * cols < ddWidth) ) ? Math.floor(ddWidth/cols) : $el.data("width");

				$el.data("dimensions", {
					// get the original width of the list item
					column: width
					// subtract the padding from the first list item from the width to get the width of the items
					, item: width - getPadding($el.children().eq(0)[0], "width")
					// get the original height
					, height: $el.height()
				});
			}

			return $el.data("dimensions");
		};

		function getHeight($el){
			// skip height calculation and use lineHeight
			if( settings.autoHeight === false ) return settings.lineHeight;
			// if we haven't cached our height, do so now
			if( !$el.data("height") ) $el.data("height", $el.outerHeight());

			// return the cached value
			return $el.data("height");
		};

		function columnizeList($el){
			// get the children items
			var $children = $el.find("> li");
			// get the total number of items
			var items = $children.length;

			// calculate how many columns we think we should have based on the max rows
			var calculatedCols = Math.ceil(items/settings.maxRows);
			// get the number of columns, don't columnize if we don't have enough rows
			// if the height of the column is bigger than the screen, we automatically try
			// moving to a new column
			var cols = !!arguments[1] ? arguments[1] : ( items <= settings.minRows ) ? 1 : (calculatedCols > settings.targetColumnSize) ? calculatedCols : settings.targetColumnSize;
			// get the dimension of this element
			var widths = getListDimensions($el, cols);
			var prevColumn = 0;
			var columnHeight = 0;
			var maxColumnHeight = 0;
			var maxRows = Math.ceil(items/cols);

			// get the width of the parent item
			var parentLIWidth = $el.parent("li").width();

			// we need to draw the list element, but hide it so we can correctly calculate it's information
			$el.css({"visibility": "hidden", "display": "block"});

			// loop through each child item
			$children.each(function (i){
				var currentItem = i+1;
				var nextItemColumn = Math.floor((currentItem/items) * cols);
				// calculate the column we're in
				var column = Math.floor((i/items) * cols);
				// reference the current item
				var $li = $(this);
				// variable to track margin-top
				var marginTop;

				// if we're in the same column
				if( prevColumn != column ){
					// move to the top of the next column
					marginTop = (columnHeight+1) * -1;
					// reset column height
					columnHeight = 0;
				// if we're in a new column
				} else {
					marginTop = 0;
				}

				// increase the column height based on it's current height (calculate this before adding classes)
				columnHeight += (getHeight($li) || settings.lineHeight);

				// update the css settings
				$li.css({
		  		"marginLeft": (widths.column * column)
					, "marginTop": marginTop
					, "width": widths.item
		  	})
					[((nextItemColumn > column) || (currentItem == items)) ? "addClass" : "removeClass"]("mc_endcol")
					[(marginTop != 0) ? "addClass" : "removeClass"]("mc_firstrow")
					;
				// get the height of the longest column
				if( columnHeight > maxColumnHeight ) maxColumnHeight = columnHeight;

				// update the previous column
				prevColumn = column;
			});

			// if the menu is too tall to fit on the screen, try adding another column
			if( ($el !== $list) && (maxColumnHeight + (settings.screenPadding*2) >= getScreenDimensions().height) ){
				return columnizeList($el, cols+1);
			}

			/*
			 * set the height of the list to the max column height. this fixes
			 * display problems in FF when the last column is not full.
			 *
			 * we also need to set the visiblity to "visible" to make sure that
			 * the element will show up
			 */
			$el.css("visibility", "visible").height(maxColumnHeight);

			return $el;
		};

		function getListItem(value){
			return $list.find("li[" + settings.valueAttr + "='"+ value +"']");
		};

		function getCurrentListItem(){
			return getListItem($hidden.val());
		};

		function onFocus(e){
			var $current = getCurrentListItem();
			var value = $self.val().toLowerCase();
			var treePath = value.toLowerCase().split(settings.delim);
			var currentNode = treePath.pop();
			var lastDelim = value.lastIndexOf(settings.delim) + 1;

			// reset the typed text
			typedText = treePath.join(settings.delim) + (treePath.length > 0 ? settings.delim : "");

			// we need to set the selection asynchronously so that when user TABs to field the pre-select isn't overwritten
			setTimeout(function (){
				// preselect the last child node
				setSelection($self[0], lastDelim, lastDelim+currentNode.length);
			}, 0);

			// create the keyboard hint list
			if( !$keylist ){
				$keylist = $('

').appendTo("body");
				// if IE6 we need an iframe to hide the scrolling list
				if( isIE6 && !!$.fn.bgIframe ) $keylistiframe = $('

').bgIframe().appendTo("body");
			}

			// should we show matches?
			var hideResults = !(settings.showACOnEmptyFocus && (typedText.length == 0));

			// get the siblings for the current item
			var $siblings = ($current.length == 0 || $current.hasClass("mc_root")) ? $list.find("> li") : $current.parent().find("> li");
			// show all matches
			showMatches($siblings, hideResults);
		};

		var iBlurTimeout;
		function onBlur(e){
			// we may need to cancel this blur event, so we run it asynchronously
			iBlurTimeout = setTimeout(function (){
				// get the current item
				var $current = getCurrentListItem();

				// if we must select a child item, then update to the first child we can find
				if( !settings.allowParentSelect && $current.is(".mc_parent") ){
					// grab the first end child item we can find for the current path
					var value = $current.find("li:not('.mc_parent'):first").attr(settings.valueAttr);
					// update the value
					thismenu.setValue(value, true);
				}

				// run the select callback
				if( settings.select != null ) settings.select.apply(thismenu, thismenu.getValue());

				// hide matches
				hideMatches();
			}, 200);
		};

		function showMatches($li, hideResults){
			var bCached = ($li === oldCache), $items = bCached ? $keylist.find("> li").removeClass("mc_hover mc_hover_parent mc_firstrow") : $li.clone().removeAttr("style").removeClass("mc_hover mc_hover_parent mc_firstrow mc_endcol").filter(":last").addClass("mc_endcol").end();

			// only do the following if we've updated the cache or the list is hidden
			if( !bCached || $keylist.is(":hidden") ){
				// update the matches
				$keylist.empty().append($items).width($divInput.outerWidth() - getPadding($keylist[0], "width")).css("height", "auto");

				// anchor the menu relative parent
				anchorTo($divInput.parent(), $keylist, true);

				// show hover on mouseover
				$items.hover(function (){$keylist.find("> li").removeClass("mc_hover_parent mc_hover"); $(this).addClass("mc_hover")}, function (){$(this).removeClass("mc_hover")});

				// make sure the the ul's are hidden (so the li's are sized correctly)
				$items.find("> ul").css("display", "none");

				// show the list
				$keylist.show().css("visibility", (hideResults === true) ? "hidden" : "visible");

				// if we're IE6, ensure we enforce the "max-height" CSS property
				if( isIE6 ){
					var maxHeight = parseInt($keylist.css("max-height"), 10) || 0;
					if( (maxHeight > 0) && (maxHeight < $keylist.outerHeight()) ) $keylist.height(maxHeight);

					// anchor the iframe behind the scrollable list
					if( !!$.fn.bgIframe ) anchorTo($divInput.parent(), $keylistiframe.css({height: $keylist.outerHeight(), width: $keylist.width()}, true).show())
				}

				// scroll the list into view
				if( hideResults !== true ) scrollToView($keylist);
			}

			// do not show the list on screen
			if( hideResults === true ){
				// hide the results and move them offscreen (so it doesn't hide the cursor in FF2)
				$keylist.css({top: "-10000px", left: "-10000px"});
				// hiden the iframe overlay
				if( isIE6 && !!$.fn.bgIframe ) $keylistiframe.css("display", "none");
			}

			// get the currently selected item
			var $current = $keylist.find("li[" + settings.valueAttr + "='"+ $hidden.val() +"']");

			// make sure the last match is still highlighted
			$current.addClass("mc_hover" + ($current.is(".mc_parent")? "_parent" : ""));

			// scroll the item into view
			if( $current.length > 0 && (hideResults != true) ) scrollIntoView($current);

			// update the cache
			oldCache = matchesCache = $li;
		};

		function hideMatches(){
			// hide the bgiframe
			if( isIE6 && !!$.fn.bgIframe && $keylistiframe ) $keylistiframe.hide();
			if( $keylist ) $keylist.hide();
		};

		// check the user's keypress
		function checkKeypress(e){
			var key = String.fromCharCode(e.keyCode || e.charCode).toLowerCase();
			var $current = getCurrentListItem();
			var $lis = ($current.length == 0 || $current.hasClass("mc_root")) ? $list.find("> li") : $current.parent().find("> li");
			var treePath = typedText.split(settings.delim);
			var currentNode = treePath.pop();
			var compare = currentNode + key;
			var selectedText = getSelection($self[0]).toLowerCase();
			var value = $self.val().toLowerCase();

			// if the up arrow was pressed
			if( e.keyCode == 38 ){
				moveMatch(-1);
				return false;

			// if the down arrow was pressed
			} else if( e.keyCode == 40 ){
				moveMatch(1);
				return false;

			// if the [ESC] was pressed
			} else if( e.keyCode == 27 ){
				// clear typedText
				typedText = "";
				// clear the value
				thismenu.setValue("");
				// show the root level
				showMatches($list.find("> li"));

				return false;

			// if user pressed [DEL] or [LEFT ARROW], go remove last typed character
			} else if( e.keyCode == 8 || e.keyCode == 37 ){
				// if left arrow, go back to previous parent
				compare = (e.keyCode == 37) ? "" : currentNode.substring(0, currentNode.length - 1);

				// if all the text is highlighted we just came from a delete
				if( selectedText == currentNode ){
					currentNode = "";
				}
				// we're going backwards to the last parent, move backwards
				if( treePath.length > 0 && currentNode.length == 0){
					updateValue($current.parent().parent());
					return false;
				// if all the text is selected, remove everything
				} else if( selectedText == value ){
					typedText = "";
					thismenu.setValue("");
					return false;
				}
			// if the user pressed [ENTER], [TAB], [RIGHT ARROW] or the delimiter--go to next level
			} else if( e.keyCode == 9 || e.keyCode == 13 || e.keyCode == 39 || key == settings.delim ){
				// get the first child item if there is one
				var $first = $current.find("> ul > li:first");

				// update with the next child branch
				if( $first.length > 0 ){
					updateValue($first);
				// leave the field
				} else {
					// if IE6, we must deselect the selection
					if( $.browser.msie ) setSelection($self[0], 0, 0);
					if( e.keyCode == 9 ){
						// blur out of the field
						$self.triggerHandler("blur");
						// hide the matches
						hideMatches();
						// allow the tab
						return true;
					} else {
						// blur out of the field
						$self.trigger("blur");
						// hide the matches
						hideMatches();
					}
				}

				return false;
			// if all the text is highlighted then we need to delete everything
			} else if( selectedText == value ){
				typedText = "";
				compare = key;
			}

			// update the match cache with all the matches
			matchesCache = findMatches($lis, compare);

			// if we have some matches, populate autofill and show matches
			if( matchesCache.length > 0 ){
				// update the a reference to what the user's typed
				typedText = treePath.join(settings.delim) + (treePath.length > 0 ? settings.delim : "") + compare;
				updateValue(matchesCache.eq(0), true);
			} else {
				// find the previous compare string
				compare = compare.length ? compare.substring(0, compare.length-1) : "";

				// since we have no matches, get the previous matches
				matchesCache = findMatches($lis, compare);

				// if we have some matches, show them
				if( matchesCache.length > 0 )
					showMatches(matchesCache);
				// hide the matches
				else
					hideMatches();
			}

			// stop default behavior
			e.preventDefault();

			return false;
		};

		function moveMatch(step){
			// find the current item in the matches cache
			var $current = getCurrentListItem(), $next, pos = 0;

			// if nothing selected, look for the item with the hover class
			if( $current.length == 0 ) $current = matchesCache.filter(".mc_hover, .mc_hover_parent");
			// if still nothing, grab the first item in the cache
			if( $current.length == 0 || $keylist.is(":hidden") ){
				// grab the first item
				$current = matchesCache.eq(0);
				// since nothing is selected, don't step forward/back
				step = 0;
			}

			// find the current position of the element
			matchesCache.each(function (i){
				if( this === $current[0]){
					pos = i;
					return false;
				}
			});

			// if no matches, cancel
			if( !matchesCache || matchesCache.length == 0 || $current.length == 0 ) return false;

			// adjust by the step count
			pos = pos + step;

			// make sure pos is in valid bounds
			if( pos < 0 ) pos = matchesCache.length-1;
			else if( pos >= matchesCache.length ) pos = 0;

			// get the next item
			$next = matchesCache.eq(pos);

			updateValue($next, true);
		};

		function findMatches($lis, compare){
			var matches = $([]); // $([]) = empty jquery object

			$lis.each(function (){
				// get the current list item and it's label
				var $li = $(this), label = getNodeText($li);

				// label matches what the user typed, add it to the queue
				if( label.substring(0, compare.length).toLowerCase() == compare ){
					// store a copy to this jQuery item
					matches = matches.add($li);
				}
			});

			// return the matches found
			return matches;
		};

		function updateValue($li, keepTypedText){
			// grab all direct children items
			var $siblings = keepTypedText ? matchesCache : ($li.length == 0 || $li.hasClass("mc_root")) ? $list.find("> li") : $li.parent().find("> li");
			var treePath = getTreePath($li);
			var currentNode = treePath.pop().toLowerCase();

			// update the a reference to what the user's typed
			if( !keepTypedText ) typedText = treePath.join(settings.delim).toLowerCase() + (treePath.length > 0 ? settings.delim : "");

			// update form field and display with the updated value
			thismenu.setValue($li.attr(settings.valueAttr), true);

			// pre-select the last node
			setSelection($self[0], typedText.length, currentNode.length+typedText.length);

			// remove any currently selected items
			$siblings.filter(".mc_hover,.mc_hover_parent").removeClass("mc_hover mc_hover_parent");
			// add the hover class
			$li.addClass("mc_hover" + ($li.is(".mc_parent")? "_parent" : ""));

			// show all the matches
			showMatches($siblings);
		};

		// get the text currently selected by the user in a text field
		function getSelection(field){
			var text = "";
			if( field.setSelectionRange ){
				text = field.value.substring(field.selectionStart, field.selectionEnd);
			} else if( document.selection ){
				var range = document.selection.createRange();
				if( range.parentElement() == field ){
					text = range.text;
				}
			}
			return text;
		};

		// set the text selected in a text field
		function setSelection(field, start, end) {
			if( field.createTextRange ){
				var selRange = field.createTextRange();
				selRange.collapse(true);
				selRange.moveStart("character", start);
				selRange.moveEnd("character", end);
				selRange.select();
			} else if( field.setSelectionRange ){
				field.setSelectionRange(start, end);
			} else {
				if( field.selectionStart ){
					field.selectionStart = start;
					field.selectionEnd = end;
				}
			}
			field.focus();
		};

		function scrollIntoView($el, center){
			var el = $el[0];
			var scrollable = $keylist[0];
			// get the padding which is need to adjust the scrollTop
			var s = {pTop: parseInt($keylist.css("paddingTop"), 10)||0, pBottom: parseInt($keylist.css("paddingBottom"), 10)||0, bTop: parseInt($keylist.css("borderTopWidth"), 10)||0, bBottom: parseInt($keylist.css("borderBottomWidth"), 10)||0};

			// scrolling down
			if( (el.offsetTop + el.offsetHeight) > (scrollable.scrollTop + scrollable.clientHeight) ){
				scrollable.scrollTop = $el.offset().top + (scrollable.scrollTop - $keylist.offset().top) - ((scrollable.clientHeight/((center == true) ? 2 : 1)) - ($el.outerHeight() + s.pBottom));
			// scrolling up
			} else if( el.offsetTop - s.bTop - s.bBottom <= (scrollable.scrollTop + s.pTop + s.pBottom) ){
				scrollable.scrollTop = $el.offset().top + (scrollable.scrollTop - $keylist.offset().top) - s.pTop;
			}
		};

		// run the init callback (some keyboard entry methods will manage this callback manually)
		if( settings.init != null ) settings.init.apply(thismenu, [$input, $hidden, $list]);

  };

})(jQuery);


text:
<?php

class WPML_Editor_UI_Single_Line_Field extends WPML_Editor_UI_Field {

	private $include_copy_button;

	function __construct( $id, $title, $data, $include_copy_button, $requires_complete = false ) {
		parent::__construct( $id, $title, $data, $requires_complete );

		$this->include_copy_button = $include_copy_button;
	}

	public function get_fields() {
		$field                = parent::get_fields();
		$field['field_style'] = '0';

		return array( $field );
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false" >
    <translate
        android:duration="2700"
        android:fromXDelta="0%"
        android:fromYDelta="0%"
        android:interpolator="@android:anim/accelerate_interpolator"
        android:toXDelta="-16%p"
        android:fillAfter="false"
        android:toYDelta="-100%p" />

</set>


text:
export EDITOR='atom'
export GOOGLE_APPLICATION_CREDENTIALS="/usr/local/etc/Chuck-Dev-5313f264f9b3.json"


text:
chef_gem 'chef-provisioning-aws' do
  action :install
  compile_time true
end

require 'chef/provisioning/aws_driver'

# Specify the driver to be used here
with_driver 'aws'

# Enable Chef server communication
config_file = "/etc/chef/knife.rb"
Chef::Config.from_file(config_file)
with_chef_server Chef::Config[:chef_server_url], {
  :client_name => Chef::Config[:node_name],
  :signing_key_filename => Chef::Config[:client_key]
}

log "*** Creating chef environment: #{node['provision']['name_prefix']}"

# Create/Destroy the Chef environment for the nodes
chef_environment node['provision']['name_prefix'] do
  default_attributes node['provision']['default_attributes']
  description "Auto-generated using chef-provisioning"
  complete true
  action (node['provision']['all']=="true" ? :create : :delete)
end

# Create an array of machine names
the_machines = []
for i in (1..node['provision']['instances'].to_i)
  the_machines.push("#{node['provision']['name_prefix']}-#{i}")
end

# Create/Destroy machines in parallel
machine_batch do
  the_machines.each do |machine_name|
    machine machine_name do
      tag "name=#{machine_name}"
      run_list node['provision']['chef']['run_list'].split(/\s*,\s*/)
      chef_environment node['provision']['name_prefix']
      converge true
      machine_options({
        :ssh_username => 'root',
        :bootstrap_options => {
          :key_name => node['provision']['cloud']['key_name'],
          :availability_zone => node['provision']['cloud']['availability_zone'],
          :instance_type => node['provision']['cloud']['instance_type'],
          :image_id => node['provision']['cloud']['image_id']
        }
      })
    end
  end
  action (node['provision']['all']=="true" ? :converge : :destroy)
end

# Create/Destroy an AWS ELB used as an HTTP load balancer for the machines
load_balancer "#{node['provision']['name_prefix']}-elb" do
  load_balancer_options :availability_zones => [node['provision']['cloud']['availability_zone']],
    :listeners => [{
      :port => 80,
      :protocol => :http,
      :instance_port => 80,
      :instance_protocol => :http,
    }]
  machines the_machines
  action (node['provision']['all']=="true" ? :create : :destroy)
end


text:
package org.elasticsearch.search.suggest.completion;

import org.apache.lucene.util.automaton.Operations;
import org.apache.lucene.util.automaton.RegExp;
import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.ToXContentFragment;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.index.query.RegexpFlag;

import java.io.IOException;

/**
 * Regular expression options for completion suggester
 */
public class RegexOptions implements ToXContentFragment, Writeable {
    static final ParseField REGEX_OPTIONS = new ParseField("regex");
    private static final ParseField FLAGS_VALUE = new ParseField("flags", "flags_value");
    private static final ParseField MAX_DETERMINIZED_STATES = new ParseField("max_determinized_states");

    /**
     * regex: {
     *     "flags" : STRING | INT
     *     "max_determinized_states" : INT
     * }
     */
    private static final ObjectParser<Builder, Void> PARSER = new ObjectParser<>(REGEX_OPTIONS.getPreferredName(),
            Builder::new);
    static {
        PARSER.declareInt(Builder::setMaxDeterminizedStates, MAX_DETERMINIZED_STATES);
        PARSER.declareField((parser, builder, aVoid) -> {
            if (parser.currentToken() == XContentParser.Token.VALUE_STRING) {
                builder.setFlags(parser.text());
            } else if (parser.currentToken() == XContentParser.Token.VALUE_NUMBER) {
                builder.setFlagsValue(parser.intValue());
            } else {
                throw new ElasticsearchParseException(REGEX_OPTIONS.getPreferredName()
                    + " " + FLAGS_VALUE.getPreferredName() + " supports string or number");
            }
        }, FLAGS_VALUE, ObjectParser.ValueType.VALUE);
    }

    public static Builder builder() {
        return new Builder();
    }

    static RegexOptions parse(XContentParser parser) throws IOException {
        return PARSER.parse(parser, null).build();
    }

    private int flagsValue;
    private int maxDeterminizedStates;

    private RegexOptions(int flagsValue, int maxDeterminizedStates) {
        this.flagsValue = flagsValue;
        this.maxDeterminizedStates = maxDeterminizedStates;
    }

    /**
     * Read from a stream.
     */
    RegexOptions(StreamInput in) throws IOException {
        this.flagsValue = in.readVInt();
        this.maxDeterminizedStates = in.readVInt();
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        out.writeVInt(flagsValue);
        out.writeVInt(maxDeterminizedStates);
    }

    /**
     * Returns internal regular expression syntax flag value
     * see {@link RegexpFlag#value()}
     */
    public int getFlagsValue() {
        return flagsValue;
    }

    /**
     * Returns the maximum automaton states allowed for fuzzy expansion
     */
    public int getMaxDeterminizedStates() {
        return maxDeterminizedStates;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        RegexOptions that = (RegexOptions) o;

        if (flagsValue != that.flagsValue) return false;
        return maxDeterminizedStates == that.maxDeterminizedStates;

    }

    @Override
    public int hashCode() {
        int result = flagsValue;
        result = 31 * result + maxDeterminizedStates;
        return result;
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
        builder.startObject(REGEX_OPTIONS.getPreferredName());
        builder.field(FLAGS_VALUE.getPreferredName(), flagsValue);
        builder.field(MAX_DETERMINIZED_STATES.getPreferredName(), maxDeterminizedStates);
        builder.endObject();
        return builder;
    }

    /**
     * Options for regular expression queries
     */
    public static class Builder {
        private int flagsValue = RegExp.ALL;
        private int maxDeterminizedStates = Operations.DEFAULT_MAX_DETERMINIZED_STATES;

        public Builder() {
        }

        /**
         * Sets the regular expression syntax flags
         * see {@link RegexpFlag}
         */
        public Builder setFlags(String flags) {
            this.flagsValue = RegexpFlag.resolveValue(flags);
            return this;
        }

        private Builder setFlagsValue(int flagsValue) {
            this.flagsValue = flagsValue;
            return this;
        }

        /**
         * Sets the maximum automaton states allowed for the regular expression expansion
         */
        public Builder setMaxDeterminizedStates(int maxDeterminizedStates) {
            if (maxDeterminizedStates < 0) {
                throw new IllegalArgumentException("maxDeterminizedStates must not be negative");
            }
            this.maxDeterminizedStates = maxDeterminizedStates;
            return this;
        }

        public RegexOptions build() {
            return new RegexOptions(flagsValue, maxDeterminizedStates);
        }
    }
}


text:
package cache;

import java.util.HashMap;

/* This class implements a size-based cache Removing the Largest File in
 * the cache first.
 */

public class CacheRLF extends CacheManagerBytes {
    private HashMap<String, RequestedObject> hashMap = new HashMap<String, RequestedObject>();

    public CacheRLF(int capacity) {
    	this.capacity = capacity;
    }

    /*This method add an element to the cache, if there is no space
     *the largest file will be remove.
     */
    public void put(RequestedObject requestObject) {
    	while (requestObject.getSize() + curUsedSpace > capacity) {
    		int maxSize = Integer.MIN_VALUE;
    		RequestedObject ro = null;
            for(RequestedObject request : this.hashMap.values()) {
                if(request.getSize() > maxSize) {
                    maxSize = request.getSize();
                    ro = request;
                }
            }
            hashMap.remove(ro.getName());
            curUsedSpace -= ro.getSize();
    	}
    	hashMap.put(requestObject.getName(), requestObject);
    	curUsedSpace += requestObject.getSize();
    }

    /*This method remove an element already present in the cache
     * but which is requested with a new size.
     */
    public void removeDynamicRessource(RequestedObject requestObject){
      if(this.hashMap.containsKey(requestObject.getName())) {
        this.hashMap.remove(requestObject.getName());
        this.curUsedSpace -= requestObject.getSize();
      }
   }

     /*This method is used to get an element in the cache and if it's not
     * in the cache, it will be added
     */
    public boolean specific_get(RequestedObject requestObject) {
        boolean result = false;
    	RequestedObject ro = hashMap.get(requestObject.getName());
    	if (ro == null) {
 			put(requestObject);
    	} else {
    		if (ro.getSize() != requestObject.getSize()) {
    			hashMap.remove(ro);
    			this.curUsedSpace -= ro.getSize();
    			put(requestObject);
    		} else {
	    		result = true;
	    	}
    	}
    	return result;
    }

    public String printCache() {
         String res = "";
         for (RequestedObject ro : this.hashMap.values()) {
              res += ro.getName() + "\n";
         }
         return res;
    }
}


text:
* new feature that allow you to add custom attributes via `onRenderCell` [#502](https://github.com/t1m0n/air-datepicker/issues/502), [read docs](https://air-datepicker.com/docs?scrollTo=onRenderCell)
* fixed selecting cell when using custom html with `onRenderCell` option  [#502](https://github.com/t1m0n/air-datepicker/issues/502)

### v3.2.1
* added Arabic locale, thanks to [abdo-host](https://github.com/abdo-host) [#497](https://github.com/t1m0n/air-datepicker/pull/497)
* added Italian locale, thanks to [msaltieri](https://github.com/msaltieri) [#498](https://github.com/t1m0n/air-datepicker/pull/498)

### v3.2.0
* added `onClickDayName` option, [#459](https://github.com/t1m0n/air-datepicker/issues/459)
* added `silent` param to `clear` method, [#477](https://github.com/t1m0n/air-datepicker/issues/477)
* added Swedish locale, thanks to [naton](https://github.com/naton) [#207](https://github.com/t1m0n/air-datepicker/pull/207)
* fixed error when trying to call `update` method with `view` parameter on hidden calendar, [#476](https://github.com/t1m0n/air-datepicker/issues/476)
* fixed styles issue with time sliders, [#489](https://github.com/t1m0n/air-datepicker/issues/489)
* fixed English docs description, [#490](https://github.com/t1m0n/air-datepicker/issues/490)
* fixed typings for `formatDate` method, [#491](https://github.com/t1m0n/air-datepicker/issues/491)

### v3.1.1
* fixed css compilation, [#461](https://github.com/t1m0n/air-datepicker/issues/461)
* fixed `autoClose` when range mode is on, [#466](https://github.com/t1m0n/air-datepicker/issues/466)
* fixed `onSelect` when range mode is on. Now it accepts array of selected dates instead of single one [#467](https://github.com/t1m0n/air-datepicker/issues/467)
* fixed transition between `isMobile` mode on and off [#470](https://github.com/t1m0n/air-datepicker/issues/470)
* added position update when resizing window [#472](https://github.com/t1m0n/air-datepicker/issues/472)
* added Sinhala locale, thanks to [nimeshc64](https://github.com/nimeshc64) in [#464](https://github.com/t1m0n/air-datepicker/pull/464)
* fixed French locale, thanks to [matschik](https://github.com/matschik) in [#465](https://github.com/t1m0n/air-datepicker/pull/465)
* added Ukrainian locale, thanks to [zaandr](https://github.com/zaandr) in [#471](https://github.com/t1m0n/air-datepicker/pull/471)

### v3.1.0
* added lazy rendering - now inner components of datepicker will be created only when it will be visible, and will be destroyed when datepicker is hidden
* improved `position` - now it can be function which allows you to perform advanced positioning using third-party libraries such as [popperjs](https://popper.js.org/) or manually
* added `isMobile` option, which allows showing Air Datepicker as modal window on mobile devices
* added `visiblie` option, if it is set to `true` then calendar will be visible at the start
* changed `dateFormat` - as function it now handles all dates at once, instead of each date separately
* fixed field names in `onSelect` and `onRenderCell` options: `type` -> `cellType`, `dp` -> `datepicker`
* fixed typings
* fixed `closet` function, thanks to [@hreyeslo](https://github.com/hreyeslo) in [#445](https://github.com/t1m0n/air-datepicker/pull/445)
* added Turkish locale, thanks to [@ozkanozcan](https://github.com/ozkanozcan) in [#447](https://github.com/t1m0n/air-datepicker/pull/447)
* added opportunity to set attributes when creating custom buttons, thanks to [@khidirbekov](https://github.com/khidirbekov) in [#448](https://github.com/t1m0n/air-datepicker/pull/448)
* added Thai locale, thanks to [@boatkung](https://github.com/boatkung) in [#453](https://github.com/t1m0n/air-datepicker/pull/453)

### v3.0.1
* fixed `update` method issue when some changes did not apply immediately

### v3.0.0
* no more jQuery
* improve rendering process - remove redundant cell render when selecting date, which gave a large speed boost compared to the old version
* date format tokens now use [Unicode Technical Standard](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table)
* TypeScript support
* added `selectedDates` option, to be able to select dates from the start
* added a possibility to create custom buttons
* now one could change selected range by dragging dates
* added `container` option which allows you to place datepicker in a custom element
* `navTitles` can receive a function and could render dynamically
* `dateFormat` now can receive a function
* `onSelect` and `onRenderCell` callbacks are now receive a single object as an argument instead of multiple parameters
* `selectDate` now receives second parameter with options
* `onChangeMonth`, `onChangeYear`, `onChangeDecades` are replaced with single option `onChangeViewDate`
* localization now must be provided as an object instead of string as it was before

### v2.2.3
* fixed min,max dates in decade mode

### v2.2.2
* fixed min,max dates handling

### v2.2.1
* changed RegExp for recognizing date parts
* changed jquery version dependency

### v2.2.0
* added `onlyTimepicker` option
* added `onShow` and `onHide` callbacks
* added `VERSION` field to plugin's prototype
* now for selecting same date in `range` mode, you should set `{toggleSelected: false}`
* fixed `dateFormat` method (fixed wrong month name in Hungarian language)
* fixed second call of `onRenderCallback`
* fixed `_getCell()` throwing exception
* new language:
    - `sk` thanks to [RobiNN1](https://github.com/RobiNN1)

### v2.1.0
* added possibility to select single date when `{range: true}`
* added support of 12 hours mode in `altFieldDateFormat`
* improved work with minDate and maxDate when `{timepicker: true}`
* fixed wrong class adding when `{range: true}`
* new languages:
    - `es` thanks to [MarioAraque](https://github.com/MarioAraque)
    - `cs` thanks to [liborm85](https://github.com/liborm85)
    - `hu` thanks to [gergo85](https://github.com/gergo85)
    - `fi` thanks to [joonaskaskisolaphz](https://github.com/joonaskaskisolaphz)
    - `pl` thanks to [xiio](https://github.com/xiio)
    - `fr` thanks to [nicooprat](https://github.com/nicooprat)

### v2.0.2
* fixed dates array in `onSelect` callback

### v2.0.1
* fixed version for npm

### v2.0.0
* added timepicker (see [docs](http://t1m0n.name/air-datepicker/docs#timepicker) for more info)
* added possibility to set `Date` in `todayButton`
* global variable `Datepicker` has been removed, now all placed in `$.fn.datepicker`
* improved `selectDate` method, now one can pass an array of dates to select
* added `npm` package
* fixed issue caused by `placeholder` on `readonly` inputs in IE
* fixed issue when `range` is true and first selected date is bigger than second
* added new languages:
    - `da`  thanks to [bjarnef](https://github.com/bjarnef)
    - `nl`  thanks to [JaZo](https://github.com/JaZo)
    - `pt`  thanks to [cmpscabral](https://github.com/cmpscabral)
    - `pt-BR`  thanks to [dowglaz](https://github.com/dowglaz)
    - `ro`  thanks to [tourniquet](https://github.com/tourniquet)

### v1.2.4
* fixed '$ is not defined' problem.

### v1.2.3
* fixed `dateFormat` method.
* fixed typo in Russian docs, add ids in docs headers.

### v1.2.2
* fixed typo in `monthsField`
* added German language (thanks to [Ichag](https://github.com/Ichag))

### v1.2.1
* tests added
* added Chinese language (thanks to [think2011](https://github.com/think2011))
* fixed if '0' is passed to `firstDay`
* fixed `showOtherYears` option
* fixed `onSelect` event, when `range` is true
* fixed case when `range` and `multipleDates` both set to true

### v1.2.0
* add `range` feature
* improve keyboard navigation (fixed two focused cells)

### v1.1.0
* add keyboard navigation
* add `classes` option to add custom classes
* add `altField` option
* bug fixes


text:
sudo mkfs.xfs /dev/disk/by-id/google-results-dec
sudo mkfs.xfs /dev/disk/by-id/google-results-hex
sudo mkdir -p /mnt/results-{dec,hex}

sudo blkid /dev/disk/by-id/google-results-dec |awk '{print $2" /mnt/results-dec    xfs    defaults   0 2"}' | sudo tee -a /etc/fstab
sudo blkid /dev/disk/by-id/google-results-hex |awk '{print $2" /mnt/results-hex    xfs    defaults   0 2"}' | sudo tee -a /etc/fstab

mount /mnt/results-dec
mount /mnt/results-hex

sudo mkdir '/mnt/results-dec/Pi - Dec - Chudnovsky'
sudo mkdir '/mnt/results-hex/Pi - Hex - Chudnovsky'

sudo ln -s '/mnt/results-dec/Pi - Dec - Chudnovsky' /mnt/y-cruncher/results/
sudo ln -s '/mnt/results-hex/Pi - Hex - Chudnovsky' /mnt/y-cruncher/results/


text:
import * as React from 'react'
import { mount, ReactWrapper } from 'enzyme'

import { onNextFrame } from '../utils'
import { TransitionWrapper } from '../TransitionWrapper'
import { Transition, SingleTransitionProps, TransitionProps, TransitionState } from '../Transition'

describe('Transition', () => {
    let getComputedStyleSpy: jest.Mock
    let el: ReactWrapper<SingleTransitionProps, TransitionState>
    const foo =
Foo!

    const bar =
Bar!

    const getRenderedChildren = (wrapperElement: ReactWrapper<TransitionProps, TransitionState>) =>
        wrapperElement
            .children()
            .children()
            .getElements()

    const tryOnNextFrame = (done: jest.DoneCallback, callback: Function) => {
        onNextFrame(() => {
            try {
                callback()
            } catch (e) {
                done.fail(e)
            }
        })
    }

    beforeAll(() => {
        getComputedStyleSpy = jest.spyOn(window, 'getComputedStyle').mockReturnValue({
            animationDuration: '0s',
            animationDelay: '0s',
            transitionDuration: '0s',
            transitionDelay: '0s'
        })
    })

    afterEach(() => {
        getComputedStyleSpy.mockClear()
    })

    it('renders correctly', () => {
        el = mount(<Transition>{foo}</Transition>)
        expect(el.children().type()).toBe(TransitionWrapper)
        expect(getRenderedChildren(el)).toContainEqual(foo)
    })

    it('uses appear props correctly on mount', done => {
        const onBeforeAppear = jest.fn(),
            onAppear = jest.fn(),
            onAfterAppear = jest.fn(),
            onEnter = jest.fn()
        el = mount(
            <Transition
                appear
                onBeforeAppear={onBeforeAppear}
                onAppear={onAppear}
                onAfterAppear={onAfterAppear}
                onEnter={onEnter}
            >
                {foo}
            </Transition>
        )
        const node = el.getDOMNode()
        expect(node.classList).toContain('t-enter')
        expect(onBeforeAppear).toBeCalledWith(node)
        expect(onAppear).not.toBeCalled()
        expect(onEnter).not.toBeCalled()
        tryOnNextFrame(done, () => {
            expect(node.classList).not.toContain('t-enter')
            expect(node.classList).toContain('t-enter-to')
            expect(node.classList).toContain('t-entering')
            expect(onAppear).toBeCalledWith(node)
            expect(onAfterAppear).not.toBeCalled()
            expect(onEnter).not.toBeCalled()
            tryOnNextFrame(done, () => {
                expect(node.classList).not.toContain('t-enter-to')
                expect(node.classList).not.toContain('t-entering')
                expect(onAfterAppear).toBeCalledWith(node)
                done()
            })
        })
    })

    it('uses enter props correctly', done => {
        const onBeforeEnter = jest.fn(),
            onEnter = jest.fn(),
            onAfterEnter = jest.fn()
        el = mount(
            <Transition onBeforeEnter={onBeforeEnter} onEnter={onEnter} onAfterEnter={onAfterEnter}>
                {null}
            </Transition>
        )
        el
            .setProps({
                children: foo
            })
            .update()
        const node = el.getDOMNode()
        expect(getRenderedChildren(el)).toContainEqual(foo)
        expect(node).toBeTruthy()
        expect(node.classList).toContain('t-enter')
        expect(onBeforeEnter).toBeCalledWith(node)
        expect(onEnter).not.toBeCalled()
        expect(el.instance().state.isEntering).toBe(true)
        tryOnNextFrame(done, () => {
            expect(node.classList).not.toContain('t-enter')
            expect(node.classList).toContain('t-entering')
            expect(node.classList).toContain('t-enter-to')
            expect(onEnter).toBeCalledWith(node)
            expect(onAfterEnter).not.toBeCalled()
            tryOnNextFrame(done, () => {
                expect(node.classList).not.toContain('t-entering')
                expect(node.classList).not.toContain('t-enter-to')
                expect(onAfterEnter).toBeCalledWith(node)
                expect(el.instance().state.isEntering).toBe(false)
                expect(el.instance().state.isLeaving).toBe(false)
                done()
            })
        })
    })

    it('uses leave props correctly', done => {
        const onBeforeLeave = jest.fn(),
            onLeave = jest.fn(),
            onAfterLeave = jest.fn()
        el = mount(
            <Transition onBeforeLeave={onBeforeLeave} onLeave={onLeave} onAfterLeave={onAfterLeave}>
                {foo}
            </Transition>
        )
        el
            .setProps({
                children: null
            })
            .update()
        const node = el.getDOMNode()
        expect(getRenderedChildren(el)).toContainEqual(foo)
        expect(node).toBeTruthy()
        expect(node.classList).toContain('t-leave')
        expect(onBeforeLeave).toBeCalledWith(node)
        expect(onLeave).not.toBeCalled()
        expect(el.instance().state.isLeaving).toBe(true)
        tryOnNextFrame(done, () => {
            expect(node.classList).not.toContain('t-leave')
            expect(node.classList).toContain('t-leaving')
            expect(node.classList).toContain('t-leave-to')
            expect(onLeave).toBeCalledWith(node)
            expect(onAfterLeave).not.toBeCalled()
            tryOnNextFrame(done, () => {
                expect(node.classList).not.toContain('t-leaving')
                expect(node.classList).not.toContain('t-leave-to')
                expect(onAfterLeave).toBeCalledWith(node)
                expect(el.instance().state.isLeaving).toBe(false)
                expect(el.instance().state.isEntering).toBe(false)
                done()
            })
        })
    })

    it('emits cancelled events correctly', done => {
        const onCancelAppear = jest.fn(),
            onCancelEnter = jest.fn(),
            onCancelLeave = jest.fn()
        el = mount(
            <Transition
                appear
                onCancelAppear={onCancelAppear}
                onCancelEnter={onCancelEnter}
                onCancelLeave={onCancelLeave}
            >
                {foo}
            </Transition>
        )
        let node = el.getDOMNode()
        tryOnNextFrame(done, () => {
            el
                .setProps({
                    children: null
                })
                .update()
            expect(onCancelAppear).toBeCalledWith(node)
            expect(onCancelAppear).toHaveBeenCalledTimes(1)
            tryOnNextFrame(done, () => {
                el
                    .setProps({
                        children: foo
                    })
                    .update()
                expect(onCancelLeave).toBeCalledWith(node)
                expect(onCancelLeave).toHaveBeenCalledTimes(1)
                tryOnNextFrame(done, () => {
                    el
                        .setProps({
                            children: bar
                        })
                        .update()
                    expect(onCancelEnter).toHaveBeenCalledTimes(1)
                    expect(getRenderedChildren(el).length).toBe(2)
                    done()
                })
            })
        })
    })

    it('overrides classes correctly', done => {
        el = mount(
            <Transition
                appear
                enterClass="enterClass"
                enteringClass="enteringClass"
                enterToClass="enterToClass"
                leaveClass="leaveClass"
                leavingClass="leavingClass"
                leaveToClass="leaveToClass"
            >
                {foo}
            </Transition>
        )
        const node = el.getDOMNode()
        expect(node.classList).toContain('enterClass')
        tryOnNextFrame(done, () => {
            expect(node.classList).toContain('enteringClass')
            expect(node.classList).toContain('enterToClass')
            tryOnNextFrame(done, () => {
                el
                    .setProps({
                        children: null
                    })
                    .update()
                expect(node.classList).toContain('leaveClass')
                tryOnNextFrame(done, () => {
                    expect(node.classList).toContain('leavingClass')
                    expect(node.classList).toContain('leaveToClass')
                    done()
                })
            })
        })
    })

    it('uses explicitly set done callbacks on JS hooks and ignores autoCss', done => {
        const doneSpy = jest.fn()
        const instantDone = (node: Element, complete: Function) => {
            doneSpy()
            complete()
        }
        el = mount(
            <Transition appear duration={300} onEnter={instantDone} onLeave={instantDone} onAppear={instantDone}>
                {foo}
            </Transition>
        )
        expect(doneSpy).not.toBeCalled()
        tryOnNextFrame(done, () => {
            expect(doneSpy).toHaveBeenCalledTimes(1)
            el
                .setProps({
                    children: null
                })
                .update()
            tryOnNextFrame(done, () => {
                expect(doneSpy).toHaveBeenCalledTimes(2)
                el
                    .setProps({
                        children: bar
                    })
                    .update()
                tryOnNextFrame(done, () => {
                    expect(doneSpy).toHaveBeenCalledTimes(3)
                    expect(getComputedStyleSpy).not.toBeCalled()
                    done()
                })
            })
        })
    })

    it('ignores autoCss when the prop is set', done => {
        el = mount(
            <Transition appear noCss>
                {foo}
            </Transition>
        )
        tryOnNextFrame(done, () => {
            el
                .setProps({
                    children: null
                })
                .update()
            tryOnNextFrame(done, () => {
                el
                    .setProps({
                        children: bar
                    })
                    .update()
                tryOnNextFrame(done, () => {
                    expect(getComputedStyleSpy).not.toBeCalled()
                    done()
                })
            })
        })
    })

    it('uses duration when available', done => {
        jest.useFakeTimers()
        const onAfterAppear = jest.fn(),
            onAfterEnter = jest.fn(),
            onAfterLeave = jest.fn()
        el = mount(
            <Transition
                appear
                duration={50}
                onAfterAppear={onAfterAppear}
                onAfterEnter={onAfterEnter}
                onAfterLeave={onAfterLeave}
            >
                {foo}
            </Transition>
        )
        tryOnNextFrame(done, () => {
            jest.runTimersToTime(49)
            expect(onAfterAppear).not.toBeCalled()
            jest.runTimersToTime(1)
            expect(onAfterAppear).toBeCalled()
            el
                .setProps({
                    children: null
                })
                .update()
            tryOnNextFrame(done, () => {
                jest.runTimersToTime(49)
                expect(onAfterLeave).not.toBeCalled()
                jest.runTimersToTime(1)
                expect(onAfterLeave).toBeCalled()
                el
                    .setProps({
                        children: bar
                    })
                    .update()
                tryOnNextFrame(done, () => {
                    jest.runTimersToTime(49)
                    expect(onAfterEnter).not.toBeCalled()
                    jest.runTimersToTime(1)
                    expect(onAfterEnter).toBeCalled()
                    done()
                })
                jest.runAllTimers()
            })
            jest.runAllTimers()
        })
        jest.runAllTimers()
    })
})


text:
<?php

// Defualt page will always be pages/homepage.html, if not, change this to
// the name of the file you have created to be the homepage.
$page = 'homepage';
// Lets get pages based on user input
if (!empty($_GET['name'])) {
    //Assign a variable to a sanitised version of the data passed in the URL
    $tmp_page = basename($_GET['name']);
    //If the file exists, update $page
    if (file_exists("pages/{$tmp_page}.html"))
        $page = $tmp_page;
    //If the file does not exist, include our custom notfound page and don't run anymore code
    elseif(!file_exists($tmp_page)){
      include 'pages/notfound.html';
      exit;
  	}
}
// Include $page (declared default)
include ("pages/$page.html");
 ?>


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddColumnPurchasingPaymentOrderTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        DB::statement('SET FOREIGN_KEY_CHECKS=0;');
        self::addColumnPurchaseInventory();
        self::addColumnPurchaseService();
        DB::statement('SET FOREIGN_KEY_CHECKS=1;');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        self::dropColumnPurchaseInventory();
        self::dropColumnPurchaseService();
    }

    public function addColumnPurchaseInventory()
    {
        /**
         * TABLE PAYMENT ORDER
         * + Column payment_type
         */

        if (!Schema::hasColumn('point_purchasing_payment_order', 'payment_type')) {
            Schema::table('point_purchasing_payment_order', function ($table) {
                $table->string('payment_type')->nullable()->default('bank');
            });
        }

        /**
         * TABLE PAYMENT ORDER DETAIL
         * + Column coa_id
         * + Column form_reference_id
         */
        if (!Schema::hasColumn('point_purchasing_payment_order_detail', 'coa_id')) {
            Schema::table('point_purchasing_payment_order_detail', function ($table) {
                $table->integer('coa_id')->unsigned()->index('purchase_po_detail_coa_index');
                $table->foreign('coa_id', 'purchase_po_detail_coa_foreign')
                    ->references('id')->on('coa')
                    ->onUpdate('restrict')
                    ->onDelete('restrict');
            });
        }

        if (!Schema::hasColumn('point_purchasing_payment_order_detail', 'form_reference_id')) {
            Schema::table('point_purchasing_payment_order_detail', function ($table) {
                $table->integer('form_reference_id')->unsigned()->index('purchase_po_detail_form_reference_index');
                $table->foreign('form_reference_id', 'purchase_po_detail_form_reference_foreign')
                    ->references('id')->on('formulir')
                    ->onUpdate('cascade')
                    ->onDelete('cascade');
            });
        }
    }

    public function dropColumnPurchaseInventory()
    {
        if (Schema::hasColumn('point_purchasing_payment_order', 'payment_type')) {
            Schema::table('point_purchasing_payment_order', function ($table) {
                $table->dropColumn(['payment_type']);
            });
        }

        if (Schema::hasColumn('point_purchasing_payment_order_detail', 'coa_id')) {
            Schema::table('point_purchasing_payment_order_detail', function ($table) {
                $table->dropForeign('purchase_po_detail_coa_foreign');
                $table->dropIndex('purchase_po_detail_coa_index');
                $table->dropColumn(['coa_id']);
            });
        }

        if (Schema::hasColumn('point_purchasing_payment_order_detail', 'form_reference_id')) {
            Schema::table('point_purchasing_payment_order_detail', function ($table) {
                $table->dropForeign('purchase_po_detail_form_reference_foreign');
                $table->dropIndex('purchase_po_detail_form_reference_index');
                $table->dropColumn(['form_reference_id']);
            });
        }
    }

    public function addColumnPurchaseService()
    {
        /**
         * TABLE PAYMENT ORDER
         * + Column payment_type
         */

        if (!Schema::hasColumn('point_purchasing_service_payment_order', 'payment_type')) {
            Schema::table('point_purchasing_service_payment_order', function ($table) {
                $table->string('payment_type')->nullable()->default('bank');
            });
        }

        /**
         * TABLE PAYMENT ORDER DETAIL
         * + Column coa_id
         * + Column form_reference_id
         */
        if (!Schema::hasColumn('point_purchasing_service_payment_order_detail', 'coa_id')) {
            Schema::table('point_purchasing_service_payment_order_detail', function ($table) {
                $table->integer('coa_id')->unsigned()->index('purchase_po_service_detail_coa_index');
                $table->foreign('coa_id', 'purchase_po_service_detail_coa_foreign')
                    ->references('id')->on('coa')
                    ->onUpdate('restrict')
                    ->onDelete('restrict');
            });
        }

        if (!Schema::hasColumn('point_purchasing_service_payment_order_detail', 'form_reference_id')) {
            Schema::table('point_purchasing_service_payment_order_detail', function ($table) {
                $table->integer('form_reference_id')->unsigned()->index('purchase_po_service_detail_form_reference_index');
                $table->foreign('form_reference_id', 'purchase_po_service_detail_form_reference_foreign')
                    ->references('id')->on('formulir')
                    ->onUpdate('cascade')
                    ->onDelete('cascade');
            });
        }
    }

    public function dropColumnPurchaseService()
    {
        if (Schema::hasColumn('point_purchasing_service_payment_order', 'payment_type')) {
            Schema::table('point_purchasing_service_payment_order', function ($table) {
                $table->dropColumn(['payment_type']);
            });
        }

        if (Schema::hasColumn('point_purchasing_service_payment_order_detail', 'coa_id')) {
            Schema::table('point_purchasing_service_payment_order_detail', function ($table) {
                $table->dropForeign('purchase_po_service_detail_coa_foreign');
                $table->dropIndex('purchase_po_service_detail_coa_index');
                $table->dropColumn(['coa_id']);
            });
        }

        if (Schema::hasColumn('point_purchasing_service_payment_order_detail', 'form_reference_id')) {
            Schema::table('point_purchasing_service_payment_order_detail', function ($table) {
                $table->dropForeign('purchase_po_service_detail_form_reference_foreign');
                $table->dropIndex('purchase_po_service_detail_form_reference_index');
                $table->dropColumn(['form_reference_id']);
            });
        }
    }
}


text:
package net.java.sip.communicator.impl.galagonotification;

import java.awt.image.*;

/**
 * Declares the native functions required by the galagonotification bundle.
 *
 * @author Lubomir Marinov
 */
public final class GalagoNotification
{
    static
    {
        System.loadLibrary("galagonotification");
    }

    /**
     * Connects to the <tt>DBUS_BUS_SESSION</tt> D-Bus bus daemon and registers
     * with it.
     *
     * @return a new reference to a <tt>DBusConnection</tt> to the
     * <tt>DBUS_BUS_SESSION</tt> D-Bus bus daemon
     * @throws DBusException if connecting to and registering with the
     * <tt>DBUS_BUS_SESSION</tt> D-Bus bus daemon fails
     */
    public static native long dbus_bus_get_session()
        throws DBusException;

    /**
     * Decrements the reference count of the specified <tt>DBusConnection</tt>
     * and finalizes it if the count reaches zero.
     *
     * @param connection the <tt>DBusConnection</tt> to decrement the reference
     * count of
     */
    public static native void dbus_connection_unref(long connection);

    /**
     * Invokes <tt>org.freedesktop.Notifications.GetCapabilities</tt> through
     * the specified <tt>DBusConnection</tt> in order to retrieve the optional
     * capabilities supported by the freedesktop.org Desktop Notifications
     * server.
     *
     * @param connection the <tt>DBusConnection</tt> with the freedesktop.org
     * Desktop Notifications server
     * @return an array of <tt>String</tt>s listing the optional capabilities
     * supported by the freedesktop.org Desktop Notifications server
     * @throws DBusException if retrieving the optional capabilities of the
     * freedesktop.org Desktop Notifications server fails
     */
    public static native String[] getCapabilities(long connection)
        throws DBusException;

    /**
     * Invokes <tt>org.freedesktop.Notifications.Notify</tt> through the
     * specified <tt>DBusConnection</tt> in order to send a notification to the
     * freedesktop.org Desktop Notifications server.
     *
     * @param connection the <tt>DBusConnection</tt> with the freedesktop.org
     * Desktop Notifications server
     * @param appName the optional name of the application sending the
     * notification
     * @param replacesId the optional notification identifier of an existing
     * notification to be replaced by the notification being sent; <tt>0</tt> to
     * not replace any existing notification
     * @param icon the optional icon to be displayed by the notification if the
     * server supports such display. Not supported by this implementation at
     * this time.
     * @param summary the summary text briefly describing the notification
     * @param body the optional detailed body text of the notification
     * @param expireTimeout the time in milliseconds since the display of the
     * notification after which the notification should automatically close. If
     * <tt>-1</tt>, the notification's expiration time is dependent on the
     * notification server's settings. If <tt>0</tt>, never expires.
     * @return the unique identifier of the sent notification if
     * <tt>replacesId</tt> is <tt>0</tt>; <tt>replacesId</tt> if
     * <tt>replacesId</tt> is not <tt>0</tt>
     * @throws DBusException if sending the notification to the freedesktop.org
     * Desktop Notifications server fails
     */
    public static native long notify(
            long connection,
            String appName,
            long replacesId,
            BufferedImage icon,
            String summary,
            String body,
            int expireTimeout)
        throws DBusException;

    /**
     * Prevents the creation of <tt>GalagoNotification</tt> instances.
     */
    private GalagoNotification()
    {
    }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Nova Acta R. Soc. Scient. upsal. , Ser. 4 8(1. 2): 306 (1932)

#### Original name
Encoeliopsis Nannfeldt, 1932

### Remarks
null