text:
package trust_test

import (
	"context"
	"fmt"
	"path/filepath"
	"sort"
	"testing"

	"github.com/golang/mock/gomock"
	"github.com/stretchr/testify/assert"

	"github.com/scionproto/scion/go/lib/scrypto/cppki"
	"github.com/scionproto/scion/go/lib/serrors"
	"github.com/scionproto/scion/go/lib/xtest"
	"github.com/scionproto/scion/go/pkg/trust"
	"github.com/scionproto/scion/go/pkg/trust/mock_trust"
)

func TestLoadChains(t *testing.T) {
	if *update {
		t.Skip("test crypto is being updated")
	}
	trc := xtest.LoadTRC(t, filepath.Join(goldenDir, "ISD1/trcs/ISD1-B1-S1.trc"))

	testCases := map[string]struct {
		inputDir   string
		setupDB    func(*gomock.Controller) trust.DB
		assertFunc assert.ErrorAssertionFunc
		ignored    []string
		loaded     []string
	}{
		"valid": {
			inputDir: filepath.Join(goldenDir, "certs"),
			setupDB: func(mctlr *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctlr)
				db.EXPECT().SignedTRC(ctxMatcher{},
					TRCIDMatcher{ISD: 1}).Return(trc, nil).AnyTimes()
				db.EXPECT().InsertChain(ctxMatcher{}, gomock.Any()).Return(true, nil).AnyTimes()
				return db
			},
			assertFunc: assert.NoError,
			loaded: []string{
				filepath.Join(goldenDir, "certs/ISD1-ASff00_0_110.pem"),
				filepath.Join(goldenDir, "certs/ISD1-ASff00_0_111.pem"),
				filepath.Join(goldenDir, "certs/ISD1-ASff00_0_112.pem"),
			},
			ignored: []string{
				filepath.Join(goldenDir, "certs/dummy.pem"),
			},
		},
		"invalid dir": {
			inputDir: "./path/to/nowhere",
			setupDB: func(mctlr *gomock.Controller) trust.DB {
				return mock_trust.NewMockDB(mctlr)
			},
			assertFunc: assert.Error,
		},
		"db.SignedTRC error": {
			inputDir: filepath.Join(goldenDir, "certs"),
			setupDB: func(mctlr *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctlr)
				db.EXPECT().SignedTRC(ctxMatcher{},
					TRCIDMatcher{ISD: 1}).Return(
					cppki.SignedTRC{}, serrors.New("db failed")).AnyTimes()
				return db
			},
			assertFunc: assert.Error,
		},
		"db.SignedTRC not found": {
			inputDir: filepath.Join(goldenDir, "certs"),
			setupDB: func(mctlr *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctlr)
				db.EXPECT().SignedTRC(ctxMatcher{},
					TRCIDMatcher{ISD: 1}).AnyTimes().Return(
					cppki.SignedTRC{}, nil,
				)
				return db
			},
			assertFunc: assert.NoError,
			ignored: []string{
				filepath.Join(goldenDir, "certs/ISD1-ASff00_0_110.pem"),
				filepath.Join(goldenDir, "certs/ISD1-ASff00_0_111.pem"),
				filepath.Join(goldenDir, "certs/ISD1-ASff00_0_112.pem"),
				filepath.Join(goldenDir, "certs/dummy.pem"),
			},
		},
		"db.Chain error": {
			inputDir: filepath.Join(goldenDir, "certs"),
			setupDB: func(mctlr *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctlr)
				db.EXPECT().SignedTRC(ctxMatcher{},
					TRCIDMatcher{ISD: 1}).Return(trc, nil).AnyTimes()
				db.EXPECT().InsertChain(ctxMatcher{}, gomock.Any()).Return(
					false, fmt.Errorf("db failed"),
				)
				return db
			},
			assertFunc: assert.Error,
		},
		"invalid TRC validation": {
			inputDir: filepath.Join(goldenDir, "certs"),
			setupDB: func(mctlr *gomock.Controller) trust.DB {
				db := mock_trust.NewMockDB(mctlr)
				db.EXPECT().SignedTRC(ctxMatcher{},
					TRCIDMatcher{ISD: 1}).Return(
					cppki.SignedTRC{}, nil).AnyTimes()
				db.EXPECT().InsertChain(ctxMatcher{}, gomock.Any()).Return(true, nil).AnyTimes()
				return db
			},
			assertFunc: assert.NoError,
			ignored: []string{
				filepath.Join(goldenDir, "certs/ISD1-ASff00_0_110.pem"),
				filepath.Join(goldenDir, "certs/ISD1-ASff00_0_111.pem"),
				filepath.Join(goldenDir, "certs/ISD1-ASff00_0_112.pem"),
				filepath.Join(goldenDir, "certs/dummy.pem"),
			},
		},
	}

	for name, tc := range testCases {
		name, tc := name, tc
		t.Run(name, func(t *testing.T) {
			t.Parallel()
			ctlr := gomock.NewController(t)
			defer ctlr.Finish()
			db := tc.setupDB(ctlr)
			res, err := trust.LoadChains(context.Background(), tc.inputDir, db)
			tc.assertFunc(t, err)
			if err != nil {
				return
			}
			assert.Equal(t, tc.loaded, res.Loaded)

			var ignored []string
			for f := range res.Ignored {
				ignored = append(ignored, f)
			}
			sort.Strings(tc.ignored)
			sort.Strings(ignored)
			assert.Equal(t, tc.ignored, ignored)
		})
	}
}

func TestLoadTRCs(t *testing.T) {
	if *update {
		t.Skip("test crypto is being updated")
	}

	mctrl := gomock.NewController(t)
	defer mctrl.Finish()

	testCases := map[string]struct {
		inputDir   string
		setupDB    func() trust.DB
		assertFunc assert.ErrorAssertionFunc
		ignored    []string
		loaded     []string
	}{
		"valid": {
			inputDir: filepath.Join(goldenDir, "ISD1/trcs"),
			setupDB: func() trust.DB {
				db := mock_trust.NewMockDB(mctrl)
				db.EXPECT().InsertTRC(gomock.Any(), gomock.Any()).Return(
					true, nil,
				)
				return db
			},
			assertFunc: assert.NoError,
			loaded:     []string{filepath.Join(goldenDir, "ISD1/trcs/ISD1-B1-S1.trc")},
		},
		"invalid dir": {
			inputDir: "./path/to/nowhere",
			setupDB: func() trust.DB {
				return mock_trust.NewMockDB(mctrl)
			},
			assertFunc: assert.Error,
		},
		"invalid TRC": {
			inputDir: "./testdata/store/invalid-trc",
			setupDB: func() trust.DB {
				return mock_trust.NewMockDB(mctrl)
			},
			assertFunc: assert.Error,
		},
		"db.InsertTRC error": {
			inputDir: filepath.Join(goldenDir, "ISD1/trcs"),
			setupDB: func() trust.DB {
				db := mock_trust.NewMockDB(mctrl)
				db.EXPECT().InsertTRC(ctxMatcher{}, gomock.Any()).Return(
					false, fmt.Errorf("db failed"),
				)
				return db
			},
			assertFunc: assert.Error,
		},
	}

	for name, tc := range testCases {
		name, tc := name, tc
		t.Run(name, func(t *testing.T) {
			t.Parallel()
			res, err := trust.LoadTRCs(context.Background(), tc.inputDir, tc.setupDB())
			tc.assertFunc(t, err)
			assert.Equal(t, tc.loaded, res.Loaded)

			var ignored []string
			for f := range res.Ignored {
				ignored = append(ignored, f)
			}
			assert.Equal(t, tc.ignored, ignored)
		})
	}
}


text:
namespace boost {

namespace threads {

namespace mac {

namespace detail {

namespace {

TaskStorageIndex g_ulIndex(0UL);

} // anonymous namespace

void do_thread_startup()
{
    if(g_ulIndex == 0UL)
    {
        OSStatus lStatus = MPAllocateTaskStorageIndex(&g_ulIndex);
        assert(lStatus == noErr);
    }
    set_thread_cleanup_task(NULL);
}

void do_thread_cleanup()
{
    void (*pfnTask)() = MPGetTaskValue(g_ulIndex)
}

void set_thread_cleanup_task(void (*pfnTask)())
{
    lStatus = MPSetTaskValue(g_ulIndex, reinterpret_cast<TaskStorageValue>(pfnTask));
    assert(lStatus == noErr);
}

} // namespace detail

} // namespace mac

} // namespace threads

} // namespace boost

redpajama_set_name: RedPajamaGithub


text:
package com.github.leonardoxh.ywheaterdata;

import android.content.Context;
import android.location.Location;
import android.os.AsyncTask;
import android.text.TextUtils;
import android.util.Log;

import com.squareup.okhttp.Callback;
import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;

import java.net.HttpURLConnection;
import java.io.IOException;
import java.io.StringReader;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

public final class YahooWeatherClient {

  public static final char WEATHER_UNIT_CELCIUS = 'c';
  public static final char WEATHER_UNIT_FAREINHART = 'f';

  private static final XmlPullParserFactory DEFAULT_PULL_PARSER =
      Utils.defaultXmlPullParser();
  private static final Executor DEFAULT_EXECUTOR = Executors.newCachedThreadPool();

  private char weatherUnit = WEATHER_UNIT_CELCIUS;
  private OkHttpClient okHttpClient = Utils.defaultOkHttpClient();
  private static String appId;
  private WeatherCallbacks callbacks;

  public YahooWeatherClient(String appId) {
    init(appId);
  }

  public YahooWeatherClient(Context context) {
    init(context);
  }

  public YahooWeatherClient() {
    if(appId == null) {
      Log.w(getClass().getName(), "appId == null maybe you forgot init call?");
    }
  }

  public static void init(Context context) {
    init(Utils.getApiKey(context));
  }

  public static void init(String appId) {
    if(TextUtils.isEmpty(appId)) {
      throw new IllegalArgumentException("Init with a null or empty appId");
    }
    if(YahooWeatherClient.appId == null) {
      YahooWeatherClient.appId = appId;
    }
  }

  public void wheaterForWoied(LocationInfo locationInfo) {
    if (TextUtils.isEmpty(locationInfo.getPrimaryWoeid())) {
      callbacks.weatherDataError(locationInfo);
      return;
    }
    Request request = new Request.Builder()
        .get()
        .url(buildWheaterQueryUrl(locationInfo.getPrimaryWoeid(), weatherUnit))
        .build();
    okHttpClient.newCall(request)
        .enqueue(new OnWoeidResponseListener(locationInfo));
  }

  public void locationInfoForLocation(Location location, WeatherCallbacks callbacks) {
    this.callbacks = callbacks;
    Request request = new Request.Builder()
        .get()
        .url(buildUrl(appId, location))
        .build();
    okHttpClient.newCall(request)
        .enqueue(new OnLocationResponseListener());
  }

  public void setWeatherUnit(char weatherUnit) {
    this.weatherUnit = weatherUnit;
  }

  public char getWeatherUnit() {
    return weatherUnit;
  }

  public void setOkHttpClient(OkHttpClient okHttpClient) {
    this.okHttpClient = okHttpClient;
  }

  public void setAppId(String appId) {
    YahooWeatherClient.appId = appId;
  }

  private static String buildWheaterQueryUrl(String woeid, char wheaterUnit) {
    return "http://weather.yahooapis.com/forecastrss?w=" + woeid + "&u=" + wheaterUnit;
  }

  private static String buildUrl(String appId, Location location) {
    StringBuilder sb = new StringBuilder();
    sb.append("http://where.yahooapis.com/v1/places.q('");
    sb.append(location.getLatitude());
    sb.append(",");
    sb.append(location.getLongitude());
    sb.append("')");
    sb.append("?appid=");
    sb.append(appId);
    return sb.toString();
  }

  class OnLocationResponseListener implements Callback {

    @Override public void onFailure(Request request, IOException e) {
      callbacks.weatherDataError(null);
    }

    @Override public void onResponse(Response response) throws IOException {
      if (response.isSuccessful()) {
        new LocationInfoParserTask().executeOnExecutor(DEFAULT_EXECUTOR,
            response.body().string());
      } else {
        callbacks.weatherDataError(null);
      }
    }

  }

  class OnWoeidResponseListener implements Callback {

    final LocationInfo locationInfo;

    OnWoeidResponseListener(LocationInfo locationInfo) {
      this.locationInfo = locationInfo;
    }

    @Override public void onFailure(Request request, IOException e) {
      callbacks.weatherDataError(locationInfo);
    }

    @Override public void onResponse(Response response) throws IOException {
      if (response.code() == HttpURLConnection.HTTP_OK) {
        new WoeidParserTask(locationInfo).executeOnExecutor(DEFAULT_EXECUTOR,
            response.body().string());
      } else {
        callbacks.weatherDataError(locationInfo);
      }
    }

  }

  class LocationInfoParserTask extends AsyncTask<String, Void, LocationInfo> {

    @Override protected LocationInfo doInBackground(String... strings) {
      String content = strings[0];
      LocationInfo locationInfo = new LocationInfo();
      String primaryWoeid = null;
      Map<String, String> alternativeWoeids = new HashMap<>();
      try {
        XmlPullParser xpp = DEFAULT_PULL_PARSER.newPullParser();
        xpp.setInput(new StringReader(content));
        boolean inWoe = false;
        boolean inTown = false;
        int eventType = xpp.getEventType();
        while (eventType != XmlPullParser.END_DOCUMENT) {
          String tagName = xpp.getName();
          if (eventType == XmlPullParser.START_TAG &&
              "woeid".equals(tagName)) {
            inWoe = true;
          } else if (eventType == XmlPullParser.TEXT && inWoe) {
            primaryWoeid = xpp.getText();
          }
          if (eventType == XmlPullParser.START_TAG &&
              (tagName.startsWith("locality") || tagName.startsWith("admin"))) {
            for (int i = xpp.getAttributeCount() - 1; i >=0; i--) {
              String attrName = xpp.getAttributeName(i);
              if ("type".equals(attrName) &&
                  "Town".equals(xpp.getAttributeValue(i))) {
                inTown = true;
              } else if ("woeid".equals(attrName)) {
                String woeid = xpp.getAttributeValue(i);
                if (!TextUtils.isEmpty(woeid)) {
                  alternativeWoeids.put(tagName, woeid);
                }
              }
            }
          } else if (eventType == XmlPullParser.TEXT && inTown) {
            locationInfo.setTown(xpp.getText());
          }
          if (eventType == XmlPullParser.END_TAG) {
            inWoe = false;
            inTown = false;
          }
          eventType = xpp.next();
        }
        if (!TextUtils.isEmpty(primaryWoeid)) {
          locationInfo.setPrimaryWoeid(primaryWoeid);
        }
        for (Map.Entry<String, String> entry : alternativeWoeids.entrySet()) {
          locationInfo.addWoeid(entry.getValue());
        }
        return locationInfo;
      } catch (IOException | XmlPullParserException e) {
        e.printStackTrace();
        return null;
      }
    }

    @Override protected void onPostExecute(LocationInfo locationInfo) {
      if (locationInfo == null) {
        callbacks.weatherDataError(null);
      } else {
        wheaterForWoied(locationInfo);
      }
    }

  }

  class WoeidParserTask extends AsyncTask<String, Void, WeatherData> {

    final LocationInfo locationInfo;

    WoeidParserTask(LocationInfo locationInfo) {
      this.locationInfo = locationInfo;
    }

    @Override protected WeatherData doInBackground(String... strings) {
      String content = strings[0];
      WeatherData data = new WeatherData();
      try {
        XmlPullParser xpp = DEFAULT_PULL_PARSER.newPullParser();
        xpp.setInput(new StringReader(content));
        boolean hasTodayForecast = false;
        int eventType = xpp.getEventType();
        while (eventType != XmlPullParser.END_DOCUMENT) {
          if (eventType == XmlPullParser.START_TAG &&
              "condition".equals(xpp.getName())) {
            for (int i = xpp.getAttributeCount() - 1; i >= 0; i--) {
              if ("temp".equals(xpp.getAttributeName(i))) {
                data.setTemperature(Integer.parseInt(xpp.getAttributeValue(i)));
              } else if ("code".equals(xpp.getAttributeName(i))) {
                data.setConditionCode(Integer.parseInt(xpp.getAttributeValue(i)));
              } else if ("text".equals(xpp.getAttributeName(i))) {
                data.setConditionText(xpp.getAttributeValue(i));
              }
            }
          } else if (eventType == XmlPullParser.START_TAG
              && "forecast".equals(xpp.getName())
              && !hasTodayForecast) {
            hasTodayForecast = true;
            for (int i = xpp.getAttributeCount() - 1; i >= 0; i--) {
              if ("code".equals(xpp.getAttributeName(i))) {
                data.setTodayForecastConditionCode(Integer.parseInt(xpp.getAttributeValue(i)));
              } else if ("low".equals(xpp.getAttributeValue(i))) {
                data.setLow(Integer.parseInt(xpp.getAttributeValue(i)));
              } else if ("high".equals(xpp.getAttributeValue(i))) {
                data.setHigh(Integer.parseInt(xpp.getAttributeValue(i)));
              } else if ("text".equals(xpp.getAttributeValue(i))) {
                data.setForecastText(xpp.getAttributeValue(i));
              }
            }
          } else if (eventType == XmlPullParser.START_TAG
              && "location".equals(xpp.getName())) {
            String cityOrVillage = "--";
            String region = null;
            String country = "--";
            for (int i = xpp.getAttributeCount() - 1; i >= 0; i--) {
              if ("city".equals(xpp.getAttributeName(i))) {
                cityOrVillage = xpp.getAttributeValue(i);
              } else if ("region".equals(xpp.getAttributeName(i))) {
                region = xpp.getAttributeValue(i);
              } else if ("country".equals(xpp.getAttributeName(i))) {
                country = xpp.getAttributeValue(i);
              }
            }
            if (!TextUtils.isEmpty(region)) {
              region = country;
            }
            data.setLocation(cityOrVillage + ", " + region);
          }
          eventType = xpp.next();
        }
      } catch (IOException | XmlPullParserException e) {
        e.printStackTrace();
        return null;
      }
      data.setWeatherUnit(weatherUnit);
      return data;
    }

    @Override protected void onPostExecute(WeatherData weatherData) {
      if (weatherData == null) {
        callbacks.weatherDataError(locationInfo);
      } else {
        callbacks.weatherDataReceived(locationInfo, weatherData);
      }
    }

  }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>org.objectstyle</groupId>
	<artifactId>link-rest-cms-demo</artifactId>
	<version>1.0-SNAPSHOT</version>

	<name>Webapp: link-rest-cms-demo</name>
	<description>A simple JAX RS project demonstrating the use of LinkRest framework</description>
	<packaging>war</packaging>

	<properties>

		<!-- Sencha Cmd properties -->

		<sencha-build-type>testing</sencha-build-type>
        <desktop.app>Demo</desktop.app>

		<!-- standard Maven properties -->

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

		<!-- Custom properties (mostly framework versions) -->

		<servlet-api-version>3.1.0</servlet-api-version>
		<slf4j-version>1.7.10</slf4j-version>
		<link-rest-version>1.18</link-rest-version>
		<cayenne-version>4.0.M2</cayenne-version>
		<jersey-version>2.16</jersey-version>
	</properties>

	<scm>
		<connection>scm:git:https://github.com/andrus/link-rest-cms-demo.git</connection>
		<developerConnection>scm:git:ssh://git@github.com:andrus/link-rest-cms-demo.git</developerConnection>
		<url>https://github.com/andrus/link-rest-cms-demo</url>
		<tag>HEAD</tag>
	</scm>

	<pluginRepositories>
		<!-- TODO: Cayenne 4.0.M2 will soon be posted to Central, So 'cayenne-staging'
			repo reference will become unneeded... -->
		<pluginRepository>
			<id>cayenne-staging</id>
			<name>Link Rest Dependencies Repo</name>
			<url>https://repository.apache.org/content/repositories/orgapachecayenne-1005/</url>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>

	<dependencyManagement>
		<dependencies>

			<dependency>
				<groupId>com.nhl.link.rest</groupId>
				<artifactId>link-rest</artifactId>
				<version>${link-rest-version}</version>
			</dependency>

			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>javax.servlet-api</artifactId>
				<version>${servlet-api-version}</version>
			</dependency>

			<dependency>
				<artifactId>javax.inject</artifactId>
				<groupId>javax.inject</groupId>
				<version>1</version>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j-version}</version>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-simple</artifactId>
				<version>${slf4j-version}</version>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>jcl-over-slf4j</artifactId>
				<version>${slf4j-version}</version>
			</dependency>

			<dependency>
				<groupId>javax.ws.rs</groupId>
				<artifactId>javax.ws.rs-api</artifactId>
				<version>2.0.1</version>
			</dependency>

			<dependency>
				<groupId>org.glassfish.jersey.containers</groupId>
				<artifactId>jersey-container-servlet</artifactId>
				<version>${jersey-version}</version>
			</dependency>

			<dependency>
				<groupId>org.glassfish.jersey.test-framework</groupId>
				<artifactId>jersey-test-framework-core</artifactId>
				<version>${jersey-version}</version>
			</dependency>

			<dependency>
				<groupId>org.glassfish.jersey.test-framework.providers</groupId>
				<artifactId>jersey-test-framework-provider-inmemory</artifactId>
				<version>${jersey-version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.cayenne</groupId>
				<artifactId>cayenne-server</artifactId>
				<version>${cayenne-version}</version>
			</dependency>

			<dependency>
				<groupId>org.apache.derby</groupId>
				<artifactId>derby</artifactId>
				<version>10.10.1.1</version>
			</dependency>

		</dependencies>
	</dependencyManagement>

	<dependencies>

		<!-- required runtime dependencies -->
		<dependency>
			<groupId>com.nhl.link.rest</groupId>
			<artifactId>link-rest</artifactId>
		</dependency>
		<dependency>
			<artifactId>javax.inject</artifactId>
			<groupId>javax.inject</groupId>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>javax.ws.rs</groupId>
			<artifactId>javax.ws.rs-api</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.cayenne</groupId>
			<artifactId>cayenne-server</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.glassfish.jersey.containers</groupId>
			<artifactId>jersey-container-servlet</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<scope>compile</scope>
		</dependency>
		<!-- providing slf4j binding for use with unit tests that require SLF and
			for clean Cayenne output. -->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jcl-over-slf4j</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.derby</groupId>
			<artifactId>derby</artifactId>
		</dependency>

		<!-- Provided dependencies -->
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
		</dependency>

		<!-- unit test deps -->
		<!-- TODO -->

	</dependencies>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.2</version>
					<configuration>
						<source>1.8</source>
						<target>1.8</target>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.4</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>2.6</version>
					<configuration>
						<failOnMissingWebXml>false</failOnMissingWebXml>
						<warName>link-rest-cms-demo</warName>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.cayenne.plugins</groupId>
					<artifactId>maven-cayenne-plugin</artifactId>
					<version>${cayenne-version}</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <warSourceIncludes>
                        WEB-INF/**
                    </warSourceIncludes>

					<webResources>
                        <resource>
                            <directory>${project.build.directory}/sencha-package/</directory>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>

       		<plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <configuration>
                            <tasks>
                                <exec executable="sencha" dir="${basedir}/src/main/webapp/" failonerror="true">
                                    <arg value="app" />
                                    <arg value="build" />
                                    <arg value="${sencha-build-type}" />
                                </exec>

                                <copy todir="${project.build.directory}/sencha-package/">
                                    <fileset dir="${project.basedir}/src/main/webapp">
                                        <include name="index.html" />
                                    </fileset>
                                </copy>

 								<copy todir="${project.build.directory}/sencha-package/">
                                    <fileset dir="${project.basedir}/src/main/webapp/build/${sencha-build-type}/${desktop.app}" />
                                </copy>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

			<!-- Generate Cayenne classes in Maven; of course you can do the same
				using Modeler -->
			<plugin>
				<groupId>org.apache.cayenne.plugins</groupId>
				<artifactId>maven-cayenne-plugin</artifactId>
				<configuration>
					<map>${project.basedir}/src/main/resources/datamap.map.xml</map>
				</configuration>
				<executions>
					<execution>
						<id>default-cli</id>
						<goals>
							<goal>cgen</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>

</project>


text:
function array_unique(inputArr) {
  //  discuss at: http://phpjs.org/functions/array_unique/
  // original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com)
  //    input by: duncan
  //    input by: Brett Zamir (http://brett-zamir.me)
  // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  // bugfixed by: Nate
  // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  // bugfixed by: Brett Zamir (http://brett-zamir.me)
  // improved by: Michael Grier
  //        note: The second argument, sort_flags is not implemented;
  //        note: also should be sorted (asort?) first according to docs
  //   example 1: array_unique(['Kevin','Kevin','van','Zonneveld','Kevin']);
  //   returns 1: {0: 'Kevin', 2: 'van', 3: 'Zonneveld'}
  //   example 2: array_unique({'a': 'green', 0: 'red', 'b': 'green', 1: 'blue', 2: 'red'});
  //   returns 2: {a: 'green', 0: 'red', 1: 'blue'}

  var key = '',
    tmp_arr2 = {},
    val = '';

  var __array_search = function (needle, haystack) {
    var fkey = '';
    for (fkey in haystack) {
      if (haystack.hasOwnProperty(fkey)) {
        if ((haystack[fkey] + '') === (needle + '')) {
          return fkey;
        }
      }
    }
    return false;
  };

  for (key in inputArr) {
    if (inputArr.hasOwnProperty(key)) {
      val = inputArr[key];
      if (false === __array_search(val, tmp_arr2)) {
        tmp_arr2[key] = val;
      }
    }
  }

  return tmp_arr2;
}


text:
package tars.logic.parser;

import static tars.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;

import java.time.DateTimeException;
import java.util.HashSet;
import java.util.NoSuchElementException;
import java.util.Set;

import tars.commons.core.Messages;
import tars.commons.exceptions.IllegalValueException;
import tars.commons.exceptions.InvalidRangeException;
import tars.commons.util.DateTimeUtil;
import tars.commons.util.StringUtil;
import tars.logic.commands.Command;
import tars.logic.commands.IncorrectCommand;
import tars.logic.commands.RsvCommand;

// @@author A0124333U
/**
 * Reserve command parser
 */
public class RsvCommandParser extends CommandParser {

    @Override
    public Command prepareCommand(String args) {
        // there is no arguments
        if (args.trim().isEmpty()) {
            return new IncorrectCommand(String.format(
                    MESSAGE_INVALID_COMMAND_FORMAT, RsvCommand.MESSAGE_USAGE));
        }

        ArgumentTokenizer argsTokenizer =
                new ArgumentTokenizer(dateTimePrefix, deletePrefix);
        argsTokenizer.tokenize(args);

        if (argsTokenizer.getValue(deletePrefix).isPresent()) {
            return prepareRsvDel(argsTokenizer);
        } else {
            return prepareRsvAdd(argsTokenizer);
        }
    }

    // Parses arguments for adding a reserved task
    private Command prepareRsvAdd(ArgumentTokenizer argsTokenizer) {
        if (!argsTokenizer.getValue(dateTimePrefix).isPresent()) {
            return new IncorrectCommand(
                    String.format(MESSAGE_INVALID_COMMAND_FORMAT,
                            RsvCommand.MESSAGE_DATETIME_NOT_FOUND));
        }

        Set<String[]> dateTimeStringSet = new HashSet<>();

        try {
            for (String dateTimeString : argsTokenizer
                    .getMultipleValues(dateTimePrefix).get()) {
                dateTimeStringSet.add(
                        DateTimeUtil.parseStringToDateTime(dateTimeString));
            }

            return new RsvCommand(argsTokenizer.getPreamble().get(),
                    dateTimeStringSet);
        } catch (IllegalValueException ive) {
            return new IncorrectCommand(ive.getMessage());
        } catch (DateTimeException dte) {
            return new IncorrectCommand(Messages.MESSAGE_INVALID_DATE);
        } catch (NoSuchElementException nse) {
            return new IncorrectCommand(String.format(
                    MESSAGE_INVALID_COMMAND_FORMAT, RsvCommand.MESSAGE_USAGE));
        }
    }

    // Parses arguments for deleting one or more reserved tasks
    private Command prepareRsvDel(ArgumentTokenizer argsTokenizer) {
        try {
            if (argsTokenizer.getPreamble().isPresent()) {
                return new IncorrectCommand(
                        String.format(MESSAGE_INVALID_COMMAND_FORMAT,
                                RsvCommand.MESSAGE_USAGE_DEL));
            }

            String rangeIndex = StringUtil
                    .indexString(argsTokenizer.getValue(deletePrefix).get());
            return new RsvCommand(rangeIndex);
        } catch (InvalidRangeException | IllegalValueException ie) {
            return new IncorrectCommand(
                    String.format(MESSAGE_INVALID_COMMAND_FORMAT,
                            RsvCommand.MESSAGE_USAGE_DEL));
        }
    }

}


text:
package it.vkaramfilov.librarysystem;

public interface IMedia {
    MediaType getType();

    IAuthor getAuthor();

    String getTitle();

    int getReleaseYear();

    MediaState getState();

    void setState(MediaState state);
}


text:
					<input type="button" class="csc-createFromExisting createFromExistingButton" />
					<input type="button" class="csc-cancel cancelButton" />
					<input type="button" class="csc-delete deleteButton" />
					<input type="button" class="csc-save saveButton" />

								*

								<input type="text" class="csc-object-identification-object-number pattern-chooser-input" />

								<input type="text" class="input-numeric-medium csc-object-identification-number-objects"/>

								<select class="csc-object-identification-responsible-department input-select"><option value="">Options not loaded</option></select>

								<select class="csc-object-identification-collection input-select"><option value="">Options not loaded</option></select>

								<textarea rows="4" cols="30" class="input-textarea csc-object-identification-brief-description"></textarea>

								<textarea rows="4" cols="30" class="input-textarea csc-object-identification-distinguishing-features"></textarea>

            								<input type="text" class="csc-object-identification-object-title input-alpha"/>

            								<select class="csc-object-identification-object-title-language input-select"><option value="">Options not loaded</option></select>

            										    <input type="text" class="csc-object-identification-object-title-translation editableText"/>
                										<select class="csc-collection-object-titleTranslationLanguage input-select"><option value="">Options not loaded</option></select>

            								<select class="csc-object-identification-object-title-type input-select"><option value="">Options not loaded</option></select>

										<input type="text" class="csc-object-identification-object-name"/>
										<select class="csc-object-identification-object-currency input-select"><option value="">Options not loaded</option></select>
										<select class="csc-object-identification-object-level input-select"><option value="">Options not loaded</option></select>
										<select class="csc-object-identification-object-system input-select"><option value="">Options not loaded</option></select>
										<select class="csc-object-identification-object-type input-select"><option value="">Options not loaded</option></select>
										<select class="csc-object-identification-object-language input-select"><option value="">Options not loaded</option></select>
										<input type="text" class="csc-object-identification-object-note"/>

								<input type="text" class="csc-object-description-copy-number"/>

								<input type="text" class="csc-object-description-edition-number"/>

								<input type="text" class="csc-object-description-color"/>

										<input type="text" class="csc-object-description-material"/>
										<input type="text" class="csc-object-description-material-component"/>
										<input type="text" class="csc-object-description-material-component-note"/>
										<input type="text" class="csc-object-description-material-name"/>
										<input type="text" class="csc-object-description-material-source"/>

							<textarea rows="4" cols="30" class="input-textarea csc-object-description-physical-description"></textarea>

											<select class="csc-object-description-technical-attribute input-select"><option value="">Options not loaded</option></select>
											<select class="csc-object-description-technical-attribute-measurement input-select"><option value="">Options not loaded</option></select>
											<select class="csc-object-description-technical-attribute-unit input-select"><option value="">Options not loaded</option></select>

									<textarea rows="4" cols="30" class="input-textarea csc-object-description-content-description"></textarea>

										<select class="csc-object-description-content-language input-select"><option value="">Options not loaded</option></select>

										<input type="text" class="csc-object-description-content-activity"/>

										<input type="text" class="csc-object-description-content-concept"/>

										<input type="text" class="csc-object-description-content-date" />

										<select class="csc-object-description-content-position input-select"><option value="">Options not loaded</option></select>

													<input type="text" class="csc-object-description-content-object"/>
													<select class="csc-object-description-content-object-type"><option value="">Options not loaded</option></select>

										<input type="text" class="csc-object-description-content-people"/>

										<input type="text" class="csc-object-description-content-person"/>

										<input type="text" class="csc-object-description-content-place"/>

										<select class="csc-object-description-content-script input-select"><option value="">Options not loaded</option></select>

										<input type="text" class="csc-object-description-content-organization"/>

													<input type="text" class="csc-object-description-content-event-name"/>
													<input type="text" class="csc-object-description-content-event-name-type"/>

													<input type="text" class="csc-object-description-content-other" />
													<input type="text" class="csc-object-description-content-other-type" />

									<textarea rows="4" cols="30" class="input-textarea csc-object-description-content-note"></textarea>

								<input type="text" class="csc-objectProductionDateGroup-objectProductionDate" />

											<input type="text" class="csc-object-production-technique"/>
											<input type="text" class="csc-object-production-technique-type input-select"/>

											<input type="text" class="csc-object-production-person"/>
											<input type="text" class="csc-collection-object-objectProductionPersonRole"/>

											<input type="text" class="csc-object-production-place"/>
											<input type="text" class="csc-collection-object-objectProductionPlaceRole"/>

											<input type="text" class="csc-object-production-organization"/>
											<input type="text" class="csc-collection-object-objectProductionOrganizationRole"/>

									<textarea rows="4" cols="30" class="input-textarea csc-object-production-note"></textarea>

										<input type="text" class="csc-collection-object-reference"/>
										<input type="text" class="csc-collection-object-referenceNote"/>

					<input type="button" class="csc-createFromExisting createFromExistingButton" />
					<input type="button" class="csc-cancel cancelButton" />
					<input type="button" class="csc-delete deleteButton" />
					<input type="button" class="csc-save saveButton" />


text:
namespace EPOS
{
    partial class Tabs
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle();
            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle();
            this.label5 = new System.Windows.Forms.Label();
            this.dataGridView2 = new System.Windows.Forms.DataGridView();
            this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Type = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.LastAccessed = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.By = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.buttonBack = new System.Windows.Forms.Button();
            this.labelTotal = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.dataGridView1 = new System.Windows.Forms.DataGridView();
            this.Product = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.Price = new System.Windows.Forms.DataGridViewTextBoxColumn();
            this.buttonNew = new System.Windows.Forms.Button();
            this.buttonAdd = new System.Windows.Forms.Button();
            this.buttonPrint = new System.Windows.Forms.Button();
            this.buttonPay = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
            this.SuspendLayout();
            //
            // label5
            //
            this.label5.AutoSize = true;
            this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label5.Location = new System.Drawing.Point(554, 41);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(135, 55);
            this.label5.TabIndex = 142;
            this.label5.Text = "Tabs";
            //
            // dataGridView2
            //
            this.dataGridView2.AllowUserToAddRows = false;
            this.dataGridView2.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
            this.dataGridView2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.dataGridView2.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
            dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle21.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle21.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle21.ForeColor = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle21.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle21.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.dataGridView2.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle21;
            this.dataGridView2.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dataGridView2.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.dataGridViewTextBoxColumn1,
            this.Type,
            this.dataGridViewTextBoxColumn2,
            this.dataGridViewTextBoxColumn3,
            this.LastAccessed,
            this.By});
            dataGridViewCellStyle22.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle22.BackColor = System.Drawing.SystemColors.Window;
            dataGridViewCellStyle22.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle22.ForeColor = System.Drawing.SystemColors.ControlText;
            dataGridViewCellStyle22.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle22.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle22.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
            this.dataGridView2.DefaultCellStyle = dataGridViewCellStyle22;
            this.dataGridView2.Location = new System.Drawing.Point(30, 137);
            this.dataGridView2.Name = "dataGridView2";
            this.dataGridView2.RowHeadersVisible = false;
            this.dataGridView2.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.dataGridView2.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            this.dataGridView2.Size = new System.Drawing.Size(908, 394);
            this.dataGridView2.TabIndex = 141;
            this.dataGridView2.TabStop = false;
            //
            // dataGridViewTextBoxColumn1
            //
            this.dataGridViewTextBoxColumn1.FillWeight = 50F;
            this.dataGridViewTextBoxColumn1.HeaderText = "ID";
            this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1";
            //
            // Type
            //
            this.Type.HeaderText = "Name";
            this.Type.Name = "Type";
            //
            // dataGridViewTextBoxColumn2
            //
            this.dataGridViewTextBoxColumn2.FillWeight = 200F;
            this.dataGridViewTextBoxColumn2.HeaderText = "Time Opened";
            this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2";
            //
            // dataGridViewTextBoxColumn3
            //
            this.dataGridViewTextBoxColumn3.HeaderText = "Opened By";
            this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3";
            //
            // LastAccessed
            //
            this.LastAccessed.FillWeight = 200F;
            this.LastAccessed.HeaderText = "Last Accessed";
            this.LastAccessed.Name = "LastAccessed";
            //
            // By
            //
            this.By.HeaderText = "Accessed By";
            this.By.Name = "By";
            //
            // buttonBack
            //
            this.buttonBack.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.buttonBack.Font = new System.Drawing.Font("Microsoft Sans Serif", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonBack.Location = new System.Drawing.Point(76, 662);
            this.buttonBack.Margin = new System.Windows.Forms.Padding(8);
            this.buttonBack.Name = "buttonBack";
            this.buttonBack.Size = new System.Drawing.Size(400, 85);
            this.buttonBack.TabIndex = 140;
            this.buttonBack.TabStop = false;
            this.buttonBack.Text = "Back";
            this.buttonBack.UseVisualStyleBackColor = true;
            this.buttonBack.Click += new System.EventHandler(this.buttonBack_Click);
            //
            // labelTotal
            //
            this.labelTotal.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.labelTotal.Location = new System.Drawing.Point(1069, 534);
            this.labelTotal.Name = "labelTotal";
            this.labelTotal.Size = new System.Drawing.Size(256, 33);
            this.labelTotal.TabIndex = 138;
            this.labelTotal.Text = "£0.00";
            this.labelTotal.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label1.Location = new System.Drawing.Point(974, 534);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(94, 33);
            this.label1.TabIndex = 137;
            this.label1.Text = "Total:";
            //
            // dataGridView1
            //
            this.dataGridView1.AllowUserToAddRows = false;
            this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
            this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
            dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle23.BackColor = System.Drawing.SystemColors.Control;
            dataGridViewCellStyle23.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle23.ForeColor = System.Drawing.SystemColors.WindowText;
            dataGridViewCellStyle23.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle23.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle23.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
            this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle23;
            this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
            this.Product,
            this.Price});
            dataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
            dataGridViewCellStyle24.BackColor = System.Drawing.SystemColors.Window;
            dataGridViewCellStyle24.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            dataGridViewCellStyle24.ForeColor = System.Drawing.SystemColors.ControlText;
            dataGridViewCellStyle24.SelectionBackColor = System.Drawing.SystemColors.Highlight;
            dataGridViewCellStyle24.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
            dataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
            this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle24;
            this.dataGridView1.Location = new System.Drawing.Point(970, 137);
            this.dataGridView1.Name = "dataGridView1";
            this.dataGridView1.RowHeadersVisible = false;
            this.dataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
            this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
            this.dataGridView1.Size = new System.Drawing.Size(366, 394);
            this.dataGridView1.TabIndex = 136;
            this.dataGridView1.TabStop = false;
            //
            // Product
            //
            this.Product.FillWeight = 300F;
            this.Product.HeaderText = "Item";
            this.Product.Name = "Product";
            //
            // Price
            //
            this.Price.HeaderText = "Price";
            this.Price.Name = "Price";
            //
            // buttonNew
            //
            this.buttonNew.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.buttonNew.Font = new System.Drawing.Font("Microsoft Sans Serif", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonNew.Location = new System.Drawing.Point(76, 561);
            this.buttonNew.Margin = new System.Windows.Forms.Padding(8);
            this.buttonNew.Name = "buttonNew";
            this.buttonNew.Size = new System.Drawing.Size(400, 85);
            this.buttonNew.TabIndex = 139;
            this.buttonNew.TabStop = false;
            this.buttonNew.Text = "New Tab";
            this.buttonNew.UseVisualStyleBackColor = true;
            this.buttonNew.Click += new System.EventHandler(this.buttonNew_Click);
            //
            // buttonAdd
            //
            this.buttonAdd.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.buttonAdd.Font = new System.Drawing.Font("Microsoft Sans Serif", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonAdd.Location = new System.Drawing.Point(492, 561);
            this.buttonAdd.Margin = new System.Windows.Forms.Padding(8);
            this.buttonAdd.Name = "buttonAdd";
            this.buttonAdd.Size = new System.Drawing.Size(400, 85);
            this.buttonAdd.TabIndex = 143;
            this.buttonAdd.TabStop = false;
            this.buttonAdd.Text = "Add to Tab";
            this.buttonAdd.UseVisualStyleBackColor = true;
            this.buttonAdd.Click += new System.EventHandler(this.buttonAdd_Click);
            //
            // buttonPrint
            //
            this.buttonPrint.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.buttonPrint.Font = new System.Drawing.Font("Microsoft Sans Serif", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonPrint.Location = new System.Drawing.Point(492, 662);
            this.buttonPrint.Margin = new System.Windows.Forms.Padding(8);
            this.buttonPrint.Name = "buttonPrint";
            this.buttonPrint.Size = new System.Drawing.Size(400, 85);
            this.buttonPrint.TabIndex = 144;
            this.buttonPrint.TabStop = false;
            this.buttonPrint.Text = "Print Bill";
            this.buttonPrint.UseVisualStyleBackColor = true;
            this.buttonPrint.Click += new System.EventHandler(this.buttonPrint_Click);
            //
            // buttonPay
            //
            this.buttonPay.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
            this.buttonPay.Font = new System.Drawing.Font("Microsoft Sans Serif", 36F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.buttonPay.Location = new System.Drawing.Point(949, 662);
            this.buttonPay.Margin = new System.Windows.Forms.Padding(8);
            this.buttonPay.Name = "buttonPay";
            this.buttonPay.Size = new System.Drawing.Size(400, 85);
            this.buttonPay.TabIndex = 145;
            this.buttonPay.TabStop = false;
            this.buttonPay.Text = "Pay Now";
            this.buttonPay.UseVisualStyleBackColor = true;
            this.buttonPay.Click += new System.EventHandler(this.buttonPay_Click);
            //
            // Tabs
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = System.Drawing.SystemColors.ControlDark;
            this.ClientSize = new System.Drawing.Size(1366, 768);
            this.Controls.Add(this.buttonPay);
            this.Controls.Add(this.buttonPrint);
            this.Controls.Add(this.buttonAdd);
            this.Controls.Add(this.label5);
            this.Controls.Add(this.dataGridView2);
            this.Controls.Add(this.buttonBack);
            this.Controls.Add(this.buttonNew);
            this.Controls.Add(this.labelTotal);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.dataGridView1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            this.Name = "Tabs";
            this.Text = "Tabs";
            this.Load += new System.EventHandler(this.Tabs_Load);
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.DataGridView dataGridView2;
        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1;
        private System.Windows.Forms.DataGridViewTextBoxColumn Type;
        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3;
        private System.Windows.Forms.DataGridViewTextBoxColumn LastAccessed;
        private System.Windows.Forms.DataGridViewTextBoxColumn By;
        private System.Windows.Forms.Button buttonBack;
        private System.Windows.Forms.Label labelTotal;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.DataGridView dataGridView1;
        private System.Windows.Forms.DataGridViewTextBoxColumn Product;
        private System.Windows.Forms.DataGridViewTextBoxColumn Price;
        private System.Windows.Forms.Button buttonNew;
        private System.Windows.Forms.Button buttonAdd;
        private System.Windows.Forms.Button buttonPrint;
        private System.Windows.Forms.Button buttonPay;
    }
}


text:
//  Boost string_algo library sequence_traits.hpp header file  ---------------------------//

//  Copyright Pavol Droba 2002-2003.
//
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

//  See http://www.boost.org/ for updates, documentation, and revision history.

#ifndef BOOST_STRING_SEQUENCE_TRAITS_HPP
#define BOOST_STRING_SEQUENCE_TRAITS_HPP

#include <boost/config.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/algorithm/string/yes_no_type.hpp>

/*! \file
    Traits defined in this header are used by various algorithms to achieve
    better performance for specific containers.
    Traits provide fail-safe defaults. If a container supports some of these
    features, it is possible to specialize the specific trait for this container.
    For lacking compilers, it is possible of define an override for a specific tester
    function.

    Due to a language restriction, it is not currently possible to define specializations for
    stl containers without including the corresponding header. To decrease the overhead
    needed by this inclusion, user can selectively include a specialization
    header for a specific container. They are located in boost/algorithm/string/stl
    directory. Alternatively she can include boost/algorithm/string/std_collection_traits.hpp
    header which contains specializations for all stl containers.
*/

namespace geofeatures_boost {} namespace boost = geofeatures_boost; namespace geofeatures_boost {
    namespace algorithm {

//  sequence traits  -----------------------------------------------//

        //! Native replace trait
        /*!
            This trait specifies that the sequence has \c std::string like replace method
        */
        template< typename T >
        class has_native_replace
        {

        public:
#    if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
            enum { value = false };
#    else
            BOOST_STATIC_CONSTANT(bool, value=false);
#    endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )

            typedef mpl::bool_<has_native_replace<T>::value> type;
        };

        //! Stable iterators trait
        /*!
            This trait specifies that the sequence has stable iterators. It means
            that operations like insert/erase/replace do not invalidate iterators.
        */
        template< typename T >
        class has_stable_iterators
        {
        public:
#    if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
            enum { value = false };
#    else
            BOOST_STATIC_CONSTANT(bool, value=false);
#    endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )

            typedef mpl::bool_<has_stable_iterators<T>::value> type;
        };

        //! Const time insert trait
        /*!
            This trait specifies that the sequence's insert method has
            constant time complexity.
        */
        template< typename T >
        class has_const_time_insert
        {
        public:
#    if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
            enum { value = false };
#    else
            BOOST_STATIC_CONSTANT(bool, value=false);
#    endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )

            typedef mpl::bool_<has_const_time_insert<T>::value> type;
        };

        //! Const time erase trait
        /*!
            This trait specifies that the sequence's erase method has
            constant time complexity.
        */
        template< typename T >
        class has_const_time_erase
        {
        public:
#    if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
            enum { value = false };
#    else
            BOOST_STATIC_CONSTANT(bool, value=false);
#    endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )

            typedef mpl::bool_<has_const_time_erase<T>::value> type;
        };

    } // namespace algorithm
} // namespace geofeatures_boost

#endif  // BOOST_STRING_SEQUENCE_TRAITS_HPP


text:
assignment.pdf: assignment.tex
	pdflatex assignment.tex


text:
@interface CPBaseViewController ()
@property (nonatomic, strong) id segueData;
@end

@implementation CPBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void) setData:(id)data sender:(id)sender {
    [self setData:data];
}

-(void)moveSubViewController:(CPBaseViewController *)uiViewController :(UINavigationController *)uiNavigationController setData:(id) data {
    if (uiViewController == nil) {
        [self presentViewController:uiNavigationController animated:YES completion:NULL];
        uiViewController = [uiNavigationController.viewControllers objectAtIndex:0];
    }
    [uiViewController setData:data];
    [self showViewController:uiViewController sender:nil];
}

-(void)moveSubViewController:(NSString *) storyboardName storyboardId:(NSString *)storyboardId setData:(id) data {
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:[NSBundle mainBundle]];
    CPBaseViewController *uiViewController = [storyboard instantiateViewControllerWithIdentifier:storyboardId];
    [uiViewController setData:data];

    [self showViewController:uiViewController sender:nil];
}

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.destinationViewController isKindOfClass:[CPBaseViewController class]]) {
        [(CPBaseViewController *) segue.destinationViewController setData:[self segueData]];
    }
}

-(void)moveSubViewController:(NSString *) segueIdentifier setData:(id) data {
    [self setSegueData:data];
    [self performSegueWithIdentifier:segueIdentifier sender:self];

}

-(void)movePopupViewController:(CPBaseViewController *)uiViewController :(UINavigationController *)uiNavigationController setData:(id) data {
    [uiViewController setData:data];
    [self showDetailViewController:uiViewController sender:nil];
}

-(void)movePopupViewController:(NSString *)storyboardName storyboardId:(NSString *)storyboardId setData:(id)data {
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:[NSBundle mainBundle]];
    CPBaseViewController *uiViewController = [storyboard instantiateViewControllerWithIdentifier:storyboardId];
    [uiViewController setData:data];
    [self showDetailViewController:uiViewController sender:nil];
}

- (void) closeViewController {

}

@end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=8" />

	<title>MochaUI - A Web Applications User Interface Library</title>
	<meta name="description" content="A web applications user interface library built on the Mootools javascript framework" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />

	<link rel="stylesheet" type="text/css" href="themes/default/css/Content.css" />
	<link rel="stylesheet" type="text/css" href="themes/default/css/Core.css" />
	<link rel="stylesheet" type="text/css" href="themes/default/css/Layout.css" />
	<link rel="stylesheet" type="text/css" href="themes/default/css/Dock.css" />
	<link rel="stylesheet" type="text/css" href="themes/default/css/Tabs.css" />
	<link rel="stylesheet" type="text/css" href="themes/default/css/Window.css" />

Mocha UI

A Web Applications User Interface Library

Welcome Demo User.

Sign Out

Examples

Ajax/XHR Demo

Json Demo

Iframe: YouTube

Accordian

Widget: Clock

Window Parametrics

Tests

Window Events

Container Test

Iframe Tests

No Canvas Body

Starters

Web Application

Fixed Width

No Toolbars

No Desktop

Modal Only

View

Cascade Windows

Tile Windows

Minimize All Windows

Close All Windows

Tools

Window Builder

					Workspace

Save Workspace

Load Workspace

Use Effects

Help

Features

Documentation

About

			© 2007-2009 Greg Houston - MIT License


text:
#include "NxOgreStable.h"
#include "NxOgreResource.h"

const char ::NxOgre::Resource::NULL_BYTE = 0;

namespace NxOgre
{

Resource::Resource(const Path& path, ResourceProtocol* protocol, Enums::ResourceAccess access)
: mPath(path),
  mProtocol(protocol),
  mStatus(Enums::ResourceStatus_Closed),
  mDirectionality(Enums::ResourceDirectionality_Unknown),
  mAccess(access),
  mNbReadBytes(0),
  mNbWroteBytes(0)
{
}

Resource::~Resource()
{
}

ResourceProtocol* Resource::getProtocol()
{
 return mProtocol;
}

Path Resource::getPath() const
{
 return mPath;
}

bool Resource::hasTouched() const
{
 return mNbWroteBytes != 0;
}

unsigned int Resource::getNbBytesRead() const
{
 return mNbReadBytes;
}

unsigned int Resource::getNbBytesWrote() const
{
 return mNbWroteBytes;
}

Enums::ResourceStatus Resource::getStatus() const
{
 return Enums::ResourceStatus_Unknown;
}

Enums::ResourceDirectionality Resource::getDirectionality() const
{
 return Enums::ResourceDirectionality_Unknown;
}

Enums::ResourceAccess Resource::getAccess() const
{
 return Enums::ResourceAccess_NoAccess;
}

size_t Resource::getSize() const
{
 return 0;
}

bool Resource::seek(size_t)
{
 return false;
}

bool Resource::seekBeginning()
{
 return false;
}

bool Resource::seekEnd()
{
 return false;
}

bool Resource::atBeginning() const
{
 return false;
}

bool Resource::atEnd() const
{
 return false;
}

size_t Resource::at() const
{
 return 0;
}

bool Resource::write(const void* src, size_t src_size)
{
 return false;
}

bool Resource::writeNull()
{
 return false;
}

bool Resource::writeBool(bool)
{
 return false;
}

bool Resource::writeBool(bool*, size_t length)
{
 return false;
}

bool Resource::writeUChar(unsigned char)
{
 return false;
}

bool Resource::writeUChar(unsigned char*, size_t length)
{
 return false;
}

bool Resource::writeChar(char)
{
 return false;
}

bool Resource::writeChar(char*, size_t length)
{
 return false;
}

bool Resource::writeUShort(unsigned short)
{
 return false;
}

bool Resource::writeUShort(unsigned short*, size_t length)
{
 return false;
}

bool Resource::writeShort(short)
{
 return false;
}

bool Resource::writeShort(short*, size_t length)
{
 return false;
}

bool Resource::writeUInt(unsigned int)
{
 return false;
}

bool Resource::writeUInt(unsigned int*, size_t length)
{
 return false;
}

bool Resource::writeInt(int)
{
 return false;
}

bool Resource::writeInt(int*, size_t length)
{
 return false;
}

bool Resource::writeFloat(float)
{
 return false;
}

bool Resource::writeFloat(float*, size_t length)
{
 return false;
}

bool Resource::writeDouble(double)
{
 return false;
}

bool Resource::writeDouble(double*, size_t length)
{
 return false;
}

bool Resource::writeReal(NxOgreRealType)
{
 return false;
}

bool Resource::writeReal(NxOgreRealType*, size_t length)
{
 return false;
}

bool Resource::writeLong(long)
{
 return false;
}

bool Resource::writeLong(long*, size_t length)
{
 return false;
}

bool Resource::writeString(const String&)
{
 return false;
}

bool Resource::readBool()
{
 return false;
}

void Resource::readBoolArray(bool*, size_t length)
{
}

unsigned char Resource::readUChar()
{
 return false;
}

void Resource::readUCharArray(unsigned char*, size_t length)
{
}

char Resource::readChar()
{
 return false;
}

void Resource::readCharArray(char*, size_t length)
{
}

unsigned short Resource::readUShort()
{
 return false;
}

void Resource::readUShortArray(unsigned short*, size_t length)
{
}

short Resource::readShort()
{
 return false;
}

void Resource::readShortArray(short*, size_t length)
{
}

unsigned int Resource::readUInt()
{
 return false;
}

void Resource::readUIntArray(unsigned int*, size_t length)
{
}

int Resource::readInt()
{
 return false;
}

void Resource::readIntArray(int*, size_t length)
{
}

float Resource::readFloat()
{
 return false;
}

void Resource::readFloatArray(float*, size_t length)
{
}

double Resource::readDouble()
{
 return false;
}

void Resource::readDouble(double*, size_t length)
{
}

Real Resource::readReal()
{
 return false;
}

void Resource::readRealArray(NxOgreRealType*, size_t length)
{
}

long Resource::readLong()
{
 return false;
}

void Resource::readLongArray(long*, size_t length)
{
}

void Resource::flush()
{
}

String Resource::to_s() const
{
 return NxOgre::to_s((void*)this, String("'" + mPath.getString() + "'") );
}

} // namespace NxOgre


text:
<?php
namespace Concrete\Controller\Panel\Detail\Page;
use \Concrete\Controller\Backend\UserInterface\Page as BackendInterfacePageController;
use PageEditResponse;
use PageType;
use View;
use Loader;
use PageTemplate;
use User;
use Core;

class Composer extends BackendInterfacePageController {

	protected $viewPath = '/panels/details/page/composer';

	protected function canAccess() {
		return $this->permissions->canEditPageContents();
	}

	public function view() {
		$pagetype = PageType::getByID($this->page->getPageTypeID());
		$id = $this->page->getCollectionID();
		$saveURL = View::url('/dashboard/composer/write', 'save', 'draft', $id);
		$viewURL = View::url('/dashboard/composer/write', 'draft', $id);
		$this->set('saveURL', $saveURL);
		$this->set('viewURL', $viewURL);
		$this->set('pagetype', $pagetype);
	}

	public function autosave() {
		if ($this->validateAction()) {
			$r = $this->save();
			$ptr = $r[0];
			if (!$ptr->error->has()) {
				$ptr->setMessage(t('Page saved on %s', Core::make('helper/date')->formatDateTime($ptr->time, true, true)));
			}
			$ptr->outputJSON();
		} else {
			throw new \Exception(t('Access Denied.'));
		}
	}

    public function saveAndExit() {
		if ($this->validateAction()) {
        	$r = $this->save();
        	$ptr = $r[0];
        	$u = new User();
        	$c = \Page::getByID($u->getPreviousFrontendPageID());
        	$ptr->setRedirectURL($c->getCollectionLink(true));
        	$ptr->outputJSON();
		} else {
			throw new \Exception(t('Access Denied.'));
		}
    }

    public function publish() {
		if ($this->validateAction()) {
			$r = $this->save();
			$ptr = $r[0];
			$pagetype = $r[1];
			$outputControls = $r[2];

			$c = $this->page;
			$e = $ptr->error;
			$validator = $pagetype->getPageTypeValidatorObject();
			if ($this->page->isPageDraft()) {
				$target = \Page::getByID($this->page->getPageDraftTargetParentPageID());
			} else {
				$target = \Page::getByID($this->page->getCollectionParentID());
			}
			$e->add($validator->validatePublishLocationRequest($target));
			$e->add($validator->validatePublishDraftRequest($c));

			$ptr->setError($e);

			if (!$e->has()) {
				$pagetype->publish($c);
				$ptr->setRedirectURL(Loader::helper('navigation')->getLinkToCollection($c));
			}
			$ptr->outputJSON();
		} else {
			throw new \Exception(t('Access Denied.'));
		}
	}

	public function discard() {
		if ($this->validateAction()) {
			$ptr = new PageEditResponse();
			if ($this->permissions->canDeletePage() && $this->page->isPageDraft()) {
				$this->page->delete();
				$u = new User();
				$cID = $u->getPreviousFrontendPageID();
				$ptr->setRedirectURL(DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=' . $cID);
			} else {
				$e = Loader::helper('validation/error');
				$e->add(t('You do not have permission to discard this page.'));
				$ptr->setError($e);
			}

			$ptr->outputJSON();
		} else {
			throw new \Exception(t('Access Denied.'));
		}
	}

	protected function save() {
		$c = $this->page;
		$ptr = new PageEditResponse($e);
		$ptr->setPage($c);

		$pagetype = $c->getPageTypeObject();
        if ($_POST['ptComposerPageTemplateID']) {
    		$pt = PageTemplate::getByID($_POST['ptComposerPageTemplateID']);
        }
		if (!is_object($pt)) {
			$pt = $pagetype->getPageTypeDefaultPageTemplateObject();
		}
		$validator = $pagetype->getPageTypeValidatorObject();
		$e = $validator->validateCreateDraftRequest($pt);
        $outputControls = array();
		if (!$e->has()) {
			$c = $c->getVersionToModify();
            $this->page = $c;

			/// set the target
			$configuredTarget = $pagetype->getPageTypePublishTargetObject();
			$targetPageID = $configuredTarget->getPageTypePublishTargetConfiguredTargetParentPageID();
			if (!$targetPageID) {
				$targetPageID = $_POST['cParentID'];
			}

			$c->setPageDraftTargetParentPageID($targetPageID);
			$outputControls = $pagetype->savePageTypeComposerForm($c);
		}
        $ptr->setError($e);
		return array($ptr, $pagetype, $outputControls);
	}

}


text:
[![Build Status](https://travis-ci.org/Aplyca/ansible-role-accelerator.svg?branch=master)](https://travis-ci.org/Aplyca/ansible-role-accelerator)
[![Circle CI](https://circleci.com/gh/Aplyca/ansible-role-accelerator.svg?style=svg)](https://circleci.com/gh/Aplyca/ansible-role-accelerator)
[![Build Status](https://drone.io/github.com/Aplyca/ansible-role-accelerator/status.png)](https://drone.io/github.com/Aplyca/ansible-role-accelerator/latest)
Ansible Role that installs and configure a web accelerator based on Varnish on Debian/Ubuntu.

## Requirements

Use hash behavior for variables in ansible.cfg
See example: https://github.com/Aplyca/ansible-role-accelerator/blob/master/tests/ansible.cfg
See official docs: http://docs.ansible.com/intro_configuration.html#hash-behaviour

## Installation

Using ansible galaxy:
```bash
ansible-galaxy install aplyca.Accelerator
```
You can add this role as a dependency for other roles, add the role to the meta/main.yml file of your own role:
```yaml
dependencies:
  - { role: mauricios.Varnish }
```

## Role Variables

See default variables: https://github.com/Aplyca/ansible-role-accelerator/blob/master/defaults/main.yml

## Dependencies

Aplyca.Nginx
Aplyca.Varnish

Testing
-------
Using Vagrant:

```bash
tests/vagrant.sh
```
Using Docker:

```bash
tests/docker.sh
```

You should see an Apache server on http://localhost:8080

License
-------

MIT / BSD

Author Information
------------------

Mauricio Sánchez from Aplyca SAS (http://www.aplyca.com)


text:
"""
Tado component to create some sensors for each zone.

For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.tado/
"""
import logging

from homeassistant.const import TEMP_CELSIUS
from homeassistant.helpers.entity import Entity
from homeassistant.components.tado import (DATA_TADO)
from homeassistant.const import (ATTR_ID)

_LOGGER = logging.getLogger(__name__)

ATTR_DATA_ID = 'data_id'
ATTR_DEVICE = 'device'
ATTR_NAME = 'name'
ATTR_ZONE = 'zone'

SENSOR_TYPES = ['temperature', 'humidity', 'power',
                'link', 'heating', 'tado mode', 'overlay']

def setup_platform(hass, config, add_devices, discovery_info=None):
    """Set up the sensor platform."""
    tado = hass.data[DATA_TADO]

    try:
        zones = tado.get_zones()
    except RuntimeError:
        _LOGGER.error("Unable to get zone info from mytado")
        return

    sensor_items = []
    for zone in zones:
        if zone['type'] == 'HEATING':
            for variable in SENSOR_TYPES:
                sensor_items.append(create_zone_sensor(
                    tado, zone, zone['name'], zone['id'],
                    variable))

    me_data = tado.get_me()
    sensor_items.append(create_device_sensor(
        tado, me_data, me_data['homes'][0]['name'],
        me_data['homes'][0]['id'], "tado bridge status"))

    if sensor_items:
        add_devices(sensor_items, True)

def create_zone_sensor(tado, zone, name, zone_id, variable):
    """Create a zone sensor."""
    data_id = 'zone {} {}'.format(name, zone_id)

    tado.add_sensor(data_id, {
        ATTR_ZONE: zone,
        ATTR_NAME: name,
        ATTR_ID: zone_id,
        ATTR_DATA_ID: data_id
    })

    return TadoSensor(tado, name, zone_id, variable, data_id)

def create_device_sensor(tado, device, name, device_id, variable):
    """Create a device sensor."""
    data_id = 'device {} {}'.format(name, device_id)

    tado.add_sensor(data_id, {
        ATTR_DEVICE: device,
        ATTR_NAME: name,
        ATTR_ID: device_id,
        ATTR_DATA_ID: data_id
    })

    return TadoSensor(tado, name, device_id, variable, data_id)

class TadoSensor(Entity):
    """Representation of a tado Sensor."""

    def __init__(self, store, zone_name, zone_id, zone_variable, data_id):
        """Initialize of the Tado Sensor."""
        self._store = store

        self.zone_name = zone_name
        self.zone_id = zone_id
        self.zone_variable = zone_variable

        self._unique_id = '{} {}'.format(zone_variable, zone_id)
        self._data_id = data_id

        self._state = None
        self._state_attributes = None

    @property
    def unique_id(self):
        """Return the unique id."""
        return self._unique_id

    @property
    def name(self):
        """Return the name of the sensor."""
        return '{} {}'.format(self.zone_name, self.zone_variable)

    @property
    def state(self):
        """Return the state of the sensor."""
        return self._state

    @property
    def device_state_attributes(self):
        """Return the state attributes."""
        return self._state_attributes

    @property
    def unit_of_measurement(self):
        """Return the unit of measurement."""
        if self.zone_variable == "temperature":
            return self.hass.config.units.temperature_unit
        elif self.zone_variable == "humidity":
            return '%'
        elif self.zone_variable == "heating":
            return '%'

    @property
    def icon(self):
        """Icon for the sensor."""
        if self.zone_variable == "temperature":
            return 'mdi:thermometer'
        elif self.zone_variable == "humidity":
            return 'mdi:water-percent'

    def update(self):
        """Update method called when should_poll is true."""
        self._store.update()

        data = self._store.get_data(self._data_id)

        if data is None:
            _LOGGER.debug("Recieved no data for zone %s", self.zone_name)
            return

        unit = TEMP_CELSIUS

        # pylint: disable=R0912
        if self.zone_variable == 'temperature':
            if 'sensorDataPoints' in data:
                sensor_data = data['sensorDataPoints']
                temperature = float(
                    sensor_data['insideTemperature']['celsius'])

                self._state = self.hass.config.units.temperature(
                    temperature, unit)
                self._state_attributes = {
                    "time":
                        sensor_data['insideTemperature']['timestamp'],
                    "setting": 0  # setting is used in climate device
                }

                # temperature setting will not exist when device is off
                if 'temperature' in data['setting'] and \
                        data['setting']['temperature'] is not None:
                    temperature = float(
                        data['setting']['temperature']['celsius'])

                    self._state_attributes["setting"] = \
                        self.hass.config.units.temperature(
                            temperature, unit)

        elif self.zone_variable == 'humidity':
            if 'sensorDataPoints' in data:
                sensor_data = data['sensorDataPoints']
                self._state = float(
                    sensor_data['humidity']['percentage'])
                self._state_attributes = {
                    "time": sensor_data['humidity']['timestamp'],
                }

        elif self.zone_variable == 'power':
            if 'setting' in data:
                self._state = data['setting']['power']

        elif self.zone_variable == 'link':
            if 'link' in data:
                self._state = data['link']['state']

        elif self.zone_variable == 'heating':
            if 'activityDataPoints' in data:
                activity_data = data['activityDataPoints']
                self._state = float(
                    activity_data['heatingPower']['percentage'])
                self._state_attributes = {
                    "time": activity_data['heatingPower']['timestamp'],
                }

        elif self.zone_variable == 'tado bridge status':
            if 'connectionState' in data:
                self._state = data['connectionState']['value']

        elif self.zone_variable == 'tado mode':
            if 'tadoMode' in data:
                self._state = data['tadoMode']

        elif self.zone_variable == 'overlay':
            if 'overlay' in data and data['overlay'] is not None:
                self._state = True
                self._state_attributes = {
                    "termination": data['overlay']['termination']['type'],
                }
            else:
                self._state = False
                self._state_attributes = {}


text:
package org.apache.logging.log4j.core.appender.rewrite;

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

import java.util.List;
import java.util.Map;

import org.apache.logging.log4j.EventLogger;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.junit.LoggerContextRule;
import org.apache.logging.log4j.message.Message;
import org.apache.logging.log4j.message.StructuredDataMessage;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Test;

/**
 *
 */
public class RewriteAppenderTest {
    private ListAppender app;
    private ListAppender app2;

    @ClassRule
    public static LoggerContextRule init = new LoggerContextRule("log4j-rewrite.xml");

    @Before
    public void setUp() throws Exception {
        app = init.getListAppender("List");
        app2 = init.getListAppender("List2");
    }

    @After
    public void tearDown() throws Exception {
        app.clear();
        app2.clear();
    }

    @Test
    public void rewriteTest() {
        final StructuredDataMessage msg = new StructuredDataMessage("Test", "This is a test", "Service");
        msg.put("Key1", "Value1");
        msg.put("Key2", "Value2");
        EventLogger.logEvent(msg);
        final List<LogEvent> list = app.getEvents();
        assertNotNull("No events generated", list);
        assertTrue("Incorrect number of events. Expected 1, got " + list.size(), list.size() == 1);
        final LogEvent event = list.get(0);
        final Message m = event.getMessage();
        assertTrue("Message is not a StringMapMessage: " + m.getClass(), m instanceof StructuredDataMessage);
        final StructuredDataMessage message = (StructuredDataMessage) m;
        final Map<String, String> map = message.getData();
        assertNotNull("No Map", map);
        assertTrue("Incorrect number of map entries, expected 3 got " + map.size(), map.size() == 3);
        final String value = map.get("Key1");
        assertEquals("Apache", value);
    }

    @Test
    public void testProperties() {
        final Logger logger = LogManager.getLogger(RewriteAppenderTest.class);
        logger.debug("Test properties rewrite");
        final List<String> list = app2.getMessages();
        assertNotNull("No events generated", list);
        assertTrue("Incorrect number of events. Expected 1, got " + list.size(), list.size() == 1);
        assertFalse("Did not resolve user name", list.get(0).contains("{user.dir}"));
    }

    @Test
    public void testFilter() {
        StructuredDataMessage msg = new StructuredDataMessage("Test", "This is a test", "Service");
        msg.put("Key1", "Value2");
        msg.put("Key2", "Value1");
        final Logger logger = LogManager.getLogger("org.apache.logging.log4j.core.Logging");
        logger.debug(msg);
        msg = new StructuredDataMessage("Test", "This is a test", "Service");
        msg.put("Key1", "Value1");
        msg.put("Key2", "Value2");
        logger.trace(msg);

        final List<LogEvent> list = app.getEvents();
        assertTrue("Events were generated", list == null || list.isEmpty());
    }
}


text:
package cn.dx.sunny.service.system.impl;

import cn.dx.sunny.domain.model.CrsLogWithBLOBs;
import cn.dx.sunny.service.system.CrsLogService;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Created by IntelliJ IDEA.
 * User: Liu Xiongwei
 * Date: 2016-11-23
 * Time: 15:30
 * Description:
 * To change this template use File | Settings | File Templates.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:conf/applicationContext.xml")
public class CrsLogServiceImplTest {

    @Autowired
    private CrsLogService crsLogService;

    @Ignore
    @Test
    public void insertCrsLog() throws Exception {
        CrsLogWithBLOBs crsLogWithBLOBs = new CrsLogWithBLOBs();
        crsLogWithBLOBs.setUserId(1);
        crsLogWithBLOBs.setRequestTitle("test");
        this.crsLogService.insertCrsLog(crsLogWithBLOBs);
    }

}


text:
/*
 *  Simple DTLS client demonstration program
 *
 *  Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
 *  SPDX-License-Identifier: Apache-2.0
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may
 *  not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *  This file is part of mbed TLS (https://tls.mbed.org)
 */

/****************************************************************************
 * Included Files
 ****************************************************************************/

#include <sys/types.h>
#include <stdio.h>
#include <string.h>

#include "mbedtls/config.h"

#if !defined(MBEDTLS_SSL_CLI_C) || !defined(MBEDTLS_SSL_PROTO_DTLS) ||	\
	!defined(MBEDTLS_NET_C) || !defined(MBEDTLS_TIMING_C) ||			\
	!defined(MBEDTLS_ENTROPY_C) || !defined(MBEDTLS_CTR_DRBG_C) ||		\
	!defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_RSA_C) ||	\
	!defined(MBEDTLS_CERTS_C)
int dtls_client_main(int argc, char **argv)
{
	printf("MBEDTLS_SSL_CLI_C and/or MBEDTLS_SSL_PROTO_DTLS and/or\n");
	printf("MBEDTLS_NET_C and/or MBEDTLS_TIMING_C and/or\n");
	printf("MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or\n");
	printf("MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_RSA_C and/or\n");
	printf("MBEDTLS_CERTS_C and/or MBEDTLS_PEM_PARSE_C not defined.\n");
	return 0;
}
#else

#define mbedtls_printf     printf
#define mbedtls_fprintf    fprintf

#include "mbedtls/net.h"
#include "mbedtls/debug.h"
#include "mbedtls/ssl.h"
#include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h"
#include "mbedtls/error.h"
#include "mbedtls/certs.h"
#include "mbedtls/timing.h"

#define SERVER_PORT "4433"
#define SERVER_NAME "localhost"
#define SERVER_ADDR "127.0.0.1"	/* forces IPv4 */
#define MESSAGE     "TinyARA test echo packet"

#define READ_TIMEOUT_MS 1000
#define MAX_RETRY       5

#define USAGE_DTLS \
"\n--------------------------USAGE----------------------------\n"	\
"dtlsc\n"															\
"dtlsc server_addr=xxx.xxx.xxx.xxx\n"								\
"-----------------------------------------------------------\n"

#define DEBUG_LEVEL 0

/*
 * Definition for handling pthread
 */
#define DTLS_CLIENT_PRIORITY     100
#define DTLS_CLIENT_STACK_SIZE   51200
#define DTLS_CLIENT_SCHED_POLICY SCHED_RR

struct pthread_arg {
	int argc;
	char **argv;
};

static void my_debug(void *ctx, int level, const char *file, int line, const char *str)
{
	((void)level);

	mbedtls_fprintf((FILE *)ctx, "%s:%04d: %s", file, line, str);
	fflush((FILE *)ctx);
}

/****************************************************************************
 * dtls_client_main
 ****************************************************************************/

int dtls_client_cb(void *args)
{
	int argc;
	char **argv;
	char *p;
	char *q;

	int ret = 0;
	int len;
	mbedtls_net_context server_fd;
	uint32_t flags;
	unsigned char buf[1024];
	const char *pers = "dtls_client";
	int retry_left = MAX_RETRY;

	mbedtls_entropy_context entropy;
	mbedtls_ctr_drbg_context ctr_drbg;
	mbedtls_ssl_context ssl;
	mbedtls_ssl_config conf;
	mbedtls_x509_crt cacert;
	mbedtls_timing_delay_context timer;

#if defined(MBEDTLS_DEBUG_C)
	mbedtls_debug_set_threshold(DEBUG_LEVEL);
#endif

	char *server_addr = SERVER_ADDR;

	argc = ((struct pthread_arg *)args)->argc;
	argv = ((struct pthread_arg *)args)->argv;

	if (argc == 0) {
usage:
		printf(USAGE_DTLS);
		goto exit;
	} else {
		int i;
		for (i = 1; i < argc; i++) {
			p = argv[i];
			if ((q = strchr(p, '=')) == NULL) {
				goto usage;
			}
			*q++ = '\0';
			if (strcmp(p, "server_addr") == 0) {
				server_addr = q;
			} else {
				goto usage;
			}
		}
	}

	/*
	 * 0. Initialize the RNG and the session data
	 */
	mbedtls_net_init(&server_fd);
	mbedtls_ssl_init(&ssl);
	mbedtls_ssl_config_init(&conf);
	mbedtls_x509_crt_init(&cacert);
	mbedtls_ctr_drbg_init(&ctr_drbg);

	mbedtls_printf("\n  . Seeding the random number generator...");
	fflush(stdout);

	mbedtls_entropy_init(&entropy);
	if ((ret = mbedtls_ctr_drbg_seed(&ctr_drbg, mbedtls_entropy_func, &entropy, (const unsigned char *)pers, strlen(pers))) != 0) {
		mbedtls_printf(" failed\n  ! mbedtls_ctr_drbg_seed returned %d\n", ret);
		goto exit;
	}

	mbedtls_printf(" ok\n");

	/*
	 * 0. Load certificates
	 */
	mbedtls_printf("  . Loading the CA root certificate ...");
	fflush(stdout);

	ret = mbedtls_x509_crt_parse(&cacert, (const unsigned char *)mbedtls_test_ca_crt_rsa, mbedtls_test_ca_crt_rsa_len);
	if (ret < 0) {
		mbedtls_printf(" failed\n  !  mbedtls_x509_crt_parse returned -0x%x\n\n", -ret);
		goto exit;
	}

	mbedtls_printf(" ok (%d skipped)\n", ret);

	/*
	 * 1. Start the connection
	 */
	mbedtls_printf("  . Connecting to udp/%s/%s...", server_addr, SERVER_PORT);
	fflush(stdout);

	if ((ret = mbedtls_net_connect(&server_fd, server_addr, SERVER_PORT, MBEDTLS_NET_PROTO_UDP)) != 0) {
		mbedtls_printf(" failed\n  ! mbedtls_net_connect returned %d\n\n", ret);
		goto exit;
	}

	mbedtls_printf(" ok\n");

	/*
	 * 2. Setup stuff
	 */
	mbedtls_printf("  . Setting up the DTLS structure...");
	fflush(stdout);

	if ((ret = mbedtls_ssl_config_defaults(&conf, MBEDTLS_SSL_IS_CLIENT, MBEDTLS_SSL_TRANSPORT_DATAGRAM, MBEDTLS_SSL_PRESET_DEFAULT)) != 0) {
		mbedtls_printf(" failed\n  ! mbedtls_ssl_config_defaults returned %d\n\n", ret);
		goto exit;
	}

	/*
	 * OPTIONAL is usually a bad choice for security, but makes interop easier
	 * in this simplified example, in which the ca chain is hardcoded.
	 * Production code should set a proper ca chain and use REQUIRED.
	 */
	mbedtls_ssl_conf_authmode(&conf, MBEDTLS_SSL_VERIFY_OPTIONAL);
	mbedtls_ssl_conf_ca_chain(&conf, &cacert, NULL);
	mbedtls_ssl_conf_rng(&conf, mbedtls_ctr_drbg_random, &ctr_drbg);
	mbedtls_ssl_conf_dbg(&conf, my_debug, stdout);

	if ((ret = mbedtls_ssl_setup(&ssl, &conf)) != 0) {
		mbedtls_printf(" failed\n  ! mbedtls_ssl_setup returned %d\n\n", ret);
		goto exit;
	}

	if ((ret = mbedtls_ssl_set_hostname(&ssl, SERVER_NAME)) != 0) {
		mbedtls_printf(" failed\n  ! mbedtls_ssl_set_hostname returned %d\n\n", ret);
		goto exit;
	}

	mbedtls_ssl_set_bio(&ssl, &server_fd, mbedtls_net_send, mbedtls_net_recv, mbedtls_net_recv_timeout);
	mbedtls_ssl_set_timer_cb(&ssl, &timer, mbedtls_timing_set_delay, mbedtls_timing_get_delay);

	mbedtls_printf(" ok\n");

	/*
	 * 4. Handshake
	 */
	mbedtls_printf("  . Performing the SSL/TLS handshake...");
	fflush(stdout);

	do {
		ret = mbedtls_ssl_handshake(&ssl);
	} while (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE);

	if (ret != 0) {
		mbedtls_printf(" failed\n  ! mbedtls_ssl_handshake returned -0x%x\n\n", -ret);
		goto exit;
	}

	mbedtls_printf(" ok\n");

	/*
	 * 5. Verify the server certificate
	 */
	mbedtls_printf("  . Verifying peer X.509 certificate...");

	/* In real life, we would have used MBEDTLS_SSL_VERIFY_REQUIRED so that the
	 * handshake would not succeed if the peer's cert is bad.  Even if we used
	 * MBEDTLS_SSL_VERIFY_OPTIONAL, we would bail out here if ret != 0 */
	if ((flags = mbedtls_ssl_get_verify_result(&ssl)) != 0) {
		char vrfy_buf[512];

		mbedtls_printf(" failed\n");

		mbedtls_x509_crt_verify_info(vrfy_buf, sizeof(vrfy_buf), "  ! ", flags);

		mbedtls_printf("%s\n", vrfy_buf);
	} else {
		mbedtls_printf(" ok\n");
	}

	/*
	 * 6. Write the echo request
	 */
send_request:

	len = sizeof(MESSAGE) - 1;

	do {
		ret = mbedtls_ssl_write(&ssl, (unsigned char *)MESSAGE, len);
	} while (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE);

	if (ret < 0) {
		mbedtls_printf(" failed\n  ! mbedtls_ssl_write returned %d\n", ret);
		goto exit;
	}

	len = ret;
	mbedtls_printf(" > WRITE TO SERVER  %d bytes written : %s\n", len, MESSAGE);

	/*
	 * 7. Read the echo response
	 */
	len = sizeof(buf) - 1;
	memset(buf, 0, sizeof(buf));

	do {
		ret = mbedtls_ssl_read(&ssl, buf, len);
	} while (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE);

	if (ret <= 0) {
		switch (ret) {
		case MBEDTLS_ERR_SSL_TIMEOUT:
			mbedtls_printf(" timeout\n\n");
			if (retry_left-- > 0) {
				goto send_request;
			}
			goto exit;

		case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY:
			mbedtls_printf(" connection was closed gracefully\n");
			ret = 0;
			goto close_notify;

		default:
			mbedtls_printf(" mbedtls_ssl_read returned -0x%x\n", -ret);
			goto exit;
		}
	}

	len = ret;
	mbedtls_printf(" < READ FROM SERVER %d bytes read : %s\n", len, buf);

	/*
	 * 8. Done, cleanly close the connection
	 */
close_notify:
	mbedtls_printf("  . Closing the connection...");

	/* No error checking, the connection might be closed already */
	do {
		ret = mbedtls_ssl_close_notify(&ssl);
	} while (ret == MBEDTLS_ERR_SSL_WANT_WRITE);
	ret = 0;

	mbedtls_printf(" done\n");

	/*
	 * 9. Final clean-ups and exit
	 */
exit:

#ifdef MBEDTLS_ERROR_C
	if (ret != 0) {
		char error_buf[100];
		mbedtls_strerror(ret, error_buf, 100);
		mbedtls_printf("Last error was: %d - %s\n\n", ret, error_buf);
	}
#endif

	mbedtls_net_free(&server_fd);

	mbedtls_x509_crt_free(&cacert);
	mbedtls_ssl_free(&ssl);
	mbedtls_ssl_config_free(&conf);
	mbedtls_ctr_drbg_free(&ctr_drbg);
	mbedtls_entropy_free(&entropy);

#if defined(_WIN32)
	mbedtls_printf("  + Press Enter to exit this program.\n");
	fflush(stdout);
	getchar();
#endif

	/* Shell can not handle large exit numbers -> 1 for errors */
	if (ret < 0) {
		ret = 1;
	}

	return 0;
}

int dtls_client_main(int argc, char **argv)
{
	pthread_t tid;
	pthread_attr_t attr;
	struct sched_param sparam;
	int r;

	struct pthread_arg args;
	args.argc = argc;
	args.argv = argv;

	/* Initialize the attribute variable */
	if ((r = pthread_attr_init(&attr)) != 0) {
		printf("%s: pthread_attr_init failed, status=%d\n", __func__, r);
	}

	/* 1. set a priority */
	sparam.sched_priority = DTLS_CLIENT_PRIORITY;
	if ((r = pthread_attr_setschedparam(&attr, &sparam)) != 0) {
		printf("%s: pthread_attr_setschedparam failed, status=%d\n", __func__, r);
	}

	if ((r = pthread_attr_setschedpolicy(&attr, DTLS_CLIENT_SCHED_POLICY)) != 0) {
		printf("%s: pthread_attr_setschedpolicy failed, status=%d\n", __func__, r);
	}

	/* 2. set a stacksize */
	if ((r = pthread_attr_setstacksize(&attr, DTLS_CLIENT_STACK_SIZE)) != 0) {
		printf("%s: pthread_attr_setstacksize failed, status=%d\n", __func__, r);
	}

	/* 3. create pthread with entry function */
	if ((r = pthread_create(&tid, &attr, (pthread_startroutine_t)dtls_client_cb, (void *)&args)) != 0) {
		printf("%s: pthread_create failed, status=%d\n", __func__, r);
	}

	/* Wait for the threads to stop */
	pthread_join(tid, NULL);

	return 0;
}
#endif


text:
package io.muoncore.memory.transport;

public class InMemFailureEvent {
}