text:
Show you're proud of where you build your product by adding a simple element and script to your site.

#Usage
```html
<hecho locale="es" country="AR" />
<hecho locale="es" country="AR" lenght="short" />
<hecho locale="en" country="CA" />
<script src="https://cdn.rawgit.com/Urucas/hecho/master/dist/hecho.js"></script>
```

#Result
<img src="https://raw.githubusercontent.com/Urucas/hecho/master/screen.png"/>

#Styling
Every ```<hecho>``` element will have as a child a ```<div>``` element with to classes:

* hecho-$index
* hecho-$country

For ex.
```html```
<hecho locale="es" country="AR"></hecho>
```
would have a ```<div>``` child with to classes **hecho-0** **hecho-AR**

Now you can add your own style in our stylesheet like
```css
.hecho-AR{
  font-style:'Helvetica Neue'
  font-size:0.8em
}
```


text:
ul {
    margin: 0;
    padding: 0;
}

h2 {
    bottom: 0;
    text-align: center;
    font-size: 12px;
    color: gray;
    float: right;
}

.app-container {
    margin: 0 auto;
    text-align: center;
}

.app-container > div {
    display: inline-block;
    vertical-align: top;
}

.animation-list-container {
    width: 370px;
    height: 350px;
    border: 1px solid lightgray;
    display: inline-block;
    overflow: auto;
    background-color: rgba(245, 245, 245, 0.1);
    position: relative;
}

.app-container.two .animation-list-container {
    width: 560px;
}

.animation-list-item {
    width: 150px;
    height: 70px;
    margin: 3px;
    border: 1px solid gray;
    text-align: center;
    display: inline-block;
    vertical-align: top;
    list-style: none;
    box-shadow: 2px 2px lightgray;
    border-radius: 3px;
    font-size: 14px;
}

.animation-list-item .title {
    width: 100%;
    display: block;
    background-color: whitesmoke;
    height: 50%;
    font-weight: bold;
}

.animation-list-item .value {
    display: block;
    height: 50%;
    font-size: 14px;
}

.animation-list-buttons {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20px;
    z-index: 1;
}

.animation-list-buttons button {
    background: none;
    border: 1px solid lightgray;
    display: block;
    position: absolute;
    width: 35px;
    height: 20px;
    cursor: pointer;
    bottom: 0;
}

.animation-list-buttons button[disabled] {
    background-color: whitesmoke;
}

.animation-list-buttons button.prev {
    left: 0;
}

.animation-list-buttons button.next {
    right: 0;
}

/*
 78px - this is
        70px        - animation-list-item height
      +  1px * 2    - animation-list-item border
      +  3px * 2    - animation-list-item margin
*/

.animation-list-line {
    height: 78px;
    overflow: hidden;
}

.animation1.ng-enter {
    transition: 0.5s linear all;
    height: 0;
}

.animation1.ng-enter.ng-enter-active {
    height: 78px;
}

.animation1.ng-leave {
    transition: 0.5s linear all;
    height: 78px;
}

.animation1.ng-leave.ng-leave-active {
    height: 0;
}

.animation-list-wrapper {
    position: relative;
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
	<!--      table information
		Generate time : 2009-06-03 13:58:23
   		Version :  1.0.1.V20070717
		tableName :CG.T_P_PAYMENT_APPLY_D
		 SEG_NO  VARCHAR2   NOT NULL   primarykey,
		 PAY_APPLY_ID  VARCHAR2   NOT NULL   primarykey,
		 PAY_APPLY_SUBID  VARCHAR2   NOT NULL   primarykey,
		 PAY_OBJECT_ID  VARCHAR2,
		 CONTRACT_ID  VARCHAR2,
		 PROVIDER_CONTRACT_NUM  VARCHAR2,
		 PAY_BASE_DATE  DATE,
		 MONEY_TYPE  VARCHAR2,
		 APPLY_AMOUNT  NUMBER,
		 PAYED_AMOUNT  NUMBER,
		 REMARK  VARCHAR2,
		 MODI_PERSON  VARCHAR2,
		 MODI_DATE  DATE,
		 CREATE_DATE  DATE
	-->
<sqlMap namespace="STCG0202">

	<select id="query" parameterClass="java.util.HashMap"
			resultClass="com.baosight.sts.st.cg.domain.STCG0202">
		SELECT
				d.SEG_NO	as "segNo",
				d.PAY_APPLY_ID	as "payApplyId",  <!-- 付款申请号 -->
				d.PAY_APPLY_SUBID	as "payApplySubid",  <!-- 付款申请子项号 -->
				d.PAY_OBJECT_ID	as "payObjectId",  <!-- 付款对象编号 -->
				d.CONTRACT_ID	as "contractId",  <!-- 采购合同号 -->
				d.PROVIDER_CONTRACT_NUM	as "providerContractNum",  <!-- 供应商合同号 -->
				d.PAY_BASE_DATE	as "payBaseDate",  <!-- 合同定的付款基准日 -->
				d.MONEY_TYPE	as "moneyType",  <!-- 款项类型 -->
				d.APPLY_AMOUNT	as "applyAmount",  <!-- 申请金额 -->
				nvl(d.PAYED_AMOUNT,0)	as "payedAmount",  <!-- 实际分配金额 -->
				d.REMARK	as "remark",  <!-- 备注 -->
				d.MODI_PERSON	as "modiPerson",  <!-- 更新人 -->
				d.MODI_DATE	as "modiDate",  <!-- 更新日期 -->
				d.CREATE_DATE	as "createDate", <!-- 创建日期 -->
				m.provider_id as "providerId",
        		nvl(m.total_amount,0) as "totalAmount",
				nvl(m.total_frght,0) as "totalFrght",
				nvl(m.total_amount,0)+nvl(m.total_frght,0) as "amount"
		FROM CG.T_P_PAYMENT_APPLY_D d,(select seg_no,
               contract_id,
               provider_id,
               nvl(total_amount, 0) total_amount,
               nvl(total_frght, 0) total_frght
          from cg.t_p_contract_m
        union
        select seg_no,
               settle_id contract_id,
               mprovider_id provider_id,
               a.settle_amount + a.tax_amount total_amount,
               a.other_amount total_frght
          from wl.t_m_settle_m a
        union
        select seg_no,
               commission_id contract_id,
               provider_id,
               (select nvl(sum(round(b.fright_price * b.plan_net_weight, 2)),
                           0)
                  from wl.t_i_trans_commission_d b
                 where a.seg_no = b.seg_no
                   and a.commission_id = b.commission_id
                   and b.commission_substatus <> '00') total_amount,
               0 total_frght
          from wl.t_i_trans_commission_m a) m WHERE 1=1
		and 	d.contract_id = m.contract_id(+) and d.seg_no = m.seg_no(+)
		<isNotEmpty prepend=" AND " property="segNo">
			d.SEG_NO = #segNo#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="payApplyId">
			d.PAY_APPLY_ID = #payApplyId#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="payApplySubid">
			d.PAY_APPLY_SUBID = #payApplySubid#
		</isNotEmpty>
			<dynamic prepend="ORDER BY">
         <isNotEmpty property="orderBy">
    		  $orderBy$
   		 </isNotEmpty>
   		<isEmpty property="orderBy">
    		  d.SEG_NO asc,
    		  d.PAY_APPLY_ID asc,
    		  d.PAY_APPLY_SUBID asc
		</isEmpty>
  		</dynamic>

	</select>

	<select id="count" resultClass="int">
		SELECT COUNT(*) FROM CG.T_P_PAYMENT_APPLY_D WHERE 1=1
		<isNotEmpty prepend=" AND " property="segNo">
			SEG_NO = #segNo#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="payApplyId">
			PAY_APPLY_ID = #payApplyId#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="payApplySubid">
			PAY_APPLY_SUBID = #payApplySubid#
		</isNotEmpty>
	</select>

	<!--
		<isNotEmpty prepend=" AND " property="segNo">
			SEG_NO = #segNo#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="payApplyId">
			PAY_APPLY_ID = #payApplyId#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="payApplySubid">
			PAY_APPLY_SUBID = #payApplySubid#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="payObjectId">
			PAY_OBJECT_ID = #payObjectId#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="contractId">
			CONTRACT_ID = #contractId#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="providerContractNum">
			PROVIDER_CONTRACT_NUM = #providerContractNum#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="payBaseDate">
			PAY_BASE_DATE = #payBaseDate#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="moneyType">
			MONEY_TYPE = #moneyType#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="applyAmount">
			APPLY_AMOUNT = #applyAmount#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="payedAmount">
			PAYED_AMOUNT = #payedAmount#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="remark">
			REMARK = #remark#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="modiPerson">
			MODI_PERSON = #modiPerson#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="modiDate">
			MODI_DATE = #modiDate#
		</isNotEmpty>
		<isNotEmpty prepend=" AND " property="createDate">
			CREATE_DATE = #createDate#
		</isNotEmpty>
	-->

	<insert id="insert">
		INSERT INTO CG.T_P_PAYMENT_APPLY_D (SEG_NO,
										PAY_APPLY_ID,  <!-- 付款申请号 -->
										PAY_APPLY_SUBID,  <!-- 付款申请子项号 -->
										PAY_OBJECT_ID,  <!-- 付款对象编号 -->
										CONTRACT_ID,  <!-- 采购合同号 -->
										PROVIDER_CONTRACT_NUM,  <!-- 供应商合同号 -->
										PAY_BASE_DATE,  <!-- 合同定的付款基准日 -->
										MONEY_TYPE,  <!-- 款项类型 -->
										APPLY_AMOUNT,  <!-- 申请金额 -->
										PAYED_AMOUNT,  <!-- 实际分配金额 -->
										REMARK,  <!-- 备注 -->
										MODI_PERSON,  <!-- 更新人 -->
										MODI_DATE,  <!-- 更新日期 -->
										CREATE_DATE  <!-- 创建日期 -->
										)
		VALUES (#segNo:VARCHAR#, #payApplyId:VARCHAR#, #payApplySubid:VARCHAR#, #payObjectId:VARCHAR#, #contractId:VARCHAR#, #providerContractNum:VARCHAR#, #payBaseDate:DATE#, #moneyType:VARCHAR#, #applyAmount:NUMERIC#, #payedAmount:NUMERIC#, #remark:VARCHAR#, #modiPerson:VARCHAR#, #modiDate:DATE#, #createDate:DATE#)
	</insert>

	<delete id="delete">
		DELETE FROM CG.T_P_PAYMENT_APPLY_D WHERE
			SEG_NO = #segNo# AND
			PAY_APPLY_ID = #payApplyId# AND
			PAY_APPLY_SUBID = #payApplySubid#
	</delete>

	<update id="update">
		UPDATE CG.T_P_PAYMENT_APPLY_D
		SET
					PAY_OBJECT_ID	= #payObjectId#,   <!-- 付款对象编号 -->
					CONTRACT_ID	= #contractId#,   <!-- 采购合同号 -->
					PROVIDER_CONTRACT_NUM	= #providerContractNum#,   <!-- 供应商合同号 -->
					PAY_BASE_DATE	= #payBaseDate:DATE#,   <!-- 合同定的付款基准日 -->
					MONEY_TYPE	= #moneyType#,   <!-- 款项类型 -->
					APPLY_AMOUNT	= #applyAmount:NUMERIC#,   <!-- 申请金额 -->
					PAYED_AMOUNT	= #payedAmount:NUMERIC#,   <!-- 实际分配金额 -->
					REMARK	= #remark#,   <!-- 备注 -->
					MODI_PERSON	= #modiPerson#,   <!-- 更新人 -->
					MODI_DATE	= #modiDate:DATE#,   <!-- 更新日期 -->
					CREATE_DATE	= #createDate:DATE#  <!-- 创建日期 -->
			WHERE
			SEG_NO = #segNo# AND
			PAY_APPLY_ID = #payApplyId# AND
			PAY_APPLY_SUBID = #payApplySubid#
	</update>

	<insert id="addPayApplyD" parameterClass="java.util.HashMap">
		insert into
		cg.T_P_PAYMENT_APPLY_D
			(
			<isNotEmpty prepend=" " property="segNo">
				seg_no
			</isNotEmpty>
			<isNotEmpty prepend="," property="payApplyId">
				pay_apply_id
			</isNotEmpty>
			<isNotEmpty prepend="," property="payApplySubid">
				pay_apply_subid
			</isNotEmpty>
			<isNotEmpty prepend="," property="payObjectId">
				pay_object_id
			</isNotEmpty>
			<isNotEmpty prepend="," property="contractId">
				contract_id
			</isNotEmpty>
			<isNotEmpty prepend="," property="providerContractNum">
				provider_contract_num
			</isNotEmpty>
			<isNotEmpty prepend="," property="payBaseDate">
				pay_base_date
			</isNotEmpty>
			<isNotEmpty prepend="," property="moneyType">
				money_type
			</isNotEmpty>
			<isNotEmpty prepend="," property="applyAmount">
				apply_amount
			</isNotEmpty>
			<isNotEmpty prepend="," property="payedAmount">
				payed_amount
			</isNotEmpty>
			<isNotEmpty prepend="," property="remark">
				remark
			</isNotEmpty>
			<isNotEmpty prepend="," property="modiPerson">
				modi_person
			</isNotEmpty>
			<isNotEmpty prepend="," property="modiDate">
				modi_date
			</isNotEmpty>
				,create_date
			)
		values
		(
		<isNotEmpty prepend=" " property="segNo">

			#segNo#
		</isNotEmpty>
		<isNotEmpty prepend="," property="payApplyId">

			#payApplyId#
		</isNotEmpty>
		<isNotEmpty prepend="," property="payApplySubid">

			#payApplySubid#
		</isNotEmpty>
		<isNotEmpty prepend="," property="payObjectId">

			#payObjectId#
		</isNotEmpty>
		<isNotEmpty prepend="," property="contractId">

			#contractId#
		</isNotEmpty>
		<isNotEmpty prepend="," property="providerContractNum">

			#providerContractNum#
		</isNotEmpty>
		<isNotEmpty prepend="," property="payBaseDate">

			to_date(#payBaseDate#,'yyyy-mm-dd')
		</isNotEmpty>
		<isNotEmpty prepend="," property="moneyType">

			#moneyType#
		</isNotEmpty>
		<isNotEmpty prepend="," property="applyAmount">

			#applyAmount#
		</isNotEmpty>
		<isNotEmpty prepend="," property="payedAmount">

			#payedAmount#
		</isNotEmpty>
		<isNotEmpty prepend="," property="remark">

			#remark#
		</isNotEmpty>
		<isNotEmpty prepend="," property="modiPerson">

			#modiPerson#
		</isNotEmpty>
		<isNotEmpty prepend="," property="modiDate">

			#modiDate#
		</isNotEmpty>
		,sysdate
		)
	</insert>

	<update id="updatePayApplyD" parameterClass="java.util.HashMap">
	update
		cg.T_P_PAYMENT_APPLY_D
		set
				pay_base_date =  to_date(#payBaseDate#,'yyyy-mm-dd') ,
				money_type =  #moneyType# ,
				apply_amount =  #applyAmount# ,
				modi_person =  #modiPerson# ,
				modi_date =  sysdate
		where 1=1
		and	pay_apply_id=#payApplyId#
		and	pay_apply_subid=#payApplySubid#
		and	seg_no=#segNo#
	</update>

</sqlMap>


text:
OldMonk is an Automation framework for developing tests using Selenium/WebDriver and TestNG

This framework abstracts away the boiler plate code that are needed for setting up any Selenium/WebDriver/TestNG based automation framework. It provides the below abilities:

- Logging
- Generation of screenshots in case of test failure
- Run tests on different browsers/platforms
- Run tests locally, on in-house selenium grid, on sauce labs or on browserstack
- Generate customized reports
- Abstract away driver creation, capability creation based on browser
- Rerun failed test cases
- Inject test data from data source like xml
- Store/retrieve locators from object repositories
- Scalable and Maintainable
- Configurable project parameters like, application url, time waits, selenium grid information etc.

To use the framework, clone the repo and run the command:
```
mvn clean package
```
It will generate `oldmonk-jar-with-dependencies.jar` file. Now create a simple maven project using the command
```
mvn archetype:generate -DgroupId={project-packaging}
   -DartifactId={project-name}
   -DarchetypeArtifactId=maven-archetype-quickstart
   -DinteractiveMode=false
```

Import this project in eclipse and any other Java IDE. Add the `oldmonk-jar-with-dependencies.jar` file to build path.

### Steps to create a new test script

Create a new file `BaseTest.java` in `src/main/java` folder. We'll be using this as a base test class, that all test script classes will extend. This class will contain few configuration methods, that will initialize the project and create appropriate driver. At the end of the test, it will close the driver.

```
package com.pswain.oldmonk.uitests;

import java.util.Properties;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.ITestContext;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeSuite;

import com.pswain.oldmonk.builder.WebCapabilitiesBuilder;
import com.pswain.oldmonk.factory.WebDriverFactory;
import com.pswain.oldmonk.utils.ObjectRepository;
import com.pswain.oldmonk.utils.ProjectConfigurator;

public class BaseTest
{
    protected static Properties config;
    protected WebDriver         driver;

    @BeforeSuite(alwaysRun = true)
    public void beforeSuite(ITestContext context) throws Exception
    {
        config = ProjectConfigurator.initializeProjectConfigurationsFromFile("project.properties");
        ObjectRepository.setRepositoryDirectory(config.getProperty("object.repository.dir"));
    }

    @BeforeClass(alwaysRun = true)
    public void beforeClass(ITestContext context) throws Exception
    {
        final String browser = context.getCurrentXmlTest().getParameter("browser");
        final String version = context.getCurrentXmlTest().getParameter("version");
        final String platform = context.getCurrentXmlTest().getParameter("platform");

        DesiredCapabilities caps = new WebCapabilitiesBuilder().addBrowser(browser)
                .addBrowserDriverExecutablePath(config.getProperty("chrome.driver.path")).addVersion(version)
                .addPlatform(platform).build();

        driver = new WebDriverFactory().createDriver(caps);

        driver.get(config.getProperty("url"));
    }

    @AfterClass(alwaysRun = true)
    public void afterClass(ITestContext context) throws Exception
    {
        if (null != driver)
        {
            driver.close();
            driver.quit();
        }
    }
}

```
### Create a project configuration file

Create a new file `project.properties` in the root of the project and add following  lines:

```
# Base application url
url=http://www.yahoo.com

# Directory where element locators will be stored. All element locator files should end with .properties.
# Locators can be specified in this format: locator_name=locator_strategy,locator
# For ex: mail_link=XPATH,//span[text()='Mail']. Supported locator strategies are 'XPATH', 'ID', 'NAME',
# 'CLASS_NAME', 'TAG_NAME', 'CSS_SELECTOR', 'LINK_TEXT', 'PARTIAL_LINK_TEXT'
object.repository.dir=src/main/resources

# Application modules
application.modules=login,booking,search

# Test Groups
test.groups=smoke,regression

# Number of times to rerun the test in case of test failure. '0' means, failed tests will not be
# executed again
max.retry.count=0

# Path to chromedriver executable file
chrome.driver.path=/Users/pradeepta/Tools/chromedriver
```

### Create Test Script

Create a test script to open browser, navigate to yahoo.com and click on 'mail' link

```
package com.pswain.oldmonk.uitests;

import org.testng.annotations.Test;

import com.pswain.oldmonk.utils.TestDataProvider;

public class TestClass extends BaseTest
{
    @Test(groups = { "smoke" }, dataProvider = "testdataprovider", dataProviderClass = TestDataProvider.class)
    public void testMethod(String email, String password) throws Exception
    {
        HomePage homePage = new HomePage(driver);

        MailLoginPage loginPage = homePage.clickOnMailLink();
        loginPage.typeEmailAddress(email);
        loginPage.typePassword(password);

        MailHomePage mailHomePage = loginPage.clickOnSigninButton();

        // Do something with mail home page
    }
}
```
Note that, email and password parameters are injected into the test method from outside data source. To create the data source, create a new file in `src/main/resources` directory. For example our testdata.xml file looks like this:

```
<?xml version="1.0" encoding="UTF-8"?>

<testdatasuite>
	<testclass name="com.pswain.oldmonk.uitests.TestClass">
		<dataset>
			<email>test@yahoo.com</email>
			<password>mypassword</password>
		</dataset>
	</testclass>
</testdatasuite>
```
You can have any number of `dataset` sections inside `testclass` section. If there are multiple `dataset` sections, test method will be executed multiple times with different `dataset` test data.

## Create few page classes

```
package com.pswain.oldmonk.uitests;

import java.io.IOException;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;

import com.pswain.oldmonk.core.BasePage;
import com.pswain.oldmonk.exception.InvalidLocatorStrategyException;
import com.pswain.oldmonk.exception.PropertyNotFoundException;

public class HomePage extends BasePage
{
    public HomePage(WebDriver driver) throws IOException
    {
        super(driver);
    }

    public MailLoginPage clickOnMailLink() throws PropertyNotFoundException, InvalidLocatorStrategyException
    {
        click("mail_link");
        return PageFactory.initElements(driver, MailLoginPage.class);
    }
}
```

```
package com.pswain.oldmonk.uitests;

import java.io.IOException;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;

import com.pswain.oldmonk.core.BasePage;
import com.pswain.oldmonk.exception.InvalidLocatorStrategyException;
import com.pswain.oldmonk.exception.PropertyNotFoundException;

public class MailLoginPage extends BasePage
{
    public MailLoginPage(WebDriver driver) throws IOException
    {
        super(driver);
    }

    public void typeEmailAddress(String emailAddress) throws PropertyNotFoundException, InvalidLocatorStrategyException
    {
        type("email_text_field", emailAddress);
    }

    public void typePassword(String password) throws PropertyNotFoundException, InvalidLocatorStrategyException
    {
        type("passsword_field", password);
    }

    public MailHomePage clickOnSigninButton() throws PropertyNotFoundException, InvalidLocatorStrategyException
    {
        click("signin_button");
        return PageFactory.initElements(driver, MailHomePage.class);
    }
}

```

## Store element locators

To store element locators create .properties files inside src/main/resources folder. Sample locator file will look like this:

```
mail_link=XPATH,//span[text()='Mail']
email_text_field=ID,email
password_field=NAME,password
```

## Run Test Script

To run the test script, we need a testng xml file. Create an xml file in the root of the directory and add the following content:

```
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Sample Test Suite" verbose="1" parallel="classes" thread-count="1">
	<listeners>
		<listener class-name="com.pswain.oldmonk.listener.ScreenshotListener" />
		<listener class-name="com.pswain.oldmonk.listener.RetryListener" />
	</listeners>

	<parameter name="browser" value="chrome" />
	<parameter name="version" value="56.0" />
	<parameter name="platform" value="windows 8" />
	<parameter name="testdataxml" value="src/main/resources/testdata.xml" />

	<test name="Sample Smoke Tests">
		<groups>
			<run>
				<include name="smoke" />
			</run>
		</groups>

		<packages>
			<package name="com.pswain.oldmonk.uitests" />
		</packages>

	</test>
</suite>
```
At this point, chrome browser will be launched and test will be executed. Reports will be generated inside test-output folder. Currently supported browsers are `firefox`, `chrome` and `ie`.

# Additional Information

## Creating browser profile

We can set different profile parameters for different browsers using browser profiles. Currently supported browser profiles are ChromeBrowserProfile, FirefoxBrowserProfile and IEBrowserProfile. To use a profile, use it like this:

```
FirefoxBrowserProfile ffProfile = new FirefoxBrowserProfile();

ffProfile.setAcceptUntrustedCertificates(true).showDownloadManagerWhenStarting(false)
                .setDownloadDirectory("/Users/pradeepta/Downloads");

DesiredCapabilities caps = new WebCapabilitiesBuilder().addBrowser(browser)
                .addBrowserDriverExecutablePath(config.getProperty("gecko.driver.path")).addVersion(version)
                .addPlatform(platform).addBrowserProfile(ffProfile).build();

driver = new WebDriverFactory().createDriver(caps);

```
## Using proxy

To access the websites using proxy, use it like:

```
DesiredCapabilities caps = new WebCapabilitiesBuilder().addBrowser(browser).addProxy("192.168.3.60", 5678).
                .addBrowserDriverExecutablePath(config.getProperty("gecko.driver.path")).addVersion(version)
                .addPlatform(platform).addBrowserProfile(ffProfile).build();
```

## Running tests using selenium GRID

Assuming that selenium Grid is configued on localhost and is running on port 4444, you can run your tests on grid using `GridUrlBuilder`

```
URL remoteHubUrl = new SeleniumGridUrlBuilder().addProtocol(Protocol.HTTP).addSeleniumHubHost("127.0.0.1")
                .addSeleniumHubPort(4444).build();

driver = new WebDriverFactory().createDriver(remoteHubUrl, caps);
```

## Supported element actions

To check the supported element actions/supported selenium commands see [BasePage.java](src/main/java/com/pswain/oldmonk/core/BasePage.java)

## Failure screenshot

In case of test failure, the framework will generate the failure screenshot and will copy the file to target folder

## Logging

To capture logs, initialize the logger in `@BeforeClass` like this:

```
LoggerUtils.startTestLogging(this.getClass().getSimpleName());
```

This will create a new file in logs folder with the name of test class being executed, and will capture all logs in that file. Ideally it's a good idea to capture the test script logs in separate log files, instead of putting all logs inside a huge log file. It helps in debugging issues faster.

To stop logging, in `@AfterClass` add a line like this:

```
LoggerUtils.stopTestLogging();
```

## Reporting (Alpha)

You can create custom reports by using the [ReporterAPI](src/main/java/com/pswain/oldmonk/core/ReporterAPI.java). Use the api like this:

```
public class HTMLReporter extends TestListenerAdapter implements IReporter
{
    ReporterAPI api;
    PrintWriter pw;

    @Override
    public void generateReport(List<XmlSuite> arg0, List<ISuite> arg1, String arg2)
    {
        try
        {
            api = new ReporterAPI(arg0, arg1, arg2);
        } catch (IOException e)
        {
            e.printStackTrace();
        }

        try
        {
            pw = new PrintWriter(new File("result.html"));
        } catch (FileNotFoundException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        pw.write("<html><head>Report</head><body>");
        pw.write(api.getParallelRunParameter() + "<br/>" + api.getSuccessPercentageForSuite());
        pw.write(api.getSuiteName() + "<br/>" + api.getTotalFailedMethodsForSuite());

        List<String> testNames = api.getAllTestNames();
        for(String test:testNames){
            pw.write("Test Name: " + test + "<br/>");
            ITestNGMethod[] methods = api.getAllMethodsForTest(test);
            for(ITestNGMethod m: methods){
                pw.println(m.getMethodName());
                pw.println(api.getFailedTestScreenshotPath(test, m.getMethodName()));
                pw.println(api.getTestFailureStackTrace(test, m.getMethodName()));
            }
        }

        pw.write("</body></html>");
        pw.flush();
        pw.close();
    }
}
```

To generate the report, add the listener to testng listener section

```
<listeners>
	<listener class-name="com.pswain.oldmonk.HTMLReporter" />
</listeners>
```


text:
#ifndef FG3DMESHIO_HPP
#define FG3DMESHIO_HPP

#include "FgString.hpp"
#include "Fg3dMesh.hpp"

namespace Fg {

enum struct     MeshFormat
{
    tri,        // FaceGen
    fgmesh,     // FaceGen
    wobj,       // Wavefront OBJ
    dae,        // Collada
    fbxA,       // Filmbox ASCII version
    fbxB,       // Filmbox binary version
    ma,         // Maya ASCII
    lwo,        // Lightwave object
    wrl,        // VRML
    stl,        // 3D Systems stereolithography
    _3ds,       // Autodesk 3D Studio
    xsi,        // Softimage ASCII
};
typedef Svec<MeshFormat>    MeshFormats;

MeshFormat          getMeshFormat(String const & ext);
bool                meshFormatSupportsMulti(MeshFormat);    // true if format supports multiple vertex lists
String              getMeshFormatExt(MeshFormat);
String              getMeshFormatName(MeshFormat);
MeshFormats         getMeshNativeFormats();                 // FaceGen formats (fgmesh,tri) are fully supported
MeshFormats         getMeshExportFormats();                 // save formats not including FaceGen formats
String              getClOptionsString(MeshFormats const &);
String              getMeshLoadExtsCLDescription();
Strings             meshExportFormatsWithMorphs();
// Includes 'tri':
std::string         getMeshSaveExtsCLDescription();

Mesh                loadMesh(String8 const & fname);
Meshes              loadMeshes(String8 const & fname);              // includes multi-mesh formats
// If a loadable mesh extension for the given base name can be found the mesh will be loaded and
// the function will return true. False otherwise:
bool                loadMeshAnyFormat_(String8 const & baseName,Mesh & returned);
Mesh                loadMeshAnyFormat(String8 const & fname);       // As above but throws if no mesh found
// Loads both mesh and albedo map (if present) and specular map (if present):
Mesh                loadMeshMaps(String8 const & baseName);
// Saves mesh and loaded images to format given by extension:
void                saveMesh(Mesh const & mesh,String8 const & fname,String const & imgFormat="png");
// saves mesh AND images:
// Note that meshes and/or surfaces may be merged and other data may be lost
// depending on the format (see comments below per-format).
void                saveMergeMesh(Meshes const & meshes,String8 const & fname,String const & imgFormat="png");

// FaceGen mesh format load / save:
Mesh                loadFgmesh(String8 const & fname);
void                saveFgmesh(String8 const & fname,Mesh const & mesh);
// FaceGen legacy mesh format load / save:
Mesh                loadTri(std::istream & is);
Mesh                loadTri(String8 const & fname);
Mesh                loadTri(String8 const & meshFile,String8 const & texFile);
void                saveTri(String8 const & fname,Mesh const & mesh);       // merges all surfaces

enum struct     SpatialUnit { millimetre, centimetre, metre };
String              inMetresStr(SpatialUnit);
String              toStr(SpatialUnit);

// Third party mesh formats:

// Load from Wavefront OBJ file. Only supports polygonal meshes (no smooth curves):
Mesh                loadWObj(String8 const & filename);
// Save to Wavefront OBJ file. OBJ does not support morphs or units and multiple vertex lists are not
// properly supported, even though multiple meshes can be passed as an argument:
void                saveWObj(String8 const & filename,Meshes const & meshes,String imgFormat = "png");
void                injectVertsWObj(String8 const & inName,Vec3Fs const & verts,String8 const & outName);
// Ignores morphs:
void                saveVrml(String8 const & filename,Meshes const & meshes,String imgFormat = "png");
Meshes              loadFbx(String8 const & filename);      // FBX is a multi-mesh format
// Meshes with shared morphs must be merged as different surfaces into a single Mesh for the
// morphs to be unified in FBX (as imported into Unity). Unity will ignore albedo map file
// references so they must be manually added:
void                saveFbxAscii(String8 const & filename,Meshes const & meshes,String imgFormat = "png");
// Inject updated vertex positions into an existing FBX binary with an identical vertex lists:
void                injectVertsFbxBin(String8 const & inFile,Vec3Fs const & verts,String8 const & outFile);
// All surfaces are merged during write, ignores UVs, textures, morphs, etc.:
void                saveStl(String8 const & fname,Meshes const & meshes);
// morph targets are also saved:
void                saveLwo(String8 const & fname,Meshes const & meshes,String imgFormat = "png");
// morph targets are also saved:
void                saveMa(String8 const & fname,Meshes const & meshes,String imgFormat = "png");
// morph targets are also saved:
void                saveXsi(String8 const & fname,Meshes const & meshes,String imgFormat = "png");
// 3DS:
// * No morph targets
// * No quads
// * Splits UV seams
// * 8.3 tex names only
// * 2^16 max verts & tris
void                save3ds(String8 const & fname,Meshes meshes,String imgFormat = "png");
// Vertices & surfaces must be merged to a single list but tex images are specified per facet.
// Currently saves all facets as tris but can easily be changed to preverve quads:
void                savePly(String8 const & fname,Meshes const & meshes,String imgFormat = "png");
// Collada. Does not yet support morphs.
void                saveDae(
    String8 const &     fname,
    Meshes const &      meshes,
    String              imgFormat = "png",
    SpatialUnit         unit=SpatialUnit::millimetre);

}

#endif


text:
package com.spotify.heroic.metric.bigtable;

import com.google.cloud.bigtable.config.BigtableOptions;
import com.google.cloud.bigtable.config.BulkOptions;
import com.google.cloud.bigtable.config.CredentialOptions;
import com.google.cloud.bigtable.config.RetryOptions;
import com.google.cloud.bigtable.grpc.BigtableSession;
import com.google.common.collect.ImmutableList;
import com.spotify.heroic.bigtable.grpc.Status;
import com.spotify.heroic.metric.bigtable.api.BigtableDataClient;
import com.spotify.heroic.metric.bigtable.api.BigtableDataClientImpl;
import com.spotify.heroic.metric.bigtable.api.BigtableMutator;
import com.spotify.heroic.metric.bigtable.api.BigtableMutatorImpl;
import com.spotify.heroic.metric.bigtable.api.BigtableTableAdminClient;
import com.spotify.heroic.metric.bigtable.api.BigtableTableTableAdminClientImpl;
import eu.toolchain.async.AsyncFramework;
import eu.toolchain.async.AsyncFuture;
import java.util.Optional;
import java.util.concurrent.Callable;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

@ToString(of = {"project", "instance", "credentials"})
@RequiredArgsConstructor
public class BigtableConnectionBuilder implements Callable<BigtableConnection> {
    private static final String USER_AGENT = "heroic";

    private final String project;
    private final String instance;

    private final CredentialsBuilder credentials;

    private final AsyncFramework async;

    private final boolean disableBulkMutations;
    private final int flushIntervalSeconds;
    private final Optional<Integer> batchSize;

    @Override
    public BigtableConnection call() throws Exception {
        final CredentialOptions credentials = this.credentials.build();

        final RetryOptions retryOptions = new RetryOptions.Builder()
            .addStatusToRetryOn(Status.Code.UNKNOWN)
            .setAllowRetriesWithoutTimestamp(true)
            .build();

        final BulkOptions bulkOptions = batchSize
            .map(integer -> new BulkOptions.Builder().setBulkMaxRowKeyCount(integer).build())
            .orElseGet(() -> new BulkOptions.Builder().build());

        final BigtableOptions options = new BigtableOptions.Builder()
            .setProjectId(project)
            .setInstanceId(instance)
            .setUserAgent(USER_AGENT)
            .setDataChannelCount(64)
            .setCredentialOptions(credentials)
            .setRetryOptions(retryOptions)
            .setBulkOptions(bulkOptions)
            .build();

        final BigtableSession session = new BigtableSession(options);

        final BigtableTableAdminClient adminClient =
            new BigtableTableTableAdminClientImpl(async, session.getTableAdminClient(), project,
                instance);

        final BigtableMutator mutator =
            new BigtableMutatorImpl(async, session, disableBulkMutations, flushIntervalSeconds);

        final BigtableDataClient client =
            new BigtableDataClientImpl(async, session, mutator, project, instance);

        return new GrpcBigtableConnection(async, project, instance, session, mutator, adminClient,
            client);
    }

    @RequiredArgsConstructor
    @ToString(of = {"project", "instance"})
    public static class GrpcBigtableConnection implements BigtableConnection {
        private final AsyncFramework async;
        private final String project;
        private final String instance;

        final BigtableSession session;
        final BigtableMutator mutator;
        final BigtableTableAdminClient tableAdminClient;
        final BigtableDataClient dataClient;

        @Override
        public BigtableTableAdminClient tableAdminClient() {
            return tableAdminClient;
        }

        @Override
        public BigtableDataClient dataClient() {
            return dataClient;
        }

        @Override
        public AsyncFuture<Void> close() {
            final AsyncFuture<Void> closeSession = async.call(() -> {
                session.close();
                return null;
            });

            return async.collectAndDiscard(ImmutableList.of(mutator.close(), closeSession));
        }
    }
}


text:
<?php
/**
 * Template part for displaying videos page.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package HUT_SCTV_Underscore
 */

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

			<?php
				$video = new Vidio();
				$video->vidio_page();
			?>

<?php echo get_the_title() ?>

				<?php the_content(); ?>

					<img class="img-responsive center-block" src="<?php echo get_stylesheet_directory_uri() ?>/asset/latest_video.png" alt="latest video">

					<?php
						$vod = new Vidio();
						$vod->display_latest();
					?>


text:
ALTER TABLE snittlistan.key_value_property
    DROP CONSTRAINT IF EXISTS key_value_property_key_key;
CREATE UNIQUE INDEX published_task_tenant_uk ON
snittlistan.key_value_property(tenant_id, key);


text:
Gohufont TrueType
====================

A font for programming and terminal use.

TrueType automatically traced, with available bitmaps in heights of 11 and 14 pixels.

Copyright 2010 by Hugo Chargois (http://font.gohu.eu)

Converted by Guilherme Maeda (github.com/koemaeda)

LICENSE
This font is released under the terms of the WTFPL (see COPYING-LICENSE).

THANKS AND AKNOWLEDGMENTS
The Unicode versions of the 11px font are based extensively on the fixed 6x10 font by Markus Kuhn (http://www.cl.cam.ac.uk/~mgk25/ucs-fonts.html).
I used the Terminus font in 14 px with great satisfaction for a long time before I decided to make gohufont 14 px, so it surely inspired me and they may share some similarities in appearance. It is not a derivative work though. Thanks to Dimitar Zhekov for his great font.


text:
namespace lldb_private {

class ClassDescriptorV2 : public ObjCLanguageRuntime::ClassDescriptor {
public:
  friend class lldb_private::AppleObjCRuntimeV2;

  ~ClassDescriptorV2() override = default;

  ConstString GetClassName() override;

  ObjCLanguageRuntime::ClassDescriptorSP GetSuperclass() override;

  ObjCLanguageRuntime::ClassDescriptorSP GetMetaclass() const override;

  bool IsValid() override {
    return true; // any Objective-C v2 runtime class descriptor we vend is valid
  }

  // a custom descriptor is used for tagged pointers
  bool GetTaggedPointerInfo(uint64_t *info_bits = nullptr,
                            uint64_t *value_bits = nullptr,
                            uint64_t *payload = nullptr) override {
    return false;
  }

  uint64_t GetInstanceSize() override;

  ObjCLanguageRuntime::ObjCISA GetISA() override { return m_objc_class_ptr; }

  bool Describe(
      std::function<void(ObjCLanguageRuntime::ObjCISA)> const &superclass_func,
      std::function<bool(const char *, const char *)> const
          &instance_method_func,
      std::function<bool(const char *, const char *)> const &class_method_func,
      std::function<bool(const char *, const char *, lldb::addr_t,
                         uint64_t)> const &ivar_func) const override;

  size_t GetNumIVars() override {
    GetIVarInformation();
    return m_ivars_storage.size();
  }

  iVarDescriptor GetIVarAtIndex(size_t idx) override {
    if (idx >= GetNumIVars())
      return iVarDescriptor();
    return m_ivars_storage[idx];
  }

protected:
  void GetIVarInformation();

private:
  static const uint32_t RW_REALIZED = (1 << 31);

  struct objc_class_t {
    ObjCLanguageRuntime::ObjCISA m_isa; // The class's metaclass.
    ObjCLanguageRuntime::ObjCISA m_superclass;
    lldb::addr_t m_cache_ptr;
    lldb::addr_t m_vtable_ptr;
    lldb::addr_t m_data_ptr;
    uint8_t m_flags;

    objc_class_t()
        : m_isa(0), m_superclass(0), m_cache_ptr(0), m_vtable_ptr(0),
          m_data_ptr(0), m_flags(0) {}

    void Clear() {
      m_isa = 0;
      m_superclass = 0;
      m_cache_ptr = 0;
      m_vtable_ptr = 0;
      m_data_ptr = 0;
      m_flags = 0;
    }

    bool Read(Process *process, lldb::addr_t addr);
  };

  struct class_ro_t {
    uint32_t m_flags;
    uint32_t m_instanceStart;
    uint32_t m_instanceSize;
    uint32_t m_reserved;

    lldb::addr_t m_ivarLayout_ptr;
    lldb::addr_t m_name_ptr;
    lldb::addr_t m_baseMethods_ptr;
    lldb::addr_t m_baseProtocols_ptr;
    lldb::addr_t m_ivars_ptr;

    lldb::addr_t m_weakIvarLayout_ptr;
    lldb::addr_t m_baseProperties_ptr;

    std::string m_name;

    bool Read(Process *process, lldb::addr_t addr);
  };

  struct class_rw_t {
    uint32_t m_flags;
    uint32_t m_version;

    lldb::addr_t m_ro_ptr;
    union {
      lldb::addr_t m_method_list_ptr;
      lldb::addr_t m_method_lists_ptr;
    };
    lldb::addr_t m_properties_ptr;
    lldb::addr_t m_protocols_ptr;

    ObjCLanguageRuntime::ObjCISA m_firstSubclass;
    ObjCLanguageRuntime::ObjCISA m_nextSiblingClass;

    bool Read(Process *process, lldb::addr_t addr);
  };

  struct method_list_t {
    uint32_t m_entsize;
    uint32_t m_count;
    lldb::addr_t m_first_ptr;

    bool Read(Process *process, lldb::addr_t addr);
  };

  struct method_t {
    lldb::addr_t m_name_ptr;
    lldb::addr_t m_types_ptr;
    lldb::addr_t m_imp_ptr;

    std::string m_name;
    std::string m_types;

    static size_t GetSize(Process *process) {
      size_t ptr_size = process->GetAddressByteSize();

      return ptr_size    // SEL name;
             + ptr_size  // const char *types;
             + ptr_size; // IMP imp;
    }

    bool Read(Process *process, lldb::addr_t addr);
  };

  struct ivar_list_t {
    uint32_t m_entsize;
    uint32_t m_count;
    lldb::addr_t m_first_ptr;

    bool Read(Process *process, lldb::addr_t addr);
  };

  struct ivar_t {
    lldb::addr_t m_offset_ptr;
    lldb::addr_t m_name_ptr;
    lldb::addr_t m_type_ptr;
    uint32_t m_alignment;
    uint32_t m_size;

    std::string m_name;
    std::string m_type;

    static size_t GetSize(Process *process) {
      size_t ptr_size = process->GetAddressByteSize();

      return ptr_size            // uintptr_t *offset;
             + ptr_size          // const char *name;
             + ptr_size          // const char *type;
             + sizeof(uint32_t)  // uint32_t alignment;
             + sizeof(uint32_t); // uint32_t size;
    }

    bool Read(Process *process, lldb::addr_t addr);
  };

  class iVarsStorage {
  public:
    iVarsStorage();

    size_t size();

    iVarDescriptor &operator[](size_t idx);

    void fill(AppleObjCRuntimeV2 &runtime, ClassDescriptorV2 &descriptor);

  private:
    bool m_filled;
    std::vector<iVarDescriptor> m_ivars;
    std::recursive_mutex m_mutex;
  };

  // The constructor should only be invoked by the runtime as it builds its
  // caches
  // or populates them.  A ClassDescriptorV2 should only ever exist in a cache.
  ClassDescriptorV2(AppleObjCRuntimeV2 &runtime,
                    ObjCLanguageRuntime::ObjCISA isa, const char *name)
      : m_runtime(runtime), m_objc_class_ptr(isa), m_name(name),
        m_ivars_storage() {}

  bool Read_objc_class(Process *process,
                       std::unique_ptr<objc_class_t> &objc_class) const;

  bool Read_class_row(Process *process, const objc_class_t &objc_class,
                      std::unique_ptr<class_ro_t> &class_ro,
                      std::unique_ptr<class_rw_t> &class_rw) const;

  AppleObjCRuntimeV2
      &m_runtime; // The runtime, so we can read information lazily.
  lldb::addr_t m_objc_class_ptr; // The address of the objc_class_t.  (I.e.,
                                 // objects of this class type have this as
                                 // their ISA)
  ConstString m_name;            // May be NULL
  iVarsStorage m_ivars_storage;
};

// tagged pointer descriptor
class ClassDescriptorV2Tagged : public ObjCLanguageRuntime::ClassDescriptor {
public:
  ClassDescriptorV2Tagged(ConstString class_name, uint64_t payload) {
    m_name = class_name;
    if (!m_name) {
      m_valid = false;
      return;
    }
    m_valid = true;
    m_payload = payload;
    m_info_bits = (m_payload & 0xF0ULL) >> 4;
    m_value_bits = (m_payload & ~0x0000000000000000FFULL) >> 8;
  }

  ClassDescriptorV2Tagged(
      ObjCLanguageRuntime::ClassDescriptorSP actual_class_sp,
      uint64_t payload) {
    if (!actual_class_sp) {
      m_valid = false;
      return;
    }
    m_name = actual_class_sp->GetClassName();
    if (!m_name) {
      m_valid = false;
      return;
    }
    m_valid = true;
    m_payload = payload;
    m_info_bits = (m_payload & 0x0FULL);
    m_value_bits = (m_payload & ~0x0FULL) >> 4;
  }

  ~ClassDescriptorV2Tagged() override = default;

  ConstString GetClassName() override { return m_name; }

  ObjCLanguageRuntime::ClassDescriptorSP GetSuperclass() override {
    // tagged pointers can represent a class that has a superclass, but since
    // that information is not
    // stored in the object itself, we would have to query the runtime to
    // discover the hierarchy
    // for the time being, we skip this step in the interest of static discovery
    return ObjCLanguageRuntime::ClassDescriptorSP();
  }

  ObjCLanguageRuntime::ClassDescriptorSP GetMetaclass() const override {
    return ObjCLanguageRuntime::ClassDescriptorSP();
  }

  bool IsValid() override { return m_valid; }

  bool IsKVO() override {
    return false; // tagged pointers are not KVO'ed
  }

  bool IsCFType() override {
    return false; // tagged pointers are not CF objects
  }

  bool GetTaggedPointerInfo(uint64_t *info_bits = nullptr,
                            uint64_t *value_bits = nullptr,
                            uint64_t *payload = nullptr) override {
    if (info_bits)
      *info_bits = GetInfoBits();
    if (value_bits)
      *value_bits = GetValueBits();
    if (payload)
      *payload = GetPayload();
    return true;
  }

  uint64_t GetInstanceSize() override {
    return (IsValid() ? m_pointer_size : 0);
  }

  ObjCLanguageRuntime::ObjCISA GetISA() override {
    return 0; // tagged pointers have no ISA
  }

  // these calls are not part of any formal tagged pointers specification
  virtual uint64_t GetValueBits() { return (IsValid() ? m_value_bits : 0); }

  virtual uint64_t GetInfoBits() { return (IsValid() ? m_info_bits : 0); }

  virtual uint64_t GetPayload() { return (IsValid() ? m_payload : 0); }

private:
  ConstString m_name;
  uint8_t m_pointer_size;
  bool m_valid;
  uint64_t m_info_bits;
  uint64_t m_value_bits;
  uint64_t m_payload;
};

} // namespace lldb_private

#endif // LLDB_SOURCE_PLUGINS_LANGUAGERUNTIME_OBJC_APPLEOBJCRUNTIME_APPLEOBJCCLASSDESCRIPTORV2_H


text:
<!DOCTYPE html>

<title>Tyler Chen Design</title>
<meta name="description" content="I'm Tyler Chen, UW PhD student, and this is a portfolio of my art.">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width user-scalable=no">

<link href="tc.ico" rel="shortcut icon" >
<link href="css/pages.css" rel="stylesheet" type="text/css" media="screen" />

<page>Glitch Art</page>tylerchen

"Glitch art is the aestheticization of digital or analog errors, such as artifacts and other "bugs", by corrupting digital code/data"

I'm currently working on a series of glitches of images taken during my most recent trip to Asia. I spent the past summer studying in Hong Kong, visiting relatives in China, and traveling around east asia. All the images were creating using very basic pixel sorting scripts, which I wrote from scratch using the Python Image Library.


text:
package org.apache.pulsar.tests;

import static org.testng.Assert.assertEquals;
import org.testng.annotations.Test;
import org.testng.internal.annotations.TestAnnotation;

public class AnnotationListenerTest {
    @Test
    void shouldSetDefaultRetryAnalyser() {
        AnnotationListener annotationListener = new AnnotationListener();
        TestAnnotation testAnnotation = new TestAnnotation();
        annotationListener.transform(testAnnotation, null, null, null);
        assertEquals(testAnnotation.getRetryAnalyzerClass(), RetryAnalyzer.class);
    }
}


text:
form {
	font-family: var(--font-family);
	margin: 0 0 20px;
	width: 100%;
}

fieldset {
	appearance: none;
	border: solid 1px var(--divider-color);
	border-radius: var(--border-radius);
	min-width: 0;
	padding: 20px;
	width: 100%;
}

label,
legend {
	font-size: ms(1)rem;
	font-weight: bold;
	margin: 0;
}

input {
	appearance: none;
	background: #fff;
	border-radius: var(--border-radius);
	border: solid 1px var(--divider-color);
	font-size: ms(1)rem;
	font-weight: normal;
	padding: 8px;
	transition: all .1s ease-in-out;
	width: 100%;
}

input:focus {
	border-color: var(--divider-darken-color);
}

input[type="number"] {
	appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
	appearance: none;
}

button,
input[type="button"],
input[type="submit"] {
	background: var(--primary-color);
	border: none;
	border-radius: var(--border-radius);
	color: #fff;
	cursor: pointer;
	display: block;
	font-weight: bold;
	padding: 8px 20px;
	text-align: center;
	width: auto;
}

input[type="button"]:hover,
input[type="button"]:focus,
input[type="submit"]:hover,
input[type="submit"]:focus {
	background: var(--type-primary-color);
}

textarea {
	background: #fff;
	border-radius: var(--border-radius);
	border: solid 1px var(--divider-color);
	font-size: ms(1)rem;
	padding: 8px;
	min-height: 150px;
	resize: none;
	transition: all .1s ease-in-out;
	width: 100%;
}


text:
layout:		property
title:		"name"
schemas:	[entity]
---

# name

---

The name of the person or legal entity to be used for display and reference purposes.


text:
package de.tbressler.waterrower.io.codec;

import de.tbressler.waterrower.io.msg.AbstractMessage;
import de.tbressler.waterrower.io.msg.IMessageInterpreter;
import de.tbressler.waterrower.io.msg.in.DecodeErrorMessage;
import de.tbressler.waterrower.io.msg.interpreter.*;
import de.tbressler.waterrower.log.Log;

import java.util.ArrayList;
import java.util.List;

import static java.nio.charset.StandardCharsets.US_ASCII;
import static java.util.Objects.requireNonNull;

/**
 * Decodes and encodes messages received from or sent to the WaterRower S4/S5 monitor.
 *
 * @author Tobias Bressler
 * @version 1.0
 */
public class MessageParser {

    /* List of message interpreters. */
    private List<IMessageInterpreter> interpreters = new ArrayList<>();

    /**
     * Decodes and encodes messages received from or sent to the WaterRower S4/S5 monitor.
     */
    public MessageParser() {
        createAndAddMessageInterpreters();
    }

    /* Add all message interpreters to this parser. */
    private void createAndAddMessageInterpreters() {
        interpreters.add(new InformationRequestMessageInterpreter());
        interpreters.add(new PulseCountMessageInterpreter());
        interpreters.add(new StrokeMessageInterpreter());
        interpreters.add(new PingMessageInterpreter());
        interpreters.add(new AcknowledgeMessageInterpreter());
        interpreters.add(new ErrorMessageInterpreter());
        interpreters.add(new HardwareTypeMessageInterpreter());
        interpreters.add(new ResetMessageInterpreter());
        interpreters.add(new ConfigureWorkoutMessageInterpreter());
        interpreters.add(new StartCommunicationMessageInterpreter());
        interpreters.add(new ExitCommunicationMessageInterpreter());
    }

    /* For testing purposes only! Returns all interpreters. */
    List<IMessageInterpreter> getInterpreters() {
        return interpreters;
    }

    /**
     * Decodes and encodes messages received from or sent to the WaterRower S4/S5 monitor.
     * Mainly used for test purposes!
     *
     * @param interpreters The interpreters for the different messages, must not be null.
     */
    MessageParser(List<IMessageInterpreter> interpreters) {
        this.interpreters = requireNonNull(interpreters);
    }

    /**
     * Decodes the given byte array to a message object. Returns a DecodeErrorMessage if the message
     * couldn't be decoded.
     *
     * @param bytes The byte array.
     * @return The message object or a DecodeErrorMessage.
     */
    public AbstractMessage decode(byte[] bytes) {

        Log.debug("Parsing message to object.");

        String msg = new String(bytes, US_ASCII);

        String msgIdentifier;
        for (IMessageInterpreter interpreter : interpreters) {

            // Check message identifiers:
            msgIdentifier = interpreter.getMessageIdentifier();
            if (msgIdentifier == null)
                continue;
            if (!msg.startsWith(msgIdentifier))
                continue;

            // Decode message to an object:
            AbstractMessage decodedMsg = interpreter.decode(msg);

            if (decodedMsg != null)
                return decodedMsg;
        }

        return new DecodeErrorMessage(msg);
    }

    /**
     * Encodes the given message to a byte array. Returns null if the message
     * couldn't be encoded.
     *
     * @param msg The message.
     * @return The byte array or null.
     */
    @SuppressWarnings("unchecked")
    public byte[] encode(AbstractMessage msg) {

        Log.debug("Parsing message '"+msg.toString()+"' to bytes.");

        for (IMessageInterpreter interpreter : interpreters) {

            // Check if message type matches:
            if (!interpreter.isSupported(msg))
                continue;

            // Encode object to message:
            String encodedMsg = interpreter.encode(msg);

            if (encodedMsg != null)
                return encodedMsg.getBytes(US_ASCII);
        }

        Log.warn("Message couldn't be encoded! Unknown message type '"+msg.getClass().getName()+"'.");

        return null;
    }

}


text:
require 'mandrill'

module Msg
  class MandrillSendingJob < ActiveJob::Base
    queue_as :default

    def perform(envelope)
      mandrill = Mandrill::API.new Msg.mandrill_api_key
      results = mandrill.messages.send(envelope.for_mandrill)
      response = results.first
      message.mandrill_id = response['_id']
      if response['status'] == "rejected"
        message.bounced = true
        message.rejection_message = response['reject_reason']
      end
      message.sent_at = Time.now
      message.save
    end

  end
end


text:
{% extends "layout.html" %}

{% block page_title %}
 Has your organisation found someone for this job?
{% endblock %}

{% block content %}

      Back

        Has your organisation found someone for this job?

      <form action="./vacancy-list" method="get" class="form">

            <fieldset>

                  <input type="radio" name="filled" value="yes" id="hasroleyes">
                  Yes

Do they have permission to work in the UK?

                    <fieldset>

                          <input type="radio" name="hasLeave" value="yes" id="extending">
                          Yes - they need to extend their leave to remain

                          <input type="radio" name="hasLeave" value="yes" id="switching">
                          Yes - they're switching from another visa

                          <input type="radio" name="hasLeave" value="yes" id="noLeave">
                          No

                    </fieldset>

                  <input type="radio" name="filled" value="no" id="hasroleno">
                  No

            </fieldset>

            <input type="submit" class="button" value="Continue">

      </form>

{% endblock %}


text:
package eagle.security.securitylog.parse;

import org.apache.eagle.security.util.LogParseUtil;
import org.apache.eagle.common.DateTimeUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.Serializable;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class HDFSSecurityLogParser implements Serializable {
    private final static Logger LOG = LoggerFactory.getLogger(HDFSSecurityLogParser.class);

    private final static int LOGDATE_INDEX = 1;
    private final static int LOGATTRS_INDEX = 4;
    private final static String SUCCESSFUL = "successful";
    private final static String USER = "user";
    private final static String ALLOWED = "allowed";
    private final static Pattern loggerPattern = Pattern.compile("^([\\d\\s\\-:,]+)\\s+(\\w+)\\s+(.*):\\s+(.*)");

    public HDFSSecurityLogObject parse(String logLine) throws ParseException {
        Matcher logMatcher = loggerPattern.matcher(logLine);
        if(!logMatcher.find()) return null;

        HDFSSecurityLogObject ret = new HDFSSecurityLogObject();
        String date = logMatcher.group(LOGDATE_INDEX);
        ret.timestamp = DateTimeUtil.humanDateToMilliseconds(logMatcher.group(LOGDATE_INDEX));

        Map<String, String> attrMap = parseAttr(logMatcher.group(LOGATTRS_INDEX));

        if(attrMap == null) return null;

        ret.user = attrMap.get(USER);
        if(attrMap.get(ALLOWED).equals(ALLOWED)) {
            ret.allowed = true;
        } else {
            ret.allowed = false;
        }

        return ret;
    }

    private Map<String, String> parseAttr(String logLine) {
        if(logLine == null) return null;

        Map<String, String> ret = new HashMap<>();
        String [] fields = logLine.split("\\s+");

        if(fields[1].equalsIgnoreCase(SUCCESSFUL)) {
            ret.put(ALLOWED, "allowed");
        } else {
            ret.put(ALLOWED, "denied");
        }

        String user = LogParseUtil.parseUserFromUGI(fields[3]);
        ret.put(USER, user);
        return ret;
    }
}


text:
package com.github.sirikid.cf.core;

import java.util.stream.Stream;

/**
 * Collection of objects.
 *
 * @author Ivan Sokolov
 * @version 1.0.0
 * @param <E> type of elements
 * @since 1.0.0
 */

public interface Collection<E> extends Iterable<E> {
	long count();

	boolean isEmpty();

	boolean nonEmpty();

	Stream<E> stream();

	Stream<E> parallelStream();

	E[] toArray();
}


text:
package Bean;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Random;

import org.genericdao.PrimaryKey;

import jgravatar.Gravatar;
import jgravatar.GravatarDefaultImage;

/**
 * http://en.gravatar.com/site/implement/
 * User generated by hbm2java
 */
@PrimaryKey("userID")
public class User implements Comparable<User> {
	public static final List<String> EXTENSIONS = Collections
			.unmodifiableList(Arrays.asList(new String[] { ".jpg", ".gif",
					".JPG" }));
	private int userID;
	private String userName;
	private String email;
	private String password;
	private String profilePic;
	private int rank;
	private int totalGame=0;
	private int win=0;
	private int lost=0;
	private int draw=0;
	private int salt=0;

	public boolean checkPassword(String password1) {
		System.out.println("salt" + salt);
		System.out.println("check" + password1);
		System.out.println("hashcheck" + hash(password1));
		return password.equals(hash(password1));
	}

	public int getUserID() {
		return userID;
	}

	public String getPassword() {
		return password;
	}

	public String getUserName() {
		return userName;
	}

	public String getEmail() {
		return email;
	}

	public int getSalt() {
		return salt;
	}

	public int hashCode() {
		return email.hashCode();
	}

	public void setUserID(int i) {
		userID = i;
	}

	public void setPassword(String x) {
		password = x;
	}

	public void setPasswordx(String s) {
		salt = newSalt();
		System.out.println("salt" + salt);
		password = hash(s);
		System.out.println("password" + password);
	}

	public void setSalt(int x) {
		salt = x;
	}

	public void setUserName(String s) {
		userName = s;
	}

	public void setEmail(String s) {
		email = s;
	}

	private String hash(String clearPassword) {
		if (salt == 0)
			return null;

		MessageDigest md = null;
		try {
			md = MessageDigest.getInstance("SHA1");
		} catch (NoSuchAlgorithmException e) {
			throw new AssertionError(
					"Can't find the SHA1 algorithm in the java.security package");
		}

		String saltString = String.valueOf(salt);

		md.update(saltString.getBytes());
		md.update(clearPassword.getBytes());
		byte[] digestBytes = md.digest();

		// Format the digest as a String
		StringBuffer digestSB = new StringBuffer();
		for (int i = 0; i < digestBytes.length; i++) {
			int lowNibble = digestBytes[i] & 0x0f;
			int highNibble = (digestBytes[i] >> 4) & 0x0f;
			digestSB.append(Integer.toHexString(highNibble));
			digestSB.append(Integer.toHexString(lowNibble));
		}
		String digestStr = digestSB.toString();

		return digestStr;
	}

	private int newSalt() {
		Random random = new Random();
		return random.nextInt(8192) + 1; // salt cannot be zero
	}

	@Override
	public int compareTo(User other) {
		// Order first by lastName and then by firstName
		//int ranki=other.getRank();
		if(rank-other.getRank()==0){
			int c = userName.compareTo(other.userName);
			if (c != 0)
				return c;
		}
		return rank-other.getRank();
	}

	public boolean equals(Object obj) {
		if (obj instanceof User) {
			User other = (User) obj;
			return userName.equals(other.userName);
		}
		return false;
	}

	public String getProfilePic() {
		return profilePic;
	}

//	public void setProfilePic(String profilePic) {
//		this.profilePic = profilePic;
//	}

	public int getRank() {
		return rank;
	}

	public void setRank(int rank) {
		this.rank = rank;
	}

	public int getTotalGame() {
		return totalGame;
	}

	public void setTotalGame(int totalGame) {
		this.totalGame = totalGame;
	}

	public int getWin() {
		return win;
	}

	public void setWin(int win) {
		this.win = win;
	}

	public int getLost() {
		return lost;
	}

	public void setLost(int lost) {
		this.lost = lost;
	}

	public int getDraw() {
		return draw;
	}

	public void setDraw(int draw) {
		this.draw = draw;
	}

	public void setProfilePic(String url) {
		  this.profilePic = url;
	}

	public void setProfilePicx(String email) {
		  Gravatar gravatar = new Gravatar();
		  gravatar.setSize(120);
		  gravatar.setDefaultImage(GravatarDefaultImage.IDENTICON);
		  String url = gravatar.getUrl(email);
		  System.out.println(url);
		  this.profilePic = url;
	}

	public void setpersonalPic(String path){
		this.profilePic=path;
	}
}

//	public byte[] profilePic(String ImageName){
//		File fnew=new File(ImageName);
//		BufferedImage originalImage;
//		try {
//			originalImage = ImageIO.read(fnew);
//		ByteArrayOutputStream baos=new ByteArrayOutputStream();
//		ImageIO.write(originalImage, "jpg", baos );
//		byte[] imageInByte=baos.toByteArray();
//		return imageInByte;
//		} catch (IOException e) {
//			// TODO Auto-generated catch block
//			return null;
//		}
//	}

//	private String ProfilePic(String email){
//		  Gravatar gravatar = new Gravatar();
//		  gravatar.setSize(120);
//		  gravatar.setDefaultImage(GravatarDefaultImage.IDENTICON);
//		  String url = gravatar.getUrl(email);
//		  System.out.println(url);
//		  //byte[] jpg = gravatar.download(email);
//	      return url;
//	}

//	  @SuppressWarnings("unused")
//	  private void setBlob(Blob imageBlob) {
//	    this.profilePic = toByteArray(imageBlob);
//	  }
//	  @SuppressWarnings("unused")
//	  private Blob getBlob(){
//	    return Hibernate.createBlob(this.profilePic);
//	  }
//
//	  private byte[] toByteArray(Blob fromImageBlob) {
//	    ByteArrayOutputStream baos = new ByteArrayOutputStream();
//	    try {
//	      return toByteArrayImpl(fromImageBlob, baos);
//	    } catch (Exception e) {
//	    }
//	    return null;
//	  }
//
//	  private byte[] toByteArrayImpl(Blob fromImageBlob,
//	      ByteArrayOutputStream baos) throws SQLException, IOException {
//	    byte buf[] = new byte[4000];
//	    int dataSize;
//	    InputStream is = fromImageBlob.getBinaryStream();
//
//	    try {
//	      while((dataSize = is.read(buf)) != -1) {
//	        baos.write(buf, 0, dataSize);
//	      }
//	    } finally {
//	      if(is != null) {
//	        is.close();
//	      }
//	    }
//	    return baos.toByteArray();
//	  }
//


text:
namespace display {
class DisplayMode;
struct GammaRampRGBEntry;
}

namespace ui {

class DrmDeviceManager;
class DrmDisplay;
class ScreenManager;

class DrmGpuDisplayManager {
 public:
  DrmGpuDisplayManager(ScreenManager* screen_manager,
                       DrmDeviceManager* drm_device_manager);
  ~DrmGpuDisplayManager();

  // Sets a callback that will be notified when display configuration may have
  // changed to clear the overlay configuration cache.
  void SetClearOverlayCacheCallback(base::RepeatingClosure callback);

  // Returns a list of the connected displays. When this is called the list of
  // displays is refreshed.
  MovableDisplaySnapshots GetDisplays();

  // Takes/releases the control of the DRM devices.
  bool TakeDisplayControl();
  void RelinquishDisplayControl();

  bool ConfigureDisplay(int64_t id,
                        const display::DisplayMode& display_mode,
                        const gfx::Point& origin);
  bool DisableDisplay(int64_t id);
  bool GetHDCPState(int64_t display_id, display::HDCPState* state);
  bool SetHDCPState(int64_t display_id, display::HDCPState state);
  void SetColorMatrix(int64_t display_id,
                      const std::vector<float>& color_matrix);
  void SetBackgroundColor(int64_t display_id,
                          const uint64_t background_color);
  void SetGammaCorrection(
      int64_t display_id,
      const std::vector<display::GammaRampRGBEntry>& degamma_lut,
      const std::vector<display::GammaRampRGBEntry>& gamma_lut);
  void SetPrivacyScreen(int64_t display_id, bool enabled);

 private:
  DrmDisplay* FindDisplay(int64_t display_id);

  // Notify ScreenManager of all the displays that were present before the
  // update but are gone after the update.
  void NotifyScreenManager(
      const std::vector<std::unique_ptr<DrmDisplay>>& new_displays,
      const std::vector<std::unique_ptr<DrmDisplay>>& old_displays) const;

  ScreenManager* const screen_manager_;         // Not owned.
  DrmDeviceManager* const drm_device_manager_;  // Not owned.

  std::vector<std::unique_ptr<DrmDisplay>> displays_;

  base::RepeatingClosure clear_overlay_cache_callback_;

  DISALLOW_COPY_AND_ASSIGN(DrmGpuDisplayManager);
};

}  // namespace ui

#endif  // UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_DISPLAY_MANAGER_H_


text:
SCORE GlobalAlign4(ProfPos *PA, unsigned uLengthA, ProfPos *PB,
  unsigned uLengthB, PWPath &Path);

SCORE AlignTwoProfs(
  const ProfPos *PA, unsigned uLengthA, WEIGHT wA,
  const ProfPos *PB, unsigned uLengthB, WEIGHT wB,
  PWPath &Path, ProfPos **ptrPout, unsigned *ptruLengthOut)
	{
	assert(uLengthA < 100000);
	assert(uLengthB < 100000);

	float r = (float) uLengthA/ (float) (uLengthB + 1); // +1 to prevent div 0
	if (r < 1)
		r = 1/r;

	SCORE Score = GlobalAlign(PA, uLengthA, PB, uLengthB, Path);

	AlignTwoProfsGivenPath(Path, PA, uLengthB, wA/(wA + wB), PB, uLengthB, wB/(wA + wB),
	  ptrPout, ptruLengthOut);

#if	HYDRO
	if (ALPHA_Amino == g_Alpha)
		Hydro(*ptrPout, *ptruLengthOut);
#endif
	return Score;
	}


text:
using namespace cuauv::serial::cli;

int main(int argc, char* argv[]) {
    return CommandDispatcher::run(argc, argv);
}


text:
#include "..\Resource.h"
// CPluginsPanelDlg dialog

#include "PluginsPanelCore.h"
#include "..\Manager\ContainerCore.h"

#include "..\UIControls\InfoBar.h"
#include "..\StandartControls\ATreeCtrl.h"
#include "afxcmn.h"

class CPluginsPanelDlg : public CDialog, public IPluginsPanelControl
{
	DECLARE_DYNAMIC(CPluginsPanelDlg)

public:
	CPluginsPanelDlg(CWnd* pParent = NULL);   // standard constructor
	virtual ~CPluginsPanelDlg();

// Dialog Data
	enum { IDD = IDD_PLUGINS_PANEL };

	CInfoBar			mPanelInfoBar;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

// IPluginsPanel declarations section
public:
	virtual BOOL			CreatePanelDlg(CWnd * pWnd);
	virtual BOOL			ShowPanel(int iCmdShow);
	virtual void			MovePanel(int iX, int iY, int iWidth, int iHeight);
	virtual void			GetPanelRect(CRect* pRect);

	virtual void			SetAppController(IAppController* pController);

// IObject declarations section
public:
	virtual CString			GetClassString();
	virtual void			QueryInterface(int iIDD, void ** ppvObject);

	virtual BOOL OnInitDialog();

	void					EnablePluginControls(BOOL bEnable);

	CTreeCtrl				mPluginsTree;

	HTREEITEM				htiRoot;
	HTREEITEM				htiPluginsRoot;
	HTREEITEM				htiWrongsRoot;

	void					SetAppFolder(CString& csFolder);
	void					SetPluginsContainer(IPluginsContainer* pContainer);

	void					CreatePluginsTreeHeader();
	void					ShowPluginsTree();
	void					CleanPluginsTree();

	void					ShowPluginBar(CPluginInstance* pInstance);

private:
	IAppController*			pAppController;
	IPluginsContainer*		pPluginsContainer;
	CString					csAppFolder;

	int iPropWndsCount;

public:
	afx_msg void OnBnClickedStartPlugin();
	afx_msg void OnBnClickedPluginProperties();
	afx_msg void OnBnClickedRefreshPluginsTree();
	int mPluginsCount;
	afx_msg void OnTvnSelchangedPluginsTree(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnNMDblclkPluginsTree(NMHDR *pNMHDR, LRESULT *pResult);
};


text:
/*global define*/

/**
 * Movable is a mix-in module that adds "move" capabilites to an object.
 *
 * @param {Publisher} publisher Extends the object with publish event capabilites.
 * @param {WmtUtil} utils Utilties.
 * @param {Events} events Constants.
 * @returns {Movable}
 *
 * @author Bruce Schubert
 */
define(['knockout',
        'model/util/Publisher',
        'model/util/WmtUtil',
        'model/Events'],
    function (ko,
              publisher,
              utils,
              events) {
        "use strict";
        var Movable = {
            moveStarted: function () {
                if (this.isMovable) {
                    this.fire(events.EVENT_OBJECT_MOVE_STARTED, this);
                }
            },
            moveToLatLon: function (latitude, longitude) {
                if (this.isMovable) {
                    if (ko.isObservable(this.latitude)) {
                        this.latitude(latitude);
                    } else {
                        this.latitude = latitude;
                    }
                    if (ko.isObservable(this.longitude)) {
                        this.longitude(longitude);
                    } else {
                        this.longitude = longitude;
                    }
                    this.fire(events.EVENT_OBJECT_MOVED, this);
                }
            },
            moveFinished: function () {
                if (this.isMovable) {
                    this.fire(events.EVENT_OBJECT_MOVE_FINISHED, this);
                }
            },
            /**
             * Adds the the movable capabilities to the given object.
             * @param {Object} o The object that will become movable.
             */
            makeMovable: function (o) {
                // Ensure we don't duplicate
                if (o.moveToLatLon) {
                    return; // o is already movable
                }
                // Add the functions
                var i;
                for (i in Movable) {
                    if (Movable.hasOwnProperty(i) && typeof Movable[i] === 'function') {
                        if (Movable[i] === this.makeMovable) {
                            continue;
                        }
                        o[i] = Movable[i];
                    }
                }
                // Add the properties
                o.isMovable = ko.observable(true);
                if (typeof o.latitude === 'undefined') {
                    o.latitude = ko.observable();
                }
                if (typeof o.longitude === 'undefined') {
                    o.longitude = ko.observable();
                }
                // Add the Publisher capability so that events can be generated.
                publisher.makePublisher(o);
            }
        };
        return Movable;
    }
);


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeCubeMapUniform" inherits="VisualShaderNodeTextureUniform" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
	<brief_description>
		A [CubeMap] uniform node to be used within the visual shader graph.
	</brief_description>
	<description>
		Translated to [code]uniform samplerCube[/code] in the shader language. The output value can be used as port for [VisualShaderNodeCubeMap].
	</description>
	<tutorials>
	</tutorials>
	<methods>
	</methods>
	<constants>
	</constants>
</class>


text:
package hydrograph.engine.jaxb.cumulate;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import hydrograph.engine.jaxb.commontypes.TypeFieldName;
import hydrograph.engine.jaxb.commontypes.TypeSortOrder;

/**
 *
Java class for type-seconday-key-fields-attributes complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="type-seconday-key-fields-attributes">
 *   <complexContent>
 *     <extension base="{hydrograph/engine/jaxb/commontypes}type-field-name">
 *       <attribute name="order" type="{hydrograph/engine/jaxb/commontypes}type-sort-order" default="asc" />
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "type-seconday-key-fields-attributes", namespace = "hydrograph/engine/jaxb/cumulate")
public class TypeSecondayKeyFieldsAttributes
    extends TypeFieldName
{

    @XmlAttribute(name = "order")
    protected TypeSortOrder order;

    /**
     * Gets the value of the order property.
     *
     * @return
     *     possible object is
     *     {@link TypeSortOrder }
     *
     */
    public TypeSortOrder getOrder() {
        if (order == null) {
            return TypeSortOrder.ASC;
        } else {
            return order;
        }
    }

    /**
     * Sets the value of the order property.
     *
     * @param value
     *     allowed object is
     *     {@link TypeSortOrder }
     *
     */
    public void setOrder(TypeSortOrder value) {
        this.order = value;
    }

}


text: export { default } from 'ember-flexberry-gis/components/layers/wms-layer';


text:
'use strict';

var jshint = require('gulp-jshint');
var gulp = require('gulp');
var config = require('../config').lint;

gulp.task('lint', function() {
  return gulp.src(config.src)
    .pipe(jshint())
    .pipe(jshint.reporter('jshint-stylish'));
});


text:
package com.citelic.game.entity.player.content.dialogue.impl.objects;

import com.citelic.game.entity.player.content.controllers.impl.distractions.pvp.CastleWars;
import com.citelic.game.entity.player.content.dialogue.Dialogue;

public class CastleWarsScoreboard extends Dialogue {

	@Override
	public void finish() {

	}

	@Override
	public void run(int interfaceId, int componentId) {
		end();

	}

	@Override
	public void start() {
		CastleWars.viewScoreBoard(player);

	}

}


text:
#include <linux/list.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

#include <media/v4l2-async.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/v4l2-of.h>

#include "xilinx-dma.h"
#include "xilinx-vipp.h"

#define XVIPP_DMA_S2MM				0
#define XVIPP_DMA_MM2S				1

/**
 * struct xvip_graph_entity - Entity in the video graph
 * @list: list entry in a graph entities list
 * @node: the entity's DT node
 * @entity: media entity, from the corresponding V4L2 subdev
 * @asd: subdev asynchronous registration information
 * @subdev: V4L2 subdev
 */
struct xvip_graph_entity {
	struct list_head list;
	struct device_node *node;
	struct media_entity *entity;

	struct v4l2_async_subdev asd;
	struct v4l2_subdev *subdev;
};

/* -----------------------------------------------------------------------------
 * Graph Management
 */

static struct xvip_graph_entity *
xvip_graph_find_entity(struct xvip_composite_device *xdev,
		       const struct device_node *node)
{
	struct xvip_graph_entity *entity;

	list_for_each_entry(entity, &xdev->entities, list) {
		if (entity->node == node)
			return entity;
	}

	return NULL;
}

static int xvip_graph_build_one(struct xvip_composite_device *xdev,
				struct xvip_graph_entity *entity)
{
	u32 link_flags = MEDIA_LNK_FL_ENABLED;
	struct media_entity *local = entity->entity;
	struct media_entity *remote;
	struct media_pad *local_pad;
	struct media_pad *remote_pad;
	struct xvip_graph_entity *ent;
	struct v4l2_of_link link;
	struct device_node *ep = NULL;
	struct device_node *next;
	int ret = 0;

	dev_dbg(xdev->dev, "creating links for entity %s\n", local->name);

	while (1) {
		/* Get the next endpoint and parse its link. */
		next = of_graph_get_next_endpoint(entity->node, ep);
		if (next == NULL)
			break;

		of_node_put(ep);
		ep = next;

		dev_dbg(xdev->dev, "processing endpoint %s\n", ep->full_name);

		ret = v4l2_of_parse_link(ep, &link);
		if (ret < 0) {
			dev_err(xdev->dev, "failed to parse link for %s\n",
				ep->full_name);
			continue;
		}

		/* Skip sink ports, they will be processed from the other end of
		 * the link.
		 */
		if (link.local_port >= local->num_pads) {
			dev_err(xdev->dev, "invalid port number %u on %s\n",
				link.local_port, link.local_node->full_name);
			v4l2_of_put_link(&link);
			ret = -EINVAL;
			break;
		}

		local_pad = &local->pads[link.local_port];

		if (local_pad->flags & MEDIA_PAD_FL_SINK) {
			dev_dbg(xdev->dev, "skipping sink port %s:%u\n",
				link.local_node->full_name, link.local_port);
			v4l2_of_put_link(&link);
			continue;
		}

		/* Skip DMA engines, they will be processed separately. */
		if (link.remote_node == xdev->dev->of_node) {
			dev_dbg(xdev->dev, "skipping DMA port %s:%u\n",
				link.local_node->full_name, link.local_port);
			v4l2_of_put_link(&link);
			continue;
		}

		/* Find the remote entity. */
		ent = xvip_graph_find_entity(xdev, link.remote_node);
		if (ent == NULL) {
			dev_err(xdev->dev, "no entity found for %s\n",
				link.remote_node->full_name);
			v4l2_of_put_link(&link);
			ret = -ENODEV;
			break;
		}

		remote = ent->entity;

		if (link.remote_port >= remote->num_pads) {
			dev_err(xdev->dev, "invalid port number %u on %s\n",
				link.remote_port, link.remote_node->full_name);
			v4l2_of_put_link(&link);
			ret = -EINVAL;
			break;
		}

		remote_pad = &remote->pads[link.remote_port];

		v4l2_of_put_link(&link);

		/* Create the media link. */
		dev_dbg(xdev->dev, "creating %s:%u -> %s:%u link\n",
			local->name, local_pad->index,
			remote->name, remote_pad->index);

		ret = media_create_pad_link(local, local_pad->index,
					       remote, remote_pad->index,
					       link_flags);
		if (ret < 0) {
			dev_err(xdev->dev,
				"failed to create %s:%u -> %s:%u link\n",
				local->name, local_pad->index,
				remote->name, remote_pad->index);
			break;
		}
	}

	of_node_put(ep);
	return ret;
}

static struct xvip_dma *
xvip_graph_find_dma(struct xvip_composite_device *xdev, unsigned int port)
{
	struct xvip_dma *dma;

	list_for_each_entry(dma, &xdev->dmas, list) {
		if (dma->port == port)
			return dma;
	}

	return NULL;
}

static int xvip_graph_build_dma(struct xvip_composite_device *xdev)
{
	u32 link_flags = MEDIA_LNK_FL_ENABLED;
	struct device_node *node = xdev->dev->of_node;
	struct media_entity *source;
	struct media_entity *sink;
	struct media_pad *source_pad;
	struct media_pad *sink_pad;
	struct xvip_graph_entity *ent;
	struct v4l2_of_link link;
	struct device_node *ep = NULL;
	struct device_node *next;
	struct xvip_dma *dma;
	int ret = 0;

	dev_dbg(xdev->dev, "creating links for DMA engines\n");

	while (1) {
		/* Get the next endpoint and parse its link. */
		next = of_graph_get_next_endpoint(node, ep);
		if (next == NULL)
			break;

		of_node_put(ep);
		ep = next;

		dev_dbg(xdev->dev, "processing endpoint %s\n", ep->full_name);

		ret = v4l2_of_parse_link(ep, &link);
		if (ret < 0) {
			dev_err(xdev->dev, "failed to parse link for %s\n",
				ep->full_name);
			continue;
		}

		/* Find the DMA engine. */
		dma = xvip_graph_find_dma(xdev, link.local_port);
		if (dma == NULL) {
			dev_err(xdev->dev, "no DMA engine found for port %u\n",
				link.local_port);
			v4l2_of_put_link(&link);
			ret = -EINVAL;
			break;
		}

		dev_dbg(xdev->dev, "creating link for DMA engine %s\n",
			dma->video.name);

		/* Find the remote entity. */
		ent = xvip_graph_find_entity(xdev, link.remote_node);
		if (ent == NULL) {
			dev_err(xdev->dev, "no entity found for %s\n",
				link.remote_node->full_name);
			v4l2_of_put_link(&link);
			ret = -ENODEV;
			break;
		}

		if (link.remote_port >= ent->entity->num_pads) {
			dev_err(xdev->dev, "invalid port number %u on %s\n",
				link.remote_port, link.remote_node->full_name);
			v4l2_of_put_link(&link);
			ret = -EINVAL;
			break;
		}

		if (dma->pad.flags & MEDIA_PAD_FL_SOURCE) {
			source = &dma->video.entity;
			source_pad = &dma->pad;
			sink = ent->entity;
			sink_pad = &sink->pads[link.remote_port];
		} else {
			source = ent->entity;
			source_pad = &source->pads[link.remote_port];
			sink = &dma->video.entity;
			sink_pad = &dma->pad;
		}

		v4l2_of_put_link(&link);

		/* Create the media link. */
		dev_dbg(xdev->dev, "creating %s:%u -> %s:%u link\n",
			source->name, source_pad->index,
			sink->name, sink_pad->index);

		ret = media_create_pad_link(source, source_pad->index,
					       sink, sink_pad->index,
					       link_flags);
		if (ret < 0) {
			dev_err(xdev->dev,
				"failed to create %s:%u -> %s:%u link\n",
				source->name, source_pad->index,
				sink->name, sink_pad->index);
			break;
		}
	}

	of_node_put(ep);
	return ret;
}

static int xvip_graph_notify_complete(struct v4l2_async_notifier *notifier)
{
	struct xvip_composite_device *xdev =
		container_of(notifier, struct xvip_composite_device, notifier);
	struct xvip_graph_entity *entity;
	int ret;

	dev_dbg(xdev->dev, "notify complete, all subdevs registered\n");

	/* Create links for every entity. */
	list_for_each_entry(entity, &xdev->entities, list) {
		ret = xvip_graph_build_one(xdev, entity);
		if (ret < 0)
			return ret;
	}

	/* Create links for DMA channels. */
	ret = xvip_graph_build_dma(xdev);
	if (ret < 0)
		return ret;

	ret = v4l2_device_register_subdev_nodes(&xdev->v4l2_dev);
	if (ret < 0)
		dev_err(xdev->dev, "failed to register subdev nodes\n");

	return media_device_register(&xdev->media_dev);
}

static int xvip_graph_notify_bound(struct v4l2_async_notifier *notifier,
				   struct v4l2_subdev *subdev,
				   struct v4l2_async_subdev *asd)
{
	struct xvip_composite_device *xdev =
		container_of(notifier, struct xvip_composite_device, notifier);
	struct xvip_graph_entity *entity;

	/* Locate the entity corresponding to the bound subdev and store the
	 * subdev pointer.
	 */
	list_for_each_entry(entity, &xdev->entities, list) {
		if (entity->node != subdev->dev->of_node)
			continue;

		if (entity->subdev) {
			dev_err(xdev->dev, "duplicate subdev for node %s\n",
				entity->node->full_name);
			return -EINVAL;
		}

		dev_dbg(xdev->dev, "subdev %s bound\n", subdev->name);
		entity->entity = &subdev->entity;
		entity->subdev = subdev;
		return 0;
	}

	dev_err(xdev->dev, "no entity for subdev %s\n", subdev->name);
	return -EINVAL;
}

static int xvip_graph_parse_one(struct xvip_composite_device *xdev,
				struct device_node *node)
{
	struct xvip_graph_entity *entity;
	struct device_node *remote;
	struct device_node *ep = NULL;
	int ret = 0;

	dev_dbg(xdev->dev, "parsing node %s\n", node->full_name);

	while (1) {
		ep = of_graph_get_next_endpoint(node, ep);
		if (ep == NULL)
			break;

		dev_dbg(xdev->dev, "handling endpoint %s\n", ep->full_name);

		remote = of_graph_get_remote_port_parent(ep);
		if (remote == NULL) {
			ret = -EINVAL;
			break;
		}

		/* Skip entities that we have already processed. */
		if (remote == xdev->dev->of_node ||
		    xvip_graph_find_entity(xdev, remote)) {
			of_node_put(remote);
			continue;
		}

		entity = devm_kzalloc(xdev->dev, sizeof(*entity), GFP_KERNEL);
		if (entity == NULL) {
			of_node_put(remote);
			ret = -ENOMEM;
			break;
		}

		entity->node = remote;
		entity->asd.match_type = V4L2_ASYNC_MATCH_OF;
		entity->asd.match.of.node = remote;
		list_add_tail(&entity->list, &xdev->entities);
		xdev->num_subdevs++;
	}

	of_node_put(ep);
	return ret;
}

static int xvip_graph_parse(struct xvip_composite_device *xdev)
{
	struct xvip_graph_entity *entity;
	int ret;

	/*
	 * Walk the links to parse the full graph. Start by parsing the
	 * composite node and then parse entities in turn. The list_for_each
	 * loop will handle entities added at the end of the list while walking
	 * the links.
	 */
	ret = xvip_graph_parse_one(xdev, xdev->dev->of_node);
	if (ret < 0)
		return 0;

	list_for_each_entry(entity, &xdev->entities, list) {
		ret = xvip_graph_parse_one(xdev, entity->node);
		if (ret < 0)
			break;
	}

	return ret;
}

static int xvip_graph_dma_init_one(struct xvip_composite_device *xdev,
				   struct device_node *node)
{
	struct xvip_dma *dma;
	enum v4l2_buf_type type;
	const char *direction;
	unsigned int index;
	int ret;

	ret = of_property_read_string(node, "direction", &direction);
	if (ret < 0)
		return ret;

	if (strcmp(direction, "input") == 0)
		type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
	else if (strcmp(direction, "output") == 0)
		type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
	else
		return -EINVAL;

	of_property_read_u32(node, "reg", &index);

	dma = devm_kzalloc(xdev->dev, sizeof(*dma), GFP_KERNEL);
	if (dma == NULL)
		return -ENOMEM;

	ret = xvip_dma_init(xdev, dma, type, index);
	if (ret < 0) {
		dev_err(xdev->dev, "%s initialization failed\n",
			node->full_name);
		return ret;
	}

	list_add_tail(&dma->list, &xdev->dmas);

	xdev->v4l2_caps |= type == V4L2_BUF_TYPE_VIDEO_CAPTURE
			 ? V4L2_CAP_VIDEO_CAPTURE : V4L2_CAP_VIDEO_OUTPUT;

	return 0;
}

static int xvip_graph_dma_init(struct xvip_composite_device *xdev)
{
	struct device_node *ports;
	struct device_node *port;
	int ret;

	ports = of_get_child_by_name(xdev->dev->of_node, "ports");
	if (ports == NULL) {
		dev_err(xdev->dev, "ports node not present\n");
		return -EINVAL;
	}

	for_each_child_of_node(ports, port) {
		ret = xvip_graph_dma_init_one(xdev, port);
		if (ret < 0) {
			of_node_put(port);
			return ret;
		}
	}

	return 0;
}

static void xvip_graph_cleanup(struct xvip_composite_device *xdev)
{
	struct xvip_graph_entity *entityp;
	struct xvip_graph_entity *entity;
	struct xvip_dma *dmap;
	struct xvip_dma *dma;

	v4l2_async_notifier_unregister(&xdev->notifier);

	list_for_each_entry_safe(entity, entityp, &xdev->entities, list) {
		of_node_put(entity->node);
		list_del(&entity->list);
	}

	list_for_each_entry_safe(dma, dmap, &xdev->dmas, list) {
		xvip_dma_cleanup(dma);
		list_del(&dma->list);
	}
}

static int xvip_graph_init(struct xvip_composite_device *xdev)
{
	struct xvip_graph_entity *entity;
	struct v4l2_async_subdev **subdevs = NULL;
	unsigned int num_subdevs;
	unsigned int i;
	int ret;

	/* Init the DMA channels. */
	ret = xvip_graph_dma_init(xdev);
	if (ret < 0) {
		dev_err(xdev->dev, "DMA initialization failed\n");
		goto done;
	}

	/* Parse the graph to extract a list of subdevice DT nodes. */
	ret = xvip_graph_parse(xdev);
	if (ret < 0) {
		dev_err(xdev->dev, "graph parsing failed\n");
		goto done;
	}

	if (!xdev->num_subdevs) {
		dev_err(xdev->dev, "no subdev found in graph\n");
		goto done;
	}

	/* Register the subdevices notifier. */
	num_subdevs = xdev->num_subdevs;
	subdevs = devm_kzalloc(xdev->dev, sizeof(*subdevs) * num_subdevs,
			       GFP_KERNEL);
	if (subdevs == NULL) {
		ret = -ENOMEM;
		goto done;
	}

	i = 0;
	list_for_each_entry(entity, &xdev->entities, list)
		subdevs[i++] = &entity->asd;

	xdev->notifier.subdevs = subdevs;
	xdev->notifier.num_subdevs = num_subdevs;
	xdev->notifier.bound = xvip_graph_notify_bound;
	xdev->notifier.complete = xvip_graph_notify_complete;

	ret = v4l2_async_notifier_register(&xdev->v4l2_dev, &xdev->notifier);
	if (ret < 0) {
		dev_err(xdev->dev, "notifier registration failed\n");
		goto done;
	}

	ret = 0;

done:
	if (ret < 0)
		xvip_graph_cleanup(xdev);

	return ret;
}

/* -----------------------------------------------------------------------------
 * Media Controller and V4L2
 */

static void xvip_composite_v4l2_cleanup(struct xvip_composite_device *xdev)
{
	v4l2_device_unregister(&xdev->v4l2_dev);
	media_device_unregister(&xdev->media_dev);
	media_device_cleanup(&xdev->media_dev);
}

static int xvip_composite_v4l2_init(struct xvip_composite_device *xdev)
{
	int ret;

	xdev->media_dev.dev = xdev->dev;
	strlcpy(xdev->media_dev.model, "Xilinx Video Composite Device",
		sizeof(xdev->media_dev.model));
	xdev->media_dev.hw_revision = 0;

	media_device_init(&xdev->media_dev);

	xdev->v4l2_dev.mdev = &xdev->media_dev;
	ret = v4l2_device_register(xdev->dev, &xdev->v4l2_dev);
	if (ret < 0) {
		dev_err(xdev->dev, "V4L2 device registration failed (%d)\n",
			ret);
		media_device_cleanup(&xdev->media_dev);
		return ret;
	}

	return 0;
}

/* -----------------------------------------------------------------------------
 * Platform Device Driver
 */

static int xvip_composite_probe(struct platform_device *pdev)
{
	struct xvip_composite_device *xdev;
	int ret;

	xdev = devm_kzalloc(&pdev->dev, sizeof(*xdev), GFP_KERNEL);
	if (!xdev)
		return -ENOMEM;

	xdev->dev = &pdev->dev;
	INIT_LIST_HEAD(&xdev->entities);
	INIT_LIST_HEAD(&xdev->dmas);

	ret = xvip_composite_v4l2_init(xdev);
	if (ret < 0)
		return ret;

	ret = xvip_graph_init(xdev);
	if (ret < 0)
		goto error;

	platform_set_drvdata(pdev, xdev);

	dev_info(xdev->dev, "device registered\n");

	return 0;

error:
	xvip_composite_v4l2_cleanup(xdev);
	return ret;
}

static int xvip_composite_remove(struct platform_device *pdev)
{
	struct xvip_composite_device *xdev = platform_get_drvdata(pdev);

	xvip_graph_cleanup(xdev);
	xvip_composite_v4l2_cleanup(xdev);

	return 0;
}

static const struct of_device_id xvip_composite_of_id_table[] = {
	{ .compatible = "xlnx,video" },
	{ }
};
MODULE_DEVICE_TABLE(of, xvip_composite_of_id_table);

static struct platform_driver xvip_composite_driver = {
	.driver = {
		.name = "xilinx-video",
		.of_match_table = xvip_composite_of_id_table,
	},
	.probe = xvip_composite_probe,
	.remove = xvip_composite_remove,
};

module_platform_driver(xvip_composite_driver);

MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
MODULE_DESCRIPTION("Xilinx Video IP Composite Driver");
MODULE_LICENSE("GPL v2");


text:
/*jshint -W024 */

define(['app'], function(app) {
  'use strict';

  function getFormData(planData) {
    return {
      name: planData.name
    };
  }

  return {
    parent: 'admin_layout',
    url: 'plans/:plan_id/',
    templateUrl: 'partials/admin/plan-details.html',
    controller: function($http, $scope, planData, planOptionData, Collection, flash) {
      var booleans = {
        "build.expect-tests": 1
      }, options = {};

      for (var key in planOptionData) {
        var value = planOptionData[key];
        if (booleans[key]) {
          value = parseInt(value, 10) == 1;
        }
        options[key] = value;
      }

      $scope.saveStep = function(step) {
        if (step.saving === true) {
          return;
        }
        step.saving = true;

        var url;
        if (step.id !== undefined) {
          url = '/api/0/steps/' + step.id + '/';
        } else {
          url = '/api/0/plans/' + planData.id + '/steps/';
        }

        var formData = {
          implementation: step.implementation,
          data: step.data,
          order: step.order,
          name: step.name,
        };

        for (var key in step.options) {
          formData[key] = step.options[key];
        }

        $http.post(url, formData).success(function(data){
          step.showForm = false;
          $.extend(true, step, data);
        }).error(function(data){
          flash('error', data.message);
        }).finally(function(){
          step.saving = false;
        });
      };

      $scope.addStep = function() {
        $scope.stepList.push({
          showForm: true,
          data: '{}',
          order: 0,
          name: 'Unsaved step',
          implementation: '',
          options: {
            'build.timeout': '0'
          }});
      };

      $scope.removeStep = function(step) {
        if (step.saving === true) {
          return;
        }
        step.saving = true;
        $http.delete('/api/0/steps/' + step.id + '/').success(function(data){
          $scope.stepList.popItem(step);
        }).error(function(data){
          flash('error', data.message);
        }).finally(function(){
          step.saving = false;
        });
      };

      $scope.addProject = function() {
        var data = {
          id: window.prompt('Enter the project ID or slug')
        };
        if (!data.id) {
          return;
        }

        $http.post('/api/0/plans/' + planData.id + '/projects/', data).success(function(data){
          $scope.projectList.push(data);
        }).error(function(data){
          flash('error', data.message);
        });
      };

      $scope.removeProject = function(project) {
        if (project.saving === true) {
          return;
        }

        project.saving = true;
        $http.delete('/api/0/plans/' + planData.id + '/projects/?id=' + project.id).success(function(data){
          $scope.projectList.popItem(project);
        }).error(function(data){
          flash('error', data.message);
        }).finally(function(){
          project.saving = false;
        });
      };

      $scope.savePlanSettings = function() {
        var options = angular.copy($scope.options);
        for (var key in options) {
          if (booleans[key]) {
            options[key] = options[key] ? '1' : '0';
          }
        }
        // TODO(dcramer): we dont correctly update the URL when the project slug
        // changes
        $http.post('/api/0/plans/' + planData.id + '/options/', options);
        $http.post('/api/0/plans/' + planData.id + '/', $scope.formData)
          .success(function(data){
            $.extend($scope.plan, data);
            $scope.formData = getFormData(data);
          });
          // TODO(dcramer): this is actually invalid
          $scope.planSettingsForm.$setPristine();
      };

      $scope.plan = planData;
      $scope.projectList = new Collection(planData.projects);
      $scope.stepList = new Collection(planData.steps);
      $scope.options = options;
      $scope.formData = getFormData(planData);
    },
    resolve: {
      planData: function($http, $stateParams) {
        return $http.get('/api/0/plans/' + $stateParams.plan_id + '/').then(function(response){
          return response.data;
        });
      },
      planOptionData: function($http, $stateParams) {
        return $http.get('/api/0/plans/' + $stateParams.plan_id + '/options/').then(function(response){
          return response.data;
        });
      }
    }
  };
});


text:
@()
    @header {

    }      {
        {{userContext.userFirstName}} {{userContext.userLastName}}

                Home

                Recently viewed

                Sign out
                    (link opens in a pop-up)

    }


text:
package com.tactfactory.harmony.test.management.entity;

import org.joda.time.DateTime;

import com.tactfactory.harmony.annotation.Column;
import com.tactfactory.harmony.annotation.Entity;
import com.tactfactory.harmony.annotation.Id;
import com.tactfactory.harmony.annotation.InheritanceType;
import com.tactfactory.harmony.annotation.InheritanceType.InheritanceMode;

@Entity
@InheritanceType(InheritanceMode.JOINED)
public class Furniture {

    @Id
    private int id;

    @Column
    private int price;

    @Column
    private DateTime purchaseDate;
}