text:
<?php

/**
*
*	This file allows inserting redirections and displaying stats.
*
*	For redirections added, there are several possibilities:
*
*	1. Adding a new URL, no custom slug: Inserted, and new slug auto-generated.
*
*	2. Adding an existing URL, no custom slug: The old slug is returned.
*
*	3. Adding a new URL, with a custom slug:
*
*	4. Adding an existing URL, with a custom slug: The new slug is inserted anyway.
*		The old redirection(s) become a "aliases" of the new one,
*		so in case 2, the newest slug is returned (it's "preferred".)
*
*	DEVELOPERS:
*	Note the following possible redir_type values:
*	-	'auto' - Automatically assigned slug. 301 redirect on access.
*	-	'custom' - Manually set slug. 301 redirect on access.
*	-	'alias' - Its 'url' is really just another slug. Do a recursive lookup to redirect on access.
*	-	'gone' - Access results in a 410; should never change
*/
REQUIRE 'config.php';
REQUIRE 'db.php';
REQUIRE 'stats.php';

define('BCURLS_VERSION',	'2.0.1');

define('BCURLS_DOMAIN', 	preg_replace('#^www\.#', '', $_SERVER['SERVER_NAME']));
define('BCURLS_URL', 	str_replace('-/index.php', '', 'http://'.BCURLS_DOMAIN.$_SERVER['PHP_SELF']));

//don't reveal db prefix over HTTP. 16 chars is more than enough to avoid collisions
define('COOKIE_NAME', 	substr(md5(DB_PREFIX.COOKIE_SALT), 4, 16).'auth');
define('COOKIE_VALUE',	md5(USERNAME.PASSWORD.COOKIE_SALT));
define('COOKIE_DOMAIN', '.'.BCURLS_DOMAIN);

if (!defined('API_SALT')) define('API_SALT', 'B75jk4K25M5U7hTAP1'); // added in lessn 1.0.5
define('API_KEY', md5(USERNAME.PASSWORD.API_SALT));

define('NOW', 		time());
define('YEAR',		365 * 24 * 60 * 60);

/**
* @Returns int Characters from the right, 0-(n-1) where n = strlen($slug),
* where a banned word ends. e.g.:
* slug = 'dLpooz'
* 'poo' is a banned word
* returns 1
*/
function bcurls_find_banned_word($slug) {
	global $bcurls_banned_words;
	require_once 'banned_words.php';
	foreach ($bcurls_banned_words as $banned){
		$strpos = stripos($slug, $banned);
		if ($strpos !== false) {
			bc_log('Found banned word '.$banned.' in '.$slug);
			// $slug = xBANNEDxx (length 9)
			// $banned = BANNED (length 6)
			// strpos = 1
			// we want to return 2 (BANNED is two characters from the right)
			return strlen($slug) - strlen($banned) - $strpos;
		}
	}
	return FALSE;
}

/**
* @Returns int Characters from the right, 0-(n-1) where n = strlen($slug),
* where a banned glyph ends. e.g.:
*/
function bcurls_find_banned_glyph($slug) {
	if (ADDITIONAL_HOMOGLYPHS_TO_AVOID === false)
		return false;
	$glyphs = str_split(ADDITIONAL_HOMOGLYPHS_TO_AVOID);
	foreach ($glyphs as $banned){
		$strpos = strpos($slug, $banned);
		if ($strpos !== FALSE) {
			bc_log('Found banned glyph '.$banned.' in '.$slug);
			// $slug = xIxx (length 4)
			// $banned = I (length I)
			// strpos = 1
			// we want to return 2 (I is two characters from the right)
			return (strlen($slug) - 1 - $strpos);
		}
	}
	return FALSE;
}

// handle login
if (isset($_POST['username']))
{
	if (md5($_POST['username'].$_POST['password'].COOKIE_SALT) == COOKIE_VALUE)
	{
		setcookie(COOKIE_NAME, COOKIE_VALUE, NOW + YEAR, '/', COOKIE_DOMAIN);
		$_COOKIE[COOKIE_NAME] = COOKIE_VALUE;
	}
}
// API login
else if (isset($_GET['api']) && $_GET['api'] == API_KEY)
{
	$_COOKIE[COOKIE_NAME] = COOKIE_VALUE;
}
else if (isset($_GET['api'])) // spit out a nicer failure for API attempts
{
	exit('Invalid API key');
}

// handle logout
if (isset($_GET['logout']))
{
	setcookie(COOKIE_NAME, '', NOW - YEAR, '/', COOKIE_DOMAIN);
	unset($_COOKIE[COOKIE_NAME]);
	header('Location:./');
}

// require login
if (!isset($_COOKIE[COOKIE_NAME]) || $_COOKIE[COOKIE_NAME] != COOKIE_VALUE)
{
	include('pages/login.php');
	exit();
}
// prolong login for another year, unless this is an API request
else if (!isset($_GET['api']))
{
	setcookie(COOKIE_NAME, COOKIE_VALUE, NOW + YEAR, '/', COOKIE_DOMAIN);
}

// Successfully logged in, so
define('OKAY_TO_SHOW_PAGES', true); //value doesn't matter

/**
*	WARNING! Provides NO checking and should ONLY be used internally!
*	Returns TRUE *or* a string "error code: error info".
*/
function bcurls_insert_url ($url, $checksum, $slug, $redir_type)
{
	global $db;
	$stmt = $db->prepare('INSERT INTO '.DB_PREFIX.'urls (url, checksum, custom_url, redir_type) VALUES(?, ?, ?, ?)');
	$stmt->bindValue(1, $url);
	$stmt->bindValue(2, $checksum);
	$stmt->bindValue(3, $slug);
	$stmt->bindValue(4, $redir_type);
	if($stmt->execute())
		return true;
	else
		return $stmt->errorCode().': '.$stmt->errorInfo();
}
/**
*	WARNING! Provides NO checking and should ONLY be used internally!
*	Returns TRUE *or* a string "error code: error info".
*/
function bcurls_update_slug ($url, $checksum, $slug, $redir_type)
{
	global $db;
	$stmt = $db->prepare('UPDATE '.DB_PREFIX.'urls SET url = ?, checksum = ?, redir_type = ? WHERE custom_url = ? ');
	$stmt->bindValue(1, $url);
	$stmt->bindValue(2, $checksum);
	$stmt->bindValue(3, $redir_type);
	$stmt->bindValue(4, $slug);
	if($stmt->execute())
		return true;
	else
		return $stmt->errorCode().': '.$stmt->errorInfo();
}

/**
* For debuggers, developers, and the curious
*/
function bc_log($message){
	global $bc_log;
	if(!is_string($bc_log)) $bc_log = '';
	if(LOG_MODE) $bc_log .= date('r - ')."$message \n";
}

// new shortcut
if (isset($_GET['url']) && !empty($_GET['url']))
{
	$url = $_GET['url'];
	$slug = NULL;
	$prefix = DB_PREFIX;
	if (!preg_match('#^[^:]+://#', $url))
	{
		$url = 'http://'.$url;
	}
	if(strpos($url, BCURLS_URL) === 0)
	{
		$error = 'You tried to shorten a URL on this domain which should already be short!';
		include('pages/error.php');
		exit;
	}

	// Is there already a row in the DB going to this same URL?
	$checksum 		= (int) sprintf('%u', crc32($url));
	$result = $db->prepare("SELECT id, custom_url, redir_type FROM {$prefix}urls WHERE checksum=? AND BINARY url = BINARY ? AND url = ? AND redir_type <> 'gone' ORDER BY redir_type DESC LIMIT 1"); //sort so custom is before auto.
	$result->bindValue(1, (int)$checksum);
	$result->bindValue(2, $url);
	$result->bindValue(3, $url);
	if ( ! $result->execute())
	{
		$error = 'Problem executing query to check if the URL is already in the DB! '
			.$result->errorCode().': '.$result->errorInfo();
		include('pages/error.php');
		exit;
	}

	if ($row = $result->fetch(PDO::FETCH_ASSOC))
	{
		$existing_slug = $row['custom_url'];
	} else {
		$existing_slug = false;
		if(LOG_MODE) bc_log('No existing slug'); //debug
	}

	if(isset($_GET['custom_url']) && strlen(trim($_GET['custom_url'])))
	{	// user wants to assign a custom short URL
		$custom_url = trim($_GET['custom_url']);
		// check if the slug is already in use
		$stmt = $db->prepare("SELECT * FROM {$prefix}urls WHERE BINARY custom_url = BINARY ? AND  custom_url =  ?");
		$stmt->bindValue(1, $custom_url);
		$stmt->bindValue(2, $custom_url);
		$stmt->execute();
		$row = $stmt->fetch(PDO::FETCH_ASSOC);
		if($row && ! isset($_GET['overwrite']))
		{
			$error = 'The custom short URL you attempted to use (/'.$row['custom_url'].') is already in use, and is '.($row['redir_type'] == 'alias' ? 'an alias for /': 'pointing to ').$row['url'];
			if(isset($_GET['api'])) exit('Error: Token in use');
			else
			{
				include('pages/add.php');
				exit;
			}
		}
		elseif ($row) //implicit: they allowed overwrite
		{

			$redir_type = 'custom';
			$slug = $custom_url;
			// Update
			$insert_result = bcurls_update_slug ($url, $checksum, $slug, $redir_type);
			if($insert_result !== true) {
				$error = $insert_result;
				include('pages/error.php');
				exit;
			}
		}
		else
		{
			$redir_type = 'custom';
			$slug = $custom_url;
			// Insert!
			$insert_result = bcurls_insert_url ($url, $checksum, $slug, $redir_type);
			if($insert_result !== true) {
				$error = $insert_result;
				include('pages/error.php');
				exit;
			}

		}

		// Old records become aliases to this one
		if($existing_slug !== false)
		{
			// User added a new custom short URL even though that URL is already in the DB
			// Update old redirections so they are no more than aliases of the new one ;)
			$update_to_alias_sql = "UPDATE {$prefix}urls SET redir_type = 'alias', url = :slug, checksum = :newchecksum WHERE checksum = :checksum AND url = :url AND BINARY url = BINARY :url AND (redir_type = 'custom' OR redir_type = 'auto') AND BINARY custom_url <> BINARY :slug";
			$updt_a = $db->prepare($update_to_alias_sql);
			$updt_a->execute(array(
				'checksum'		=> $checksum,
			 	'url'			=> $url,
				'slug'			=> $slug,
				'newchecksum' 	=> (int) sprintf('%u', crc32($slug)),
			));
			unset($updt_a);
		}
	}
	elseif($existing_slug == false)
	{	// auto-assign a slug for this new URL.
		$redir_type = 'auto';
		require_once 'library/BaseIntEncoder.php';

		// PREPARE
		switch(AUTO_SLUG_METHOD) {
			case 'base62':
				$glyphs = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
				$base = 62;
				break;
			case 'mixed-smart':
				$glyphs = '23456789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
				// we excluded 6 characters: 0oO1Il
				$base = 56;
				break;
			case 'base36':
				$glyphs = '0123456789abcdefghijklmnopqrstuvwxyz';
				$base = 36;
				break;
			case 'smart':
				$glyphs = '23456789abcdefghijkmnpqrstuvwxyz';
				$base = 32; //exclude 0o1l
				break;
			default:
				throw new Exception ('Unsupported method to generate unique slugs!');
				break;
		}
		$seek_count = 0; // When we need to skip tweets
		$auto_seek_pow = 1.1513;
		$custom_seek_pow = 1.031;
		$auto_assign_sql = "SELECT base10 FROM {$prefix}autoslug "
			.'WHERE method = :method LIMIT 1';
		$auto = $db->prepare($auto_assign_sql);
		$auto->execute(array('method'=>AUTO_SLUG_METHOD));
		$counter = $auto->fetch(PDO::FETCH_ASSOC);
		$counter = $counter['base10'];

		// For binary search //TODO
		$high = $low = $counter;

		$total_attempts_remaining = 250;

		// Check to insert (seek)
		while ($slug === NULL) {
			// Never just try forever
			if($total_attempts_remaining-- < 1) {
				bc_log('Total attempts maxed out in insert loop');
				$error = 'Tried too many times seeking an available slug';
				include('pages/error.php');
				exit;
			}

			$slug = BaseIntEncoder::encode($counter, $glyphs, $base);

			// Check if slug is free
			$stmt = $db->prepare("SELECT custom_url, redir_type FROM {$prefix}urls WHERE BINARY custom_url = BINARY :slug AND custom_url = :slug");
			$stmt->execute(array('slug'=>$slug));
			$row = $stmt->fetch(PDO::FETCH_ASSOC);
			if( ! $row ) //okay to insert
			{
				$high = $counter;
				break; // found a suitable URL
			}
			else
			{
				$low = $counter;
				$counter += ceil(pow(++$seek_count,
					($row['redir_type'] == 'custom'
						? $custom_seek_pow
						: $auto_seek_pow
					)
				));
				if(LOG_MODE) bc_log('Slug '.$slug.' already in use; its redir_type is '.$row['redir_type']
					." - ".'Incremented counter from '.$low.' to '.$counter);
				$slug = NULL;
				continue;
			}

		}

		// Binary Search
		if(LOG_MODE) bc_log("Before binary search: low: $low; high: $high; slug: $slug");
		// Note: Low is always "known bad" and high is always "known good"
		$high = (string)$high;
		$low = (string)$low;
		while($low != $high)
		{
			if($high == bcadd((string)$low,'1'))
			{
				$counter = $high;
				$slug = BaseIntEncoder::encode($counter, $glyphs, $base);
				if(LOG_MODE) bc_log('Binary search decided to use '.$slug.' (counter '.$counter.") because high == low+1");
				break;
			}

			$counter = bcadd($low, bcmul(bcsub($high, $low), '0.5', 0)); // at least +1
			$slug = BaseIntEncoder::encode($counter, $glyphs, $base);
			$stmt = $db->prepare("SELECT custom_url, redir_type FROM {$prefix}urls WHERE  custom_url = :slug AND BINARY custom_url = BINARY :slug");
			$stmt->execute(array('slug'=>$slug));
			$row = $stmt->fetch(PDO::FETCH_ASSOC);
			if( ! $row ) // empty spot in the DB!
			{
				$high = $counter;
				if(LOG_MODE) bc_log($slug.' was available (counter: '.$counter.')');

			}
			else
			{
				$low = $counter;
				if(LOG_MODE) bc_log($slug.' was occupied (counter: '.$counter.')');
			}

		}

		$total_attempts_remaining += 50;
		$validated = true;
		// (Carefully, loopingly) Insert!
		while ($slug !== false){
			// Never just try forever
			if($total_attempts_remaining-- < 1) {
				bc_log('Total attempts maxed out in insert loop');
				$error = 'Tried too many times';
				include('pages/error.php');
				exit;
			}

			if( ! $validated){
				$stmt = $db->prepare("SELECT custom_url, redir_type FROM {$prefix}urls WHERE  custom_url = :slug AND BINARY custom_url = BINARY :slug");
				$stmt->execute(array('slug'=>$slug));
				$row = $stmt->fetch(PDO::FETCH_ASSOC);
				if($row)
				{
					$counter = bcadd($counter, '1');
					$slug = BaseIntEncoder::encode($counter, $glyphs, $base);
					continue;
				}
			}

			if(USE_BANNED_WORD_LIST){
				$banned_pos = bcurls_find_banned_word($slug);
				if($banned_pos !== FALSE) {
					if($banned_pos > 0) {
						// If slug is e.g. BANNEDa
						// we want to increment counter by (10 - a) in base $base
						// to make the slug BANNEE0
						$rollover = bcpow((string)$base, (string)$banned_pos);
						bc_log('Rollover calculated: '.$rollover);
						// and computure that a(base $base) = 11(base 10)
						$already_in = BaseIntEncoder::decode(substr($slug, 0-$banned_pos),
							$glyphs, $base);
						bc_log('Already_in calculated: '.$already_in.' based on "'.substr($slug, 0-$banned_pos).'"');
						// so (10 in base $base) in base 10 - 11 in base 10
						$diff = bcsub($rollover,$already_in);
						$counter = bcadd($counter, $diff);
						if(LOG_MODE) bc_log('Counter += '.$diff.
							' for banned word,  is now '.$counter.' - slug '.$slug);
					} else {
						$counter = bcadd($counter, '1');
						if(LOG_MODE) bc_log('Counter++ for banned word in slug '.$slug
							.', counter is now '.$counter);
					}
					$slug = BaseIntEncoder::encode($counter, $glyphs, $base);
					$validated = false;
					continue;
				}
			}
			if(ADDITIONAL_HOMOGLYPHS_TO_AVOID){
				$banned_pos = bcurls_find_banned_glyph($slug);
				if($banned_pos !== FALSE) {
					if($banned_pos > 0) {
						$rollover = bcpow((string)$base, (string)$banned_pos);
						bc_log('Rollover calculated: '.$rollover);
						$already_in = BaseIntEncoder::decode(substr($slug, 0-$banned_pos),
							$glyphs, $base);
						bc_log('Already_in calculated: '.$already_in.' based on "'.substr($slug, 0-$banned_pos).'"');
						$diff = bcsub($rollover,$already_in);
						$counter = bcadd($counter, $diff);
						if(LOG_MODE) bc_log('Counter += '.$diff.
							' for homoglyphs,  is now '.$counter.' - slug '.$slug);
					} else {
						$counter = bcadd($counter, '1');
						if(LOG_MODE) bc_log('Counter++ for homoglyph in slug '.$slug
							.', counter is now '.$counter);
					}
					$slug = BaseIntEncoder::encode($counter, $glyphs, $base);
					$validated = false;
					continue;
				}
			}

			// Actually insert
			try{
				$insert_result = bcurls_insert_url ($url, $checksum, $slug, $redir_type);
				if($insert_result !== true) {
					bc_log('Insertion result (not true)'.(string)$insert_result);
					$counter = bcadd($counter, '1');
					$slug = BaseIntEncoder::encode($counter, $glyphs, $base);
					$validated = false;
					continue;
				}
			} catch(Exception $e){
				bc_log('Exception inserting or incrementing counter.'.$e);
				$error = $e;
				include('pages/error.php');
				exit;
			}
			bc_log('About to increment counter');
			// Update counter
			try{
				// Update counter
				// Note it would be great if this was a strictly incremental
				// and atomic operation: "If your current base10 is smaller
				// than mine, change it to mine, database!"
				// This would deal with simultaneous inserts.
				$counter_update_sql = "UPDATE {$prefix}autoslug
					SET base10 = :base10
					WHERE method = :method LIMIT 1";
				$ctr_up = $db->prepare($counter_update_sql);
				$ctr_up_res = $ctr_up->execute(array(
					'method' => AUTO_SLUG_METHOD,
					'base10' => bcadd((string)$counter,'1'
				)));
				if(! $ctr_up_res) {
					$error = 'Could not update the autoslug index (this will hurt insertion performance.) '
						.$ctr_up->errorCode().': '.$ctr_up->errorInfo();
					bc_log('Counter increment error. '.$error);
				}
			}
			catch (Exception $e2) {
				$error = (string) $e2;
				bc_log('Could not update counter. '.$e2);
			}

			break;
		}

		if(LOG_MODE) bc_log('$total_attempts_remaining after finish: '.$total_attempts_remaining);
	}
	else
	{	// This is already in the DB, don't provide a new one
		$slug = $existing_slug;
	}

	$new_url = BCURLS_URL.$slug;

	if (isset($_GET['tweet']))
	{
		$_GET['redirect'] = 'http://twitter.com/?status=%l';
	}
	if (isset($_GET['redirect']))
	{
		header('Location:'.str_replace('%l', urlencode($new_url), $_GET['redirect']));
		exit();
	}
	if (isset($_GET['api']))
	{
		echo $new_url;
		exit();
	}

	include('pages/done.php');
}
else if(isset($_GET['stats']))  // Display stats
{
	$top_urls = stats_top_urls($db);
	$top_referers = stats_top_referers($db);
	include('pages/stats.php');
}
elseif(isset($_GET['mark_gone']) && isset($_GET['slug']) && strlen(trim($_GET['slug'])))
{ // Mark a redirection as GONE
	// TODO
}
else
{
	include('pages/add.php');
}


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>Hospital Santa Fé</title>

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

  <link href="css/modern-business.css" rel="stylesheet">
  <link rel="stylesheet" href="css/animate.min.css" type="text/css">

  <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

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

              </button>
              Inicio

                  Registro

                  A continuación ingrese su información para registrarlo al sistema.

                <form name="loginform" id="loginform" action="" method="POST">

                   Nombre(s)

                     <input type="text" name="nombres" id="nombres" class="input" value="" size="20" />

                     Apellidos

                       <input type="text" name="apellidos" id="apellidos" class="input" value="" size="20" />

                       Cédula

                         <input type="text" name="cedula" id="cedula" class="input" value="" size="20" />

                         Entidad EPS

                           <input type="text" name="eps" id="eps" class="input" value="" size="20" />

                           No. Contrato

                             <input type="text" name="numEps" id="numEps" class="input" value="" size="20" />

                             Contraseña

                               <input type="password" name="password" id="password" class="input" value="" size="20" />

                               Repetir Contraseña

                                 <input type="password" name="password2" id="password2" class="input" value="" size="20" />

                                Ver Horarios Disponibles

                             </form>

Fundación Santa Fe de Bogotá Carrera 7 No. 117 – 15. Tel: (571) 6030303 / Fax (571) 6575714 / A.A. 220246 Bogotá D.C. Colombia Suramérica / Email: info@fsfb.org.co

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <title>Add Road Coordianate</title>
  <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
  <meta charset="utf-8">

        INFORMATION

        ID Jalan :

        <input type="text" id="namajalan">

        TOOLS

          <input type="button" value = "Delete Last Marker"readonly onclick="deleteLast()">
          <input type="button" value = "Print Coordinate"readonly onclick="printCoordinate()">


text:
package ru.tasp.tools.xmpp;

import org.jivesoftware.smack.AbstractConnectionClosedListener;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.SASLAuthentication;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.StanzaListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.filter.MessageTypeFilter;
import org.jivesoftware.smack.filter.StanzaFilter;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.roster.Roster;
import org.jivesoftware.smack.tcp.XMPPTCPConnection;
import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration;
import org.jivesoftware.smackx.offline.OfflineMessageManager;
import org.jxmpp.jid.impl.JidCreate;
import org.jxmpp.stringprep.XmppStringprepException;

import java.io.IOException;
import java.util.Calendar;
import java.util.Comparator;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.PriorityBlockingQueue;
import java.util.concurrent.TimeUnit;

import ru.tasp.tools.Threads;
import ru.tasp.tools.bus.Bus;
import ru.tasp.tools.bus.Subscribe;
import ru.tasp.tools.logger.L;
import ru.tasp.tools.network.Network;
import ru.tasp.tools.network.NetworkChangeEvent;
import ru.tasp.tools.xmpp.accounts.XmppAccount;
import ru.tasp.tools.xmpp.accounts.XmppAccountManager;
import ru.tasp.tools.xmpp.events.XmppEventConnect;
import ru.tasp.tools.xmpp.events.XmppEventDisconnect;
import ru.tasp.tools.xmpp.receivers.XmppMessage;

/**
 * Created by the28awg on 26.10.15.
 */
public class XmppContext {

    private boolean connected = false;
    private boolean connecting = false;
    private boolean authenticated = false;
    private XmppAccount account;
    private XMPPTCPConnection connection;
    private PriorityBlockingQueue<XmppMessage> queue;
    private PriorityBlockingQueue<XmppMessage> sendQueue;

    public XmppContext(XmppAccount account) {
        this.account = account;
        this.queue = new PriorityBlockingQueue<XmppMessage>(10, new Comparator<XmppMessage>() {
            @Override
            public int compare(XmppMessage lhs, XmppMessage rhs) {
                return lhs.getCreationDate().compareTo(rhs.getCreationDate());
            }
        });
        this.sendQueue = new PriorityBlockingQueue<XmppMessage>(10, new Comparator<XmppMessage>() {
            @Override
            public int compare(XmppMessage lhs, XmppMessage rhs) {
                return lhs.getCreationDate().compareTo(rhs.getCreationDate());
            }
        });
    }

    public void connect() {
        Bus.get().register(this);
        account.setState(1);
        if (Network.isNetworkAvailable()) {
            checkConnect();
        }
    }

    public void disconnect() {
        Bus.get().unRegister(this);
        account.setState(0);
        checkDisconnect();
    }

    private void checkDisconnect() {
        if (isConnected()) {
            Threads.get().getExecutor().execute(new Disconnect(this));
            XmppAccountManager.get().getProvider().update(account);
            Bus.get().fire(new XmppEventDisconnect());
        }
    }

    @Subscribe(ui = true)
    private void network(NetworkChangeEvent networkChangeEvent) {
        if (Network.isNetworkAvailable()) {
            checkConnect();
        } else {
            checkDisconnect();
        }
    }
    public PriorityBlockingQueue<XmppMessage> getQueue() {
        return queue;
    }

    protected void send(XmppMessage message) {
        sendQueue.add(message);
        checkSend();
    }

    private void checkSend() {
        if (isAuthenticated()) {
            XmppMessage message;
            while ((message = sendQueue.poll()) != null) {
                Message stanza = new Message();
                stanza.setFrom(connection.getUser());
                try {
                    stanza.setTo(JidCreate.from(message.getFrom(), message.getAccount().getHost(), ""));
                } catch (XmppStringprepException e) {
                    e.printStackTrace();
                }
                stanza.setBody(message.getMessage());
                try {
                    connection.sendStanza(stanza);
                } catch (SmackException.NotConnectedException e) {
                    e.printStackTrace();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    private void checkConnect() {
        if (!isConnected()) {
            if (!connecting) {
                connecting = true;
                Threads.get().getExecutor().execute(new Threads.Task<XMPPTCPConnection>(new Connect(this)) {
                    @Override
                    public void done(XMPPTCPConnection result) {
                        connecting = false;
                        connection = result;
                        account.setLastConnectionDate(Calendar.getInstance().getTime());
                        XmppAccountManager.get().getProvider().update(account);
                        StanzaFilter filter = MessageTypeFilter.NORMAL_OR_CHAT_OR_HEADLINE;
                        StanzaListener stanzaListener = new StanzaListener() {
                            public void processPacket(Stanza packet) {
                                Message message = (Message) packet;
                                String from;
                                if (message.getFrom().hasLocalpart()) {
                                    from = message.getFrom().getLocalpartOrNull().toString();
                                } else {
                                    from = message.getFrom().toString();
                                }
                                String body = message.getBody();
                                if (!XmppTools.isEmpty(body)) {
                                    queue.add(new XmppMessage(account, from, body));
                                }
                            }
                        };
                        connection.addAsyncStanzaListener(stanzaListener, filter);
                        OfflineMessageManager manager = new OfflineMessageManager(connection);
                        try {
                            if (manager.supportsFlexibleRetrieval()) {
                                if (manager.getMessageCount() != 0) {
                                    for (Message message : manager.getMessages()) {
                                        String from;
                                        if (message.getFrom().hasLocalpart()) {
                                            from = message.getFrom().getLocalpartOrNull().toString();
                                        } else {
                                            from = message.getFrom().toString();
                                        }
                                        String body = message.getBody();
                                        if (!XmppTools.isEmpty(body)) {
                                            queue.add(new XmppMessage(account, from, body));
                                        }
                                    }
                                }
                            }
                        } catch (SmackException.NoResponseException e) {
                            e.printStackTrace();
                        } catch (XMPPException.XMPPErrorException e) {
                            e.printStackTrace();
                        } catch (SmackException.NotConnectedException e) {
                            e.printStackTrace();
                        } catch (InterruptedException e) {
                            e.printStackTrace();
                        } catch (NullPointerException e) {
                            e.printStackTrace();
                        }
                        checkSend();
                        Bus.get().fire(new XmppEventConnect());
                    }
                });
            }
        }
    }

    public XmppAccount getAccount() {
        return account;
    }

    public boolean isConnected() {
        return connected;
    }

    public void setConnected(boolean connected) {
        this.connected = connected;
    }

    public boolean isAuthenticated() {
        return authenticated;
    }

    public void setAuthenticated(boolean authenticated) {
        this.authenticated = authenticated;
    }

    protected XMPPTCPConnection getConnection() {
        return connection;
    }

    private class Connect implements Callable<XMPPTCPConnection> {
        private CountDownLatch latch = new CountDownLatch(1);

        private XmppContext context;

        public Connect(XmppContext context) {
            this.context = context;
        }

        @Override
        public XMPPTCPConnection call() throws Exception {
            XMPPTCPConnectionConfiguration configuration = XMPPTCPConnectionConfiguration.builder()
                    .setHost(context.getAccount().getHost())
                    .setUsernameAndPassword(context.getAccount().getUsername(), context.getAccount().getPassword())
                    .setServiceName(JidCreate.domainBareFrom(context.getAccount().getHost()))
                    .setResource(context.getAccount().getResource())
                    .setPort(context.getAccount().getPort())
                    .setSecurityMode(ConnectionConfiguration.SecurityMode.disabled)
                    .setDebuggerEnabled(L.isTrace())
                    .build();
            connection = new XMPPTCPConnection(configuration);
            connection.addConnectionListener(new AbstractConnectionClosedListener() {
                @Override
                public void connectionTerminated() {
                    context.setConnected(false);
                    context.setAuthenticated(false);
                }

                @Override
                public void connected(XMPPConnection x) {
                    context.setConnected(true);
                    try {
                        SASLAuthentication.unBlacklistSASLMechanism("PLAIN");
                        SASLAuthentication.blacklistSASLMechanism("DIGEST-MD5");
                        Roster.getInstanceFor(connection).setRosterLoadedAtLogin(false);
                        Roster.getInstanceFor(connection).setSubscriptionMode(Roster.SubscriptionMode.accept_all);
                        connection.login();
                    } catch (XMPPException e) {
                        e.printStackTrace();
                    } catch (SmackException e) {
                        e.printStackTrace();
                    } catch (IOException e) {
                        e.printStackTrace();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }

                @Override
                public void authenticated(XMPPConnection connection, boolean resumed) {
                    try {
                        connection.sendStanza(new Presence(Presence.Type.available, "Hello!", 0, Presence.Mode.available));
                    } catch (SmackException.NotConnectedException e) {
                        e.printStackTrace();
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    latch.countDown();
                    context.setAuthenticated(true);
                }
            });
            connection.connect();
            latch.await(1, TimeUnit.MINUTES);
            return connection;
        }
    }

    private class Disconnect implements Runnable {

        private XmppContext context;

        public Disconnect(XmppContext context) {
            this.context = context;
        }

        @Override
        public void run() {
            try {
                context.getConnection().disconnect(new Presence(Presence.Type.unavailable, "Bye!", 0, Presence.Mode.available));
            } catch (SmackException.NotConnectedException e) {
                e.printStackTrace();
            }
        }
    }
}


text:
The Luna Security Provider Framework causes an application to be automatically configured to work with a bound [Luna Security Service][].

    Detection Criterion
    Existence of a single bound Luna Security Provider service. The existence of an Luna Security service defined by the VCAP_SERVICES payload containing a service name, label or tag with luna as a substring.

    Tags
    <tt>luna-security-provider=<version></tt>

Tags are printed to standard output by the buildpack detect script

## User-Provided Service
When binding to the Luna Security Provider using a user-provided service, it must have name or tag with `luna` in it. The credential payload can contain the following entries:

| Name | Description
| ---- | -----------
| `client` | A hash containing client configuration
| `servers` | An array of hashes containing server configuration
| `groups` | An array of hashes containing group configuration

#### Client Configuration
| Name | Description
| ---- | -----------
| `certificate` | A PEM encoded client certificate
| `private-key` | A PEM encoded client private key

#### Server Configuration
| Name | Description
| ---- | -----------
| `certificate` | A PEM encoded server certificate
| `name` | A host name or address

#### Group Configuration
| Name | Description
| ---- | -----------
| `label` | The label for the group
| `members` | An array of group member serial numbers

### Example Credentials Payload
```
{
  "client": {
    "certificate": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
    "private-key": "-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"
  },
  "servers": [
    {
      "name": "test-host-1",
      "certificate": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
    },
    {
      "name": "test-host-2",
      "certificate": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"
    }
  ],
  "groups": [
    {
      "label": "test-group-1",
      "members": [
        "test-serial-number-1",
        "test-serial-number-2"
      ]
    },
    {
      "label": "test-group-2",
      "members": [
        "test-serial-number-3",
        "test-serial-number-4"
      ]
    }
  ]
}
```

### Creating Credential Payload
In order to create the credentials payload, you should collapse the JSON payload to a single line and set it like the following

```
$ cf create-user-provided-service luna -p '{"client":{"certificate":"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----","private-key":"-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVATE KEY-----"},"servers":[{"name":"test-host-1","certificate":"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"},{"name":"test-host-2","certificate":"-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----"}],"groups":[{"label":"test-group-1","members":["test-serial-number-1","test-serial-number-2"]},{"label":"test-group-2","members":["test-serial-number-3","test-serial-number-4"]}]}'
```

## Configuration
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to [Configuration and Extension][].

The framework can be configured by modifying the [`config/luna_security_provider.yml`][] file in the buildpack. The framework uses the [`Repository` utility support][repositories] and so it supports the [version syntax][] defined there.

| Name | Description
| ---- | -----------
| `ha_logging_enabled` | Whether to enable HA logging for the Luna Security Provider.  Defaults to `true`.
| `logging_enabled` | Whether to enable the logging wrapper for the Luna Security Provider.  Defaults to `false`.
| `tcp_keep_alive_enabled` | Whether to enable the client TCP keep alive setting for the Luna Security Provider.  Defaults to `false`.
| `repository_root` | The URL of the Luna Security Provider repository index ([details][repositories]).
| `version` | Version of the Luna Security Provider to use.

### Additional Resources
The framework can also be configured by overlaying a set of resources on the default distribution.  To do this, add files to the `resources/luna_security_provider` directory in the buildpack fork.

[`config/luna_security_provider.yml`]: ../config/luna_security_provider.yml
[Luna Security Service]: http://www.safenet-inc.com/data-encryption/hardware-security-modules-hsms/
[Configuration and Extension]: ../README.md#configuration-and-extension
[repositories]: extending-repositories.md
[version syntax]: extending-repositories.md#version-syntax-and-ordering


text:
{% extends 'dashboard/index.html' %}
{% load staticfiles %}

{% block csslinks %}
    {{ block.super }}
    <link rel="stylesheet" href="{% static 'voting/style.css' %}">
{% endblock %}

{% block app-content %}
    <form method="POST" action="{% url 'voting:poll_specific:add_part' pk %}">
        {% csrf_token %}
        {{form.as_p}}
        <input type="submit" class="btn btn-primary" value="Save and return to poll">
        <input type="submit" class="btn btn-success" formaction="{% url 'voting:poll_specific:add_another_part' pk %}" value="Save and add another part">
    </form>
{% endblock %}

{% block app-scripts %}
    {{ block.super }}
{% endblock %}


text:
// ------------------------------------------------------------------------------
//  Copyright (c) Microsoft Corporation.
//  All Rights Reserved.
//  Licensed under the MIT License.
//  See License in the project root for license information.
// ------------------------------------------------------------------------------

namespace Microsoft.Groove.Api.DataContract
{
    using System;
    using System.Collections.Generic;
    using System.Runtime.Serialization;

    [DataContract(Namespace = Constants.Xmlns)]
    public class Track : Content
    {
        // These items are available when this is the main element of the query or if an extra details parameter has been specified for that sub-element
        [DataMember(EmitDefaultValue = false)]
        public DateTime? ReleaseDate { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public TimeSpan? Duration { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public int? TrackNumber { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public bool? IsExplicit { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public GenreList Genres { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public GenreList Subgenres { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public RightList Rights { get; set; }

        [DataMember(EmitDefaultValue = false)]
        public string Subtitle { get; set; }

        /// <summary>
        /// Possible values are:
        ///     - audio/mp3
        ///     - audio/aac
        ///     - audio/wma
        ///     - audio/mp4
        /// </summary>
        [DataMember(EmitDefaultValue = false)]
        public string ContentType { get; set; }

        // This sub-element is null when this Track is queried as a sub-element of an album (to avoid looping), populated with just the minimal stuff by default when this Track is the main element, and extra details can obtained with a details parameter
        [DataMember(EmitDefaultValue = false)]
        public Album Album { get; set; }

        // This sub-element populated with just the minimal stuff by default when this Track is the main element, and extra details can obtained with a details parameter
        [DataMember(EmitDefaultValue = false)]
        public List<Contributor> Artists { get; set; }
    }
}


text:
  Val-de-Vière est
       un village
       situé dans le département de Marne en Champagne-Ardenne. Elle totalisait 122 habitants en 2008.

Le nombre d'habitations, à Val-de-Vière, était réparti en 2011 en un appartements et 62 maisons soit
 un marché relativement équilibré.

Si vous envisagez de emmenager à Val-de-Vière, vous pourrez aisément trouver une maison à acheter.

À proximité de Val-de-Vière sont positionnées géographiquement les communes de
Vavray-le-Petit située à 3 km, 64 habitants,
Le Buisson située à 6 km, 94 habitants,
Vavray-le-Grand à 4 km, 188 habitants,
Heiltz-l'Évêque localisée à 4 km, 272 habitants,
Vanault-les-Dames à 2 km, 349 habitants,
Bassu localisée à 4 km, 128 habitants,
 entre autres. De plus, Val-de-Vière est située à seulement 25 km de Saint-Dizier.

La commune offre quelques  équipements, elle dispose, entre autres, de un terrain de sport.


text:
/**
 * Demonstrates the use of an assignment statement to change the
 * value stored in a variable.
 *
 * @author Java Foundations
 */
public class Geometry
{
	/**
	 * Prints the number of sides of several geometric shapes.
	 */
	public static void main(String[] args)
	{
		int sides = 7;  // declaration with initialization
		System.out.println("A heptagon has " + sides + " sides.");

		sides = 10;  // assignment statement
		System.out.println("A decagon has " + sides + " sides.");

		sides = 12;
		System.out.println("A dodecagon has " + sides + " sides.");
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.thinkbiganalytics.kylo.plugins</groupId>
    <artifactId>kylo-plugins</artifactId>
    <version>0.9.0-SNAPSHOT</version>
  </parent>
  <properties>
    <plugin.license.parentRelative>../../</plugin.license.parentRelative>
  </properties>
  <artifactId>kylo-ui-sqoop-table-data-processor-template</artifactId>

  <dependencies>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
    </dependency>

    <!-- Kylo -->
    <dependency>
      <groupId>com.thinkbiganalytics.kylo</groupId>
      <artifactId>kylo-ui-api</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <configuration>
          <roots>
            <root>src/main/java</root>
            <root>src/test</root>
          </roots>
          <excludes>
            <exclude>*.js</exclude>
            <exclued>*.html</exclued>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>first</id>
            <goals>
              <goal>update-file-header</goal>
            </goals>
            <phase>process-sources</phase>
            <configuration>
              <roots>
                <root>src/main/java</root>
                <root>src/test/java</root>
              </roots>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>
</project>


text:
package com.peterphi.std.guice.liquibase.hibernate;

import com.google.inject.Inject;
import com.peterphi.std.guice.hibernate.dao.HibernateDao;
import com.peterphi.std.guice.testing.GuiceUnit;
import com.peterphi.std.guice.testing.com.peterphi.std.guice.testing.annotations.GuiceConfig;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;

@RunWith(GuiceUnit.class)
@GuiceConfig(config = {"liquibase-hibernate-tests-in-memory-hsqldb.properties"}, classPackages = SomeEntity.class)
public class LiquibaseCoreTest
{
	@Inject
	HibernateDao<SomeEntity, Long> dao;

	@Test
	public void testThatLiquibaseMigrationInsertedTestData()
	{
		assertEquals("Initial data insert should have succeeded", 1, dao.getAll().size());
		assertEquals("Initial data insert name field", "Example Object", dao.getById(1L).name);
	}
}


text:
package com.groupon.seleniumgridextras.utilities;

import com.groupon.seleniumgridextras.SeleniumGridExtras;

import java.io.IOException;
import java.io.InputStream;

public class ResourceRetriever {

  public String getAsString(String resource) throws IOException {
    InputStream in = SeleniumGridExtras.class.getResourceAsStream(resource);
    return StreamUtility.inputStreamToString(in);
  }

}


text:
<resources>
    <dimen name="four_dp">4dp</dimen>
    <dimen name="eight_dp">8dp</dimen>
    <dimen name="sixteen_dp">16dp</dimen>
    <dimen name="twenty_dp">20dp</dimen>
    <dimen name="twenty_four_dp">24dp</dimen>
    <dimen name="thirty_two_dp">32dp</dimen>

    <dimen name="text_size_headline">24sp</dimen>
    <dimen name="text_size_title">20sp</dimen>
    <dimen name="text_size_body">14sp</dimen>
    <dimen name="text_size_caption">12sp</dimen>
</resources>


text:
namespace Snippets5.Headers.Writers
{
    using System;
    using System.Collections.Generic;
    using System.Threading;
    using NServiceBus;
    using NServiceBus.Config;
    using NServiceBus.Config.ConfigurationSource;
    using NServiceBus.MessageMutator;
    using NUnit.Framework;
    using Operations.Msmq;

    [TestFixture]
    public class HeaderWriterPublish
    {
        public static ManualResetEvent ManualResetEvent = new ManualResetEvent(false);

        public static string EndpointName = "HeaderWriterPublishV5";

        [SetUp]
        [TearDown]
        public void Setup()
        {
            QueueDeletion.DeleteQueuesForEndpoint(EndpointName);
        }

        [Test]
        public void Write()
        {
            BusConfiguration config = new BusConfiguration();
            config.EndpointName(EndpointName);
            IEnumerable<Type> typesToScan = TypeScanner.NestedTypes<HeaderWriterPublish>(typeof(ConfigErrorQueue));
            config.TypesToScan(typesToScan);
            config.EnableInstallers();
            config.UsePersistence<InMemoryPersistence>();
            config.RegisterComponents(c => c.ConfigureComponent<Mutator>(DependencyLifecycle.InstancePerCall));
            using (IBus bus = Bus.Create(config).Start())
            {
                //give time for the subscription to happen
                Thread.Sleep(3000);
                bus.Publish(new MessageToPublish());
                ManualResetEvent.WaitOne();
            }
        }

        class MessageToPublish : IEvent
        {
        }

        class MessageHandler : IHandleMessages<MessageToPublish>
        {
            public void Handle(MessageToPublish message)
            {
            }
        }

        class ConfigUnicastBus : IProvideConfiguration<UnicastBusConfig>
        {
            public UnicastBusConfig GetConfiguration()
            {
                UnicastBusConfig unicastBusConfig = new UnicastBusConfig();
                unicastBusConfig.MessageEndpointMappings.Add(new MessageEndpointMapping
                {
                    AssemblyName = GetType().Assembly.GetName().Name,
                    Endpoint = EndpointName + "@" + Environment.MachineName
                });
                return unicastBusConfig;
            }
        }

        class Mutator : IMutateIncomingTransportMessages
        {
            public void MutateIncoming(TransportMessage transportMessage)
            {
                string headerText = HeaderWriter.ToFriendlyString<HeaderWriterPublish>(transportMessage.Headers);
                SnippetLogger.Write(headerText, version: "All");
                ManualResetEvent.Set();
            }
        }
    }
}


text:
/**
 *
 */

package org.opensaml.saml2.metadata.validator;

import org.opensaml.saml2.metadata.EntitiesDescriptor;
import org.opensaml.xml.validation.ValidationException;
import org.opensaml.xml.validation.Validator;

/**
 * Checks {@link org.opensaml.saml2.metadata.EntitiesDescriptor} for Schema compliance.
 */
public class EntitiesDescriptorSchemaValidator implements Validator<EntitiesDescriptor> {

    /** Constructor */
    public EntitiesDescriptorSchemaValidator() {

    }

    /** {@inheritDoc} */
    public void validate(EntitiesDescriptor entitiesDescriptor) throws ValidationException {
        validateEntityDescriptors(entitiesDescriptor);
    }

    /**
     * Checks that at least one EntitiesDescriptor or EntityDescriptor is present.
     *
     * @param entitiesDescriptor
     * @throws ValidationException
     */
    protected void validateEntityDescriptors(EntitiesDescriptor entitiesDescriptor) throws ValidationException {
        if ((entitiesDescriptor.getEntitiesDescriptors() == null || entitiesDescriptor.getEntitiesDescriptors().size() < 1)
                && (entitiesDescriptor.getEntityDescriptors() == null || entitiesDescriptor.getEntityDescriptors()
                        .size() < 1)) {
            throw new ValidationException("Must have one or more EntitiesDescriptor or EntityDescriptor.");
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>

<ScrollView android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:scrollbars="none">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <!--个人信息-->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="160dp"
            android:background="@color/colorPrimary">

            <!--消息提醒-->
            <RelativeLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_marginRight="15dp"
                android:layout_marginTop="15dp">

                <ImageView
                    android:id="@+id/iv_msg"
                    android:layout_width="24dp"
                    android:layout_height="24dp"
                    android:src="@color/color3"/>

                <com.example.chenhuamou.meicai.util.RoundImageView
                    android:id="@+id/iv_redpoint"
                    android:layout_width="10dp"
                    android:layout_height="10dp"
                    android:background="@color/colorRed"/>

            </RelativeLayout>

            <!--用户头像-->
            <com.example.chenhuamou.meicai.util.RoundImageView
                android:id="@+id/avatar"
                android:layout_width="90dp"
                android:layout_height="90dp"
                android:layout_marginLeft="15dp"
                android:layout_marginBottom="20dp"
                android:layout_alignParentBottom="true"
                android:src="@drawable/bitmap"/>

            <!--用户名称-->
            <TextView
                android:id="@+id/tv_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/colorWhite"
                android:text="用户名称"
                android:layout_toRightOf="@+id/avatar"
                android:layout_alignTop="@+id/avatar"
                android:layout_marginLeft="10dp"
                android:layout_marginTop="20dp"/>

            <!--用户级别-->
            <TextView
                android:id="@+id/tv_level"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/colorWhite"
                android:text="普通会员"
                android:layout_below="@+id/tv_name"
                android:layout_alignLeft="@+id/tv_name"
                android:layout_marginTop="15dp"/>

            <TextView
                android:id="@+id/tv_account_manager"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="@color/colorWhite"
                android:text="账户管理"
                android:layout_toLeftOf="@+id/iv_right_arrow"
                android:layout_marginRight="10dp"
                android:layout_alignBottom="@+id/iv_right_arrow"/>

            <!--向右的箭头-->
            <ImageView
                android:id="@+id/iv_right_arrow"
                android:src="@mipmap/right_arrow"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentRight="true"
                android:layout_marginBottom="20dp"
                android:layout_marginRight="15dp"/>

        </RelativeLayout>

        <!--我的钱包-->
        <View
            android:layout_width="wrap_content"
            android:layout_height="8dp"
            android:background="@color/backgroundColor" />
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:gravity="center_vertical">

            <TextView
                style="@style/mine_section_textView_style"
                android:text="我的钱包" />
        </RelativeLayout>
        <!--分割线-->
        <View
            android:layout_width="wrap_content"
            android:layout_height="1dp"
            android:background="@color/colorSepaLine"
            />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="90dp"
            android:orientation="horizontal"
            android:gravity="center">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:gravity="center"
                android:layout_weight="1">

                <TextView
                    android:id="@+id/tv_banlance"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/colorRed"
                    android:text="0"/>

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:textColor="@color/color9"
                    android:text="钱包余额"/>

            </LinearLayout>

            <!--分割线-->
            <View
                android:layout_width="1dp"
                android:layout_height="75dp"
                android:background="@color/colorSepaLine"/>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:gravity="center"
                android:layout_weight="1">

                <TextView
                    android:id="@+id/tv_coupon"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/colorRed"
                    android:text="0"/>

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:textColor="@color/color9"
                    android:text="优惠券"/>

            </LinearLayout>

            <!--分割线-->
            <View
                android:layout_width="1dp"
                android:layout_height="75dp"
                android:background="@color/colorSepaLine"/>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:orientation="vertical"
                android:gravity="center"
                android:layout_weight="1">

                <TextView
                    android:id="@+id/tv_online"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/colorRed"
                    android:text="在线预付"
                    android:textSize="20sp"/>

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:textColor="@color/color9"
                    android:text="预付余额"/>

            </LinearLayout>

        </LinearLayout>

        <!--我的订单-->
        <View
            android:layout_width="wrap_content"
            android:layout_height="8dp"
            android:background="@color/backgroundColor"
            android:layout_alignParentTop="true"/>
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:gravity="center_vertical">

            <TextView
                style="@style/mine_section_textView_style"
                android:text="我的订单" />

            <Button
                style="@style/mine_section_button_style"
                android:text="查看全部订单" />
        </RelativeLayout>
        <View
            android:layout_width="wrap_content"
            android:layout_height="1dp"
            android:background="@color/colorSepaLine" />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="90dp"
            android:orientation="horizontal"
            android:gravity="center">

            <!--待付款-->
            <Button
                android:id="@+id/btn_pending_pay"
                style="@style/mine_help_center_style"
                android:text="待付款"
                android:drawableTop="@mipmap/bt_setting"
                />

            <!--待发货-->
            <Button
                android:id="@+id/btn_pending_send"
                style="@style/mine_help_center_style"
                android:text="待发货"
                android:drawableTop="@mipmap/bt_setting" />

            <!--待收货-->
            <Button
                android:id="@+id/btn_pending_receive"
                style="@style/mine_help_center_style"
                android:text="待收货"
                android:drawableTop="@mipmap/bt_setting" />

        </LinearLayout>

        <!--常用工具-->
        <View
            android:layout_width="wrap_content"
            android:layout_height="8dp"
            android:background="@color/backgroundColor"
            android:layout_alignParentTop="true"/>
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:gravity="center_vertical">

            <TextView
                style="@style/mine_section_textView_style"
                android:text="常用工具" />

        </RelativeLayout>
        <View
            android:layout_width="wrap_content"
            android:layout_height="1dp"
            android:background="@color/colorSepaLine" />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="90dp"
            android:orientation="horizontal"
            android:gravity="center">

            <!--常见问题-->
            <Button
                style="@style/mine_help_center_style"
                android:text="我的钥匙"
                android:drawableTop="@mipmap/bt_setting" />
            <View
                android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@color/colorSepaLine"/>

            <!--服务中心-->
            <Button
                style="@style/mine_help_center_style"
                android:text="常用清单"
                android:drawableTop="@mipmap/bt_setting" />
            <View
                android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@color/colorSepaLine"/>

            <!--在线客服-->
            <Button
                style="@style/mine_help_center_style"
                android:text="退押金"
                android:drawableTop="@mipmap/bt_setting" />
            <View
                android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@color/colorSepaLine"/>

            <!--客服电话-->
            <Button
                style="@style/mine_help_center_style"
                android:text="新品需求"
                android:drawableTop="@mipmap/bt_setting" />

        </LinearLayout>
        <!--分割线-->
        <View
            android:layout_width="wrap_content"
            android:layout_height="1dp"
            android:background="@color/colorSepaLine"
            />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="90dp"
            android:orientation="horizontal"
            android:gravity="center" >

            <!--常见问题-->
            <Button
                style="@style/mine_help_center_style"
                android:text="我的发票"
                android:drawableTop="@mipmap/bt_setting" />
            <View
                android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@color/colorSepaLine"/>

            <!--服务中心-->
            <Button
                style="@style/mine_help_center_style"
                android:text="经营分析"
                android:drawableTop="@mipmap/bt_setting" />
            <View
                android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@color/colorSepaLine"/>
            <Button
                style="@style/mine_help_center_style" />
            <Button
                style="@style/mine_help_center_style" />

        </LinearLayout>

        <!--帮助中心-->
        <View
            android:layout_width="wrap_content"
            android:layout_height="8dp"
            android:background="@color/backgroundColor"
            android:layout_alignParentTop="true"/>
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:gravity="center_vertical">

            <TextView
                style="@style/mine_section_textView_style"
                android:text="帮助中心" />

            <Button
                style="@style/mine_section_button_style"
                android:text="进入客户服务中心 " />

        </RelativeLayout>
        <View
            android:layout_width="wrap_content"
            android:layout_height="1dp"
            android:background="@color/colorSepaLine" />
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="90dp"
            android:orientation="horizontal"
            android:gravity="center">

            <!--常见问题-->
            <Button
                style="@style/mine_help_center_style"
                android:text="常见问题"
                android:drawableTop="@mipmap/bt_setting" />
            <View
                android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@color/colorSepaLine"/>

            <!--服务中心-->
            <Button
                style="@style/mine_help_center_style"
                android:text="服务中心"
                android:drawableTop="@mipmap/bt_setting" />
            <View
                android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@color/colorSepaLine"/>

            <!--在线客服-->
            <Button
                style="@style/mine_help_center_style"
                android:text="在线客服"
                android:drawableTop="@mipmap/bt_setting" />
            <View
                android:layout_width="1dp"
                android:layout_height="match_parent"
                android:background="@color/colorSepaLine"/>

            <!--客服电话-->
            <Button
                style="@style/mine_help_center_style"
                android:text="客服电话"
                android:drawableTop="@mipmap/bt_setting" />

        </LinearLayout>
        <View
            android:layout_width="wrap_content"
            android:layout_height="8dp"
            android:background="@color/backgroundColor"
            android:layout_alignParentTop="true"/>

    </LinearLayout>

</ScrollView>


text:
#ifndef __DRIVER_MPC_H
#define __DRIVER_MPC_H

#include "Driver_Common.h"

/* API version */
#define ARM_MPC_API_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(1,0)

/* Error code returned by the driver functions */
#define ARM_MPC_ERR_NOT_INIT      (ARM_DRIVER_ERROR_SPECIFIC - 1)  ///< MPC not initialized */
#define ARM_MPC_ERR_NOT_IN_RANGE  (ARM_DRIVER_ERROR_SPECIFIC - 2)  ///< Address does not belong to a range controlled by the MPC */
#define ARM_MPC_ERR_NOT_ALIGNED   (ARM_DRIVER_ERROR_SPECIFIC - 3)  ///< Address is not aligned on the block size of this MPC */
#define ARM_MPC_ERR_INVALID_RANGE (ARM_DRIVER_ERROR_SPECIFIC - 4)  ///< The given address range to configure is invalid
#define ARM_MPC_ERR_RANGE_SEC_ATTR_NON_COMPATIBLE (ARM_DRIVER_ERROR_SPECIFIC - 4)  ///< The given range cannot be accessed with the wanted security attributes */
#define ARM_MPC_ERR_UNSPECIFIED   (ARM_DRIVER_ERROR_SPECIFIC - 5)  ///< Unspecified error */

/* Security attribute used in various place of the API */
typedef enum _ARM_MPC_SEC_ATTR {
    ARM_MPC_ATTR_SECURE,     ///< Secure attribute
    ARM_MPC_ATTR_NONSECURE,  ///< Non-secure attribute
    /* Used when getting the configuration of a memory range and some blocks are
     * secure whereas some other are non secure */
    ARM_MPC_ATTR_MIXED,      ///< Mixed attribute
} ARM_MPC_SEC_ATTR;

/* Function documentation */
/**
  \fn          ARM_DRIVER_VERSION ARM_MPC_GetVersion (void)
  \brief       Get driver version.
  \return      \ref ARM_DRIVER_VERSION

  \fn          int32_t ARM_MPC_Initialize (void)
  \brief       Initialize MPC Interface.
  \return      Returns error code.

  \fn          int32_t ARM_MPC_Uninitialize (void)
  \brief       De-initialize MPC Interface. The controlled memory region
               should not be accessed after a call to this function, as
               it is allowed to configure everything to be secure (to
               prevent information leak for example).
  \return      Returns error code.

  \fn          int32_t ARM_MPC_GetBlockSize (uint32_t* blk_size)
  \brief       Get the block size of the MPC. All regions must be aligned
               on this block size (base address and limit+1 address).
  \param[out]  blk_size:  The block size in bytes.
  \return      Returns error code.

  \fn          int32_t ARM_MPC_GetCtrlConfig (uint32_t* ctrl_val)
  \brief       Get some information on how the MPC IP is configured.
  \param[out]  ctrl_val:  MPC control configuration
  \return      Returns error code.

  \fn          int32_t ARM_MPC_SetCtrlConfig (uint32_t ctrl)
  \brief       Set new control configuration for the MPC IP.
  \param[in]   ctrl:  New control configuration.
  \return      Returns error code.

  \fn          int32_t ARM_MPC_ConfigRegion (uintptr_t base,
                                             uintptr_t limit,
                                             ARM_MPC_SEC_ATTR attr)
  \brief       Configure a memory region (base and limit included).
               Both base and limit addresses must belong to the same
               memory range, and this range must be managed by this MPC.
               Also, some ranges are only allowed to be configured as
               secure/non-secure, because of hardware requirements
               (security aliases), and only a relevant security attribute
               is therefore allowed for such ranges.
  \param[in]   base:  Base address of the region to configure. This
                      bound is included in the configured region.
                      This must be aligned on the block size of this MPC.
  \param[in]   limit: Limit address of the region to configure. This
                      bound is included in the configured region.
                      Limit+1 must be aligned on the block size of this MPC.
  \param[in]   attr:  Wanted security attribute of the region.
  \return      Returns error code.

  \fn          int32_t ARM_MPC_GetRegionConfig (uintptr_t base,
                                                uintptr_t limit,
                                                ARM_MPC_SEC_ATTR *attr)
  \brief       Gets a memory region (base and limit included).
  \param[in]   base:  Base address of the region to poll. This
                      bound is included. It does not need to be aligned
                      in any way.
  \param[in]   limit: Limit address of the region to poll. This
                      bound is included. (limit+1) does not need to be aligned
                      in any way.
  \param[out]  attr:  Security attribute of the region.
                      If the region has mixed secure/non-secure,
                      a special value is returned (\ref ARM_MPC_SEC_ATTR).

               In case base and limit+1 addresses are not aligned on
               the block size, the enclosing region with base and
               limit+1 aligned on block size will be queried.
               In case of early termination of the function (error), the
               security attribute will be set to ARM_MPC_ATTR_MIXED.
  \return      Returns error code.

  \fn          int32_t ARM_MPC_EnableInterrupt (void)
  \brief       Enable MPC interrupt.
  \return      Returns error code.

  \fn          void ARM_MPC_DisableInterrupt (void)
  \brief       Disable MPC interrupt.

  \fn          void ARM_MPC_ClearInterrupt (void)
  \brief       Clear MPC interrupt.

  \fn          uint32_t ARM_MPC_InterruptState (void)
  \brief       MPC interrupt state.
  \return      Returns 1 if the interrupt is active, 0 otherwise.

  \fn          int32_t ARM_MPC_LockDown (void)
  \brief       Lock down the MPC configuration.
  \return      Returns error code.
*/

/**
 * \brief Access structure of the MPC Driver.
 */
typedef struct _ARM_DRIVER_MPC {
  ARM_DRIVER_VERSION (*GetVersion)       (void);                                                     ///< Pointer to \ref ARM_MPC_GetVersion    : Get driver version.
  int32_t            (*Initialize)       (void);                                                     ///< Pointer to \ref ARM_MPC_Initialize    : Initialize the MPC Interface.
  int32_t            (*Uninitialize)     (void);                                                     ///< Pointer to \ref ARM_MPC_Uninitialize  : De-initialize the MPC Interface.
  int32_t            (*GetBlockSize)     (uint32_t* blk_size);                                       ///< Pointer to \ref ARM_MPC_GetBlockSize  : Get MPC block size
  int32_t            (*GetCtrlConfig)    (uint32_t* ctrl_val);                                       ///< Pointer to \ref ARM_MPC_GetCtrlConfig : Get the MPC control configuration flags.
  int32_t            (*SetCtrlConfig)    (uint32_t ctrl);                                            ///< Pointer to \ref ARM_MPC_SetCtrlConfig : Set the MPC control configuration flags.
  int32_t            (*ConfigRegion)     (uintptr_t base, uintptr_t limit, ARM_MPC_SEC_ATTR attr);   ///< Pointer to \ref ARM_MPC_ConfigRegion  : Configure a region using the driver for the specific MPC.
  int32_t            (*GetRegionConfig)  (uintptr_t base, uintptr_t limit, ARM_MPC_SEC_ATTR *attr);  ///< Pointer to \ref ARM_MPC_GetRegionConfig  : Get the configuration of a specific region on this MPC.
  int32_t            (*EnableInterrupt)  (void);                                                     ///< Pointer to \ref ARM_MPC_EnableInterrupt  : Enable MPC interrupt.
  void               (*DisableInterrupt) (void);                                                     ///< Pointer to \ref ARM_MPC_DisableInterrupt : Disable MPC interrupt.
  void               (*ClearInterrupt)   (void);                                                     ///< Pointer to \ref ARM_MPC_ClearInterrupt   : Clear MPC interrupt.
  uint32_t           (*InterruptState)   (void);                                                     ///< Pointer to \ref ARM_MPC_InterruptState   : MPC interrupt State.
  int32_t            (*LockDown)         (void);                                                     ///< Pointer to \ref ARM_MPC_LockDown         : Lock down the MPC configuration.
} const ARM_DRIVER_MPC;

#endif /* __DRIVER_MPC_H */


text:
using System;
using System.Collections.Generic;

namespace HashTable
{
    /// <summary>
    /// A key/value associative collection
    /// </summary>
    /// <typeparam name="TKey">The key type of the key/value pair</typeparam>
    /// <typeparam name="TValue">The value type of the key/value pair</typeparam>
    public class HashTable<TKey, TValue>
    {
        // If the array exceeds this fill percentage it will grow
        // In this example the fill factor is the total number of items
        // regardless of whether they are collisions or not.
        const double _fillFactor = 0.75;

        // the maximum number of items to store before growing.
        // This is just a cached value of the fill factor calculation
        int _maxItemsAtCurrentSize;

        // the number of items in the hash table
        int _count;

        // The array where the items are stored.
        HashTableArray<TKey, TValue> _array;

        /// <summary>
        /// Constructs a hash table with the default capacity
        /// </summary>
        public HashTable()
            : this(1000)
        {
        }

        /// <summary>
        /// Constructs a hash table with the specified capacity
        /// </summary>
        public HashTable(int initialCapacity)
        {
            if (initialCapacity < 1)
            {
                throw new ArgumentOutOfRangeException("initialCapacity");
            }

            _array = new HashTableArray<TKey, TValue>(initialCapacity);

            // when the count exceeds this value, the next Add will cause the
            // array to grow
            _maxItemsAtCurrentSize = (int) (initialCapacity*_fillFactor) + 1;
        }

        /// <summary>
        /// Adds the key/value pair to the hash table.  If the key already exists in the
        /// hash table an ArgumentException will be thrown
        /// </summary>
        /// <param name="key">The key of the item being added</param>
        /// <param name="value">The value of the item being added</param>
        public void Add(TKey key, TValue value)
        {
            // if we are at capacity, the array needs to grow
            if (_count >= _maxItemsAtCurrentSize)
            {
                // allocate a larger array
                HashTableArray<TKey, TValue> largerArray = new HashTableArray<TKey, TValue>(_array.Capacity*2);

                // and re-add each item to the new array
                foreach (HashTableNodePair<TKey, TValue> node in _array.Items)
                {
                    largerArray.Add(node.Key, node.Value);
                }

                // the larger array is now the hash table storage
                _array = largerArray;

                // update the new max items cached value
                _maxItemsAtCurrentSize = (int) (_array.Capacity*_fillFactor) + 1;
            }

            _array.Add(key, value);
            _count++;
        }

        /// <summary>
        /// Removes the item from the hash table whose key matches
        /// the specified key.
        /// </summary>
        /// <param name="key">The key of the item to remove</param>
        /// <returns>True if the item was removed, false otherwise.</returns>
        public bool Remove(TKey key)
        {
            bool removed = _array.Remove(key);
            if (removed)
            {
                _count--;
            }

            return removed;
        }

        /// <summary>
        /// Gets and sets the value with the specified key.  ArgumentException is
        /// thrown if the key does not already exist in the hash table.
        /// </summary>
        /// <param name="key">The key of the value to retrieve</param>
        /// <returns>The value associated with the specified key</returns>
        public TValue this[TKey key]
        {
            get
            {
                TValue value;
                if (!_array.TryGetValue(key, out value))
                {
                    throw new ArgumentException("key");
                }

                return value;
            }
            set { _array.Update(key, value); }
        }

        /// <summary>
        /// Finds and returns the value for the specified key.
        /// </summary>
        /// <param name="key">The key whose value is sought</param>
        /// <param name="value">The value associated with the specified key</param>
        /// <returns>True if the value was found, false otherwise</returns>
        public bool TryGetValue(TKey key, out TValue value)
        {
            return _array.TryGetValue(key, out value);
        }

        /// <summary>
        /// Returns a Boolean indicating if the hash table contains the specified key.
        /// </summary>
        /// <param name="key">The key whose existence is being tested</param>
        /// <returns>True if the value exists in the hash table, false otherwise.</returns>
        public bool ContainsKey(TKey key)
        {
            TValue value;
            return _array.TryGetValue(key, out value);
        }

        /// <summary>
        /// Returns a Boolean indicating if the hash table contains the specified value.
        /// </summary>
        /// <param name="value">The value whose existence is being tested</param>
        /// <returns>True if the value exists in the hash table, false otherwise.</returns>
        public bool ContainsValue(TValue value)
        {
            foreach (TValue foundValue in _array.Values)
            {
                if (value.Equals(foundValue))
                {
                    return true;
                }
            }

            return false;
        }

        /// <summary>
        /// Returns an enumerator for all of the keys in the hash table
        /// </summary>
        public IEnumerable<TKey> Keys
        {
            get
            {
                foreach (TKey key in _array.Keys)
                {
                    yield return key;
                }
            }
        }

        /// <summary>
        /// Returns an enumerator for all of the values in the hash table
        /// </summary>
        public IEnumerable<TValue> Values
        {
            get
            {
                foreach (TValue value in _array.Values)
                {
                    yield return value;
                }
            }
        }

        /// <summary>
        /// Removes all items from the hash table
        /// </summary>
        public void Clear()
        {
            _array.Clear();
            _count = 0;
        }

        /// <summary>
        /// The number of items currently in the hash table
        /// </summary>
        public int Count
        {
            get { return _count; }
        }
    }
}


text:
package com.jetbrains.python.debugger;

public class PyNumericContainerValueEvaluator extends PyFullValueEvaluator
{

	protected PyNumericContainerValueEvaluator(String linkText, PyFrameAccessor debugProcess, String expression)
	{
		super(linkText, debugProcess, expression);
	}

	@Override
	protected void showCustomPopup(PyFrameAccessor debugProcess, PyDebugValue debugValue)
	{
		debugProcess.showNumericContainer(debugValue);
	}

	@Override
	public boolean isShowValuePopup()
	{
		return false;
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2014 Andrew Reitz
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.andrewreitz.encryptedcamera"
          android:installLocation="auto">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    <application
        android:name="com.andrewreitz.encryptedcamera.EncryptedCameraApp"
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:theme="@style/AppTheme">
        <activity
            android:name=".ui.activity.SettingsActivity"
            android:label="@string/title_activity_settings"
            android:launchMode="singleInstance"
            android:theme="@style/Theme.Encryptedcamera">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.activity.CameraActivity"
            android:label="@string/title_activity_camera">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.activity.GalleryActivity"
            android:parentActivityName=".ui.activity.SettingsActivity"
            android:label="@string/photos"
            android:theme="@style/Theme.Encryptedcamera">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".ui.activity.SettingsActivity"/>
        </activity>
        <activity
            android:name=".ui.activity.AboutActivity"
            android:label="@string/app_name"
            android:theme="@style/Theme.Encryptedcamera"/>

        <service
            android:name="com.andrewreitz.encryptedcamera.service.EncryptionIntentService"
            android:exported="false">
        </service>
        <meta-data
            android:name="com.crashlytics.ApiKey"
            android:value="70c11ca0c2a7650c8d46912da5df388159dd6916"/>
    </application>
</manifest>


text:
package com.google.sitebricks.client.transport;

import com.google.inject.ImplementedBy;
import com.google.sitebricks.client.Transport;

/**
 * A plain text (UTF-8) implementation of Transport where input types are assumed
 * to be Strings.
 *
 * @author dhanji@google.com (Dhanji R. Prasanna)
 */
@ImplementedBy(JacksonJsonTransport.class)
public abstract class Json implements Transport {

  public String contentType() {
    return "application/json";
  }
}


text:
#ifdef HAVE_CONFIG_H
#include "../../../../ext_config.h"
#endif

#include <php.h>
#include "../../../../php_ext.h"
#include "../../../../ext.h"

#include <Zend/zend_operators.h>
#include <Zend/zend_exceptions.h>
#include <Zend/zend_interfaces.h>

#include "kernel/main.h"
#include "kernel/memory.h"
#include "kernel/fcall.h"
#include "kernel/operators.h"
#include "kernel/array.h"
#include "kernel/exception.h"
#include "Zend/zend_closures.h"
#include "kernel/object.h"
#include "kernel/time.h"
#include "ext/spl/spl_exceptions.h"

/**
 * Phalcon\Mvc\Collection\Behavior\Timestampable
 *
 * Allows to automatically update a model's attribute saving the
 * datetime when a record is created or updated
 */
ZEPHIR_INIT_CLASS(Phalcon_Mvc_Collection_Behavior_Timestampable) {

	ZEPHIR_REGISTER_CLASS_EX(Phalcon\\Mvc\\Collection\\Behavior, Timestampable, phalcon, mvc_collection_behavior_timestampable, phalcon_mvc_collection_behavior_ce, phalcon_mvc_collection_behavior_timestampable_method_entry, 0);

	return SUCCESS;

}

/**
 * Listens for notifications from the models manager
 */
PHP_METHOD(Phalcon_Mvc_Collection_Behavior_Timestampable, notify) {

	HashTable *_2$$12;
	HashPosition _1$$12;
	zephir_fcall_cache_entry *_4 = NULL;
	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *type_param = NULL, *model, *options = NULL, *timestamp = NULL, *singleField = NULL, *field = NULL, *generator = NULL, *format = NULL, *_0 = NULL, **_3$$12;
	zval *type = NULL;

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 2, 0, &type_param, &model);

	if (UNEXPECTED(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) {
		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC);
		RETURN_MM_NULL();
	}
	if (EXPECTED(Z_TYPE_P(type_param) == IS_STRING)) {
		zephir_get_strval(type, type_param);
	} else {
		ZEPHIR_INIT_VAR(type);
		ZVAL_EMPTY_STRING(type);
	}

	ZEPHIR_CALL_METHOD(&_0, this_ptr, "musttakeaction", NULL, 0, type);
	zephir_check_call_status();
	if (!ZEPHIR_IS_TRUE_IDENTICAL(_0)) {
		RETURN_MM_NULL();
	}
	ZEPHIR_CALL_METHOD(&options, this_ptr, "getoptions", NULL, 0, type);
	zephir_check_call_status();
	if (Z_TYPE_P(options) == IS_ARRAY) {
		ZEPHIR_OBS_VAR(field);
		if (!(zephir_array_isset_string_fetch(&field, options, SS("field"), 0 TSRMLS_CC))) {
			ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_collection_exception_ce, "The option 'field' is required", "phalcon/mvc/collection/behavior/timestampable.zep", 56);
			return;
		}
		ZEPHIR_INIT_VAR(timestamp);
		ZVAL_NULL(timestamp);
		ZEPHIR_OBS_VAR(format);
		if (zephir_array_isset_string_fetch(&format, options, SS("format"), 0 TSRMLS_CC)) {
			ZEPHIR_CALL_FUNCTION(&timestamp, "date", NULL, 311, format);
			zephir_check_call_status();
		} else {
			ZEPHIR_OBS_VAR(generator);
			if (zephir_array_isset_string_fetch(&generator, options, SS("generator"), 0 TSRMLS_CC)) {
				if (Z_TYPE_P(generator) == IS_OBJECT) {
					if (zephir_instance_of_ev(generator, zend_ce_closure TSRMLS_CC)) {
						ZEPHIR_INIT_NVAR(timestamp);
						ZEPHIR_CALL_USER_FUNC(timestamp, generator);
						zephir_check_call_status();
					}
				}
			}
		}
		if (Z_TYPE_P(timestamp) == IS_NULL) {
			ZEPHIR_INIT_NVAR(timestamp);
			zephir_time(timestamp);
		}
		if (Z_TYPE_P(field) == IS_ARRAY) {
			zephir_is_iterable(field, &_2$$12, &_1$$12, 0, 0, "phalcon/mvc/collection/behavior/timestampable.zep", 94);
			for (
			  ; zend_hash_get_current_data_ex(_2$$12, (void**) &_3$$12, &_1$$12) == SUCCESS
			  ; zend_hash_move_forward_ex(_2$$12, &_1$$12)
			) {
				ZEPHIR_GET_HVALUE(singleField, _3$$12);
				ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", &_4, 0, singleField, timestamp);
				zephir_check_call_status();
			}
		} else {
			ZEPHIR_CALL_METHOD(NULL, model, "writeattribute", NULL, 0, field, timestamp);
			zephir_check_call_status();
		}
	}
	ZEPHIR_MM_RESTORE();

}


text:
/**
 *
 */
package exercises.threads.synchronization;

/**
 * @author gongzhihui
 *
 */
public class SynchronizedEventGenerator extends IntGenerator {
	private int currentEventValue = 0;
	/* (non-Javadoc)
	 * @see exercises.threads.synchronization.IntGenerator#next()
	 */
	@Override
	public synchronized int next() {
		// TODO Auto-generated method stub
		this.currentEventValue++;
		Thread.yield();
		this.currentEventValue++;
		return this.currentEventValue;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		EventChecker.test(new SynchronizedEventGenerator());
	}

}