text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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.
-->
<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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.syncope</groupId>
    <artifactId>syncope-fit</artifactId>
    <version>3.0.1-SNAPSHOT</version>
  </parent>

  <name>Apache Syncope FIT WA Reference</name>
  <description>Apache Syncope FIT WA Reference</description>
  <groupId>org.apache.syncope.fit</groupId>
  <artifactId>syncope-fit-wa-reference</artifactId>
  <packaging>war</packaging>

  <properties>
    <ianal.phase>none</ianal.phase>

    <rootpom.basedir>${basedir}/../..</rootpom.basedir>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apereo.cas</groupId>
        <artifactId>cas-server-support-bom</artifactId>
        <version>${cas.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.apache.syncope.wa</groupId>
      <artifactId>syncope-wa-starter</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.syncope.common.keymaster.self</groupId>
      <artifactId>syncope-common-keymaster-client-self</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- required by JDBC attribute repository -->
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
    </dependency>

    <!-- TEST -->
    <dependency>
      <groupId>org.apache.syncope.ext.saml2sp4ui</groupId>
      <artifactId>syncope-ext-saml2sp4ui-client-enduser</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.syncope.ext.oidcc4ui</groupId>
      <artifactId>syncope-ext-oidcc4ui-client-enduser</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.syncope</groupId>
      <artifactId>syncope-sra</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>spring-cloud-starter</artifactId>
          <groupId>org.springframework.cloud</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.syncope.fit</groupId>
      <artifactId>syncope-fit-build-tools</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.syncope.fit</groupId>
      <artifactId>syncope-fit-core-reference</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.syncope.fit</groupId>
      <artifactId>syncope-fit-console-reference</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.syncope.fit</groupId>
      <artifactId>syncope-fit-enduser-reference</artifactId>
      <version>${project.version}</version>
      <type>war</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jsoup</groupId>
      <artifactId>jsoup</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven3-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <container>
            <containerId>tomcat9x</containerId>
            <zipUrlInstaller>
              <url>https://repo1.maven.org/maven2/org/apache/tomcat/tomcat/${tomcat.version}/tomcat-${tomcat.version}.zip</url>
              <downloadDir>${settings.localRepository}/org/codehaus/cargo/cargo-container-archives</downloadDir>
              <extractDir>${project.build.directory}/cargo/extract</extractDir>
            </zipUrlInstaller>
            <timeout>600000</timeout>
            <log>${cargo.log}</log>
            <output>${cargo.output}</output>

            <systemProperties>
              <java.security.egd>file:/dev/./urandom</java.security.egd>
              <java.util.secureRandomSeed>true</java.util.secureRandomSeed>

              <h2.returnOffsetDateTime>true</h2.returnOffsetDateTime>

              <javax.net.ssl.trustStore>${basedir}/src/test/resources/keystore.jks</javax.net.ssl.trustStore>
              <javax.net.ssl.trustStorePassword>password</javax.net.ssl.trustStorePassword>
            </systemProperties>
          </container>
          <configuration>
            <properties>
              <cargo.jvmargs>
                -Dspring.profiles.active=embedded,https,all
                -Dwicket.ioc.useByteBuddy=true
                -Xmx1024m -Xms512m</cargo.jvmargs>

              <cargo.servlet.port>9443</cargo.servlet.port>
              <cargo.protocol>https</cargo.protocol>
              <cargo.tomcat.connector.keystoreFile>${basedir}/src/test/resources/keystore.jks</cargo.tomcat.connector.keystoreFile>
              <cargo.tomcat.connector.keystorePass>password</cargo.tomcat.connector.keystorePass>
              <cargo.tomcat.connector.keyAlias>tomcat</cargo.tomcat.connector.keyAlias>
              <cargo.tomcat.connector.clientAuth>false</cargo.tomcat.connector.clientAuth>
              <cargo.tomcat.connector.sslProtocol>TLS</cargo.tomcat.connector.sslProtocol>
              <cargo.tomcat.connector.redirectPort>9443</cargo.tomcat.connector.redirectPort>
              <cargo.tomcat.httpSecure>true</cargo.tomcat.httpSecure>
            </properties>
          </configuration>
          <deployables>
            <deployable>
              <groupId>org.apache.syncope.fit</groupId>
              <artifactId>syncope-fit-build-tools</artifactId>
              <type>war</type>
              <properties>
                <context>syncope-fit-build-tools</context>
              </properties>
            </deployable>
            <deployable>
              <groupId>org.apache.syncope.fit</groupId>
              <artifactId>syncope-fit-core-reference</artifactId>
              <type>war</type>
              <pingURL>https://localhost:9443/syncope/index.html</pingURL>
              <pingTimeout>${cargo.deployable.ping.timeout}</pingTimeout>
              <properties>
                <context>syncope</context>
              </properties>
            </deployable>
            <deployable>
              <groupId>org.apache.syncope.fit</groupId>
              <artifactId>syncope-fit-console-reference</artifactId>
              <type>war</type>
              <properties>
                <context>syncope-console</context>
              </properties>
            </deployable>
            <deployable>
              <groupId>org.apache.syncope.fit</groupId>
              <artifactId>syncope-fit-enduser-reference</artifactId>
              <type>war</type>
              <properties>
                <context>syncope-enduser</context>
              </properties>
            </deployable>
            <deployable>
              <location>${project.build.directory}/${project.build.finalName}</location>
              <properties>
                <context>syncope-wa</context>
              </properties>
            </deployable>
          </deployables>
        </configuration>
        <executions>
          <execution>
            <id>start-container</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start</goal>
            </goals>
            <configuration>
              <skip>${skipTests}</skip>
            </configuration>
          </execution>
          <execution>
            <id>stop-container</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
            <configuration>
              <skip>${skipTests}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <argLine>-Djavax.net.ssl.trustStore=${basedir}/src/test/resources/keystore.jks -Djavax.net.ssl.trustStorePassword=password</argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <argLine>-Djavax.net.ssl.trustStore=${basedir}/src/test/resources/keystore.jks -Djavax.net.ssl.trustStorePassword=password</argLine>
        </configuration>
        <executions>
          <execution>
            <id>verify</id>
            <goals>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <resourceIncludes>src/main/resources/**/*.properties</resourceIncludes>
        </configuration>
      </plugin>
    </plugins>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
        <excludes>
          <exclude>keystore.jks</exclude>
        </excludes>
      </testResource>
      <testResource>
        <directory>${basedir}/../../sra/src/test/resources/debug</directory>
        <filtering>false</filtering>
        <includes>
          <include>saml.keystore.jks</include>
        </includes>
      </testResource>
    </testResources>
  </build>

  <profiles>
    <profile>
      <id>skipTests</id>
    </profile>

    <profile>
      <id>debug</id>

      <properties>
        <skipTests>true</skipTests>
      </properties>

      <build>
        <defaultGoal>clean verify cargo:run</defaultGoal>

        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven3-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <configuration>
                <properties>
                  <cargo.jvmargs>
                    -Dspring.profiles.active=embedded,https,all
                    -Dwicket.core.settings.general.configuration-type=development
                    -Dwicket.ioc.useByteBuddy=true
                    -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
                    -XX:+UseG1GC -Xmx1024m -Xms512m</cargo.jvmargs>
                </properties>
              </configuration>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- requires JAVA_HOME set to the latest JDK from https://github.com/TravaOpenJDK/trava-jdk-11-dcevm -->
    <profile>
      <id>hotswap</id>

      <build>
        <defaultGoal>clean verify cargo:run</defaultGoal>

        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <inherited>true</inherited>
            <executions>
              <execution>
                <id>enableHotSwapForCoreAndConsoleAndEnduser</id>
                <phase>package</phase>
                <configuration>
                  <target>
                    <copy file="${basedir}/../core-reference/target/test-classes/hotswap-agent.properties"
                          tofile="${basedir}/../core-reference/target/syncope-fit-core-reference-${project.version}/WEB-INF/classes/hotswap-agent.properties"
                          overwrite="true"/>
                    <copy file="${basedir}/../console-reference/target/test-classes/hotswap-agent.properties"
                          tofile="${basedir}/../console-reference/target/syncope-fit-console-reference-${project.version}/WEB-INF/classes/hotswap-agent.properties"
                          overwrite="true"/>
                    <copy file="${basedir}/../enduser-reference/target/test-classes/hotswap-agent.properties"
                          tofile="${basedir}/../enduser-reference/target/syncope-fit-enduser-reference-${project.version}/WEB-INF/classes/hotswap-agent.properties"
                          overwrite="true"/>
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven3-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <configuration>
                <properties>
                  <cargo.jvmargs>
                    -Dspring.profiles.active=embedded,all
                    -Dwicket.core.settings.general.configuration-type=development
                    -Dwicket.ioc.useByteBuddy=true
                    -javaagent:${java.home}/lib/hotswap/hotswap-agent.jar=autoHotswap=true,disablePlugin=Spring,disablePlugin=Hibernate,disablePlugin=CxfJAXRS
                    -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
                    -XX:+UseConcMarkSweepGC -Xmx1024m -Xms512m</cargo.jvmargs>
                </properties>
              </configuration>
            </configuration>
          </plugin>
        </plugins>

        <resources>
          <resource>
            <directory>src/test/resources</directory>
            <filtering>true</filtering>
            <includes>
              <include>hotswap-agent.properties</include>
            </includes>
          </resource>
        </resources>
      </build>
    </profile>

    <profile>
      <id>apache-release</id>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <inherited>false</inherited>
            <configuration>
              <skipSource>true</skipSource>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>
</project>


text:
<?php

OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();

$l = \OC_L10N::get('settings');
$user = \OC_User::getUser();
$view = new \OC\Files\View('/' . $user . '/files_encryption');

$keyfilesDeleted = $view->deleteAll('keyfiles.backup');
$sharekeysDeleted = $view->deleteAll('share-keys.backup');

if ($keyfilesDeleted && $sharekeysDeleted) {
	\OCP\JSON::success(array('data' => array('message' => $l->t('Encryption keys deleted permanently'))));
} else {
	\OCP\JSON::error(array('data' => array('message' => $l->t('Couldn\'t permanently delete your encryption keys, please check your owncloud.log or ask your administrator'))));
}

redpajama_set_name: RedPajamaGithub


text:
There is some delay between mounting the component and the camera stream
becoming visible. Listen for the `init` event to show a loading indicator.

Push the button below to force destroy and re-create the component.

<ClientOnly>
  <DemoWrapper component="LoadingIndicator" />
</ClientOnly>

### Source

<<< @/docs/.vuepress/components/demos/LoadingIndicator.vue


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="rustdoc">
    <meta name="description" content="API documentation for the Rust `resolve` mod in crate `rustc_typeck`.">
    <meta name="keywords" content="rust, rustlang, rust-lang, resolve">

    <title>rustc_typeck::middle::infer::resolve - Rust</title>

    <link rel="stylesheet" type="text/css" href="../../../../main.css">

    <link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico">

rustc_typeck::<wbr>middle::<wbr>infer

        <form class="search-form js-only">

                <input class="search-input" name="search"
                       autocomplete="off"
                       placeholder="Click or press 'S' to search, '?' for more options..."
                       type="search">

        </form>

Module rustc_typeck::<wbr>middle::<wbr>infer::<wbr>resolve<wbr>Unstable
            [-] [+]
        [src]

Structs

                        OpportunisticTypeResolver

The opportunistic type resolver can be used at any time. It simply replaces
type variables that have been unified with the things they have
been unified with (similar to shallow_resolve, but deep). This is
useful for printing messages etc but also required at various
points for correctness.

Functions

                        fully_resolve

Full type resolution replaces all type and region variables with
their concrete results. If any variable cannot be replaced (never unified, etc)
then an Err result is returned.

Keyboard shortcuts

?

Show this help dialog

S

Focus the search field

⇤

Move up in search results

⇥

Move down in search results

⏎

Go to active search result

Search tricks

                Prefix searches with a type followed by a colon (e.g.
                fn:) to restrict the search to a given type.

                Accepted types are: fn, mod,
                struct, enum,
                trait, typedef (or
                tdef).


text:
package org.sana.android.activity;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.LinkedList;
import java.util.List;

import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

import org.sana.R;
import org.sana.android.app.Locales;
import org.sana.android.content.Intents;
import org.sana.android.content.Uris;
import org.sana.android.db.EventDAO;
import org.sana.android.db.ModelWrapper;
import org.sana.android.db.SanaDB.ImageSQLFormat;
import org.sana.android.fragment.EncounterListFragment;
import org.sana.android.net.MDSInterface;
import org.sana.android.provider.Encounters;
import org.sana.android.provider.Observations;
import org.sana.android.provider.Patients;
import org.sana.android.provider.Subjects;
import org.sana.android.provider.Procedures;
import org.sana.android.provider.Events.EventType;
import org.sana.android.service.BackgroundUploader;
import org.sana.android.service.QueueManager;
import org.sana.android.service.ServiceConnector;
import org.sana.android.service.ServiceListener;
import org.sana.android.util.SanaUtil;
import org.sana.api.IModel;
import org.sana.api.task.Status;
import org.sana.net.Response;
import org.sana.util.UUIDUtil;

import android.app.ListActivity;
import android.content.ContentUris;
import android.content.Intent;
import android.content.IntentFilter;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseBooleanArray;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import android.widget.Toast;

/**
 * Displays a list of previous encounters and their status.
 *
 * @author Sana Development Team
 */
public class EncounterList extends BaseActivity implements
        EncounterListFragment.OnModelItemSelectedListener
{
	private static final String TAG = EncounterList.class.getSimpleName();
	private EncounterListFragment mListFragment;

    /** {@inheritDoc} */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        Log.d(TAG, "onStart()");
        super.onCreate(savedInstanceState);
        Locales.updateLocale(this, getString(R.string.force_locale));
        setContentView(R.layout.activity_encounterlist);
    }

    @Override
    protected void onPause() {
        super.onPause();
        Log.i(TAG, "onPause()");
        LocalBroadcastManager.getInstance(this.getApplicationContext()).unregisterReceiver(mReceiver);
    }

   @Override
    protected void onResume() {
        super.onResume();
    	Log.i(TAG, "onResume()");
        IntentFilter filter = new IntentFilter(Response.RESPONSE);
        try{
            filter.addDataType(Encounters.CONTENT_ITEM_TYPE);
        } catch (Exception e){}

        LocalBroadcastManager.getInstance(this.getApplicationContext()).registerReceiver(mReceiver, filter);
    }

    @Override
    public void onAttachFragment(Fragment fragment) {
        Log.d(TAG, "onStart()");
        super.onAttachFragment(fragment);
        Locales.updateLocale(this, getString(R.string.force_locale));
        if (fragment.getClass() == EncounterListFragment.class) {
            mListFragment = (EncounterListFragment) fragment;
            mListFragment.setOnModelItemSelectedListener(this);
            //showProgressDialogFragment(null);
        }
    }

    @Override
    public void onModelItemSelected(long id) {
		Log.i(TAG, "onModelItemSelected() " + id);
        Bundle data = mListFragment.getSelectedData(id);
        Uri encounter = mListFragment.getItemUri(id);
        Boolean finished = mListFragment.isItemFinished(id);
		Log.d(TAG, "....finished=" + finished + ", uri=" + encounter);
        Intent intent = null;
        try{
			if(finished || !finished){
				intent = new Intent(Intent.ACTION_VIEW, encounter);
				startActivity(intent);
			} else {
				intent = new Intent(Intent.ACTION_EDIT, encounter);
				startActivity(intent);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
    }
    /*
	private static final String[] PROJECTION = {
		    Encounters.Contract._ID,
			Encounters.Contract.UUID,
			Encounters.Contract.PROCEDURE,
			Encounters.Contract.SUBJECT,
			Encounters.Contract.STATE,
			Encounters.Contract.UPLOAD_STATUS,
			Encounters.Contract.UPLOAD_QUEUE,
			Encounters.Contract.MODIFIED };
	private HashMap<Integer, String> procedureToName =
		new HashMap<Integer, String>();
	private HashMap<String, String[]> patientToName =
			new HashMap<String, String[]>();
	private HashMap<Integer,Boolean> checkboxes =
            new HashMap<Integer,Boolean>();

    private ServiceConnector mConnector = new ServiceConnector();
    private BackgroundUploader mUploadService = null;
    SimpleDateFormat sdf = new SimpleDateFormat(IModel.DATE_FORMAT,Locale.US);
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd",Locale.US);
    /**
     * Listens for connections to the BackgroundUploader service
     * @author Sana Development Team
     *
    private class BackgroundUploaderConnectionListener implements
    	ServiceListener<BackgroundUploader>
    {

		public void onConnect(BackgroundUploader uploadService) {
			Log.i(TAG, "onServiceConnected");
			mUploadService = uploadService;
		}

		public void onDisconnect(BackgroundUploader uploadService) {
			Log.i(TAG, "onServiceDisconnected");
			mUploadService = null;
		}
    }

	/**
	 * Lookup procedure name in the database by primary key with memoization.
	 * @return the procedure name for procedureId
	 *
	private String lookupProcedureName(int procedureId) {

		if(procedureToName.containsKey(procedureId)) {
			return procedureToName.get(procedureId);
		}

		Cursor cur2 = getContentResolver().query(Procedures.CONTENT_URI,
				new String[] { Procedures.Contract.TITLE },
				Procedures.Contract._ID + " = ?",
				new String[] { Integer.toString(procedureId) }, null);
		cur2.moveToFirst();
		String title = cur2.getString(0);
		cur2.close();

		procedureToName.put(procedureId, title);

		return title;
	}

	private String lookupProcedureName(Uri procedure){
        Log.i(TAG, "lookupProcedureName() " + procedure);
		Cursor cur2 = getContentResolver().query(procedure,
				new String[] {
					Procedures.Contract._ID,
					Procedures.Contract.TITLE },
				null, null, null);
		cur2.moveToFirst();
		int id = cur2.getInt(0);
		String title = cur2.getString(1);
		cur2.close();
		procedureToName.put(id, title);

		return title;
	}
	/** Parses patient name from JSON String *
	@Deprecated
	private String getPatientNameFromData(String jsonData) {
        String patientId = "";
        String patientFirst = "";
        String patientLast = "";

        try {
    		JSONTokener tokener = new JSONTokener(jsonData);
            JSONObject answersDict = new JSONObject(tokener);
            if (answersDict.has("patientId"))
            	patientId = (String)answersDict.get("patientId");
            if (answersDict.has("newPatientFirstName"))
            	patientFirst = (String)answersDict.get("newPatientFirstName");
            if (answersDict.has("patientFirstName") && "".equals(patientFirst))
            	patientFirst = (String)answersDict.get("patientFirstName");
            if (answersDict.has("newPatientLastName"))
            	patientLast = (String)answersDict.get("newPatientLastName");
            if (answersDict.has("patientLastName") && "".equals(patientLast))
            	patientLast = (String)answersDict.get("patientLastName");
        } catch(JSONException e) {

        }

        StringBuilder result = new StringBuilder(patientId);
        if(!patientFirst.equals("")) {
        	result.append(" - ");
        	result.append(patientFirst);
        	result.append(" ");
        	result.append(patientLast);
        }
        return result.toString();
	}

	/** Gets the upload status of an item in the queue *
	@Deprecated
	private String getUploadStatus(int queueStatus, int queuePosition) {
		String message = "";
		if (queueStatus == 0 || queueStatus == -1) message = "Not Uploaded";
		else if (queueStatus == QueueManager.UPLOAD_STATUS_WAITING) {
			message = "Waiting in the queue to be uploaded, " + queuePosition;
			if (queuePosition == -1)
				message = "Waiting in the queue to be uploaded";
			else if (queuePosition == 1)
				message += "st in line";
			else if (queuePosition == 2)
				message += "nd in line";
			else if (queuePosition == 3)
				message += "rd in line";
			else
				message += "th in line";
		} else if (queueStatus == QueueManager.UPLOAD_STATUS_SUCCESS)
			message = "Uploaded Successfully";
		else if (queueStatus == QueueManager.UPLOAD_STATUS_IN_PROGRESS)
			message = "Upload in progress";
		else if (queueStatus == QueueManager.UPLOAD_NO_CONNECTIVITY)
			message = "Upload stalled - Waiting for connectivity";
		else if (queueStatus == QueueManager.UPLOAD_STATUS_FAILURE)
			message = "Upload failed";
		else if (queueStatus == QueueManager.UPLOAD_STATUS_CREDENTIALS_INVALID)
			message = "Upload stalled - username/password incorrect";
		else Log.i(TAG, "Not a valid number stored in database.");
		//Log.i(TAG, "Message being set as the status of the procedure: "
		//		+ message);
		return message;
	}

	private String getUploadStatus2(int queueStatus, int queuePosition) {
		String message = "";
		if (queueStatus == 0)
			message = getString(R.string.not_uploaded);
		else if (queueStatus == QueueManager.UPLOAD_STATUS_WAITING) {
			message = "Waiting in the queue to be uploaded, " + queuePosition;
			if (queuePosition == -1)
				message = "Waiting in the queue to be uploaded";
			else if (queuePosition == 1)
				message += "st in line";
			else if (queuePosition == 2)
				message += "nd in line";
			else if (queuePosition == 3)
				message += "rd in line";
			else
				message += "th in line";
		} else if (queueStatus == QueueManager.UPLOAD_STATUS_SUCCESS)
			message = getString(R.string.upload_success);
		else if (queueStatus == QueueManager.UPLOAD_STATUS_IN_PROGRESS)
			message = getString(R.string.general_upload_in_progress);
		else if (queueStatus == QueueManager.UPLOAD_NO_CONNECTIVITY)
			message = "Upload stalled - Waiting for connectivity";
		else if (queueStatus == QueueManager.UPLOAD_STATUS_FAILURE)
			message = getString(R.string.upload_fail);
		else if (queueStatus == QueueManager.UPLOAD_STATUS_CREDENTIALS_INVALID)
			message = "Upload stalled - username/password incorrect";
		else Log.i(TAG, "Not a valid number stored in database.");
		//Log.i(TAG, "Message being set as the status of the procedure: "
		//		+ message);
		return message;
	}

	private String getPatientNameFromTable(String uuid) {
        Log.i(TAG, "getPatientNameFromTable() uuid value: " + uuid );
		String[] row = new String[4];
		final String[] projection = new String[] {
				Patients.Contract.PATIENT_ID,
				Patients.Contract.UUID,
				Patients.Contract.GIVEN_NAME,
				Patients.Contract.FAMILY_NAME };
		Uri uri = Subjects.CONTENT_URI;
		String selection = Patients.Contract.UUID + " = '?'";
		String[] selectionArgs = new String[] { uuid };
		// Handle any
		if(uuid.startsWith("content")){
			Log.w(TAG, "uuid value is a uri: " + uuid );
			uri = Uri.parse(uuid);
			selectionArgs = null;
			selection = null;
		} else {
			//selection = Patients.Contract.UUID + " = ?";
                        //uri = Uris.withAppendedUuid(Patients.CONTENT_URI,uuid);
                        uri = Uri.parse(Subjects.CONTENT_URI.toString() +"/" + uuid);
			selectionArgs = null;
			selection = null;
		}

		if(patientToName.containsKey(uuid)) {
			row = patientToName.get(uuid);
		} else {
                row = new String[4];
                Cursor cur2 = null;
                try{
                    cur2 = getContentResolver().query(uri,
                    projection,
                    null,
                    null, null);
                    if(cur2 != null && cur2.moveToFirst()){
                        for(int i=0; i < 4; i++){
                            row[i] = cur2.getString(i);
                        }
                    } else {
                        row[0] = uuid;
                    }
                    patientToName.put(uuid, row);
                } catch (Exception e){
                    Log.e(TAG, "error building name row");
                    e.printStackTrace();
                } finally {
                    if(cur2 != null) cur2.close();
                    else Log.e(TAG, "NULL cursor ");
		}
	        }
                StringBuilder result = new StringBuilder(row[0]);
                if(!TextUtils.isEmpty(row[2])) {
        	    result.append(" - ");
        	    result.append(row[2]);
        	    result.append(" ");
        	    result.append(row[3]);
                }
        return result.toString();
	}

	/**
	 * Binds the cursor columns to the text views as follows
	 * [ Procedure name, Patient name, Upload Status ]
	 *
	 *
	@Override
	public boolean setViewValue(View v, Cursor cur, int columnIndex) {
		try {
            Log.i(TAG, "setViewValue()" + v.getClass().getSimpleName());
            final int position = cur.getPosition();
            Log.d(TAG, "....position=" + position);
			if (v instanceof TextView) {
				((TextView)v).setText(cur.getString(columnIndex));
				switch(columnIndex) {
				case 2:
					String procedureId = cur.getString(cur.getColumnIndex(Encounters.Contract.PROCEDURE));
					String procedureName = "UNKNOWN";
					Uri procedure;
					if(UUIDUtil.isValid(procedureId))
						procedure = Uris.withAppendedUuid(Procedures.CONTENT_URI, procedureId);
					else
						procedure = ContentUris.withAppendedId(Procedures.CONTENT_URI, Long.parseLong(procedureId));

					procedureName = lookupProcedureName(procedure);
					((TextView)v).setText(procedureName);
					break;
				case 3:
					String patientUuid = cur.getString(cur.getColumnIndex(Encounters.Contract.SUBJECT));
					//Log.i(TAG, "Setting patient name for patient. " + patientUuid);
					String patientName = getPatientNameFromTable(patientUuid);
					((TextView)v).setText(patientName);
					break;
				case 5:
					Locales.updateLocale(this, getString(R.string.force_locale));
					int queueStatus = cur.getInt(cur.getColumnIndex(Encounters.Contract.UPLOAD_STATUS));
					int queuePosition = cur.getInt(cur.getColumnIndex(Encounters.Contract.UPLOAD_QUEUE));
					String message = getUploadStatus2(queueStatus,
							queuePosition + 1);
					//Log.d(TAG, "Setting upload status to : " + message);
					((TextView)v).setText(message);
					break;
                                //case 7:
                                //        String dateStr = cur.getString(cur.getColumnIndex(Encounters.Contract.MODIFIED));
                                //        Date date = sdf.parse(dateStr);
                                //        ((TextView)v).setText(df.format(date));
				}
			} else if (v instanceof  CheckBox){
                final CheckBox checkbox = (CheckBox)v;
                checkbox.setClickable(true);
                Boolean checked = checkboxes.get(position);
                if(checked != null){
                    checkbox.setChecked(checked);
                }
                checkbox.setOnClickListener(new View.OnClickListener(){
                    public void onClick(View v){
                        final CheckBox ckbx = (CheckBox) v;
                        ckbx.toggle();
                        boolean ckd = ckbx.isChecked();
                        Log.i(TAG,"CheckBox.onClick() position=" + position
                            +", checked="+ ckd);
                        //((CheckBox) v).setChecked(!ckd);
                        checkboxes.put(position, !ckd);
                    }
                });
            }
		} catch (Exception e) {
			Log.e(TAG, "Exception in setting the text in the list: " +
					e.toString() + ((cur != null)? cur.getPosition(): -1));
			e.printStackTrace();
		}
		return true;
	}
*
	/** {@inheritDoc} *
	@Override
	public void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		Log.d(TAG, "onCreate()");

		// Connect to the background uploader service
		try {
        	//mConnector.setServiceListener(
        	//		new BackgroundUploaderConnectionListener());
        	//mConnector.connect(this);
        }
        catch (Exception e) {
        	Log.e(TAG, "Exception starting background upload service: "
        			+ e.toString());
        	e.printStackTrace();
        }

        Cursor cursor = managedQuery(Encounters.CONTENT_URI,
        		PROJECTION, null, null,
        		Encounters.DEFAULT_SORT_ORDER);
        try {
	        SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
	        		R.layout.row, cursor,
	                new String[] { Encounters.Contract.PROCEDURE,
                                        Encounters.Contract.SUBJECT,
                                        Encounters.Contract.MODIFIED,
                                        Encounters.Contract.UPLOAD_STATUS },
	                new int[] { R.id.toptext, R.id.bottomtext,R.id.datetext,
	        					R.id.queue_status });
	        adapter.setViewBinder(this);
	        setListAdapter(adapter);
        }
        catch (Exception e) {
			e.printStackTrace();
			Log.e(TAG, "Exception in creating SimpleCursorAdapter: "
					+ e.toString());
		}
	}

	/** {@inheritDoc} *
	@Override
	public void onDestroy() {
		super.onDestroy();
		try {
			mConnector.disconnect(this);
			mUploadService = null;
		} catch (IllegalArgumentException e) {
			Log.e(TAG, "While disconnecting service got exception: "
					+ e.toString());
			e.printStackTrace();
		}
	}

	@Override
    protected void onListItemClick(ListView l, View v, int position, long id) {
        Log.i(TAG,"onListItemClick() position=" + position + ", id=" + id);
        Log.d(TAG, "....checkbox id="+R.id.icon);
		if(v.getId() == R.id.icon){
            //CheckBox checked = (Checkbox) view;
            Log.d(TAG,"....got a checkbox");
            return;
            //checked.setChecked(!checked.isChecked());
		}//l.setItemChecked(position, view.isChecked());

        Uri uri = ContentUris.withAppendedId(Encounters.CONTENT_URI, id);
        Log.i(TAG, "procedure Uri in onListItemClick: " + uri);
        String action = getIntent().getAction();
        Log.i(TAG, "...action: " + action);
        if (Intent.ACTION_PICK.equals(action) ||
        		Intent.ACTION_GET_CONTENT.equals(action))
        {
            // The caller is waiting for us to return a note selected by
            // the user.  The have clicked on one, so return it now.

        	//MDSInterface.logObservations(this, uri.toString());
            setResult(RESULT_OK, new Intent().setData(uri));
            finish();
        } else if (Intent.ACTION_VIEW.equals(action)){
        	startActivity(new Intent(Intent.ACTION_VIEW, uri));
        } else {
            // Launch activity to view/edit the currently selected item
            //startActivity(new Intent(Intent.ACTION_EDIT, uri));

		}

	}

    @Override
	public boolean onLongClick(View v){
        Log.i(TAG,"onLongClick() " + v.getId());
        //Uri uri = ContentUris.withAppendedId(Encounters.CONTENT_URI, id);
        if(v.getId() != R.id.icon){
            String action = getIntent().getAction();
            if (Intent.ACTION_VIEW.equals(action)){
                //startActivity(new Intent(Intent.ACTION_VIEW, uri));
                return false;
            }
        } else {
            Log.d(TAG,"....Checkbox");
            //CheckBox checked = (Checkbox) v;
            return false;
        }
        return false;
	}
*/
	public static final int SELECT_ALL = 0;
	public static final int SELECT_FAILED = 3;
	public static final int DELETE = 1;
	public static final int RESEND = 2;
	//public static final int CANCEL_UPLOAD = 2;

	/** Available options are to select all, delete, or resend */
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		super.onCreateOptionsMenu(menu);
		menu.add(0, SELECT_ALL, 0, getString(R.string.menu_select_all));
		menu.add(0, DELETE, 1, getString(R.string.menu_delete));
		menu.add(0, RESEND, 2, getString(R.string.menu_resend));
		//menu.add(0, CANCEL_UPLOAD, 2, "Cancel Upload");
		return true;
	}

    boolean selectAllToggle = false;
    /** {@inheritDoc} */
    @Override
    public boolean onOptionsItemSelected(MenuItem item){
		Log.i(TAG, "onOptionItemsSelected() " + item.getItemId());
        switch (item.getItemId()) {
        case SELECT_ALL:
            if(!selectAllToggle)
                mListFragment.selectAllProcedures();
            else
                mListFragment.unselectAllProcedures();
            selectAllToggle = !selectAllToggle;
            return true;
        case DELETE:
			mListFragment.deleteSelected();
            return true;
        case RESEND:
            resendSelected();
            return true;
        //case CANCEL_UPLOAD:
        //    cancelUploads();
        //    return true;
        }
        return false;
    }
	// gets selec
    private void resendSelected() {
		Log.i(TAG, "resendSelected()");
		int index = 0;
        List<Uri> uris = mListFragment.getSelected();
        for(Uri uri:uris){
            Intent intent = new Intent(Intents.ACTION_CREATE, uri);
            startService(intent);
            index++;
        }
		Log.i(TAG,"....sent: " + index);
    }

    private void resendSelectedFinished() {
		Log.i(TAG, "resendSelectedFinished()");
		int index = 0;
        List<Uri> uris = mListFragment.getSelectedFinished();
        for(Uri uri:uris){
            Intent intent = new Intent(Intents.ACTION_CREATE, uri);
            startService(intent);
            index++;
        }
		Log.i(TAG,"....sent: " + index);
    }

    private void cancelUploads(){

    }

    @Override
    protected void handleBroadcast(Intent data){
        Log.i(TAG,"handleBroadcast()");
        cancelProgressDialogFragment();
        String message = data.getStringExtra(Response.MESSAGE);
        Response.Code code = Response.Code.get(data.getIntExtra(Response.CODE,-1));
        switch(code){
            case CONTINUE:
                if(showProgressForeground())
                    showProgressDialogFragment(message);
                break;
            default:
                hideProgressDialogFragment();
                if(!TextUtils.isEmpty(message)){
                    Toast.makeText(this,message,Toast.LENGTH_LONG).show();
                }
        }
    }
/*
	boolean selectAllToggle = false;

	/** All checkboxes will be checked *
	private void selectAllProcedures() {

			for (int x = 0; x < getListAdapter().getCount(); x++) {
				try {
					//getListView().setItemChecked(x, true);
					//boolean checked = getListView().isItemChecked(x);
					//Log.w(TAG, "....ListView Item:"+ x+ ", checked : " + checked);
				CheckBox checkbox = (CheckBox) getListView().getChildAt(x)
												.findViewById(R.id.icon);
				checkbox.setChecked(true);
				Log.i(TAG, "....Is checkbox checked? (Should be true): "
						+ checkbox.isChecked());
				}
				catch (Exception e) {
					e.printStackTrace();
					Log.e(TAG, "Exception in selectAll(): pos: " + x+" ," + e.getMessage());
				}
			}
	}

	/**
	 * Unselect all checked items in the list.
	 *
	private void unselectAllProcedures() {
        if(mListFragment != null){
            mListFrgament.unselectAllProcedures();
        }
		try {
			for (int x = 0; x < getListAdapter().getCount(); x++) {
				View v = getListView().getChildAt(x);
				//getListView().setItemChecked(x, false);
				CheckBox checkbox = (CheckBox) v.findViewById(R.id.icon);
				checkbox.setChecked(false);

			}
		}
		catch (Exception e) {
			e.printStackTrace();
			Log.e(TAG, "Exception in unselectAll(): " + e.toString());
		}
	}

	/**
	 * Delete every checked item in the list.
	 *
	private void deleteSelected() {
		List<Long> ids = new LinkedList<Long>();
		List<String> uuids = new LinkedList<String>();
		ListAdapter adapter = getListAdapter();
			for (int x = 0; x < adapter.getCount(); x++) {
				try{
					CheckBox checkbox = (CheckBox) getListView().getChildAt(x)
												.findViewById(R.id.icon);
					Cursor c = (Cursor) adapter.getItem(x);
					if (checkbox.isChecked()) {
						long itemId = adapter.getItemId(x);
						uuids.add(c.getString(1));
						ids.add(itemId);
					}

				}
				catch (Exception e) {
				e.printStackTrace();
				Log.e(TAG, "Exception in deleteSelected(): pos: " + x+" ," + e.getMessage());
				}
			}
			Log.w(TAG, "Delete count: " + ids.size());
			String idList = SanaUtil.formatPrimaryKeyList(ids);
			String uuidList = SanaUtil.formatPrimaryKeyList(uuids);
			Log.w(TAG, "Deleting: " + idList);
			// Now delete the ids
			getContentResolver().delete(Encounters.CONTENT_URI,
					Encounters.Contract._ID + " IN " + idList, null);

			for(long id: ids){
				int deleted = getContentResolver().delete(ImageSQLFormat.CONTENT_URI,
	        		ImageSQLFormat.ENCOUNTER_ID + " = ?",
	        		new String[]{ String.valueOf(id) });
				Log.d(TAG, "Deleted n = " + deleted +" images");
				deleted = getContentResolver().delete(ImageSQLFormat.CONTENT_URI,
	        		ImageSQLFormat.ENCOUNTER_ID + " = ?",
	        		new String[]{ "encounter" });
				Log.d(TAG, "Deleted n = " + deleted +" bad images");
			}
			/*
			getContentResolver().delete(Observations.CONTENT_URI,
	        		Observations.Contract.ENCOUNTER + " IN " + uuidList,null);

	        getContentResolver().delete(ImageSQLFormat.CONTENT_URI,
	        		ImageSQLFormat.ENCOUNTER_ID + " IN " + idList, null);
			/*
			for(long id: ids){
				int index = getListView().
				String uuid = ((Cursor)getListAdapter().get)).getString(columnIndex);
				getContentResolver().delete(Observations.CONTENT_URI,
	        		Observations.Contract.ENCOUNTER + " = ?",
	        		new String[]{ uuid });
	        	getContentResolver().delete(ImageSQLFormat.CONTENT_URI,
	        		ImageSQLFormat.ENCOUNTER_ID + " = ?",
	        		new String[]{ uuid });

			}
			*
			unselectAllProcedures();
	}
*/
/*
	//Resend every checked item in the list.
	private void resendSelected() {
		try {
			if (mUploadService != null) {
				ListAdapter adapter = getListAdapter();
				ListView view = getListView();
				Uri contentUri = getIntent().getData();
				for (int x = 0; x < adapter.getCount(); x++) {
					//boolean checked = getListView().isItemChecked(x);
					//Log.w(TAG, "ListView Item:"+ x+ ", checked : " + checked);
					CheckBox checkbox = (CheckBox)view.getChildAt(x)
													.findViewById(R.id.icon);
					if (checkbox.isChecked()) {
						Uri procedure = ContentUris.withAppendedId(contentUri,
								(Long) view.getItemIdAtPosition(x));
						Log.i(TAG, "Resending encounter: " + procedure);
						mUploadService.addProcedureToQueue(procedure);
					}
				}
			}
		} catch (Exception e) {
			Log.e(TAG, "While resending selected procedures, got exception: "
					+ e.toString());
			e.printStackTrace();
		}
	}

	private void resendSelected2(){
		// use the uEncounter field to Post the data.
		long[] ids = null;
		ListView view = getListView();
		//if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.FROYO)
		int count = getListAdapter().getCount();
		Log.i(TAG, "resendSelecected2() count=" + count);
		// iterate over list and resend checked
        for (int x = 0; x < count; x++) {
            boolean checked = getListView().isItemChecked(x);
            Log.w(TAG, "....ListView Item:"+ x+ ", checked : " + checked);
            Boolean ckd = (checkboxes.get(x) != null)? checkboxes.get(x): false;
            Log.d(TAG, "....checkboxes map: " + ckd);
            Uri encounter = ContentUris.withAppendedId(Encounters.CONTENT_URI, getListView().getItemIdAtPosition(x));
            Log.d(TAG, "Checking for encounter: " + encounter);
            View childView = view.getChildAt(x);
            if(childView != null){
                CheckBox checkbox = (CheckBox)childView.findViewById(R.id.icon);
                checked = checkbox.isChecked();
                Log.i(TAG, "....Checkbox checked: " + checkbox.isChecked() + ":" + checked);
            } else {
                Log.i(TAG, "resendSelected2(): NULL child of ListView");
            }
            if (checked || ckd) {
                Intent upload = new Intent("org.sana.intent.action.CREATE", encounter);
                //Cursor cur = c.getCursor();
                //String message = String.format("encounter: %s, procedure: %s, subject %d",
                //  cur.getString(2), cur.getString(3), cur.getInt(4));
                //StringBuilder sb = new StringBuilder();
                //DatabaseUtils.dumpCurrentRow(c.getCursor(), sb);
                startService(upload);
                String msg = "Sending dispatcher CREATE for: " + encounter;
                Log.i(TAG, msg);
                EventDAO.registerEvent(this, EventType.ENCOUNTER_SAVE_UPLOAD, msg);
            } else {
                Log.w(TAG, "Not selected: " + encounter);
            }
		}
	}

	//private static ContentResolver contentResolver;
	//If selected procedures are in queue or are currently being uploaded, cancel the upload
	private void cancelUploads() {
		try{
			for (int x = 0; x < getListAdapter().getCount(); x++) {
				CheckBox checkbox = (CheckBox) getListView().getChildAt(x).findViewById(R.id.icon);
				Uri procedure = ContentUris.withAppendedId(getIntent().getData(), (Long) getListView().getItemIdAtPosition(x));
				if (checkbox.isChecked()) {
					// TODO Make is cancel if its in the middle of uploading, not just taking it out of the queue
					//mUploadService.removeFromQueue(procedure);
				}
			}
			unselectAllProcedures();
		}
		catch (Exception e) {
			unselectAllProcedures();
			Log.i(TAG, "Exception in cancelSelected(): " + e.toString());
		}
	}
*/
}


text:
<!DOCTYPE html>

    <title>Example 11</title>
    <meta charset="utf-8">

Header

Sidebar

Content


text:
package eggdropsoap.ropesandbridges;

import net.minecraft.util.MathHelper;

public class Utils {

	public static double getDistance(int x, int y, int z, int x2, int y2, int z2) {
		double d1 = x - x2;
		double d2 = y - y2;
		double d3 = z - z2;
		return (double)MathHelper.sqrt_double(d1 * d1 + d2 * d2 + d3 * d3);
	}

	public static double getHorizontalDistance(int x, int y, int z, int x2, int y2, int z2) {
		return getDistance(x, y, z, x2, y, z2);	// use the same y, doesn't matter which
	}

}


text:
Introduction
==============

check_AMQP is a small Nagios plugin that tests an AMQP resource by sending a message, collecting it and calculating the round trip time.

The purpose of this plugin is test the full stack availability of your AMQP resource by checking the ability to connect and the speed of message return. So far the script has been tested with Nagios 3.3 on Ubuntu 10.04 and with the folloing AMQP services:
  * StormMQ AMQP service (www.stormmq.com).
  * RabbitMQ 2.8.7xxx

This script only supports AMQP 0.8 and should work with all AMQP 0.8 compatible services, however we have not tested this.

Usage
==========

The script allows you to specify your connection details to your resource and then it tries to connect to your specified queue. If the connection fails the plugin returns a critical exit code.

I recommend you use a queue that is solely for this plugin, as it will drop any messages that it's not expecting.

Once connected the plugin publishes a single message to the queue with a random message ID and then waits until the message is received. If your specified timeout is reached before the message is received the plugin will return a critical exit code.

If the message is received the plugin checks if it is above or below the recievedTimeWarning threshold and either exits OK or with a warning.

Install Instructions
==========

Assuming that Nagios is installed in the default directory (/usr/local/nagios/libexec/).

Place the file in this directory:
/usr/local/nagios/libexec/

Installation with virtualenv
----------------------------

    cd /usr/local/nagios/libexec/
    git clone <repourl>
    cd check_AMQP
    virtualenv venv
    . venv/bin/activate
    pip install -r requirements.txt

Configuration
=============
An example of the text you can add to the nagios config file:

    define host{
            use                     linux-server
            host_name               AMQPserver
            alias                   AMQPserver
            address                 <<IP ADDRESS OF SERVER>>
    }

    define command {
            command_name    check_amqp
            command_line    /usr/lib/nagios/plugins/check_AMQP/check_amqp --ssl --host '$HOSTADDRESS$' --port 5672 --queue monitoring_test_queue --vhost '$ARG1$' --user '$ARG2$' --password '$ARG3$' --warning 0.05 --critical 0.5
    }

    define service{
            use                             generic-service
            host_name                       AMQPserver
            service_description             Check AMQP Connection
            check_command                   check_amqp!/!guest!guest
    }

Requirements
==============
  * Python 2.6
  * py-amqplib : http://code.google.com/p/py-amqplib/

Future
==============
* Testing on other AMQP services
* Support for AMQP 0.9, 0.10 and 1.0


text:
#ifndef _ISERIES_VPD_AREAS_H
#define _ISERIES_VPD_AREAS_H

/*
 * This file defines the address and length of all of the VPD area passed to
 * the OS from PLIC (most of which start from the SP).
 */

#include <asm/types.h>

/* VPD Entry index is carved in stone - cannot be changed (easily). */
#define ItVpdCecVpd				0
#define ItVpdDynamicSpace			1
#define ItVpdExtVpd				2
#define ItVpdExtVpdOnPanel			3
#define ItVpdFirstPaca				4
#define ItVpdIoVpd				5
#define ItVpdIplParms				6
#define ItVpdMsVpd				7
#define ItVpdPanelVpd				8
#define ItVpdLpNaca				9
#define ItVpdBackplaneAndMaybeClockCardVpd	10
#define ItVpdRecoveryLogBuffer			11
#define ItVpdSpCommArea				12
#define ItVpdSpLogBuffer			13
#define ItVpdSpLogBufferSave			14
#define ItVpdSpCardVpd				15
#define ItVpdFirstProcVpd			16
#define ItVpdApModelVpd				17
#define ItVpdClockCardVpd			18
#define ItVpdBusExtCardVpd			19
#define ItVpdProcCapacityVpd			20
#define ItVpdInteractiveCapacityVpd		21
#define ItVpdFirstSlotLabel			22
#define ItVpdFirstLpQueue			23
#define ItVpdFirstL3CacheVpd			24
#define ItVpdFirstProcFruVpd			25

#define ItVpdMaxEntries				26

#define ItDmaMaxEntries				10

#define ItVpdAreasMaxSlotLabels			192

struct ItVpdAreas {
	u32	xSlicDesc;		// Descriptor			000-003
	u16	xSlicSize;		// Size of this control block	004-005
	u16	xPlicAdjustVpdLens:1;	// Flag to indicate new interface006-007
	u16	xRsvd1:15;		// Reserved bits		...
	u16	xSlicVpdEntries;	// Number of VPD entries	008-009
	u16	xSlicDmaEntries;	// Number of DMA entries	00A-00B
	u16	xSlicMaxLogicalProcs;	// Maximum logical processors	00C-00D
	u16	xSlicMaxPhysicalProcs;	// Maximum physical processors	00E-00F
	u16	xSlicDmaToksOffset;	// Offset into this of array	010-011
	u16	xSlicVpdAdrsOffset;	// Offset into this of array	012-013
	u16	xSlicDmaLensOffset;	// Offset into this of array	014-015
	u16	xSlicVpdLensOffset;	// Offset into this of array	016-017
	u16	xSlicMaxSlotLabels;	// Maximum number of slot labels018-019
	u16	xSlicMaxLpQueues;	// Maximum number of LP Queues	01A-01B
	u8	xRsvd2[4];		// Reserved			01C-01F
	u64	xRsvd3[12];		// Reserved			020-07F
	u32	xPlicDmaLens[ItDmaMaxEntries];// Array of DMA lengths	080-0A7
	u32	xPlicDmaToks[ItDmaMaxEntries];// Array of DMA tokens	0A8-0CF
	u32	xSlicVpdLens[ItVpdMaxEntries];// Array of VPD lengths	0D0-12F
	void	*xSlicVpdAdrs[ItVpdMaxEntries];// Array of VPD buffers	130-1EF
};

extern struct ItVpdAreas	itVpdAreas;

#endif /* _ISERIES_VPD_AREAS_H */


text:
package org.jetbrains.plugins.javaFX.sceneBuilder;

import com.intellij.execution.configurations.PathEnvironmentVariableUtil;
import com.intellij.openapi.fileChooser.FileChooser;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.javaFX.JavaFxSettings;
import org.jetbrains.plugins.javaFX.JavaFxSettingsConfigurable;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Alexander Lobas
 */
public class SceneBuilderInfo {
  public static final SceneBuilderInfo EMPTY = new SceneBuilderInfo(null, null);

  public final String path;
  public final String libPath;

  private SceneBuilderInfo(String path, String libPath) {
    this.path = path;
    this.libPath = libPath;
  }

  @Override
  public boolean equals(Object object) {
    if (object instanceof SceneBuilderInfo) {
      SceneBuilderInfo info = (SceneBuilderInfo)object;
      return Comparing.equal(path, info.path) && Comparing.equal(libPath, info.libPath);
    }
    return false;
  }

  @NotNull
  public static SceneBuilderInfo get(Project project, boolean choosePathIfEmpty) {
    JavaFxSettings settings = JavaFxSettings.getInstance();
    String pathToSceneBuilder = settings.getPathToSceneBuilder();

    if (StringUtil.isEmptyOrSpaces(pathToSceneBuilder) || !new File(pathToSceneBuilder).exists()) {
      VirtualFile sceneBuilderFile = null;
      if (choosePathIfEmpty) {
        sceneBuilderFile = FileChooser.chooseFile(JavaFxSettingsConfigurable.createSceneBuilderDescriptor(), project, getPredefinedPath());
      }
      if (sceneBuilderFile == null) {
        return EMPTY;
      }

      pathToSceneBuilder = FileUtil.toSystemIndependentName(sceneBuilderFile.getPath());
      settings.setPathToSceneBuilder(pathToSceneBuilder);
    }

    File sceneBuilderLibsFile;

    if (SystemInfo.isMac) {
      sceneBuilderLibsFile = new File(new File(pathToSceneBuilder, "Contents"), "Java");
    }
    else if (SystemInfo.isWindows) {
      File sceneBuilderRoot = new File(pathToSceneBuilder);
      File sceneBuilderRootDir = sceneBuilderRoot.getParentFile();
      if (sceneBuilderRootDir == null) {
        final File foundInPath = PathEnvironmentVariableUtil.findInPath(pathToSceneBuilder);
        if (foundInPath != null) {
          sceneBuilderRootDir = foundInPath.getParentFile();
        }
      }
      sceneBuilderRoot = sceneBuilderRootDir != null ? sceneBuilderRootDir.getParentFile() : null;
      if (sceneBuilderRoot != null) {
        final File appFile = new File(sceneBuilderRootDir, "app");
        if (appFile.isDirectory()) {
          sceneBuilderLibsFile = appFile;
        }
        else {
          final File libFile = new File(sceneBuilderRoot, "lib");
          sceneBuilderLibsFile = libFile.isDirectory() ? libFile : null;
        }
      }
      else {
        sceneBuilderLibsFile = null;
      }
    }
    else {
      sceneBuilderLibsFile = new File(new File(pathToSceneBuilder).getParent(), "app");
    }

    if (sceneBuilderLibsFile != null && (!sceneBuilderLibsFile.exists() || !sceneBuilderLibsFile.isDirectory())) {
      sceneBuilderLibsFile = null;
    }

    return new SceneBuilderInfo(pathToSceneBuilder, sceneBuilderLibsFile == null ? null : sceneBuilderLibsFile.getAbsolutePath());
  }

  @Nullable
  private static VirtualFile getPredefinedPath() {
    String path = null;
    if (SystemInfo.isWindows) {
      List<String> suspiciousPaths = new ArrayList<>();
      String programFiles = "C:\\Program Files";

      String sb20 = "\\JavaFX Scene Builder 2.0\\JavaFX Scene Builder 2.0.exe";
      String sb11 = "\\JavaFX Scene Builder 1.1\\JavaFX Scene Builder 1.1.exe";
      String sb10 = "\\JavaFX Scene Builder 1.0\\bin\\scenebuilder.exe";

      fillPaths(programFiles, suspiciousPaths, sb20, sb11, sb10);
      fillPaths(programFiles + " (x86)", suspiciousPaths, sb20, sb11, sb10);

      path = findFirstThatExist(ArrayUtil.toStringArray(suspiciousPaths));
    }
    else if (SystemInfo.isMac) {
      path = findFirstThatExist("/Applications/JavaFX Scene Builder 2.0.app",
                                "/Applications/JavaFX Scene Builder 1.1.app",
                                "/Applications/JavaFX Scene Builder 1.0.app");
    }
    else if (SystemInfo.isUnix) {
      path = findFirstThatExist("/opt/JavaFXSceneBuilder2.0/JavaFXSceneBuilder2.0", "/opt/JavaFXSceneBuilder1.1/JavaFXSceneBuilder1.1");
    }

    return path != null ? LocalFileSystem.getInstance().findFileByPath(FileUtil.toSystemIndependentName(path)) : null;
  }

  private static String findFirstThatExist(String... paths) {
    File sb = FileUtil.findFirstThatExist(paths);
    return sb == null ? null : sb.getPath();
  }

  private static void fillPaths(String programFilesPath, List<String> suspiciousPaths, String... sb) {
    for (String sbi : sb) {
      suspiciousPaths.add(new File(programFilesPath, "Oracle").getPath() + sbi);
    }
  }
}


text:
#ifndef	_FEATURES_H
#define	_FEATURES_H	1

#undef	__USE_ISOC99
#undef	__USE_POSIX
#undef	__USE_POSIX2
#undef	__USE_POSIX199309
#undef	__USE_POSIX199506
#undef	__USE_XOPEN
#undef	__USE_XOPEN_EXTENDED
#undef	__USE_UNIX98
#undef	__USE_XOPEN2K
#undef	__USE_LARGEFILE
#undef	__USE_LARGEFILE64
#undef	__USE_FILE_OFFSET64
#undef	__USE_BSD
#undef	__USE_SVID
#undef	__USE_MISC
#undef	__USE_GNU
#undef	__USE_REENTRANT
#undef	__FAVOR_BSD
#undef	__KERNEL_STRICT_NAMES

#ifndef _LOOSE_KERNEL_NAMES
#define __KERNEL_STRICT_NAMES
#endif

#define	__USE_ANSI	1

#if defined _BSD_SOURCE && \
    !(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
      defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
      defined _GNU_SOURCE || defined _SVID_SOURCE)
# define __FAVOR_BSD	1
#endif

#ifdef _GNU_SOURCE
# undef  _ISOC99_SOURCE
# define _ISOC99_SOURCE	1
# undef  _POSIX_SOURCE
# define _POSIX_SOURCE	1
# undef  _POSIX_C_SOURCE
# define _POSIX_C_SOURCE	199506L
# undef  _XOPEN_SOURCE
# define _XOPEN_SOURCE	600
# undef  _XOPEN_SOURCE_EXTENDED
# define _XOPEN_SOURCE_EXTENDED	1
# undef	 _LARGEFILE64_SOURCE
# define _LARGEFILE64_SOURCE	1
# undef  _BSD_SOURCE
# define _BSD_SOURCE	1
# undef  _SVID_SOURCE
# define _SVID_SOURCE	1
#endif

#if (!defined __STRICT_ANSI__ && !defined _ISOC99_SOURCE && \
     !defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
     !defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
     !defined _BSD_SOURCE && !defined _SVID_SOURCE)
# define _BSD_SOURCE	1
# define _SVID_SOURCE	1
#endif

#if (defined _ISOC99_SOURCE || defined _ISOC9X_SOURCE \
     || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
# define __USE_ISOC99	1
#endif

#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
     !defined _POSIX_C_SOURCE)
# define _POSIX_SOURCE	1
# if defined _XOPEN_SOURCE && (_XOPEN_SOURCE - 0) < 500
#  define _POSIX_C_SOURCE	2
# else
#  define _POSIX_C_SOURCE	199506L
# endif
#endif

#if defined _POSIX_SOURCE || _POSIX_C_SOURCE >= 1 || defined _XOPEN_SOURCE
# define __USE_POSIX	1
#endif

#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 2 || defined _XOPEN_SOURCE
# define __USE_POSIX2	1
#endif

#if (_POSIX_C_SOURCE - 0) >= 199309L
# define __USE_POSIX199309	1
#endif

#if (_POSIX_C_SOURCE - 0) >= 199506L
# define __USE_POSIX199506	1
#endif

#ifdef	_XOPEN_SOURCE
# define __USE_XOPEN	1
# if (_XOPEN_SOURCE - 0) >= 500
#  define __USE_XOPEN_EXTENDED	1
#  define __USE_UNIX98	1
#  undef _LARGEFILE_SOURCE
#  define _LARGEFILE_SOURCE	1
#  if (_XOPEN_SOURCE - 0) >= 600
#   define __USE_XOPEN2K	1
#   undef __USE_ISOC99
#   define __USE_ISOC99		1
#  endif
# else
#  ifdef _XOPEN_SOURCE_EXTENDED
#   define __USE_XOPEN_EXTENDED	1
#  endif
# endif
#endif

#ifdef _LARGEFILE_SOURCE
# define __USE_LARGEFILE	1
#endif

#ifdef _LARGEFILE64_SOURCE
# define __USE_LARGEFILE64	1
#endif

#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
# define __USE_FILE_OFFSET64	1
#endif

#if defined _BSD_SOURCE || defined _SVID_SOURCE
# define __USE_MISC	1
#endif

#ifdef	_BSD_SOURCE
# define __USE_BSD	1
#endif

#ifdef	_SVID_SOURCE
# define __USE_SVID	1
#endif

#ifdef	_GNU_SOURCE
# define __USE_GNU	1
#endif

#if defined _REENTRANT || defined _THREAD_SAFE
# define __USE_REENTRANT	1
#endif

#define __STDC_IEC_559__		1
#define __STDC_IEC_559_COMPLEX__	1

#define __STDC_ISO_10646__		200009L

#undef  __GNU_LIBRARY__
#define __GNU_LIBRARY__ 6

#define	__GLIBC__	2
#define	__GLIBC_MINOR__	2

#if defined __GNUC__ && defined __GNUC_MINOR__
# define __GNUC_PREREQ(maj, min) \
	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
#else
# define __GNUC_PREREQ(maj, min) 0
#endif

#define __GLIBC_PREREQ(maj, min) \
	((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min))

# if defined __USE_FILE_OFFSET64 && !defined __REDIRECT
#  define __USE_LARGEFILE	1
#  define __USE_LARGEFILE64	1
# endif

#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
    && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__
# define __USE_EXTERN_INLINES	1
#endif

/* This is here only because every header file already includes this one.  */
#ifndef _LIBC
/* Get the definitions of all the appropriate `__stub_FUNCTION' symbols.
   <gnu/stubs.h> contains `#define __stub_FUNCTION' when FUNCTION is a stub
   which will always return failure (and set errno to ENOSYS).

   We avoid including <gnu/stubs.h> when compiling the C library itself to
   avoid a dependency loop.  stubs.h depends on every object file.  If
   this #include were done for the library source code, then every object
   file would depend on stubs.h.  */

# include <gnu/stubs.h>
#endif

#endif	/* features.h  */


text:
package org.commonjava.indy.core.ctl;

import org.commonjava.indy.model.core.RemoteRepository;
import org.commonjava.indy.model.core.dto.EndpointView;
import org.commonjava.indy.subsys.template.ScriptEngine;

/**
 * Responsible for creating new {@link RemoteRepository} instances created as a result of replicating another Indy instance.
 * This interface will be implemented by a Groovy script, and accessed by way of the
 * {@link org.commonjava.indy.subsys.template.ScriptEngine#parseStandardScriptInstance(ScriptEngine.StandardScriptType, String, Class)} method.
 *
 * Created by jdcasey on 8/17/16.
 */
public interface ReplicationRepositoryCreator
{
    RemoteRepository createRemoteRepository( String name, EndpointView view );
}


text:
<!-- <script src="http://tkellehe.github.io/utils.js/nullptr.js/nullptr.js"></script> -->
<script src="point.min.js"></script>
<script>
console.log("point",point.name);
console.log("nullptr",point.nullptr.constructor.name);
console.log("Pointer",point("").constructor.name);
</script>


text:
using System;

public class Program
{
	public static void Main()
	{
		test(Test<String>);
	}

	public static void Test(Object param)
	{
		//Console.WriteLine("This should never called");
	}

	public static void Test<T>(T param)
	{
		//Console.WriteLine("Hello Word");
	}

	public static void test(Action<String> str)
	{
		//str.Invoke("test");
	}
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>DAY 0: FRIDAY 29 JULY 2011, Calais (France) – Ville de Laon (France) -- African Uhambo</title>

    <link href="https://africanuhambo.co.uk//css/bootstrap.min.css" rel="stylesheet">

    <link href="https://africanuhambo.co.uk//css/clean-blog.min.css" rel="stylesheet">

    <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='//fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                African Uhambo

                        home

                        Archives

                        About Us

                        Tusky

DAY 0: FRIDAY 29 JULY 2011, Calais (France) – Ville de Laon (France)

  A 2 minute read,

Posted by Dan on Sat, Jul 30, 2011

In Summer 2011

Tags

Camping Cost: Camping Municiple le Chenaie €14.40 – 2 nights, 1 adult & 1 child

We managed to leave a day earlier. Dan got Friday off work and we finished off the packing on the Thursday and decided to head for Dover to try board the 07.00hr ferry to Calais. Off to bed early for a very early rise. We thought we had promised ourselves no more silly timed ferries…Oh Well!!!

We were up early, 03.55hr, and out the flat and on the road by 04.30hr. Using our new GPS, the Garmin Montana, and made it by 06.00hr. Unfortunately the 07.00hr sailing was fully booked, but a £60 admin fee later and we were on the 08.15hr ferry and told that if there were any non arrivals for the 07.00hr ferry, we would get a space on there. Sitting in the car we saw the 07.00hr ferry dock..would we be lucky enough to get a spot on the ferry?

YES! We were on it!

We decided to drive at a reasonable pace and not break our backs driving long distances. We also didn't want to go on the toll roads, so we got the GPS to take us – no toll, shortest distance on our route towards Interlaken. We stopped at the all important Intermarchѐ to gather supplies and then for lunch. Towards 15.00hr we were dropping like flies and decided to stop and find a campsite. So, here we are, on a one night stop in a standard municiple campsite. Tired and ready for sleep, after an easy dinner. But…we are on holiday!!!

Please enable JavaScript to view the comments powered by Disqus.
comments powered by Disqus

Code released under the MIT license.


text:
#import <HomeSharing/HSRequest.h>

@interface HSNowPlayingArtworkRequest : HSRequest
{
    unsigned int _interfaceID;
    unsigned int _playQueueIndex;
    struct CGSize _maximumSize;
}

@property(readonly, nonatomic) unsigned int playQueueIndex; // @synthesize playQueueIndex=_playQueueIndex;
@property(readonly, nonatomic) struct CGSize maximumSize; // @synthesize maximumSize=_maximumSize;
@property(readonly, nonatomic) unsigned int interfaceID; // @synthesize interfaceID=_interfaceID;
- (id)canonicalResponseForResponse:(id)arg1;
- (id)initWithInterfaceID:(unsigned int)arg1 maximumSize:(struct CGSize)arg2 playQueueIndex:(unsigned int)arg3;

@end


text:
Festivaljakt - Slottsfjell
================

Koden for applikasjonen "Festivaljakt - Slottsfjell" ligger her. Mye hurrakode og jazzløsninger.


text:
package pl.maikeru.cgol;

import pl.maikeru.cgol.sample.WrongGame;
import pl.maikeru.cgol.sample.SampleGame;
import pl.maikeru.cgol.sample.CellFactory;

class PlayableAdapter implements Playable {

        private final SampleGame game;

        public static Playable createPlayable() {
            Playable playable = new PlayableAdapter(new SampleGame(10, new CellFactory()));
            return playable;
        }

        private PlayableAdapter(SampleGame yourGame) {
            this.game = yourGame;
            gameSetUp();
        }

//        private final WrongGame game;
//
//        public static Playable createPlayable() {
//            Playable playable = new PlayableAdapter(new WrongGame());
//            return playable;
//        }
//
//        private PlayableAdapter(WrongGame yourGame) {
//            this.game = yourGame;
//            gameSetUp();
//        }

        private void gameSetUp()
        {
            //game.resetState();
        }

        @Override
        public Boolean[][] toArray() {
            return game.toArray();
        }

        @Override
        public void nextState() {
            //game.nextState();
        }

        @Override
        public void resetState() {
            //game.resetState();
        }
}


text:
namespace CloudFlare.NET
{
    using System.Diagnostics.CodeAnalysis;
    using Newtonsoft.Json;
    using Newtonsoft.Json.Converters;

    // ReSharper disable InconsistentNaming
#pragma warning disable 1591

    /// <summary>
    /// The fields by which DNS records can be ordered.
    /// </summary>
    [SuppressMessage(
        "StyleCop.CSharp.DocumentationRules",
        "SA1602:EnumerationItemsMustBeDocumented",
        Justification = "Names are self-explanatory.")]
    [SuppressMessage(
        "StyleCop.CSharp.NamingRules",
        "SA1300:ConstFieldNamesMustBeginWithUpperCaseLetter",
        Justification = "Named to match serialized values.")]
    [JsonConverter(typeof(StringEnumConverter))]
    public enum DnsRecordOrderTypes
    {
        none,
        type,
        name,
        content,
        ttl,
        proxied,
    }
}


text:
#include <aws/cognito-idp/model/UserPoolType.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace CognitoIdentityProvider
{
namespace Model
{

UserPoolType::UserPoolType() :
    m_idHasBeenSet(false),
    m_nameHasBeenSet(false),
    m_policiesHasBeenSet(false),
    m_lambdaConfigHasBeenSet(false),
    m_status(StatusType::NOT_SET),
    m_statusHasBeenSet(false),
    m_lastModifiedDateHasBeenSet(false),
    m_creationDateHasBeenSet(false),
    m_schemaAttributesHasBeenSet(false),
    m_autoVerifiedAttributesHasBeenSet(false),
    m_aliasAttributesHasBeenSet(false),
    m_usernameAttributesHasBeenSet(false),
    m_smsVerificationMessageHasBeenSet(false),
    m_emailVerificationMessageHasBeenSet(false),
    m_emailVerificationSubjectHasBeenSet(false),
    m_verificationMessageTemplateHasBeenSet(false),
    m_smsAuthenticationMessageHasBeenSet(false),
    m_mfaConfiguration(UserPoolMfaType::NOT_SET),
    m_mfaConfigurationHasBeenSet(false),
    m_deviceConfigurationHasBeenSet(false),
    m_estimatedNumberOfUsers(0),
    m_estimatedNumberOfUsersHasBeenSet(false),
    m_emailConfigurationHasBeenSet(false),
    m_smsConfigurationHasBeenSet(false),
    m_userPoolTagsHasBeenSet(false),
    m_smsConfigurationFailureHasBeenSet(false),
    m_emailConfigurationFailureHasBeenSet(false),
    m_domainHasBeenSet(false),
    m_customDomainHasBeenSet(false),
    m_adminCreateUserConfigHasBeenSet(false),
    m_userPoolAddOnsHasBeenSet(false),
    m_usernameConfigurationHasBeenSet(false),
    m_arnHasBeenSet(false),
    m_accountRecoverySettingHasBeenSet(false)
{
}

UserPoolType::UserPoolType(JsonView jsonValue) :
    m_idHasBeenSet(false),
    m_nameHasBeenSet(false),
    m_policiesHasBeenSet(false),
    m_lambdaConfigHasBeenSet(false),
    m_status(StatusType::NOT_SET),
    m_statusHasBeenSet(false),
    m_lastModifiedDateHasBeenSet(false),
    m_creationDateHasBeenSet(false),
    m_schemaAttributesHasBeenSet(false),
    m_autoVerifiedAttributesHasBeenSet(false),
    m_aliasAttributesHasBeenSet(false),
    m_usernameAttributesHasBeenSet(false),
    m_smsVerificationMessageHasBeenSet(false),
    m_emailVerificationMessageHasBeenSet(false),
    m_emailVerificationSubjectHasBeenSet(false),
    m_verificationMessageTemplateHasBeenSet(false),
    m_smsAuthenticationMessageHasBeenSet(false),
    m_mfaConfiguration(UserPoolMfaType::NOT_SET),
    m_mfaConfigurationHasBeenSet(false),
    m_deviceConfigurationHasBeenSet(false),
    m_estimatedNumberOfUsers(0),
    m_estimatedNumberOfUsersHasBeenSet(false),
    m_emailConfigurationHasBeenSet(false),
    m_smsConfigurationHasBeenSet(false),
    m_userPoolTagsHasBeenSet(false),
    m_smsConfigurationFailureHasBeenSet(false),
    m_emailConfigurationFailureHasBeenSet(false),
    m_domainHasBeenSet(false),
    m_customDomainHasBeenSet(false),
    m_adminCreateUserConfigHasBeenSet(false),
    m_userPoolAddOnsHasBeenSet(false),
    m_usernameConfigurationHasBeenSet(false),
    m_arnHasBeenSet(false),
    m_accountRecoverySettingHasBeenSet(false)
{
  *this = jsonValue;
}

UserPoolType& UserPoolType::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("Id"))
  {
    m_id = jsonValue.GetString("Id");

    m_idHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Name"))
  {
    m_name = jsonValue.GetString("Name");

    m_nameHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Policies"))
  {
    m_policies = jsonValue.GetObject("Policies");

    m_policiesHasBeenSet = true;
  }

  if(jsonValue.ValueExists("LambdaConfig"))
  {
    m_lambdaConfig = jsonValue.GetObject("LambdaConfig");

    m_lambdaConfigHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Status"))
  {
    m_status = StatusTypeMapper::GetStatusTypeForName(jsonValue.GetString("Status"));

    m_statusHasBeenSet = true;
  }

  if(jsonValue.ValueExists("LastModifiedDate"))
  {
    m_lastModifiedDate = jsonValue.GetDouble("LastModifiedDate");

    m_lastModifiedDateHasBeenSet = true;
  }

  if(jsonValue.ValueExists("CreationDate"))
  {
    m_creationDate = jsonValue.GetDouble("CreationDate");

    m_creationDateHasBeenSet = true;
  }

  if(jsonValue.ValueExists("SchemaAttributes"))
  {
    Array<JsonView> schemaAttributesJsonList = jsonValue.GetArray("SchemaAttributes");
    for(unsigned schemaAttributesIndex = 0; schemaAttributesIndex < schemaAttributesJsonList.GetLength(); ++schemaAttributesIndex)
    {
      m_schemaAttributes.push_back(schemaAttributesJsonList[schemaAttributesIndex].AsObject());
    }
    m_schemaAttributesHasBeenSet = true;
  }

  if(jsonValue.ValueExists("AutoVerifiedAttributes"))
  {
    Array<JsonView> autoVerifiedAttributesJsonList = jsonValue.GetArray("AutoVerifiedAttributes");
    for(unsigned autoVerifiedAttributesIndex = 0; autoVerifiedAttributesIndex < autoVerifiedAttributesJsonList.GetLength(); ++autoVerifiedAttributesIndex)
    {
      m_autoVerifiedAttributes.push_back(VerifiedAttributeTypeMapper::GetVerifiedAttributeTypeForName(autoVerifiedAttributesJsonList[autoVerifiedAttributesIndex].AsString()));
    }
    m_autoVerifiedAttributesHasBeenSet = true;
  }

  if(jsonValue.ValueExists("AliasAttributes"))
  {
    Array<JsonView> aliasAttributesJsonList = jsonValue.GetArray("AliasAttributes");
    for(unsigned aliasAttributesIndex = 0; aliasAttributesIndex < aliasAttributesJsonList.GetLength(); ++aliasAttributesIndex)
    {
      m_aliasAttributes.push_back(AliasAttributeTypeMapper::GetAliasAttributeTypeForName(aliasAttributesJsonList[aliasAttributesIndex].AsString()));
    }
    m_aliasAttributesHasBeenSet = true;
  }

  if(jsonValue.ValueExists("UsernameAttributes"))
  {
    Array<JsonView> usernameAttributesJsonList = jsonValue.GetArray("UsernameAttributes");
    for(unsigned usernameAttributesIndex = 0; usernameAttributesIndex < usernameAttributesJsonList.GetLength(); ++usernameAttributesIndex)
    {
      m_usernameAttributes.push_back(UsernameAttributeTypeMapper::GetUsernameAttributeTypeForName(usernameAttributesJsonList[usernameAttributesIndex].AsString()));
    }
    m_usernameAttributesHasBeenSet = true;
  }

  if(jsonValue.ValueExists("SmsVerificationMessage"))
  {
    m_smsVerificationMessage = jsonValue.GetString("SmsVerificationMessage");

    m_smsVerificationMessageHasBeenSet = true;
  }

  if(jsonValue.ValueExists("EmailVerificationMessage"))
  {
    m_emailVerificationMessage = jsonValue.GetString("EmailVerificationMessage");

    m_emailVerificationMessageHasBeenSet = true;
  }

  if(jsonValue.ValueExists("EmailVerificationSubject"))
  {
    m_emailVerificationSubject = jsonValue.GetString("EmailVerificationSubject");

    m_emailVerificationSubjectHasBeenSet = true;
  }

  if(jsonValue.ValueExists("VerificationMessageTemplate"))
  {
    m_verificationMessageTemplate = jsonValue.GetObject("VerificationMessageTemplate");

    m_verificationMessageTemplateHasBeenSet = true;
  }

  if(jsonValue.ValueExists("SmsAuthenticationMessage"))
  {
    m_smsAuthenticationMessage = jsonValue.GetString("SmsAuthenticationMessage");

    m_smsAuthenticationMessageHasBeenSet = true;
  }

  if(jsonValue.ValueExists("MfaConfiguration"))
  {
    m_mfaConfiguration = UserPoolMfaTypeMapper::GetUserPoolMfaTypeForName(jsonValue.GetString("MfaConfiguration"));

    m_mfaConfigurationHasBeenSet = true;
  }

  if(jsonValue.ValueExists("DeviceConfiguration"))
  {
    m_deviceConfiguration = jsonValue.GetObject("DeviceConfiguration");

    m_deviceConfigurationHasBeenSet = true;
  }

  if(jsonValue.ValueExists("EstimatedNumberOfUsers"))
  {
    m_estimatedNumberOfUsers = jsonValue.GetInteger("EstimatedNumberOfUsers");

    m_estimatedNumberOfUsersHasBeenSet = true;
  }

  if(jsonValue.ValueExists("EmailConfiguration"))
  {
    m_emailConfiguration = jsonValue.GetObject("EmailConfiguration");

    m_emailConfigurationHasBeenSet = true;
  }

  if(jsonValue.ValueExists("SmsConfiguration"))
  {
    m_smsConfiguration = jsonValue.GetObject("SmsConfiguration");

    m_smsConfigurationHasBeenSet = true;
  }

  if(jsonValue.ValueExists("UserPoolTags"))
  {
    Aws::Map<Aws::String, JsonView> userPoolTagsJsonMap = jsonValue.GetObject("UserPoolTags").GetAllObjects();
    for(auto& userPoolTagsItem : userPoolTagsJsonMap)
    {
      m_userPoolTags[userPoolTagsItem.first] = userPoolTagsItem.second.AsString();
    }
    m_userPoolTagsHasBeenSet = true;
  }

  if(jsonValue.ValueExists("SmsConfigurationFailure"))
  {
    m_smsConfigurationFailure = jsonValue.GetString("SmsConfigurationFailure");

    m_smsConfigurationFailureHasBeenSet = true;
  }

  if(jsonValue.ValueExists("EmailConfigurationFailure"))
  {
    m_emailConfigurationFailure = jsonValue.GetString("EmailConfigurationFailure");

    m_emailConfigurationFailureHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Domain"))
  {
    m_domain = jsonValue.GetString("Domain");

    m_domainHasBeenSet = true;
  }

  if(jsonValue.ValueExists("CustomDomain"))
  {
    m_customDomain = jsonValue.GetString("CustomDomain");

    m_customDomainHasBeenSet = true;
  }

  if(jsonValue.ValueExists("AdminCreateUserConfig"))
  {
    m_adminCreateUserConfig = jsonValue.GetObject("AdminCreateUserConfig");

    m_adminCreateUserConfigHasBeenSet = true;
  }

  if(jsonValue.ValueExists("UserPoolAddOns"))
  {
    m_userPoolAddOns = jsonValue.GetObject("UserPoolAddOns");

    m_userPoolAddOnsHasBeenSet = true;
  }

  if(jsonValue.ValueExists("UsernameConfiguration"))
  {
    m_usernameConfiguration = jsonValue.GetObject("UsernameConfiguration");

    m_usernameConfigurationHasBeenSet = true;
  }

  if(jsonValue.ValueExists("Arn"))
  {
    m_arn = jsonValue.GetString("Arn");

    m_arnHasBeenSet = true;
  }

  if(jsonValue.ValueExists("AccountRecoverySetting"))
  {
    m_accountRecoverySetting = jsonValue.GetObject("AccountRecoverySetting");

    m_accountRecoverySettingHasBeenSet = true;
  }

  return *this;
}

JsonValue UserPoolType::Jsonize() const
{
  JsonValue payload;

  if(m_idHasBeenSet)
  {
   payload.WithString("Id", m_id);

  }

  if(m_nameHasBeenSet)
  {
   payload.WithString("Name", m_name);

  }

  if(m_policiesHasBeenSet)
  {
   payload.WithObject("Policies", m_policies.Jsonize());

  }

  if(m_lambdaConfigHasBeenSet)
  {
   payload.WithObject("LambdaConfig", m_lambdaConfig.Jsonize());

  }

  if(m_statusHasBeenSet)
  {
   payload.WithString("Status", StatusTypeMapper::GetNameForStatusType(m_status));
  }

  if(m_lastModifiedDateHasBeenSet)
  {
   payload.WithDouble("LastModifiedDate", m_lastModifiedDate.SecondsWithMSPrecision());
  }

  if(m_creationDateHasBeenSet)
  {
   payload.WithDouble("CreationDate", m_creationDate.SecondsWithMSPrecision());
  }

  if(m_schemaAttributesHasBeenSet)
  {
   Array<JsonValue> schemaAttributesJsonList(m_schemaAttributes.size());
   for(unsigned schemaAttributesIndex = 0; schemaAttributesIndex < schemaAttributesJsonList.GetLength(); ++schemaAttributesIndex)
   {
     schemaAttributesJsonList[schemaAttributesIndex].AsObject(m_schemaAttributes[schemaAttributesIndex].Jsonize());
   }
   payload.WithArray("SchemaAttributes", std::move(schemaAttributesJsonList));

  }

  if(m_autoVerifiedAttributesHasBeenSet)
  {
   Array<JsonValue> autoVerifiedAttributesJsonList(m_autoVerifiedAttributes.size());
   for(unsigned autoVerifiedAttributesIndex = 0; autoVerifiedAttributesIndex < autoVerifiedAttributesJsonList.GetLength(); ++autoVerifiedAttributesIndex)
   {
     autoVerifiedAttributesJsonList[autoVerifiedAttributesIndex].AsString(VerifiedAttributeTypeMapper::GetNameForVerifiedAttributeType(m_autoVerifiedAttributes[autoVerifiedAttributesIndex]));
   }
   payload.WithArray("AutoVerifiedAttributes", std::move(autoVerifiedAttributesJsonList));

  }

  if(m_aliasAttributesHasBeenSet)
  {
   Array<JsonValue> aliasAttributesJsonList(m_aliasAttributes.size());
   for(unsigned aliasAttributesIndex = 0; aliasAttributesIndex < aliasAttributesJsonList.GetLength(); ++aliasAttributesIndex)
   {
     aliasAttributesJsonList[aliasAttributesIndex].AsString(AliasAttributeTypeMapper::GetNameForAliasAttributeType(m_aliasAttributes[aliasAttributesIndex]));
   }
   payload.WithArray("AliasAttributes", std::move(aliasAttributesJsonList));

  }

  if(m_usernameAttributesHasBeenSet)
  {
   Array<JsonValue> usernameAttributesJsonList(m_usernameAttributes.size());
   for(unsigned usernameAttributesIndex = 0; usernameAttributesIndex < usernameAttributesJsonList.GetLength(); ++usernameAttributesIndex)
   {
     usernameAttributesJsonList[usernameAttributesIndex].AsString(UsernameAttributeTypeMapper::GetNameForUsernameAttributeType(m_usernameAttributes[usernameAttributesIndex]));
   }
   payload.WithArray("UsernameAttributes", std::move(usernameAttributesJsonList));

  }

  if(m_smsVerificationMessageHasBeenSet)
  {
   payload.WithString("SmsVerificationMessage", m_smsVerificationMessage);

  }

  if(m_emailVerificationMessageHasBeenSet)
  {
   payload.WithString("EmailVerificationMessage", m_emailVerificationMessage);

  }

  if(m_emailVerificationSubjectHasBeenSet)
  {
   payload.WithString("EmailVerificationSubject", m_emailVerificationSubject);

  }

  if(m_verificationMessageTemplateHasBeenSet)
  {
   payload.WithObject("VerificationMessageTemplate", m_verificationMessageTemplate.Jsonize());

  }

  if(m_smsAuthenticationMessageHasBeenSet)
  {
   payload.WithString("SmsAuthenticationMessage", m_smsAuthenticationMessage);

  }

  if(m_mfaConfigurationHasBeenSet)
  {
   payload.WithString("MfaConfiguration", UserPoolMfaTypeMapper::GetNameForUserPoolMfaType(m_mfaConfiguration));
  }

  if(m_deviceConfigurationHasBeenSet)
  {
   payload.WithObject("DeviceConfiguration", m_deviceConfiguration.Jsonize());

  }

  if(m_estimatedNumberOfUsersHasBeenSet)
  {
   payload.WithInteger("EstimatedNumberOfUsers", m_estimatedNumberOfUsers);

  }

  if(m_emailConfigurationHasBeenSet)
  {
   payload.WithObject("EmailConfiguration", m_emailConfiguration.Jsonize());

  }

  if(m_smsConfigurationHasBeenSet)
  {
   payload.WithObject("SmsConfiguration", m_smsConfiguration.Jsonize());

  }

  if(m_userPoolTagsHasBeenSet)
  {
   JsonValue userPoolTagsJsonMap;
   for(auto& userPoolTagsItem : m_userPoolTags)
   {
     userPoolTagsJsonMap.WithString(userPoolTagsItem.first, userPoolTagsItem.second);
   }
   payload.WithObject("UserPoolTags", std::move(userPoolTagsJsonMap));

  }

  if(m_smsConfigurationFailureHasBeenSet)
  {
   payload.WithString("SmsConfigurationFailure", m_smsConfigurationFailure);

  }

  if(m_emailConfigurationFailureHasBeenSet)
  {
   payload.WithString("EmailConfigurationFailure", m_emailConfigurationFailure);

  }

  if(m_domainHasBeenSet)
  {
   payload.WithString("Domain", m_domain);

  }

  if(m_customDomainHasBeenSet)
  {
   payload.WithString("CustomDomain", m_customDomain);

  }

  if(m_adminCreateUserConfigHasBeenSet)
  {
   payload.WithObject("AdminCreateUserConfig", m_adminCreateUserConfig.Jsonize());

  }

  if(m_userPoolAddOnsHasBeenSet)
  {
   payload.WithObject("UserPoolAddOns", m_userPoolAddOns.Jsonize());

  }

  if(m_usernameConfigurationHasBeenSet)
  {
   payload.WithObject("UsernameConfiguration", m_usernameConfiguration.Jsonize());

  }

  if(m_arnHasBeenSet)
  {
   payload.WithString("Arn", m_arn);

  }

  if(m_accountRecoverySettingHasBeenSet)
  {
   payload.WithObject("AccountRecoverySetting", m_accountRecoverySetting.Jsonize());

  }

  return payload;
}

} // namespace Model
} // namespace CognitoIdentityProvider
} // namespace Aws


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package org.chromium.components.devtools_bridge;

import android.net.LocalSocketAddress;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Tunnels DevTools UNIX socket over AbstractDataChannel.
 */
public class SocketTunnelServer extends SocketTunnelBase {
    private final LocalSocketAddress mAddress;

    private final ExecutorService mReadingThreadPool = Executors.newCachedThreadPool();

    // Connections with opened client to server stream. If bound to data channel must be accessed
    // on signaling thread.
    private final Map<Integer, Connection> mClientConnections =
            new HashMap<Integer, Connection>();

    // Connections with opened server to client stream. Values are added
    // on signaling thread and removed on reading thread.
    private final ConcurrentMap<Integer, Connection> mServerConnections =
            new ConcurrentHashMap<Integer, Connection>();

    public SocketTunnelServer(String socketName) {
        mAddress = new LocalSocketAddress(socketName);
    }

    @Override
    public AbstractDataChannel unbind() {
        AbstractDataChannel dataChannel = super.unbind();

        mReadingThreadPool.shutdownNow();

        // Safe to access mClientConnections here once AbstractDataChannel.Observer detached.
        for (Connection connection : mClientConnections.values()) {
            connection.terminate();
        }
        mClientConnections.clear();
        return dataChannel;
    }

    public boolean hasConnections() {
        return mClientConnections.size() + mServerConnections.size() > 0;
    }

    @Override
    protected void onReceivedDataPacket(int connectionId, byte[] data) throws ProtocolError {
        checkCalledOnSignalingThread();

        if (!mClientConnections.containsKey(connectionId)) {
            throw new ProtocolError("Unknows conection id");
        }

        mClientConnections.get(connectionId).onReceivedDataPacket(data);
    }

    @Override
    protected void onReceivedControlPacket(int connectionId, byte opCode) throws ProtocolError {
        checkCalledOnSignalingThread();

        switch (opCode) {
            case CLIENT_OPEN:
                onClientOpen(connectionId);
                break;

            case CLIENT_CLOSE:
                onClientClose(connectionId);
                break;

            default:
                throw new ProtocolError("Invalid opCode");
        }
    }

    private void onClientOpen(int connectionId) throws ProtocolError {
        checkCalledOnSignalingThread();

        if (mClientConnections.containsKey(connectionId) ||
                mServerConnections.containsKey(connectionId)) {
            throw new ProtocolError("Conection id already used");
        }

        Connection connection = new Connection(connectionId);
        mClientConnections.put(connectionId, connection);
        mServerConnections.put(connectionId, connection);

        mReadingThreadPool.execute(connection);
    }

    private void onClientClose(int connectionId) throws ProtocolError {
        checkCalledOnSignalingThread();

        if (!mClientConnections.containsKey(connectionId)) {
            throw new ProtocolError("Unknows connection id");
        }

        Connection connection = mClientConnections.get(connectionId);

        connection.closedByClient();
        mClientConnections.remove(connectionId);
    }

    private final class Connection extends ConnectionBase implements Runnable {
        public Connection(int id) {
            super(id);
        }

        public void closedByClient() {
            shutdownOutput();
        }

        @Override
        public void run() {
            assert mServerConnections.containsKey(mId);

            if (connect(mAddress)) {
                sendToDataChannel(buildControlPacket(mId, SERVER_OPEN_ACK));
                runReadingLoop();
            }
            mServerConnections.remove(mId);
            shutdownInput();
            sendToDataChannel(buildControlPacket(mId, SERVER_CLOSE));
        }
    }
}


text:
package io.appium.java_client.remote.options;

import org.openqa.selenium.Capabilities;
import org.openqa.selenium.ScreenOrientation;

import java.util.Optional;

public interface SupportsOrientationOption<T extends BaseOptions<T>> extends
        Capabilities, CanSetCapability<T> {
    String ORIENTATION_OPTION = "orientation";

    /**
     * Set the orientation of the screen.
     *
     * @param orientation is the screen orientation.
     * @return self instance for chaining.
     */
    default T setOrientation(ScreenOrientation orientation) {
        return amend(ORIENTATION_OPTION, orientation.name());
    }

    /**
     * Get the orientation of the screen.
     *
     * @return ScreenOrientation of the app.
     */
    default Optional<ScreenOrientation> getOrientation() {
        return Optional.ofNullable(getCapability(ORIENTATION_OPTION))
                .map((v) -> v instanceof ScreenOrientation
                        ? (ScreenOrientation) v
                        : ScreenOrientation.valueOf((String.valueOf(v)).toUpperCase())
                );
    }
}


text:
<window>
	<defaultcontrol always="true">50</defaultcontrol>
	<backgroundcolor>0</backgroundcolor>
	<allowoverlay>yes</allowoverlay>
	<previouswindow>Home</previouswindow>
	<controls>
		<include>background</include>
		<include>Fake-Overlay</include>
		<include>#files</include>

		<control type="image">
			<description>Music Logo</description>
			<include>icon-header-commons</include>
			<texture>icon-music-sml.png</texture>
		</control>
		<control type="grouplist">
			<posx>946</posx>
			<posy>50</posy>
			<width>360</width>
			<height>37</height>
			<align>left</align>
			<aligny>center</aligny>
			<orientation>horizontal</orientation>
			<control type="label">
				<description>Video screen headings</description>
				<width min="60" max="250">auto</width>
				<height>37</height>
				$VAR[MusicHeadings]
				font20
				<aligny>center</aligny>
			</control>
			<control type="label">
				<description>Number of files</description>
				<visible>Skin.HasSetting(homemenu-horizontal) | [!Skin.HasSetting(homemenu-vertical) + !Skin.HasSetting(homemenu-horizontal)]</visible>
				<posy>13</posy>
				<width min="40" max="110">auto</width>
				<height>38</height>
				font13
				<aligny>center</aligny>
				$INFO[Container.NumItems, (,)]
			</control>
		</control>

		<include>memory-low</include>

		<include>ListView</include>
		<include>ListView-MusicIcon</include>
		<include>AlbumWrapView</include>
		<include>AudioWallView</include>
		<include>AlbumCoverflow</include>

		<control type="group">
			<posy>720</posy>
			<include>View-as</include>
			<control type="group" id="9000">
				<visible>!Skin.HasSetting(view-as-lock)</visible>
				<control type="image">
					<description>Background shadow</description>
					<posx>0</posx>
					<posy>0</posy>
					<width>1280</width>
					<height>900</height>
					<texture>black.png</texture>
					<colordiffuse>osd-background</colordiffuse>
				</control>
				<control type="image">
					<description>Button Background</description>
					<posx>460</posx>
					<posy>212</posy>
					<width>398</width>
					<height>400</height>
					<texture border="8" diffuse="mask-squ.png">button-menu-background.png</texture>
				</control>
				<control type="button" id="2">
					<description>View As Icons button</description>
					<posx>477</posx>
					<posy>225</posy>
					<width>362</width>
					<height>50</height>
					font12
					100
					<textoffsetx>10</textoffsetx>
					<aligny>center</aligny>
					<onleft>50</onleft>
					<onright>50</onright>
					<onup>1200</onup>
					<ondown>3</ondown>
				</control>
				<control type="button" id="3">
					<description>Sort by button</description>
					<posx>477</posx>
					<posy>275</posy>
					<width>362</width>
					<height>50</height>
					font12
					103
					<textoffsetx>10</textoffsetx>
					<onleft>50</onleft>
					<onright>50</onright>
					<onup>2</onup>
					<ondown>4</ondown>
				</control>
				<control type="togglebutton" id="4">
					<description>Sort direction</description>
					<posx>477</posx>
					<posy>325</posy>
					<width>362</width>
					<height>50</height>
					$LOCALIZE[21429]: $LOCALIZE[21430]
					<altlabel>$LOCALIZE[21429]: $LOCALIZE[21431]</altlabel>
					<textoffsetx>10</textoffsetx>
					<onleft>50</onleft>
					<onright>50</onright>
					<onup>3</onup>
					<ondown>5</ondown>
				</control>
				<control type="radiobutton" id="5">
					<description>Library button</description>
					<posx>477</posx>
					<posy>375</posy>
					<width>362</width>
					<height>50</height>
					font12
					<textoffsetx>10</textoffsetx>
					$LOCALIZE[14022] $LOCALIZE[456]
					<onclick>ReplaceWindow(mymusiclibrary)</onclick>
					<selected>Window.IsVisible(musiclibrary)</selected>
					<onleft>50</onleft>
					<onright>50</onright>
					<onup>4</onup>
					<ondown>19</ondown>
					<radioposx>330</radioposx>
				</control>
				<control type="edit" id="19">
					<description>Filter</description>
					<posx>477</posx>
					<posy>425</posy>
					<width>362</width>
					<height>50</height>
					font12
					587
					<textwidth>340</textwidth>
					<texturenofocus>-</texturenofocus>
					<aligny>center</aligny>
					<textoffsetx>10</textoffsetx>
					<onleft>50</onleft>
					<onright>50</onright>
					<onup>5</onup>
					<ondown>20</ondown>
					<visible>!Container.CanFilterAdvanced</visible>
				</control>
				<control type="radiobutton" id="20">
					<description>Advanced Filter</description>
					<posx>477</posx>
					<posy>425</posy>
					<width>362</width>
					<height>50</height>
					587
					font12
					<selected>Container.Filtered</selected>
					<onclick>Filter</onclick>
					<onleft>50</onleft>
					<onright>50</onright>
					<onup>19</onup>
					<ondown>11</ondown>
					<textoffsetx>10</textoffsetx>
					<radioposx>330</radioposx>
					<visible>Container.CanFilterAdvanced</visible>
				</control>
				<control type="button" id="11">
					<description>Rip CD</description>
					<posx>477</posx>
					<posy>475</posy>
					<width>362</width>
					<height>50</height>
					font12
					600
					<onleft>50</onleft>
					<onright>50</onright>
					<onup>20</onup>
					<ondown>1200</ondown>
				</control>
				<control type="button" id="1200">
					<description>PlayerControls</description>
					<posx>477</posx>
					<posy>525</posy>
					<width>362</width>
					<height>50</height>
					font12
					$LOCALIZE[16003] $LOCALIZE[478]
					<onleft>50</onleft>
					<onright>50</onright>
					<onup>19</onup>
					<ondown>2</ondown>
					<onclick>ActivateWindow(playercontrols)</onclick>
					<onclick>SetFocus(50)</onclick>
					<enable>Player.HasAudio | Player.HasVideo</enable>
				</control>
			</control>
		</control>
	</controls>
</window>