text:
package mat.client.clause.clauseworkspace.view;

import java.util.Map.Entry;
import java.util.Set;
import mat.client.clause.clauseworkspace.model.CellTreeNode;
import mat.client.clause.clauseworkspace.presenter.PopulationWorkSpaceConstants;
import mat.client.clause.clauseworkspace.presenter.XmlTreeDisplay;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.OptionElement;
import com.google.gwt.dom.client.SelectElement;
import com.google.gwt.event.dom.client.ChangeEvent;
import com.google.gwt.event.dom.client.ChangeHandler;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.DomEvent;
import com.google.gwt.event.dom.client.DoubleClickEvent;
import com.google.gwt.event.dom.client.DoubleClickHandler;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
import com.google.gwt.user.client.ui.SuggestBox;
import com.google.gwt.user.client.ui.SuggestOracle.Suggestion;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.xml.client.NamedNodeMap;
import com.google.gwt.xml.client.Node;
import com.google.gwt.xml.client.NodeList;

// TODO: Auto-generated Javadoc
/**
 * The Class SubTreeDialogBox.
 */
public class SubTreeDialogBox {

	/** The is selected. */
	private static boolean isSelected;

	/**
	 * Show SubTree dialog box. (used for Population workspace).
	 *
	 * @param xmlTreeDisplay
	 *            the xml tree display
	 * @param isAdd
	 *            the is add
	 */
	public static void showSubTreeDialogBox(final XmlTreeDisplay xmlTreeDisplay,
			boolean isAdd){
		showSubTreeDialogBox(xmlTreeDisplay, isAdd,false);
	}

	/**
	 * Show SubTree dialog box. (used for Clause workspace)
	 *
	 * @param xmlTreeDisplay the xml tree display
	 * @param isAdd the is add
	 * @param isClauseWorkspace the is clause workspace
	 */
	public static void showSubTreeDialogBox(final XmlTreeDisplay xmlTreeDisplay,
			boolean isAdd, boolean isClauseWorkspace) {
		final DialogBox dialogBox = new DialogBox(false, true);
		dialogBox.setGlassEnabled(true);
		dialogBox.setAnimationEnabled(true);
		setSelected(false);
		dialogBox.setText("Double Click to Select SubTree Element.");
		dialogBox.setTitle("Double Click to Select SubTree Element.");
		dialogBox.getElement().setAttribute("id", "SubTreeDialogBox");
		// Create a table to layout the content
		VerticalPanel dialogContents = new VerticalPanel();
		dialogContents.getElement().setId("dialogContents_VerticalPanel");
		dialogContents.setWidth("20em");
		dialogContents.setHeight("15em");
		dialogContents.setSpacing(8);
		dialogBox.setWidget(dialogContents);

		// Create Search box
		final SuggestBox suggestBox = new SuggestBox(createSuggestOracle());
		suggestBox.getElement().setId("suggestBox_SuggestBox");
		suggestBox.setWidth("18em");
		suggestBox.setText("Search");
		suggestBox.getValueBox().addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				if ("Search".equals(suggestBox.getText())) {
					suggestBox.setText("");
				}
			}
		});

		dialogContents.add(suggestBox);
		dialogContents.setCellHorizontalAlignment(suggestBox,
				HasHorizontalAlignment.ALIGN_CENTER);

		// Create ListBox
		final ListBox listBox = new ListBox();
		listBox.getElement().setId("listBox_ListBox");
		listBox.setWidth("18em");
		listBox.setVisibleItemCount(10);
		String currentSelectedSubTreeuid = xmlTreeDisplay.getSelectedNode()
				.getUUID();

		if(isClauseWorkspace){
			CellTreeNode cellTreeNode = (CellTreeNode) (xmlTreeDisplay
					.getXmlTree().getRootTreeNode().getChildValue(0));
			currentSelectedSubTreeuid = cellTreeNode.getChilds().get(0).getUUID();
		}

		addSubTreeNamesToListBox(listBox, currentSelectedSubTreeuid, isClauseWorkspace);

		// Add listbox to vertical panel and align it in center.
		dialogContents.add(listBox);
		dialogContents.setCellHorizontalAlignment(listBox,
				HasHorizontalAlignment.ALIGN_CENTER);
		// Add a Close button at the bottom of the dialog
		Button closeButton = new Button("Close", new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				dialogBox.hide();
			}
		});
		closeButton.getElement().setId("closeButton_Button");
		Button selectButton = new Button("Select", new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				if(!isSelected()){
					DomEvent.fireNativeEvent(
							Document.get().createDblClickEvent(0, 0, 0, 0, 0,
									false, false, false, false), listBox);
					setSelected(true);
				}
			}
		});
		selectButton.getElement().setId("selectButton_Button");
		HorizontalPanel horizontalButtonPanel = new HorizontalPanel();
		horizontalButtonPanel.setSpacing(5);
		horizontalButtonPanel.add(selectButton);
		horizontalButtonPanel.setCellHorizontalAlignment(selectButton,
				HasHorizontalAlignment.ALIGN_RIGHT);
		horizontalButtonPanel.add(closeButton);
		horizontalButtonPanel.setCellHorizontalAlignment(closeButton,
				HasHorizontalAlignment.ALIGN_RIGHT);

		dialogContents.add(horizontalButtonPanel);
		dialogContents.setCellHorizontalAlignment(horizontalButtonPanel,
				HasHorizontalAlignment.ALIGN_RIGHT);

		addSuggestHandler(suggestBox, listBox);
		addListBoxHandler(listBox, suggestBox, xmlTreeDisplay, dialogBox, isAdd);

		dialogBox.center();
	}

	/**
	 * Adds the list box handler.
	 *
	 * @param listBox
	 *            the list box
	 * @param suggestBox
	 *            the suggest box
	 * @param xmlTreeDisplay
	 *            the xml tree display
	 * @param dialogBox
	 *            the dialog box
	 * @param isAdd
	 *            the is add
	 */
	private static void addListBoxHandler(final ListBox listBox,
			final SuggestBox suggestBox, final XmlTreeDisplay xmlTreeDisplay,
			final DialogBox dialogBox, final boolean isAdd) {
		listBox.addChangeHandler(new ChangeHandler() {
			@Override
			public void onChange(ChangeEvent event) {
				int selectedIndex = listBox.getSelectedIndex();
				String selectedItem = listBox.getItemText(selectedIndex);
				suggestBox.setText(selectedItem);
			}
		});
		listBox.addDoubleClickHandler(new DoubleClickHandler() {
			@Override
			public void onDoubleClick(DoubleClickEvent event) {
				if (listBox.getSelectedIndex() == -1) {
					return;
				}

				if(!isSelected()){
					String value = listBox.getItemText(listBox.getSelectedIndex());
					String uuid = listBox.getValue(listBox.getSelectedIndex());
					if (isAdd) {
						xmlTreeDisplay.addNode(value, value, uuid,
								CellTreeNode.SUBTREE_REF_NODE);
					} else {
						xmlTreeDisplay.editNode(value, value, uuid);
					}
					xmlTreeDisplay.setDirty(true);
					setSelected(true);
				}
				dialogBox.hide();
			}
		});
	}

	/**
	 * Adds the suggest handler.
	 *
	 * @param suggestBox
	 *            the suggest box
	 * @param listBox
	 *            the list box
	 */
	private static void addSuggestHandler(final SuggestBox suggestBox,
			final ListBox listBox) {
		suggestBox.addSelectionHandler(new SelectionHandler<Suggestion>() {

			@Override
			public void onSelection(SelectionEvent<Suggestion> event) {
				String selectedSubTreeName = event.getSelectedItem()
						.getReplacementString();
				for (int i = 0; i < listBox.getItemCount(); i++) {
					if (selectedSubTreeName.equals(listBox.getItemText(i))) {
						listBox.setItemSelected(i, true);
						break;
					}
				}
			}
		});
	}

	/**
	 * Adds the SubTree names to list box.
	 *
	 * @param listBox the list box
	 * @param currentSelectedSubTreeUuid the current selected SubTree uuid
	 * @param isClauseWorkSpace the is clause work space
	 */
	private static void addSubTreeNamesToListBox(ListBox listBox,
			String currentSelectedSubTreeUuid, boolean isClauseWorkSpace) {
		Set<Entry<String, Node>> subTreeLookUpNodes = PopulationWorkSpaceConstants
				.getSubTreeLookUpNode().entrySet();
		for (Entry<String, Node> subTreeLookup : subTreeLookUpNodes) {
			String key = subTreeLookup.getKey();
			String uuid = key.substring(key.lastIndexOf("~") + 1);
			if (uuid.equals(currentSelectedSubTreeUuid) && isClauseWorkSpace) {
				continue;
			}
			if (PopulationWorkSpaceConstants.getSubTreeLookUpName().get(uuid) != null) {
				String item = PopulationWorkSpaceConstants.getSubTreeLookUpName().get(uuid);
				boolean noCycle = true;
				if (isClauseWorkSpace) {
					System.out.println();
					System.out.println();
					System.out.println("checkForCycleConditions for:" + item);
					System.out.println("currentSelectedSubTreeUuid for:" + currentSelectedSubTreeUuid);
					Node node = PopulationWorkSpaceConstants.getSubTreeLookUpNode().get(item + "~" + uuid);
					NamedNodeMap namedNodeMap = node.getAttributes();
					if (namedNodeMap.getNamedItem("instance") != null) { // filter Occurrences of Selected Clause.
						String instanceOfUUID = namedNodeMap.getNamedItem("instanceOf").getNodeValue();
						if (currentSelectedSubTreeUuid.equalsIgnoreCase(instanceOfUUID)) {
							noCycle = false;
						} else {
							noCycle = checkForCycleConditions(item, uuid, currentSelectedSubTreeUuid);
						}
					} else {
						noCycle = checkForCycleConditions(item, uuid, currentSelectedSubTreeUuid);
					}
				}
				if (noCycle) {
					listBox.addItem(item, uuid);
				}
			}
			if (uuid.equals(currentSelectedSubTreeUuid) && !isClauseWorkSpace) {
				listBox.setItemSelected(listBox.getItemCount() - 1, true);
			}
		}
		// Set tooltips for each element in listbox
		SelectElement selectElement = SelectElement.as(listBox.getElement());
		com.google.gwt.dom.client.NodeList<OptionElement> options = selectElement
				.getOptions();
		for (int i = 0; i < options.getLength(); i++) {
			String text = options.getItem(i).getText();
			String title = text;
			OptionElement optionElement = options.getItem(i);
			optionElement.setTitle(title);
		}
	}

	/**
	 * Check for cycle conditions.
	 *
	 * @param subTreeName the sub tree name
	 * @param uuid the uuid
	 * @param currentSelectedSubTreeUuid the current selected sub tree uuid
	 * @return true, if successful
	 */
	private static boolean checkForCycleConditions(String subTreeName, String uuid, String currentSelectedSubTreeUuid) {
		Node node = PopulationWorkSpaceConstants.getSubTreeLookUpNode().get(subTreeName + "~" + uuid);

		return checkForCycleConditions(node,currentSelectedSubTreeUuid);
	}

	/**
	 * Check for cycle conditions.
	 *
	 * @param node the node
	 * @param currentSelectedSubTreeUuid the current selected sub tree uuid
	 * @return true, if successful
	 */
	private static boolean checkForCycleConditions(Node node,
			String currentSelectedSubTreeUuid) {
		System.out.println("node.hasChildNodes():"  + node.hasChildNodes());
		if (node.hasChildNodes()) {
			NodeList childNodeList = node.getChildNodes();
			System.out.println("childNodeList.getLength():"+childNodeList.getLength());
			for(int i=0;i<childNodeList.getLength();i++){
				Node childNode = childNodeList.item(i);
				System.out.println("childNode: node type:"+childNode.getNodeName());
				if("subTreeRef".equals(childNode.getNodeName())){
					String uuid = childNode.getAttributes().getNamedItem("id").getNodeValue();
					String nodeValue = PopulationWorkSpaceConstants.subTreeLookUpName.get(uuid);
					childNode.getAttributes().getNamedItem("displayName").setNodeValue(nodeValue);
					String displayName = childNode.getAttributes().getNamedItem("displayName").getNodeValue();
					System.out.println("subtree name:"+displayName);
					System.out.println("subtree uuid:"+uuid);
					//					String uuid = childNode.getAttributes().getNamedItem("id").getNodeValue();
					Node subTreeNode = PopulationWorkSpaceConstants.getSubTreeLookUpNode().get(displayName + "~" + uuid);
					NamedNodeMap namedNodeMap = subTreeNode.getAttributes();
					if (namedNodeMap.getNamedItem("instance") != null) { // filter Occurrences of Selected Clause.
						String instanceOfUUID = namedNodeMap.getNamedItem("instanceOf").getNodeValue();
						if (currentSelectedSubTreeUuid.equalsIgnoreCase(instanceOfUUID)) {
							return false;
						} else {
							String parentDisplayName = namedNodeMap.getNamedItem("displayName").getNodeValue();
							parentDisplayName = parentDisplayName.replace("Occurrence "
									+ namedNodeMap.getNamedItem("instance").getNodeValue() + " of " , "");
							Node subTreeParentNode = PopulationWorkSpaceConstants.getSubTreeLookUpNode().get(parentDisplayName + "~" + instanceOfUUID);
							boolean isInnerSubTreeCycle = checkForCycleConditions(subTreeParentNode, currentSelectedSubTreeUuid);
							if(!isInnerSubTreeCycle){
								return false;
							}
						}
					} else if(uuid.equals(currentSelectedSubTreeUuid)){
						return false;
					}else{
						Node childSubTreeNode = PopulationWorkSpaceConstants.getSubTreeLookUpNode().get(displayName+"~"+uuid);
						boolean isInnerSubTreeCycle = checkForCycleConditions(childSubTreeNode, currentSelectedSubTreeUuid);
						if(!isInnerSubTreeCycle){
							return false;
						}
					}
				}else{
					boolean isInnerSubTreeCycle = checkForCycleConditions(childNode, currentSelectedSubTreeUuid);
					if(!isInnerSubTreeCycle){
						return false;
					}
				}
			}
		} else {

			NamedNodeMap namedNodeMap = node.getAttributes();
			if (namedNodeMap.getNamedItem("instance") != null) { // filter Occurrences of Selected Clause.
				String instanceOfUUID = namedNodeMap.getNamedItem("instanceOf").getNodeValue();
				if (currentSelectedSubTreeUuid.equalsIgnoreCase(instanceOfUUID)) {
					return false;
				} else {
					String parentDisplayName = namedNodeMap.getNamedItem("displayName").getNodeValue();
					parentDisplayName = parentDisplayName.replace("Occurrence "
							+ namedNodeMap.getNamedItem("instance").getNodeValue() + " of " , "");
					Node subTreeParentNode = PopulationWorkSpaceConstants.getSubTreeLookUpNode().get(parentDisplayName + "~" + instanceOfUUID);
					boolean isInnerSubTreeCycle = checkForCycleConditions(subTreeParentNode, currentSelectedSubTreeUuid);
					if(!isInnerSubTreeCycle){
						return false;
					}
				}
			}
		}
		return true;
	}
	/**
	 * Creates the suggest oracle.
	 *
	 * @return the multi word suggest oracle
	 */
	private static MultiWordSuggestOracle createSuggestOracle() {
		MultiWordSuggestOracle multiWordSuggestOracle = new MultiWordSuggestOracle();
		multiWordSuggestOracle.addAll(PopulationWorkSpaceConstants.getSubTreeLookUpName()
				.values());
		return multiWordSuggestOracle;
	}

	/**
	 * Checks if is selected.
	 *
	 * @return true, if is selected
	 */
	public static boolean isSelected() {
		return isSelected;
	}

	/**
	 * Sets the selected.
	 *
	 * @param isSelected the new selected
	 */
	public static void setSelected(boolean isSelected) {
		SubTreeDialogBox.isSelected = isSelected;
	}

}


text:
@class QBCBlobObjectAccessAnswer;
@class QBCBlob;

@interface QBCBlobAnswer : EntityAnswer {
@protected
	QBCBlob* blob;
    QBCBlobObjectAccessAnswer* blobObjectAccessAnswer;
}

@property (nonatomic, readonly) QBCBlob* blob;
@property (nonatomic, retain) QBCBlobObjectAccessAnswer* blobObjectAccessAnswer;

@end

redpajama_set_name: RedPajamaGithub


text:
'''
===============================================================================
Creator: Christopher Sabater Cordero
Original: Nguyen Ha Dong
Date Started: 12/30/2015
File: Flappy Bird Clone
Notice: (c) Copyright 2015 by Christopher Sabater Cordero  All Rights Reserved.
===============================================================================
'''


text:
namespace Kinetic {
/*!
\ingroup PkgKdsFrameworkOtherConcepts
\cgalConcept

The concept `Kinetic::RootStack` enumerates through roots of a function
contained in a half open interval [lb \f$ \dots\f$ ub).

\sa `CGAL::Kinetic::FunctionKernel`
\sa `CGAL::Kinetic::Certificate`

*/

class RootStack {
public:

/// \name Types
/// @{

/*!
The root of a function.
*/
typedef unspecified_type Root;

/*!
The traits class for this concept.
*/
typedef unspecified_type Traits;

/// @}

/// \name Creation
/// @{

/*!
default constructor.
*/
RootStack();

/*!
Construct a `Kinetic::RootStack` over the roots of `f` in the half open interval [`lb` to `ub`).
*/
RootStack(Function f, Root lb, Root ub, Traits tr);

/// @}

/// \name Operations
/// @{

/*!
Advance to the next root. As a precondition, empty() must be false.
*/
void pop();

/*!
Return the current root. As a precondition, empty() must be false. Note that the `Root` returned might not actually be in the interval (since the solver has not yet proved that there are no more roots).
*/
Root top();

/*!
Return true if there are known to be no more roots left. There might not actually be any roots of the polynomial left in the interval, but the work necessary to prove this has been delayed.
*/
bool empty();

/// @}

}; /* end Kinetic::RootStack */

} /* end namespace KineticConcepts */


text:
from google.appengine.api import mail
import webapp2

class cronSendMail(webapp2.RequestHandler):
    def get(self):
        user_address = "jceforrexapp@gmail.com"
        senderadress = "aviram1202@gmail.com"
        name = "yaacov the king"
        comment = "temani is work"
       #mail.send_mail(senderadress, senderadress, "name: " + name + " mail: " + user_address , comment)

app = webapp2.WSGIApplication([
    ('/cron', cronSendMail)
],debug=True)


text:
[comment]: # (@@author A0124333U)
# User Guide

* [Quick Start](#quick-start)
* [Features](#features)
* [FAQ](#faq)
* [Support Date Format](#supported-date-formats)
* [Command Summary](#command-summary)

## Quick Start

1. Ensure you have Java version `1.8.0_60` or later installed in your Computer.
   > Having any Java 8 version is not enough.
   This app will not work with earlier versions of Java 8.

   Click [here](http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html) to download the latest Java version.

2. Download the latest `tars.jar` from the '[releases](https://github.com/CS2103AUG2016-F10-C1/main/releases)' tab.
3. Copy the file to the folder you want to use as the home folder for your TARS App.
4. Double-click the file to start the app. The GUI should appear in a few seconds.
5. Type the command in the command box and press Enter to execute it.
   e.g. typing **`help`** and pressing Enter will open the help window.
6. Some example commands you can try:
   * **`ls`** : lists all tasks
   * **`add`**` Complete CS2103 Quiz 3 /dt 23/09/2016 /p h /t Quiz /t CS2103` :
     adds a task `Complete CS2103 Quiz 3` to TARS.
   * **`del`**` 3` : deletes the 3rd task shown in TARS.
   * **`exit`** : exits the app
7. Refer to the [Features](#features) section below for details of each command.
8. Note
	- All text in `< >` are required fields whereas those in `[ ]` are optional.
	- `<INDEX>` refers to the index number of a task shown in the task list.
	- The index **must be a positive integer** 1, 2, 3, ...
	- Priority options are: `h` for High, `m` for Medium, `l` for Low.

## Features

#### Adding a task : `add`
Adds a task to TARS
Format: `<TASK_NAME> [/dt DATETIME] [/p PRIORITY] [/t TAG_NAME ...] [/r NUM_TIMES FREQUENCY]`

> Support for events (i.e., has a start time and end time),  deadlines (tasks that have to be done before a specific deadline),  and floating tasks (tasks without specific times).
>
> Parameters can be in any order.

Examples:
* `add Meet John Doe /dt 26/09/2016 0900 to 26/09/2016 1030 /t catchup`
* `add Complete CS2103 Quiz /dt 23/09/2016 /p h /t Quiz /t CS2103, /r 13 EVERY WEEK`
* `add Floating Task`

[comment]: # (@@author A0124333U)
#### Changing data storage location : `cd`
Changes the directory of the TARS storage file.
Format: `cd <FILE_PATH>`

> Returns an error if the directory chosen is invalid.
>
> `<FILE_PATH>` must end with the file type extension, `.xml`

Examples:
* `cd C:\Users\John_Doe\Documents\tars.xml`

#### Clearing the data storage file : `clear`
Clears the whole To-Do List storage file.
Format: `clear`

[comment]: # (@@author A0124333U)
#### Confirming a reserved timeslot : `confirm`
Confirms a dateTime for a reserved task and adds it to the task list.
Format: `confirm <RSV_TASK_INDEX> <DATETIME_INDEX> [/p PRIORITY] [/t TAG_NAME ...]`

> Confirm the task of a specific `<RSV_TASK_INDEX>` at a dateTime of a specific `<DATETIME_INDEX>`.
>
> The `<RSV_TASK_INDEX>` refers to the index number shown in the reserved task list.
>
> The `<DATETIME_INDEX>` refers to the index number of the dateTime.

Examples:
* `confirm 3 2 /p l /t Tag`

[comment]: # (@@author A0121533W)
#### Deleting a task : `del`
Deletes the task based on its index in the task list.
Formats:
* `del <INDEX> [INDEX ...]`
* `del <START_INDEX>..<END_INDEX>`

> Deletes the task at the specific `<INDEX>`.
>
> Start index of range must be before end index.

Examples:
* `del 3 6`
* `del 1..3`

[comment]: # (@@author A0121533W)
#### Marking tasks as done : `do`
Marks the task based on its index in the task list as done.
Format: `do <INDEX> [INDEX ...]`
Format: `do <START_INDEX>..<END_INDEX>`

> Marks the task at the specific `<INDEX>` as `done`.
>
> Start index of range must be before end index.

Examples:
* `do 2 4 6`
* `do 1..3`

[comment]: # (@@author A0121533W)
#### Editing a task : `edit`
Edits any component of a particular task.
Format: `edit <INDEX> [/n TASK_NAME] [/dt DATETIME] [/p PRIORITY] [/ta TAG_TO_ADD ...] [/tr TAG_TO_REMOVE ...]`

> Edits the task at the specific `<INDEX>`.
>
> `/ta` adds a tag to the task.
>
> `/tr` removes a tag from the task.
>
> Parameters can be in any order.

Examples:
* `edit 3 /n Meet John Tan /dt 08/10/2016 1000 to 1200 /p h /ta friend`

#### Exiting the program : `exit`
Exits the program.
Format: `exit`

[comment]: # (@@author A0124333U)
#### Finding tasks : `find`
Finds all tasks containing a list of keywords (i.e. AND search).
Two modes: Quick Search & Filter Search.
Format:
* [Quick Search]: `find <KEYWORD> [KEYWORD ...]`
* [Filter Search]: `find [/n NAME_KEYWORD ...] [/dt DATETIME] [/p PRIORITY] [/do] [/ud] [/t TAG_KEYWORD ...]`

> **Quick Search Mode**: Find tasks quickly by entering keywords that match what is displayed in the task list.
>
> **Filter Search Mode**: Find tasks using task filters (i.e. /n, /p, /dt, /do, /ud, /t).
>
> Use /n to filter tasks by task name.
>
> Use /p to filter tasks by priority level.
>
> Use /dt to filter tasks by date (in a date range).
>
> Use /do to filter all done tasks (Cannot be used together with /ud).
>
> Use /ud to filter all undone tasks (Cannot be used together with /do).
>
> Use /t to filter tasks by tags.
>
> `<KEYWORD>` are **case-insensitive**.
>
> Parameters can be in any order.

Examples:
* `find meet John` uses Quick Search and returns all tasks containing BOTH the keywords "meet" and "John" (e.g. meet John Doe)
* `find /n meet /dt 17/10/2016 1300 to 18/10/2016 1400` uses Filter Search and returns all tasks whose name contains "meet" and whose task date falls within the range "17/10/2016 1300 to 18/10/2016 1400" (e.g. meet Tim for dinner, 17/10/2016 1800 to 17/10/2016 1900)

[comment]: # (@@author A0124333U)
#### Suggesting free timeslots : `free`
Suggests free timeslots in a specified day.
Format: `free <DATETIME>`

> Does not check for tasks without dateTime nor tasks without a start dateTime.

Examples:
* `free next tuesdsay`
* `free 26/10/2016`

[comment]: # (@@author A0140022H)
#### Displaying a list of available commands : `help`
Shows program usage instructions in help panel.
Format: `help [COMMAND_WORD]`

> Help is also shown if you enter an incorrect command e.g. `abcd`.

Examples:
* `help add`
* `help summary`

[comment]: # (@@author A0140022H)
#### Listing tasks : `ls`
Lists all tasks.
Format:
* `ls`
* `ls /dt [dsc]`
* `ls /p [dsc]`

> All tasks listed by default.
>
> Use /dt to list all tasks by earliest end dateTime.
>
> Use /p to list all task by priority from low to high.
>
> Use dsc with previous two prefixes to reverse the order.

Examples:
* `ls`
* `ls /dt`
* `ls /dt dsc`
* `ls /p`
* `ls /p dsc`

[comment]: # (@@author A0139924W)
#### Redoing a command : `redo`
Redo a previous command
Format: `redo`

> Able to redo all `add`, `delete`, `edit`, `tag`, `rsv`, `confirm` and `del` commands from the time the app starts running.
>
> Keyboard shortcut: CTRL-Y

[comment]: # (@@author A0124333U)
#### Reserving timeslots for a task : `rsv`
Reserves one or more timeslot for a task
Format: `rsv <TASK_NAME> </dt DATETIME> [/dt DATETIME ...]`

> Multiple dateTimes can be added.

Examples:
* `rsv Meet John Doe /dt 26/09/2016 0900 to 1030 /dt 28/09/2016 1000 to 1130`

[comment]: # (@@author A0124333U)
#### Deleting a task with reserved timeslots : `rsv /del`
Deletes a task with all its reserved time slots
Format: `rsv /del <INDEX>`
Format: `rsv /del <START_INDEX>..<END_INDEX>`

> Deletes the task at the specific `<INDEX>`.
>
> Start index of range must be before end index.

Examples:
* `rsv /del 5`
* `rsv /del 1..4`

[comment]: # (@@author A0139924W)
#### Editing a tag's name : `tag /e`
Edits a tag's name
Format: `tag /e <INDEX> <TAG_NAME>`

> Edits the name of the tag at the specific `<INDEX>`.

Examples:
* `tag /e 5 Assignment`

[comment]: # (@@author A0139924W)
#### Deleting a tag : `tag /del`
Deletes a particular tag
Format: `tag /del <INDEX>`

> Deletes the tag at the specific `<INDEX>`.

Examples:
* `tag /del 4` deletes the tag at Index 4

[comment]: # (@@author A0139924W)
#### Listing all tags : `tag /ls`
Lists all tags in TARS
Format: `tag /ls`

[comment]: # (@@author A0121533W)
#### Marking tasks as undone : `ud`
Marks the task based on its index in the task list as undone.
Format: `ud <INDEX> [INDEX ...]`
Format: `ud <START_INDEX>..<END_INDEX>`

> Marks the task at the specific `<INDEX>` as `undone`.
>
> Start index of range must be before end index.

Examples:
* `ud 2 4 6`
* `ud 1..3`

[comment]: # (@@author A0139924W)
#### Undoing a command : `undo`
Undo a command executed by the user.
Format: `undo`

> Able to undo all `add`, `delete`, `edit`, `tag`, `rsv`, `confirm` and `del` commands from the time the app starts running.
>
> Keyboard shortcut: CTRL-Z

#### Saving the data
TARS data are saved in the hard disk automatically after any command that changes the data.
There is no need to save manually.

## FAQ

**Q**: How do I transfer my data to another Computer?
**A**: Install the app in the other computer and overwrite the empty data file it creates with
       the file that contains the data of your previous TARS app.

[comment]: # (@@author A0139924W)
## Supported Date Formats
#### formal dates
Formal dates are those in which the day, month, and year are represented as integers separated by a common separator character. The year is optional and may precede the month or succeed the day of month. If a two-digit year is given, it must succeed the day of month.

Examples:
* `28-01-2016`
* `28/01/2016`
* `1/02/2016`
* `2/2/16`

#### relaxed dates
Relaxed dates are those in which the month, day of week, day of month, and year may be given in a loose, non-standard manner, with most parts being optional.

Examples:
* `The 31st of April in the year 2008`
* `Fri, 21 Nov 1997`
* `Jan 21, '97`
* `Sun, Nov 21`
* `jan 1st`
* `february twenty-eighth`

#### relative dates
Relative dates are those that are relative to the current date.

Examples:
* `next thursday`
* `last wednesday`
* `today`
* `tomorrow`
* `yesterday`
* `next week`
* `next month`
* `next year`
* `3 days from now`
* `three weeks ago`

#### prefixes
Most of the above date formats may be prefixed with a modifier.

Examples:
`day after`
`the day before`
`the monday after`
`the monday before`
`2 fridays before`
`4 tuesdays after`

#### time
The above date formats may be prefixed or suffixed with time information.

Examples:
* `0600h`
* `06:00 hours`
* `6pm`
* `5:30 a.m.`
* `5`
* `12:59`
* `23:59`
* `8p`
* `noon`
* `afternoon`
* `midnight`

#### relative times

Examples:
* `10 seconds ago`
* `in 5 minutes`
* `4 minutes from now`

[comment]: # (@@author A0124333U)
## Command Summary

Command | Format
-------- | :--------
[Add](#adding-a-task--add)| `add <TASK_NAME> [/dt DATETIME] [/p PRIORITY] [/t TAG_NAME ...] [/r NUM_TIMES FREQUENCY]`
[Change Storage Location](#changing-data-storage-location--cd) | `cd <FILE_PATH.xml>`
[Clear](#clearing-the-data-storage-file--clear) | `clear`
[Confirm](#confirming-a-reserved-timeslot--confirm) | `confirm <RSV_TASK_INDEX> <DATETIME_INDEX> [/p PRIORITY] [/t TAG_NAME ...]`
[Delete](#deleting-a-task--del) | `del <INDEX> [INDEX ...]`
 `del <START_INDEX>..<END_INDEX>`
[Done](#marking-tasks-as-done--do) | `do <INDEX> [INDEX ...]`
 `do <START_INDEX>..<END_INDEX>`
[Edit](#editing-a-task--edit) | `edit <INDEX> [/n TASK_NAME] [/dt DATETIME] [/p PRIORITY] [/ta TAG_TO_ADD ...] [/tr TAG_TO_REMOVE ...]`
[Exit](#exiting-the-program--exit) | `exit`
[Find [Quick Search]](#finding-tasks--find) | `find <KEYWORD> [KEYWORD ...]`
[Find [Filter Search]](#finding-tasks--find) | `find [/n NAME_KEYWORD ...] [/dt DATETIME] [/p PRIORITY] [/do] [/ud] [/t TAG_KEYWORD ...]`
[Free](#suggesting-free-timeslots--free) | `free <DATETIME>`
[Help](#displaying-a-list-of-available-commands--help) | `help [COMMAND_WORD]`
[List](#listing-tasks--ls) | `ls`
[List [Date]](#listing-tasks--ls) | `ls /dt`
[List [Priority]](#listing-tasks--ls) | `ls /p`
[Redo](#redoing-a-command--redo) | `redo`
[Reserve](#reserving-timeslots-for-a-task--rsv) | `rsv <TASK_NAME> </dt DATETIME> [/dt DATETIME ...]`
[Reserve [Delete]](#deleting-a-task-with-reserved-timeslots--rsv-del) | `rsv /del <INDEX>`
 `rsv /del <START_INDEX>..<END_INDEX>`
[Tag [Delete]](#deleting-a-tag--tag-del) | `tag /del <INDEX>`
[Tag [Edit]](#editing-a-tags-name--tag-e) | `tag /e <INDEX> <TAG_NAME>`
[Tag [List]](#listing-all-tags--tag-ls) | `tag /ls`
[Undone](#marking-tasks-as-undone--ud) | `ud <INDEX> [INDEX ...]`
 `ud <START_INDEX>..<END_INDEX>`
[Undo](#undoing-a-command--undo) | `undo`


text:
using namespace ncv::common;

Nan::Persistent<FunctionTemplate> Range::constructor;

void Range::Init(Local<Object> target) {
  Nan::HandleScope scope;

  // Constructor
  Local<FunctionTemplate> ctor = Nan::New<FunctionTemplate>(New);
  constructor.Reset(ctor);

  ctor->SetClassName(Nan::New("Range").ToLocalChecked());

  // Instance
  Local<ObjectTemplate> inst = ctor->InstanceTemplate();
  inst->SetInternalFieldCount(1);
  Nan::SetAccessor(inst, Nan::New<String>(OBJECT_KEY_X).ToLocalChecked(), Getter, Setter);
  Nan::SetAccessor(inst, Nan::New<String>(OBJECT_KEY_Y).ToLocalChecked(), Getter, Setter);

  // Prototype Methods
  Nan::SetPrototypeMethod(ctor, "size", Size);
  Nan::SetPrototypeMethod(ctor, "isEmpty", IsEmpty);

  Nan::SetPrototypeMethod(ctor, "isAll", IsAll);

  Nan::SetMethod(ctor, "all", All);

  Nan::Set(target, Nan::New("Range").ToLocalChecked(), ctor->GetFunction());
}

NAN_METHOD(Range::New) {
  Nan::HandleScope scope;

  if (!info.IsConstructCall()) {
    return Nan::ThrowTypeError(ERROR_MUST_USE_NEW);
  }

  SETUP_ARGC_AND_ARGV;

  cv::Range range;
  try {
    range = RawRange(argc, argv);
  } catch (const char* msg) {
    delete[] argv;
    return Nan::ThrowTypeError(msg);
  }
  delete[] argv;

  Range* pt = new Range();
  pt->range = range;
  pt->Wrap(info.This());

  info.GetReturnValue().Set(info.This());
}

NEW_INSTANCE_DEF(Range)

Local<Object> Range::NewInstance(cv::Range const &range) {
  Nan::EscapableHandleScope scope;

  UNWRAP_NEW_INSTANCE(Range, r);
  r->range = range;

  return scope.Escape(inst);
}

Local<Object> Range::NewInstance(int const &start, int const &end) {
  Nan::EscapableHandleScope scope;

  UNWRAP_NEW_INSTANCE(Range, r);
  r->range.start = start;
  r->range.end = end;

  return scope.Escape(inst);
}

HAS_INSTANCE_DEF(Range)

cv::Range Range::RawRange(int const &argc, Local<Value>* const argv) {
  Nan::HandleScope scope;

  if (argc == 0) {
    return cv::Range();
  }

  if (argc == 1) {
    if (HasInstance(argv[0])) {
      Range *r = UNWRAP_OBJECT(Range, argv[0]->ToObject());
      return r->range;
    }

    if (argv[0]->IsArray()) {
      Local<Array> rangeLike = Local<Array>::Cast(argv[0]->ToObject());

      if (rangeLike->Length() != 2) {
        throw "RangeLike array must have 2 elements";
      }

      Local<Value> objValue_x = Nan::Get(rangeLike, 0).ToLocalChecked();
      Local<Value> objValue_y = Nan::Get(rangeLike, 1).ToLocalChecked();

      if (!objValue_x->IsNumber() || !objValue_y->IsNumber()) {
        throw "RangeLike array elements must be numbers";
      }

      return cv::Range(objValue_x->Int32Value(), objValue_y->Int32Value());
    }

    if (argv[0]->IsObject()) {
      Local<Object> rangeLike = argv[0]->ToObject();

      Local<String> objKey_s = Nan::New<String>(OBJECT_KEY_START).ToLocalChecked();
      Local<String> objKey_e = Nan::New<String>(OBJECT_KEY_END).ToLocalChecked();

      if (!Nan::HasOwnProperty(rangeLike, objKey_s).FromJust() || !Nan::HasOwnProperty(rangeLike, objKey_e).FromJust()) {
        throw "RangeLike object must have properties \"start\" and \"end\"";
      }

      Local<Value> objValue_s = Nan::Get(rangeLike, objKey_s).ToLocalChecked();
      Local<Value> objValue_e = Nan::Get(rangeLike, objKey_e).ToLocalChecked();

      if (!objValue_s->IsNumber() || !objValue_e->IsNumber()) {
        throw "RangeLike object properties must be numbers";
      }

      return cv::Range(objValue_s->Int32Value(), objValue_e->Int32Value());
    }

    throw ERROR_INVALID_ARGUMENTS;
  }

  if (argc == 2) {
    if (!argv[0]->IsNumber() || !argv[1]->IsNumber()) {
      throw ERROR_INVALID_ARGUMENTS;
    }

    return cv::Range(argv[0]->Int32Value(), argv[1]->Int32Value());
  }

  throw cv::format("Expected 0-2 arguments, but got %d", argc).c_str();
}

NAN_GETTER(Range::Getter) {
  SETUP_FUNCTION(Range);

  std::string name = *Nan::Utf8String(property);
  if (name == OBJECT_KEY_START) {
    info.GetReturnValue().Set(Nan::New<Number>(self->range.start));
  } else if (name == OBJECT_KEY_END) {
    info.GetReturnValue().Set(Nan::New<Number>(self->range.end));
  }
}

NAN_SETTER(Range::Setter) {
  SETUP_FUNCTION(Range);

  if (!value->IsNumber()) {
    return Nan::ThrowTypeError("value must be a number");
  }

  std::string name = *Nan::Utf8String(property);
  if (name == OBJECT_KEY_START) {
    self->range.start = value->Int32Value();
  } else if (name == OBJECT_KEY_END) {
    self->range.end = value->Int32Value();
  }
}

NAN_METHOD(Range::IsEmpty) {
  SETUP_FUNCTION(Range);

  info.GetReturnValue().Set(Nan::New<Boolean>(self->range.empty()));
}

NAN_METHOD(Range::Size) {
  SETUP_FUNCTION(Range);

  info.GetReturnValue().Set(Nan::New<Number>(self->range.size()));
}

NAN_METHOD(Range::All) {
  Nan::HandleScope scope;

  UNWRAP_NEW_INSTANCE(Range, r);
  r->range = cv::Range::all();

  info.GetReturnValue().Set(inst);
}

NAN_METHOD(Range::IsAll) {
  SETUP_FUNCTION(Range);

  info.GetReturnValue().Set(Nan::New<Boolean>(self->range == cv::Range::all()));
}


text:
<archimate:Product
    xmlns:archimate="http://www.archimatetool.com/archimate"
    name="BPM Online"
    id="id-13743f70f69e46d28cdafd0ace2bab78"/>


text:
<!DOCTYPE HTML>

                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />

                <meta name="description" content="Welp suggests food"/>

                <meta name="keywords" content="Welp,recommendation,food,review,friend,restaurant,search,meh,pointless">

                <meta name="viewport" content="width=1020">

    <meta name="application-name" content="Welp">

    <meta name="msapplication-TileImage" content="http://s3-media3.fl.welpcdn.com/assets/2/www/img/7f906850f02b/ico/win8-tile.png">
    <meta name="msapplication-TileColor" content="#bla169">

    <meta name="msapplication-starturl" content="http://www.welp.com/">
    <meta name="msapplication-navbutton-color" content="#bla169">
    <meta name="msapplication-window" content="width=1024;height=768">
    <meta name="msapplication-tooltip" content="Go to Welp">

                <link rel="shortcut icon" href="http://s3-media2.fl.welpcdn.com/assets/2/www/img/118ff475a341/ico/favicon.ico">

                <link rel="search" type="application/opensearchdescription+xml" href="/opensearch" title="Welp" />

<link rel="stylesheet" type="text/css" media="all" href="http://ke11i.webs.com/welp/welpmain.css">

            <title>welp</title>

            welp

welp CITYHERE

elsewhere

faraway

even farther away

you don't really travel

just stay in your room

                                1.     Gio's Baguettes & More

            95 reviews

        $

                Sandwiches,         Bakeries,         Cafes

Fabulous croissants! If you have ever had croissants from the grocery store or an ordinary bakery, you have not had croissants. These are flaky, buttery deliciousness. Can't wait to try other…

welp digest

review not about food

                        morgan or something

reviewed     a pottery place

                "i mean they had cool pots and stuff."

 - morgan or something

food events

                        thing at a place

                    yesterday at 12:00pm

            19-32 ppl are interested

                        don't go to events

                    never at 4:00pm

            someone used to be interested

                        this one isn't even about food

                    wednesday 4:80pm

            no one is interested

not food

        this isn't food

            <q>
                i guess it's kind of vaguely food-like though
            </q>

        maybe food

            <q>
                just kidding it's not actually food
            </q>

        inedible food thing

            <q>
                it's a rock
            </q>

not food

       definitely not food

            absolutely not food

                9 minutes ago

        only sometimes food

            but probably not right now

                20 minutes ago

       not food

            not not not food

                3 hours ago

            more not food


text:
(C) Copyright 2014 William Dyce

All rights reserved. This program and the accompanying materials
are made available under the terms of the GNU Lesser General Public License
(LGPL) version 2.1 which accompanies this distribution, and is available at
http://www.gnu.org/licenses/lgpl-2.1.html

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
--]]

local state = gamestate.new()

local t = nil
local entering = nil
local desires_leave = false
local finished_in = false

--[[------------------------------------------------------------
Gamestate navigation
--]]--

function state:init()
end

function state:enter()
	entering = 0
	desires_leave = false
	finished_in = false
end

function state:leave()
	SHADOW_CANVAS:clear()
end

--[[------------------------------------------------------------
Callbacks
--]]--

function state:keypressed(key, uni)
  if key=="escape" then
  	desires_leave = true
  end
end

function state:mousepressed(x, y, button)
  desires_leave = true
end

function state:update(dt)

	if not finished_in then
		entering = math.min(1, entering + 0.5*dt)
		if entering >= 1 then
			finished_in = true
		end
	elseif desires_leave then
		entering = entering - dt
		if entering <= 0 then
			gamestate.switch(title)
		end
	end
end

function state:draw()
	WORLD_CANVAS:clear()

	-- mouse
	love.graphics.setColor(200, 200, 255)
	useful.pushCanvas(UI_CANVAS)
		local mx, my = love.mouse.getPosition()
		love.graphics.polygon("fill", mx - 4, my, mx, my - 4, mx + 4, my, mx, my + 4)
		love.graphics.setBlendMode("subtractive")
			love.graphics.polygon("fill", mx - 2, my, mx, my - 2, mx + 2, my, mx, my + 2)
		love.graphics.setBlendMode("alpha")
	useful.popCanvas()
	useful.bindWhite()

	love.graphics.setColor(200, 200, 255)

		love.graphics.setFont(FONT_MEDIUM)
		local y

		-- title
		y = useful.lerp(-0.3*WORLD_H, WORLD_H*0.3, entering)
		love.graphics.printf("And so was the light of Mankind",
			0, y, WORLD_W, "center")

		-- credits
		y = useful.lerp(WORLD_H, WORLD_H*0.6, entering)
		love.graphics.setFont(FONT_BIG)
		love.graphics.printf("forever extinguished",
			0, y, WORLD_W, "center")

		love.graphics.setFont(FONT_SMALL)
	useful.bindWhite()
end

--[[------------------------------------------------------------
EXPORT
--]]------------------------------------------------------------

return state


text:
/* vi: set sw=4 ts=4: */
/*
 * ext2fs.h --- ext2fs
 *
 * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o.
 *
 * %Begin-Header%
 * This file may be redistributed under the terms of the GNU Public
 * License.
 * %End-Header%
 */

#include "ext2fs.h"
#include "bitops.h"
#include <string.h>

/*
 *  Allocate memory
 */
errcode_t ext2fs_get_mem(unsigned long size, void *ptr)
{
	void **pp = (void **)ptr;

	*pp = malloc(size);
	if (!*pp)
		return EXT2_ET_NO_MEMORY;
	return 0;
}

/*
 * Free memory
 */
errcode_t ext2fs_free_mem(void *ptr)
{
	void **pp = (void **)ptr;

	free(*pp);
	*pp = 0;
	return 0;
}

/*
 *  Resize memory
 */
errcode_t ext2fs_resize_mem(unsigned long EXT2FS_ATTR((unused)) old_size,
				     unsigned long size, void *ptr)
{
	void *p;

	/* Use "memcpy" for pointer assignments here to avoid problems
	 * with C99 strict type aliasing rules. */
	memcpy(&p, ptr, sizeof (p));
	p = realloc(p, size);
	if (!p)
		return EXT2_ET_NO_MEMORY;
	memcpy(ptr, &p, sizeof (p));
	return 0;
}

/*
 * Mark a filesystem superblock as dirty
 */
void ext2fs_mark_super_dirty(ext2_filsys fs)
{
	fs->flags |= EXT2_FLAG_DIRTY | EXT2_FLAG_CHANGED;
}

/*
 * Mark a filesystem as changed
 */
void ext2fs_mark_changed(ext2_filsys fs)
{
	fs->flags |= EXT2_FLAG_CHANGED;
}

/*
 * Check to see if a filesystem has changed
 */
int ext2fs_test_changed(ext2_filsys fs)
{
	return (fs->flags & EXT2_FLAG_CHANGED);
}

/*
 * Mark a filesystem as valid
 */
void ext2fs_mark_valid(ext2_filsys fs)
{
	fs->flags |= EXT2_FLAG_VALID;
}

/*
 * Mark a filesystem as NOT valid
 */
void ext2fs_unmark_valid(ext2_filsys fs)
{
	fs->flags &= ~EXT2_FLAG_VALID;
}

/*
 * Check to see if a filesystem is valid
 */
int ext2fs_test_valid(ext2_filsys fs)
{
	return (fs->flags & EXT2_FLAG_VALID);
}

/*
 * Mark the inode bitmap as dirty
 */
void ext2fs_mark_ib_dirty(ext2_filsys fs)
{
	fs->flags |= EXT2_FLAG_IB_DIRTY | EXT2_FLAG_CHANGED;
}

/*
 * Mark the block bitmap as dirty
 */
void ext2fs_mark_bb_dirty(ext2_filsys fs)
{
	fs->flags |= EXT2_FLAG_BB_DIRTY | EXT2_FLAG_CHANGED;
}

/*
 * Check to see if a filesystem's inode bitmap is dirty
 */
int ext2fs_test_ib_dirty(ext2_filsys fs)
{
	return (fs->flags & EXT2_FLAG_IB_DIRTY);
}

/*
 * Check to see if a filesystem's block bitmap is dirty
 */
int ext2fs_test_bb_dirty(ext2_filsys fs)
{
	return (fs->flags & EXT2_FLAG_BB_DIRTY);
}

/*
 * Return the group # of a block
 */
int ext2fs_group_of_blk(ext2_filsys fs, blk_t blk)
{
	return (blk - fs->super->s_first_data_block) /
		fs->super->s_blocks_per_group;
}

/*
 * Return the group # of an inode number
 */
int ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino)
{
	return (ino - 1) / fs->super->s_inodes_per_group;
}

blk_t ext2fs_inode_data_blocks(ext2_filsys fs,
					struct ext2_inode *inode)
{
       return inode->i_blocks -
	      (inode->i_file_acl ? fs->blocksize >> 9 : 0);
}

__u16 ext2fs_swab16(__u16 val)
{
	return (val >> 8) | (val << 8);
}

__u32 ext2fs_swab32(__u32 val)
{
	return ((val>>24) | ((val>>8)&0xFF00) |
		((val<<8)&0xFF0000) | (val<<24));
}

int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
					blk_t bitno);

int ext2fs_test_generic_bitmap(ext2fs_generic_bitmap bitmap,
					blk_t bitno)
{
	if ((bitno < bitmap->start) || (bitno > bitmap->end)) {
		ext2fs_warn_bitmap2(bitmap, EXT2FS_TEST_ERROR, bitno);
		return 0;
	}
	return ext2fs_test_bit(bitno - bitmap->start, bitmap->bitmap);
}

int ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap,
				       blk_t block)
{
	return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap)
				       bitmap,
					  block);
}

int ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
					 blk_t block)
{
	return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
					    block);
}

int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,
				       blk_t block)
{
	return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
					  block);
}

int ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
				       ext2_ino_t inode)
{
	return ext2fs_mark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
					  inode);
}

int ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
					 ext2_ino_t inode)
{
	return ext2fs_unmark_generic_bitmap((ext2fs_generic_bitmap) bitmap,
				     inode);
}

int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
				       ext2_ino_t inode)
{
	return ext2fs_test_generic_bitmap((ext2fs_generic_bitmap) bitmap,
					  inode);
}

void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap,
					    blk_t block)
{
	ext2fs_set_bit(block - bitmap->start, bitmap->bitmap);
}

void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
					      blk_t block)
{
	ext2fs_clear_bit(block - bitmap->start, bitmap->bitmap);
}

int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap,
					    blk_t block)
{
	return ext2fs_test_bit(block - bitmap->start, bitmap->bitmap);
}

void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
					    ext2_ino_t inode)
{
	ext2fs_set_bit(inode - bitmap->start, bitmap->bitmap);
}

void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
					      ext2_ino_t inode)
{
	ext2fs_clear_bit(inode - bitmap->start, bitmap->bitmap);
}

int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
					   ext2_ino_t inode)
{
	return ext2fs_test_bit(inode - bitmap->start, bitmap->bitmap);
}

blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap)
{
	return bitmap->start;
}

ext2_ino_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap)
{
	return bitmap->start;
}

blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap)
{
	return bitmap->end;
}

ext2_ino_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap)
{
	return bitmap->end;
}

int ext2fs_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
					    blk_t block, int num)
{
	int	i;

	if ((block < bitmap->start) || (block+num-1 > bitmap->end)) {
		ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_TEST,
				   block, bitmap->description);
		return 0;
	}
	for (i=0; i < num; i++) {
		if (ext2fs_fast_test_block_bitmap(bitmap, block+i))
			return 0;
	}
	return 1;
}

int ext2fs_fast_test_block_bitmap_range(ext2fs_block_bitmap bitmap,
						 blk_t block, int num)
{
	int	i;

	for (i=0; i < num; i++) {
		if (ext2fs_fast_test_block_bitmap(bitmap, block+i))
			return 0;
	}
	return 1;
}

void ext2fs_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
					     blk_t block, int num)
{
	int	i;

	if ((block < bitmap->start) || (block+num-1 > bitmap->end)) {
		ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_MARK, block,
				   bitmap->description);
		return;
	}
	for (i=0; i < num; i++)
		ext2fs_set_bit(block + i - bitmap->start, bitmap->bitmap);
}

void ext2fs_fast_mark_block_bitmap_range(ext2fs_block_bitmap bitmap,
						  blk_t block, int num)
{
	int	i;

	for (i=0; i < num; i++)
		ext2fs_set_bit(block + i - bitmap->start, bitmap->bitmap);
}

void ext2fs_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
					       blk_t block, int num)
{
	int	i;

	if ((block < bitmap->start) || (block+num-1 > bitmap->end)) {
		ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_UNMARK, block,
				   bitmap->description);
		return;
	}
	for (i=0; i < num; i++)
		ext2fs_clear_bit(block + i - bitmap->start, bitmap->bitmap);
}

void ext2fs_fast_unmark_block_bitmap_range(ext2fs_block_bitmap bitmap,
						    blk_t block, int num)
{
	int	i;
	for (i=0; i < num; i++)
		ext2fs_clear_bit(block + i - bitmap->start, bitmap->bitmap);
}


text:
<?php
$this->breadcrumbs=array(
    Yii::t('main', 'List Flash Ads')=>array('admin'),
    Yii::t('main', 'Create'),
);

$this->menu=array(
	array('label'=>Yii::t('main', 'Manage Flash Ads'), 'icon'=>'cog','url'=>array('admin')),
);
?>

<?php echo $this->renderPartial('_form', array('model'=>$model)); ?>


text:
/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86str.h,v 1.97 2003/10/30 17:36:56 tsi Exp $ */

/*
 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * Except as contained in this notice, the name of the copyright holder(s)
 * and author(s) shall not be used in advertising or otherwise to promote
 * the sale, use or other dealings in this Software without prior written
 * authorization from the copyright holder(s) and author(s).
 */

/*
 * This file contains definitions of the public XFree86 data structures/types.
 * Any data structures that video drivers need to access should go here.
 */

#ifndef _XF86STR_H
#define _XF86STR_H

#include "misc.h"
#include "input.h"
#include "scrnintstr.h"
#include "pixmapstr.h"
#include "colormapst.h"
#include "xf86Module.h"
#include "xf86Opt.h"
#include "xf86Pci.h"

/*
 * memType is of the size of the addressable memory (machine size)
 * usually unsigned long.
 */
typedef unsigned long memType;

/* Video mode flags */

typedef enum {
    V_PHSYNC	= 0x0001,
    V_NHSYNC	= 0x0002,
    V_PVSYNC	= 0x0004,
    V_NVSYNC	= 0x0008,
    V_INTERLACE	= 0x0010,
    V_DBLSCAN	= 0x0020,
    V_CSYNC	= 0x0040,
    V_PCSYNC	= 0x0080,
    V_NCSYNC	= 0x0100,
    V_HSKEW	= 0x0200,	/* hskew provided */
    V_BCAST	= 0x0400,
    V_PIXMUX	= 0x1000,
    V_DBLCLK	= 0x2000,
    V_CLKDIV2	= 0x4000
} ModeFlags;

typedef enum {
    INTERLACE_HALVE_V	= 0x0001	/* Halve V values for interlacing */
} CrtcAdjustFlags;

/* Flags passed to ChipValidMode() */
typedef enum {
    MODECHECK_INITIAL = 0,
    MODECHECK_FINAL   = 1
} ModeCheckFlags;

/* These are possible return values for xf86CheckMode() and ValidMode() */
typedef enum {
    MODE_OK	= 0,	/* Mode OK */
    MODE_HSYNC,		/* hsync out of range */
    MODE_VSYNC,		/* vsync out of range */
    MODE_H_ILLEGAL,	/* mode has illegal horizontal timings */
    MODE_V_ILLEGAL,	/* mode has illegal horizontal timings */
    MODE_BAD_WIDTH,	/* requires an unsupported linepitch */
    MODE_NOMODE,	/* no mode with a maching name */
    MODE_NO_INTERLACE,	/* interlaced mode not supported */
    MODE_NO_DBLESCAN,	/* doublescan mode not supported */
    MODE_NO_VSCAN,	/* multiscan mode not supported */
    MODE_MEM,		/* insufficient video memory */
    MODE_VIRTUAL_X,	/* mode width too large for specified virtual size */
    MODE_VIRTUAL_Y,	/* mode height too large for specified virtual size */
    MODE_MEM_VIRT,	/* insufficient video memory given virtual size */
    MODE_NOCLOCK,	/* no fixed clock available */
    MODE_CLOCK_HIGH,	/* clock required is too high */
    MODE_CLOCK_LOW,	/* clock required is too low */
    MODE_CLOCK_RANGE,	/* clock/mode isn't in a ClockRange */
    MODE_BAD_HVALUE,	/* horizontal timing was out of range */
    MODE_BAD_VVALUE,	/* vertical timing was out of range */
    MODE_BAD_VSCAN,	/* VScan value out of range */
    MODE_HSYNC_NARROW,	/* horizontal sync too narrow */
    MODE_HSYNC_WIDE,	/* horizontal sync too wide */
    MODE_HBLANK_NARROW,	/* horizontal blanking too narrow */
    MODE_HBLANK_WIDE,	/* horizontal blanking too wide */
    MODE_VSYNC_NARROW,	/* vertical sync too narrow */
    MODE_VSYNC_WIDE,	/* vertical sync too wide */
    MODE_VBLANK_NARROW,	/* vertical blanking too narrow */
    MODE_VBLANK_WIDE,	/* vertical blanking too wide */
    MODE_PANEL,         /* exceeds panel dimensions */
    MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
    MODE_ONE_WIDTH,     /* only one width is supported */
    MODE_ONE_HEIGHT,    /* only one height is supported */
    MODE_ONE_SIZE,      /* only one resolution is supported */
    MODE_BAD = -2,	/* unspecified reason */
    MODE_ERROR	= -1	/* error condition */
} ModeStatus;

# define M_T_BUILTIN 0x01        /* built-in mode */
# define M_T_CLOCK_C (0x02 | M_T_BUILTIN) /* built-in mode - configure clock */
# define M_T_CRTC_C  (0x04 | M_T_BUILTIN) /* built-in mode - configure CRTC  */
# define M_T_CLOCK_CRTC_C  (M_T_CLOCK_C | M_T_CRTC_C)
                               /* built-in mode - configure CRTC and clock */
# define M_T_DEFAULT 0x10	/* (VESA) default modes */
# define M_T_USERDEF 0x20	/* One of the modes from the config file */

/* Video mode */
typedef struct _DisplayModeRec {
    struct _DisplayModeRec *	prev;
    struct _DisplayModeRec *	next;
    char *			name;		/* identifier for the mode */
    ModeStatus			status;
    int				type;

    /* These are the values that the user sees/provides */
    int				Clock;		/* pixel clock freq (kHz) */
    int				HDisplay;	/* horizontal timing */
    int				HSyncStart;
    int				HSyncEnd;
    int				HTotal;
    int				HSkew;
    int				VDisplay;	/* vertical timing */
    int				VSyncStart;
    int				VSyncEnd;
    int				VTotal;
    int				VScan;
    int				Flags;

  /* These are the values the hardware uses */
    int				ClockIndex;
    int				SynthClock;	/* Actual clock freq to
					  	 * be programmed  (kHz) */
    int				CrtcHDisplay;
    int				CrtcHBlankStart;
    int				CrtcHSyncStart;
    int				CrtcHSyncEnd;
    int				CrtcHBlankEnd;
    int				CrtcHTotal;
    int				CrtcHSkew;
    int				CrtcVDisplay;
    int				CrtcVBlankStart;
    int				CrtcVSyncStart;
    int				CrtcVSyncEnd;
    int				CrtcVBlankEnd;
    int				CrtcVTotal;
    Bool			CrtcHAdjusted;
    Bool			CrtcVAdjusted;
    int				PrivSize;
    INT32 *			Private;
    int				PrivFlags;

    float			HSync, VRefresh;
} DisplayModeRec, *DisplayModePtr;

/* The monitor description */

#define MAX_HSYNC 8
#define MAX_VREFRESH 8

typedef struct { float hi, lo; } range;

typedef struct { CARD32 red, green, blue; } rgb;

typedef struct { float red, green, blue; } Gamma;

/* The permitted gamma range is 1 / GAMMA_MAX <= g <= GAMMA_MAX */
#define GAMMA_MAX	10.0
#define GAMMA_MIN	(1.0 / GAMMA_MAX)
#define GAMMA_ZERO	(GAMMA_MIN / 100.0)

typedef struct {
    char *		id;
    char *		vendor;
    char *		model;
    int			nHsync;
    range		hsync[MAX_HSYNC];
    int			nVrefresh;
    range		vrefresh[MAX_VREFRESH];
    DisplayModePtr	Modes;		/* Start of the monitor's mode list */
    DisplayModePtr	Last;		/* End of the monitor's mode list */
    Gamma		gamma;		/* Gamma of the monitor */
    int			widthmm;
    int			heightmm;
    pointer		options;
    pointer		DDC;
} MonRec, *MonPtr;

/* the list of clock ranges */
typedef struct x_ClockRange {
    struct x_ClockRange *next;
    int			minClock;	/* (kHz) */
    int			maxClock;	/* (kHz) */
    int			clockIndex;	/* -1 for programmable clocks */
    Bool		interlaceAllowed;
    Bool		doubleScanAllowed;
    int			ClockMulFactor;
    int			ClockDivFactor;
    int			PrivFlags;
} ClockRange, *ClockRangePtr;

/* Need to store the strategy with clockRange for VidMode extension */
typedef struct x_ClockRanges {
    struct x_ClockRanges *next;
    int			minClock;
    int			maxClock;
    int			clockIndex;	/* -1 for programmable clocks */
    Bool		interlaceAllowed;
    Bool		doubleScanAllowed;
    int			ClockMulFactor;
    int			ClockDivFactor;
    int			PrivFlags;
    int			strategy;
} ClockRanges, *ClockRangesPtr;

/*
 * The driverFunc. xorgDriverFuncOp specifies the action driver should
 * perform. If requested option is not supported function should return
 * FALSE. pointer can be used to pass arguments to the function or
 * to return data to the caller.
 */
typedef struct _ScrnInfoRec *ScrnInfoPtr;

/* do not change order */
typedef enum {
    RR_GET_INFO,
    RR_SET_CONFIG,
    RR_GET_MODE_MM,
    GET_REQUIRED_HW_INTERFACES = 10
} xorgDriverFuncOp;

typedef Bool xorgDriverFuncProc		  (ScrnInfoPtr, xorgDriverFuncOp,
					   pointer);

/* RR_GET_INFO, RR_SET_CONFIG */
typedef struct {
    int rotation;
    int rate;
    int width;
    int height;
} xorgRRConfig;

typedef union {
    short RRRotations;
    xorgRRConfig RRConfig;
} xorgRRRotation, *xorgRRRotationPtr;

/* RR_GET_MODE_MM */
typedef struct {
    DisplayModePtr mode;
    int virtX;
    int virtY;
    int mmWidth;
    int mmHeight;
} xorgRRModeMM, *xorgRRModeMMPtr;

/* GET_REQUIRED_HW_INTERFACES */
#define HW_IO 1
#define HW_MMIO 2
#define NEED_IO_ENABLED(x) (x & HW_IO)

typedef CARD32 xorgHWFlags;

/*
 * The driver list struct.  This contains the information required for each
 * driver before a ScrnInfoRec has been allocated.
 */
struct _DriverRec;

typedef struct {
    int			driverVersion;
    char *		driverName;
    void		(*Identify)(int flags);
    Bool		(*Probe)(struct _DriverRec *drv, int flags);
    const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
    pointer		module;
    int			refCount;
} DriverRec1;

typedef struct _DriverRec {
    int			driverVersion;
    char *		driverName;
    void		(*Identify)(int flags);
    Bool		(*Probe)(struct _DriverRec *drv, int flags);
    const OptionInfoRec * (*AvailableOptions)(int chipid, int bustype);
    pointer		module;
    int			refCount;
    xorgDriverFuncProc  *driverFunc;
} DriverRec, *DriverPtr;

/*
 *  AddDriver flags
 */
#define HaveDriverFuncs 1

#ifdef XFree86LOADER
/*
 * The optional module list struct. This allows modules exporting helping
 * functions to configuration tools, the Xserver, or any other
 * application/module interested in such information.
 */
typedef struct _ModuleInfoRec {
    int			moduleVersion;
    char *		moduleName;
    pointer		module;
    int			refCount;
    const OptionInfoRec * (*AvailableOptions)(void *unused);
    pointer		unused[8];	/* leave some space for more fields */
} ModuleInfoRec, *ModuleInfoPtr;
#endif

/*
 * These are the private bus types.  New types can be added here.  Types
 * required for the public interface should be added to xf86str.h, with
 * function prototypes added to xf86.h.
 */

/* Tolerate prior #include <linux/input.h> */
#if defined(linux) && defined(_INPUT_H)
#undef BUS_NONE
#undef BUS_ISA
#undef BUS_PCI
#undef BUS_SBUS
#undef BUS_last
#endif

typedef enum {
    BUS_NONE,
    BUS_ISA,
    BUS_PCI,
    BUS_SBUS,
    BUS_last    /* Keep last */
} BusType;

typedef struct {
    int		bus;
    int		device;
    int		func;
} PciBusId;

typedef struct {
    unsigned int dummy;
} IsaBusId;

typedef struct {
    int		fbNum;
} SbusBusId;

typedef struct _bus {
    BusType type;
    union {
	IsaBusId isa;
	PciBusId pci;
	SbusBusId sbus;
    } id;
} BusRec, *BusPtr;

#define MAXCLOCKS   128
typedef enum {
    DAC_BPP8 = 0,
    DAC_BPP16,
    DAC_BPP24,
    DAC_BPP32,
    MAXDACSPEEDS
} DacSpeedIndex;

typedef struct {
   char *			identifier;
   char *			vendor;
   char *			board;
   char *			chipset;
   char *			ramdac;
   char *			driver;
   struct _confscreenrec *	myScreenSection;
   Bool				claimed;
   int				dacSpeeds[MAXDACSPEEDS];
   int				numclocks;
   int				clock[MAXCLOCKS];
   char *			clockchip;
   char *			busID;
   Bool				active;
   Bool				inUse;
   int				videoRam;
   int				textClockFreq;
   unsigned long		BiosBase;	/* Base address of video BIOS */
   unsigned long		MemBase;	/* Frame buffer base address */
   unsigned long		IOBase;
   int				chipID;
   int				chipRev;
   pointer			options;
   int                          irq;
   int                          screen;         /* For multi-CRTC cards */
} GDevRec, *GDevPtr;

typedef int (*FindIsaDevProc)(GDevPtr dev);

typedef struct {
   char *			identifier;
   char *			driver;
   pointer		 	commonOptions;
   pointer			extraOptions;
} IDevRec, *IDevPtr;

typedef struct {
    int			vendor;
    int			chipType;
    int			chipRev;
    int			subsysVendor;
    int			subsysCard;
    int			bus;
    int			device;
    int			func;
    int			class;
    int			subclass;
    int			interface;
    memType  	        memBase[6];
    memType  	        ioBase[6];
    int			size[6];
    unsigned char	type[6];
    memType   	        biosBase;
    int			biosSize;
    pointer		thisCard;
    Bool                validSize;
    Bool                validate;
    CARD32              listed_class;
} pciVideoRec, *pciVideoPtr;

typedef struct {
    int			frameX0;
    int			frameY0;
    int			virtualX;
    int			virtualY;
    int			depth;
    int			fbbpp;
    rgb			weight;
    rgb			blackColour;
    rgb			whiteColour;
    int			defaultVisual;
    char **		modes;
    pointer		options;
} DispRec, *DispPtr;

typedef struct _confxvportrec {
    char *		identifier;
    pointer		options;
} confXvPortRec, *confXvPortPtr;

typedef struct _confxvadaptrec {
    char *		identifier;
    int			numports;
    confXvPortPtr	ports;
    pointer		options;
} confXvAdaptorRec, *confXvAdaptorPtr;

typedef struct _confscreenrec {
    char *		id;
    int			screennum;
    int			defaultdepth;
    int			defaultbpp;
    int			defaultfbbpp;
    MonPtr		monitor;
    GDevPtr		device;
    int			numdisplays;
    DispPtr		displays;
    int			numxvadaptors;
    confXvAdaptorPtr	xvadaptors;
    pointer		options;
} confScreenRec, *confScreenPtr;

typedef enum {
    PosObsolete = -1,
    PosAbsolute = 0,
    PosRightOf,
    PosLeftOf,
    PosAbove,
    PosBelow,
    PosRelative
} PositionType;

typedef struct _screenlayoutrec {
    confScreenPtr	screen;
    char *		topname;
    confScreenPtr	top;
    char *		bottomname;
    confScreenPtr	bottom;
    char *		leftname;
    confScreenPtr	left;
    char *		rightname;
    confScreenPtr	right;
    PositionType	where;
    int			x;
    int			y;
    char *		refname;
    confScreenPtr	refscreen;
} screenLayoutRec, *screenLayoutPtr;

typedef struct _serverlayoutrec {
    char *		id;
    screenLayoutPtr	screens;
    GDevPtr		inactives;
    IDevPtr		inputs;
    pointer		options;
} serverLayoutRec, *serverLayoutPtr;

typedef struct _confdribufferrec {
    int                 count;
    int                 size;
    enum {
	XF86DRI_WC_HINT = 0x0001 /* Placeholder: not implemented */
    }                   flags;
} confDRIBufferRec, *confDRIBufferPtr;

typedef struct _confdrirec {
    int                 group;
    int                 mode;
    int                 bufs_count;
    confDRIBufferRec    *bufs;
} confDRIRec, *confDRIPtr;

/* These values should be adjusted when new fields are added to ScrnInfoRec */
#define NUM_RESERVED_INTS		16
#define NUM_RESERVED_POINTERS		15
#define NUM_RESERVED_FUNCS		11

typedef pointer (*funcPointer)(void);

/* flags for depth 24 pixmap options */
typedef enum {
    Pix24DontCare = 0,
    Pix24Use24,
    Pix24Use32
} Pix24Flags;

/* Power management events: so far we only support APM */

typedef enum {
    XF86_APM_UNKNOWN = -1,
    XF86_APM_SYS_STANDBY,
    XF86_APM_SYS_SUSPEND,
    XF86_APM_CRITICAL_SUSPEND,
    XF86_APM_USER_STANDBY,
    XF86_APM_USER_SUSPEND,
    XF86_APM_STANDBY_RESUME,
    XF86_APM_NORMAL_RESUME,
    XF86_APM_CRITICAL_RESUME,
    XF86_APM_LOW_BATTERY,
    XF86_APM_POWER_STATUS_CHANGE,
    XF86_APM_UPDATE_TIME,
    XF86_APM_CAPABILITY_CHANGED,
    XF86_APM_STANDBY_FAILED,
    XF86_APM_SUSPEND_FAILED
} pmEvent;

typedef enum {
    PM_WAIT,
    PM_CONTINUE,
    PM_FAILED,
    PM_NONE
} pmWait;

/*
 * The IO access enabler struct. This contains the address for
 * the IOEnable/IODisable funcs for their specific bus along
 * with a pointer to data needed by them
 */
typedef struct _AccessRec {
    void (*AccessDisable)(void *arg);
    void (*AccessEnable)(void *arg);
    void *arg;
} xf86AccessRec, *xf86AccessPtr;

typedef struct {
    xf86AccessPtr mem;
    xf86AccessPtr io;
    xf86AccessPtr io_mem;
} xf86SetAccessFuncRec, *xf86SetAccessFuncPtr;

/*  bus-access-related types */
typedef enum {
    NONE,
    IO,
    MEM_IO,
    MEM
} resType;

typedef struct _EntityAccessRec {
    xf86AccessPtr fallback;
    xf86AccessPtr pAccess;
    resType rt;
    pointer  busAcc;
    struct _EntityAccessRec *next;
} EntityAccessRec, *EntityAccessPtr;

typedef struct _CurrAccRec {
    EntityAccessPtr pMemAccess;
    EntityAccessPtr pIoAccess;
} xf86CurrentAccessRec, *xf86CurrentAccessPtr;

/* new RAC */

/* Resource Type values */
#define ResNone		((unsigned long)(-1))

#define ResMem		0x0001
#define ResIo		0x0002
#define ResIrq		0x0003
#define ResDma		0x0004
#define ResPciCfg	0x000e	/* PCI Configuration space */
#define ResPhysMask	0x000F

#define ResExclusive	0x0010
#define ResShared	0x0020
#define ResAny		0x0040
#define ResAccMask	0x0070
#define ResUnused	0x0080

#define ResUnusedOpr	0x0100
#define ResDisableOpr	0x0200
#define ResOprMask	0x0300

#define ResBlock	0x0400
#define ResSparse	0x0800
#define ResExtMask	0x0C00

#define ResEstimated	0x001000
#define ResInit 	0x002000
#define ResBios		0x004000
#define ResMiscMask	0x00F000

#define ResBus		0x010000
#define ResOverlap	0x020000

#if defined(__alpha__) && defined(linux)
# define ResDomain	0x1ff000000ul
#else
# define ResDomain	0xff000000ul
#endif
#define ResTypeMask	(ResPhysMask | ResDomain)	/* For conflict check */

#define ResEnd		ResNone

#define ResExcMemBlock		(ResMem | ResExclusive | ResBlock)
#define ResExcIoBlock		(ResIo | ResExclusive | ResBlock)
#define ResShrMemBlock		(ResMem | ResShared | ResBlock)
#define ResShrIoBlock		(ResIo | ResShared | ResBlock)
#define ResExcUusdMemBlock	(ResMem | ResExclusive | ResUnused | ResBlock)
#define ResExcUusdIoBlock	(ResIo | ResExclusive | ResUnused | ResBlock)
#define ResShrUusdMemBlock	(ResMem | ResShared | ResUnused | ResBlock)
#define ResShrUusdIoBlock	(ResIo | ResShared | ResUnused | ResBlock)
#define ResExcUusdMemSparse	(ResMem | ResExclusive | ResUnused | ResSparse)
#define ResExcUusdIoSparse	(ResIo | ResExclusive | ResUnused | ResSparse)
#define ResShrUusdMemSparse	(ResMem | ResShared | ResUnused | ResSparse)
#define ResShrUusdIoSparse	(ResIo | ResShared | ResUnused | ResSparse)

#define ResExcMemSparse		(ResMem | ResExclusive | ResSparse)
#define ResExcIoSparse		(ResIo | ResExclusive | ResSparse)
#define ResShrMemSparse		(ResMem | ResShared | ResSparse)
#define ResShrIoSparse		(ResIo | ResShared | ResSparse)
#define ResUusdMemSparse	(ResMem | ResUnused | ResSparse)
#define ResUusdIoSparse		(ResIo | ResUnused | ResSparse)

#define ResIsMem(r)		(((r)->type & ResPhysMask) == ResMem)
#define ResIsIo(r)		(((r)->type & ResPhysMask) == ResIo)
#define ResIsExclusive(r)	(((r)->type & ResAccMask) == ResExclusive)
#define ResIsShared(r)		(((r)->type & ResAccMask) == ResShared)
#define ResIsUnused(r)		(((r)->type & ResAccMask) == ResUnused)
#define ResIsBlock(r)		(((r)->type & ResExtMask) == ResBlock)
#define ResIsSparse(r)		(((r)->type & ResExtMask) == ResSparse)
#define ResIsEstimated(r)	(((r)->type & ResMiscMask) == ResEstimated)
#define ResCanOverlap(r)	(ResIsEstimated(r) || ((r)->type & ResOverlap))

typedef struct {
    unsigned long type;     /* shared, exclusive, unused etc. */
    memType a;
    memType b;
} resRange, *resList;

#define RANGE_TYPE(type, domain) \
               (((unsigned long)(domain) << 24) | ((type) & ~ResBus))
#define RANGE(r,u,v,t) {\
                       (r).a = (u);\
                       (r).b = (v);\
                       (r).type = (t);\
                       }

#define rBase a
#define rMask b
#define rBegin a
#define rEnd b

/* resource record */
typedef struct _resRec *resPtr;
typedef struct _resRec {
    resRange    val;
    int		entityIndex;	/* who owns the resource */
    resPtr	next;
} resRec;

#define sparse_base	val.rBase
#define sparse_mask	val.rMask
#define block_begin	val.rBegin
#define block_end	val.rEnd
#define res_type	val.type

typedef struct {
    int numChipset;
    resRange *resList;
} IsaChipsets;

typedef struct {
    int numChipset;
    int PCIid;
    resRange *resList;
} PciChipsets;

/* Entity properties */
typedef void (*EntityProc)(int entityIndex,pointer private);

typedef struct _entityInfo {
    int index;
    BusRec location;
    int chipset;
    Bool active;
    resPtr resources;
    GDevPtr device;
    DriverPtr driver;
} EntityInfoRec, *EntityInfoPtr;

/* server states */

typedef enum {
    SETUP,
    OPERATING
} xf86State;

typedef enum {
    NOTIFY_SETUP_TRANSITION,
    NOTIFY_SETUP,
    NOTIFY_OPERATING,
    NOTIFY_OPERATING_TRANSITION,
    NOTIFY_ENABLE,
    NOTIFY_ENTER,
    NOTIFY_LEAVE
} xf86NotifyState;

typedef void (*xf86StateChangeNotificationCallbackFunc)(xf86NotifyState state,pointer);

/* DGA */

typedef struct {
   int num;		/* A unique identifier for the mode (num > 0) */
   DisplayModePtr mode;
   int flags;		/* DGA_CONCURRENT_ACCESS, etc... */
   int imageWidth;	/* linear accessible portion (pixels) */
   int imageHeight;
   int pixmapWidth;	/* Xlib accessible portion (pixels) */
   int pixmapHeight;	/* both fields ignored if no concurrent access */
   int bytesPerScanline;
   int byteOrder;	/* MSBFirst, LSBFirst */
   int depth;
   int bitsPerPixel;
   unsigned long red_mask;
   unsigned long green_mask;
   unsigned long blue_mask;
   short visualClass;
   int viewportWidth;
   int viewportHeight;
   int xViewportStep;	/* viewport position granularity */
   int yViewportStep;
   int maxViewportX;	/* max viewport origin */
   int maxViewportY;
   int viewportFlags;	/* types of page flipping possible */
   int offset;		/* offset into physical memory */
   unsigned char *address;	/* server's mapped framebuffer */
   int reserved1;
   int reserved2;
} DGAModeRec, *DGAModePtr;

typedef struct {
   DGAModePtr mode;
   PixmapPtr pPix;
} DGADeviceRec, *DGADevicePtr;

/*
 * Flags for driver Probe() functions.
 */
#define PROBE_DEFAULT	  0x00
#define PROBE_DETECT	  0x01
#define PROBE_TRYHARD	  0x02

/*
 * Driver entry point types
 */

typedef Bool xf86ProbeProc                (DriverPtr, int);
typedef Bool xf86PreInitProc              (ScrnInfoPtr, int);
typedef Bool xf86ScreenInitProc           (int, ScreenPtr, int, char**);
typedef Bool xf86SwitchModeProc           (int, DisplayModePtr, int);
typedef void xf86AdjustFrameProc          (int, int, int, int);
typedef Bool xf86EnterVTProc              (int, int);
typedef void xf86LeaveVTProc              (int, int);
typedef void xf86FreeScreenProc           (int, int);
typedef ModeStatus xf86ValidModeProc      (int, DisplayModePtr, Bool, int);
typedef void xf86EnableDisableFBAccessProc(int, Bool);
typedef int  xf86SetDGAModeProc           (int, int, DGADevicePtr);
typedef int  xf86ChangeGammaProc          (int, Gamma);
typedef void xf86PointerMovedProc         (int, int, int);
typedef Bool xf86PMEventProc              (int, pmEvent, Bool);
typedef int  xf86HandleMessageProc     (int, const char*, const char*, char**);
typedef void xf86DPMSSetProc		  (ScrnInfoPtr, int, int);
typedef void xf86LoadPaletteProc   (ScrnInfoPtr, int, int *, LOCO *, VisualPtr);
typedef void xf86SetOverscanProc          (ScrnInfoPtr, int);

/*
 * ScrnInfoRec
 *
 * There is one of these for each screen, and it holds all the screen-specific
 * information.
 *
 * Note: the size and layout must be kept the same across versions.  New
 * fields are to be added in place of the "reserved*" fields.  No fields
 * are to be dependent on compile-time defines.
 */

typedef struct _ScrnInfoRec {
    int			driverVersion;
    char *		driverName;		/* canonical name used in */
						/* the config file */
    ScreenPtr		pScreen;		/* Pointer to the ScreenRec */
    int			scrnIndex;		/* Number of this screen */
    Bool		configured;		/* Is this screen valid */
    int			origIndex;		/* initial number assigned to
						 * this screen before
						 * finalising the number of
						 * available screens */

    /* Display-wide screenInfo values needed by this screen */
    int			imageByteOrder;
    int			bitmapScanlineUnit;
    int			bitmapScanlinePad;
    int			bitmapBitOrder;
    int			numFormats;
    PixmapFormatRec	formats[MAXFORMATS];
    PixmapFormatRec	fbFormat;

    int			bitsPerPixel;		/* fb bpp */
    Pix24Flags		pixmap24;		/* pixmap pref for depth 24 */
    int			depth;			/* depth of default visual */
    MessageType		depthFrom;		/* set from config? */
    MessageType		bitsPerPixelFrom;	/* set from config? */
    rgb			weight;			/* r/g/b weights */
    rgb			mask;			/* rgb masks */
    rgb			offset;			/* rgb offsets */
    int			rgbBits;		/* Number of bits in r/g/b */
    Gamma		gamma;			/* Gamma of the monitor */
    int			defaultVisual;		/* default visual class */
    int			maxHValue;		/* max horizontal timing */
    int			maxVValue;		/* max vertical timing value */
    int			virtualX;		/* Virtual width */
    int			virtualY; 		/* Virtual height */
    int			xInc;			/* Horizontal timing increment */
    MessageType		virtualFrom;		/* set from config? */
    int			displayWidth;		/* memory pitch */
    int			frameX0;		/* viewport position */
    int			frameY0;
    int			frameX1;
    int			frameY1;
    int			zoomLocked;		/* Disallow mode changes */
    DisplayModePtr	modePool;		/* list of compatible modes */
    DisplayModePtr	modes;			/* list of actual modes */
    DisplayModePtr	currentMode;		/* current mode
						 * This was previously
						 * overloaded with the modes
						 * field, which is a pointer
						 * into a circular list */
    confScreenPtr	confScreen;		/* Screen config info */
    MonPtr		monitor;		/* Monitor information */
    DispPtr		display;		/* Display information */
    int *		entityList;		/* List of device entities */
    int			numEntities;
    int			widthmm;		/* physical display dimensions
						 * in mm */
    int			heightmm;
    int			xDpi;			/* width DPI */
    int			yDpi;			/* height DPI */
    char *		name;			/* Name to prefix messages */
    pointer		driverPrivate;		/* Driver private area */
    DevUnion *		privates;		/* Other privates can hook in
						 * here */
    DriverPtr		drv;			/* xf86DriverList[] entry */
    pointer		module;			/* Pointer to module head */
    int			colorKey;
    int			overlayFlags;

    /* Some of these may be moved out of here into the driver private area */

    char *		chipset;		/* chipset name */
    char *		ramdac;			/* ramdac name */
    char *		clockchip;		/* clock name */
    Bool		progClock;		/* clock is programmable */
    int			numClocks;		/* number of clocks */
    int			clock[MAXCLOCKS];	/* list of clock frequencies */
    int			videoRam;		/* amount of video ram (kb) */
    unsigned long	biosBase;		/* Base address of video BIOS */
    unsigned long	memPhysBase;		/* Physical address of FB */
    unsigned long 	fbOffset;		/* Offset of FB in the above */
    IOADDRESS    	domainIOBase;		/* Domain I/O base address */
    int			memClk;			/* memory clock */
    int			textClockFreq;		/* clock of text mode */
    Bool		flipPixels;		/* swap default black/white */
    pointer		options;

    int			chipID;
    int			chipRev;
    int			racMemFlags;
    int			racIoFlags;
    pointer		access;
    xf86CurrentAccessPtr CurrentAccess;
    resType		resourceType;
    pointer		busAccess;

    /* Allow screens to be enabled/disabled individually */
    Bool		vtSema;
    DevUnion		pixmapPrivate;		/* saved devPrivate from pixmap */

    /* hw cursor moves at SIGIO time */
    Bool		silkenMouse;

    /* Storage for clockRanges and adjustFlags for use with the VidMode ext */
    ClockRangesPtr	clockRanges;
    int			adjustFlags;

    /*
     * These can be used when the minor ABI version is incremented.
     * The NUM_* parameters must be reduced appropriately to keep the
     * structure size and alignment unchanged.
     */
    int			reservedInt[NUM_RESERVED_INTS];

    int *		entityInstanceList;
    pointer		reservedPtr[NUM_RESERVED_POINTERS];

    /*
     * Driver entry points.
     *
     */

    xf86ProbeProc			*Probe;
    xf86PreInitProc			*PreInit;
    xf86ScreenInitProc			*ScreenInit;
    xf86SwitchModeProc			*SwitchMode;
    xf86AdjustFrameProc			*AdjustFrame;
    xf86EnterVTProc			*EnterVT;
    xf86LeaveVTProc			*LeaveVT;
    xf86FreeScreenProc			*FreeScreen;
    xf86ValidModeProc			*ValidMode;
    xf86EnableDisableFBAccessProc	*EnableDisableFBAccess;
    xf86SetDGAModeProc			*SetDGAMode;
    xf86ChangeGammaProc			*ChangeGamma;
    xf86PointerMovedProc		*PointerMoved;
    xf86PMEventProc			*PMEvent;
    xf86HandleMessageProc		*HandleMessage;
    xf86DPMSSetProc			*DPMSSet;
    xf86LoadPaletteProc			*LoadPalette;
    xf86SetOverscanProc			*SetOverscan;
    xorgDriverFuncProc			*DriverFunc;

    /*
     * This can be used when the minor ABI version is incremented.
     * The NUM_* parameter must be reduced appropriately to keep the
     * structure size and alignment unchanged.
     */
    funcPointer		reservedFuncs[NUM_RESERVED_FUNCS];

} ScrnInfoRec;

typedef struct {
   Bool (*OpenFramebuffer)(
	ScrnInfoPtr pScrn,
	char **name,
	unsigned char **mem,
	int *size,
	int *offset,
        int *extra
   );
   void	(*CloseFramebuffer)(ScrnInfoPtr pScrn);
   Bool (*SetMode)(ScrnInfoPtr pScrn, DGAModePtr pMode);
   void (*SetViewport)(ScrnInfoPtr pScrn, int x, int y, int flags);
   int  (*GetViewport)(ScrnInfoPtr pScrn);
   void (*Sync)(ScrnInfoPtr);
   void (*FillRect)(
	ScrnInfoPtr pScrn,
	int x, int y, int w, int h,
	unsigned long color
   );
   void (*BlitRect)(
	ScrnInfoPtr pScrn,
	int srcx, int srcy,
	int w, int h,
	int dstx, int dsty
   );
   void (*BlitTransRect)(
	ScrnInfoPtr pScrn,
	int srcx, int srcy,
	int w, int h,
	int dstx, int dsty,
	unsigned long color
   );
} DGAFunctionRec, *DGAFunctionPtr;

typedef struct {
    int			token;		/* id of the token */
    const char *	name;		/* token name */
} SymTabRec, *SymTabPtr;

/* flags for xf86LookupMode */
typedef enum {
    LOOKUP_DEFAULT		= 0,	/* Use default mode lookup method */
    LOOKUP_BEST_REFRESH,		/* Pick modes with best refresh */
    LOOKUP_CLOSEST_CLOCK,		/* Pick modes with the closest clock */
    LOOKUP_LIST_ORDER,			/* Pick first useful mode in list */
    LOOKUP_CLKDIV2		= 0x0100, /* Allow half clocks */
    LOOKUP_OPTIONAL_TOLERANCES	= 0x0200  /* Allow missing hsync/vrefresh */
} LookupModeFlags;

#define NoDepth24Support	0x00
#define Support24bppFb		0x01	/* 24bpp framebuffer supported */
#define Support32bppFb		0x02	/* 32bpp framebuffer supported */
#define SupportConvert24to32	0x04	/* Can convert 24bpp pixmap to 32bpp */
#define SupportConvert32to24	0x08	/* Can convert 32bpp pixmap to 24bpp */
#define PreferConvert24to32	0x10	/* prefer 24bpp pixmap to 32bpp conv */
#define PreferConvert32to24	0x20	/* prefer 32bpp pixmap to 24bpp conv */

/* For DPMS */
typedef void (*DPMSSetProcPtr)(ScrnInfoPtr, int, int);

/* Input handler proc */
typedef void (*InputHandlerProc)(int fd, pointer data);

/* These are used by xf86GetClocks */
#define CLK_REG_SAVE		-1
#define CLK_REG_RESTORE		-2

/* xf86Debug.c */
#ifdef BUILDDEBUG
typedef struct {
    long sec;
    long usec;
} xf86TsRec, *xf86TsPtr;
#endif

/*
 * misc constants
 */
#define INTERLACE_REFRESH_WEIGHT	1.5
#define SYNC_TOLERANCE		0.01	/* 1 percent */
#define CLOCK_TOLERANCE		2000	/* Clock matching tolerance (2MHz) */

#define OVERLAY_8_32_DUALFB	0x00000001
#define OVERLAY_8_24_DUALFB	0x00000002
#define OVERLAY_8_16_DUALFB	0x00000004
#define OVERLAY_8_32_PLANAR	0x00000008

#if 0
#define LD_RESOLV_IFDONE		0	/* only check if no more
						   delays pending */
#define LD_RESOLV_NOW			1	/* finish one delay step */
#define LD_RESOLV_FORCE			2	/* force checking... */
#endif

/* Values of xf86Info.mouseFlags */
#define MF_CLEAR_DTR       1
#define MF_CLEAR_RTS       2

/* Action Events */
typedef enum {
    ACTION_TERMINATE		= 0,	/* Terminate Server */
    ACTION_NEXT_MODE		= 10,	/* Switch to next video mode */
    ACTION_PREV_MODE,
    ACTION_DISABLEGRAB		= 20,	/* Cancel server/pointer/kbd grabs */
    ACTION_CLOSECLIENT,			/* Kill client holding grab */
    ACTION_SWITCHSCREEN		= 100,	/* VT switch */
    ACTION_SWITCHSCREEN_NEXT,
    ACTION_SWITCHSCREEN_PREV,
    ACTION_MESSAGE		= 9999  /* Generic message passing */
} ActionEvent;

/* xf86Versions.c */
/*
 * Never change existing values, and always assign values explicitly.
 * NUM_BUILTIN_IFS must always be the last entry.
 */
typedef enum {
    BUILTIN_IF_OSMOUSE = 0,
    BUILTIN_IF_OSKBD = 1,
    NUM_BUILTIN_IFS
} BuiltinInterface;

/*
 * These are intentionally the same as the module version macros.
 * It is possible to register a module as providing a specific interface,
 * in which case the module's version is used.  This feature isn't
 * really ready for use yet though.
 */

#define BUILTIN_INTERFACE_VERSION_NUMERIC(maj, min, patch) \
	((((maj) & 0xFF) << 24) | (((min) & 0xFF) << 16) | (patch & 0xFFFF))
#define GET_BUILTIN_INTERFACE_MAJOR_VERSION(vers)	(((vers) >> 24) & 0xFF)
#define GET_BUILTIN_INTERFACE_MINOR_VERSION(vers)	(((vers) >> 16) & 0xFF)
#define GET_BUILTIN_INTERFACE_PATCH_VERSION(vers)	((vers) & 0xFFFF)

#endif /* _XF86STR_H */


text:
package com.companyname.springapp.repository;

import java.util.List;

import com.companyname.springapp.domain.Product;

public interface  ProductDao {

	public List<Product> getProductList();

    public void saveProduct(Product prod);

}