text:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
  <!-- Opens the app's settings in the Settings app -->
  <string name="app_settings">Postavke aplikacije</string>
  <!-- Description of back of driver's license image -->
  <string name="back_of_dl">Stražnja strana vozačke dozvole</string>
  <!-- Description of the checkmark to indicate back of driver's license is uploaded, used for A11Y -->
  <string name="back_of_dl_selected">Poleđina vozačke dozvole je odabrana</string>
  <!-- Description of back of identity card image -->
  <string name="back_of_id">Stražnja strana osobne iskaznice</string>
  <!-- Description of the checkmark to indicate back of ID is uploaded, used for A11Y -->
  <string name="back_of_id_selected">Poleđina osobne iskaznice je odabrana</string>
  <!-- Title displayed when requesting camera permissions -->
  <string name="camera_permission">Dozvole kamere</string>
  <string name="camera_permission_rationale">Ova aplikacija koristi kameru za skeniranje vaših osobnih dokumenata i snimanje fotografija radi provjere vašeg identiteta.</string>
  <!-- Instructional text during selfie is being captured -->
  <string name="capturing">Snimanje…</string>
  <!-- Description of the check mark, used for A11Y -->
  <string name="check_mark">Kvačica za označavanje uspješnog preuzimanja dokumenta</string>
  <!-- Text for choosing a photo from gallery -->
  <string name="choose_file">Odaberi fotografiju</string>
  <!-- Line1 body text of error screen when live capture fails -->
  <string name="could_not_capture_body1">Nismo uspjeli snimiti fotografiju visoke kvalitete.</string>
  <!-- Line2 body text of error screen when live capture fails -->
  <string name="could_not_capture_body2">Možete pokušati ponovno ili prenijeti sliku sa svog uređaja.</string>
  <!-- Error title displayed to the user if we could not scan a high quality image of the user's identity document in a reasonable amount of time -->
  <string name="could_not_capture_title">Nismo uspjeli snimiti fotografiju</string>
  <!-- Description of the clock icon, used for A11Y -->
  <string name="description_clock">Ikona sata</string>
  <!-- Label of the driver's license option for document type selection -->
  <string name="driver_license">Vozačka dozvola</string>
  <!-- Text for error labels -->
  <string name="error">Greška</string>
  <!-- Button that opens file upload screen -->
  <string name="file_upload">Učitavanje datoteke</string>
  <!-- Instructions for uploading images of drivers license -->
  <string name="file_upload_content_dl">Molimo vas učitajte slike prednje i stražnje strane vaše vozačke dozvole</string>
  <!-- Instructions for uploading images of identity card -->
  <string name="file_upload_content_id">Molimo vas učitajte slike prednje i stražnje strane vaše osobne iskaznice</string>
  <!-- Instructions for uploading images of passport -->
  <string name="file_upload_content_passport">Molimo učitajte sliku vaše putovnice</string>
  <!-- Content description of selfie flash animation mask -->
  <string name="flash_mask">Maska za selfie animaciju</string>
  <!-- Description of front of driver's license image -->
  <string name="front_of_dl">Prednja strana vozačke dozvole</string>
  <!-- Description of the checkmark to indicate front of driver's license is uploaded, used for A11Y -->
  <string name="front_of_dl_selected">Prednja strana vozačke dozvole je odabrana</string>
  <!-- Description of front of identity card image -->
  <string name="front_of_id">Prednja strana osobne iskaznice</string>
  <!-- Description of the checkmark to indicate front of ID is uploaded, used for A11Y -->
  <string name="front_of_id_selected">Prednja strana osobne iskaznice je odabrana</string>
  <!-- Button to go back to the previous screen -->
  <string name="go_back">Vrati se natrag</string>
  <!-- Text displayed when requesting camera permissions -->
  <string name="grant_camera_permission_text">Potrebna nam je dozvola za uporabu kamere. Molimo dozvolite pristup kameri u postavkama aplikacije.</string>
  <!-- Instructional text when camera is focusing on a document while scanning it -->
  <string name="hold_still">Ne pomičite se, skeniranje u tijeku</string>
  <!-- display name for ID -->
  <string name="id_card">Osobna iskaznica</string>
  <!-- Continue button text -->
  <string name="kontinue">Nastavi</string>
  <!-- Status while screen is loading -->
  <string name="loading">Učitavanje</string>
  <!-- No comment provided by engineer. -->
  <string name="ok">U redu</string>
  <!-- Label of the passport option for document type selection -->
  <string name="passport">Putovnica</string>
  <!-- Description of the checkmark to indicate passport uploaded, used for A11Y -->
  <string name="passport_selected">Putovnica je odabrana</string>
  <!-- Instructional text for scanning back of a driver's license -->
  <string name="position_dl_back">Okrenite svoju vozačku dozvolu na drugu stranu</string>
  <!-- Instructional text for scanning front of a driver's license -->
  <string name="position_dl_front">Postavite svoju vozačku dozvolu u sredinu okvira</string>
  <!-- Instructional text for scanning back of a identity card -->
  <string name="position_id_back">Okrenite svoju osobnu iskaznicu na drugu stranu</string>
  <!-- Instructional text for scanning front of a identity card -->
  <string name="position_id_front">Postavite svoju osobnu iskaznicu u sredinu okvira</string>
  <!-- Instructional text for scanning a passport -->
  <string name="position_passport">Postavite svoju putovnicu u sredinu okvira</string>
  <!-- Instructional text for capturing selfie -->
  <string name="position_selfie">Postavite svoje lice u središte okvira.</string>
  <!-- State when identity document has been successfully scanned -->
  <string name="scanned">Skenirano</string>
  <!-- Label of a button displayed below a payment method form. Tapping the button closes the form and uses the entered payment method details for checkout in the next step -->
  <string name="select">Odaberi</string>
  <!-- Instructional text when selfie is captured -->
  <string name="selfie_capture_complete">Snimanje selfi slika je završeno</string>
  <!-- Title of selfie capture screen -->
  <string name="selfie_captures">Snimanje selfie slika</string>
  <!-- Content description of a captured selfie -->
  <string name="selfie_item_description">snimljen je jedan selfie</string>
  <!-- Text for message of warning alert when selfie is not yet saved -->
  <string name="selfie_not_saved_warning">Vaše selfie slike nisu pohranjene. Želite li napustiti?</string>
  <!-- When selected in an action sheet, opens the device's camera interface -->
  <string name="take_photo">Snimi fotografiju</string>
  <!-- Button to attempt to re-scan identity document image -->
  <string name="try_again">Pokušaj ponovno</string>
  <!-- Unexpected error, such as a 500 from Stripe or a JSON parse error -->
  <string name="unexpected_error_try_again">Došlo je do neočekivane pogreške -- pokušajte ponovno za nekoliko sekundi</string>
  <!-- Title of dialog to upload back of driver license -->
  <string name="upload_dialog_title_dl_back">Učitajte poleđinu vozačke dozvole</string>
  <!-- Title of dialog to upload front of driver license -->
  <string name="upload_dialog_title_dl_front">Učitajte prednju stranu vozačke dozvole</string>
  <!-- Title of dialog to upload back of ID -->
  <string name="upload_dialog_title_id_back">Učitajte poleđinu osobne iskaznice</string>
  <!-- Title of dialog to upload front of ID -->
  <string name="upload_dialog_title_id_front">Učitajte prednju stranu osobne iskaznice</string>
  <!-- Title of dialog to upload passport -->
  <string name="upload_dialog_title_passport">Učitajte fotografiju putovnice</string>
  <!-- Message for alternative options when uploading a document -->
  <string name="upload_file_text">Umjesto toga možete ručno prenijeti fotografiju vaše %1$s</string>
</resources>


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Function is_sorted</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Compute">
<link rel="up" href="../../boost_compute/reference.html#header.boost.compute.algorithm.is_sorted_hpp" title="Header <boost/compute/algorithm/is_sorted.hpp>">
<link rel="prev" href="is_permutation.html" title="Function template is_permutation">
<link rel="next" href="lexicographical_compare.html" title="Function template lexicographical_compare">

Home
Libraries
People
FAQ
More

Function is_sorted

boost::compute::is_sorted

Synopsis

// In header: <boost/compute/algorithm/is_sorted.hpp>

template<typename InputIterator, typename Compare>
  bool is_sorted(InputIterator first, InputIterator last, Compare compare,
                 command_queue & queue = system::default_queue());
template<typename InputIterator>
  bool is_sorted(InputIterator first, InputIterator last,
                 command_queue & queue = system::default_queue());

Description

Returns true if the values in the range [first, last) are in sorted order.

See Also:

sort()

<col align="left" valign="top">

Parameters:

<col align="left" valign="top">

compare

comparison function (by default less)

first

first element in the range to check

last

last element in the range to check

queue

command queue to perform the operation

Returns:

true if the range [first, last) is sorted

Copyright © 2013, 2014 Kyle Lutz

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

redpajama_set_name: RedPajamaGithub


text:
var has = require("@nathanfaucett/has"),
    isObject = require("@nathanfaucett/is_object"),
    isFunction = require("@nathanfaucett/is_function");

module.exports = createComponentFunction;

function createComponentFunction(options, fn) {
    var displayName, propTypes;

    options = options || {};

    displayName = options.name || options.displayName;
    propTypes = options.propTypes || options.params;

    if (!isFunction(fn)) {
        throw new TypeError(
            "createComponentFunction(options: Object, fn: Funciton) fn must be a function"
        );
    }

    if (isObject(propTypes)) {
        return function componentFunction(props, locale, callback) {
            var errors = checkPropTypes(propTypes, props, displayName, locale);

            if (errors) {
                callback(errors);
            } else {
                fn(props, callback);
            }
        };
    } else {
        return fn;
    }
}

function checkPropTypes(propTypes, props, displayName, locale) {
    var localHas = has,
        propName, errors, error;

    if (propTypes) {
        for (propName in propTypes) {
            if (localHas(propTypes, propName)) {
                error = propTypes[propName](props, propName, displayName, locale);

                if (error) {
                    errors = errors || [];
                    errors[errors.length] = error;
                }
            }
        }
    }

    return errors;
}


text:
/**
 *
 */
package com.novartis.opensource.yada.format;

import org.apache.log4j.Logger;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.novartis.opensource.yada.YADAQueryResult;
import com.novartis.opensource.yada.YADAResourceException;
import com.novartis.opensource.yada.io.YADAIOException;

/**
 * @since 4.0.0
 * @author David Varon
 *
 */
public class RESTResultJSONConverter extends AbstractConverter
{

	/**
	 * Local logger handle
	 */
	@SuppressWarnings("unused")
	private static Logger l = Logger.getLogger(RESTResultJSONConverter.class);

	/**
	 * Default constructor
	 * @throws YADAResourceException when the path to {@code r.js} or {@code harmony.js} is corrupt
   * @throws YADAIOException when the path to {@code r.js} or {@code harmony.js} can't be read
   * @throws YADAConverterException when the Rhino javascript engine throws an error
	 */
	public RESTResultJSONConverter() throws YADAResourceException, YADAIOException, YADAConverterException {
	  // default constructor
	}

	/**
	 * Constructor with {@link YADAQueryResult}
	 * @param yqr the container for result processing artifacts
	 * @throws YADAResourceException when the path to {@code r.js} or {@code harmony.js} is corrupt
   * @throws YADAIOException when the path to {@code r.js} or {@code harmony.js} can't be read
   * @throws YADAConverterException when the Rhino javascript engine throws an error
	 */
	public RESTResultJSONConverter(YADAQueryResult yqr) throws YADAResourceException, YADAIOException, YADAConverterException {
	  this.setYADAQueryResult(yqr);
	}

	/**
	 * Wraps the result of the REST request in a json object
	 * @throws YADAConverterException when conversion fails
	 * @see com.novartis.opensource.yada.format.AbstractConverter#convert(java.lang.Object)
	 */
	@Override
	public Object convert(Object result) throws YADAConverterException
	{
		JSONArray arrayResult = new JSONArray();
		String    harm        = "";
		Object[]  o           = new Object[2];
		o[0] = result;

		if(getHarmonyMap() != null)
		{
		  if(getHarmonizer() == null)
      {
		    try
		    {
          setHarmonizer(new Harmonizer());
          o[1] = getHarmonyMap().toString();
          harm = getHarmonizer().call(HARMONIZE, o);
        }
		    catch (YADAResourceException e)
        {
		      throw new YADAConverterException(e.getMessage(),e);
        }
		    catch (YADAIOException e)
		    {
		      throw new YADAConverterException(e.getMessage(),e);
        }
      }
		}
		try
		{

			arrayResult = new JSONArray(harm);
		}
		catch (JSONException e)
		{
			try
			{
				arrayResult = new JSONArray();
				arrayResult.put(new JSONObject(harm));
			}
			catch(JSONException e1)
			{
				arrayResult.put(result);
			}
		}
		return arrayResult;
	}
}


text:
import * as React from "react";
type DocLinkProps = {
    children?: React.ReactNode,
    resource: string
}

export default function DocsLink({ children, resource }: DocLinkProps) {
    let url = `https://docs.mitmproxy.org/stable/${resource}`
    return (

            {children || }

    )
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="next" href="Errormsg.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of classes" rel=Appendix href="index_classes.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Pretty" rel="Chapter" href="Pretty.html">
<link title="Errormsg" rel="Chapter" href="Errormsg.html">
<link title="Clist" rel="Chapter" href="Clist.html">
<link title="Stats" rel="Chapter" href="Stats.html">
<link title="Cil" rel="Chapter" href="Cil.html">
<link title="Formatcil" rel="Chapter" href="Formatcil.html">
<link title="Alpha" rel="Chapter" href="Alpha.html">
<link title="Cillower" rel="Chapter" href="Cillower.html">
<link title="Cfg" rel="Chapter" href="Cfg.html">
<link title="Dataflow" rel="Chapter" href="Dataflow.html">
<link title="Dominators" rel="Chapter" href="Dominators.html"><title>CIL API Documentation (version 1.3.7) : Pretty</title>

 Up
 Next

Module Pretty

module Pretty: sig .. end
Utility functions for pretty-printing. The major features provided by
    this module are

An fprintf-style interface with support for user-defined printers

The printout is fit to a width by selecting some of the optional newlines

Constructs for alignment and indentation

Print ellipsis starting at a certain nesting depth

Constructs for printing lists and arrays

 Pretty-printing occurs in two stages:

Construct a Pretty.doc object that encodes all of the elements to be
  printed
  along with alignment specifiers and optional and mandatory newlines

Format the Pretty.doc to a certain width and emit it as a string, to an
  output stream or pass it to a user-defined function

 The formatting algorithm is not optimal but it does a pretty good job while
 still operating in linear time. The original version was based on a pretty
 printer by Philip Wadler which turned out to not scale to large jobs.

API

type doc

The type of unformated documents. Elements of this type can be
 constructed in two ways. Either with a number of constructor shown below,
 or using the Pretty.dprintf function with a printf-like interface.
 The Pretty.dprintf method is slightly slower so we do not use it for
 large jobs such as the output routines for a compiler. But we use it for
 small jobs such as logging and error messages.

Constructors for the doc type.

val nil : doc

Constructs an empty document

val (++) : doc -> doc -> doc

Concatenates two documents. This is an infix operator that associates to
    the left.

val concat : doc -> doc -> doc

val text : string -> doc

A document that prints the given string

val num : int -> doc

A document that prints an integer in decimal form

val num64 : int64 -> doc

A document that prints a 64-bit int in decimal form

val real : float -> doc

A document that prints a real number

val chr : char -> doc

A document that prints a character. This is just like Pretty.text
    with a one-character string.

val line : doc

A document that consists of a mandatory newline. This is just like (text
    "\n"). The new line will be indented to the current indentation level,
    unless you use Pretty.leftflush right after this.

val leftflush : doc

Use after a Pretty.line to prevent the indentation. Whatever follows
 next will be flushed left. Indentation resumes on the next line.

val break : doc

A document that consists of either a space or a line break. Also called
    an optional line break. Such a break will be
    taken only if necessary to fit the document in a given width. If the break
    is not taken a space is printed instead.

val align : doc

Mark the current column as the current indentation level. Does not print
    anything. All taken line breaks will align to this column. The previous
    alignment level is saved on a stack.

val unalign : doc

Reverts to the last saved indentation level.

val mark : doc

Mark the beginning of a markup section. The width of a markup section is
 considered 0 for the purpose of computing identation

val unmark : doc

The end of a markup section

Syntactic sugar

val indent : int -> doc -> doc

Indents the document. Same as ((text "  ") ++ align ++ doc ++ unalign),
    with the specified number of spaces.

val markup : doc -> doc

Prints a document as markup. The marked document cannot contain line
 breaks or alignment constructs.

val seq : sep:doc -> doit:('a -> doc) -> elements:'a list -> doc

Formats a sequence. sep is a separator, doit is a function that
 converts an element to a document.

val docList : ?sep:doc -> ('a -> doc) -> unit -> 'a list -> doc

An alternative function for printing a list. The unit argument is there
 to make this function more easily usable with the Pretty.dprintf
 interface. The first argument is a separator, by default a comma.

val d_list : string -> (unit -> 'a -> doc) -> unit -> 'a list -> doc

sm: Yet another list printer.  This one accepts the same kind of
 printing function that Pretty.dprintf does, and itself works
 in the dprintf context.  Also accepts
 a string as the separator since that's by far the most common.

val docArray : ?sep:doc ->
       (int -> 'a -> doc) -> unit -> 'a array -> doc

Formats an array. A separator and a function that prints an array
    element. The default separator is a comma.

val docOpt : ('a -> doc) -> unit -> 'a option -> doc

Prints an 'a option with None or Some

val d_int32 : int32 -> doc

Print an int32

val f_int32 : unit -> int32 -> doc

val d_int64 : int64 -> doc

val f_int64 : unit -> int64 -> doc

module MakeMapPrinter:
functor (Map : sig

type key

type 'a t

val fold : (key -> 'a -> 'b -> 'b) ->
       'a t -> 'b -> 'b

end) -> sig .. end

Format maps.

module MakeSetPrinter:
functor (Set : sig

type elt

type t

val fold : (elt -> 'a -> 'a) ->
       t -> 'a -> 'a

end) -> sig .. end

Format sets.

val insert : unit -> doc -> doc

A function that is useful with the printf-like interface

val dprintf : ('a, unit, doc, doc) format4 -> 'a

This function provides an alternative method for constructing
    doc objects. The first argument for this function is a format string
    argument (of type ('a, unit, doc) format; if you insist on
    understanding what that means see the module Printf). The format string
    is like that for the printf function in C, except that it understands a
    few more formatting controls, all starting with the @ character.

    See the gprintf function if you want to pipe the result of dprintf into
    some other functions.

 The following special formatting characters are understood (these do not
 correspond to arguments of the function):

 @[ Inserts an Pretty.align. Every format string must have matching
        Pretty.align and Pretty.unalign.

 @] Inserts an Pretty.unalign.

 @!  Inserts a Pretty.line. Just like "\n"

 @?  Inserts a Pretty.break.

 @<  Inserts a Pretty.mark.

 @>  Inserts a Pretty.unmark.

 @^  Inserts a Pretty.leftflush
       Should be used immediately after @! or "\n".

 @@ : inserts a @ character

 In addition to the usual printf % formatting characters the following two
 new characters are supported:

%t Corresponds to an argument of type unit -> doc. This argument is
     invoked to produce a document

%a Corresponds to two arguments. The first of type unit -> 'a -> doc
     and the second of type 'a. (The extra unit is do to the
     peculiarities of the built-in support for format strings in Ocaml. It
     turns out that it is not a major problem.) Here is an example of how
     you use this:

dprintf "Name=%s, SSN=%7d, Children=@[%a@]\n"
             pers.name pers.ssn (docList (chr ',' ++ break) text)
             pers.children

 The result of dprintf is a Pretty.doc. You can format the document and
 emit it using the functions Pretty.fprint and Pretty.sprint.

val gprintf : (doc -> 'a) -> ('b, unit, doc, 'a) format4 -> 'b

Like Pretty.dprintf but more general. It also takes a function that is
 invoked on the constructed document but before any formatting is done. The
 type of the format argument means that 'a is the type of the parameters of
 this function, unit is the type of the first argument to %a and %t
 formats, doc is the type of the intermediate result, and 'b is the type of
 the result of gprintf.

val fprint : out_channel -> width:int -> doc -> unit

Format the document to the given width and emit it to the given channel

val sprint : width:int -> doc -> string

Format the document to the given width and emit it as a string

val fprintf : out_channel -> ('a, unit, doc) format -> 'a

Like Pretty.dprintf followed by Pretty.fprint

val printf : ('a, unit, doc) format -> 'a

Like Pretty.fprintf applied to stdout

val eprintf : ('a, unit, doc) format -> 'a

Like Pretty.fprintf applied to stderr

val withPrintDepth : int -> (unit -> unit) -> unit

Invokes a thunk, with printDepth temporarily set to the specified value

The following variables can be used to control the operation of the printer

val printDepth : int ref

Specifies the nesting depth of the align/unalign pairs at which
    everything is replaced with ellipsis

val printIndent : bool ref

If false then does not indent

val fastMode : bool ref

If set to true then optional breaks are taken only when the document
    has exceeded the given width. This means that the printout will looked
    more ragged but it will be faster

val flushOften : bool ref

If true the it flushes after every print

val countNewLines : int ref

Keep a running count of the taken newlines. You can read and write this
 from the client code if you want

val auto_printer : string -> 'a

A function that when used at top-level in a module will direct
 the pa_prtype module generate automatically the printing functions for a
 type


text:
package dk.silverbullet.telemed.device.monica;

import java.io.ByteArrayOutputStream;
import java.io.IOException;

import android.util.Log;
import dk.silverbullet.telemed.device.monica.packet.PatientStatusMessage;
import dk.silverbullet.telemed.utils.Util;

public class MessageFactory {

    public static final String TAG = Util.getTag(MessageFactory.class);

    public static byte[] getInfoMessage() {
        return "?I".getBytes();
    }

    public static byte[] requestBatteryLevel() {
        return "N02PCBAT".getBytes();
    }

    public static byte[] setPatientStatus(PatientStatusMessage.Status status, boolean uterusActivity) {
        ByteArrayOutputStream bytes = new ByteArrayOutputStream();
        try {
            bytes.write("N02PCPST".getBytes());
        } catch (IOException ioe) {
            Log.e(TAG, "Should never happen!!", ioe);
            return null;
        }
        bytes.write(status.value);
        bytes.write(uterusActivity ? 1 : 0);
        return bytes.toByteArray();
    }

    public static byte[] requestImpedanceStatus1() {
        return "N02PCIMP".getBytes();
    }

    public static byte[] requestImpedanceStatus2() {
        return "N02PCIM2".getBytes();
    }

    public static byte[] selectContinuousMode() {
        return "N02PCCONT".getBytes();
    }

    public static byte[] deleteExistingData() {
        return "N02PCDEL".getBytes();
    }

    public static byte[] bypassImpedanceTest() {
        return "N02PCBYP".getBytes();
    }

    public static byte[] deleteDataAndSwitchOff() {
        return "N02PCOFD".getBytes();
    }

    public static byte[] switchOff() {
        return "N02PCOFF".getBytes();
    }

    public static byte[] downloadData() {
        return "G".getBytes();
    }

    public static byte[] halt() {
        return "H".getBytes();
    }

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Monogr. Campan. 143. 1830

#### Original name
null

### Remarks
null


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Egito</logradouro><bairro>Pineville</bairro><cidade>Pinhais</cidade><uf>PR</uf><cep>83320010</cep></feed>


text:
	#define DISABLESTEAMWORKS
#endif

#if !DISABLESTEAMWORKS

using System.Runtime.InteropServices;
using IntPtr = System.IntPtr;

namespace Steamworks {
	public static class Constants {
		public const string STEAMAPPLIST_INTERFACE_VERSION = "STEAMAPPLIST_INTERFACE_VERSION001";
		public const string STEAMAPPS_INTERFACE_VERSION = "STEAMAPPS_INTERFACE_VERSION008";
		public const string STEAMAPPTICKET_INTERFACE_VERSION = "STEAMAPPTICKET_INTERFACE_VERSION001";
		public const string STEAMCLIENT_INTERFACE_VERSION = "SteamClient020";
		public const string STEAMCONTROLLER_INTERFACE_VERSION = "SteamController007";
		public const string STEAMFRIENDS_INTERFACE_VERSION = "SteamFriends017";
		public const string STEAMGAMECOORDINATOR_INTERFACE_VERSION = "SteamGameCoordinator001";
		public const string STEAMGAMESERVER_INTERFACE_VERSION = "SteamGameServer013";
		public const string STEAMGAMESERVERSTATS_INTERFACE_VERSION = "SteamGameServerStats001";
		public const string STEAMHTMLSURFACE_INTERFACE_VERSION = "STEAMHTMLSURFACE_INTERFACE_VERSION_005";
		public const string STEAMHTTP_INTERFACE_VERSION = "STEAMHTTP_INTERFACE_VERSION003";
		public const string STEAMINPUT_INTERFACE_VERSION = "SteamInput001";
		public const string STEAMINVENTORY_INTERFACE_VERSION = "STEAMINVENTORY_INTERFACE_V003";
		public const string STEAMMATCHMAKING_INTERFACE_VERSION = "SteamMatchMaking009";
		public const string STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION = "SteamMatchMakingServers002";
		public const string STEAMGAMESEARCH_INTERFACE_VERSION = "SteamMatchGameSearch001";
		public const string STEAMPARTIES_INTERFACE_VERSION = "SteamParties002";
		public const string STEAMMUSIC_INTERFACE_VERSION = "STEAMMUSIC_INTERFACE_VERSION001";
		public const string STEAMMUSICREMOTE_INTERFACE_VERSION = "STEAMMUSICREMOTE_INTERFACE_VERSION001";
		public const string STEAMNETWORKING_INTERFACE_VERSION = "SteamNetworking006";
		// Silence some warnings
		public const string STEAMNETWORKINGSOCKETS_INTERFACE_VERSION = "SteamNetworkingSockets008";
		// Silence some warnings
		public const string STEAMNETWORKINGUTILS_INTERFACE_VERSION = "SteamNetworkingUtils003";
		public const string STEAMPARENTALSETTINGS_INTERFACE_VERSION = "STEAMPARENTALSETTINGS_INTERFACE_VERSION001";
		public const string STEAMREMOTEPLAY_INTERFACE_VERSION = "STEAMREMOTEPLAY_INTERFACE_VERSION001";
		public const string STEAMREMOTESTORAGE_INTERFACE_VERSION = "STEAMREMOTESTORAGE_INTERFACE_VERSION014";
		public const string STEAMSCREENSHOTS_INTERFACE_VERSION = "STEAMSCREENSHOTS_INTERFACE_VERSION003";
		public const string STEAMUGC_INTERFACE_VERSION = "STEAMUGC_INTERFACE_VERSION014";
		public const string STEAMUSER_INTERFACE_VERSION = "SteamUser020";
		public const string STEAMUSERSTATS_INTERFACE_VERSION = "STEAMUSERSTATS_INTERFACE_VERSION011";
		public const string STEAMUTILS_INTERFACE_VERSION = "SteamUtils009";
		public const string STEAMVIDEO_INTERFACE_VERSION = "STEAMVIDEO_INTERFACE_V002";
		public const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key
		// maximum length of friend group name (not including terminating nul!)
		public const int k_cchMaxFriendsGroupName = 64;
		// maximum number of groups a single user is allowed
		public const int k_cFriendsGroupLimit = 100;
		public const int k_cEnumerateFollowersMax = 50;
		// maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16.
		// The UTF-8 version has to be very generous to accomodate characters that get large when encoded
		// in UTF-8.
		public const int k_cchPersonaNameMax = 128;
		public const int k_cwchPersonaNameMax = 32;
		// size limit on chat room or member metadata
		public const int k_cubChatMetadataMax = 8192;
		// size limits on Rich Presence data
		public const int k_cchMaxRichPresenceKeys = 30;
		public const int k_cchMaxRichPresenceKeyLength = 64;
		public const int k_cchMaxRichPresenceValueLength = 256;
		// game server flags
		public const int k_unServerFlagNone = 0x00;
		public const int k_unServerFlagActive = 0x01; // server has users playing
		public const int k_unServerFlagSecure = 0x02; // server wants to be secure
		public const int k_unServerFlagDedicated = 0x04; // server is dedicated
		public const int k_unServerFlagLinux = 0x08; // linux build
		public const int k_unServerFlagPassworded = 0x10; // password protected
		public const int k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
		// game server flags
		public const int k_unFavoriteFlagNone = 0x00;
		public const int k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list
		public const int k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list
		//-----------------------------------------------------------------------------
		// Purpose: Defines the largest allowed file size. Cloud files cannot be written
		// in a single chunk over 100MB (and cannot be over 200MB total.)
		//-----------------------------------------------------------------------------
		public const int k_unMaxCloudFileChunkSize = 100 * 1024 * 1024;
		public const int k_cchPublishedDocumentTitleMax = 128 + 1;
		public const int k_cchPublishedDocumentDescriptionMax = 8000;
		public const int k_cchPublishedDocumentChangeDescriptionMax = 8000;
		public const int k_unEnumeratePublishedFilesMaxResults = 50;
		public const int k_cchTagListMax = 1024 + 1;
		public const int k_cchFilenameMax = 260;
		public const int k_cchPublishedFileURLMax = 256;
		public const int k_nScreenshotMaxTaggedUsers = 32;
		public const int k_nScreenshotMaxTaggedPublishedFiles = 32;
		public const int k_cubUFSTagTypeMax = 255;
		public const int k_cubUFSTagValueMax = 255;
		// Required with of a thumbnail provided to AddScreenshotToLibrary.  If you do not provide a thumbnail
		// one will be generated.
		public const int k_ScreenshotThumbWidth = 200;
		public const int kNumUGCResultsPerPage = 50;
		public const int k_cchDeveloperMetadataMax = 5000;
		// size limit on stat or achievement name (UTF-8 encoded)
		public const int k_cchStatNameMax = 128;
		// maximum number of bytes for a leaderboard name (UTF-8 encoded)
		public const int k_cchLeaderboardNameMax = 128;
		// maximum number of details int32's storable for a single leaderboard entry
		public const int k_cLeaderboardDetailsMax = 64;
		//
		// Max size (in bytes of UTF-8 data, not in characters) of server fields, including null terminator.
		// WARNING: These cannot be changed easily, without breaking clients using old interfaces.
		//
		public const int k_cbMaxGameServerGameDir = 32;
		public const int k_cbMaxGameServerMapName = 32;
		public const int k_cbMaxGameServerGameDescription = 64;
		public const int k_cbMaxGameServerName = 64;
		public const int k_cbMaxGameServerTags = 128;
		public const int k_cbMaxGameServerGameData = 2048;
		//-----------------------------------------------------------------------------
		// Purpose: Base values for callback identifiers, each callback must
		//			have a unique ID.
		//-----------------------------------------------------------------------------
		public const int k_iSteamUserCallbacks = 100;
		public const int k_iSteamGameServerCallbacks = 200;
		public const int k_iSteamFriendsCallbacks = 300;
		public const int k_iSteamBillingCallbacks = 400;
		public const int k_iSteamMatchmakingCallbacks = 500;
		public const int k_iSteamContentServerCallbacks = 600;
		public const int k_iSteamUtilsCallbacks = 700;
		public const int k_iClientFriendsCallbacks = 800;
		public const int k_iClientUserCallbacks = 900;
		public const int k_iSteamAppsCallbacks = 1000;
		public const int k_iSteamUserStatsCallbacks = 1100;
		public const int k_iSteamNetworkingCallbacks = 1200;
		public const int k_iSteamNetworkingSocketsCallbacks = 1220;
		public const int k_iSteamNetworkingMessagesCallbacks = 1250;
		public const int k_iSteamNetworkingUtilsCallbacks = 1280;
		public const int k_iClientRemoteStorageCallbacks = 1300;
		public const int k_iClientDepotBuilderCallbacks = 1400;
		public const int k_iSteamGameServerItemsCallbacks = 1500;
		public const int k_iClientUtilsCallbacks = 1600;
		public const int k_iSteamGameCoordinatorCallbacks = 1700;
		public const int k_iSteamGameServerStatsCallbacks = 1800;
		public const int k_iSteam2AsyncCallbacks = 1900;
		public const int k_iSteamGameStatsCallbacks = 2000;
		public const int k_iClientHTTPCallbacks = 2100;
		public const int k_iClientScreenshotsCallbacks = 2200;
		public const int k_iSteamScreenshotsCallbacks = 2300;
		public const int k_iClientAudioCallbacks = 2400;
		public const int k_iClientUnifiedMessagesCallbacks = 2500;
		public const int k_iSteamStreamLauncherCallbacks = 2600;
		public const int k_iClientControllerCallbacks = 2700;
		public const int k_iSteamControllerCallbacks = 2800;
		public const int k_iClientParentalSettingsCallbacks = 2900;
		public const int k_iClientDeviceAuthCallbacks = 3000;
		public const int k_iClientNetworkDeviceManagerCallbacks = 3100;
		public const int k_iClientMusicCallbacks = 3200;
		public const int k_iClientRemoteClientManagerCallbacks = 3300;
		public const int k_iClientUGCCallbacks = 3400;
		public const int k_iSteamStreamClientCallbacks = 3500;
		public const int k_IClientProductBuilderCallbacks = 3600;
		public const int k_iClientShortcutsCallbacks = 3700;
		public const int k_iClientRemoteControlManagerCallbacks = 3800;
		public const int k_iSteamAppListCallbacks = 3900;
		public const int k_iSteamMusicCallbacks = 4000;
		public const int k_iSteamMusicRemoteCallbacks = 4100;
		public const int k_iClientVRCallbacks = 4200;
		public const int k_iClientGameNotificationCallbacks = 4300;
		public const int k_iSteamGameNotificationCallbacks = 4400;
		public const int k_iSteamHTMLSurfaceCallbacks = 4500;
		public const int k_iClientVideoCallbacks = 4600;
		public const int k_iClientInventoryCallbacks = 4700;
		public const int k_iClientBluetoothManagerCallbacks = 4800;
		public const int k_iClientSharedConnectionCallbacks = 4900;
		public const int k_ISteamParentalSettingsCallbacks = 5000;
		public const int k_iClientShaderCallbacks = 5100;
		public const int k_iSteamGameSearchCallbacks = 5200;
		public const int k_iSteamPartiesCallbacks = 5300;
		public const int k_iClientPartiesCallbacks = 5400;
		public const int k_iSteamSTARCallbacks = 5500;
		public const int k_iClientSTARCallbacks = 5600;
		public const int k_iSteamRemotePlayCallbacks = 5700;
		public const int k_iClientCompatCallbacks = 5800;
		public const int k_unSteamAccountIDMask = -1;
		public const int k_unSteamAccountInstanceMask = 0x000FFFFF;
		public const int k_unSteamUserDefaultInstance = 1; // fixed instance for all individual users
		public const int k_cchGameExtraInfoMax = 64;
		/// Max length of serialized auth ticket.  This is important so that we
		/// can ensure that we always fit into a single UDP datagram (along with
		/// other certs and signatures) and keep the implementation simple.
		public const int k_cbSteamDatagramMaxSerializedTicket = 512;
		/// Max size of user data blob
		public const int k_cbMaxSteamDatagramGameCoordinatorServerLoginAppData = 2048;
		/// Max size of serialized data blob
		public const int k_cbMaxSteamDatagramGameCoordinatorServerLoginSerialized = 4096;
		public const int k_nSteamEncryptedAppTicketSymmetricKeyLen = 32;
		/// Max length of diagnostic error message
		public const int k_cchMaxSteamNetworkingErrMsg = 1024;
		/// Max length, in bytes (including null terminator) of the reason string
		/// when a connection is closed.
		public const int k_cchSteamNetworkingMaxConnectionCloseReason = 128;
		/// Max length, in bytes (include null terminator) of debug description
		/// of a connection.
		public const int k_cchSteamNetworkingMaxConnectionDescription = 128;
		//
		// Network messages
		//
		/// Max size of a single message that we can SEND.
		/// Note: We might be wiling to receive larger messages,
		/// and our peer might, too.
		public const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024;
		//
		// Flags used to set options for message sending
		//
		// Send the message unreliably. Can be lost.  Messages *can* be larger than a
		// single MTU (UDP packet), but there is no retransmission, so if any piece
		// of the message is lost, the entire message will be dropped.
		//
		// The sending API does have some knowledge of the underlying connection, so
		// if there is no NAT-traversal accomplished or there is a recognized adjustment
		// happening on the connection, the packet will be batched until the connection
		// is open again.
		//
		// Migration note: This is not exactly the same as k_EP2PSendUnreliable!  You
		// probably want k_ESteamNetworkingSendType_UnreliableNoNagle
		public const int k_nSteamNetworkingSend_Unreliable = 0;
		// Disable Nagle's algorithm.
		// By default, Nagle's algorithm is applied to all outbound messages.  This means
		// that the message will NOT be sent immediately, in case further messages are
		// sent soon after you send this, which can be grouped together.  Any time there
		// is enough buffered data to fill a packet, the packets will be pushed out immediately,
		// but partially-full packets not be sent until the Nagle timer expires.  See
		// ISteamNetworkingSockets::FlushMessagesOnConnection, ISteamNetworkingMessages::FlushMessagesToUser
		//
		// NOTE: Don't just send every message without Nagle because you want packets to get there
		// quicker.  Make sure you understand the problem that Nagle is solving before disabling it.
		// If you are sending small messages, often many at the same time, then it is very likely that
		// it will be more efficient to leave Nagle enabled.  A typical proper use of this flag is
		// when you are sending what you know will be the last message sent for a while (e.g. the last
		// in the server simulation tick to a particular client), and you use this flag to flush all
		// messages.
		public const int k_nSteamNetworkingSend_NoNagle = 1;
		// Send a message unreliably, bypassing Nagle's algorithm for this message and any messages
		// currently pending on the Nagle timer.  This is equivalent to using k_ESteamNetworkingSend_Unreliable
		// and then immediately flushing the messages using ISteamNetworkingSockets::FlushMessagesOnConnection
		// or ISteamNetworkingMessages::FlushMessagesToUser.  (But using this flag is more efficient since you
		// only make one API call.)
		public const int k_nSteamNetworkingSend_UnreliableNoNagle = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoNagle;
		// If the message cannot be sent very soon (because the connection is still doing some initial
		// handshaking, route negotiations, etc), then just drop it.  This is only applicable for unreliable
		// messages.  Using this flag on reliable messages is invalid.
		public const int k_nSteamNetworkingSend_NoDelay = 4;
		// Send an unreliable message, but if it cannot be sent relatively quickly, just drop it instead of queuing it.
		// This is useful for messages that are not useful if they are excessively delayed, such as voice data.
		// NOTE: The Nagle algorithm is not used, and if the message is not dropped, any messages waiting on the
		// Nagle timer are immediately flushed.
		//
		// A message will be dropped under the following circumstances:
		// - the connection is not fully connected.  (E.g. the "Connecting" or "FindingRoute" states)
		// - there is a sufficiently large number of messages queued up already such that the current message
		//   will not be placed on the wire in the next ~200ms or so.
		//
		// If a message is dropped for these reasons, k_EResultIgnored will be returned.
		public const int k_nSteamNetworkingSend_UnreliableNoDelay = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoDelay|k_nSteamNetworkingSend_NoNagle;
		// Reliable message send. Can send up to k_cbMaxSteamNetworkingSocketsMessageSizeSend bytes in a single message.
		// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for
		// efficient sends of large chunks of data.
		//
		// The Nagle algorithm is used.  See notes on k_ESteamNetworkingSendType_Unreliable for more details.
		// See k_ESteamNetworkingSendType_ReliableNoNagle, ISteamNetworkingSockets::FlushMessagesOnConnection,
		// ISteamNetworkingMessages::FlushMessagesToUser
		//
		// Migration note: This is NOT the same as k_EP2PSendReliable, it's more like k_EP2PSendReliableWithBuffering
		public const int k_nSteamNetworkingSend_Reliable = 8;
		// Send a message reliably, but bypass Nagle's algorithm.
		//
		// Migration note: This is equivalent to k_EP2PSendReliable
		public const int k_nSteamNetworkingSend_ReliableNoNagle = k_nSteamNetworkingSend_Reliable|k_nSteamNetworkingSend_NoNagle;
		// By default, message sending is queued, and the work of encryption and talking to
		// the operating system sockets, etc is done on a service thread.  This is usually a
		// a performance win when messages are sent from the "main thread".  However, if this
		// flag is set, and data is ready to be sent immediately (either from this message
		// or earlier queued data), then that work will be done in the current thread, before
		// the current call returns.  If data is not ready to be sent (due to rate limiting
		// or Nagle), then this flag has no effect.
		//
		// This is an advanced flag used to control performance at a very low level.  For
		// most applications running on modern hardware with more than one CPU core, doing
		// the work of sending on a service thread will yield the best performance.  Only
		// use this flag if you have a really good reason and understand what you are doing.
		// Otherwise you will probably just make performance worse.
		public const int k_nSteamNetworkingSend_UseCurrentThread = 16;
		/// Max possible length of a ping location, in string format.  This is
		/// an extremely conservative worst case value which leaves room for future
		/// syntax enhancements.  Most strings in practice are a lot shorter.
		/// If you are storing many of these, you will very likely benefit from
		/// using dynamic memory.
		public const int k_cchMaxSteamNetworkingPingLocationString = 1024;
		/// Special values that are returned by some functions that return a ping.
		public const int k_nSteamNetworkingPing_Failed = -1;
		public const int k_nSteamNetworkingPing_Unknown = -2;
		public const int k_cubSaltSize = 8;
		public const ulong k_GIDNil = 0xffffffffffffffff;
		public const ulong k_TxnIDNil = k_GIDNil;
		public const ulong k_TxnIDUnknown = 0;
		public const int k_uPackageIdInvalid = -1;
		public const ulong k_ulAssetClassIdInvalid = 0x0;
		public const int k_uPhysicalItemIdInvalid = 0x0;
		public const int k_uCellIDInvalid = -1;
		public const int k_uPartnerIdInvalid = 0;
		public const ulong k_ulPartyBeaconIdInvalid = 0;
		public const int STEAM_CONTROLLER_MAX_COUNT = 16;
		public const int STEAM_CONTROLLER_MAX_ANALOG_ACTIONS = 16;
		public const int STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS = 128;
		public const int STEAM_CONTROLLER_MAX_ORIGINS = 8;
		public const int STEAM_CONTROLLER_MAX_ACTIVE_LAYERS = 16;
		// When sending an option to a specific controller handle, you can send to all controllers via this command
		public const ulong STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS = 0xFFFFFFFFFFFFFFFF;
		public const float STEAM_CONTROLLER_MIN_ANALOG_ACTION_DATA = -1.0f;
		public const float STEAM_CONTROLLER_MAX_ANALOG_ACTION_DATA = 1.0f;
		public const ushort MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE	= 0xFFFF;
		public const int INVALID_HTTPREQUEST_HANDLE		= 0;
		public const int STEAM_INPUT_MAX_COUNT = 16;
		public const int STEAM_INPUT_MAX_ANALOG_ACTIONS = 16;
		public const int STEAM_INPUT_MAX_DIGITAL_ACTIONS = 128;
		public const int STEAM_INPUT_MAX_ORIGINS = 8;
		public const int STEAM_INPUT_MAX_ACTIVE_LAYERS = 16;
		// When sending an option to a specific controller handle, you can send to all devices via this command
		public const ulong STEAM_INPUT_HANDLE_ALL_CONTROLLERS = 0xFFFFFFFFFFFFFFFF;
		public const float STEAM_INPUT_MIN_ANALOG_ACTION_DATA = -1.0f;
		public const float STEAM_INPUT_MAX_ANALOG_ACTION_DATA = 1.0f;
		// maximum number of characters a lobby metadata key can be
		public const byte k_nMaxLobbyKeyLength = 255;
		public const int k_SteamMusicNameMaxLength = 255;
		public const int k_SteamMusicPNGMaxLength = 65535;
		//-----------------------------------------------------------------------------
		// Constants used for query ports.
		//-----------------------------------------------------------------------------
		public const int QUERY_PORT_NOT_INITIALIZED		= 0xFFFF; // We haven't asked the GS for this query port's actual value yet.
		public const int QUERY_PORT_ERROR				= 0xFFFE; // We were unable to get the query port for this server.
	}
}

#endif // !DISABLESTEAMWORKS


text:
package org.apache.camel.component.slack;

import java.io.IOException;

import com.google.gson.Gson;
import com.slack.api.Slack;
import com.slack.api.SlackConfig;
import com.slack.api.methods.SlackApiException;
import com.slack.api.methods.response.chat.ChatPostMessageResponse;
import com.slack.api.model.Message;
import com.slack.api.webhook.WebhookResponse;
import org.apache.camel.AsyncCallback;
import org.apache.camel.CamelExchangeException;
import org.apache.camel.Exchange;
import org.apache.camel.component.slack.helper.SlackHelper;
import org.apache.camel.component.slack.helper.SlackMessage;
import org.apache.camel.support.DefaultAsyncProducer;

public class SlackProducer extends DefaultAsyncProducer {

    private static final Gson GSON = new Gson();

    private final SlackEndpoint slackEndpoint;
    private Slack slack;

    public SlackProducer(SlackEndpoint endpoint) {
        super(endpoint);
        this.slackEndpoint = endpoint;
    }

    @Override
    protected void doStart() throws Exception {
        SlackConfig config = SlackHelper.createSlackConfig(slackEndpoint.getServerUrl());
        CustomSlackHttpClient client = new CustomSlackHttpClient();
        this.slack = Slack.getInstance(config, client);
        super.doStart();
    }

    @Override
    protected void doStop() throws Exception {
        super.doStop();
        if (slack != null) {
            slack.close();
        }
    }

    @Override
    public boolean process(Exchange exchange, AsyncCallback callback) {
        if (slackEndpoint.getToken() != null) {
            return sendMessageByToken(exchange, callback);
        } else {
            return sendMessageByWebhookURL(exchange, callback);
        }
    }

    private boolean sendMessageByToken(Exchange exchange, AsyncCallback callback) {
        ChatPostMessageResponse response;
        Object payload = exchange.getIn().getBody();

        try {
            if (payload instanceof SlackMessage) {
                response = sendLegacySlackMessage((SlackMessage) payload);
            } else if (payload instanceof Message) {
                response = sendMessage((Message) payload);
            } else {
                SlackMessage slackMessage = new SlackMessage();
                slackMessage.setText(exchange.getIn().getBody(String.class));
                response = sendLegacySlackMessage(slackMessage);
            }
        } catch (Exception e) {
            exchange.setException(e);
            return true;
        } finally {
            callback.done(true);
        }

        if (!response.isOk()) {
            exchange.setException(new CamelExchangeException("Error POSTing to Slack API: " + response.toString(), exchange));
        }

        return false;
    }

    private ChatPostMessageResponse sendLegacySlackMessage(SlackMessage slackMessage) throws IOException, SlackApiException {
        return slack.methods(slackEndpoint.getToken()).chatPostMessage(req -> req
                .channel(slackEndpoint.getChannel())
                .username(slackEndpoint.getUsername())
                .iconUrl(slackEndpoint.getIconUrl())
                .iconEmoji(slackEndpoint.getIconEmoji())
                .text(slackMessage.getText()));
    }

    private ChatPostMessageResponse sendMessage(Message message) throws IOException, SlackApiException {
        return slack.methods(slackEndpoint.getToken()).chatPostMessage(req -> req
                .channel(slackEndpoint.getChannel())
                .username(slackEndpoint.getUsername())
                .iconUrl(slackEndpoint.getIconUrl())
                .iconEmoji(slackEndpoint.getIconEmoji())
                .text(message.getText())
                .blocks(message.getBlocks())
                .attachments(message.getAttachments()));
    }

    private boolean sendMessageByWebhookURL(Exchange exchange, AsyncCallback callback) {
        String json;
        Object payload = exchange.getIn().getBody();
        if (payload instanceof SlackMessage) {
            json = GSON.toJson(addEndPointOptions((SlackMessage) payload));
        } else if (payload instanceof Message) {
            json = GSON.toJson(addEndPointOptions((Message) payload));
        } else {
            SlackMessage slackMessage = new SlackMessage();
            slackMessage.setText(exchange.getIn().getBody(String.class));
            json = GSON.toJson(addEndPointOptions(slackMessage));
        }

        WebhookResponse response;
        try {
            response = slack.send(slackEndpoint.getWebhookUrl(), json);
        } catch (IOException e) {
            exchange.setException(e);
            return true;
        } finally {
            callback.done(true);
        }

        if (response.getCode() < 200 || response.getCode() > 299) {
            exchange.setException(new CamelExchangeException("Error POSTing to Slack API: " + response.toString(), exchange));
        }

        return false;
    }

    private Message addEndPointOptions(Message slackMessage) {
        slackMessage.setChannel(slackEndpoint.getChannel());
        slackMessage.setUsername(slackEndpoint.getUsername());
        return slackMessage;
    }

    private SlackMessage addEndPointOptions(SlackMessage slackMessage) {
        slackMessage.setChannel(slackEndpoint.getChannel());
        slackMessage.setUsername(slackEndpoint.getUsername());
        slackMessage.setIconUrl(slackEndpoint.getIconUrl());
        slackMessage.setIconEmoji(slackEndpoint.getIconEmoji());
        return slackMessage;
    }
}


text:
package org.mockserver.serialization.serializers.body;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import org.mockserver.serialization.model.BinaryBodyDTO;

import java.io.IOException;

/**
 * @author jamesdbloom
 */
public class BinaryBodyDTOSerializer extends StdSerializer<BinaryBodyDTO> {

    public BinaryBodyDTOSerializer() {
        super(BinaryBodyDTO.class);
    }

    @Override
    public void serialize(BinaryBodyDTO binaryBodyDTO, JsonGenerator jgen, SerializerProvider provider) throws IOException {
        jgen.writeStartObject();
        if (binaryBodyDTO.getNot() != null && binaryBodyDTO.getNot()) {
            jgen.writeBooleanField("not", binaryBodyDTO.getNot());
        }
        jgen.writeStringField("type", binaryBodyDTO.getType().name());
        jgen.writeStringField("base64Bytes", binaryBodyDTO.getValue());
        if (binaryBodyDTO.getContentType() != null) {
            jgen.writeStringField("contentType", binaryBodyDTO.getContentType());
        }
        jgen.writeEndObject();
    }
}


text:
try:
    import unittest2 as unittest
except ImportError:
    import unittest

from iscool_e.pynba.message import dumps, cast
from six import binary_type

class ProtoTestCase(unittest.TestCase):
    def test_hostname(self):
        assert cast('\n\x0bexample.com') == dumps(hostname='example.com')

    def test_server_name(self):
        assert cast('\x12\nserver.lan') == dumps(server_name='server.lan')

    def test_script_name(self):
        assert cast('\x1a\x05/path') == dumps(script_name = '/path')

    def test_request_count(self):
        assert cast(' \x01') == dumps(request_count = 1)
        assert cast(' \x96\x01') == dumps(request_count = 150)
        assert cast(' \xa7\x1f') == dumps(request_count = 4007)
        assert cast(' \x87\x92\x8a\xf7\x0e') == dumps(request_count = 4007823623)

    def test_request_time(self):
        assert cast(b'=\xf86M>') == dumps(request_time = 0.200405)

    def test_dictionary(self):
        assert cast('z\x03fooz\x03barz\x03baz') == dumps(dictionary = ['foo', 'bar', 'baz'])

    def test_timer_hit_count(self):
        assert cast('P*P\xe8\x07P\x02') == dumps(timer_hit_count = [42, 1000, 2])

    def test_timer_value(self):
        assert cast(b']ff(B]\xcd\xcc\xcc=]ff\x06@') == dumps(timer_value = [42.1, .1000, 2.1])

    def test_mix_1(self):
        assert cast('\n\x0bexample.com \x17z\x03fooz\x03barz\x03baz') == dumps(
            hostname='example.com', request_count=23, dictionary=['foo', 'bar' , 'baz'])


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Mesh" inherits="Resource" category="Core" version="3.1">
	<brief_description>
		A [Resource] that contains vertex-array based geometry.
	</brief_description>
	<description>
		Mesh is a type of [Resource] that contains vertex-array based geometry, divided in [i]surfaces[/i]. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials.
	</description>
	<tutorials>
	</tutorials>
	<demos>
	</demos>
	<methods>
		<method name="create_convex_shape" qualifiers="const">
			<return type="Shape">
			</return>
			<description>
				Calculate a [ConvexPolygonShape] from the mesh.
			</description>
		</method>
		<method name="create_outline" qualifiers="const">
			<return type="Mesh">
			</return>
			<argument index="0" name="margin" type="float">
			</argument>
			<description>
				Calculate an outline mesh at a defined offset (margin) from the original mesh. Note: Typically returns the vertices in reverse order (e.g. clockwise to anti-clockwise).
			</description>
		</method>
		<method name="create_trimesh_shape" qualifiers="const">
			<return type="Shape">
			</return>
			<description>
				Calculate a [ConcavePolygonShape] from the mesh.
			</description>
		</method>
		<method name="generate_triangle_mesh" qualifiers="const">
			<return type="TriangleMesh">
			</return>
			<description>
				Generate a [TriangleMesh] from the mesh.
			</description>
		</method>
		<method name="get_faces" qualifiers="const">
			<return type="PoolVector3Array">
			</return>
			<description>
				Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.
			</description>
		</method>
	</methods>
	<members>
		<member name="lightmap_size_hint" type="Vector2" setter="set_lightmap_size_hint" getter="get_lightmap_size_hint">
		</member>
	</members>
	<constants>
		<constant name="PRIMITIVE_POINTS" value="0" enum="PrimitiveType">
			Render array as points (one vertex equals one point).
		</constant>
		<constant name="PRIMITIVE_LINES" value="1" enum="PrimitiveType">
			Render array as lines (every two vertices a line is created).
		</constant>
		<constant name="PRIMITIVE_LINE_STRIP" value="2" enum="PrimitiveType">
			Render array as line strip.
		</constant>
		<constant name="PRIMITIVE_LINE_LOOP" value="3" enum="PrimitiveType">
			Render array as line loop (like line strip, but closed).
		</constant>
		<constant name="PRIMITIVE_TRIANGLES" value="4" enum="PrimitiveType">
			Render array as triangles (every three vertices a triangle is created).
		</constant>
		<constant name="PRIMITIVE_TRIANGLE_STRIP" value="5" enum="PrimitiveType">
			Render array as triangle strips.
		</constant>
		<constant name="PRIMITIVE_TRIANGLE_FAN" value="6" enum="PrimitiveType">
			Render array as triangle fans.
		</constant>
		<constant name="BLEND_SHAPE_MODE_NORMALIZED" value="0" enum="BlendShapeMode">
		</constant>
		<constant name="BLEND_SHAPE_MODE_RELATIVE" value="1" enum="BlendShapeMode">
		</constant>
		<constant name="ARRAY_FORMAT_VERTEX" value="1" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FORMAT_NORMAL" value="2" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FORMAT_TANGENT" value="4" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FORMAT_COLOR" value="8" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FORMAT_TEX_UV" value="16" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FORMAT_TEX_UV2" value="32" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FORMAT_BONES" value="64" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FORMAT_WEIGHTS" value="128" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FORMAT_INDEX" value="256" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_BASE" value="9" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_VERTEX" value="512" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_NORMAL" value="1024" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_TANGENT" value="2048" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_COLOR" value="4096" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_TEX_UV" value="8192" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_TEX_UV2" value="16384" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_BONES" value="32768" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_WEIGHTS" value="65536" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_INDEX" value="131072" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FLAG_USE_2D_VERTICES" value="262144" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_FLAG_USE_16_BIT_BONES" value="524288" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_COMPRESS_DEFAULT" value="97280" enum="ArrayFormat">
		</constant>
		<constant name="ARRAY_VERTEX" value="0" enum="ArrayType">
		</constant>
		<constant name="ARRAY_NORMAL" value="1" enum="ArrayType">
		</constant>
		<constant name="ARRAY_TANGENT" value="2" enum="ArrayType">
		</constant>
		<constant name="ARRAY_COLOR" value="3" enum="ArrayType">
		</constant>
		<constant name="ARRAY_TEX_UV" value="4" enum="ArrayType">
		</constant>
		<constant name="ARRAY_TEX_UV2" value="5" enum="ArrayType">
		</constant>
		<constant name="ARRAY_BONES" value="6" enum="ArrayType">
		</constant>
		<constant name="ARRAY_WEIGHTS" value="7" enum="ArrayType">
		</constant>
		<constant name="ARRAY_INDEX" value="8" enum="ArrayType">
		</constant>
		<constant name="ARRAY_MAX" value="9" enum="ArrayType">
		</constant>
	</constants>
</class>


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

public abstract class Entity : MonoBehaviour {

	protected List<Spell> magicSkills;
	protected string entityName;
	public Stats stats;
	protected ActionSystem actionSystem;
	protected GameSystem gameSystem;

	public Sprite sprite;

	public Entity (string name) {
		entityName = name;
		stats = new Stats (this);
		gameSystem = GameObject.FindObjectOfType<GameSystem> ();
		actionSystem = gameSystem.getActionSystem();
	}

	public string getName(){
		return entityName;
	}

	public bool isDie (){
		return stats.isDie ();
	}

	public float actionSpeed ()
	{
		return stats.actionSpeed ();
	}

	public abstract void myTurn ();

	public void finishTurn(){
		stats.updateTurn ();
		gameSystem.finishTurnPlayer ();
	}

	public void applyAction (Action action){
		actionSystem.ApplyAction (action);
	}

	public Stats getStats(){
		return stats;
	}

	public float getExperience(){
		return 1f;
	}

	public Sprite getSprite() {
		return sprite;
	}

	public void addExperience(float exp){
		stats.getLevel ().addExperience (exp);
	}

	public List<Spell> getMagicalSkills(){
		return magicSkills;
	}

	public bool canUseSpell(Spell spell){
		return stats.getSp () >= spell.getCost ();
	}
}


text:
package net.sourceforge.marathon.javadriver.recorder;

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

import org.apache.commons.exec.OS;
import org.openqa.selenium.By;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.AssertJUnit;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import com.sun.swingset3.SwingSet3;

import net.sourceforge.marathon.javadriver.ClassPathHelper;
import net.sourceforge.marathon.javadriver.JavaDriver;
import net.sourceforge.marathon.javadriver.JavaProfile;
import net.sourceforge.marathon.javadriver.JavaProfile.LaunchMode;
import net.sourceforge.marathon.runtime.api.Constants;

@Test
public class LaunchCommandLineTest extends RecordingTest {

    private JavaDriver driver;

    public LaunchCommandLineTest() {
    }

    @BeforeClass
    public void createDriver() {
        System.setProperty(Constants.PROP_PROJECT_FRAMEWORK, Constants.FRAMEWORK_SWING);
        JavaProfile profile = new JavaProfile(LaunchMode.COMMAND_LINE);
        File f = findFile();
        profile.setCommand(f.getAbsolutePath());
        profile.setRecordingPort(startRecordingServer());
        DesiredCapabilities caps = new DesiredCapabilities("java", "1.5", Platform.ANY);
        driver = new JavaDriver(profile, caps, caps);
    }

    @AfterClass
    public void quitDriver() {
        driver.quit();
    }

    public void checkBasicRecording() throws Throwable {
        List<WebElement> buttons = driver.findElements(By.cssSelector("toggle-button"));
        AssertJUnit.assertTrue(buttons.size() > 0);
        buttons.get(3).click();
        buttons.get(0).click();
        System.out.println(scriptElements);
        AssertJUnit.assertTrue(scriptElements.size() > 0);
    }

    private File findFile() {
        if (OS.isFamilyWindows()) {
            return new File(new File(ClassPathHelper.getClassPath(SwingSet3.class)).getParentFile(), "swingset3.bat");
        }
        return new File(new File(ClassPathHelper.getClassPath(SwingSet3.class)).getParentFile(), "swingset3.sh");
    }
}


text:
namespace Planex.Web.Areas.Manager.Models.Gantt
{
    public class ProjectDetailsAssignmentsViewModel
    {
        public int AssignmentId { get; set; }

        public int ResourceId { get; set; }

        public int TaskId { get; set; }

        public decimal Units { get; set; }
    }
}


text:
#ifndef DIFFEO_METHODS_HPP
#define DIFFEO_METHODS_HPP

#include <stdlib.h>
#include<iostream>
#include <math.h>

#include <Eigen/LU>
#include <Eigen/Core>

#include "FileVector.h"

#ifndef PIExists
    #define PI 3.141592653589793
    #define Ang2Rad 3.141592653589793/180.
    #define Rad2Ang 180./3.141592653589793
    #define PIExists
#endif

using namespace std;
using namespace Eigen;

///////////////////////////////////////////////////////////////////////////////////

namespace DiffeoMethods{
    ///////////////////////////////////////////////////////////////////////////////////

    /*
    *Structure keeping all information defining a diffeomorphism
    */
    struct diffeoStruct {
        MatrixXd centers; // centers and targets are column vectors stacked horizontally
        MatrixXd targets;
        VectorXd coefs; //coefs and division_coefs are column vectors
        VectorXd divisionCoefs;
        int numTrans;
        ///////////////////////////////////////////////////////////
        bool toFolder(const string & folder, const string writeMode = "cpp"){

            if (not ( writeMode.compare("cpp")==0 || writeMode.compare("python")==0)){
                std::cout << "writeMode is either cpp or python" << endl;
                return false;
            }

            (void) system( ("mkdir -p "+folder+"/diffeo/details").c_str() );

            VectorXd thisNumTrans(1);
            thisNumTrans(0) = numTrans;

            Leph::WriteMatrix(folder+"diffeo/centers.txt", centers, 32, writeMode);
            Leph::WriteMatrix(folder+"diffeo/targets.txt", targets, 32, writeMode);
            Leph::WriteVector(folder+"diffeo/coefs.txt", coefs, 32, writeMode);
            Leph::WriteVector(folder+"diffeo/divisionCoefs.txt", divisionCoefs, 32, writeMode);
            Leph::WriteVector(folder+"diffeo/numTrans.txt", thisNumTrans, 32, writeMode);

            return true;
        }
        ///////////////////////////////////////////////////////////
        bool fromFolder(const string & folder){
        try{
            centers = Leph::ReadMatrix(folder+"diffeo/centers.txt");
            targets = Leph::ReadMatrix(folder+"diffeo/targets.txt");
            coefs = Leph::ReadVector(folder+"diffeo/coefs.txt");
            divisionCoefs = Leph::ReadVector(folder+"diffeo/divisionCoefs.txt");
            numTrans = (int) (Leph::ReadVector(folder+"diffeo/numTrans.txt")) (0);

            if (not(centers.cols()==numTrans && targets.cols()==numTrans && coefs.size()==numTrans && divisionCoefs.size()==numTrans)){
                std::cerr << "Inconsistent diffeo in number of transitions" << endl;
                return false;
            }
            if (not( centers.rows()==targets.rows() )){
                std::cerr << "Inconsistent diffeo in center and target dimension" << endl;
            }

        }catch(const std::exception &excp){
            std::cerr << excp.what() << endl;
            return false;
        }catch(...){
            std::cerr << "Unknown exception" << endl;
            return false;
        }
        return true;
        }
    };

    ///////////////////////////////////////////////////////////////////////////////////
    /*
    *Function applying a diffeomorphic "forward" transformation
    *Denoting pt' the point after deformation we get
    *pt' = tau(pt) = pt + V.exp(-coef^2.||pt-center||_2^2)
    * and V = (target-center)/divisionCoef
    */
    //#TBD schlepil check if && aka rvalue reference behaves as expected
    /*
    template<typename V1, typename V2, typename M1>
    inline void iterativeFunction(const V1 & center, const V2 & target, M1 & pt, const double & divisionCoef, const double & coef){

        assert(center.rows() == pt.rows() && "Points to be transformed do not have the same dimension as center and target");
        assert(center.rows() == target.rows() && "Inconsistent");
        assert(center.cols() == 1 && target.cols()==1 && "Inconsistent");

        int M = pt.rows();
        int N = pt.cols();

        M1 result = coef*(pt.colwise() - center);
        result = -result.cwiseProduct(result);

        //I hope this can be done more efficiently
        M1 helper1 = ((target-center)/divisionCoef).replicate(1,N) ;
        M1 helper2 = result.colwise().sum().array().exp().replicate(M,1) ;

        pt += helper1.cwiseProduct(helper2);
    }
    */

    inline void iterativeFunction(const Ref<const VectorXd> center, const Ref<const VectorXd> target, Ref<MatrixXd> pt, const double & divisionCoef, const double & coef){

        assert(center.rows() == pt.rows() && "Points to be transformed do not have the same dimension as center and target");
        assert(center.rows() == target.rows() && "Inconsistent");
        assert(center.cols() == 1 && target.cols()==1 && "Inconsistent");

        const int M = pt.rows();
        const int N = pt.cols();

        MatrixXd result = coef*(pt.colwise() - center);
        result = -result.cwiseProduct(result);//noalias()?

        //I hope this can be done more efficiently
        MatrixXd helper1 = ((target-center)/divisionCoef).replicate(1,N) ;
        MatrixXd helper2 = result.colwise().sum().array().exp().replicate(M,1) ;

        pt += helper1.cwiseProduct(helper2);//noalias()?
    }

    //////////////////////
    /*
    *Same as iterative function but also calculating the jacobian of each point
    *As above the transformation is given as
    *pt' = tau(pt) = pt + V*exp(-coef^2.||pt-center||_2^2)
    *so
    *d/(d pt) tau(pt) = J_pt(tau) = Identity - 2*coef^2*exp(-coef^2.||pt-center||_2^2)*V.(pt-center)
    */
    /*
    template<typename vectorType, typename V1, typename M1>
    inline void iterativeFunctionJac(const V1 & center, const V1 & target, M1 & pt, const double divisionCoef, const double coef, vectorType & allJacs){

        assert(center.rows() == pt.rows() && "Points to be transformed do not have the same dimension as center and target");

        int M = pt.rows();
        int N = pt.cols();

        M1 result = coef*(pt.colwise() - center);
        result = -result.cwiseProduct(result);

        //I hope this can be done more efficiently
        M1 helper1 = ((target-center)/divisionCoef).replicate(1,N) ;
        M1 helper2 = result.colwise().sum().array().exp().replicate(M,1) ;

        //Calculate jacobians if necessary
        MatrixXd thisId = MatrixXd::Identity(M,M);
        Matrix<double,-1,1> V = helper1.col(0);
        M1 deltaPos = pt.colwise()-center;
        for (size_t i=0; i<N; i++){
            allJacs[i] = (thisId - helper2(0,i)*2.*coef*coef*V*( deltaPos.col(i).transpose() ))*(allJacs[i]);
        }

        pt += helper1.cwiseProduct(helper2);
        //Test
        //pt += (((((target-center)/divisionCoef).replicate(1,N))).cwise(((result.colwise().sum().array().exp().replicate(M,1)))))
    }
    */
    template<typename vectorType>
    inline void iterativeFunctionJac(const Ref<const VectorXd> center, const Ref<const VectorXd> target, Ref<MatrixXd> pt, const double divisionCoef, const double coef, vectorType & allJacs){

        assert(center.rows() == pt.rows() && "Points to be transformed do not have the same dimension as center and target");

        int M = pt.rows();
        int N = pt.cols();

        MatrixXd result = coef*(pt.colwise() - center);
        result = -result.cwiseProduct(result);

        //I hope this can be done more efficiently
        MatrixXd helper1 = ((target-center)/divisionCoef).replicate(1,N) ;
        MatrixXd helper2 = result.colwise().sum().array().exp().replicate(M,1) ;

        //Calculate jacobians if necessary
        MatrixXd thisId = MatrixXd::Identity(M,M);
        Matrix<double,-1,1> V = helper1.col(0);
        MatrixXd deltaPos = pt.colwise()-center;
        for (size_t i=0; i<N; i++){
            allJacs[i] = (thisId - helper2(0,i)*2.*coef*coef*V*( deltaPos.col(i).transpose() ))*(allJacs[i]);
        }

        pt += helper1.cwiseProduct(helper2);
        //Test
        //pt += (((((target-center)/divisionCoef).replicate(1,N))).cwise(((result.colwise().sum().array().exp().replicate(M,1)))))
    }

    //////////////////////
    /*
    *Same as iterative function but also transforming the velocity associated to each point
    *As above the transformation is given as
    *pt' = tau(pt) = pt + V*exp(-coef^2.||pt-center||_2^2)
    *so
    *d/(d pt) tau(pt) = J_pt(tau) = Identity - 2*coef^2*exp(-coef^2.||pt-center||_2^2)*V.(pt-center)
    */
    /*
    template<typename V1, typename M1>
    inline void iterativeFunctionVel(const V1 & center, const V1 & target, M1 & pt, M1 & vel, const double divisionCoef, const double coef){

        assert(center.rows() == pt.rows() && "Points to be transformed do not have the same dimension as center and target");
        assert(coef>0. && "coef needs to be positive");

        size_t M = pt.rows();
        size_t N = pt.cols();

        M1 result = coef*(pt.colwise() - center);
        result = -result.cwiseProduct(result);

        //I hope this can be done more efficiently
        M1 helper1 = ((target-center)/divisionCoef).replicate(1,N) ;
        M1 helper2 = result.colwise().sum().array().exp().replicate(M,1) ;

        //Calculate jacobians if necessary
        MatrixXd thisId = MatrixXd::Identity(M,M);
        Matrix<double,-1,1> V = helper1.col(0);
        M1 deltaPos = pt.colwise()-center;
        for (size_t i=0; i<N; i++){
            vel.col(i) = (thisId - helper2(0,i)*2.*coef*coef*V*( deltaPos.col(i).transpose() ))*vel.col(i);
        }

        pt += helper1.cwiseProduct(helper2);
    }*/
    //template<typename Vref, typename Mref>
    //inline void iterativeFunctionVel(const Ref<const Vref> center, const Ref<const Vref>  target, Ref<Mref>  pt, Ref<Mref> vel, const double divisionCoef, const double coef){
    inline void iterativeFunctionVel(const Ref<const VectorXd> center, const Ref<const VectorXd>  target, Ref<MatrixXd>  pt, Ref<MatrixXd> vel, const double divisionCoef, const double coef){

        assert(center.rows() == pt.rows() && "Points to be transformed do not have the same dimension as center and target");
        assert(coef>0. && "coef needs to be positive");

        const size_t M = pt.rows();
        const size_t N = pt.cols();

        MatrixXd result = coef*(pt.colwise() - center);
        result = -result.cwiseProduct(result);

        //I hope this can be done more efficiently
        MatrixXd helper1 = ((target-center)/divisionCoef).replicate(1,N) ;
        MatrixXd helper2 = result.colwise().sum().array().exp().replicate(M,1) ;

        //Calculate jacobians if necessary
        MatrixXd thisId = MatrixXd::Identity(M,M);
        Matrix<double,-1,1> V = helper1.col(0);
        MatrixXd deltaPos = pt.colwise()-center;
        for (size_t i=0; i<N; i++){
            vel.col(i) = (thisId - helper2(0,i)*2.*coef*coef*V*( deltaPos.col(i).transpose() ))*vel.col(i);
        }

        pt += helper1.cwiseProduct(helper2);
    }

    ////////////////////////////////////////////////////////////////////////////////////
    /*A entire diffeo for multiple points
    The diffeomorphism tau is the composition of some diffeomorphic transformations of the form
    *pt' = tau_i(pt) = pt + V*exp(-coef^2.||pt-center||_2^2)
    *So
    *tau(pt) = tau_N(tau_(N-1)(...(tau_1(tau_0(pt)))))
    */
    //template<typename M1>
    //void forwardDiffeo(M1 & pt, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1){
    void forwardDiffeo(Ref<MatrixXd> pt, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1){

        nStart = nStart<0 ? 0:nStart;
        nStop = nStop<0 ? aDiffeo.numTrans:nStop;
        //std::cout << "forward: " << nStart << "to: " << nStop << std::endl;
        //MatrixXd ptOut = pt;
        size_t i;
        for (i=(size_t) nStart; i<(size_t) nStop; ++i){
            //ptOut = iterativeFunction(aDiffeo.centers.col(i), aDiffeo.targets.col(i), ptOut, aDiffeo.divisionCoefs(i), aDiffeo.coefs(i));
            iterativeFunction(aDiffeo.centers.col(i), aDiffeo.targets.col(i), pt, aDiffeo.divisionCoefs(i), aDiffeo.coefs(i)); //Inplace modification of pt and Jac
        }
        //return ptOut;
    }
    ////////////////////////////////////////////////////////////////////////////////////
    /*A entire diffeo for multiple points including jacobian calculation
    * tau^N = tau_N . tau_(N-1) . ... . tau_0 (where . denotes composition)
    *then
    *J_pt(tau) = J_(tau^(N-1)(pt))(tau_N)*...*J_(tau^1(pt))(tau_2)*J_(tau^0(pt))(tau_1)*J_pt(tau_0) where * denotes standard matrix product
    */
    //template<typename vectorType, typename M1>
    //void forwardDiffeoJac(M1 & pt, const diffeoStruct & aDiffeo, vectorType & allJacs, int nStart=-1, int nStop=-1){
    template<typename vectorType>
    void forwardDiffeoJac(Ref<MatrixXd> pt, const diffeoStruct & aDiffeo, vectorType & allJacs, int nStart=-1, int nStop=-1){

        int dim = pt.rows();
        int l = pt.cols();

        nStart = nStart<0 ? 0:nStart;
        nStop = nStop<0 ? aDiffeo.numTrans:nStop;
        //std::cout << "forward: " << nStart << "to: " << nStop << std::endl;
        //MatrixXd ptOut = pt;

        //Initialize with identities
        allJacs.clear();
        for (size_t i=0; i<l; i++){
            allJacs.push_back(MatrixXd::Identity(dim,dim));
        }

        for (size_t i=nStart; i<nStop; i++){
            //ptOut = iterativeFunction(aDiffeo.centers.col(i), aDiffeo.targets.col(i), ptOut, aDiffeo.divisionCoefs(i), aDiffeo.coefs(i));
            iterativeFunctionJac(aDiffeo.centers.col(i), aDiffeo.targets.col(i), pt, aDiffeo.divisionCoefs(i), aDiffeo.coefs(i), allJacs); //Inplace modification of pt and Jac
        }
        //return ptOut;
    }
    ////////////////////////////////////////////////////////////////////////////////////
    /*An entire diffeo for multiple points transforming associated velocities
    * tau^N = tau_N . tau_(N-1) . ... . tau_0 (where . denotes composition)
    *then
    *J_pt(tau) = J_(tau^(N-1)(pt))(tau_N)*...*J_(tau^1(pt))(tau_2)*J_(tau^0(pt))(tau_1)*J_pt(tau_0) where * denotes standard matrix product
    */
    //template<typename M1>
    //void forwardDiffeoVel(M1 & pt, M1 & vel, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1){
    void forwardDiffeoVel(Ref<MatrixXd> pt, Ref<MatrixXd> vel, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1){
        nStart = nStart<0 ? 0:nStart;
        nStop = nStop<0 ? aDiffeo.numTrans:nStop;
        //std::cout << "forward: " << nStart << "to: " << nStop << std::endl;
        //MatrixXd ptOut = pt;

        for (size_t i=(size_t)nStart; i<(size_t)nStop; i++){
            //ptOut = iterativeFunction(aDiffeo.centers.col(i), aDiffeo.targets.col(i), ptOut, aDiffeo.divisionCoefs(i), aDiffeo.coefs(i));
            iterativeFunctionVel(aDiffeo.centers.col(i), aDiffeo.targets.col(i), pt, vel, aDiffeo.divisionCoefs(i), aDiffeo.coefs(i)); //Inplace modification of pt and Jac
        }
        //return ptOut;
    }

    ////////////////////////////////////////////////////////////////////////////////////
    /*Helper
    *Inline function calculating the exponential factor of a transformation
    *V1 and V2 need to be different templates in order to allow the usage with
    */
    //template<typename V1, typename V2>
    //inline double radial(const V1 & center, const V2 & pt, const double coefSq){
    inline double radial(const Ref<const VectorXd> center, const Ref<const VectorXd> pt, const double coefSq){
        //V1 dX = pt-center;
        //return exp(-coefSq * ((double) dX.dot(dX)));
        return exp(-coefSq * ((double) (pt-center).squaredNorm()));
    }

    ////////////////////////////////////////////////////////////////////////////////////
    /*Computes the inverse transformation of tau
    *There exists no closed form solution for this problem, so we use a
    *bounded version of newton's method to find the
    *pt = inverse(tau)(pt')
    */
    //template<typename MatorVec>
    //void reverseDiffeo(MatorVec & pt, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1, const double convCrit=1e-12){
    void reverseDiffeo(Ref<MatrixXd> pt, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1, const double convCrit=1e-12){

        size_t nPoints = pt.cols();

        //assert((pt.cols()==1));

        nStart = nStart<0 ? aDiffeo.numTrans:nStart;
        nStop = nStop<0 ? 0:nStop;
        //std::cout << "reverse: " << nStart << "to: " << nStop << std::endl;

        VectorXd V(pt.rows());//This translation
        VectorXd b(pt.rows());
        //Matrix<double, -1,1> ptOut = pt;

        VectorXd thisCenter(pt.rows());
        VectorXd thisTarget(pt.rows());

        double lambda, g, deriv, errValue, r;
        double thisCoef, thisCoefSq;

        //Parallelize for each point?
        for (size_t indCol=0; indCol<nPoints; indCol++){
            for (int i=nStart-1; i>=nStop; i--){
                thisCenter = aDiffeo.centers.col(i);
                thisTarget = aDiffeo.targets.col(i);
                thisCoef = aDiffeo.coefs(i);
                thisCoefSq = thisCoef*thisCoef;

                lambda = 0.0;
                V = -(thisTarget-thisCenter)/aDiffeo.divisionCoefs(i);
                //b = ptOut-thisCenter;
                b = pt.col(indCol)-thisCenter;

                do{
                    r = radial(thisCenter, pt.col(indCol)+lambda*V, thisCoefSq);
                    g = 2.*V.dot(b+lambda*V);
                    deriv = -1-thisCoefSq*g*r;
                    errValue = r-lambda;
                    lambda = min(max(lambda-errValue/deriv, 0.), 1.);
                }while(abs(errValue)>convCrit);

                //ptOut = ptOut+lambda*V;
                pt.col(indCol) += lambda*V;
            }
        //return ptOut;
        }
    }

    ////////////////////////////////////////////////////////////////////////////////////
    /*Computes the inverse transformation of tau
    *There exists no closed form solution for this problem, so we use a
    *bounded version of newton's method to find the
    *pt = inverse(tau)(pt')
    *This method also provides jacobians associated to each point. By default the "forward" jacobians are returned, since there is no analytical form to directly obtain
    *the jacobians of the reverse transformation
    */
    //template<typename MatorVec, typename vectorType>
    //void reverseDiffeoJac(MatorVec & pt, vectorType & allJacs, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1, const double convCrit=1e-12, const bool returnForwardJacs=true){
    template<typename vectorType>
    void reverseDiffeoJac(Ref<MatrixXd> pt, vectorType & allJacs, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1, const double convCrit=1e-12, const bool returnForwardJacs=true){

        const int dim = pt.rows();
        const int nPoints = pt.cols();

        //assert((pt.cols()==1));

        nStart = nStart<0 ? aDiffeo.numTrans:nStart;
        nStop = nStop<0 ? 0:nStop;
        //std::cout << "reverse: " << nStart << "to: " << nStop << std::endl;

        VectorXd V(pt.size());//This translation
        VectorXd b(pt.size());
        //Matrix<double, -1,1> ptOut = pt;

        VectorXd thisCenter(pt.size());
        VectorXd thisTarget(pt.size());

        double lambda, g, deriv, errValue, r;
        double thisCoef, thisCoefSq;

        MatrixXd thisIdentity = MatrixXd::Identity(dim,dim);
        allJacs.clear();
        for (size_t i=0; i<nPoints; i++){
            allJacs.push_back(thisIdentity);
        }

        for (int indCol=0; indCol<nPoints; indCol++){
            for (int i=nStart-1; i>=nStop; i--){
                thisCenter = aDiffeo.centers.col(i);
                thisTarget = aDiffeo.targets.col(i);
                thisCoef = aDiffeo.coefs(i);
                thisCoefSq = thisCoef*thisCoef;

                lambda = 0.0;
                V = -(thisTarget-thisCenter)/aDiffeo.divisionCoefs(i);
                //b = ptOut-thisCenter;
                b = pt.col(indCol)-thisCenter;

                do{
                    r = radial(thisCenter, pt.col(indCol)+lambda*V, thisCoefSq);
                    g = 2.*V.dot(b+lambda*V);
                    deriv = -1-thisCoefSq*g*r;
                    errValue = r-lambda;
                    lambda = min(max(lambda-errValue/deriv, 0.), 1.);
                }while(abs(errValue)>convCrit);

                //ptOut = ptOut+lambda*V;
                //Update the jacobian
                pt.col(indCol) += lambda*V;

                allJacs[indCol] = allJacs[indCol]*(thisIdentity + V*((pt.col(indCol)-thisCenter).transpose())*lambda*2.*thisCoefSq);
            }
            if (not returnForwardJacs){
                allJacs[indCol] = allJacs[indCol].inverse();
            }
        }
    }
//////////////////////////////////////////////////////////////////////////////

    ////////////////////////////////////////////////////////////////////////////////////
    /*Computes the inverse transformation of tau
    *There exists no closed form solution for this problem, so we use a
    *bounded version of newton's method to find the
    *pt = inverse(tau)(pt')
    *This method also transforms the velocities associated to each point from the demonstration to the control space
    */
    //template<typename MatorVec>
    //void reverseDiffeoVel(MatorVec & pt, MatorVec & vel, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1, const double convCrit=1e-12){
    void reverseDiffeoVel(Ref<MatrixXd> pt, Ref<MatrixXd> vel, const diffeoStruct & aDiffeo, int nStart=-1, int nStop=-1, const double convCrit=1e-12){

        assert( (pt.rows()==vel.rows()) && (pt.cols()==vel.cols()) && "There need to be as many velocities as positions") ;

        const int dim = pt.rows();
        const int nPoints = pt.cols();

        //assert((pt.cols()==1));

        nStart = nStart<0 ? aDiffeo.numTrans:nStart;
        nStop = nStop<0 ? 0:nStop;
        //std::cout << "reverse: " << nStart << "to: " << nStop << std::endl;

        VectorXd V(pt.size());//This translation
        VectorXd b(pt.size());
        //Matrix<double, -1,1> ptOut = pt;

        VectorXd thisCenter(pt.size());
        VectorXd thisTarget(pt.size());

        double lambda, g, deriv, errValue, r;
        double thisCoef, thisCoefSq;

        MatrixXd thisIdentity = MatrixXd::Identity(dim,dim);
        MatrixXd thisJacobian = thisIdentity;

        for (int indCol=0; indCol<nPoints; indCol++){
            thisJacobian = thisIdentity;
            for (int i=nStart-1; i>=nStop; i--){
                thisCenter = aDiffeo.centers.col(i);
                thisTarget = aDiffeo.targets.col(i);
                thisCoef = aDiffeo.coefs(i);
                thisCoefSq = thisCoef*thisCoef;

                lambda = 0.0;
                V = -(thisTarget-thisCenter)/aDiffeo.divisionCoefs(i);
                //b = ptOut-thisCenter;
                b = pt.col(indCol)-thisCenter;

                do{
                    r = radial(thisCenter, pt.col(indCol)+lambda*V, thisCoefSq);
                    g = 2.*V.dot(b+lambda*V);
                    deriv = -1-thisCoefSq*g*r;
                    errValue = r-lambda;
                    lambda = min(max(lambda-errValue/deriv, 0.), 1.);
                }while(abs(errValue)>convCrit);

                //ptOut = ptOut+lambda*V;
                //Update the jacobian
                pt.col(indCol) += lambda*V;

                thisJacobian = thisJacobian*(thisIdentity + V*(((pt.col(indCol)-thisCenter).transpose()))*lambda*2.*thisCoefSq);
            }
            vel.col(indCol) = thisJacobian.inverse()*vel.col(indCol);
        }
    }
}; // end namespace
#endif


text:
{{ login.login_text }}

{% if error_message %}
{{ error_message }}
{% endif %}

<form action="{% url 'truco:vote' login.id %}" method="post">
{% csrf_token %}
{% for choice in login.choice_set.all %}
    <input type="radio" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" />
    {{ login.choice_text }}

{% endfor %}
<input type="submit" value="Vote" />
</form>


text:
/*
 * ConnectedComponents.cpp
 *
 *  Created on: Dec 16, 2013
 *      Author: cls
 */

#ifndef CONNECTEDCOMPONENTS_H_
#define CONNECTEDCOMPONENTS_H_

#include "../graph/Graph.h"
#include "../graph/BFS.h"
#include "../structures/Partition.h"
#include "../base/Algorithm.h"
#include <unordered_set>

namespace NetworKit {

/**
 * @ingroup components
 * Determines the connected components of an undirected graph.
 */
class ConnectedComponents : public Algorithm {
public:
	/**
	 * Create ConnectedComponents class for Graph @a G.
	 *
	 * @param G The graph.
	 */
	ConnectedComponents(const Graph& G);

	/**
	 * This method determines the connected components for the graph given in the constructor.
	 */
	void run();

	/**
	 * Get the number of connected components.
	 *
	 * @return The number of connected components.
	 */
	count numberOfComponents();

	/**
	 * Get the the component in which node @a u is situated.
	 *
	 * @param[in]	u	The node whose component is asked for.
	 */
	count componentOfNode(node u);

	/**
	 * Get a Partition that represents the components.
	 *
	 * @return A partition representing the found components.
	 */
	Partition getPartition();

    /**
     *Return the map from component to size
     */
    std::map<index, count> getComponentSizes();

    /**
     * @return Vector of components, each stored as (unordered) set of nodes.
     */
    std::vector<std::vector<node> > getComponents();

private:
	const Graph& G;
	Partition component;
	count numComponents;
	bool hasRun;
};

inline count ConnectedComponents::componentOfNode(node u) {
	assert (component[u] != none);
	if (!hasRun) throw std::runtime_error("run method has not been called");
	return component[u];
}

inline count ConnectedComponents::numberOfComponents() {
	if (!hasRun) throw std::runtime_error("run method has not been called");
	return this->numComponents;
}

}

#endif /* CONNECTEDCOMPONENTS_H_ */