text:
namespace Microsoft.Azure.Management.Compute.Models
{
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using System.Collections;
    using System.Collections.Generic;
    using System.Linq;

    ///
    /// Specifies information about the dedicated host group that the dedicated
    /// hosts should be assigned to.

 Currently, a
    /// dedicated host can only be added to a dedicated host group at creation
    /// time. An existing dedicated host cannot be added to another dedicated
    /// host group.
    ///
    [Rest.Serialization.JsonTransformation]
    public partial class DedicatedHostGroup : Resource
    {
        ///
        /// Initializes a new instance of the DedicatedHostGroup class.
        ///
        public DedicatedHostGroup()
        {
            CustomInit();
        }

        ///
        /// Initializes a new instance of the DedicatedHostGroup class.
        ///
        /// <param name="location">Resource location</param>
        /// <param name="platformFaultDomainCount">Number of fault domains that
        /// the host group can span.</param>
        /// <param name="id">Resource Id</param>
        /// <param name="name">Resource name</param>
        /// <param name="type">Resource type</param>
        /// <param name="tags">Resource tags</param>
        /// <param name="hosts">A list of references to all dedicated hosts in
        /// the dedicated host group.</param>
        /// <param name="instanceView">The dedicated host group instance view,
        /// which has the list of instance view of the dedicated hosts under
        /// the dedicated host group.</param>
        /// <param name="supportAutomaticPlacement">Specifies whether virtual
        /// machines or virtual machine scale sets can be placed automatically
        /// on the dedicated host group. Automatic placement means resources
        /// are allocated on dedicated hosts, that are chosen by Azure, under
        /// the dedicated host group. The value is defaulted to 'true' when not
        /// provided.

Minimum api-version:
        /// 2020-06-01.</param>
        /// <param name="zones">Availability Zone to use for this host group.
        /// Only single zone is supported. The zone can be assigned only during
        /// creation. If not provided, the group supports all zones in the
        /// region. If provided, enforces each host in the group to be in the
        /// same zone.</param>
        public DedicatedHostGroup(string location, int platformFaultDomainCount, string id = default(string), string name = default(string), string type = default(string), IDictionary<string, string> tags = default(IDictionary<string, string>), IList<SubResourceReadOnly> hosts = default(IList<SubResourceReadOnly>), DedicatedHostGroupInstanceView instanceView = default(DedicatedHostGroupInstanceView), bool? supportAutomaticPlacement = default(bool?), IList<string> zones = default(IList<string>))
            : base(location, id, name, type, tags)
        {
            PlatformFaultDomainCount = platformFaultDomainCount;
            Hosts = hosts;
            InstanceView = instanceView;
            SupportAutomaticPlacement = supportAutomaticPlacement;
            Zones = zones;
            CustomInit();
        }

        ///
        /// An initialization method that performs custom operations like setting defaults
        ///
        partial void CustomInit();

        ///
        /// Gets or sets number of fault domains that the host group can span.
        ///
        [JsonProperty(PropertyName = "properties.platformFaultDomainCount")]
        public int PlatformFaultDomainCount { get; set; }

        ///
        /// Gets a list of references to all dedicated hosts in the dedicated
        /// host group.
        ///
        [JsonProperty(PropertyName = "properties.hosts")]
        public IList<SubResourceReadOnly> Hosts { get; private set; }

        ///
        /// Gets the dedicated host group instance view, which has the list of
        /// instance view of the dedicated hosts under the dedicated host
        /// group.
        ///
        [JsonProperty(PropertyName = "properties.instanceView")]
        public DedicatedHostGroupInstanceView InstanceView { get; private set; }

        ///
        /// Gets or sets specifies whether virtual machines or virtual machine
        /// scale sets can be placed automatically on the dedicated host group.
        /// Automatic placement means resources are allocated on dedicated
        /// hosts, that are chosen by Azure, under the dedicated host group.
        /// The value is defaulted to 'true' when not provided.
        /// &lt;br&gt;&lt;br&gt;Minimum api-version:
        /// 2020-06-01.
        ///
        [JsonProperty(PropertyName = "properties.supportAutomaticPlacement")]
        public bool? SupportAutomaticPlacement { get; set; }

        ///
        /// Gets or sets availability Zone to use for this host group. Only
        /// single zone is supported. The zone can be assigned only during
        /// creation. If not provided, the group supports all zones in the
        /// region. If provided, enforces each host in the group to be in the
        /// same zone.
        ///
        [JsonProperty(PropertyName = "zones")]
        public IList<string> Zones { get; set; }

        ///
        /// Validate the object.
        ///
        /// <exception cref="ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public override void Validate()
        {
            base.Validate();
            if (PlatformFaultDomainCount < 1)
            {
                throw new ValidationException(ValidationRules.InclusiveMinimum, "PlatformFaultDomainCount", 1);
            }
        }
    }
}


text:
//using System;
//using System.Threading.Tasks;
//using Windows.Foundation;
//using Windows.UI.StartScreen;
//using Windows.UI.Xaml;
//using Windows.UI.Xaml.Media;

//namespace Rybird.Framework
//{
//    public class SecondaryTilePinner : ISecondaryTilePinner
//    {
//        public async Task<bool> Pin(TileInfo tileInfo)
//        {
//            if (tileInfo == null)
//            {
//                throw new ArgumentNullException("tileInfo");
//            }

//            var isPinned = false;

//            if (!SecondaryTile.Exists(tileInfo.TileId))
//            {
//                var secondaryTile = new SecondaryTile(
//                    tileInfo.TileId,
//                    tileInfo.ShortName,
//                    tileInfo.DisplayName,
//                    tileInfo.Arguments,
//                    tileInfo.TileOptions,
//                    tileInfo.LogoUri);

//                if (tileInfo.WideLogoUri != null)
//                {
//                    secondaryTile.WideLogo = tileInfo.WideLogoUri;
//                }

//                isPinned = await secondaryTile.RequestCreateForSelectionAsync(
//                        GetElementRect(tileInfo.AnchorElement), tileInfo.RequestPlacement);
//            }

//            return isPinned;
//        }

//        public async Task<bool> Unpin(TileInfo tileInfo)
//        {
//            var wasUnpinned = false;

//            if (SecondaryTile.Exists(tileInfo.TileId))
//            {
//                var secondaryTile = new SecondaryTile(tileInfo.TileId);
//                wasUnpinned = await secondaryTile.RequestDeleteForSelectionAsync(
//                    GetElementRect(tileInfo.AnchorElement), tileInfo.RequestPlacement);
//            }

//            return wasUnpinned;
//        }

//        public bool IsPinned(string tileId)
//        {
//            return SecondaryTile.Exists(tileId);
//        }

//        private static Rect GetElementRect(FrameworkElement element)
//        {
//            GeneralTransform buttonTransform = element.TransformToVisual(null);
//            Point point = buttonTransform.TransformPoint(new Point());
//            return new Rect(point, new Size(element.ActualWidth, element.ActualHeight));
//        }
//    }
//}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">Agenda Skarleth</string>

    <string name="action_settings">Ajustes</string>
    <string name="no_to_dos">Genial amor has hecho todos tus deberes</string>
    <string name="title">Título</string>
    <string name="remind_me">Avísame</string>
    <string name="choose_date">Fecha</string>
    <string name="choose_time">Hora</string>
    <string name="remind_date_and_time">Recordatorio el %1$s, %2$s %3$s</string>
    <string name="about">Acerca de</string>
    <string name="app_version">Versión: 1.1</string>
    <string name="contact_me">Puedes contactarme en</string>
    <string name="made_by">Hecho por Santiago García Cabral</string>
    <string name="done_label">Hecho</string>

    <string name="date_reminder_default">Hoy</string>
    <string name="date_error_check_again">La fecha ya pasó</string>
    <string name="night_mode">Modo Noche</string>
    <string name="night_mode_on_summary">Modo noche activo</string>
    <string name="night_mode_off_summary">Modo noche apagado</string>

    <string-array name="snooze_options">
        <item>10 Minutos</item>
        <item>30 Minutos</item>
        <item>1 Hora</item>
    </string-array>

    <string name="snooze">Siesta</string>
    <string name="remove">Terminar</string>

    <string name="acerca_titulo">Para mi novia</string>
    <string name="mensaje">Con mucho cariño para ti amor. Espero que te ayude a cumplir todos todo lo que te propongas.</string>
    <string name="felicitacion">Te quiero!</string>

    <string name="email_address" translatable="false">santiago.garcia@uaz.edu.mx</string>
    <string name="night_mode_pref_key" translatable="false">NightModePreference</string>
    <string name="example" translatable="false">Limpiar mi cuarto</string>
</resources>


text:
import PhotoItemDeleteDialog from './photo-item-delete-dialog'

export default PhotoItemDeleteDialog


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 2018 Google LLC
    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
        https://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.
 -->
<resources>
    <string-array name="entries">
        <item>Choose me!</item>
        <item>No, me!</item>
        <item>What about me?!</item>
    </string-array>

    <string-array name="entry_values">
        <item>alpha</item>
        <item>beta</item>
        <item>charlie</item>
    </string-array>
</resources>


text:
'use strict'

// var pressure = require('./pascal')

// pressure.set('megapascal', 'pascal', 1E6)

// module.exports = pressure

module.exports = ['megapascal', 'pascal', 1E6]


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>Tests for ie8png.js</title>
    <link rel="stylesheet" href="../bower_components/qunit/qunit/qunit.css">


text:
ACCEPTED

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

#### Published in
null

#### Original name
Xylopia trunciflora Schltdl. & Cham.

### Remarks
null


text:
\begin{figure}[H]
\centering
\includegraphics[width=6in]{figs/run_69/run_69_turb_visc_total_vs_r_meshscatter}
\caption{Scatter plot of non-equilibrium based $\nu_T$ vs radius at $z/c$=10.00, $V_{free}$=31.31, station 7.}
\label{fig:run_69_turb_visc_total_vs_r_meshscatter}
\end{figure}


text:
<!DOCTYPE html>
<html amp lang="en">
<head>
	<meta charset="utf-8">
	<title>sevdev: $title$</title>
	<meta name="theme-color" content="#7f2626">
	<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
	<link rel="alternate" type="application/rss+xml" title="sevdev RSS" href="$base$/rss.xml">
	<link rel="alternate" type="application/atom+xml" title="sevdev Atom" href="$base$/atom.xml">
	<link rel="icon" sizes="16x16" href="$base$/images/favicon_16px.png">
	<link rel="apple-touch-icon" href="$base$/images/favicon.svg">
	<link rel="canonical" href="$canonical_url$">
	<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
	<script async src="//cdn.ampproject.org/v9.js"></script>
</head>
<body>
	$body$
</body>
</html>


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

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.bazaarvoice.emodb</groupId>
        <artifactId>emodb-parent</artifactId>
        <version>5.7.9-SNAPSHOT</version>
        <relativePath>../../parent/pom.xml</relativePath>
    </parent>

    <artifactId>emodb-common-api</artifactId>
    <packaging>jar</packaging>

    <name>EmoDB Common API Classes</name>

    <dependencies>
        <!-- 3rd-party dependencies -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>


text:
namespace storage {

class FileStreamReader;
class FileStreamWriter;

// Reads upto |size| bytes of data from |reader|, an initialized
// FileStreamReader. The read bytes will be written to |data| and the actual
// number of bytes or the error code will be written to |result|.
void ReadFromReader(FileStreamReader* reader,
                    std::string* data,
                    size_t size,
                    int* result);

// Returns the length of the file if it could be successfully retrieved,
// otherwise a net error.
int64_t GetLengthFromReader(FileStreamReader* reader);

// Writes |data| to |writer|, an initialized FileStreamWriter. Returns net::OK
// if successful, otherwise a net error.
int WriteStringToWriter(FileStreamWriter* writer, const std::string& data);

}  // namespace storage

#endif  // STORAGE_BROWSER_FILE_SYSTEM_FILE_STREAM_TEST_UTILS_H_


text:
web-commons
===========

A collection of common code used when building content for the web


text:
using namespace epee;

namespace cryptonote
{
  //---------------------------------------------------------------
  void get_transaction_prefix_hash(const TransactionPrefix& tx, crypto::hash& h)
  {
    std::ostringstream s;
    binary_archive<true> a(s);
    ::serialization::serialize(a, const_cast<TransactionPrefix&>(tx));
    crypto::cn_fast_hash(s.str().data(), s.str().size(), h);
  }
  //---------------------------------------------------------------
  crypto::hash get_transaction_prefix_hash(const TransactionPrefix& tx)
  {
    crypto::hash h = null_hash;
    get_transaction_prefix_hash(tx, h);
    return h;
  }
  //---------------------------------------------------------------
  bool parse_and_validate_tx_from_blob(const blobdata& tx_blob, Transaction& tx)
  {
    std::stringstream ss;
    ss << tx_blob;
    binary_archive<false> ba(ss);
    bool r = ::serialization::serialize(ba, tx);
    CHECK_AND_ASSERT_MES(r, false, "Failed to parse transaction from blob");
    return true;
  }
  //---------------------------------------------------------------
  bool parse_and_validate_tx_from_blob(const blobdata& tx_blob, Transaction& tx, crypto::hash& tx_hash, crypto::hash& tx_prefix_hash)
  {
    std::stringstream ss;
    ss << tx_blob;
    binary_archive<false> ba(ss);
    bool r = ::serialization::serialize(ba, tx);
    CHECK_AND_ASSERT_MES(r, false, "Failed to parse transaction from blob");
    //TODO: validate tx

    crypto::cn_fast_hash(tx_blob.data(), tx_blob.size(), tx_hash);
    get_transaction_prefix_hash(tx, tx_prefix_hash);
    return true;
  }
  //---------------------------------------------------------------
  bool generate_key_image_helper(const account_keys& ack, const crypto::public_key& tx_public_key, size_t real_output_index, KeyPair& in_ephemeral, crypto::key_image& ki)
  {
    crypto::key_derivation recv_derivation = AUTO_VAL_INIT(recv_derivation);
    bool r = crypto::generate_key_derivation(tx_public_key, ack.m_view_secret_key, recv_derivation);
    CHECK_AND_ASSERT_MES(r, false, "key image helper: failed to generate_key_derivation(" << tx_public_key << ", " << ack.m_view_secret_key << ")");

    r = crypto::derive_public_key(recv_derivation, real_output_index, ack.m_account_address.m_spendPublicKey, in_ephemeral.pub);
    CHECK_AND_ASSERT_MES(r, false, "key image helper: failed to derive_public_key(" << recv_derivation << ", " << real_output_index <<  ", " << ack.m_account_address.m_spendPublicKey << ")");

    crypto::derive_secret_key(recv_derivation, real_output_index, ack.m_spend_secret_key, in_ephemeral.sec);

    crypto::generate_key_image(in_ephemeral.pub, in_ephemeral.sec, ki);
    return true;
  }
  //---------------------------------------------------------------
  uint64_t power_integral(uint64_t a, uint64_t b)
  {
    if(b == 0)
      return 1;
    uint64_t total = a;
    for(uint64_t i = 1; i != b; i++)
      total *= a;
    return total;
  }
  //---------------------------------------------------------------
  bool parse_tx_extra(const std::vector<uint8_t>& tx_extra, std::vector<tx_extra_field>& tx_extra_fields)
  {
    tx_extra_fields.clear();

    if(tx_extra.empty())
      return true;

    std::string extra_str(reinterpret_cast<const char*>(tx_extra.data()), tx_extra.size());
    std::istringstream iss(extra_str);
    binary_archive<false> ar(iss);

    bool eof = false;
    while (!eof) {
      tx_extra_field field;
      bool r = ::do_serialize(ar, field);
      if (!r) {
        LOG_PRINT_L4("failed to deserialize extra field. extra = " <<
          string_tools::buff_to_hex_nodelimer(std::string(reinterpret_cast<const char*>(tx_extra.data()), tx_extra.size())));
        return false;
      }
      tx_extra_fields.push_back(field);

      std::ios_base::iostate state = iss.rdstate();
      eof = (EOF == iss.peek());
      iss.clear(state);
    }

    if (!::serialization::check_stream_state(ar)) {
      LOG_PRINT_L4("failed to deserialize extra field. extra = " <<
        string_tools::buff_to_hex_nodelimer(std::string(reinterpret_cast<const char*>(tx_extra.data()), tx_extra.size())));
      return false;
    }

    return true;
  }
  //---------------------------------------------------------------
  crypto::public_key get_tx_pub_key_from_extra(const std::vector<uint8_t>& tx_extra)
  {
    std::vector<tx_extra_field> tx_extra_fields;
    parse_tx_extra(tx_extra, tx_extra_fields);

    tx_extra_pub_key pub_key_field;
    if(!find_tx_extra_field_by_type(tx_extra_fields, pub_key_field))
      return null_pkey;

    return pub_key_field.pub_key;
  }
  //---------------------------------------------------------------
  crypto::public_key get_tx_pub_key_from_extra(const Transaction& tx)
  {
    return get_tx_pub_key_from_extra(tx.extra);
  }
  //---------------------------------------------------------------
  bool add_tx_pub_key_to_extra(Transaction& tx, const crypto::public_key& tx_pub_key)
  {
    tx.extra.resize(tx.extra.size() + 1 + sizeof(crypto::public_key));
    tx.extra[tx.extra.size() - 1 - sizeof(crypto::public_key)] = TX_EXTRA_TAG_PUBKEY;
    *reinterpret_cast<crypto::public_key*>(&tx.extra[tx.extra.size() - sizeof(crypto::public_key)]) = tx_pub_key;
    return true;
  }
  //---------------------------------------------------------------
  bool add_extra_nonce_to_tx_extra(std::vector<uint8_t>& tx_extra, const blobdata& extra_nonce)
  {
    CHECK_AND_ASSERT_MES(extra_nonce.size() <= TX_EXTRA_NONCE_MAX_COUNT, false, "extra nonce could be 255 bytes max");
    size_t start_pos = tx_extra.size();
    tx_extra.resize(tx_extra.size() + 2 + extra_nonce.size());
    //write tag
    tx_extra[start_pos] = TX_EXTRA_NONCE;
    //write len
    ++start_pos;
    tx_extra[start_pos] = static_cast<uint8_t>(extra_nonce.size());
    //write data
    ++start_pos;
    memcpy(&tx_extra[start_pos], extra_nonce.data(), extra_nonce.size());
    return true;
  }
  //---------------------------------------------------------------
  void set_payment_id_to_tx_extra_nonce(blobdata& extra_nonce, const crypto::hash& payment_id)
  {
    extra_nonce.clear();
    extra_nonce.push_back(TX_EXTRA_NONCE_PAYMENT_ID);
    const uint8_t* payment_id_ptr = reinterpret_cast<const uint8_t*>(&payment_id);
    std::copy(payment_id_ptr, payment_id_ptr + sizeof(payment_id), std::back_inserter(extra_nonce));
  }
  //---------------------------------------------------------------
  bool get_payment_id_from_tx_extra_nonce(const blobdata& extra_nonce, crypto::hash& payment_id)
  {
    if(sizeof(crypto::hash) + 1 != extra_nonce.size())
      return false;
    if(TX_EXTRA_NONCE_PAYMENT_ID != extra_nonce[0])
      return false;
    payment_id = *reinterpret_cast<const crypto::hash*>(extra_nonce.data() + 1);
    return true;
  }

  bool parsePaymentId(const std::string& paymentIdString, crypto::hash& paymentId) {
    cryptonote::blobdata binData;
    if (!epee::string_tools::parse_hexstr_to_binbuff(paymentIdString, binData)) {
      return false;
    }

    if (sizeof(crypto::hash) != binData.size()) {
      return false;
    }

    paymentId = *reinterpret_cast<const crypto::hash*>(binData.data());
    return true;
  }

  bool createTxExtraWithPaymentId(const std::string& paymentIdString, std::vector<uint8_t>& extra) {
    crypto::hash paymentIdBin;

    if (!parsePaymentId(paymentIdString, paymentIdBin)) {
      return false;
    }

    std::string extraNonce;
    cryptonote::set_payment_id_to_tx_extra_nonce(extraNonce, paymentIdBin);

    if (!cryptonote::add_extra_nonce_to_tx_extra(extra, extraNonce)) {
      return false;
    }

    return true;
  }

  bool getPaymentIdFromTxExtra(const std::vector<uint8_t>& extra, crypto::hash& paymentId) {
    std::vector<tx_extra_field> tx_extra_fields;
    if(!parse_tx_extra(extra, tx_extra_fields)) {
      return false;
    }

    tx_extra_nonce extra_nonce;
    if (find_tx_extra_field_by_type(tx_extra_fields, extra_nonce)) {
      if (!get_payment_id_from_tx_extra_nonce(extra_nonce.nonce, paymentId)) {
        return false;
      }
    } else {
      return false;
    }

    return true;
  }

  bool construct_tx(const account_keys& sender_account_keys, const std::vector<tx_source_entry>& sources, const std::vector<tx_destination_entry>& destinations,
                    const std::vector<tx_message_entry>& messages, const std::vector<uint8_t>& extra, uint64_t unlock_time, Transaction& tx)
  {
    tx.vin.clear();
    tx.vout.clear();
    tx.signatures.clear();

    tx.version = TRANSACTION_VERSION_1;
    tx.unlockTime = unlock_time;

    tx.extra = extra;
    KeyPair txkey = KeyPair::generate();
    add_tx_pub_key_to_extra(tx, txkey.pub);

    struct input_generation_context_data
    {
      KeyPair in_ephemeral;
    };
    std::vector<input_generation_context_data> in_contexts;

    uint64_t summary_inputs_money = 0;
    //fill inputs
    for (const tx_source_entry& src_entr : sources)
    {
      if(src_entr.real_output >= src_entr.outputs.size())
      {
        LOG_ERROR("real_output index (" << src_entr.real_output << ")bigger than output_keys.size()=" << src_entr.outputs.size());
        return false;
      }
      summary_inputs_money += src_entr.amount;

      //key_derivation recv_derivation;
      in_contexts.push_back(input_generation_context_data());
      KeyPair& in_ephemeral = in_contexts.back().in_ephemeral;
      crypto::key_image img;
      if(!generate_key_image_helper(sender_account_keys, src_entr.real_out_tx_key, src_entr.real_output_in_tx_index, in_ephemeral, img))
        return false;

      //check that derivated key is equal with real output key
      if( !(in_ephemeral.pub == src_entr.outputs[src_entr.real_output].second) )
      {
        LOG_ERROR("derived public key missmatch with output public key! "<< ENDL << "derived_key:"
          << string_tools::pod_to_hex(in_ephemeral.pub) << ENDL << "real output_public_key:"
          << string_tools::pod_to_hex(src_entr.outputs[src_entr.real_output].second) );
        return false;
      }

      //put key image into tx input
      TransactionInputToKey input_to_key;
      input_to_key.amount = src_entr.amount;
      input_to_key.keyImage = img;

      //fill outputs array and use relative offsets
      for (const tx_source_entry::output_entry& out_entry : src_entr.outputs) {
        input_to_key.keyOffsets.push_back(out_entry.first);
      }

      input_to_key.keyOffsets = absolute_output_offsets_to_relative(input_to_key.keyOffsets);
      tx.vin.push_back(input_to_key);
    }

    // "Shuffle" outs
    std::vector<tx_destination_entry> shuffled_dsts(destinations);
    std::sort(shuffled_dsts.begin(), shuffled_dsts.end(), [](const tx_destination_entry& de1, const tx_destination_entry& de2) { return de1.amount < de2.amount; } );

    uint64_t summary_outs_money = 0;
    //fill outputs
    size_t output_index = 0;
    for (const tx_destination_entry& dst_entr : shuffled_dsts) {
      CHECK_AND_ASSERT_MES(dst_entr.amount > 0, false, "Destination with wrong amount: " << dst_entr.amount);
      crypto::key_derivation derivation;
      crypto::public_key out_eph_public_key;
      bool r = crypto::generate_key_derivation(dst_entr.addr.m_viewPublicKey, txkey.sec, derivation);
      CHECK_AND_ASSERT_MES(r, false, "at creation outs: failed to generate_key_derivation(" << dst_entr.addr.m_viewPublicKey << ", " << txkey.sec << ")");

      r = crypto::derive_public_key(derivation, output_index, dst_entr.addr.m_spendPublicKey, out_eph_public_key);
      CHECK_AND_ASSERT_MES(r, false, "at creation outs: failed to derive_public_key(" << derivation << ", " << output_index << ", "<< dst_entr.addr.m_spendPublicKey << ")");

      TransactionOutput out;
      out.amount = dst_entr.amount;
      TransactionOutputToKey tk;
      tk.key = out_eph_public_key;
      out.target = tk;
      tx.vout.push_back(out);
      output_index++;
      summary_outs_money += dst_entr.amount;
    }

    //check money
    if(summary_outs_money > summary_inputs_money )
    {
      LOG_ERROR("Transaction inputs money ("<< summary_inputs_money << ") less than outputs money (" << summary_outs_money << ")");
      return false;
    }

    for (size_t i = 0; i < messages.size(); i++) {
      const tx_message_entry &msg = messages[i];
      tx_extra_message tag;
      if (!tag.encrypt(i, msg.message, msg.encrypt ? &msg.addr : NULL, txkey)) {
        return false;
      }
      std::ostringstream oss;
      binary_archive<true> ar(oss);
      if (!::do_serialize(ar, tag)) {
        return false;
      }
      std::string s = oss.str();
      tx.extra.push_back(TX_EXTRA_MESSAGE_TAG);
      tx.extra.insert(tx.extra.end(), s.begin(), s.end());
    }

    //generate ring signatures
    crypto::hash tx_prefix_hash;
    get_transaction_prefix_hash(tx, tx_prefix_hash);

    std::stringstream ss_ring_s;
    size_t i = 0;
    for (const tx_source_entry& src_entr : sources) {
      ss_ring_s << "pub_keys:" << ENDL;
      std::vector<const crypto::public_key*> keys_ptrs;
      for (const tx_source_entry::output_entry& o : src_entr.outputs) {
        keys_ptrs.push_back(&o.second);
        ss_ring_s << o.second << ENDL;
      }

      tx.signatures.push_back(std::vector<crypto::signature>());
      std::vector<crypto::signature>& sigs = tx.signatures.back();
      sigs.resize(src_entr.outputs.size());
      crypto::generate_ring_signature(tx_prefix_hash, boost::get<TransactionInputToKey>(tx.vin[i]).keyImage, keys_ptrs,
        in_contexts[i].in_ephemeral.sec, src_entr.real_output, sigs.data());
      ss_ring_s << "signatures:" << ENDL;
      std::for_each(sigs.begin(), sigs.end(), [&](const crypto::signature& s){ss_ring_s << s << ENDL;});
      ss_ring_s << "prefix_hash:" << tx_prefix_hash << ENDL << "in_ephemeral_key: " << in_contexts[i].in_ephemeral.sec <<
        ENDL << "real_output: " << src_entr.real_output;
      i++;
    }

    LOG_PRINT2("construct_tx.log", "transaction_created: " << get_transaction_hash(tx) << ENDL << obj_to_json_str(tx) << ENDL << ss_ring_s.str() , LOG_LEVEL_3);

    return true;
  }
  //---------------------------------------------------------------
  uint64_t get_block_height(const Block& b)
  {
    CHECK_AND_ASSERT_MES(b.minerTx.vin.size() == 1, 0, "wrong miner tx in block: " << get_block_hash(b) << ", b.minerTx.vin.size() != 1");
    CHECKED_GET_SPECIFIC_VARIANT(b.minerTx.vin[0], const TransactionInputGenerate, coinbase_in, 0);
    return coinbase_in.height;
  }
  //---------------------------------------------------------------
  bool check_inputs_types_supported(const Transaction& tx) {
    for (const auto& in : tx.vin) {
      const auto& inputType = in.type();
      if (inputType == typeid(TransactionInputMultisignature)) {
        if (tx.version < TRANSACTION_VERSION_2) {
          LOG_PRINT_L1("Transaction << " << get_transaction_hash(tx) << " contains multisignature inputs but its version is less than 2");
          return false;
        }
      } else if (inputType != typeid(TransactionInputToKey)) {
        LOG_PRINT_L1("Transaction << " << get_transaction_hash(tx) << " contains inputs with invalid type.");
        return false;
      }
    }

    return true;
  }
  //-----------------------------------------------------------------------------------------------
  bool check_outs_valid(const Transaction& tx) {
    for (const TransactionOutput& out : tx.vout) {
      //assert(out.target.type() == typeid(TransactionOutputToKey) || out.target.type() == typeid(TransactionOutputMultisignature));
      if (out.target.type() == typeid(TransactionOutputToKey)) {
        CHECK_AND_NO_ASSERT_MES(0 < out.amount, false, "zero amount ouput in transaction id=" << get_transaction_hash(tx));

        if (!check_key(boost::get<TransactionOutputToKey>(out.target).key)) {
          return false;
        }
      } else if (out.target.type() == typeid(TransactionOutputMultisignature)) {
        if (tx.version < TRANSACTION_VERSION_2) {
          LOG_PRINT_L1("Transaction << " << get_transaction_hash(tx) << " contains multisignature output but its version is less than 2");
          return false;
        }

        const TransactionOutputMultisignature& multisignatureOutput = ::boost::get<TransactionOutputMultisignature>(out.target);
        if (multisignatureOutput.requiredSignatures > multisignatureOutput.keys.size()) {
          LOG_PRINT_L1("Transaction << " << get_transaction_hash(tx) << " contains multisignature output with invalid required signature count.");
          return false;
        }

        for (const crypto::public_key& key : multisignatureOutput.keys) {
          if (!check_key(key)) {
            LOG_PRINT_L1("Transaction << " << get_transaction_hash(tx) << " contains multisignature output with invalid public keys.");
            return false;
          }
        }
      } else {
        LOG_PRINT_L1("Transaction << " << get_transaction_hash(tx) << " contains outputs with invalid type.");
        return false;
      }
    }

    return true;
  }

  //-----------------------------------------------------------------------------------------------
  bool checkMultisignatureInputsDiff(const Transaction& tx) {
    std::set<std::pair<uint64_t, uint32_t>> inputsUsage;
    for (const auto& inv : tx.vin) {
      if (inv.type() == typeid(TransactionInputMultisignature)) {
        const TransactionInputMultisignature& in = ::boost::get<TransactionInputMultisignature>(inv);
        if (!inputsUsage.insert(std::make_pair(in.amount, static_cast<uint32_t>(in.outputIndex))).second) {
          return false;
        }
      }
    }
    return true;
  }

  //-----------------------------------------------------------------------------------------------
  bool check_money_overflow(const Transaction& tx)
  {
    return check_inputs_overflow(tx) && check_outs_overflow(tx);
  }
  //---------------------------------------------------------------
  bool check_inputs_overflow(const Transaction& tx)
  {
    uint64_t money = 0;

    for (const auto& in : tx.vin) {
      uint64_t amount = 0;

      if (in.type() == typeid(TransactionInputToKey)) {
        amount = boost::get<TransactionInputToKey>(in).amount;
      } else if (in.type() == typeid(TransactionInputMultisignature)) {
        amount = boost::get<TransactionInputMultisignature>(in).amount;
        if (boost::get<TransactionInputMultisignature>(in).term != 0) {
          uint64_t hi;
          uint64_t lo = mul128(amount, cryptonote::parameters::DEPOSIT_MAX_TOTAL_RATE, &hi);
          uint64_t maxInterestHi;
          uint64_t maxInterestLo;
          div128_32(hi, lo, 100, &maxInterestHi, &maxInterestLo);
          if (maxInterestHi > 0) {
            return false;
          }

          if (amount > std::numeric_limits<uint64_t>::max() - maxInterestLo) {
            return false;
          }

          amount += maxInterestLo;
        }
      }

      if (money > amount + money)
        return false;

      money += amount;
    }
    return true;
  }
  //---------------------------------------------------------------
  bool check_outs_overflow(const Transaction& tx)
  {
    uint64_t money = 0;
    for (const auto& o : tx.vout) {
      if(money > o.amount + money)
        return false;
      money += o.amount;
    }
    return true;
  }
  //---------------------------------------------------------------
  uint64_t get_outs_money_amount(const Transaction& tx)
  {
    uint64_t outputs_amount = 0;
    for (const auto& o : tx.vout) {
      outputs_amount += o.amount;
    }
    return outputs_amount;
  }
  //---------------------------------------------------------------
  std::string short_hash_str(const crypto::hash& h)
  {
    std::string res = string_tools::pod_to_hex(h);
    CHECK_AND_ASSERT_MES(res.size() == 64, res, "wrong hash256 with string_tools::pod_to_hex conversion");
    auto erased_pos = res.erase(8, 48);
    res.insert(8, "....");
    return res;
  }

  //---------------------------------------------------------------
  bool is_out_to_acc(const account_keys& acc, const TransactionOutputToKey& out_key, const crypto::key_derivation& derivation, size_t keyIndex)
  {
    crypto::public_key pk;
    derive_public_key(derivation, keyIndex, acc.m_account_address.m_spendPublicKey, pk);
    return pk == out_key.key;
  }

  //---------------------------------------------------------------
  bool is_out_to_acc(const account_keys& acc, const TransactionOutputToKey& out_key, const crypto::public_key& tx_pub_key, size_t keyIndex)
  {
    crypto::key_derivation derivation;
    generate_key_derivation(tx_pub_key, acc.m_view_secret_key, derivation);
    return is_out_to_acc(acc, out_key, derivation, keyIndex);
  }

  //---------------------------------------------------------------
  bool lookup_acc_outs(const account_keys& acc, const Transaction& tx, std::vector<size_t>& outs, uint64_t& money_transfered)
  {
    crypto::public_key tx_pub_key = get_tx_pub_key_from_extra(tx);
    if(null_pkey == tx_pub_key)
      return false;
    return lookup_acc_outs(acc, tx, tx_pub_key, outs, money_transfered);
  }
  //---------------------------------------------------------------
  bool lookup_acc_outs(const account_keys& acc, const Transaction& tx, const crypto::public_key& tx_pub_key, std::vector<size_t>& outs, uint64_t& money_transfered)
  {
    money_transfered = 0;
    size_t keyIndex = 0;
    size_t outputIndex = 0;

    crypto::key_derivation derivation;
    generate_key_derivation(tx_pub_key, acc.m_view_secret_key, derivation);

    for (const TransactionOutput& o : tx.vout) {
      assert(o.target.type() == typeid(TransactionOutputToKey) || o.target.type() == typeid(TransactionOutputMultisignature));
      if (o.target.type() == typeid(TransactionOutputToKey)) {
        if (is_out_to_acc(acc, boost::get<TransactionOutputToKey>(o.target), derivation, keyIndex)) {
          outs.push_back(outputIndex);
          money_transfered += o.amount;
        }

        ++keyIndex;
      } else if (o.target.type() == typeid(TransactionOutputMultisignature)) {
        keyIndex += boost::get<TransactionOutputMultisignature>(o.target).keys.size();
      }

      ++outputIndex;
    }
    return true;
  }
  //---------------------------------------------------------------
  void get_blob_hash(const blobdata& blob, crypto::hash& res)
  {
    cn_fast_hash(blob.data(), blob.size(), res);
  }
  //---------------------------------------------------------------
  crypto::hash get_blob_hash(const blobdata& blob)
  {
    crypto::hash h = null_hash;
    get_blob_hash(blob, h);
    return h;
  }
  //---------------------------------------------------------------
  crypto::hash get_transaction_hash(const Transaction& t)
  {
    crypto::hash h = null_hash;
    size_t blob_size = 0;
    get_object_hash(t, h, blob_size);
    return h;
  }
  //---------------------------------------------------------------
  bool get_transaction_hash(const Transaction& t, crypto::hash& res)
  {
    size_t blob_size = 0;
    return get_object_hash(t, res, blob_size);
  }
  //---------------------------------------------------------------
  bool get_transaction_hash(const Transaction& t, crypto::hash& res, size_t& blob_size)
  {
    return get_object_hash(t, res, blob_size);
  }
  //---------------------------------------------------------------
  bool get_block_hashing_blob(const Block& b, blobdata& blob) {
    if (!t_serializable_object_to_blob(static_cast<const BlockHeader&>(b), blob)) {
      return false;
    }
    crypto::hash tree_root_hash = get_tx_tree_hash(b);
    blob.append(reinterpret_cast<const char*>(&tree_root_hash), sizeof(tree_root_hash));
    blob.append(tools::get_varint_data(b.txHashes.size() + 1));

    return true;
  }
  //---------------------------------------------------------------
  bool get_block_hash(const Block& b, crypto::hash& res) {
    blobdata blob;
    if (!get_block_hashing_blob(b, blob)) {
      return false;
    }

    return get_object_hash(blob, res);
  }
  //---------------------------------------------------------------
  crypto::hash get_block_hash(const Block& b) {
    crypto::hash p = null_hash;
    get_block_hash(b, p);
    return p;
  }
  //---------------------------------------------------------------
  bool get_aux_block_header_hash(const Block& b, crypto::hash& res) {
    blobdata blob;
    if (!get_block_hashing_blob(b, blob)) {
      return false;
    }

    return get_object_hash(blob, res);
  }
  //---------------------------------------------------------------
  bool get_block_longhash(crypto::cn_context &context, const Block& b, crypto::hash& res) {
    blobdata bd;
    if (!get_block_hashing_blob(b, bd)) {
      return false;
    }

    crypto::cn_slow_hash(context, bd.data(), bd.size(), res);
    return true;
  }
  //---------------------------------------------------------------
  std::vector<uint64_t> relative_output_offsets_to_absolute(const std::vector<uint64_t>& off)
  {
    std::vector<uint64_t> res = off;
    for(size_t i = 1; i < res.size(); i++)
      res[i] += res[i-1];
    return res;
  }
  //---------------------------------------------------------------
  std::vector<uint64_t> absolute_output_offsets_to_relative(const std::vector<uint64_t>& off)
  {
    std::vector<uint64_t> res = off;
    if(!off.size())
      return res;
    std::sort(res.begin(), res.end());//just to be sure, actually it is already should be sorted
    for(size_t i = res.size()-1; i != 0; i--)
      res[i] -= res[i-1];

    return res;
  }
  //---------------------------------------------------------------
  bool parse_and_validate_block_from_blob(const blobdata& b_blob, Block& b)
  {
    std::stringstream ss;
    ss << b_blob;
    binary_archive<false> ba(ss);
    bool r = ::serialization::serialize(ba, b);
    CHECK_AND_ASSERT_MES(r, false, "Failed to parse block from blob");
    return true;
  }
  //---------------------------------------------------------------
  blobdata block_to_blob(const Block& b)
  {
    return t_serializable_object_to_blob(b);
  }
  //---------------------------------------------------------------
  bool block_to_blob(const Block& b, blobdata& b_blob)
  {
    return t_serializable_object_to_blob(b, b_blob);
  }
  //---------------------------------------------------------------
  blobdata tx_to_blob(const Transaction& tx)
  {
    return t_serializable_object_to_blob(tx);
  }
  //---------------------------------------------------------------
  bool tx_to_blob(const Transaction& tx, blobdata& b_blob)
  {
    return t_serializable_object_to_blob(tx, b_blob);
  }
  //---------------------------------------------------------------
  void get_tx_tree_hash(const std::vector<crypto::hash>& tx_hashes, crypto::hash& h)
  {
    tree_hash(tx_hashes.data(), tx_hashes.size(), h);
  }
  //---------------------------------------------------------------
  crypto::hash get_tx_tree_hash(const std::vector<crypto::hash>& tx_hashes)
  {
    crypto::hash h = null_hash;
    get_tx_tree_hash(tx_hashes, h);
    return h;
  }
  //---------------------------------------------------------------
  crypto::hash get_tx_tree_hash(const Block& b)
  {
    std::vector<crypto::hash> txs_ids;
    crypto::hash h = null_hash;
    size_t bl_sz = 0;
    get_transaction_hash(b.minerTx, h, bl_sz);
    txs_ids.push_back(h);
    for (auto& th : b.txHashes) {
      txs_ids.push_back(th);
    }
    return get_tx_tree_hash(txs_ids);
  }
  //---------------------------------------------------------------
  std::vector<std::string> get_messages_from_extra(const std::vector<uint8_t> &extra, const crypto::public_key &txkey, const crypto::secret_key *recepient_secret_key) {
    std::vector<tx_extra_field> tx_extra_fields;
    std::vector<std::string> result;
    if (!parse_tx_extra(extra, tx_extra_fields)) {
      return result;
    }
    size_t i = 0;
    for (const tx_extra_field &f: tx_extra_fields) {
      if (f.type() != typeid(tx_extra_message)) {
        continue;
      }
      std::string res;
      if (boost::get<tx_extra_message>(f).decrypt(i, txkey, recepient_secret_key, res)) {
        result.push_back(res);
      }
      ++i;
    }
    return result;
  }
}


text:
package org.nfctools.mf.classic;

import org.nfctools.mf.mad.MadConstants;

public class MemoryLayout {

	private static final int FOUR_BLOCK_SECTORS = 32;
	private static final int SIXTEEN_BLOCK_SECTORS = 8;

	public static final MemoryLayout CLASSIC_1K = new MemoryLayout(16);
	public static final MemoryLayout CLASSIC_4K = new MemoryLayout(FOUR_BLOCK_SECTORS + SIXTEEN_BLOCK_SECTORS);

	private int sectors;

	public MemoryLayout(int sectors) {
		this.sectors = sectors;
	}

	public int getMadVersion() {
		if (sectors == 16)
			return MadConstants.GPB_MAD_V1;
		else
			return MadConstants.GPB_MAD_V2;
	}

	public int getSectors() {
		return sectors;
	}

	public int getBlocksPerSector(int sectorId) {
		if (sectorId < FOUR_BLOCK_SECTORS)
			return 4;
		else
			return 16;
	}

	public int getDataBlocksPerSector(int sectorId) {
		if (sectorId < FOUR_BLOCK_SECTORS)
			return 3;
		else
			return 15;
	}

	public int getBlockNumber(int sectorId, int blockId) {
		if (sectorId < FOUR_BLOCK_SECTORS)
			return sectorId * 4 + blockId;
		else
			return (FOUR_BLOCK_SECTORS * 4) + ((sectorId - FOUR_BLOCK_SECTORS) * 16 + blockId);
	}

	public int getTrailerBlockNumberForSector(int sectorId) {
		return getBlocksPerSector(sectorId) - 1;
	}

	public boolean isTrailerBlock(int sectorId, int blockId) {
		return blockId == getBlocksPerSector(sectorId) - 1;
	}

}


text:
#ifndef GrGLShaderVar_DEFINED
#define GrGLShaderVar_DEFINED

#include "GrGLContext.h"
#include "GrGLSL.h"
#include "SkString.h"

#define USE_UNIFORM_FLOAT_ARRAYS true

/**
 * Represents a variable in a shader
 */
class GrGLShaderVar {
public:

    /**
     * Early versions of GLSL have Varying and Attribute; those are later
     * deprecated, but we still need to know whether a Varying variable
     * should be treated as In or Out.
     */
    enum TypeModifier {
        kNone_TypeModifier,
        kOut_TypeModifier,
        kIn_TypeModifier,
        kInOut_TypeModifier,
        kUniform_TypeModifier,
        kAttribute_TypeModifier,
        kVaryingIn_TypeModifier,
        kVaryingOut_TypeModifier
    };

    enum Precision {
        kLow_Precision,         // lowp
        kMedium_Precision,      // mediump
        kHigh_Precision,        // highp
        kDefault_Precision,     // Default for the current context. We make
                                // fragment shaders default to mediump on ES2
                                // because highp support is not guaranteed (and
                                // we haven't been motivated to test for it).
                                // Otherwise, highp.
    };

    /**
     * See GL_ARB_fragment_coord_conventions.
     */
    enum Origin {
        kDefault_Origin,        // when set to kDefault the origin field is ignored.
        kUpperLeft_Origin,      // only used to declare vec4 in gl_FragCoord.
    };

    /**
     * Defaults to a float with no precision specifier
     */
    GrGLShaderVar() {
        fType = kFloat_GrSLType;
        fTypeModifier = kNone_TypeModifier;
        fCount = kNonArray;
        fPrecision = kDefault_Precision;
        fOrigin = kDefault_Origin;
        fUseUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS;
    }

    GrGLShaderVar(const char* name, GrSLType type, int arrayCount = kNonArray) {
        GrAssert(kVoid_GrSLType != type);
        fType = type;
        fTypeModifier = kNone_TypeModifier;
        fCount = arrayCount;
        fPrecision = kDefault_Precision;
        fOrigin = kDefault_Origin;
        fUseUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS;
        fName = name;
    }

    GrGLShaderVar(const GrGLShaderVar& var)
        : fType(var.fType)
        , fTypeModifier(var.fTypeModifier)
        , fName(var.fName)
        , fCount(var.fCount)
        , fPrecision(var.fPrecision)
        , fOrigin(var.fOrigin)
        , fUseUniformFloatArrays(var.fUseUniformFloatArrays) {
        GrAssert(kVoid_GrSLType != var.fType);
    }

    /**
     * Values for array count that have special meaning. We allow 1-sized arrays.
     */
    enum {
        kNonArray     =  0, // not an array
        kUnsizedArray = -1, // an unsized array (declared with [])
    };

    /**
     * Sets as a non-array.
     */
    void set(GrSLType type,
             TypeModifier typeModifier,
             const SkString& name,
             Precision precision = kDefault_Precision,
             Origin origin = kDefault_Origin,
             bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) {
        GrAssert(kVoid_GrSLType != type);
        fType = type;
        fTypeModifier = typeModifier;
        fName = name;
        fCount = kNonArray;
        fPrecision = precision;
        fOrigin = origin;
        fUseUniformFloatArrays = useUniformFloatArrays;
    }

    /**
     * Sets as a non-array.
     */
    void set(GrSLType type,
             TypeModifier typeModifier,
             const char* name,
             Precision precision = kDefault_Precision,
             Origin origin = kDefault_Origin,
             bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) {
        GrAssert(kVoid_GrSLType != type);
        fType = type;
        fTypeModifier = typeModifier;
        fName = name;
        fCount = kNonArray;
        fPrecision = precision;
        fOrigin = origin;
        fUseUniformFloatArrays = useUniformFloatArrays;
    }

    /**
     * Set all var options
     */
    void set(GrSLType type,
             TypeModifier typeModifier,
             const SkString& name,
             int count,
             Precision precision = kDefault_Precision,
             Origin origin = kDefault_Origin,
             bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) {
        GrAssert(kVoid_GrSLType != type);
        fType = type;
        fTypeModifier = typeModifier;
        fName = name;
        fCount = count;
        fPrecision = precision;
        fOrigin = origin;
        fUseUniformFloatArrays = useUniformFloatArrays;
    }

    /**
     * Set all var options
     */
    void set(GrSLType type,
             TypeModifier typeModifier,
             const char* name,
             int count,
             Precision precision = kDefault_Precision,
             Origin origin = kDefault_Origin,
             bool useUniformFloatArrays = USE_UNIFORM_FLOAT_ARRAYS) {
        GrAssert(kVoid_GrSLType != type);
        fType = type;
        fTypeModifier = typeModifier;
        fName = name;
        fCount = count;
        fPrecision = precision;
        fOrigin = origin;
        fUseUniformFloatArrays = useUniformFloatArrays;
    }

    /**
     * Is the var an array.
     */
    bool isArray() const { return kNonArray != fCount; }
    /**
     * Is this an unsized array, (i.e. declared with []).
     */
    bool isUnsizedArray() const { return kUnsizedArray == fCount; }
    /**
     * Get the array length of the var.
     */
    int getArrayCount() const { return fCount; }
    /**
     * Set the array length of the var
     */
    void setArrayCount(int count) { fCount = count; }
    /**
     * Set to be a non-array.
     */
    void setNonArray() { fCount = kNonArray; }
    /**
     * Set to be an unsized array.
     */
    void setUnsizedArray() { fCount = kUnsizedArray; }

    /**
     * Access the var name as a writable string
     */
    SkString* accessName() { return &fName; }
    /**
     * Set the var name
     */
    void setName(const SkString& n) { fName = n; }
    void setName(const char* n) { fName = n; }

    /**
     * Get the var name.
     */
    const SkString& getName() const { return fName; }

    /**
     * Shortcut for this->getName().c_str();
     */
    const char* c_str() const { return this->getName().c_str(); }

    /**
     * Get the type of the var
     */
    GrSLType getType() const { return fType; }
    /**
     * Set the type of the var
     */
    void setType(GrSLType type) { fType = type; }

    TypeModifier getTypeModifier() const { return fTypeModifier; }
    void setTypeModifier(TypeModifier type) { fTypeModifier = type; }

    /**
     * Get the precision of the var
     */
    Precision getPrecision() const { return fPrecision; }

    /**
     * Set the precision of the var
     */
    void setPrecision(Precision p) { fPrecision = p; }

    /**
     * Get the origin of the var
     */
    Origin getOrigin() const { return fOrigin; }

    /**
     * Set the origin of the var
     */
    void setOrigin(Origin origin) { fOrigin = origin; }

    /**
     * Write a declaration of this variable to out.
     */
    void appendDecl(const GrGLContextInfo& ctxInfo, SkString* out) const {
        if (kUpperLeft_Origin == fOrigin) {
            // this is the only place where we specify a layout modifier. If we use other layout
            // modifiers in the future then they should be placed in a list.
            out->append("layout(origin_upper_left) ");
        }
        if (this->getTypeModifier() != kNone_TypeModifier) {
           out->append(TypeModifierString(this->getTypeModifier(),
                                          ctxInfo.glslGeneration()));
           out->append(" ");
        }
        out->append(PrecisionString(fPrecision, ctxInfo.binding()));
        GrSLType effectiveType = this->getType();
        if (this->isArray()) {
            if (this->isUnsizedArray()) {
                out->appendf("%s %s[]",
                             GrGLSLTypeString(effectiveType),
                             this->getName().c_str());
            } else {
                GrAssert(this->getArrayCount() > 0);
                out->appendf("%s %s[%d]",
                             GrGLSLTypeString(effectiveType),
                             this->getName().c_str(),
                             this->getArrayCount());
            }
        } else {
            out->appendf("%s %s",
                         GrGLSLTypeString(effectiveType),
                         this->getName().c_str());
        }
    }

    void appendArrayAccess(int index, SkString* out) const {
        out->appendf("%s[%d]%s",
                     this->getName().c_str(),
                     index,
                     fUseUniformFloatArrays ? "" : ".x");
    }

    void appendArrayAccess(const char* indexName, SkString* out) const {
        out->appendf("%s[%s]%s",
                     this->getName().c_str(),
                     indexName,
                     fUseUniformFloatArrays ? "" : ".x");
    }

private:
    static const char* TypeModifierString(TypeModifier t, GrGLSLGeneration gen) {
        switch (t) {
            case kNone_TypeModifier:
                return "";
            case kIn_TypeModifier:
                return "in";
            case kInOut_TypeModifier:
                return "inout";
            case kOut_TypeModifier:
                return "out";
            case kUniform_TypeModifier:
                return "uniform";
            case kAttribute_TypeModifier:
                return k110_GrGLSLGeneration == gen ? "attribute" : "in";
            case kVaryingIn_TypeModifier:
                return k110_GrGLSLGeneration == gen ? "varying" : "in";
            case kVaryingOut_TypeModifier:
                return k110_GrGLSLGeneration == gen ? "varying" : "out";
            default:
                GrCrash("Unknown shader variable type modifier.");
                return ""; // suppress warning
        }
    }

    static const char* PrecisionString(Precision p, GrGLBinding binding) {
        // Desktop GLSL has added precision qualifiers but they don't do anything.
        if (kES2_GrGLBinding == binding) {
            switch (p) {
                case kLow_Precision:
                    return "lowp ";
                case kMedium_Precision:
                    return "mediump ";
                case kHigh_Precision:
                    return "highp ";
                case kDefault_Precision:
                    return "";
                default:
                    GrCrash("Unexpected precision type.");
            }
        }
        return "";
    }

    GrSLType        fType;
    TypeModifier    fTypeModifier;
    SkString        fName;
    int             fCount;
    Precision       fPrecision;
    Origin          fOrigin;
    /// Work around driver bugs on some hardware that don't correctly
    /// support uniform float []
    bool            fUseUniformFloatArrays;
};

#endif


text:
<?php

declare(strict_types = 1);

namespace Telegram\API\Type;

use Telegram\API\API;
use Telegram\API\Base\Abstracts\ABaseObject;

/**
 * Class Poll
 * @package Telegram\API\Type
 * @property string $id
 * @property string $question
 * @property \Telegram\API\Type\PollOption[] $options
 * @property int $totalVoterCount
 * @property bool $isClosed
 * @property bool $isAnonymous
 * @property string $type
 * @property null|int $correctOptionId
 * @property null|string $explanation
 * @property nulL|string $explanationEntities
 * @property null|int $openPeriod
 * @property null|int $closeDate
 */
class Poll extends ABaseObject {

    protected static $_IdProp = 'id';

    const T_REGULAR = 'regular';
    const T_QUIZ = 'quiz';

    public static function GetDatamodel() : array {
        $datamodel = [
            'id' => ['type' => ABaseObject::T_STRING, 'optional' => FALSE, 'external' => 'id'],
            'question' => ['type' => ABaseObject::T_STRING, 'optional' => FALSE, 'external' => 'question'],
            'options' => ['type' => ABaseObject::T_ARRAY, 'optional' => FALSE, 'external' => 'options'],
            'totalVoterCount' => ['type' => ABaseObject::T_INT, 'optional' => FALSE, 'external' => 'total_voter_count'],
            'isClosed' => ['type' => ABaseObject::T_BOOL, 'optional' => FALSE, 'external' => 'is_closed'],
            'isAnonymous' => ['type' => ABaseObject::T_BOOL, 'optional' => FALSE, 'external' => 'is_anonymous'],
            'type' => ['type' => ABaseObject::T_STRING, 'optional' => FALSE, 'external' => 'type'],
            'allowsMultipleAnswers' => ['type' => ABaseObject::T_BOOL, 'optional' => FALSE, 'external' => 'allows_multiple_answers'],
            'correctOptionId' => ['type' => ABaseObject::T_INT, 'optional' => TRUE, 'external' => 'correct_option_id'],
            'explanation' => ['type' => ABaseObject::T_STRING, 'optional' => TRUE, 'external' => 'explanation'],
            'explanationEntities' => ['type' => ABaseObject::T_ARRAY, 'optional' => TRUE, 'explanation_entities'],
            'openPeriod' => ['type' => ABaseObject::T_INT, 'optional' => TRUE, 'external' => 'open_period'],
            'closeDate' => ['type' => ABaseObject::T_INT, 'optional' => TRUE, 'external' => 'close_date']
        ];
        return array_merge(parent::GetDatamodel(), $datamodel);
    }

    public function __construct(\stdClass $payload = NULL) {
        parent::__construct($payload);

        if (empty($this->id)) {
            $this->id = API::GenerateUUID();
        }

        if (isset($this->options)) {
            $options = [];
            foreach ($this->options as $option) {
                $options[] = new PollOption($option);
            }
            $this->options = $options;
        }
        if (isset($this->explanationEntities)) {
            $explanationEntities = [];
            foreach ($this->explanationEntities as $entity) {
                $explanationEntities[] = new MessageEntity($entity);
            }
            $this->explanationEntities = $explanationEntities;
        }
    }

}


text:
<?php

namespace Oro\Bundle\AddressBundle\Migrations\Data\ORM;

use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\ORM\EntityRepository;
use Oro\Bundle\AddressBundle\Entity\Country;
use Oro\Bundle\AddressBundle\Entity\Region;
use Oro\Bundle\MigrationBundle\Fixture\VersionedFixtureInterface;
use Oro\Bundle\TranslationBundle\DataFixtures\AbstractTranslatableEntityFixture;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Yaml\Yaml;

class LoadCountryData extends AbstractTranslatableEntityFixture implements
    VersionedFixtureInterface,
    ContainerAwareInterface
{
    const COUNTRY_PREFIX = 'country';
    const REGION_PREFIX  = 'region';

    /**
     * @var EntityRepository
     */
    protected $countryRepository;

    /**
     * @var EntityRepository
     */
    protected $regionRepository;

    /**
     * @var string
     */
    protected $structureFileName = '/data/countries.yml';

    /**
     * @var ContainerInterface
     */
    protected $container;

    /**
     * {@inheritdoc}
     */
    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
    }

    /**
     * {@inheritdoc}
     */
    public function getVersion()
    {
        return '1.2';
    }

    /**
     * {@inheritdoc}
     */
    protected function loadEntities(ObjectManager $manager)
    {
        $fileName = $this->getFileName();
        $countries = $this->getDataFromFile($fileName);
        $this->loadCountriesAndRegions($manager, $countries);
    }

    /**
     * @return string
     */
    protected function getFileName()
    {
        return $this->container
            ->get('kernel')
            ->locateResource('@OroAddressBundle/Migrations/Data/ORM' . $this->structureFileName);
    }

    /**
     * @param string $fileName
     * @return bool
     */
    protected function isFileAvailable($fileName)
    {
        return is_file($fileName) && is_readable($fileName);
    }

    /**
     * @param string $fileName
     * @return array
     * @throws \LogicException
     */
    protected function getDataFromFile($fileName)
    {
        if (!$this->isFileAvailable($fileName)) {
            throw new \LogicException('File ' . $fileName . 'is not available');
        }

        $fileName = realpath($fileName);

        return Yaml::parse(file_get_contents($fileName));
    }

    /**
     * @param string $locale
     * @param array $countryData
     * @return null|Country
     */
    protected function getCountry($locale, array $countryData)
    {
        if (empty($countryData['iso2Code']) || empty($countryData['iso3Code'])) {
            return null;
        }

        /** @var $country Country */
        $country = $this->countryRepository->findOneBy(array('iso2Code' => $countryData['iso2Code']));
        if (!$country) {
            $country = new Country($countryData['iso2Code']);
            $country->setIso3Code($countryData['iso3Code']);
        }

        $countryName = $this->translate($countryData['iso2Code'], static::COUNTRY_PREFIX, $locale);

        $country->setLocale($locale)
            ->setName($countryName);

        return $country;
    }

    /**
     * @param string $locale
     * @param Country $country
     * @param array $regionData
     * @return null|Region
     */
    protected function getRegion($locale, Country $country, array $regionData)
    {
        if (empty($regionData['combinedCode']) || empty($regionData['code'])) {
            return null;
        }

        /** @var $region Region */
        $region = $this->regionRepository->findOneBy(array('combinedCode' => $regionData['combinedCode']));
        if (!$region) {
            $region = new Region($regionData['combinedCode']);
            $region->setCode($regionData['code'])
                ->setCountry($country);
        }

        $regionName = $this->translate($regionData['combinedCode'], static::REGION_PREFIX, $locale);

        $region->setLocale($locale)
            ->setName($regionName);

        return $region;
    }

    /**
     * Load countries and regions to DB
     *
     * @param ObjectManager $manager
     * @param array $countries
     */
    protected function loadCountriesAndRegions(ObjectManager $manager, array $countries)
    {
        $this->countryRepository = $manager->getRepository('OroAddressBundle:Country');
        $this->regionRepository  = $manager->getRepository('OroAddressBundle:Region');

        $translationLocales = $this->getTranslationLocales();

        foreach ($translationLocales as $locale) {
            foreach ($countries as $countryData) {
                $country = $this->getCountry($locale, $countryData);
                if (!$country) {
                    continue;
                }

                $manager->persist($country);

                if (!empty($countryData['regions'])) {
                    foreach ($countryData['regions'] as $regionData) {
                        $region = $this->getRegion($locale, $country, $regionData);
                        if (!$region) {
                            continue;
                        }

                        $manager->persist($region);
                    }
                }
            }

            $manager->flush();
            $manager->clear();
        }
    }
}


text:
package com.douwe.notes.resource;

import com.douwe.notes.entities.EvaluationDetails;
import com.douwe.notes.entities.TypeCours;
import java.util.List;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;

/**
 *
 * @author Kenfack Valmy-Roi <roykenvalmy@gmail.com>
 */
@Path("/typeCours")
public interface ITypeCoursResource {
    @POST
    TypeCours createTypeCours(TypeCours typeCours);

    @GET
    @Path(value = "{id : \\d+}")
    @Produces(value = "application/json")
    TypeCours getTypeCours(@PathParam(value = "id") long id);

    @PUT
    @Path(value = "{id : \\d+}")
    @Produces(value = "application/json")
    TypeCours updateTypeCours(@PathParam(value = "id") long id, TypeCours typeCours);

    @GET
    @Produces(value = "application/json")
    List<TypeCours> getAllTypeCours();

    @DELETE
    @Path(value = "{id : \\d+}")
    void deleteTypeCours(@PathParam(value = "id")long id);

    @GET
    @Path(value = "{id : \\d+}/evaluations")
    @Produces(value = "application/json")
    List<EvaluationDetails> getEvaluationByTypeCours(@PathParam(value = "id")long id);

    @POST
    @Path(value = "{id : \\d+}/evaluations")
    EvaluationDetails saveEvaluationByTypeCours(@PathParam(value = "id")long id, EvaluationDetails details);

    @PUT
    @Path(value = "{idTCours : \\d+}/evaluations/{idEvaluation : \\d+}")
    @Produces(value = "application/json")
    EvaluationDetails updateEvalDetailByTypeCours(@PathParam(value = "idTCours")long idTCours,@PathParam(value = "idEvaluation")long idEvaluation ,EvaluationDetails evaluationDetails);

    @GET
    @Path(value = "{idTCours : \\d+}/evaluations/{idEvaluation : \\d+}")
    @Produces(value = "application/json")
    EvaluationDetails getEvalDetailById(@PathParam(value = "idTCours")long idTCours,@PathParam(value = "idEvaluation")long idEvaluation);

    @DELETE
    @Path(value = "{idTCours : \\d+}/evaluations/{idEvaluation : \\d+}")
    void deleteEvalDetailByTypeCours(@PathParam(value = "idTCours")long idTCours,@PathParam(value = "idEvaluation")long idEvaluation);

}


text:
<?php

namespace PUGX\Badge\Model;

/**
 * This class is intended to load ApiPackage, create, and work with the Package object
 *
 * @author Giulio De Donato <liuggio@gmail.com>
 */
interface PackageRepositoryInterface
{
    /**
     * Returns package if founded.
     *
     * @param string $repository
     *
     * @return Package
     *
     * @throws UnexpectedValueException
     */
    public function fetchByRepository($repository);
}


text:
  Loading extensions
]]

wire_expression2_PreLoadExtensions()

-- Save E2's metatable for wire_expression2_reload
if ENT then

	local wire_expression2_ENT = ENT

	function wire_expression2_reload(ply, cmd, args)
		if IsValid( ply ) and not ply:IsSuperAdmin() and not game.SinglePlayer() then
			ply:PrintMessage( 2, "Sorry " .. ply:Name() .. ", you don't have access to this command." )
			return
		end

		local function _Msg( str )
			if IsValid( ply ) then ply:PrintMessage( 2, str ) end
			if not game.SinglePlayer() then MsgN( str ) end
		end

		timer.Destroy( "E2_AutoReloadTimer" )

		_Msg( "Calling destructors for all Expression 2 chips." )
		local chips = ents.FindByClass( "gmod_wire_expression2" )
		for _, chip in ipairs( chips ) do
			if not chip.error then
				chip:PCallHook( "destruct" )
			end
			chip.script = nil
		end

		_Msg( "Reloading Expression 2 extensions." )
		ENT = wire_expression2_ENT
		wire_expression2_is_reload = true
		include( "entities/gmod_wire_expression2/core/extloader.lua" )
		wire_expression2_is_reload = nil
		ENT = nil

		_Msg( "Calling constructors for all Expression 2 chips." )
		wire_expression2_prepare_functiondata()
		if not args or args[1] ~= "nosend" then
			for _, p in ipairs( player.GetAll() ) do
				if IsValid( p ) then wire_expression2_sendfunctions( p ) end
			end
		end
		for _, chip in ipairs( chips ) do
			pcall( chip.OnRestore, chip )
		end

		_Msg( "Done reloading Expression 2 extensions." )
	end

	concommand.Add( "wire_expression2_reload", wire_expression2_reload )

end

wire_expression2_reset_extensions()

include("extpp.lua")

local included_files

local function e2_include_init()
	e2_extpp_init()
	included_files = {}
end

-- parses typename/typeid associations from a file and stores info about the file for later use by e2_include_finalize/e2_include_pass2
local function e2_include(name)
	local path, filename = string.match(name, "^(.-/?)([^/]*)$")

	local luaname = "entities/gmod_wire_expression2/core/" .. name
	local contents = file.Read(luaname, "LUA") or ""
	e2_extpp_pass1(contents)
	table.insert(included_files, { name, luaname, contents })
end

-- parses and executes an extension
local function e2_include_pass2(name, luaname, contents)
	local ok, ret = pcall(e2_extpp_pass2, contents)
	if not ok then
		WireLib.ErrorNoHalt(luaname .. ret .. "\n")
		return
	end

	if not ret then
		-- e2_extpp_pass2 returned false => file didn't need preprocessing => use the regular means of inclusion
		return include(name)
	end

	-- file needed preprocessing => Run the processed file
	local ok, func = pcall(CompileString,ret,luaname)
	if not ok then -- an error occurred while compiling
		error(func)
		return
	end

	local ok, err = pcall(func)
	if not ok then -- an error occured while executing
		if not err:find( "EXTENSION_DISABLED" ) then
			error(err)
		end
		return
	end

	__e2setcost(nil) -- Reset ops cost at the end of each file
end

local function e2_include_finalize()
	for _, info in ipairs(included_files) do
		e2_include_pass2(unpack(info))
	end
	included_files = nil
	e2_include = nil
end

-- end preprocessor stuff

e2_include_init()

e2_include("core.lua")
e2_include("array.lua")
e2_include("number.lua")
e2_include("vector.lua")
e2_include("string.lua")
e2_include("angle.lua")
e2_include("entity.lua")
e2_include("player.lua")
e2_include("timer.lua")
e2_include("selfaware.lua")
e2_include("unitconv.lua")
e2_include("wirelink.lua")
e2_include("console.lua")
e2_include("find.lua")
e2_include("files.lua")
e2_include("cl_files.lua")
e2_include("globalvars.lua")
e2_include("ranger.lua")
e2_include("sound.lua")
e2_include("color.lua")
e2_include("serverinfo.lua")
e2_include("chat.lua")
e2_include("constraint.lua")
e2_include("weapon.lua")
e2_include("gametick.lua")
e2_include("npc.lua")
e2_include("matrix.lua")
e2_include("vector2.lua")
e2_include("signal.lua")
e2_include("bone.lua")
e2_include("table.lua")
e2_include("serialization.lua")
e2_include("hologram.lua")
e2_include("complex.lua")
e2_include("bitwise.lua")
e2_include("quaternion.lua")
e2_include("debug.lua")
e2_include("http.lua")
e2_include("compat.lua")
e2_include("custom.lua")
e2_include("datasignal.lua")
e2_include("egpfunctions.lua")
e2_include("functions.lua")
e2_include("strfunc.lua")
e2_include("steamidconv.lua")

-- Load serverside files here, they need additional parsing
do
	local list = file.Find("entities/gmod_wire_expression2/core/custom/*.lua", "LUA")
	for _, filename in pairs(list) do
		if filename:sub(1, 3) ~= "cl_" then
			e2_include("custom/" .. filename)
		end
	end
end

e2_include_finalize()
wire_expression2_CallHook("postinit")
wire_expression2_PostLoadExtensions()


text:
<!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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.12"/>
<title>OpenCV: cv::detail::MatchesInfo Struct Reference</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon" />
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>

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

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

OpenCV
    3.2.0

Open Source Computer Vision

cv

detail

MatchesInfo

Public Member Functions |
Public Attributes |
List of all members

cv::detail::MatchesInfo Struct Reference
Images stitching » Features Finding and Images Matching

Structure containing information about matches between two images.
 More...

#include "matchers.hpp"

Public Member Functions

 	MatchesInfo ()

 	MatchesInfo (const MatchesInfo &other)

const MatchesInfo & 	operator= (const MatchesInfo &other)

Public Attributes

double 	confidence

 	Confidence two images are from the same panorama.  More...

int 	dst_img_idx

 	Images indices (optional)  More...

Mat 	H

 	Estimated transformation.  More...

std::vector< uchar > 	inliers_mask

 	Geometrically consistent matches mask.  More...

std::vector< DMatch > 	matches

int 	num_inliers

 	Number of geometrically consistent matches.  More...

int 	src_img_idx

Detailed Description

Structure containing information about matches between two images.

It's assumed that there is a transformation between those images. Transformation may be homography or affine transformation based on selected matcher.

See also

detail::FeaturesMatcher

Constructor & Destructor Documentation

§ MatchesInfo() [1/2]

          cv::detail::MatchesInfo::MatchesInfo
          (
          	)

§ MatchesInfo() [2/2]

          cv::detail::MatchesInfo::MatchesInfo
          (
          const MatchesInfo &
          other	)

Member Function Documentation

§ operator=()

          const MatchesInfo& cv::detail::MatchesInfo::operator=
          (
          const MatchesInfo &
          other	)

Member Data Documentation

§ confidence

          double cv::detail::MatchesInfo::confidence

Confidence two images are from the same panorama.

§ dst_img_idx

          int cv::detail::MatchesInfo::dst_img_idx

Images indices (optional)

§ H

          Mat cv::detail::MatchesInfo::H

Estimated transformation.

§ inliers_mask

          std::vector<uchar> cv::detail::MatchesInfo::inliers_mask

Geometrically consistent matches mask.

§ matches

          std::vector<DMatch> cv::detail::MatchesInfo::matches

§ num_inliers

          int cv::detail::MatchesInfo::num_inliers

Number of geometrically consistent matches.

§ src_img_idx

          int cv::detail::MatchesInfo::src_img_idx

The documentation for this struct was generated from the following file:

stitching/include/opencv2/stitching/detail/matchers.hpp

<address class="footer">
Generated on Fri Dec 23 2016 13:00:29 for OpenCV by

 1.8.12
</address>


text:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Abstract class for the formatted transformations plugins
 *
 * @package    PhpMyAdmin-Transformations
 * @subpackage Formatted
 */
if (! defined('PHPMYADMIN')) {
    exit;
}

/* Get the transformations interface */
require_once 'libraries/plugins/TransformationsPlugin.class.php';

/**
 * Provides common methods for all of the formatted transformations plugins.
 *
 * @package PhpMyAdmin
 */
abstract class FormattedTransformationsPlugin extends TransformationsPlugin
{
    /**
     * Gets the transformation description of the specific plugin
     *
     * @return string
     */
    public static function getInfo()
    {
        return __(
            'Displays the contents of the column as-is, without running it'
            . ' through htmlspecialchars(). That is, the column is assumed'
            . ' to contain valid HTML.'
        );
    }

    /**
     * Does the actual work of each specific transformations plugin.
     *
     * @param string $buffer  text to be transformed
     * @param array  $options transformation options
     * @param string $meta    meta information
     *
     * @return void
     */
    public function applyTransformation($buffer, $options = array(), $meta = '')
    {
        return $buffer;
    }

    /**
     * This method is called when any PluginManager to which the observer
     * is attached calls PluginManager::notify()
     *
     * @param SplSubject $subject The PluginManager notifying the observer
     *                            of an update.
     *
     * @todo implement
     * @return void
     */
    public function update (SplSubject $subject)
    {
        ;
    }

    /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */

    /**
     * Gets the transformation name of the specific plugin
     *
     * @return string
     */
    public static function getName()
    {
        return "Formatted";
    }
}
?>


text:
from fabric.decorators import task, roles

from haus_vars import APP_INFO, parse_vars
from fabric.api import run, execute
from fabric.context_managers import cd

from heroku import create_fixture_on_s3, grab_fixture_on_s3

import cStringIO

def copyBucket(srcBucketName, dstBucketName, aws_key, aws_secret, folder_name='uploads'):
    from boto.s3.connection import S3Connection
    conn = S3Connection(aws_key, aws_secret)
    source = conn.get_bucket(srcBucketName);
    destination = conn.get_bucket(dstBucketName);
    if folder_name:
        s3keys = source.list(folder_name)
    else:
        s3keys = source.list()

    for k in s3keys:
        print 'Copying ' + k.key + ' from ' + srcBucketName + ' to ' + dstBucketName
        destination.copy_key(k.key, srcBucketName, k.key, preserve_acl=True)

def copyBucketDifferentOwners(src_settings, dst_settings, folder_name='uploads'):
    from boto.s3.connection import S3Connection
    srcBucketName = src_settings['AWS_BUCKET_NAME']
    dstBucketName = dst_settings['AWS_BUCKET_NAME']
    src_conn = S3Connection(src_settings['AWS_ACCESS_KEY_ID'], src_settings['AWS_SECRET_ACCESS_KEY'])
    dst_conn = S3Connection(dst_settings['AWS_ACCESS_KEY_ID'], dst_settings['AWS_SECRET_ACCESS_KEY'])
    source = src_conn.get_bucket(srcBucketName);
    destination = dst_conn.get_bucket(dstBucketName);
    if folder_name:
        s3keys = source.list(folder_name)
    else:
        s3keys = source.list()

    for k in s3keys:
        print 'Copying ' + k.key + ' from ' + srcBucketName + ' to ' + dstBucketName
        f = cStringIO.StringIO()
        k.get_contents_to_file(f)
        nk = destination.new_key(k.key)
        f.seek(0)
        nk.set_contents_from_file(f,
                                  policy='public-read',
                                  headers={ 'Content-Type': k.content_type }
                                  )

@task
@roles('vagrant')
def update_uploads(src_env='staging', dst_env='dev', different_owners=False):
    """copies the uploads folder from src_env to dst_env s3 buckets, pass different_owners=True to copy between s3 buckets that belong to different accounts"""
    print "UPDATING UPLOADS...."
    different_owners = str(different_owners).lower() == 'true'
    print "{}".format(APP_INFO)
    src_app_env = APP_INFO[src_env]['APP_ENV']
    dst_app_env = APP_INFO[dst_env]['APP_ENV']
    with(cd('/var/www')):
        src_settings = parse_vars(run("APP_ENV={} ./manage.py settings_vars AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_BUCKET_NAME".format(src_app_env)))
        dst_settings = parse_vars(run("APP_ENV={} ./manage.py settings_vars AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_BUCKET_NAME".format(dst_app_env)))
    src = src_settings['AWS_BUCKET_NAME']
    dst = dst_settings['AWS_BUCKET_NAME']
    folder = 'uploads'

    owners = {
              'dev': 1,
              'staging': 1,
              'production': 1,
              }

    if different_owners or owners[src_env] != owners[dst_env]:
        copyBucketDifferentOwners(src_settings, dst_settings, folder)
    else:
        copyBucket(src, dst, src_settings['AWS_ACCESS_KEY_ID'], src_settings['AWS_SECRET_ACCESS_KEY'], folder)

@task
@roles('vagrant')
def update_fixture(src_env='staging', dst_env='dev', do_update_uploads=True, *args, **kwargs):
    """ updates fixture and downloads it for given src_env (staging by default) copies uploads directory from src_env to dst_env s3 buckets unless update_uploads=False"""
    if str(do_update_uploads).lower() == 'false':
        do_update_uploads = False
    execute(create_fixture_on_s3, env=src_env)
    execute(grab_fixture_on_s3, env=src_env)
    if do_update_uploads:
        execute(update_uploads, src_env=src_env, dst_env=dst_env)


text:
package containerd

import "golang.org/x/net/context"

type ContainerInfo struct {
	ID      string
	Runtime string
}

type Container interface {
	// Information of the container
	Info() ContainerInfo
	// Start the container's user defined process
	Start(context.Context) error
	// State returns the container's state
	State(context.Context) (State, error)
	// Kill signals a container
	Kill(context.Context, uint32, bool) error
	// Exec adds a process into the container
	Exec(context.Context, ExecOpts) (Process, error)
	// Pty resizes the processes pty/console
	Pty(context.Context, uint32, ConsoleSize) error
	// CloseStdin closes the processes stdin
	CloseStdin(context.Context, uint32) error
}

type LinuxContainer interface {
	Container

	Pause(context.Context) error
	Resume(context.Context) error
}

type ExecOpts struct {
	Spec []byte
	IO   IO
}

type Process interface {
	// State returns the process state
	State(context.Context) (State, error)
	// Kill signals a container
	Kill(context.Context, uint32, bool) error
}

type ConsoleSize struct {
	Width  uint32
	Height uint32
}

type Status int

const (
	CreatedStatus Status = iota + 1
	RunningStatus
	StoppedStatus
	DeletedStatus
	PausedStatus
)

type State interface {
	// Status is the current status of the container
	Status() Status
	// Pid is the main process id for the container
	Pid() uint32
}


text:
{% macro pager() %}
{% if paginator.page_count!=1 %}

{{paginator.pager(format='~20~')}}

{% endif %}
{% endmacro %}
{% set last_date = None %}

<!DOCTYPE html>

    <title>MSPARP (BETA)</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="initial-scale=1" content="width=device-width" />
    <link rel="stylesheet" type="text/css" href="msparp.css" />
    <link rel="stylesheet" type="text/css" href="chat.css" />

{{pager()}}

{% if lines|length == 0 %}

There isn't a log for this chat - either it hasn't existed long enough to be archived or I've screwed up the archiving system yet again. Chats are archived about half an hour after the chat reaches 50 lines, so if you're still seeing this message after that then please send a series of very angry asks to tehdragonfly.tumblr.com.

{% else %}

{% for line in lines %}
    {% set current_date = line['datetime'].date() %}

    {% if current_date!=last_date %}

{{current_date.strftime("%A %d %B %Y")}}

        {% set last_date = current_date %}
    {% endif %}

{{line['line']}}{{line['datetime'].strftime('%X')}}

{% endfor %}

{% endif %}

{{pager()}}
{% raw %}

{% endraw %}


text:
using KerbalEngineer.Flight.Sections;
using KerbalEngineer.Helpers;

#endregion

namespace KerbalEngineer.Flight.Readouts.Vessel
{
    public class ThrustTorque : ReadoutModule
    {
        #region Constructors

        public ThrustTorque()
        {
            this.Name = "Thrust torque";
            this.Category = ReadoutCategory.GetCategory("Vessel");
            this.HelpString = "Thrust torque due to vessel asymmetries and gimballing";
            this.IsDefault = true;
        }

        #endregion

        #region Methods: public

        public override void Draw(SectionModule section)
        {
            if (SimulationProcessor.ShowDetails)
            {
                this.DrawLine(Units.ToTorque(SimulationProcessor.LastStage.maxThrustTorque), section.IsHud);
            }
        }

        public override void Reset()
        {
            FlightEngineerCore.Instance.AddUpdatable(SimulationProcessor.Instance);
        }

        public override void Update()
        {
            SimulationProcessor.RequestUpdate();
        }

        #endregion
    }
}


text:
package edu.berkeley.compbio.ml.cluster.bayesian;

import com.davidsoergel.dsutils.collections.WeightedSet;
import com.davidsoergel.stats.DissimilarityMeasure;
import com.davidsoergel.stats.DistributionException;
import com.davidsoergel.stats.Multinomial;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Multiset;
import com.google.common.collect.TreeMultimap;
import edu.berkeley.compbio.ml.cluster.AdditiveClusterable;
import edu.berkeley.compbio.ml.cluster.CentroidCluster;
import edu.berkeley.compbio.ml.cluster.Cluster;
import edu.berkeley.compbio.ml.cluster.ClusterMove;
import edu.berkeley.compbio.ml.cluster.ClusterRuntimeException;
import edu.berkeley.compbio.ml.cluster.ClusteringTestResults;
import edu.berkeley.compbio.ml.cluster.NoGoodClusterException;
import edu.berkeley.compbio.ml.cluster.ProhibitionModel;
import org.apache.log4j.Logger;

import java.util.Collection;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Set;

/**
 * @author David Soergel
 * @version $Id$
 */
public class TacoaClustering<T extends AdditiveClusterable<T>> extends MultiNeighborClustering<T>
	{
// ------------------------------ FIELDS ------------------------------

	private static final Logger logger = Logger.getLogger(TacoaClustering.class);

	private final double bestScoreRatioThreshold;

// --------------------------- CONSTRUCTORS ---------------------------

	/**
	 * @param dm The distance measure to use
	 */

	public TacoaClustering(final DissimilarityMeasure<T> dm, final Set<String> potentialTrainingBins,
	                       final Map<String, Set<String>> predictLabelSets, final ProhibitionModel<T> prohibitionModel,
	                       final Set<String> testLabels, final int maxNeighbors, final double bestScoreRatioThreshold)
		{
		super(dm, Double.POSITIVE_INFINITY, potentialTrainingBins, predictLabelSets, prohibitionModel, testLabels,
		      maxNeighbors);
		this.bestScoreRatioThreshold = bestScoreRatioThreshold;
		}

// -------------------------- OTHER METHODS --------------------------

/*	protected Map<String, Set<String>> findPopulatedPredictLabelSets(ClusteringTestResults tr) throws DistributionException
		{
		Multiset<String> populatedTrainingLabels = new HashMultiset<String>();

		if (predictLabelSets.size() > 1)
			{
			throw new ClusterRuntimeException(
					"TacoaClustering can't yet handle more than one exclusive label set at a time: " + predictLabelSets
							.keySet());
			}

		Set<String> predictLabels = predictLabelSets.values().iterator().next();

		for (CentroidCluster<T> theCluster : theClusters)
			{
			final String label = theCluster.getDerivedLabelProbabilities().getDominantKeyInSet(predictLabels);
			populatedTrainingLabels.add(label);
			tr.incrementTotalTrainingMass(theCluster.getWeightedLabels().getItemCount());
			}

		// ** we're going to hack the prior probabilities using the number of clusters per label
		// TacoaDistanceMeasure takes the prior to be per label, not per cluster
		// so, the "distance" between a sample and a cluster depends on the label set we're trying to predict
		// this is why we can deal with only one label set at a time

		clusterPriors = new HashMap<CentroidCluster<T>, Double>();
		Multinomial<String> labelPriors = new Multinomial<String>(populatedTrainingLabels);
		for (CentroidCluster<T> theCluster : theClusters)
			{
			final String label =
					theCluster.getDerivedLabelProbabilities().getDominantKeyInSet(predictLabels); // PERF redundant
			clusterPriors.put(theCluster, labelPriors.get(label));
			}
		Map<String, Set<String>> result = new HashMap<String, Set<String>>();
		result.put(predictLabelSets.keySet().iterator().next(), populatedTrainingLabels.elementSet());
		return result;
		}
*/

	/**
	 * Hack the prior probabilities using the number of clusters per training label.  TacoaDistanceMeasure takes the prior
	 * to be per label, not per cluster.   So, the "distance" between a sample and a cluster depends on how many clusters
	 * share the same training label.
	 */
	protected synchronized void preparePriors() //throws DistributionException
		{
		//normalizeClusterLabelProbabilities();
		try
			{
			final Multiset<String> populatedTrainingLabels = HashMultiset.create();
			//int clustersWithTrainingLabel = 0;
			final Collection<? extends CentroidCluster<T>> immutableClusters = getClusters();
			for (final CentroidCluster<T> theCluster : immutableClusters)
				{
				try
					{
					// note this also insures that every cluster has a training label, otherwise it throws NoSuchElementException
					final String label =
							theCluster.getImmutableWeightedLabels().getDominantKeyInSet(potentialTrainingBins);
					// could use theCluster.getDerivedLabelProbabilities() there except they're not normalized yet, and there's no need

					populatedTrainingLabels.add(label);
					//clustersWithTrainingLabel++;
					}
				catch (NoSuchElementException e)
					{
					logger.warn("Cluster has no training label: " + theCluster);
					}
				}

			logger.info(String.valueOf(populatedTrainingLabels.size()) + " of " + getNumClusters()
			            + " clusters have a training label; " + populatedTrainingLabels.entrySet().size()
			            + " labels were trained");

			final ImmutableMap.Builder<Cluster<T>, Double> builder = ImmutableMap.builder();

			final Multinomial<String> labelPriors = new Multinomial<String>(populatedTrainingLabels);
			for (final CentroidCluster<T> theCluster : immutableClusters)
				{
				final String label = theCluster.getImmutableWeightedLabels()
						.getDominantKeyInSet(potentialTrainingBins); // PERF redundant
				builder.put(theCluster, labelPriors.get(label));
				}

			clusterPriors = builder.build();
			}
		catch (DistributionException e)
			{
			logger.error("Error", e);
			throw new ClusterRuntimeException(e);
			}
		}

/*	protected void testOneSample(DissimilarityMeasure<String> intraLabelDistances, ClusteringTestResults tr,
	                             final Map<String, Set<String>> populatedPredictLabelSets, T frag)
		{
		WeightedSet<String> predictedLabelWeights = predictLabelWeights(tr, frag);
		testAgainstPredictionLabels(intraLabelDistances, tr, populatedPredictLabelSets, frag, predictedLabelWeights);
		}
*/

	/**
	 * allow an overriding clustering method to tweak the distances, set vote weights, etc.
	 *
	 * @param cluster
	 * @param distance
	 * @return
	 */
	protected ClusterMove<T, CentroidCluster<T>> makeClusterMove(final CentroidCluster<T> cluster,
	                                                             final double distance)
		{
		final ClusterMove<T, CentroidCluster<T>> cm = new ClusterMove<T, CentroidCluster<T>>();
		cm.bestCluster = cluster;
		cm.voteWeight = distance;

		// ** hack: monotonic positive inversion to a distance-like metric (smaller better)
		cm.bestDistance = 1.0 / distance;
		return cm;
		}

	protected WeightedSet<String> predictLabelWeights(final ClusteringTestResults tr,
	                                                  final T frag) //, Set<String> populatedTrainingLabels)
		{
		//double secondToBestDistanceRatio = 0;

		//double bestDistance;
		//double bestVoteProportion;
		double secondToBestVoteRatio = 0;

		double voteProportion = 0;
		double bestVotes = 0;

		WeightedSet<String> labelWeights = null;
		//VotingResults votingResults = null;

		try
			{
			// make the prediction
			final TreeMultimap<Double, ClusterMove<T, CentroidCluster<T>>> moves = scoredClusterMoves(frag);

			// consider up to maxNeighbors neighbors.  If fewer neighbors than that passed the unknown threshold, so be it.
			final VotingResults votingResults = addUpNeighborVotes(moves); //, populatedTrainingLabels);
			labelWeights = votingResults.getLabelVotes();

			final BestLabelPair votingWinners = votingResults.getSubResults(potentialTrainingBins);

			// note the "votes" from each cluster may be fractional (probabilities) but we just summed them all up.

			// now pick the best one
			final String predictedLabel = votingWinners.getBestLabel();
			bestVotes = labelWeights.get(predictedLabel);

			voteProportion = labelWeights.getNormalized(predictedLabel);

			// In TACOA, distance == votes, so we don't deal with them separately

			// check that there's not a (near) tie
			if (votingWinners.hasSecondBestLabel())
				{
				final String secondBestLabel = votingWinners.getSecondBestLabel();

				final double secondBestVotes = labelWeights.get(secondBestLabel);
				assert secondBestVotes <= bestVotes;

				// if the top two scores are too similar...
				secondToBestVoteRatio = secondBestVotes / bestVotes;
				if (secondToBestVoteRatio > bestScoreRatioThreshold)
					{
					throw new NoGoodClusterException();
					}
				}
			else
				{
				secondToBestVoteRatio =
						1e308; // Double.MAX_VALUE; triggers MySQL bug # 21497  // infinity really, but that causes jdbc problems
				}
			}
		catch (NoGoodClusterException e)
			{

			//bestDistance = UNKNOWN_DISTANCE;
			//secondToBestDistanceRatio = 1.0;
			bestVotes = 1e-9;
			voteProportion = 0;
			secondToBestVoteRatio = 1.0;

			tr.incrementUnknown();
			}

		// In TACOA, distance == inverse of votes, so we don't really need to record them separately
		// ** hack: monotonic positive inversion to a distance-like metric (smaller better)
		final double bestDistance = 1.0 / bestVotes;
		final double secondToBestDistanceRatio = 1.0 / secondToBestVoteRatio;
		tr.addClusterResult(bestDistance, secondToBestDistanceRatio, voteProportion, secondToBestVoteRatio);

		return labelWeights;
		}

/*
  private VotingResults addUpNeighborVotes(TreeMultimap<Double, ClusterMove<T, CentroidCluster<T>>> moves, Set<String> populatedTrainingLabels)
	  {
	  VotingResults result = new VotingResults();

	  for (ClusterMove<T, CentroidCluster<T>> cm : moves.values())
		  {
		  WeightedSet<String> labelsOnThisCluster = cm.bestCluster.getDerivedLabelProbabilities();

		  // in the usual case, labelsOnThisCluster contains a single label with weight 1.
		  // but it might have weights for all the ancestors too

		  // we actually want the vote to count in proportion to the computed "distance", which is really a score (bigger better):
		  result.addVotes(labelsOnThisCluster, cm.bestDistance);

		  //** dunno if this makes any sense here... OK, it allows computing weighted distances per label later
		  for (Map.Entry<String, Double> entry : labelsOnThisCluster.getItemNormalizedMap().entrySet())
			  {
			  final String label = entry.getKey();
			  final Double labelProbability = entry.getValue();

			  result.addContribution(cm, label, labelProbability);
			  }
		  }
	  result.finish(populatedTrainingLabels);
	  return result;
	  }*/
	}


text:
class MiqReport::Formats
  private_class_method def self.format_hash
    @format_hash ||= YAML.load_file(ApplicationRecord::FIXTURE_DIR.join('miq_report_formats.yml')).freeze
  end

  private_class_method def self.formats
    format_hash[:formats]
  end

  private_class_method def self.defaults_and_overrides
    format_hash[:defaults_and_overrides]
  end

  def self.available_formats_for(column, suffix, datatype)
    is_break_sfx = (suffix && MiqReport.is_break_suffix?(suffix))
    formats.each_with_object({}) do |(format_name, properties), result|
      # Ignore formats that don't include suffix if the column name has a break suffix
      next if is_break_sfx && (properties[:suffixes].nil? || !properties[:suffixes].include?(suffix.to_sym))
      next unless (properties[:columns] && properties[:columns].include?(column)) ||
                  (properties[:sub_types] && properties[:sub_types].include?(sub_type(column))) ||
                  (properties[:data_types] && properties[:data_types].include?(datatype)) ||
                  (properties[:suffixes] && properties[:suffixes].include?(suffix.to_sym)) ||
                  format_name == sub_type(column) ||
                  format_name == defaults_and_overrides[:formats_by_sub_type][sub_type(column)]

      result[format_name] = properties[:description]
    end
  end

  def self.default_format_for_path(path, datatype)
    column = path.split('-').last.to_sym
    suffix = column.to_s.split('__').last.try(:to_sym)
    # HACK: formats for columns are unqualified, so we need a
    # temporary way to avoid collisions
    defaults_and_overrides[:formats_by_path].fetch(path.to_sym) do
      defaults_and_overrides[:formats_by_suffix][suffix] ||
        defaults_and_overrides[:formats_by_column][column] ||
        defaults_and_overrides[:formats_by_sub_type][sub_type(column)] ||
        defaults_and_overrides[:formats_by_data_type][datatype]
    end
  end

  def self.default_format_details_for(path, column, datatype)
    format = formats[default_format_for_path(path, datatype)]
    if format
      format = format.deep_clone # Make sure we don't taint the original
      if defaults_and_overrides[:precision_by_column].key?(column.to_sym)
        format[:precision] = defaults_and_overrides[:precision_by_column][column.to_sym]
      end
    end
    format
  end

  def self.details(format_name)
    formats[format_name.try(:to_sym)]
  end

  def self.sub_type(column)
    defaults_and_overrides[:sub_types_by_column][column]
  end
end


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
J. Hattori bot. Lab. 43: 290 (1977)

#### Original name
Stereocaulon crambidiocephalum I.M. Lamb

### Remarks
null


text:
@current_recipe = "rspec"
@before_configs["rspec"].call if @before_configs["rspec"]
say_recipe 'RSpec'

@configs[@current_recipe] = config

gem 'rspec-rails', '>= 2.12.0', :group => [:development, :test]

inject_into_file "config/initializers/generators.rb", :after => "Rails.application.config.generators do |g|\n" do
  "  g.test_framework = :rspec\n"
end

after_bundler do
  generate 'rspec:install'
end


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Hello Lilacs</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />

    <link rel="stylesheet" href="../../../css/test/index.css" />
    <link rel="stylesheet" href="../../../css/parent/test/index.css" />

Hello Lilacs!