text:
#include "includes.h"
#include <winsock2.h>

#include "common.h"
#include "eloop.h"

struct eloop_sock {
	int sock;
	void *eloop_data;
	void *user_data;
	eloop_sock_handler handler;
	WSAEVENT event;
};

struct eloop_event {
	void *eloop_data;
	void *user_data;
	eloop_event_handler handler;
	HANDLE event;
};

struct eloop_timeout {
	struct os_time time;
	void *eloop_data;
	void *user_data;
	eloop_timeout_handler handler;
	struct eloop_timeout *next;
};

struct eloop_signal {
	int sig;
	void *user_data;
	eloop_signal_handler handler;
	int signaled;
};

struct eloop_data {
	int max_sock;
	size_t reader_count;
	struct eloop_sock *readers;

	size_t event_count;
	struct eloop_event *events;

	struct eloop_timeout *timeout;

	int signal_count;
	struct eloop_signal *signals;
	int signaled;
	int pending_terminate;

	int terminate;
	int reader_table_changed;

	struct eloop_signal term_signal;
	HANDLE term_event;

	HANDLE *handles;
	size_t num_handles;
};

static struct eloop_data eloop;

int eloop_init(void)
{
	os_memset(&eloop, 0, sizeof(eloop));
	eloop.num_handles = 1;
	eloop.handles = os_malloc(eloop.num_handles *
				  sizeof(eloop.handles[0]));
	if (eloop.handles == NULL)
		return -1;

	eloop.term_event = CreateEvent(NULL, FALSE, FALSE, NULL);
	if (eloop.term_event == NULL) {
		printf("CreateEvent() failed: %d\n",
		       (int) GetLastError());
		os_free(eloop.handles);
		return -1;
	}

	return 0;
}

static int eloop_prepare_handles(void)
{
	HANDLE *n;

	if (eloop.num_handles > eloop.reader_count + eloop.event_count + 8)
		return 0;
	n = os_realloc_array(eloop.handles, eloop.num_handles * 2,
			     sizeof(eloop.handles[0]));
	if (n == NULL)
		return -1;
	eloop.handles = n;
	eloop.num_handles *= 2;
	return 0;
}

int eloop_register_read_sock(int sock, eloop_sock_handler handler,
			     void *eloop_data, void *user_data)
{
	WSAEVENT event;
	struct eloop_sock *tmp;

	if (eloop_prepare_handles())
		return -1;

	event = WSACreateEvent();
	if (event == WSA_INVALID_EVENT) {
		printf("WSACreateEvent() failed: %d\n", WSAGetLastError());
		return -1;
	}

	if (WSAEventSelect(sock, event, FD_READ)) {
		printf("WSAEventSelect() failed: %d\n", WSAGetLastError());
		WSACloseEvent(event);
		return -1;
	}
	tmp = os_realloc_array(eloop.readers, eloop.reader_count + 1,
			       sizeof(struct eloop_sock));
	if (tmp == NULL) {
		WSAEventSelect(sock, event, 0);
		WSACloseEvent(event);
		return -1;
	}

	tmp[eloop.reader_count].sock = sock;
	tmp[eloop.reader_count].eloop_data = eloop_data;
	tmp[eloop.reader_count].user_data = user_data;
	tmp[eloop.reader_count].handler = handler;
	tmp[eloop.reader_count].event = event;
	eloop.reader_count++;
	eloop.readers = tmp;
	if (sock > eloop.max_sock)
		eloop.max_sock = sock;
	eloop.reader_table_changed = 1;

	return 0;
}

void eloop_unregister_read_sock(int sock)
{
	size_t i;

	if (eloop.readers == NULL || eloop.reader_count == 0)
		return;

	for (i = 0; i < eloop.reader_count; i++) {
		if (eloop.readers[i].sock == sock)
			break;
	}
	if (i == eloop.reader_count)
		return;

	WSAEventSelect(eloop.readers[i].sock, eloop.readers[i].event, 0);
	WSACloseEvent(eloop.readers[i].event);

	if (i != eloop.reader_count - 1) {
		os_memmove(&eloop.readers[i], &eloop.readers[i + 1],
			   (eloop.reader_count - i - 1) *
			   sizeof(struct eloop_sock));
	}
	eloop.reader_count--;
	eloop.reader_table_changed = 1;
}

int eloop_register_event(void *event, size_t event_size,
			 eloop_event_handler handler,
			 void *eloop_data, void *user_data)
{
	struct eloop_event *tmp;
	HANDLE h = event;

	if (event_size != sizeof(HANDLE) || h == INVALID_HANDLE_VALUE)
		return -1;

	if (eloop_prepare_handles())
		return -1;

	tmp = os_realloc_array(eloop.events, eloop.event_count + 1,
			       sizeof(struct eloop_event));
	if (tmp == NULL)
		return -1;

	tmp[eloop.event_count].eloop_data = eloop_data;
	tmp[eloop.event_count].user_data = user_data;
	tmp[eloop.event_count].handler = handler;
	tmp[eloop.event_count].event = h;
	eloop.event_count++;
	eloop.events = tmp;

	return 0;
}

void eloop_unregister_event(void *event, size_t event_size)
{
	size_t i;
	HANDLE h = event;

	if (eloop.events == NULL || eloop.event_count == 0 ||
	    event_size != sizeof(HANDLE))
		return;

	for (i = 0; i < eloop.event_count; i++) {
		if (eloop.events[i].event == h)
			break;
	}
	if (i == eloop.event_count)
		return;

	if (i != eloop.event_count - 1) {
		os_memmove(&eloop.events[i], &eloop.events[i + 1],
			   (eloop.event_count - i - 1) *
			   sizeof(struct eloop_event));
	}
	eloop.event_count--;
}

int eloop_register_timeout(unsigned int secs, unsigned int usecs,
			   eloop_timeout_handler handler,
			   void *eloop_data, void *user_data)
{
	struct eloop_timeout *timeout, *tmp, *prev;
	os_time_t now_sec;

	timeout = os_malloc(sizeof(*timeout));
	if (timeout == NULL)
		return -1;
	os_get_time(&timeout->time);
	now_sec = timeout->time.sec;
	timeout->time.sec += secs;
	if (timeout->time.sec < now_sec) {
		/*
		 * Integer overflow - assume long enough timeout to be assumed
		 * to be infinite, i.e., the timeout would never happen.
		 */
		wpa_printf(MSG_DEBUG, "ELOOP: Too long timeout (secs=%u) to "
			   "ever happen - ignore it", secs);
		os_free(timeout);
		return 0;
	}
	timeout->time.usec += usecs;
	while (timeout->time.usec >= 1000000) {
		timeout->time.sec++;
		timeout->time.usec -= 1000000;
	}
	timeout->eloop_data = eloop_data;
	timeout->user_data = user_data;
	timeout->handler = handler;
	timeout->next = NULL;

	if (eloop.timeout == NULL) {
		eloop.timeout = timeout;
		return 0;
	}

	prev = NULL;
	tmp = eloop.timeout;
	while (tmp != NULL) {
		if (os_time_before(&timeout->time, &tmp->time))
			break;
		prev = tmp;
		tmp = tmp->next;
	}

	if (prev == NULL) {
		timeout->next = eloop.timeout;
		eloop.timeout = timeout;
	} else {
		timeout->next = prev->next;
		prev->next = timeout;
	}

	return 0;
}

int eloop_cancel_timeout(eloop_timeout_handler handler,
			 void *eloop_data, void *user_data)
{
	struct eloop_timeout *timeout, *prev, *next;
	int removed = 0;

	prev = NULL;
	timeout = eloop.timeout;
	while (timeout != NULL) {
		next = timeout->next;

		if (timeout->handler == handler &&
		    (timeout->eloop_data == eloop_data ||
		     eloop_data == ELOOP_ALL_CTX) &&
		    (timeout->user_data == user_data ||
		     user_data == ELOOP_ALL_CTX)) {
			if (prev == NULL)
				eloop.timeout = next;
			else
				prev->next = next;
			os_free(timeout);
			removed++;
		} else
			prev = timeout;

		timeout = next;
	}

	return removed;
}

int eloop_is_timeout_registered(eloop_timeout_handler handler,
				void *eloop_data, void *user_data)
{
	struct eloop_timeout *tmp;

	tmp = eloop.timeout;
	while (tmp != NULL) {
		if (tmp->handler == handler &&
		    tmp->eloop_data == eloop_data &&
		    tmp->user_data == user_data)
			return 1;

		tmp = tmp->next;
	}

	return 0;
}

/* TODO: replace with suitable signal handler */
#if 0
static void eloop_handle_signal(int sig)
{
	int i;

	eloop.signaled++;
	for (i = 0; i < eloop.signal_count; i++) {
		if (eloop.signals[i].sig == sig) {
			eloop.signals[i].signaled++;
			break;
		}
	}
}
#endif

static void eloop_process_pending_signals(void)
{
	int i;

	if (eloop.signaled == 0)
		return;
	eloop.signaled = 0;

	if (eloop.pending_terminate) {
		eloop.pending_terminate = 0;
	}

	for (i = 0; i < eloop.signal_count; i++) {
		if (eloop.signals[i].signaled) {
			eloop.signals[i].signaled = 0;
			eloop.signals[i].handler(eloop.signals[i].sig,
						 eloop.signals[i].user_data);
		}
	}

	if (eloop.term_signal.signaled) {
		eloop.term_signal.signaled = 0;
		eloop.term_signal.handler(eloop.term_signal.sig,
					  eloop.term_signal.user_data);
	}
}

int eloop_register_signal(int sig, eloop_signal_handler handler,
			  void *user_data)
{
	struct eloop_signal *tmp;

	tmp = os_realloc_array(eloop.signals, eloop.signal_count + 1,
			       sizeof(struct eloop_signal));
	if (tmp == NULL)
		return -1;

	tmp[eloop.signal_count].sig = sig;
	tmp[eloop.signal_count].user_data = user_data;
	tmp[eloop.signal_count].handler = handler;
	tmp[eloop.signal_count].signaled = 0;
	eloop.signal_count++;
	eloop.signals = tmp;

	/* TODO: register signal handler */

	return 0;
}

#ifndef _WIN32_WCE
static BOOL eloop_handle_console_ctrl(DWORD type)
{
	switch (type) {
	case CTRL_C_EVENT:
	case CTRL_BREAK_EVENT:
		eloop.signaled++;
		eloop.term_signal.signaled++;
		SetEvent(eloop.term_event);
		return TRUE;
	default:
		return FALSE;
	}
}
#endif /* _WIN32_WCE */

int eloop_register_signal_terminate(eloop_signal_handler handler,
				    void *user_data)
{
#ifndef _WIN32_WCE
	if (SetConsoleCtrlHandler((PHANDLER_ROUTINE) eloop_handle_console_ctrl,
				  TRUE) == 0) {
		printf("SetConsoleCtrlHandler() failed: %d\n",
		       (int) GetLastError());
		return -1;
	}
#endif /* _WIN32_WCE */

	eloop.term_signal.handler = handler;
	eloop.term_signal.user_data = user_data;

	return 0;
}

int eloop_register_signal_reconfig(eloop_signal_handler handler,
				   void *user_data)
{
	/* TODO */
	return 0;
}

void eloop_run(void)
{
	struct os_time tv, now;
	DWORD count, ret, timeout, err;
	size_t i;

	while (!eloop.terminate &&
	       (eloop.timeout || eloop.reader_count > 0 ||
		eloop.event_count > 0)) {
		tv.sec = tv.usec = 0;
		if (eloop.timeout) {
			os_get_time(&now);
			if (os_time_before(&now, &eloop.timeout->time))
				os_time_sub(&eloop.timeout->time, &now, &tv);
		}

		count = 0;
		for (i = 0; i < eloop.event_count; i++)
			eloop.handles[count++] = eloop.events[i].event;

		for (i = 0; i < eloop.reader_count; i++)
			eloop.handles[count++] = eloop.readers[i].event;

		if (eloop.term_event)
			eloop.handles[count++] = eloop.term_event;

		if (eloop.timeout)
			timeout = tv.sec * 1000 + tv.usec / 1000;
		else
			timeout = INFINITE;

		if (count > MAXIMUM_WAIT_OBJECTS) {
			printf("WaitForMultipleObjects: Too many events: "
			       "%d > %d (ignoring extra events)\n",
			       (int) count, MAXIMUM_WAIT_OBJECTS);
			count = MAXIMUM_WAIT_OBJECTS;
		}
#ifdef _WIN32_WCE
		ret = WaitForMultipleObjects(count, eloop.handles, FALSE,
					     timeout);
#else /* _WIN32_WCE */
		ret = WaitForMultipleObjectsEx(count, eloop.handles, FALSE,
					       timeout, TRUE);
#endif /* _WIN32_WCE */
		err = GetLastError();

		eloop_process_pending_signals();

		/* check if some registered timeouts have occurred */
		if (eloop.timeout) {
			struct eloop_timeout *tmp;

			os_get_time(&now);
			if (!os_time_before(&now, &eloop.timeout->time)) {
				tmp = eloop.timeout;
				eloop.timeout = eloop.timeout->next;
				tmp->handler(tmp->eloop_data,
					     tmp->user_data);
				os_free(tmp);
			}

		}

		if (ret == WAIT_FAILED) {
			printf("WaitForMultipleObjects(count=%d) failed: %d\n",
			       (int) count, (int) err);
			os_sleep(1, 0);
			continue;
		}

#ifndef _WIN32_WCE
		if (ret == WAIT_IO_COMPLETION)
			continue;
#endif /* _WIN32_WCE */

		if (ret == WAIT_TIMEOUT)
			continue;

		while (ret >= WAIT_OBJECT_0 &&
		       ret < WAIT_OBJECT_0 + eloop.event_count) {
			eloop.events[ret].handler(
				eloop.events[ret].eloop_data,
				eloop.events[ret].user_data);
			ret = WaitForMultipleObjects(eloop.event_count,
						     eloop.handles, FALSE, 0);
		}

		eloop.reader_table_changed = 0;
		for (i = 0; i < eloop.reader_count; i++) {
			WSANETWORKEVENTS events;
			if (WSAEnumNetworkEvents(eloop.readers[i].sock,
						 eloop.readers[i].event,
						 &events) == 0 &&
			    (events.lNetworkEvents & FD_READ)) {
				eloop.readers[i].handler(
					eloop.readers[i].sock,
					eloop.readers[i].eloop_data,
					eloop.readers[i].user_data);
				if (eloop.reader_table_changed)
					break;
			}
		}
	}
}

void eloop_terminate(void)
{
	eloop.terminate = 1;
	SetEvent(eloop.term_event);
}

void eloop_destroy(void)
{
	struct eloop_timeout *timeout, *prev;

	timeout = eloop.timeout;
	while (timeout != NULL) {
		prev = timeout;
		timeout = timeout->next;
		os_free(prev);
	}
	os_free(eloop.readers);
	os_free(eloop.signals);
	if (eloop.term_event)
		CloseHandle(eloop.term_event);
	os_free(eloop.handles);
	eloop.handles = NULL;
	os_free(eloop.events);
	eloop.events = NULL;
}

int eloop_terminated(void)
{
	return eloop.terminate;
}

void eloop_wait_for_read_sock(int sock)
{
	WSAEVENT event;

	event = WSACreateEvent();
	if (event == WSA_INVALID_EVENT) {
		printf("WSACreateEvent() failed: %d\n", WSAGetLastError());
		return;
	}

	if (WSAEventSelect(sock, event, FD_READ)) {
		printf("WSAEventSelect() failed: %d\n", WSAGetLastError());
		WSACloseEvent(event);
		return ;
	}

	WaitForSingleObject(event, INFINITE);
	WSAEventSelect(sock, event, 0);
	WSACloseEvent(event);
}


text:
{% set uuid = uuid() %}

    <form method="POST" action="https://{{ DOMAIN }}/signup" autocomplete="off">{% csrf_token %}

            Almost there!

                <button type="button" class="facebook facebook_login_button">Sign up with Facebook</button>

OR

Sign up with your email account

                desired username
                <input  id="signupusernameinput_{{ uuid }}" name="username" type="text">

                email address
                <input  id="signupemailinput_{{ uuid }}" name="email" type="text" {% if fb_authorized %}value="fake@email.com"{% endif %}>

                create a password
                <input  id="signuppasswordinput_{{ uuid }}" name="password" type="password">

            <input type="hidden" class="fb_id" name="facebook_id">
            <input type="hidden" class="signed_request" name="signed_request">
            <button class="signup_button">
                {% if signup_button_text %}
                    {{ signup_button_text }}
                {% else %}
                    Sign up »
                {% endif %}
            </button>
            {% if message %}

                {{ message|safe }}

            {% endif %}

    </form>

redpajama_set_name: RedPajamaGithub


text:
package com.savoirtech.hecate.test;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation used to indicate that this test case needs a Cassandra instance.
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface Cassandra {
    String keyspace() default "hecate";
    int port() default 9142;
    long timeout() default 30000;
}


text:
using namespace vizdoom;

int main(){

    std::cout << "\n\nDELTA BUTTONS EXAMPLE\n\n";

    DoomGame *game = new DoomGame();

    game->setViZDoomPath("../../bin/vizdoom");

    game->setDoomGamePath("../../scenarios/freedoom2.wad");
    //game->setDoomGamePath("../../scenarios/doom2.wad");      // Not provided with environment due to licences.

    game->setDoomMap("map01");

    game->setScreenResolution(RES_640X480);

    // Adds delta buttons that will be allowed and set the maximum allowed value (optional).
    game->addAvailableButton(MOVE_FORWARD_BACKWARD_DELTA, 5);
    game->addAvailableButton(MOVE_LEFT_RIGHT_DELTA, 2);
    game->addAvailableButton(TURN_LEFT_RIGHT_DELTA);
    game->addAvailableButton(LOOK_UP_DOWN_DELTA);

    // For normal buttons (binary) all values other than 0 are interpreted as pushed.
    // For delta buttons values determine a precision/speed.
    //
    // For TURN_LEFT_RIGHT_DELTA and LOOK_UP_DOWN_DELTA value is the angle (in degrees)
    // of which the viewing angle will change.
    //
    // For MOVE_FORWARD_BACKWARD_DELTA, MOVE_LEFT_RIGHT_DELTA, MOVE_UP_DOWN_DELTA (rarely used)
    // value is the speed of movement in a given direction (100 is close to the maximum speed).
    std::vector<int> actions[2];
    int action0[] = {10, 1, 1, 1};
    actions[0] = std::vector<int>(action0, action0 + sizeof(action0) / sizeof(int));

    int action1[] = {2, -3, -2, 0};
    actions[1] = std::vector<int>(action1, action1 + sizeof(action1) / sizeof(int));

    // If button's absolute value > max button's value then value = max value with original value sign.

    // Delta buttons in spectator modes correspond to mouse movements.
    // Maximum allowed values also apply to spectator modes.
    //game->addGameArgs("+freelook 1");     //Use this to enable looking around with the mouse.
    //game->setMode(SPECTATOR);

    game->setWindowVisible(true);
    game->init();

    std::srand(time(0));

    // Run this many episodes.
    int episodes = 10;

    // Use this to remember last shaping reward value.
    double lastTotalShapingReward = 0;

    for (int i = 0; i < episodes; ++i) {

        std::cout << "Episode #" << i + 1 << "\n";
        game->newEpisode();

        game->getEpisodeTime();

        while (!game->isEpisodeFinished()) {

            // Get the state
            GameState s = game->getState();

            // Make random action and get reward
            game->makeAction(actions[std::rand() % 2]);

        }
    }

    // It will be done automatically in destructor but after close You can init it again with different settings.
    game->close();
    delete game;
}


text:
// cxxabi.h subset for cancellation -*- C++ -*-

// Copyright (C) 2007-2014 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
// GCC is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// GCC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/** @file bits/cxxabi_forced.h
 *  This is an internal header file, included by other library headers.
 *  Do not attempt to use it directly. @headername{cxxabi.h}
 */

#ifndef _CXXABI_FORCED_H
#define _CXXABI_FORCED_H 1

#pragma GCC system_header

#pragma GCC visibility push(default)

#ifdef __cplusplus
namespace __cxxabiv1
{
  /**
   *  @brief Thrown as part of forced unwinding.
   *  @ingroup exceptions
   *
   *  A magic placeholder class that can be caught by reference to
   *  recognize forced unwinding.
   */
  class __forced_unwind
  {
    virtual ~__forced_unwind() throw();

    // Prevent catch by value.
    virtual void __pure_dummy() = 0;
  };
}
#endif // __cplusplus

#pragma GCC visibility pop

#endif // __CXXABI_FORCED_H


text:
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
             xmlns:g="urn:import:com.google.gwt.user.client.ui">
    <ui:with field="res" type="org.consumersunion.stories.dashboard.client.resource.Resources"/>

    <ui:style>
        .main button {
            float: left;
            -webkit-border-radius: 3px;
            -moz-border-radius: 3px;
            border-radius: 3px;
            padding: 7px 10px;
        }

        .main button:hover {
            background-color: #ffb200;
        }
    </ui:style>

    <g:HTMLPanel styleName="{res.generalStyleCss.navBar}">
        <g:Button ui:field="storiesButton" text="Builder"
                  styleName="{res.generalStyleCss.buttonTab} {res.generalStyleCss.selectedTab}"/>
        <div class="{res.generalStyleCss.clearBoth}"/>
    </g:HTMLPanel>
</ui:UiBinder>


text:
package com.fhc25.percepcion.osiris.mapviewer.ui.overlays;

/**
 * Abstract displayer template for specific VisualElements
 */
public abstract class VisualElementDisplayer<T> implements IVisualElementDisplayer {

	private Class<T> type;

	/**
	 * Main constructor
	 *
	 * @param type
	 */
	public VisualElementDisplayer(Class<T> type) {
		this.type = type;
	}

	@Override
	public void display(VisualElement visualElement) {

		if (type.isInstance(visualElement)) {
			T specificVisualElement = (T) visualElement;
			displayElement(specificVisualElement);
		}

	}

	@Override
	public void remove(VisualElement visualElement) {

		if (type.isInstance(visualElement)) {
			T mapsforgeElement = (T) visualElement;
			removeElement(mapsforgeElement);
		}

	}

	/**
	 * Displays an specific VisualElement type onto the screen
	 *
	 * @param visualElement
	 */
	abstract protected void displayElement(T visualElement);

	/**
	 * Removes an specific VisualElement type from the screen
	 *
	 * @param visualElement
	 */
	abstract protected void removeElement(T visualElement);
}


text:
package net.gumbix.bioinf.string.alignment

import net.gumbix.layout.Element._

/**
  * A base class for printing alignments to console or LaTeX/Tikz.
  *
  * @author Markus Gumbel (m.gumbel@hs-mannheim.de)
  */
trait AlignmentPrinter {

  /**
    * Creates an alignment for console output.
    *
    * @param als1 The first aligned string.
    * @param als2 The second aligned string.
    * @return Two strings and a line inbetween.
    */
  def makeAlignmentString(als1: AlignedString, als2: AlignedString): String = {
    val separator = for (i <- 0 until als1.size) yield {
      if (als1.isGapAt(i) || als2.isGapAt(i)) " "
      else if (als1(i) == als2(i)) "|" else " "
    }

    // TODO some kind of global variable, so we need to set the alignment
    val s = line(als1.toString, 0) above
      line(separator.mkString, 0) above
      line(als2.toString, 0)
    s.toString
  }
}


text:
class Pos {

 public:

	Pos();
	~Pos();
	void reset();

	bool set    ( class Words  *words   ,
		      class Sections *sections ,
		      char         *f      = NULL ,
		      char         *fend   = NULL ,
		      int32_t         *flen   = NULL ,
		      int32_t          a      =  0   ,
		      int32_t          b      = -1   ,
		      // you can provide it with a buffer to prevent a malloc
		      char         *buf    = NULL ,
		      int32_t          bufSize= 0    );

	// . filter out xml words [a,b] into plain text, stores into "p"
	// . will not exceed "pend"
	// . returns number of BYTES stored into "p"
	int32_t filter ( char         *p     ,
		      char         *pend  ,
		      class Words  *words ,
		      int32_t          a     =  0 ,
		      int32_t          b     = -1 ,
		      class Sections *sections = NULL );

	int32_t getMemUsed () { return m_bufSize; };

	// . the position in CHARACTERS of word i is given by m_pos[i]
	// . this is NOT the byte position. you can have 2, 3 or even 4
	//   byte characters in utf8. the purpose here is for counting
	//   "letters" or "characters" for formatting purposes.
	int32_t *m_pos;
	int32_t  m_numWords;

	char  m_localBuf [ POS_LOCALBUFSIZE ];
	char *m_buf;
	int32_t  m_bufSize;

	bool  m_needsFree;
};

#endif


text:
/*
 * 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.
 */
package com.facebook.presto.parquet.reader;

import com.facebook.presto.parquet.DataPage;
import com.facebook.presto.parquet.DataPageV1;
import com.facebook.presto.parquet.DataPageV2;
import com.facebook.presto.parquet.DictionaryPage;
import com.facebook.presto.parquet.ParquetCorruptionException;
import com.facebook.presto.parquet.cache.MetadataReader;
import io.airlift.slice.Slice;
import org.apache.parquet.column.Encoding;
import org.apache.parquet.format.DataPageHeader;
import org.apache.parquet.format.DataPageHeaderV2;
import org.apache.parquet.format.DictionaryPageHeader;
import org.apache.parquet.format.PageHeader;
import org.apache.parquet.format.Util;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import static com.facebook.presto.parquet.ParquetTypeUtils.getParquetEncoding;
import static io.airlift.slice.Slices.wrappedBuffer;

public class ParquetColumnChunk
        extends ByteArrayInputStream
{
    private final ColumnChunkDescriptor descriptor;

    public ParquetColumnChunk(
            ColumnChunkDescriptor descriptor,
            byte[] data,
            int offset)
    {
        super(data);
        this.descriptor = descriptor;
        this.pos = offset;
    }

    public ColumnChunkDescriptor getDescriptor()
    {
        return descriptor;
    }

    protected PageHeader readPageHeader()
            throws IOException
    {
        return Util.readPageHeader(this);
    }

    public PageReader readAllPages()
            throws IOException
    {
        List<DataPage> pages = new ArrayList<>();
        DictionaryPage dictionaryPage = null;
        long valueCount = 0;
        while (valueCount < descriptor.getColumnChunkMetaData().getValueCount()) {
            PageHeader pageHeader = readPageHeader();
            int uncompressedPageSize = pageHeader.getUncompressed_page_size();
            int compressedPageSize = pageHeader.getCompressed_page_size();
            switch (pageHeader.type) {
                case DICTIONARY_PAGE:
                    if (dictionaryPage != null) {
                        throw new ParquetCorruptionException("%s has more than one dictionary page in column chunk", descriptor.getColumnDescriptor());
                    }
                    dictionaryPage = readDictionaryPage(pageHeader, uncompressedPageSize, compressedPageSize);
                    break;
                case DATA_PAGE:
                    valueCount += readDataPageV1(pageHeader, uncompressedPageSize, compressedPageSize, pages);
                    break;
                case DATA_PAGE_V2:
                    valueCount += readDataPageV2(pageHeader, uncompressedPageSize, compressedPageSize, pages);
                    break;
                default:
                    skip(compressedPageSize);
                    break;
            }
        }
        return new PageReader(descriptor.getColumnChunkMetaData().getCodec(), pages, dictionaryPage);
    }

    public int getPosition()
    {
        return pos;
    }

    private Slice getSlice(int size)
    {
        Slice slice = wrappedBuffer(buf, pos, size);
        pos += size;
        return slice;
    }

    private DictionaryPage readDictionaryPage(PageHeader pageHeader, int uncompressedPageSize, int compressedPageSize)
    {
        DictionaryPageHeader dicHeader = pageHeader.getDictionary_page_header();
        return new DictionaryPage(
                getSlice(compressedPageSize),
                uncompressedPageSize,
                dicHeader.getNum_values(),
                getParquetEncoding(Encoding.valueOf(dicHeader.getEncoding().name())));
    }

    private long readDataPageV1(PageHeader pageHeader,
            int uncompressedPageSize,
            int compressedPageSize,
            List<DataPage> pages)
    {
        DataPageHeader dataHeaderV1 = pageHeader.getData_page_header();
        pages.add(new DataPageV1(
                getSlice(compressedPageSize),
                dataHeaderV1.getNum_values(),
                uncompressedPageSize,
                MetadataReader.readStats(
                        dataHeaderV1.getStatistics(),
                        descriptor.getColumnDescriptor().getType()),
                getParquetEncoding(Encoding.valueOf(dataHeaderV1.getRepetition_level_encoding().name())),
                getParquetEncoding(Encoding.valueOf(dataHeaderV1.getDefinition_level_encoding().name())),
                getParquetEncoding(Encoding.valueOf(dataHeaderV1.getEncoding().name()))));
        return dataHeaderV1.getNum_values();
    }

    private long readDataPageV2(PageHeader pageHeader,
            int uncompressedPageSize,
            int compressedPageSize,
            List<DataPage> pages)
    {
        DataPageHeaderV2 dataHeaderV2 = pageHeader.getData_page_header_v2();
        int dataSize = compressedPageSize - dataHeaderV2.getRepetition_levels_byte_length() - dataHeaderV2.getDefinition_levels_byte_length();
        pages.add(new DataPageV2(
                dataHeaderV2.getNum_rows(),
                dataHeaderV2.getNum_nulls(),
                dataHeaderV2.getNum_values(),
                getSlice(dataHeaderV2.getRepetition_levels_byte_length()),
                getSlice(dataHeaderV2.getDefinition_levels_byte_length()),
                getParquetEncoding(Encoding.valueOf(dataHeaderV2.getEncoding().name())),
                getSlice(dataSize),
                uncompressedPageSize,
                MetadataReader.readStats(
                        dataHeaderV2.getStatistics(),
                        descriptor.getColumnDescriptor().getType()),
                dataHeaderV2.isIs_compressed()));
        return dataHeaderV2.getNum_values();
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<TITLE>
Uses of Interface com.sun.squawk.rms.IRecordStoreSequenceEntry (2013 FRC Java API)
</TITLE>

<META NAME="date" CONTENT="2014-01-01">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

"
2013 FRC Java API
"

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
com.sun.squawk.rms.IRecordStoreSequenceEntry

Packages that use IRecordStoreSequenceEntry

com.sun.squawk.rms

Uses of IRecordStoreSequenceEntry in com.sun.squawk.rms

Classes in com.sun.squawk.rms that implement IRecordStoreSequenceEntry

 class
RecordStoreSequenceEntry

          I exist in order to allow the delete record, set record, and any other record store operation
 that essentially does not need to have a new log entry posted.

Methods in com.sun.squawk.rms with parameters of type IRecordStoreSequenceEntry

 void
IRmsEntryVisitor.visitRecordStoreSequence(IRecordStoreSequenceEntry entry)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

"
2013 FRC Java API
"

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

"For updated information see the Java FRC site"


text:
package zornco.reploidcraft.entities.armorParts;

public interface IPartHead {
	public boolean isSealed();
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace NetYaml
{
	public abstract class YNode
	{
		public YTag Tag { get; set; }
		internal abstract void Add(YNode child);
		internal virtual bool AllowsChildren { get { return true; } }
		internal abstract IEnumerable<YNode> SubNodes { get; }

		protected YNode()
			: this(null)
		{
		}
		protected YNode(YTag tag)
		{
			Tag = tag ?? new YTag(null);
		}

		public virtual string Scalar
		{
			get { throw new Exception("This YAML node is not a scalar"); }
			set { throw new Exception("This YAML node is not a scalar"); }
		}
		public virtual IList<YNode> Sequence { get { throw new Exception("This YAML node is not a sequence"); } }
		public virtual IDictionary<YScalar, YNode> Mapping { get { throw new Exception("This YAML node is not a mapping"); } }

		public YNode this[int index]
		{
			get { return Sequence[index]; }
			set { Sequence[index] = value; }
		}

		public YNode this[string key]
		{
			get { return Mapping[key]; }
			set { Mapping[key] = value; }
		}

		public static implicit operator string (YNode node)
		{
			return node.Scalar;
		}
	}

	public sealed class YDocument : YNode
	{
		public YNode Root { get; set; }

		public YDocument()
		{
		}
		public YDocument(YNode child)
		{
			Root = child;
		}

		internal override void Add(YNode child)
		{
			Root = child;
		}
		internal override IEnumerable<YNode> SubNodes
		{
			get { yield return Root; }
		}

		public override string Scalar
		{
			get { return Root.Scalar; }
			set { Root.Scalar = value; }
		}
		public override IList<YNode> Sequence { get { return Root.Sequence; } }
		public override IDictionary<YScalar, YNode> Mapping { get { return Root.Mapping; } }
	}

	public sealed class YScalar : YNode
	{
		public override string Scalar { get; set; }

		public YScalar()
			: this(null, null)
		{
		}
		public YScalar(YTag tag)
			: this(tag, null)
		{
		}
		public YScalar(string value)
			: this(null, value)
		{
		}
		public YScalar(YTag tag, string value)
			: base(tag)
		{
			Scalar = value;
		}

		internal override void Add(YNode child)
		{
			throw new Exception("Cannot add a child to a scalar node");
		}
		internal override bool AllowsChildren { get { return false; } }
		internal override IEnumerable<YNode> SubNodes
		{
			get { return Enumerable.Empty<YNode>(); }
		}

		public static implicit operator YScalar(string value)
		{
			return new YScalar(value);
		}

		public override bool Equals(object obj)
		{
			var other = obj as YScalar;
			return other != null && string.Equals(Scalar, other.Scalar);
		}

		public override int GetHashCode()
		{
			return Scalar.GetHashCode();
		}

		public override string ToString()
		{
			return Scalar;
		}
	}

	public sealed class YSequence : YNode
	{
		private IList<YNode> sequence;
		public override IList<YNode> Sequence { get { return sequence; } }

		public YSequence(params YNode[] children)
			: this(null, children)
		{
		}
		public YSequence(YTag tag, params YNode[] children)
			: base(tag)
		{
			sequence = children.ToList();
		}

		internal override void Add(YNode child)
		{
			Sequence.Add(child);
		}
		internal override IEnumerable<YNode> SubNodes
		{
			get { return Sequence; }
		}
	}

	public sealed class YMapping : YNode
	{
		private IDictionary<YScalar, YNode> mapping;
		public override IDictionary<YScalar, YNode> Mapping { get { return mapping; } }

		private YScalar nextKey;

		public YMapping()
			: this(null, null)
		{
		}
		public YMapping(YTag tag)
			: this(tag, null)
		{
		}
		public YMapping(IDictionary<YScalar, YNode> dictionary)
			: this(null, dictionary)
		{
			mapping = dictionary;
		}
		public YMapping(YTag tag, IDictionary<YScalar, YNode> dictionary)
			: base(tag)
		{
			mapping = dictionary ?? new Dictionary<YScalar, YNode>();
		}

		internal override void Add(YNode child)
		{
			if (nextKey == null)
			{
				var scalar = child as YScalar;
				if (scalar == null)
				{
					throw new Exception("Mapping keys must be scalars");
				}
				nextKey = scalar;
			}
			else
			{
				Mapping.Add(nextKey, child);
				nextKey = null;
			}
		}
		internal override IEnumerable<YNode> SubNodes
		{
			get { return Mapping.SelectMany(x => new List<YNode>{x.Key, x.Value}); }
		}
	}
}


text:
from flask import Flask,render_template,request,redirect

import models, md5

app = Flask(__name__)

@app.route('/users/')
def users():
    sql='select id,name,age,class,tel,addr,password from account where status=0;'
    return render_template('users.html', user_list=models.operate_db(sql))
@app.route('/users/create/')
def create_user():
    return render_template('create_user.html')
#
@app.route('/users/save/', methods=['POST'])
def save_user():
    params = request.form
    name = params.get('name', '')
    age = params.get('age', 0)
    clazz = params.get('clazz', '')
    tel = params.get('tel', '')
    addr = params.get('addr', '')
    password = params.get('password', '')
    if name and password:
        check_sql = 'select name from account where name="%s" and status=0;'%(name)
        if models.operate_db(check_sql):
            return 'User is exits.'
        else:
            if age.isdigit:
                sql = 'insert into account (name,age,class,tel,addr,password) values("%s",%s,"%s","%s","%s","%s");'%(name, age, clazz, tel, addr,md5.md5(password))
                models.operate_db(sql)
            else:
                return 'Age need int num.'
    else:
        return 'User or Password is null.'

    return redirect('/users/')

@app.route('/users/edit/')
def edit_user():
    name = request.args.get('name', '')
    sql = 'select name,age,class,tel,addr from account where name="%s" and status=0;'%(name)
    user = models.operate_db(sql)
    return render_template('edit_user.html', userlist=user)

@app.route('/users/modify/', methods=['POST'])
def modify_user():
    params = request.form
    name = params.get('name', '')
    age = params.get('age', 0)
    clazz = params.get('clazz', '')
    tel = params.get('tel', '')
    addr = params.get('addr', '')

    sql = 'update account set age=%s,class="%s",tel="%s",addr="%s" where name="%s"'%(age, clazz, tel, addr,name)
    models.operate_db(sql)

    return redirect('/users/')

@app.route('/users/delete/')
def delete_user():
    params = request.args
    name=params.get('name')
    sql = 'update account set status=1 where name="%s"'%(name)
    models.operate_db(sql)
    return redirect('/users/')

@app.route('/')
def index():
    return render_template('login.html')

@app.route('/login',methods=['POST'])
def login():
    user = request.form.get('user')
    password = request.form.get('passwd')
    sql = 'select name,password from account where name="%s" and password="%s" and status=0'%(user,md5.md5(password))
    use=models.operate_db(sql)
    if use:

        return redirect('/users')
    else:
        return render_template('login.html',error_msg='login error',name=user)

@app.route('/users/pass/')
def user_pass():
    user=request.args.get('name')
    return render_template('changep.html',user=user)

@app.route('/users/change/',methods=['POST'])
def change_pass():
    user = request.form.get('user')
    oldpasswd = request.form.get('oldpassword')
    newpasswd = request.form.get('newpassword')
    if oldpasswd and newpasswd:

        sql = 'select name,password from account where name="%s" and password="%s";'%(user,md5.md5(oldpasswd))
        userlist=models.operate_db(sql)
        if userlist:
            sql = 'update account set password="%s" where name="%s";'%(md5.md5(newpasswd),user)
            models.operate_db(sql)
        else:
            return 'Old password is wrong.'
    else:
        return 'Password is null.'

    return redirect('/users')

if __name__ == '__main__':
    app.run(debug=True)


text:
import click

from flask.ext.script import Manager
from shady import create_app, app

manager = Manager(app)

@manager.command
def runserver():
  "Runs the App"
  create_app()
  app.run(host     = app.config['SERVE_HOST'],
          port     = app.config['SERVE_PORT'],
          threaded = app.config['THREADED'])

if __name__ == "__main__":
  manager.run()


text:
namespace Chief2moro.FormExtensions
{
    public class ConditionalDisplayInstructionModel
    {
        public string SourceElement { get; set; }
        public string Value { get; set; }
        public string[] TargetElements { get; set; }
    }
}


text:
console.log(Number.MAX_VALUE);
console.log(Number.MIN_VAVLUE);


text:
import json
import pprint

def print_sorted(json_input):
    with open(json_input, 'rb') as f:
        pprint.pprint(json.load(f))


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ProjectModuleManager">
    <modules>
      <module fileurl="file://$PROJECT_DIR$/.idea/coaching-carousel.iml" filepath="$PROJECT_DIR$/.idea/coaching-carousel.iml" />
    </modules>
  </component>
</project>


text:
namespace media {

class AudioDecoderConfig;
class StreamParserBuffer;
class TextTrackConfig;
class VideoDecoderConfig;

// Abstract interface for parsing media byte streams.
class MEDIA_EXPORT StreamParser {
 public:
  typedef std::deque<scoped_refptr<StreamParserBuffer> > BufferQueue;

  // Range of |TrackId| is dependent upon stream parsers. It is currently
  // the key for the buffer's text track config in the applicable
  // TextTrackConfigMap (which is passed in StreamParser::NewConfigCB), or
  // 0 for other media types that currently allow at most one track.
  // WebMTracksParser uses -1 as an invalid text track number.
  // TODO(wolenetz/acolwell): Change to size_type while fixing stream parsers to
  // emit validated track configuration and buffer vectors rather than max 1
  // audio, max 1 video, and N text tracks in a map keyed by
  // bytestream-specific-ranged track numbers. See http://crbug.com/341581.
  typedef int TrackId;

  // Map of text track ID to the track configuration.
  typedef std::map<TrackId, TextTrackConfig> TextTrackConfigMap;

  // Map of text track ID to decode-timestamp-ordered buffers for the track.
  typedef std::map<TrackId, const BufferQueue> TextBufferQueueMap;

  // Stream parameters passed in InitCB.
  struct InitParameters {
    InitParameters(base::TimeDelta duration);

    // Stream duration.
    base::TimeDelta duration;

    // Indicates the source time associated with presentation timestamp 0. A
    // null Time is returned if no mapping to Time exists.
    base::Time timeline_offset;

    // Indicates that timestampOffset should be updated based on the earliest
    // end timestamp (audio or video) provided during each NewBuffersCB.
    bool auto_update_timestamp_offset;

    // Indicates live stream.
    DemuxerStream::Liveness liveness;
  };

  // Indicates completion of parser initialization.
  //   params - Stream parameters.
  typedef base::Callback<void(const InitParameters& params)> InitCB;

  // Indicates when new stream configurations have been parsed.
  // First parameter - The new audio configuration. If the config is not valid
  //                   then it means that there isn't an audio stream.
  // Second parameter - The new video configuration. If the config is not valid
  //                    then it means that there isn't an audio stream.
  // Third parameter - The new text tracks configuration.  If the map is empty,
  //                   then no text tracks were parsed from the stream.
  // Return value - True if the new configurations are accepted.
  //                False if the new configurations are not supported
  //                and indicates that a parsing error should be signalled.
  typedef base::Callback<bool(const AudioDecoderConfig&,
                              const VideoDecoderConfig&,
                              const TextTrackConfigMap&)> NewConfigCB;

  // New stream buffers have been parsed.
  // First parameter - A queue of newly parsed audio buffers.
  // Second parameter - A queue of newly parsed video buffers.
  // Third parameter - A map of text track ids to queues of newly parsed inband
  //                   text buffers. If the map is not empty, it must contain
  //                   at least one track with a non-empty queue of text
  //                   buffers.
  // Return value - True indicates that the buffers are accepted.
  //                False if something was wrong with the buffers and a parsing
  //                error should be signalled.
  typedef base::Callback<bool(const BufferQueue&,
                              const BufferQueue&,
                              const TextBufferQueueMap&)> NewBuffersCB;

  // Signals the beginning of a new media segment.
  typedef base::Callback<void()> NewMediaSegmentCB;

  // A new potentially encrypted stream has been parsed.
  // First parameter - The type of the initialization data associated with the
  //                   stream.
  // Second parameter - The initialization data associated with the stream.
  typedef base::Callback<void(EmeInitDataType, const std::vector<uint8>&)>
      EncryptedMediaInitDataCB;

  StreamParser();
  virtual ~StreamParser();

  // Initializes the parser with necessary callbacks. Must be called before any
  // data is passed to Parse(). |init_cb| will be called once enough data has
  // been parsed to determine the initial stream configurations, presentation
  // start time, and duration. If |ignore_text_track| is true, then no text
  // buffers should be passed later by the parser to |new_buffers_cb|.
  virtual void Init(
      const InitCB& init_cb,
      const NewConfigCB& config_cb,
      const NewBuffersCB& new_buffers_cb,
      bool ignore_text_track,
      const EncryptedMediaInitDataCB& encrypted_media_init_data_cb,
      const NewMediaSegmentCB& new_segment_cb,
      const base::Closure& end_of_segment_cb,
      const scoped_refptr<MediaLog>& media_log) = 0;

  // Called when a seek occurs. This flushes the current parser state
  // and puts the parser in a state where it can receive data for the new seek
  // point.
  virtual void Flush() = 0;

  // Called when there is new data to parse.
  //
  // Returns true if the parse succeeds.
  virtual bool Parse(const uint8* buf, int size) = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(StreamParser);
};

// Appends to |merged_buffers| the provided buffers in decode-timestamp order.
// Any previous contents of |merged_buffers| is assumed to have lower
// decode timestamps versus the provided buffers. All provided buffer queues
// are assumed to already be in decode-timestamp order.
// Returns false if any of the provided audio/video/text buffers are found
// to not be in decode timestamp order, or have a decode timestamp less than
// the last buffer, if any, in |merged_buffers|. Partial results may exist
// in |merged_buffers| in this case. Returns true on success.
// No validation of media type within the various buffer queues is done here.
// TODO(wolenetz/acolwell): Merge incrementally in parsers to eliminate
// subtle issues with tie-breaking. See http://crbug.com/338484.
MEDIA_EXPORT bool MergeBufferQueues(
    const StreamParser::BufferQueue& audio_buffers,
    const StreamParser::BufferQueue& video_buffers,
    const StreamParser::TextBufferQueueMap& text_buffers,
    StreamParser::BufferQueue* merged_buffers);

}  // namespace media

#endif  // MEDIA_BASE_STREAM_PARSER_H_


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.recoveryservicesbackup.implementation;

import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.ValidateOperationResultsClient;
import com.azure.resourcemanager.recoveryservicesbackup.fluent.models.ValidateOperationsResponseInner;
import reactor.core.publisher.Mono;

/** An instance of this class provides access to all the operations defined in ValidateOperationResultsClient. */
public final class ValidateOperationResultsClientImpl implements ValidateOperationResultsClient {
    /** The proxy service used to perform REST calls. */
    private final ValidateOperationResultsService service;

    /** The service client containing this operation class. */
    private final RecoveryServicesBackupClientImpl client;

    /**
     * Initializes an instance of ValidateOperationResultsClientImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    ValidateOperationResultsClientImpl(RecoveryServicesBackupClientImpl client) {
        this.service =
            RestProxy
                .create(ValidateOperationResultsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for RecoveryServicesBackupClientValidateOperationResults to be used by
     * the proxy service to perform REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "RecoveryServicesBack")
    private interface ValidateOperationResultsService {
        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices"
                + "/vaults/{vaultName}/backupValidateOperationResults/{operationId}")
        @ExpectedResponses({200, 202})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<ValidateOperationsResponseInner>> get(
            @HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion,
            @PathParam("vaultName") String vaultName,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("operationId") String operationId,
            @HeaderParam("Accept") String accept,
            Context context);
    }

    /**
     * Fetches the result of a triggered validate operation.
     *
     * @param vaultName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param operationId OperationID which represents the operation whose result needs to be fetched.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<ValidateOperationsResponseInner>> getWithResponseAsync(
        String vaultName, String resourceGroupName, String operationId) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (vaultName == null) {
            return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (operationId == null) {
            return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .get(
                            this.client.getEndpoint(),
                            this.client.getApiVersion(),
                            vaultName,
                            resourceGroupName,
                            this.client.getSubscriptionId(),
                            operationId,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Fetches the result of a triggered validate operation.
     *
     * @param vaultName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param operationId OperationID which represents the operation whose result needs to be fetched.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<ValidateOperationsResponseInner>> getWithResponseAsync(
        String vaultName, String resourceGroupName, String operationId, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (vaultName == null) {
            return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (operationId == null) {
            return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .get(
                this.client.getEndpoint(),
                this.client.getApiVersion(),
                vaultName,
                resourceGroupName,
                this.client.getSubscriptionId(),
                operationId,
                accept,
                context);
    }

    /**
     * Fetches the result of a triggered validate operation.
     *
     * @param vaultName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param operationId OperationID which represents the operation whose result needs to be fetched.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<ValidateOperationsResponseInner> getAsync(
        String vaultName, String resourceGroupName, String operationId) {
        return getWithResponseAsync(vaultName, resourceGroupName, operationId)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Fetches the result of a triggered validate operation.
     *
     * @param vaultName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param operationId OperationID which represents the operation whose result needs to be fetched.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response body along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<ValidateOperationsResponseInner> getWithResponse(
        String vaultName, String resourceGroupName, String operationId, Context context) {
        return getWithResponseAsync(vaultName, resourceGroupName, operationId, context).block();
    }

    /**
     * Fetches the result of a triggered validate operation.
     *
     * @param vaultName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param operationId OperationID which represents the operation whose result needs to be fetched.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ValidateOperationsResponseInner get(String vaultName, String resourceGroupName, String operationId) {
        return getWithResponse(vaultName, resourceGroupName, operationId, Context.NONE).getValue();
    }
}


text:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE toc
  PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 2.0//EN"
         "http://java.sun.com/products/javahelp/toc_2_0.dtd">

<toc version="2.0">
	<tocitem text="Gabay ng Gumagamit ng ZAP" tocid="toplevelitem">
		<tocitem text="Mga Add On" tocid="addons">
			<tocitem text="Mabilis na umpisa" image="icon147" target="quickstart">
				<tocitem text="Linya ng Kautusan"  target="quickstart.cmdline" />
				<tocitem text="Mga Opsyon ng Paglulunsad"  target="quickstart.launch.options" />
			</tocitem>
		</tocitem>
	</tocitem>
</toc>


text:
This is my implementation of Gupta's [Soundwave paper](http://research.microsoft.com/en-us/um/redmond/groups/cue/publications/guptasoundwavechi2012.pdf) for android. The project is heavily inspired by Daniel Rapp's [javascript plugin](https://github.com/DanielRapp/doppler) for the same effect.

##How to Use
I haven't figured out how to work this project into gradle/maven, so the only way to use it at the moment is to download the library as a zip and add it to your Android Studio project as a module.

To use the library in your code, just initialize a new Doppler instance, and start it:

    Doppler doppler = new Doppler();
    doppler.start();
    //also, make sure to pause doppler when the user exits your app:
    doppler.pause();

You can then start listening for gestures by attach a GestureListener:

    doppler.setOnGestureCallback(new Doppler.OnGestureListener() {
      public void onPush() {
        //scroll down
      }
      public void onPull() {
        //scroll up
      }
      public void onTap() {
        //click button
      }
      public void onDoubleTap() {
        //pause scrolling?
      }
    });

If you would rather manipulate the raw data, you can attach a ReadCallback as well:

    doppler.setOnReadCallback(new Doppler.OnReadCallback() {
      public void onBandwidthRead(int leftBandwidth, int rightBandwidth) {
        //play around with the bandwidth differences
      }
      public void onBinsRead(double[] bins) {
        //graph the frequency bin magnitudes, for example
      }
    });

The library is also set to automatically calibrate by default. I find that the best way to use this library is to let Doppler autocalibrate for several seconds before starting whatever task you intend to use it for. Thanks to (dracolytch)[https://github.com/DanielRapp/doppler/pull/9] for his autocalibration algorithm.

Should you wish to turn off autocalibration, just call the method:

    doppler.setCalibrate(false);

##Disclaimer
I was only able to test the library on my OnePlus One so far, so the library may still be a little buggy. Also, I get some jagged lines near the edges of the 20k frequency reading, which may either be caused by bad code or my device.

Some times, this causes Doppler to bug out and "lock" to one direction, so if this happens, just reinitialize the Doppler instance and it should work again.


text:
namespace formulate.app.Backoffice.Trees.Helpers
{

    // Namespaces.
    using core.Extensions;
    using Entities;
    using Folders;
    using formulate.app.Helpers;
    using System;
    using System.Collections.Generic;
    using System.Net.Http.Formatting;
    using Umbraco.Web.Models.Trees;
    using Umbraco.Web.Trees;
    using Validations;
    using ValidationConstants = formulate.app.Constants.Trees.Validations;

    /// <summary>
    /// Helps with validations in the Formulate tree.
    /// </summary>
    internal class ValidationHelper
    {

        #region Properties

        /// <summary>
        /// The tree controller.
        /// </summary>
        private TreeController Tree { get; set; }

        /// <summary>
        /// The folder helper.
        /// </summary>
        private FolderHelper Helper { get; set; }
        private ILocalizationHelper LocalizationHelper { get; set; }

        #endregion

        #region Constructors

        /// <summary>
        /// Primary constructor.
        /// </summary>
        /// <param name="tree">
        /// The tree controller.
        /// </param>
        /// <param name="helper">
        /// The folder helper.
        /// </param>
        public ValidationHelper(TreeController tree, FolderHelper helper, ILocalizationHelper localizationHelper)
        {
            Tree = tree;
            Helper = helper;
            LocalizationHelper = localizationHelper;
        }

        #endregion

        #region Methods

        /// <summary>
        /// Adds the specified validation entities (validation or folder)
        /// to the tree.
        /// </summary>
        /// <param name="nodes">
        /// The collection to add the nodes to.
        /// </param>
        /// <param name="queryStrings">The query strings.</param>
        /// <param name="entities">
        /// The entities (validations and folders) to add to the tree.
        /// </param>
        public void AddValidationChildrenToTree(TreeNodeCollection nodes,
            FormDataCollection queryStrings, IEnumerable<IEntity> entities)
        {
            foreach (var entity in entities)
            {

                // Folder or validation?
                if (entity is Folder)
                {
                    var folder = entity as Folder;
                    Helper.AddFolderToTree(nodes, queryStrings, folder,
                        ValidationConstants.GroupIcon);
                }
                else if (entity is Validation)
                {
                    var validation = entity as Validation;
                    AddValidationToTree(nodes, queryStrings, validation);
                }

            }
        }

        /// <summary>
        /// Adds a validation node to the tree.
        /// </summary>
        /// <param name="nodes">
        /// The node collection to add the validation to.
        /// </param>
        /// <param name="queryStrings">The query strings.</param>
        /// <param name="validation">The validation to add.</param>
        public void AddValidationToTree(TreeNodeCollection nodes,
            FormDataCollection queryStrings, Validation validation)
        {
            var formatUrl = "/formulate/formulate/editValidation/{0}";
            var validationId = GuidHelper.GetString(validation.Id);
            var validationRoute = string.Format(formatUrl, validationId);
            var validationName = validation.Name.Fallback("Unnamed");
            var parentId = validation.Path[validation.Path.Length - 2];
            var strParentId = GuidHelper.GetString(parentId);
            var validationNode = Tree.CreateTreeNode(validationId,
                strParentId, queryStrings, validationName,
                ValidationConstants.ItemIcon, false, validationRoute);
            nodes.Add(validationNode);
        }

        /// <summary>
        /// Adds the "Delete Validation" action to the validation node.
        /// </summary>
        /// <param name="menu">
        /// The menu to add the action to.
        /// </param>
        public void AddDeleteValidationAction(MenuItemCollection menu)
        {
            var path = "/App_Plugins/formulate/menu-actions/deleteValidation.html";
            var menuItem = new MenuItem()
            {
                Alias = "deleteValidation",
                Icon = "formulate-delete",
                Name = LocalizationHelper.GetMenuItemName("Delete Validation")
            };
            menuItem.LaunchDialogView(path, "Delete Validation");
            menu.Items.Add(menuItem);
        }

        /// <summary>
        /// Adds the "Move" action to the menu.
        /// </summary>
        /// <param name="menu">
        /// The menu items to add the action to.
        /// </param>
        /// <param name="validation">
        /// The validation.
        /// </param>
        public void AddMoveValidationAction(MenuItemCollection menu, Validation validation)
        {
            var path = "/App_Plugins/formulate/menu-actions/moveValidation.html";
            var menuItem = new MenuItem()
            {
                Alias = "moveValidation",
                Icon = "formulate-move",
                Name = LocalizationHelper.GetMenuItemName("Move")
            };
            var titleFormat = @"Move ""{0}"" Validation";
            var title = string.Format(titleFormat, validation.Name);
            menuItem.LaunchDialogView(path, title);
            menu.Items.Add(menuItem);
        }

        /// <summary>
        /// Adds the "Create Validation" action with the specified ID used
        /// as the parent for the validation that is created.
        /// </summary>
        /// <param name="menu">
        /// The menu to add the action to.
        /// </param>
        /// <param name="entityId">
        /// The ID of the entity to create the validation under.
        /// If null, the validation will be created at the root.
        /// </param>
        public void AddCreateValidationAction(MenuItemCollection menu,
            Guid? entityId = null)
        {
            var path = "/App_Plugins/formulate/menu-actions/createValidation.html";
            var menuItem = new MenuItem()
            {
                Alias = "createValidation",
                Icon = "formulate-create",
                Name = LocalizationHelper.GetMenuItemName("Create Validation")
            };
            if (entityId.HasValue)
            {
                path = path + "?under=" + GuidHelper.GetString(entityId.Value);
            }
            menuItem.LaunchDialogView(path, "Create Validation");
            menu.Items.Add(menuItem);
        }

        #endregion

    }

}


text:
namespace Azure.ResourceManager.Network.Models
{
    /// <summary> The ip configuration for a container network interface. </summary>
    public partial class ContainerNetworkInterfaceIpConfiguration
    {
        /// <summary> Initializes a new instance of ContainerNetworkInterfaceIpConfiguration. </summary>
        public ContainerNetworkInterfaceIpConfiguration()
        {
        }

        /// <summary> Initializes a new instance of ContainerNetworkInterfaceIpConfiguration. </summary>
        /// <param name="name"> The name of the resource. This name can be used to access the resource. </param>
        /// <param name="type"> Sub Resource type. </param>
        /// <param name="etag"> A unique read-only string that changes whenever the resource is updated. </param>
        /// <param name="provisioningState"> The provisioning state of the container network interface IP configuration resource. </param>
        internal ContainerNetworkInterfaceIpConfiguration(string name, string type, string etag, ProvisioningState? provisioningState)
        {
            Name = name;
            Type = type;
            Etag = etag;
            ProvisioningState = provisioningState;
        }

        /// <summary> The name of the resource. This name can be used to access the resource. </summary>
        public string Name { get; set; }
        /// <summary> Sub Resource type. </summary>
        public string Type { get; }
        /// <summary> A unique read-only string that changes whenever the resource is updated. </summary>
        public string Etag { get; }
        /// <summary> The provisioning state of the container network interface IP configuration resource. </summary>
        public ProvisioningState? ProvisioningState { get; }
    }
}


text:
package cc.factorie.app.nlp.lemma
import cc.factorie.app.nlp._

class SimplifyDigitsLemmatizer extends DocumentAnnotator {
  def lemmatize(word:String): String = cc.factorie.app.strings.simplifyDigits(word)
  def process(document:Document): Document = {
    for (token <- document.tokens) token.attr += new SimplifyDigitsTokenLemma(token, lemmatize(token.string))
    document
  }
  override def tokenAnnotationString(token:Token): String = { val l = token.attr[SimplifyDigitsTokenLemma]; l.value }
  def prereqAttrs: Iterable[Class[_]] = List(classOf[Token])
  def postAttrs: Iterable[Class[_]] = List(classOf[SimplifyDigitsTokenLemma])
}
object SimplifyDigitsLemmatizer extends SimplifyDigitsLemmatizer

class SimplifyDigitsTokenLemma(token:Token, s:String) extends TokenLemma(token, s)


text:
<?php

namespace Padel\LeagueBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Padel\LeagueBundle\Entity\Stage;
use Padel\LeagueBundle\Entity\League;
use Padel\LeagueBundle\Form\StageType;

class StagesController extends Controller {

    public function createAction($id) {

        $stage = new Stage();

        $form = $this->get('form.factory')
                ->create(new StageType(), $stage);
        $request = $this->get('request');

        if ($request->getMethod() == 'POST') {
            $league = new League();
            $manager = $this->get('doctrine')->getEntityManager();
            $league = $manager->getRepository('PadelLeagueBundle:League')->findOneById($id);
            $form->bindRequest($request);
            if ($form->isValid()) {
                $stage->setLeague($league);
                $manager->persist($stage);
                $manager->flush();
                return $this->redirect($this->generateUrl('league_manager', array('id' => $id)));
            }
        }
        return $this->render('PadelLeagueBundle:Stages:create.html.twig', array(
            'form' => $form->createView(),
            'id' => $id
        ));
    }

    public function deleteAction($id) {

        $stage = new Stage();
        $request = $this->get('request');

        if ($request->getMethod() == 'POST') {
            $manager = $this->get('doctrine')->getEntityManager();
            $stage = $manager->getRepository('PadelLeagueBundle:Stage')->findOneById($id);
            $leagueId = $stage->getLeague()->getId();

            if (!$stage) {
                throw $this->createNotFoundException('No division found for id ' . $stage->getId());
            }

            $manager->remove($stage);
            $manager->flush();
            return $this->redirect($this->generateUrl('league_manager', array('id' => $leagueId)));
        }
    }

    public function managerAction($id) {

        $stage = new Stage();
        $manager = $this->get('doctrine')->getEntityManager();
        $stage = $manager->getRepository('PadelLeagueBundle:Stage')->findOneById($id);
        $leagueId = $stage->getLeague()->getId();

        $form = $this->get('form.factory')
                ->create(new StageType(), $stage);
        $request = $this->get('request');

        if ($request->getMethod() == 'POST') {
            $form->bindRequest($request);
            if ($form->isValid()) {
                $manager->flush();
                return $this->redirect($this->generateUrl('league_manager', array('id' => $leagueId)));
            }
        }

        $divisions = $this->get('doctrine')
                ->getEntityManager()
                ->getRepository('PadelLeagueBundle:Division')
                ->findByStage($stage->getId());

        $error = '';
        if (!$divisions) {
            $error = "The are no divisions in this stage at the moment.";
        }

        return $this->render('PadelLeagueBundle:Stages:manager.html.twig', array(
            'form' => $form->createView(),
            'id' => $id,
            'divisions' => $divisions,
            'error' => $error
        ));
    }

}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

  <title>Docs For Class Swift_Mime_Headers_AbstractHeader</title>
  <link rel="stylesheet" href="../../media/stylesheet.css" />

<link id="webfx-tab-style-sheet" type="text/css" rel="stylesheet" href="../../media/lib/tab.webfx.css" />

	Class Swift_Mime_Headers_AbstractHeader

 (line 21)

Description

	Located in File: /vendors/swiftMailer/classes/Swift/Mime/Headers/AbstractHeader.php

An abstract base MIME Header.

author: - Chris Corbyn

abstract: -

Classes extended from Swift_Mime_Headers_AbstractHeader:

Swift_Mime_Headers_DateHeader

A Date MIME Header for Swift Mailer.

Swift_Mime_Headers_IdentificationHeader

An ID MIME Header for something like Message-ID or Content-ID.

Swift_Mime_Headers_MailboxHeader

A Mailbox Address MIME Header for something like From or Sender.

Swift_Mime_Headers_PathHeader

A Path Header in Swift Mailer, such a Return-Path.

Swift_Mime_Headers_UnstructuredHeader

A Simple MIME Header.

Class Variables

Summary:

Class Constants

Summary:

Method Detail

Summary:

            void
        clearCachedValueIf
        (boolean $condition)

            string
        createPhrase
        (Swift_Mime_Header $header, string $string, string $charset, [Swift_Mime_HeaderEncoder $encoder = null], [boolean $shorten = false])

            string
        encodeWords
        (Swift_Mime_Header $header, string $input, [ $usedLength = -1], string $usedLength,)

            string
        escapeSpecials
        (string $token, [string[] $include = array()], [string[] $exclude = array()])

            string[]
        generateTokenLines
        (string $token)

            string
        getCachedValue
        ()

            string
        getCharset
        ()

            string[]
        getEncodableWordTokens
        (string $string)

            Swift_Mime_HeaderEncoder
        getEncoder
        ()

            string
        getFieldName
        ()

            string
        getGrammar
        (string $name)

            string
        getLanguage
        ()

            int
        getMaxLineLength
        ()

            string
        getTokenAsEncodedWord
        (string $token, [ $firstLineOffset = 0], int $firstLineOffset,)

            void
        initializeGrammar
        ()

            void
        setCachedValue
        (string $value)

            void
        setCharset
        (string $charset)

            void
        setEncoder
        (Swift_Mime_HeaderEncoder $encoder)

            void
        setFieldName
        (string $name)

            void
        setLanguage
        (string $lang)

            void
        setMaxLineLength
        (int $lineLength)

            boolean
        tokenNeedsEncoding
        (string $token)

            string
        toString
        ()

            string[]
        toTokens
        ([string $string = null])

            string
        __toString
        ()

 Method clearCachedValueIf (line 525)

void clearCachedValueIf(
boolean
$condition)

Clear the cached value if $condition is met.

Parameters

boolean $condition:

Info

access - protected

 Method createPhrase (line 325)

string createPhrase(
Swift_Mime_Header
$header, string
$string, string
$charset, [Swift_Mime_HeaderEncoder
$encoder = null], [boolean
$shorten = false])

Produces a compliant, formatted RFC 2822 'phrase' based on the string given.

Parameters

Swift_Mime_Header $header:

string $string: as displayed

string $charset: of the text

Swift_Mime_HeaderEncoder $encoder:

boolean $shorten: the first line to make remove for header name

Info

access - protected

 Method encodeWords (line 366)

string encodeWords(
Swift_Mime_Header
$header, string
$input, [
$usedLength = -1], string
$usedLength,)

Encode needed word tokens within a string of input.

Parameters

string $input:

string $usedLength,: optional

Swift_Mime_Header $header:

 $usedLength:

Info

access - protected

 Method escapeSpecials (line 305)

string escapeSpecials(
string
$token, [string[]
$include = array()], [string[]
$exclude = array()])

Escape special characters in a string (convert to quoted-pairs).

Parameters

string $token:

string[] $include: additonal chars to escape

string[] $exclude: chars from escaping

Info

access - protected

 Method generateTokenLines (line 495)

string[] generateTokenLines(
string
$token)

Generates tokens from the given string which include CRLF as individual tokens.

Parameters

string $token:

Info

access - protected

 Method getCachedValue (line 515)

string getCachedValue(
)

Get the value in the cache.

Info

access - protected

 Method getCharset (line 97)

string getCharset(
)

Get the character set used in this Header.

Info

access - public

 Method getEncodableWordTokens (line 420)

string[] getEncodableWordTokens(
string
$string)

Splits a string into tokens in blocks of words which can be encoded quickly.

Parameters

string $string:

Info

access - protected

 Method getEncoder (line 137)

Swift_Mime_HeaderEncoder getEncoder(
)

Get the encoder used for encoding this Header.

Info

access - public

 Method getFieldName (line 146)

string getFieldName(
)

Implementation of:

Swift_Mime_Header::getFieldName()

Get the name of this header (e.g. Subject).

Get the name of this header (e.g. charset).

Info

access - public

 Method getGrammar (line 284)

string getGrammar(
string
$name)

Get the grammar defined for $name token.

Parameters

string $name: execatly as written in the RFC

Info

access - protected

 Method getLanguage (line 118)

string getLanguage(
)

Get the language used in this Header.

Info

access - public

 Method getMaxLineLength (line 165)

int getMaxLineLength(
)

Get the maximum permitted length of lines in this Header.

Info

access - public

 Method getTokenAsEncodedWord (line 456)

string getTokenAsEncodedWord(
string
$token, [
$firstLineOffset = 0], int
$firstLineOffset,)

Get a token as an encoded word for safe insertion into headers.

Parameters

string $token: to encode

int $firstLineOffset,: optional

 $firstLineOffset:

Info

access - protected

 Method initializeGrammar (line 208)

void initializeGrammar(
)

Initialize some RFC 2822 (and friends) ABNF grammar definitions.

Info

access - protected

 Method setCachedValue (line 505)

void setCachedValue(
string
$value)

Set a value into the cache.

Parameters

string $value:

Info

access - protected

 Method setCharset (line 83)

void setCharset(
string
$charset)

Overridden in child classes as:

Swift_Mime_Headers_ParameterizedHeader::setCharset()

Set the character set used in this Header.

Implementation of:

Swift_Mime_Header::setCharset()

Set the charset used when rendering the Header.

Set the character set used in this Header.

Parameters

string $charset:

Info

access - public

 Method setEncoder (line 127)

void setEncoder(
Swift_Mime_HeaderEncoder
$encoder)

Set the encoder used for encoding the header.

Parameters

Swift_Mime_HeaderEncoder $encoder:

Info

access - public

 Method setFieldName (line 199)

void setFieldName(
string
$name)

Set the name of this Header field.

Parameters

string $name:

Info

access - protected

 Method setLanguage (line 108)

void setLanguage(
string
$lang)

Set the language used in this Header.

For example, for US English, 'en-us'.  This can be unspecified.

Parameters

string $lang:

Info

access - public

 Method setMaxLineLength (line 155)

void setMaxLineLength(
int
$lineLength)

Set the maximum length of lines in the header (excluding EOL).

Parameters

int $lineLength:

Info

access - public

 Method tokenNeedsEncoding (line 410)

boolean tokenNeedsEncoding(
string
$token)

Test if a token needs to be encoded or not.

Parameters

string $token:

Info

access - protected

 Method toString (line 175)

string toString(
)

Implementation of:

Swift_Mime_Header::toString()

Get this Header rendered as a compliant string.

Get this Header rendered as a RFC 2822 compliant string.

Info

throws - Swift_RfcComplianceException

access - public

 Method toTokens (line 541)

string[] toTokens(
[string
$string = null])

Overridden in child classes as:

Swift_Mime_Headers_ParameterizedHeader::toTokens()

Generate a list of all tokens in the final header.

Generate a list of all tokens in the final header.

Parameters

string $string: input, optional

Info

access - protected

 Method __toString (line 187)

string __toString(
)

Returns a string representation of this object.

Info

see - Swift_Mime_Headers_AbstractHeader::toString()

access - public

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary

		Documentation generated on Fri, 12 Nov 2010 20:45:09 +0000 by phpDocumentor 1.4.3


text:
<?php

namespace Epfc\JobeetBundle\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class CategoryControllerTest extends WebTestCase
{
    /*public function testShow()
    {
      $client = static::createClient();

      $crawler = $client->request('GET', '/category/programming/2');
      $this->assertEquals('Epfc\JobeetBundle\Controller\CategoryController::showAction', $client->getRequest()->attributes->get('_controller'));
      $this->assertTrue(200 === $client->getResponse()->getStatusCode());
    }*/

    public function testShow()
    {
      // get the custom parameters from app config.yml
      $kernel = static::createKernel();
      $kernel->boot();
      $max_jobs_on_homepage = $kernel->getContainer()->getParameter('max_jobs_on_homepage');
      $max_jobs_on_category = $kernel->getContainer()->getParameter('max_jobs_on_category');

      $client = static::createClient();

      // categories on homepage are clickable
      $crawler = $client->request('GET', '/category/');
      $link = $crawler->selectLink('Programming')->link();
      $crawler = $client->click($link);
      $this->assertEquals('Epfc\JobeetBundle\Controller\CategoryController::showAction', $client->getRequest()->attributes->get('_controller'));
      $this->assertEquals('Programming', $client->getRequest()->attributes->get('slug'));

      // categories with more than $max_jobs_on_homepage jobs also have a "more" link
      $crawler = $client->request('GET', '/');
      $link = $crawler->selectLink('22')->link();
      $crawler = $client->click($link);
      $this->assertEquals('Epfc\JobeetBundle\Controller\CategoryController::showAction', $client->getRequest()->attributes->get('_controller'));
      $this->assertEquals('programming', $client->getRequest()->attributes->get('slug'));

      // only $max_jobs_on_category jobs are listed
      $this->assertTrue($crawler->filter('.jobs tr')->count() == 20);
      $this->assertRegExp('/32 jobs/', $crawler->filter('.pagination_desc')->text());
      $this->assertRegExp('/page 1\/2/', $crawler->filter('.pagination_desc')->text());

      $link = $crawler->selectLink('2')->link();
      $crawler = $client->click($link);
      $this->assertEquals(2, $client->getRequest()->attributes->get('page'));
      $this->assertRegExp('/page 2\/2/', $crawler->filter('.pagination_desc')->text());
    }
    /*
    public function testCompleteScenario()
    {
        // Create a new client to browse the application
        $client = static::createClient();

        // Create a new entry in the database
        $crawler = $client->request('GET', '/category/');
        $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /category/");
        $crawler = $client->click($crawler->selectLink('Create a new entry')->link());

        // Fill in the form and submit it
        $form = $crawler->selectButton('Create')->form(array(
            'epfc_jobeetbundle_category[field_name]'  => 'Test',
            // ... other fields to fill
        ));

        $client->submit($form);
        $crawler = $client->followRedirect();

        // Check data in the show view
        $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")');

        // Edit the entity
        $crawler = $client->click($crawler->selectLink('Edit')->link());

        $form = $crawler->selectButton('Update')->form(array(
            'epfc_jobeetbundle_category[field_name]'  => 'Foo',
            // ... other fields to fill
        ));

        $client->submit($form);
        $crawler = $client->followRedirect();

        // Check the element contains an attribute with value equals "Foo"
        $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]');

        // Delete the entity
        $client->submit($crawler->selectButton('Delete')->form());
        $crawler = $client->followRedirect();

        // Check the entity has been delete on the list
        $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());
    }

    */
}