text:
package misc

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"

	"github.com/go-swagger/go-swagger/client"
	"github.com/go-swagger/go-swagger/httpkit"
	"github.com/go-swagger/go-swagger/strfmt"

	"github.com/tangr1/hicto/models"
)

type PostInvitecodesReader struct {
	formats strfmt.Registry
}

func (o *PostInvitecodesReader) ReadResponse(response client.Response, consumer httpkit.Consumer) (interface{}, error) {
	switch response.Code() {

	case 201:
		result := NewPostInvitecodesCreated()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil

	case 400:
		result := NewPostInvitecodesBadRequest()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	case 401:
		result := NewPostInvitecodesUnauthorized()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	case 403:
		result := NewPostInvitecodesForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	case 500:
		result := NewPostInvitecodesInternalServerError()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result

	default:
		return nil, NewAPIError("unknown error", response, response.Code())
	}
}

// NewPostInvitecodesCreated creates a PostInvitecodesCreated with default headers values
func NewPostInvitecodesCreated() *PostInvitecodesCreated {
	return &PostInvitecodesCreated{}
}

/*PostInvitecodesCreated

成功生成邀请码
*/
type PostInvitecodesCreated struct {
	Payload *models.InviteCode
}

func (o *PostInvitecodesCreated) Error() string {
	return fmt.Sprintf("[POST /invitecodes/][%d] postInvitecodesCreated  %+v", 201, o.Payload)
}

func (o *PostInvitecodesCreated) readResponse(response client.Response, consumer httpkit.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.InviteCode)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil {
		return err
	}

	return nil
}

// NewPostInvitecodesBadRequest creates a PostInvitecodesBadRequest with default headers values
func NewPostInvitecodesBadRequest() *PostInvitecodesBadRequest {
	return &PostInvitecodesBadRequest{}
}

/*PostInvitecodesBadRequest

无效请求
*/
type PostInvitecodesBadRequest struct {
	Payload *models.Error
}

func (o *PostInvitecodesBadRequest) Error() string {
	return fmt.Sprintf("[POST /invitecodes/][%d] postInvitecodesBadRequest  %+v", 400, o.Payload)
}

func (o *PostInvitecodesBadRequest) readResponse(response client.Response, consumer httpkit.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil {
		return err
	}

	return nil
}

// NewPostInvitecodesUnauthorized creates a PostInvitecodesUnauthorized with default headers values
func NewPostInvitecodesUnauthorized() *PostInvitecodesUnauthorized {
	return &PostInvitecodesUnauthorized{}
}

/*PostInvitecodesUnauthorized

未认证
*/
type PostInvitecodesUnauthorized struct {
	Payload *models.Error
}

func (o *PostInvitecodesUnauthorized) Error() string {
	return fmt.Sprintf("[POST /invitecodes/][%d] postInvitecodesUnauthorized  %+v", 401, o.Payload)
}

func (o *PostInvitecodesUnauthorized) readResponse(response client.Response, consumer httpkit.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil {
		return err
	}

	return nil
}

// NewPostInvitecodesForbidden creates a PostInvitecodesForbidden with default headers values
func NewPostInvitecodesForbidden() *PostInvitecodesForbidden {
	return &PostInvitecodesForbidden{}
}

/*PostInvitecodesForbidden

无访问权限
*/
type PostInvitecodesForbidden struct {
	Payload *models.Error
}

func (o *PostInvitecodesForbidden) Error() string {
	return fmt.Sprintf("[POST /invitecodes/][%d] postInvitecodesForbidden  %+v", 403, o.Payload)
}

func (o *PostInvitecodesForbidden) readResponse(response client.Response, consumer httpkit.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil {
		return err
	}

	return nil
}

// NewPostInvitecodesInternalServerError creates a PostInvitecodesInternalServerError with default headers values
func NewPostInvitecodesInternalServerError() *PostInvitecodesInternalServerError {
	return &PostInvitecodesInternalServerError{}
}

/*PostInvitecodesInternalServerError

服务端内部错误
*/
type PostInvitecodesInternalServerError struct {
	Payload *models.Error
}

func (o *PostInvitecodesInternalServerError) Error() string {
	return fmt.Sprintf("[POST /invitecodes/][%d] postInvitecodesInternalServerError  %+v", 500, o.Payload)
}

func (o *PostInvitecodesInternalServerError) readResponse(response client.Response, consumer httpkit.Consumer, formats strfmt.Registry) error {

	o.Payload = new(models.Error)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil {
		return err
	}

	return nil
}


text:
package com.nasageek.utexasutilities.model;

import android.os.Parcel;
import android.os.Parcelable;
import android.util.Log;

import java.io.Serializable;
import java.util.Locale;

public class BBClass implements Parcelable, Serializable {

    private static final long serialVersionUID = 1L;
    private String name;
    private String bbid;
    private String fullcourseid;
    private String semester;
    private String unique;
    private String courseid;
    private String fullName;

    private boolean courseIdAvailable, fullCourseIdTooShort;

    public static Parcelable.Creator<BBClass> CREATOR = new Parcelable.Creator<BBClass>() {

        @Override
        public BBClass createFromParcel(Parcel source) {
            return new BBClass(source);
        }

        @Override
        public BBClass[] newArray(int size) {
            return new BBClass[size];
        }
    };

    public BBClass(Parcel in) {
        name = in.readString();
        bbid = in.readString();
        fullcourseid = in.readString();
        semester = in.readString();
        unique = in.readString();
        courseid = in.readString();
        boolean[] temp = new boolean[2];
        in.readBooleanArray(temp);
        courseIdAvailable = temp[0];
        fullCourseIdTooShort = temp[1];
    }

    // TODO: move auto-formatting into a separate method?
    public BBClass(String name, String bbid, String fullcourseid) {
        if (!fullcourseid.matches("^\\d{4}_[a-z]+?_\\d{5}_[A-Za-z]+?_\\w+$")) {
            Log.d("BBClass check", "Course ID malformed: " + fullcourseid);
        }
        if (!name.matches("^\\d{2}[A-Z]{1,2} .*?\\(\\d+?\\)$")) {
            Log.d("BBClass check", "Course Name malformed: " + name);
        }

        // names don't always have spaces, be careful!
        if (name.contains(" ")) {
            // TODO: might try this with a split[0] rather than the substring
            // TODO: this might not trim off Summer semester identifier, check
            // Alex's tablet
            // If we've got a date in the front (probably) chop it off
            if (name.substring(0, name.indexOf(" ")).matches("^\\d{2}[A-Z]{1,2}$")) {
                this.name = name.substring(name.indexOf(" ") + 1);
            } else {
                this.name = name;
            }
        } else {
            this.name = name;
        }

        // remove anything in parentheses, it's usually all superfluous
        this.name = this.name.replaceAll("\\(.*?\\)", "");
        // because the stuff in parentheses is generally at the beginning
        // or end, it leaves leading/trailing whitespace when removed
        this.name = this.name.trim();

        // the course ID seems to relatively consistently be the last 2 tokens
        // in the full ID, maybe just pull those out
        this.bbid = bbid;
        this.fullName = name;
        this.fullcourseid = fullcourseid;
        // some courseid's are malformed (ex. 00002), can't pull semester out of
        // that unfortunately
        try {
            // pulls the first section and second section of courseid,
            // capitalizes the first letter of the semester
            this.semester = fullcourseid.split("_")[0] + " "
                    + (fullcourseid.split("_")[1].charAt(0) + "").toUpperCase(Locale.US)
                    + fullcourseid.split("_")[1].substring(1);
        } catch (Exception ex) {
            ex.printStackTrace();
            this.semester = "Unknown";
        }

        if (fullcourseid.split("_").length >= 3) {
            fullCourseIdTooShort = false;
            this.unique = fullcourseid.split("_")[2];
            // assumes Course ID is directly after unique_ and is at the end of
            // the string
            // will fail if unique start is less than 6 characters from the end
            // of the string.
            try {
                courseid = fullcourseid.substring(fullcourseid.indexOf(unique) + 6)
                        .replaceAll("_", " ");
                courseIdAvailable = true;
            } catch (Exception ex) {
                courseIdAvailable = false;
            }
        } else {
            fullCourseIdTooShort = true;
        }
    }

    public boolean isFullCourseIdTooShort() {
        return fullCourseIdTooShort;
    }

    public boolean isCourseIdAvailable() {
        return courseIdAvailable;
    }

    public String getCourseId() {
        return courseid;
    }

    public String getUnique() {
        return unique;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getBbid() {
        return bbid;
    }

    public void setBbid(String bbid) {
        this.bbid = bbid;
    }

    public String getFullCourseid() {
        return fullcourseid;
    }

    public void setFullCourseid(String fullcourseid) {
        this.fullcourseid = fullcourseid;
    }

    public String getSemester() {
        return semester;
    }

    public void setSemester(String semester) {
        this.semester = semester;
    }

    public String getFullName() {
        return fullName;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {

        dest.writeString(name);
        dest.writeString(bbid);
        dest.writeString(fullcourseid);
        dest.writeString(semester);
        dest.writeString(unique);
        dest.writeString(courseid);
        dest.writeBooleanArray(new boolean[] {
                courseIdAvailable, fullCourseIdTooShort
        });

    }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace SuperClosure;

use SuperClosure\Analyzer\AstAnalyzer as DefaultAnalyzer;
use SuperClosure\Analyzer\ClosureAnalyzer;

/**
 * This is the serializer class used for serializing Closure objects.
 *
 * We're abstracting away all the details, impossibilities, and scary things
 * that happen within.
 */
class Serializer implements SerializerInterface {

    /**
     * The special value marking a recursive reference to a closure.
     *
     * @var string
     */
    const RECURSION = "{{RECURSION}}";

    /**
     * The keys of closure data required for serialization.
     *
     * @var array
     */
    private static $dataToKeep = [
        'code' => true,
        'context' => true,
        'binding' => true,
        'scope' => true,
        'isStatic' => true,
    ];

    /**
     * The closure analyzer instance.
     *
     * @var ClosureAnalyzer
     */
    private $analyzer;

    /**
     * Create a new serializer instance.
     *
     * @param ClosureAnalyzer|null $analyzer
     */
    public function __construct(ClosureAnalyzer $analyzer = null) {
        $this->analyzer = $analyzer ? : new DefaultAnalyzer;
    }

    /**
     * @inheritDoc
     */
    public function serialize(\Closure $closure) {
        return serialize(new SerializableClosure($closure, $this));
    }

    /**
     * @inheritDoc
     */
    public function unserialize($serialized) {
        /** @var SerializableClosure $unserialized */
        $unserialized = unserialize($serialized);

        return $unserialized->getClosure();
    }

    /**
     * @inheritDoc
     */
    public function getData(\Closure $closure, $forSerialization = false) {
        // Use the closure analyzer to get data about the closure.
        $data = $this->analyzer->analyze($closure);

        // If the closure data is getting retrieved solely for the purpose of
        // serializing the closure, then make some modifications to the data.
        if ($forSerialization) {
            // If there is no reference to the binding, don't serialize it.
            if (!$data['hasThis']) {
                $data['binding'] = null;
            }

            // Remove data about the closure that does not get serialized.
            $data = array_intersect_key($data, self::$dataToKeep);

            // Wrap any other closures within the context.
            foreach ($data['context'] as &$value) {
                if ($value instanceof \Closure) {
                    $value = ($value === $closure) ? self::RECURSION : new SerializableClosure($value, $this);
                }
            }
        }

        return $data;
    }

    /**
     * Recursively traverses and wraps all Closure objects within the value.
     *
     * NOTE: THIS MAY NOT WORK IN ALL USE CASES, SO USE AT YOUR OWN RISK.
     *
     * @param mixed $data Any variable that contains closures.
     * @param SerializerInterface $serializer The serializer to use.
     */
    public static function wrapClosures(&$data, SerializerInterface $serializer) {
        if ($data instanceof \Closure) {
            $reflection = new \ReflectionFunction($data);
            if ($binding = $reflection->getClosureThis()) {
                self::wrapClosures($binding, $serializer);
                $scope = $reflection->getClosureScopeClass();
                $scope = $scope ? $scope->getName() : 'static';
                $data = $data->bindTo($binding, $scope);
            }
            $data = new SerializableClosure($data, $serializer);
        } elseif (is_array($data) || $data instanceof \stdClass || $data instanceof \Traversable) {
            foreach ($data as &$value) {
                self::wrapClosures($value, $serializer);
            }
        } elseif (is_object($data) && !$data instanceof \Serializable) {
            $reflection = new \ReflectionObject($data);
            if (!$reflection->hasMethod('__sleep')) {
                foreach ($reflection->getProperties() as $property) {
                    if ($property->isPrivate() || $property->isProtected()) {
                        $property->setAccessible(true);
                    }
                    $value = $property->getValue($data);
                    self::wrapClosures($value, $serializer);
                    $property->setValue($data, $value);
                }
            }
        }
    }

}


text:
<?php

namespace BingAds\Reporting;

/**
 * The GeographicalLocationReportRequest and corresponding programming elements are deprecated, and instead you should use the GeoLocationPerformanceReportRequest.
 *
 * @link http://msdn.microsoft.com/en-us/library/dn393955(v=msads.90).aspx GeographicalLocationReportRequest Data Object
 *
 * @uses NonHourlyReportAggregation
 * @uses GeographicalLocationReportColumn
 * @uses GeographicalLocationReportFilter
 * @uses AccountThroughAdGroupReportScope
 * @uses ReportTime
 */
final class GeographicalLocationReportRequest extends ReportRequest
{
    /**
     * The type of aggregation to use to aggregate the report data.
     *
     * @var NonHourlyReportAggregation
     */
    public $Aggregation;
    /**
     * The list of attributes and performance statistics to include in the report.
     *
     * @var GeographicalLocationReportColumn[]
     */
    public $Columns;
    /**
     * The filter information to use to filter the report data.
     *
     * @var GeographicalLocationReportFilter
     */
    public $Filter;
    /**
     * The scope of the report.
     *
     * @var AccountThroughAdGroupReportScope
     */
    public $Scope;
    /**
     * The time period to use for the report.
     *
     * @var ReportTime
     */
    public $Time;
}


text:
namespace base {
class DictionaryValue;
class ListValue;
}  // namespace base

namespace net {
class AuthChallengeInfo;
class URLRequest;
class X509Certificate;
class HttpResponseHeaders;
struct CertPrincipal;
}  // namespace net

namespace network {
struct ResourceRequest;
}

namespace mate {

template <>
struct Converter<net::AuthChallengeInfo> {
  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
                                   const net::AuthChallengeInfo& val);
};

template <>
struct Converter<scoped_refptr<net::X509Certificate>> {
  static v8::Local<v8::Value> ToV8(
      v8::Isolate* isolate,
      const scoped_refptr<net::X509Certificate>& val);

  static bool FromV8(v8::Isolate* isolate,
                     v8::Local<v8::Value> val,
                     scoped_refptr<net::X509Certificate>* out);
};

template <>
struct Converter<net::CertPrincipal> {
  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
                                   const net::CertPrincipal& val);
};

template <>
struct Converter<net::HttpResponseHeaders*> {
  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
                                   net::HttpResponseHeaders* headers);
  static bool FromV8(v8::Isolate* isolate,
                     v8::Local<v8::Value> val,
                     net::HttpResponseHeaders* out);
};

template <>
struct Converter<network::ResourceRequest> {
  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
                                   const network::ResourceRequest& val);
};

}  // namespace mate

namespace electron {

void FillRequestDetails(base::DictionaryValue* details,
                        const net::URLRequest* request);

void GetUploadData(base::ListValue* upload_data_list,
                   const net::URLRequest* request);

}  // namespace electron

#endif  // SHELL_COMMON_NATIVE_MATE_CONVERTERS_NET_CONVERTER_H_


text:
package ru.ydn.wicket.wicketorientdb;

import org.apache.wicket.Application;
import org.apache.wicket.Component;
import org.apache.wicket.DefaultExceptionMapper;
import org.apache.wicket.Page;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.authorization.UnauthorizedActionException;
import org.apache.wicket.core.request.handler.PageProvider;
import org.apache.wicket.core.request.handler.RenderPageRequestHandler;
import org.apache.wicket.request.IRequestHandler;
import org.apache.wicket.util.lang.Exceptions;

import com.orientechnologies.orient.core.exception.OSchemaException;
import com.orientechnologies.orient.core.exception.OSecurityException;
import com.orientechnologies.orient.core.exception.OValidationException;

/**
 * Extension of {@link DefaultExceptionMapper} for handling customly exceptions:
 * {@link OSecurityException}, {@link OValidationException}, {@link OSchemaException}, {@link IllegalStateException}
 */
public class OrientDefaultExceptionMapper extends DefaultExceptionMapper {

	@Override
	protected IRequestHandler mapExpectedExceptions(Exception ex, Application application) {
		Throwable th = null;
		if((th=Exceptions.findCause(ex, OSecurityException.class))!=null
				|| (th=Exceptions.findCause(ex, OValidationException.class))!=null
				|| (th=Exceptions.findCause(ex, OSchemaException.class))!=null
				|| (th=Exceptions.findCause(ex, IllegalStateException.class))!=null && Exceptions.findCause(ex, WicketRuntimeException.class)==null)
		{
			Page page = extractCurrentPage();
			if(page==null) {
				if(th instanceof OSecurityException)
					return (rh) -> OrientDbWebApplication.get().restartResponseAtSignInPage();
			}
			OrientDbWebSession.get().error(th.getMessage());
			return new RenderPageRequestHandler(new PageProvider(page),
									RenderPageRequestHandler.RedirectPolicy.ALWAYS_REDIRECT);
		}
		else if((th=Exceptions.findCause(ex, UnauthorizedActionException.class))!=null)
		{
			final Component component = ((UnauthorizedActionException)th).getComponent();
			return (rc) -> OrientDbWebApplication.get().onUnauthorizedInstantiation(component);
		}
		else
		{
			return super.mapExpectedExceptions(ex, application);
		}
	}

}


text:
#ifdef UWP
#include "..\adventures-of-orchi\Include\Input\TouchScreenController.hpp"
#include "Engine\Include\Diagnostics\PlayerSpeed.hpp"
#include "Engine\Include\Screen\TouchScreenParam.hpp"
#elif defined(IOS)
#include "TouchScreenController.hpp"
#endif

int TouchScreenController::STATE_0 = 0;
int TouchScreenController::STATE_1 = 1;
int TouchScreenController::STATE_2 = 2;
int TouchScreenController::STATE_3 = 3;

///
///
///
TouchScreenController::TouchScreenController(CoreWindow ^ window)
{
	m_nPreviousAButtonState = HOLD_STEADY;
	m_nPreviousBButtonState = HOLD_STEADY;
	m_nPreviousXButtonState = HOLD_STEADY;
	m_nPreviousYButtonState = HOLD_STEADY;
	m_nPreviousRBButtonState = HOLD_STEADY;
	m_nPreviousLBButtonState = HOLD_STEADY;

	m_nNorthButtonState = 0;
	m_nEastButtonState = 0;
	m_nSouthButtonState = 0;
	m_nWestButtonState = 0;
}

///
///
///
bool TouchScreenController::Update(
	ControllerParameter *,
	Controller *)
{
	return false;
}

///
///
///
int TouchScreenController::CheckAButton(ControllerParameter * pParam)
{
	int nCurrentAButtonState =
		(TouchScreenParam::GetInstance()->GetButtonStates(TouchScreenParam::BUTTONS_PAD) & A_PRESSED)
			== A_PRESSED ? 1 : 0;

	int nAButtonStateChange =
		nCurrentAButtonState - m_nPreviousAButtonState;

	m_nPreviousAButtonState = nCurrentAButtonState;

	return nAButtonStateChange;
}

///
///
///
int TouchScreenController::CheckBButton(ControllerParameter * pParam)
{
	int nCurrentBButtonState =
		(TouchScreenParam::GetInstance()->GetButtonStates(TouchScreenParam::BUTTONS_PAD) & B_PRESSED)
			== B_PRESSED ? 1 : 0;

	int nBButtonStateChange = nCurrentBButtonState - m_nPreviousBButtonState;

	m_nPreviousBButtonState = nCurrentBButtonState;

	return nBButtonStateChange;
}

///
///
///
int TouchScreenController::CheckXButton(ControllerParameter * pParam)
{
	int nCurrentXButtonState =
		(TouchScreenParam::GetInstance()->GetButtonStates(TouchScreenParam::BUTTONS_PAD) & X_PRESSED)
			== X_PRESSED ? 1 : 0;

	int nXButtonStateChange = nCurrentXButtonState - m_nPreviousXButtonState;

	m_nPreviousXButtonState = nCurrentXButtonState;

	return nXButtonStateChange;
}

///
///
///
int TouchScreenController::CheckYButton(ControllerParameter * pParam)
{
	int nCurrentYButtonState =
		(TouchScreenParam::GetInstance()->GetButtonStates(TouchScreenParam::BUTTONS_PAD) & Y_PRESSED)
			== Y_PRESSED ? 1 : 0;

	int nYButtonStateChange =
		nCurrentYButtonState - m_nPreviousYButtonState;

	m_nPreviousYButtonState = nCurrentYButtonState;

	return nYButtonStateChange;
}

///
///
///
double TouchScreenController::CheckLTButton(ControllerParameter * pParam)
{
	return 0.0;
}

///
///
///
void TouchScreenController::CheckLBButton(ControllerParameter * pParam)
{

}

///
///
///
double TouchScreenController::CheckRTButton(ControllerParameter * pParam)
{
	return 0.0;
}

///
///
///
int TouchScreenController::CheckRBButton(ControllerParameter * pParam)
{
	return 0;
}

///
///
///
bool TouchScreenController::CheckLeftThumbstick(
	ControllerParameter * pParam)
{
	HandleNorth(pParam);
	HandleEast(pParam);
	HandleSouth(pParam);
	HandleWest(pParam);

	return true;
}

///
///
///
void TouchScreenController::CheckRightThumbstick(ControllerParameter * pParam)
{

}

///
///
///
void TouchScreenController::CheckDirectionalKeypad(ControllerParameter * pParam)
{

}

///
///
///
void TouchScreenController::CheckKey(ControllerParameter * pParam)
{

}

///
///
///
bool TouchScreenController::GetIsConnected()
{
	return false;
}

///
///
///
int TouchScreenController::CheckNorthButton(ControllerParameter *)
{
	int nCurrentNorthButtonState =
		(TouchScreenParam::GetInstance()->GetButtonStates(TouchScreenParam::DIRECTIONAL_PAD) & NORTH_PRESSED)
			== NORTH_PRESSED ? 1 : 0;

	int nNorthButtonStateChange =
		nCurrentNorthButtonState - m_nPreviousNorthButtonState;

	m_nPreviousNorthButtonState = nCurrentNorthButtonState;

	return nNorthButtonStateChange;
}

///
///
///
int TouchScreenController::CheckEastButton(ControllerParameter *)
{
	int nCurrentEastButtonState =
		(TouchScreenParam::GetInstance()->GetButtonStates(TouchScreenParam::DIRECTIONAL_PAD) & EAST_PRESSED)
			== EAST_PRESSED ? 1 : 0;

	int nEastButtonStateChange = nCurrentEastButtonState - m_nPreviousEastButtonState;

	m_nPreviousEastButtonState = nCurrentEastButtonState;

	return nEastButtonStateChange;
}

///
///
///
int TouchScreenController::CheckSouthButton(ControllerParameter *)
{
	int nCurrentSouthButtonState =
		(TouchScreenParam::GetInstance()->GetButtonStates(TouchScreenParam::DIRECTIONAL_PAD) & SOUTH_PRESSED)
			== SOUTH_PRESSED ? 1 : 0;

	int nSouthButtonStateChange = nCurrentSouthButtonState - m_nPreviousSouthButtonState;

	m_nPreviousSouthButtonState = nCurrentSouthButtonState;

	return nSouthButtonStateChange;
}

///
///
///
int TouchScreenController::CheckWestButton(ControllerParameter *)
{
	int nCurrentWestButtonState =
		(TouchScreenParam::GetInstance()->GetButtonStates(TouchScreenParam::DIRECTIONAL_PAD) & WEST_PRESSED)
			== WEST_PRESSED ? 1 : 0;

	int nWestButtonStateChange = nCurrentWestButtonState - m_nPreviousWestButtonState;

	m_nPreviousWestButtonState = nCurrentWestButtonState;

	return nWestButtonStateChange;
}

///
///
///
void TouchScreenController::HandleNorth(ControllerParameter * pParam)
{
	int nCurrentLevel = CheckNorthButton(pParam);

	if (m_nNorthButtonState == STATE_0)
	{
		if (nCurrentLevel == TO_HIGH)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				90.0f
			};

			*pParam->GetDirection() = 90.0f;

			m_nNorthButtonState = STATE_1;
		}
	}
	else if (m_nNorthButtonState == STATE_1)
	{
		if (nCurrentLevel == HOLD_STEADY)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				90.0f
			};

			*pParam->GetDirection() = 90.0f;

			m_nNorthButtonState = STATE_2;
		}
	}
	else if (m_nNorthButtonState == STATE_2)
	{
		if (nCurrentLevel == HOLD_STEADY)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				90.0f
			};

			*pParam->GetDirection() = 90.0f;
		}
		else if (nCurrentLevel == TO_LOW)
		{
			m_nNorthButtonState = STATE_3;
		}
	}
	else if (m_nNorthButtonState == STATE_3)
	{
		*(pParam->GetForwardVelocity()) = 0.0f;

		*(pParam->GetSteering()) =
		{
			FULL_THUMBSTICK_RADIUS,
			90.0f
		};

		*pParam->GetDirection() = 90.0f;

		m_nNorthButtonState = STATE_0;
	}
}

///
///
///
void TouchScreenController::HandleEast(ControllerParameter * pParam)
{
	int nCurrentLevel = CheckEastButton(pParam);

	if (m_nEastButtonState == STATE_0)
	{
		if (nCurrentLevel == TO_HIGH)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				90.0f
			};

			*pParam->GetDirection() = 90.0f;

			m_nEastButtonState = STATE_1;
		}
	}
	else if (m_nEastButtonState == STATE_1)
	{
		if (nCurrentLevel == HOLD_STEADY)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				0.0f
			};

			*pParam->GetDirection() = 0.0f;

			m_nEastButtonState = STATE_2;
		}
	}
	else if (m_nEastButtonState == STATE_2)
	{
		if (nCurrentLevel == HOLD_STEADY)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				0.0f
			};

			*pParam->GetDirection() = 0.0f;
		}
		else if (nCurrentLevel == TO_LOW)
		{
			m_nEastButtonState = STATE_3;
		}
	}
	else if (m_nEastButtonState == STATE_3)
	{
		*(pParam->GetForwardVelocity()) = 0.0f;

		*(pParam->GetSteering()) =
		{
			FULL_THUMBSTICK_RADIUS,
			0.0f
		};

		*pParam->GetDirection() = 0.0f;

		m_nEastButtonState = STATE_0;
	}
}

///
///
///
void TouchScreenController::HandleSouth(ControllerParameter * pParam)
{
	int nCurrentLevel = CheckSouthButton(pParam);

	if (m_nSouthButtonState == STATE_0)
	{
		if (nCurrentLevel == TO_HIGH)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				270.0f
			};

			*pParam->GetDirection() = 270.0f;

			m_nSouthButtonState = STATE_1;
		}
	}
	else if (m_nSouthButtonState == STATE_1)
	{
		if (nCurrentLevel == HOLD_STEADY)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				270.0f
			};

			*pParam->GetDirection() = 270.0f;

			m_nSouthButtonState = STATE_2;
		}
	}
	else if (m_nSouthButtonState == STATE_2)
	{
		if (nCurrentLevel == HOLD_STEADY)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				270.0f
			};

			*pParam->GetDirection() = 270.0f;
		}
		else if (nCurrentLevel == TO_LOW)
		{
			m_nSouthButtonState = STATE_3;
		}
	}
	else if (m_nSouthButtonState == STATE_3)
	{
		*(pParam->GetForwardVelocity()) = 0.0f;

		*(pParam->GetSteering()) =
		{
			FULL_THUMBSTICK_RADIUS,
			270.0f
		};

		*pParam->GetDirection() = 270.0f;

		m_nSouthButtonState = STATE_0;
	}
}

///
///
///
void TouchScreenController::HandleWest(ControllerParameter * pParam)
{
	int nCurrentLevel = CheckWestButton(pParam);

	if (m_nWestButtonState == STATE_0)
	{
		if (nCurrentLevel == TO_HIGH)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				180.0f
			};

			*pParam->GetDirection() = 180.0f;

			m_nWestButtonState = STATE_1;
		}
	}
	else if (m_nWestButtonState == STATE_1)
	{
		if (nCurrentLevel == HOLD_STEADY)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				180.0f
			};

			*pParam->GetDirection() = 180.0f;

			m_nWestButtonState = STATE_2;
		}
	}
	else if (m_nWestButtonState == STATE_2)
	{
		if (nCurrentLevel == HOLD_STEADY)
		{
			*(pParam->GetForwardVelocity()) =
				PlayerSpeed::GetInstance()->GetSpeed() * 5.0f;

			*(pParam->GetSteering()) =
			{
				FULL_THUMBSTICK_RADIUS,
				180.0f
			};

			*pParam->GetDirection() = 180.0f;
		}
		else if (nCurrentLevel == TO_LOW)
		{
			m_nWestButtonState = STATE_3;
		}
	}
	else if (m_nWestButtonState == STATE_3)
	{
		*(pParam->GetForwardVelocity()) = 0.0f;

		*(pParam->GetSteering()) =
		{
			FULL_THUMBSTICK_RADIUS,
			180.0f
		};

		*pParam->GetDirection() = 180.0f;

		m_nWestButtonState = STATE_0;
	}
}


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

    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <meta name="description" content="Compares the contents of any two fields. If the fields match, the result is 1 (True); otherwise, the result is 0 (False)." />

    <title>Exact</title>

    <link rel="StyleSheet" href="../css/webworks.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="../css/print.css" type="text/css" media="print" />

      FileMaker Pro 13 Help

      Contents
      Next >
      < Previous

      Home >
      Reference >
      Functions reference >
      Text functions >
      Exact

Exact

Purpose

Compares the contents of any two fields. If the fields match, the result is 1 (True); otherwise, the result is 0 (False).

Format

Exact(originalText;comparisonText)

Parameters

originalText - any text expression, text field, or container field

comparisonText - any text expression, text field, or container field

Data type returned

number

Originated in

FileMaker Pro 6.0 or earlier

Description

For text to match exactly, the uppercase and lowercase usage must be the same. For container fields, the data must be stored in the same manner (either embedded, or stored by reference).

        Note  When evaluating values, text attributes such as font, styles, and sizes are not considered.

        Tip  If case isn't important, use the Lower or Upper function on both parameters to process data before checking for an exact match.

Examples

Exact("McDonald";"McDonald") returns 1 (True).

Exact("McDonald";"MCDONALD") returns 0 (False).

Exact(Upper("McDonald");Upper("MCDONALD")) returns 1 (True).

Exact("John";"John ") returns 0 (False).

Exact(BillTo;ShipTo) returns 1 (True) when the value in BillTo is the same as the value in ShipTo.

Exact(Recipient;Upper(Recipient)) returns 1 (True), when Recipient contains JOHNSON.

Exact(Country;"Spain") returns 1 (True) when the Country field contains Spain.

Related topics

Functions reference (category list)

Functions reference (alphabetical list)

About formulas

About functions

Defining calculation fields

Using operators in formulas

Was this topic helpful? Send feedback.


text:
This Visual Studio 2013 project is a copy of the completed code for the [Azure Notification Hubs Notify Users](https://azure.microsoft.com/documentation/articles/notification-hubs-aspnet-backend-windows-dotnet-notify-users/) tutorial.

* To test sending notification with the Windows 10 Action Center use the "ToastGeneric" template instead of "ToastText01". This code will be updated soon for Windows 10.

		// Windows 10
		var toast = @"<toast><visual><binding template=""ToastGeneric"">" +
						"<text id=""1"">Hello from a .NET App!</text>" +
					"</binding></visual></toast>";


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 org.flowable.test.spring.boot;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.tuple;

import java.io.IOException;
import java.util.Base64;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;

import org.flowable.cmmn.rest.service.api.repository.CaseDefinitionResponse;
import org.flowable.common.rest.api.DataResponse;
import org.flowable.content.rest.service.api.content.ContentItemResponse;
import org.flowable.dmn.rest.service.api.repository.DmnDeploymentResponse;
import org.flowable.rest.service.api.identity.GroupResponse;
import org.flowable.rest.service.api.repository.FormDefinitionResponse;
import org.flowable.rest.service.api.repository.ProcessDefinitionResponse;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.client.AutoConfigureWebClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.web.server.LocalServerPort;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.ClientHttpResponse;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.ResponseErrorHandler;
import org.springframework.web.client.RestTemplate;

import flowable.Application;

/**
 * @author Filip Hrisafov
 */
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureWebClient(registerRestTemplate = true)
public class RestApiSecurityApplicationTest {

    @Autowired
    private UserDetailsService userDetailsService;

    @Autowired
    private RestTemplate restTemplate;

    @LocalServerPort
    private int serverPort;

    @AfterEach
    public void tearDown() {
        restTemplate.setErrorHandler(new DefaultResponseErrorHandler());
    }

    @Test
    public void userDetailsService() {
        assertThat(userDetailsService.loadUserByUsername("jlong").getAuthorities())
                .as("jlong user's authorities")
                .extracting(GrantedAuthority::getAuthority)
                .containsExactly("user-privilege");

        assertThat(userDetailsService.loadUserByUsername("jbarrez").getAuthorities())
                .as("jbarrez user's authorities")
                .extracting(GrantedAuthority::getAuthority)
                .containsExactlyInAnyOrder("user-privilege", "admin-privilege");
    }

    @Test
    public void testRestApiIntegration() throws InterruptedException {
        String authenticationChallenge = "http://localhost:" + serverPort + "/repository/process-definitions";

        CountDownLatch latch401 = new CountDownLatch(1);
        restTemplate.setErrorHandler(new ResponseErrorHandler() {

            @Override
            public boolean hasError(ClientHttpResponse clientHttpResponse) throws IOException {
                return true;
            }

            @Override
            public void handleError(ClientHttpResponse clientHttpResponse) throws IOException {
                if (clientHttpResponse.getStatusCode() == HttpStatus.UNAUTHORIZED) {
                    latch401.countDown();
                }
            }
        });

        restTemplate.getForEntity(authenticationChallenge, String.class);
        latch401.await(500, TimeUnit.MILLISECONDS);
        assertThat(latch401.getCount())
            .as("401 Latch")
            .isZero();
    }

    @Test
    public void testRestApiIntegrationWithAuthentication() {
        String processDefinitionsUrl = "http://localhost:" + serverPort + "/process-api/repository/process-definitions";

        HttpEntity<?> request = new HttpEntity<>(createHeaders("jbarrez", "password"));
        ResponseEntity<DataResponse<ProcessDefinitionResponse>> response = restTemplate
            .exchange(processDefinitionsUrl, HttpMethod.GET, request, new ParameterizedTypeReference<DataResponse<ProcessDefinitionResponse>>() {

            });

        assertThat(response.getStatusCode())
            .as("Status code")
            .isEqualTo(HttpStatus.OK);
        DataResponse<ProcessDefinitionResponse> processDefinitions = response.getBody();
        assertThat(processDefinitions).isNotNull();
        assertThat(processDefinitions.getTotal()).isEqualTo(1);
        ProcessDefinitionResponse defResponse = processDefinitions.getData().get(0);
        assertThat(defResponse.getKey()).isEqualTo("dogeProcess");
        assertThat(defResponse.getUrl()).startsWith("http://localhost:" + serverPort + "/process-api/repository/process-definitions/dogeProcess:1:");

    }

    @Test
    public void testCmmnRestApiIntegrationWithAuthentication() {
        String processDefinitionsUrl = "http://localhost:" + serverPort + "/cmmn-api/cmmn-repository/case-definitions";

        HttpEntity<?> request = new HttpEntity<>(createHeaders("filiphr", "password"));
        ResponseEntity<DataResponse<CaseDefinitionResponse>> response = restTemplate
            .exchange(processDefinitionsUrl, HttpMethod.GET, request, new ParameterizedTypeReference<DataResponse<CaseDefinitionResponse>>() {
            });

        assertThat(response.getStatusCode())
            .as("Status code")
            .isEqualTo(HttpStatus.OK);
        DataResponse<CaseDefinitionResponse> caseDefinitions = response.getBody();
        assertThat(caseDefinitions).isNotNull();
        CaseDefinitionResponse defResponse = caseDefinitions.getData().get(0);
        assertThat(defResponse.getKey()).isEqualTo("case1");
        assertThat(defResponse.getUrl()).startsWith("http://localhost:" + serverPort + "/cmmn-api/cmmn-repository/case-definitions/");
    }

    @Test
    public void testContentRestApiIntegrationWithAuthentication() {
        String processDefinitionsUrl = "http://localhost:" + serverPort + "/content-api/content-service/content-items";

        HttpEntity<?> request = new HttpEntity<>(createHeaders("filiphr", "password"));
        ResponseEntity<DataResponse<ContentItemResponse>> response = restTemplate
            .exchange(processDefinitionsUrl, HttpMethod.GET, request, new ParameterizedTypeReference<DataResponse<ContentItemResponse>>() {
            });

        assertThat(response.getStatusCode())
            .as("Status code")
            .isEqualTo(HttpStatus.OK);
        DataResponse<ContentItemResponse> contentItems = response.getBody();
        assertThat(contentItems).isNotNull();
        assertThat(contentItems.getData())
            .isEmpty();
        assertThat(contentItems.getTotal()).isZero();
    }
    @Test
    public void testDmnRestApiIntegrationWithAuthentication() {
        String processDefinitionsUrl = "http://localhost:" + serverPort + "/dmn-api/dmn-repository/deployments";

        HttpEntity<?> request = new HttpEntity<>(createHeaders("filiphr", "password"));
        ResponseEntity<DataResponse<DmnDeploymentResponse>> response = restTemplate
            .exchange(processDefinitionsUrl, HttpMethod.GET, request, new ParameterizedTypeReference<DataResponse<DmnDeploymentResponse>>() {
            });

        assertThat(response.getStatusCode())
            .as("Status code")
            .isEqualTo(HttpStatus.OK);
        DataResponse<DmnDeploymentResponse> deployments = response.getBody();
        assertThat(deployments).isNotNull();
        assertThat(deployments.getData())
            .isEmpty();
        assertThat(deployments.getTotal()).isZero();
    }
    @Test
    public void testFormRestApiIntegrationWithAuthentication() {
        String processDefinitionsUrl = "http://localhost:" + serverPort + "/form-api/form-repository/form-definitions";

        HttpEntity<?> request = new HttpEntity<>(createHeaders("filiphr", "password"));
        ResponseEntity<DataResponse<FormDefinitionResponse>> response = restTemplate
            .exchange(processDefinitionsUrl, HttpMethod.GET, request, new ParameterizedTypeReference<DataResponse<FormDefinitionResponse>>() {
            });

        assertThat(response.getStatusCode())
            .as("Status code")
            .isEqualTo(HttpStatus.OK);
        DataResponse<FormDefinitionResponse> formDefinitions = response.getBody();
        assertThat(formDefinitions).isNotNull();
        assertThat(formDefinitions.getData())
            .isEmpty();
        assertThat(formDefinitions.getTotal()).isZero();
    }
    @Test
    public void testIdmRestApiIntegrationWithAuthentication() {
        String processDefinitionsUrl = "http://localhost:" + serverPort + "/idm-api/groups";

        HttpEntity<?> request = new HttpEntity<>(createHeaders("filiphr", "password"));
        ResponseEntity<DataResponse<GroupResponse>> response = restTemplate
            .exchange(processDefinitionsUrl, HttpMethod.GET, request, new ParameterizedTypeReference<DataResponse<GroupResponse>>() {
            });

        assertThat(response.getStatusCode())
            .as("Status code")
            .isEqualTo(HttpStatus.OK);
        DataResponse<GroupResponse> groups = response.getBody();
        assertThat(groups).isNotNull();
        assertThat(groups.getData())
            .extracting(GroupResponse::getId, GroupResponse::getType, GroupResponse::getName, GroupResponse::getUrl)
            .containsExactlyInAnyOrder(
                tuple("user", "security-role", "users", null),
                tuple("admin", "security-role", "admin", null)
            );
        assertThat(groups.getTotal()).isEqualTo(2);
    }

    protected static HttpHeaders createHeaders(String username, String password) {
        HttpHeaders headers = new HttpHeaders();
        headers.set(HttpHeaders.AUTHORIZATION, base64Authentication(username, password));
        return headers;
    }

    protected static String base64Authentication(String username, String password) {
        String auth = username + ":" + password;
        return "Basic " + Base64.getEncoder().encodeToString(auth.getBytes());
    }
}


text:
#include "llist.h"

/******************************************************************************//**
 * \brief Creates empty list
 *
 * This list can take any amount of elements and will resize itself when necessary.
 ********************************************************************************/
ds_list_t* create_list() {
    ds_list_t* list = (ds_list_t*) malloc(sizeof(ds_list_t));
    if (list) {
		list->first = 0;
		list->last = 0;
		list->size = 0;
    }
    return list;
}

/******************************************************************************//**
 * \brief Removes left side of the list.
 *
 * Returns NULL if list is empty.
 ********************************************************************************/
void* list_remove_left(ds_list_t* list) {
    list_element_t* list_head = list->first;
    if (list_head == 0)
        return 0;

    if (list->size == 1) {
        list->first = 0;
        list->last = 0;
        list->size = 0;
        void* data = list_head->data;
        free(list_head);
        return data;
    }

    void* data = list_head->data;
    list->first = list_head->next;

    free(list_head);

    list->size--;
    return data;
}

/******************************************************************************//**
 * \brief Removes right side of the list.
 *
 * Returns NULL if list is empty.
 ********************************************************************************/
void* list_remove_right(ds_list_t* list) {
    list_element_t* list_head = list->last;
    if (list_head == 0)
        return 0;

    if (list->size == 1) {
        list->first = 0;
        list->last = 0;
        list->size = 0;
        void* data = list_head->data;
        free(list_head);
        return data;
    }

    void* data = list_head->data;
    list->last = list_head->previous;

    free(list_head);

    list->size--;
    return data;
}

/******************************************************************************//**
 * \brief Returns head of the list without removing it.
 *
 * Returns NULL if list is empty.
 ********************************************************************************/
void* list_get_left(ds_list_t* list) {
    list_element_t* list_head = list->first;
    if (list_head == 0)
        return 0;

    return list_head->data;
}

/******************************************************************************//**
 * \brief Returns last element of the list without removing it.
 *
 * Returns NULL if list is empty.
 ********************************************************************************/
void* list_get_right(ds_list_t* list) {
    list_element_t* list_head = list->last;
    if (list_head == 0)
        return 0;

    return list_head->data;
}

/******************************************************************************//**
 * Returns true if list is not empty.
 ********************************************************************************/
bool list_has_elements(ds_list_t* list) {
    return list_size(list) > 0;
}

/******************************************************************************//**
 * \brief Adds element to the list.
 *
 * Element is put at the head of the list.
 * Returns true if failure happened.
 ********************************************************************************/
bool list_push_left(ds_list_t* list, void* data) {
    list_element_t* element;
    element = (list_element_t*) malloc(sizeof(list_element_t));

    if (element == 0)
        return true;

    element->data = data;
    element->next = 0;
    element->previous = 0;

    if (list->first == 0) {
        list->first = list->last = element;
        list->size = 1;
    } else {
    	element->next = list->first;
    	list->first->previous = element;
    	list->first = element;
        list->size++;
    }

    return false;
}

/******************************************************************************//**
 * \brief Adds element to the list.
 *
 * Element is put at the end of the list.
 * Returns true if failure happened.
 ********************************************************************************/
bool list_push_right(ds_list_t* list, void* data) {
    list_element_t* element;
    element = (list_element_t*) malloc(sizeof(list_element_t));

    if (element == 0)
        return true;

    element->data = data;
    element->next = 0;
    element->previous = 0;

    if (list->first == 0) {
        list->first = list->last = element;
        list->size = 1;
    } else {
        list->last->next = element;
        element->previous = list->last;
        list->last = element;
        list->size++;
    }

    return false;
}

/******************************************************************************//**
 * Returns number of elements in the list.
 ********************************************************************************/
uint32_t list_size(ds_list_t* list) {
    return list->size;
}

/******************************************************************************//**
 * \brief Deallocates list.
 *
 * Removes all memory used by this list. Elements in the list are NOT
 * deallocated.
 ********************************************************************************/
void free_list(ds_list_t* list) {
	list_element_t* el = list->first;
	while (el != 0) {
		list_element_t* tmp = el->next;
		free(el);
		el = tmp;
	}
	free(list);
}

/******************************************************************************//**
 * \brief Removes element from list at any position.
 *
 * Element is compared via ==.
 ********************************************************************************/
void list_remove(void* element, ds_list_t* list) {
    if (list->size == 0)
        return;

    list_element_t* e = list->first;
    while (e != 0 && e->data != element)
        e = e->next;

    if (e) {
    	if (e->previous)
    		e->previous->next = e->next;
    	else {
    		list->first = e->next;
    	}

        if (e->next)
            e->next->previous = e->previous;
        else
        	list->last = e->previous;

        free(e);

        --list->size;
    }
}

bool list_contains(ds_list_t* list, void* element) {
	if (list->size == 0)
		return false;

	list_element_t* e = list->first;
	while (e != 0) {
		if (e->data == element)
			return true;
		e = e->next;
	}

	return false;
}

/******************************************************************************//**
 * \brief Returns element from list found by search predicate.
 *
 * For more info, see array.
 ********************************************************************************/
void* list_find_by_predicate(void* data, search_predicate_t func, ds_list_t* list) {
    if (list->size == 0)
        return 0;

    list_element_t* e = list->first;
    while (e != 0 && func(e->data, data) == false)
        e = e->next;

    if (e)
        return e->data;
    else
        return 0;
}

/******************************************************************************//**
 * \brief Deletes the element from list if predicate returns true
 *
 * Delete all elements that return true for predicate
 ********************************************************************************/
void list_remove_by_predicate(void* data, search_predicate_t func, ds_list_t* list) {
	if (list->size == 0)
		return;

	list_element_t* e = list->first;
	while (e != 0) {
		if (func(e->data, data)) {
			if (e->previous)
				e->previous->next = e->next;
			else {
				list->first = e->next;
			}

			if (e->next)
				e->next->previous = e->previous;
			else
				list->last = e->previous;

			list_element_t* el = e;
			e = e->next;
			free(el);
			--list->size;
		} else
			e = e->next;
	}
}

/******************************************************************************//**
 * Creates iterator for list
 ********************************************************************************/
void list_create_iterator(ds_list_t* list, list_iterator_t* li) {
	li->current = list->first;
	li->prev = &list->first;
	li->pprev = NULL;
	li->ls = &list->size;
}

/******************************************************************************//**
 * Returns true if list iterator has any element, or false if it does not.
 ********************************************************************************/
bool list_has_next(list_iterator_t* li) {
	return li->current != NULL;
}

/******************************************************************************//**
 * \brief Returns next element of the list.
 *
 * Asking list iterator that has no elements left is UB.
 ********************************************************************************/
void* list_next(list_iterator_t* li) {
	list_element_t* le = li->current;
	li->pprev = li->prev;
	li->prev = &le->next;
	li->current = le->next;
	return le->data;
}

/******************************************************************************//**
 * \brief Removes current head from the iterator.
 *
 * Removes previously returned element from list_next.
 ********************************************************************************/
void  list_remove_it(list_iterator_t* li) {
	// TODO: might be broken
	list_element_t* remel = *li->pprev;
	list_element_t* prev = remel->previous;
	list_element_t* next = remel->next;

	if (prev != NULL) {
		prev->next = next;
		li->prev = &prev->next;
	} else {
		li->prev = NULL;
	}

	if (next != NULL) {
		next->previous = prev;
	}

	li->pprev = NULL;
	free(remel);
	--(*li->ls);
}


text:
package comeon.ui.media;

import javax.swing.*;
import java.awt.*;

final class AliasedTextArea extends JTextArea {
    private static final long serialVersionUID = 1L;

    AliasedTextArea(final String text) {
        super(text);
        this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
    }

    @Override
    protected void paintComponent(final Graphics g) {
        final Graphics2D g2d = (Graphics2D) g;
        g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
        g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);
        g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
        super.paintComponent(g);
    }
}


text:
<wicket:panel>
    <img wicket:id="image" src="#" class="left-image"/>
	<span wicket:id="label"></span>
</wicket:panel>


text: Chrome extension for ghost messenger (NLP not included)


text:
import runDefault from '../../common/runDefault';
import news from './loader/news';
import viewArchive from './loader/viewArchive';

const unknownPage = () => { runDefault(import('../unknownPage')); };

export default {
  news: { '-': news },
  viewupdatearchive: { '-': viewArchive },
  viewarchive: { '-': viewArchive },
  '-': { '-': unknownPage },
};