text:
<?php

namespace App\Modules\Forms\Controllers;

use App\Shared\Controllers\ControllerBase;
use App\Plugins\Tools;

class CadastroProdutosController extends ControllerBase
{

    /**
     * initialize
     */
    public function initialize()
    {
        $this->tag->setTitle('Formulário de Cadastro de Produtos');
        parent::initialize();
    }

    public function indexAction()
    {

    }

    public function sendFormAction()
    {
        try {
            if (!$this->request->isPost()) {
                throw new \Exception('Acesso indevido a essa action.');
            }

            $this->view->setTemplateBefore('blank');

            $uploadedFiles = '';
            if ($this->request->hasFiles(true) == true) {
                $tools = new Tools();
                $uploadedFiles = $tools->uploadedFiles($this->request->getUploadedFiles());

                if (!empty($uploadedFiles['error'])) {
                    $this->flash->error($uploadedFiles['error']);
                    unset($uploadedFiles['error']);
                }
                $options['attach'] = $uploadedFiles;
            }

            $this->view->campos = $this->request->getPost();
            $to = [$this->auth_identity->email => $this->auth_identity->nome];
            $subject = 'Solicitação Cadastro de Produtos';
            $params = ['campos' => $this->request->getPost()];
            $options['copy'] = ['cadastro@grupompe.com.br' => 'Cadastro - Grupo MPE'];

            //log
            $options['log'] = [
                'formName' => $subject,
                'usersName' => $this->auth_identity->userName,
                'identKey' => 'Nome do Material: ' . $this->request->getPost('Nome_do_Material') . ' - ' .
                'Material de Fabricação: ' . $this->request->getPost('Material_de_Fabricação'),
            ];

            $return = $this->mail->send($to, $subject, 'blank', $params, $options);

            if ($return) {
                $this->flash->success('Sua solicitação foi enviada com Sucesso. Você receberá, em breve, um e-mail contendo as informações dessa solicitação.');
            }

            if (!empty($uploadedFiles)) {
                $this->eraseFiles($uploadedFiles);
            }
        } catch (\Exception $e) {
            $this->flash->error($e->getMessage());
        }
        return $this->response->redirect('forms/cadastro_produtos/');
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Versl. Verg. Wis- Natuurk. Afd. KNAW 32: 119 (1923)

#### Original name
Oidium suaveolens var. minutum Berkhout

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
package org.jbpm.casemgmt.api.dynamic;

import java.util.Map;

/**
 * Provides all required information about a dynamic task so it can be represented as correct
 * node type when added to case/process instance.
 *
 */
public interface TaskSpecification {

    /**
     * Returns the type of the node that will be added. Usually it corresponds to the
     * name used when registering work item handler.
     * @return
     */
    String getNodeType();

    /**
     * Optional set of parameters to be given to created dynamic task.
     * @return
     */
    Map<String, Object> getParameters();
}


text:
//go:generate go run github.com/mailru/easyjson/easyjson $GOFILE

package elasticsearch

import (
	"encoding/json"
	"errors"

	"github.com/olivere/elastic/v7"

	"github.com/skydive-project/skydive/common"
	"github.com/skydive-project/skydive/flow"
	fl "github.com/skydive-project/skydive/flow/layers"
	etcd "github.com/skydive-project/skydive/graffiti/etcd/client"
	"github.com/skydive-project/skydive/graffiti/filters"
	es "github.com/skydive-project/skydive/graffiti/storage/elasticsearch"
)

const flowMapping = `
{
	"dynamic_templates": [
		{
			"strings": {
				"match": "*",
				"match_mapping_type": "string",
				"mapping": {
					"type": "keyword"
				}
			}
		},
		{
			"packets": {
				"match": "*Packets",
				"mapping": {
					"type": "long"
				}
			}
		},
		{
			"bytes": {
				"match": "*Bytes",
				"mapping": {
					"type": "long"
				}
			}
		},
		{
			"rtt": {
				"match": "RTT",
				"mapping": {
					"type": "long"
				}
			}
		},
		{
			"start": {
				"match": "*Start",
				"mapping": {
					"type": "date",
					"format": "epoch_millis"
				}
			}
		},
		{
			"last": {
				"match": "Last",
				"mapping": {
					"type": "date",
					"format": "epoch_millis"
				}
			}
		},
		{
			"last": {
				"match": "Timestamp",
				"mapping": {
					"type": "date",
					"format": "epoch_millis"
				}
			}
		}
	]
}`

var (
	flowIndex = es.Index{
		Name:      "flow",
		Mapping:   flowMapping,
		RollIndex: true,
	}
	metricIndex = es.Index{
		Name:      "metric",
		Mapping:   flowMapping,
		RollIndex: true,
	}
	rawpacketIndex = es.Index{
		Name:      "rawpacket",
		Mapping:   flowMapping,
		RollIndex: true,
	}
)

// Storage describes an ElasticSearch flow backend
type Storage struct {
	client      *es.Client
	indexPrefix string
}

// easyjson:json
type embeddedFlow struct {
	UUID         *string
	LayersPath   *string
	Application  *string
	Link         *flow.FlowLayer      `json:"Link,omitempty"`
	Network      *flow.FlowLayer      `json:"Network,omitempty"`
	Transport    *flow.TransportLayer `json:"Transport,omitempty"`
	ICMP         *flow.ICMPLayer      `json:"ICMP,omitempty"`
	DHCPv4       *fl.DHCPv4           `json:"DHCPv4,omitempty"`
	DNS          *fl.DNS              `json:"DNS,omitempty"`
	VRRPv2       *fl.VRRPv2           `json:"VRRPv2,omitempty"`
	TrackingID   *string
	L3TrackingID *string
	ParentUUID   *string
	NodeTID      *string
	Start        int64
	Last         int64
}

func flowToEmbbedFlow(f *flow.Flow) *embeddedFlow {
	return &embeddedFlow{
		UUID:         &f.UUID,
		LayersPath:   &f.LayersPath,
		Application:  &f.Application,
		Link:         f.Link,
		Network:      f.Network,
		Transport:    f.Transport,
		ICMP:         f.ICMP,
		DHCPv4:       f.DHCPv4,
		DNS:          f.DNS,
		VRRPv2:       f.VRRPv2,
		TrackingID:   &f.TrackingID,
		L3TrackingID: &f.L3TrackingID,
		ParentUUID:   &f.ParentUUID,
		NodeTID:      &f.NodeTID,
		Start:        f.Start,
		Last:         f.Last,
	}
}

// easyjson:json
type metricRecord struct {
	*flow.FlowMetric
	Flow *embeddedFlow `json:"Flow"`
}

// easyjson:json
type rawpacketRecord struct {
	*flow.RawPacket
	Flow *embeddedFlow `json:"Flow"`
}

func normalizeKey(key string) string {
	return "Flow." + key
}

// StoreFlows push a set of flows in the database
func (c *Storage) StoreFlows(flows []*flow.Flow) error {
	if !c.client.Started() {
		return errors.New("Storage is not yet started")
	}

	for _, f := range flows {
		data, err := json.Marshal(f)
		if err != nil {
			return err
		}

		if err := c.client.BulkIndex(flowIndex, f.UUID, json.RawMessage(data)); err != nil {
			return err
		}

		eflow := flowToEmbbedFlow(f)

		if f.LastUpdateMetric != nil {
			record := &metricRecord{
				FlowMetric: f.LastUpdateMetric,
				Flow:       eflow,
			}

			data, err := json.Marshal(record)
			if err != nil {
				return err
			}

			if err := c.client.BulkIndex(metricIndex, "", json.RawMessage(data)); err != nil {
				return err
			}
		}

		for _, r := range f.LastRawPackets {
			record := &rawpacketRecord{
				RawPacket: r,
				Flow:      eflow,
			}

			data, err := json.Marshal(record)
			if err != nil {
				return err
			}

			if c.client.BulkIndex(rawpacketIndex, "", json.RawMessage(data)) != nil {
				return err
			}
		}
	}

	return nil
}

func (c *Storage) sendRequest(query elastic.Query, pagination filters.SearchQuery, indices ...string) (*elastic.SearchResult, error) {
	return c.client.Search(query, pagination, indices...)
}

// SearchRawPackets searches flow raw packets matching filters in the database
func (c *Storage) SearchRawPackets(fsq filters.SearchQuery, packetFilter *filters.Filter) (map[string][]*flow.RawPacket, error) {
	if !c.client.Started() {
		return nil, errors.New("Storage is not yet started")
	}

	// do not escape flow as ES use sub object in that case
	mustQueries := []elastic.Query{es.FormatFilter(fsq.Filter, normalizeKey)}

	if packetFilter != nil {
		mustQueries = append(mustQueries, es.FormatFilter(packetFilter, nil))
	}

	out, err := c.sendRequest(elastic.NewBoolQuery().Must(mustQueries...), fsq, rawpacketIndex.IndexWildcard(c.indexPrefix))
	if err != nil {
		return nil, err
	}

	rawpackets := make(map[string][]*flow.RawPacket)
	if len(out.Hits.Hits) > 0 {
		for _, d := range out.Hits.Hits {
			var record rawpacketRecord
			if err := json.Unmarshal(d.Source, &record); err != nil {
				return nil, err
			}

			fr := rawpackets[*record.Flow.UUID]
			fr = append(fr, record.RawPacket)
			rawpackets[*record.Flow.UUID] = fr
		}
	}

	return rawpackets, nil
}

// SearchMetrics searches flow metrics matching filters in the database
func (c *Storage) SearchMetrics(fsq filters.SearchQuery, metricFilter *filters.Filter) (map[string][]common.Metric, error) {
	if !c.client.Started() {
		return nil, errors.New("Storage is not yet started")
	}

	// do not escape flow as ES use sub object in that case
	flowQuery := es.FormatFilter(fsq.Filter, normalizeKey)
	metricQuery := es.FormatFilter(metricFilter, nil)

	query := elastic.NewBoolQuery().Must(flowQuery, metricQuery)
	out, err := c.sendRequest(query, fsq, metricIndex.IndexWildcard(c.indexPrefix))
	if err != nil {
		return nil, err
	}

	metrics := make(map[string][]common.Metric)
	if len(out.Hits.Hits) > 0 {
		for _, d := range out.Hits.Hits {
			var record metricRecord
			if err := json.Unmarshal(d.Source, &record); err != nil {
				return nil, err
			}

			if fm, ok := metrics[*record.Flow.UUID]; ok {
				metrics[*record.Flow.UUID] = append(fm, record.FlowMetric)
			} else {
				metrics[*record.Flow.UUID] = []common.Metric{record.FlowMetric}
			}
		}
	}

	return metrics, nil
}

// SearchFlows search flow matching filters in the database
func (c *Storage) SearchFlows(fsq filters.SearchQuery) (*flow.FlowSet, error) {
	if !c.client.Started() {
		return nil, errors.New("Storage is not yet started")
	}

	// TODO: dedup and sort in order to remove duplicate flow UUID due to rolling index
	out, err := c.sendRequest(es.FormatFilter(fsq.Filter, nil), fsq, flowIndex.IndexWildcard(c.indexPrefix))
	if err != nil {
		return nil, err
	}

	flowset := flow.NewFlowSet()
	if len(out.Hits.Hits) > 0 {
		for _, d := range out.Hits.Hits {
			f := new(flow.Flow)
			if err := json.Unmarshal(d.Source, f); err != nil {
				return nil, err
			}
			flowset.Flows = append(flowset.Flows, f)
		}
	}

	if fsq.Dedup {
		if err := flowset.Dedup(fsq.DedupBy); err != nil {
			return nil, err
		}
	}

	return flowset, nil
}

// Start the Database client
func (c *Storage) Start() {
	go c.client.Start()
}

// Stop the Database client
func (c *Storage) Stop() {
	c.client.Stop()
}

// New creates a new ElasticSearch database client
func New(cfg es.Config, etcdClient *etcd.Client) (*Storage, error) {
	indices := []es.Index{
		flowIndex,
		metricIndex,
		rawpacketIndex,
	}

	client, err := es.NewClient(indices, cfg, etcdClient)
	if err != nil {
		return nil, err
	}

	return &Storage{
		client:      client,
		indexPrefix: cfg.IndexPrefix,
	}, nil
}


text:
using UnityEngine;
using System.Collections;

public class PositionCamera : MonoBehaviour {

    public float fWidth = 9.0f;  // Desired width

    void Start() {
        float fT = fWidth / Screen.width * Screen.height;
        fT = fT / (2.0f * Mathf.Tan(0.5f * Camera.main.fieldOfView * Mathf.Deg2Rad));
        Vector3 v3T = Camera.main.transform.position;
        v3T.z = -fT;
        transform.position = v3T;
    }
}


text:
CustomNavigationManager = new function () {

    var renderItem = function (item) {
        var container = jq("#customNavigationItems tr.display-none").clone().removeClass("display-none");
        container.find(".item-img img").attr("src", item.smallImg);
        container.find(".item-label div").text(item.label);
        container.find(".item-action a").attr("id", item.id);

        var exist = jq("#" + item.id);

        if (exist.length) {
            exist.parents("tr:first").replaceWith(container);
        } else {
            container.appendTo("#customNavigationItems");
        }

        jq("#addBtn").parent().addClass("middle-button-container");

        exist = jq("#topNavCustomItem_" + item.id);

        if (!item.showInMenu) {
            exist.remove();
            return;
        }

        var topNavItemLi = jq("<li/>").attr("id", "topNavCustomItem_" + item.id);
        var topNavItemA = jq("<a/>").attr("href", item.url).attr("target", "_blank").addClass("dropdown-item menu-products-item").text(item.label);
        var topNavItemSpan = jq("<span/>").addClass("dropdown-item-icon").attr("style", "background: url('" + item.smallImg + "')");

        topNavItemSpan.prependTo(topNavItemA);
        topNavItemLi.append(topNavItemA);

        if (exist.length) {
            exist.replaceWith(topNavItemLi);
        } else {
            topNavItemLi.appendTo("#studio_productListPopupPanel .custom-nav-items ul");
        }
    };

    var bindUploader = function (uploader, img, size) {
        return new AjaxUpload(uploader, {
            action: "ajaxupload.ashx?type=ASC.Web.Studio.UserControls.CustomNavigation.LogoUploader,ASC.Web.Studio",
            autoSubmit: false,
            data: { size: size },
            onChange: function () {
                var fileUploader = this,
                    file = fileUploader._input.files[0],
                    reader = new FileReader();

                reader.onload = function (event) {
                    var dataUri = event.target.result,
                        image = new Image();

                    if (dataUri.indexOf("data:image") == -1) {
                        toastr.error(jq("#notImageError").text());
                        return;
                    }

                    image.onload = function () {
                        if (image.width == size && image.height == size) {
                            LoadingBanner.showLoaderBtn("#studio_customNavigation");
                            fileUploader.submit();
                        } else {
                            toastr.error(jq("#sizeError").text());
                        }
                    };

                    image.src = reader.result;
                };

                reader.onerror = function (event) {
                    console.error("The file can not be read! error code " + event.target.error.code);
                };

                reader.readAsDataURL(file);
            },
            onComplete: function (file, response) {
                var result = eval("(" + response + ")");
                if (result.Success) {
                    img.attr("src", result.Message);
                } else {
                    toastr.error(result.Message);
                }
                LoadingBanner.hideLoaderBtn("#studio_customNavigation");
            }
        });
    };

    var getItemData = function() {
        var item = {};
        var valid = true;

        item.id = jq("#itemId").val().trim();

        var obj = jq("#labelText");
        var value = obj.val().trim();
        item.label = value;
        value ? obj.removeClass("with-error") : (obj.addClass("with-error") && (valid = false));

        obj = jq("#urlText");
        value = obj.val().trim();
        item.url = value;

        if (value) {
            obj.removeClass("with-error");
            var urlpattern = /^(ftp|http|https):\/\//;
            if (!urlpattern.test(value)) {
                var trimpattern = /^\/+/g;
                item.url = "http://" + value.replace(trimpattern, "");
            }
        } else {
            obj.addClass("with-error");
            valid = false;
        }

        item.showInMenu = jq("#showInMenuCbx").is(":checked");

        item.showOnHomePage = jq("#showOnHomePageCbx").is(":checked");

        item.smallImg = jq("#smallImg").attr("src").trim();

        item.bigImg = jq("#bigImg").attr("src").trim();

        return valid ? item : null;
    };

    var setItemData = function (item) {
        jq("#itemId").val(item.id);
        jq("#labelText").val(item.label).removeClass("with-error");
        jq("#urlText").val(item.url).removeClass("with-error");
        jq("#showInMenuCbx").prop("checked", item.showInMenu);
        jq("#showOnHomePageCbx").prop("checked", item.showOnHomePage);
        jq("#smallImg").attr("src", item.smallImg);
        jq("#bigImg").attr("src", item.bigImg);
    };

    this.Init = function () {

        jq("#addBtn").on("click", function () {
            Teamlab.getCustomNavigationItemSample({},
            {
                before: function () {
                    LoadingBanner.showLoaderBtn("#studio_customNavigation");
                },
                after: function () {
                    LoadingBanner.hideLoaderBtn("#studio_customNavigation");
                },
                success: function (params, response) {
                    setItemData(response);
                    var dialog = jq("#customNavigationItemDialog").removeClass("settings-mode");
                    window.StudioBlockUIManager.blockUI(dialog, 400);
                },
                error: function (params, errors) {
                    LoadingBanner.showMesInfoBtn("#studio_customNavigation", errors[0], "error");
                }
            });
        });

        jq("#customNavigationItems").on("click", ".item-action a", function () {
            Teamlab.getCustomNavigationItem({}, jq(this).attr("id"),
            {
                before: function () {
                    LoadingBanner.showLoaderBtn("#studio_customNavigation");
                },
                after: function () {
                    LoadingBanner.hideLoaderBtn("#studio_customNavigation");
                },
                success: function (params, response) {
                    if (!response.id) return;

                    setItemData(response);
                    var dialog = jq("#customNavigationItemDialog").addClass("settings-mode");
                    window.StudioBlockUIManager.blockUI(dialog, 400);
                },
                error: function (params, errors) {
                    LoadingBanner.showMesInfoBtn("#studio_customNavigation", errors[0], "error");
                }
            });
        });

        jq("#customNavigationItemDialog .cancel-btn").on("click", function () {
            PopupKeyUpActionProvider.CloseDialog();
        });

        jq("#saveBtn").on("click", function () {
            var data = getItemData();

            if (!data) return;

            Teamlab.createCustomNavigationItem({}, { item: data },
            {
                before: function () {
                    LoadingBanner.showLoaderBtn("#customNavigationItemDialog");
                },
                after: function () {
                    LoadingBanner.hideLoaderBtn("#customNavigationItemDialog");
                },
                success: function (params, response) {
                    renderItem(response);
                    PopupKeyUpActionProvider.CloseDialog();
                    toastr.success(ASC.Resources.Master.ResourceJS.SuccessfullySaveSettingsMessage);
                },
                error: function (params, errors) {
                    LoadingBanner.showMesInfoBtn("#customNavigationItemDialog", errors[0], "error");
                }
            });
        });

        jq("#removeBtn").on("click", function () {
            var id = jq("#customNavigationItemDialog #itemId").val();

            Teamlab.deleteCustomNavigationItem({}, id,
            {
                before: function () {
                    LoadingBanner.showLoaderBtn("#customNavigationItemDialog");
                },
                after: function () {
                    LoadingBanner.hideLoaderBtn("#customNavigationItemDialog");
                },
                success: function () {
                    jq("#" + id).parents("tr:first").remove();
                    jq("#topNavCustomItem_" + id).remove();

                    if (!jq("#customNavigationItems tr:visible").length)
                        jq("#addBtn").parent().removeClass("middle-button-container");

                    PopupKeyUpActionProvider.CloseDialog();
                },
                error: function (params, errors) {
                    LoadingBanner.showMesInfoBtn("#customNavigationItemDialog", errors[0], "error");
                }
            });
        });

        bindUploader(jq("#smallUploader"), jq("#smallImg"), 16);

        bindUploader(jq("#bigUploader"), jq("#bigImg"), 100);
    };
};

jq(document).ready(function () {
    CustomNavigationManager.Init();
});


text:
(function() {

  var module = angular.module("githubViewer");

  var RepoController = function($scope, $routeParams, github) {

    var onRepo = function(data) {
      $scope.repo = data;
    };

    var onError = function(reason) {
      $scope.error = reason;
    };

    var reponame = $routeParams.reponame;
    var username = $routeParams.username;

    github.getRepoDetails(username, reponame)
        .then(onRepo, onError);
  };

  module.Controller("RepoController", RepoController);

})();


text:
#include "TecplotWriter.hh"
#include "GlobalData.hh"
#include "Device.hh"
#include "Coordinate.hh"
#include "Region.hh"
#include "Node.hh"
#include "Edge.hh"
#include "Triangle.hh"
#include "Tetrahedron.hh"
#include "Contact.hh"
#include "Interface.hh"
#include "NodeModel.hh"
#include "EdgeModel.hh"
#include "MeshUtil.hh"
#include "dsAssert.hh"
#include "OutputStream.hh"
#include "TriangleEdgeModel.hh"
#include "TetrahedronEdgeModel.hh"
#include <sstream>
#include <fstream>
#include <iomanip>
#include <set>
namespace Tecplot {
void BreakLine(std::ostream &myfile, const std::string &output_string)
{
  if (output_string.empty())
  {
    return;
  }

  size_t len = output_string.size();

  if (len < 30000)
  {
    myfile << output_string;
  }
  else
  {
    size_t start = 0;

    bool done = false;
    while (!done)
    {
      size_t seek  = start + 29999;

      if (seek > (len - 1))
      {
        myfile << output_string.substr(start);
        done = true;
      }
      else
      {
        size_t pos = output_string.rfind(' ', seek);
        if (pos != std::string::npos)
        {
          /// we drop the whitespace character and replace
          myfile << output_string.substr(start, pos - start) << "\n";
          start = pos + 1;
        }
        else
        {
          pos = output_string.rfind('\n', seek);
          if (pos != std::string::npos)
          {
            myfile << output_string.substr(start, pos - start) << "\n";
            start = pos + 1;
          }
          else
          {
            myfile << output_string.substr(start, seek) << "\n";
            start = seek + 1;

          }
        }
      }
      //// This is one past the end of the string
      if (start >= len)
      {
        done = true;
      }
    }
  }
}

void WriteBlock(std::ostream &os, const std::vector<double> &values)
{
  NodeScalarList<double>::const_iterator it = values.begin();
  if (it != values.end())
  {
    os << *it;
    ++it;
  }
  for (; it != values.end(); ++it)
  {
    os << " " << *it;
  }
}

void WriteUniform(std::ostream &os, const size_t length, const double uniform_value)
{
#if 0
  if (uniform_value == 0.0)
  {
    os << length << "*0";
  }
  else
  {
    os << length << "*" << uniform_value;
  }
#else
  if (length != 0)
  {
    os << uniform_value;
  }
  for (size_t i = 1; i < length; ++i)
  {
    os << " " << uniform_value;
  }
#endif
}

void WriteNodeBlock(std::ostream &myfile, const Region &reg, const std::string &model_name)
{
  const size_t number_nodes = reg.GetNumberNodes();
  ConstNodeModelPtr nmp = reg.GetNodeModel(model_name);

  std::ostringstream os;
  os.copyfmt(myfile);
  if (nmp)
  {
    if (nmp->IsUniform())
    {
      WriteUniform(os, number_nodes, nmp->GetUniformValue<double>());
    }
    else
    {
      const NodeScalarList<double> &values = nmp->GetScalarValues<double>();
      WriteBlock(os, values);
    }
  }
  else
  {
    WriteUniform(os, number_nodes, 0.0);
  }
  os << "\n";

  BreakLine(myfile, os.str());
}

void WriteEdgeBlockScalar(std::ostream &myfile, const Region &reg, const std::string &model_name)
{
  std::ostringstream os;
  os.copyfmt(myfile);
  const size_t number_nodes = reg.GetNumberNodes();
  ConstEdgeModelPtr emp = reg.GetEdgeModel(model_name);

  /// in case the model doesn't exist in our region
  if (emp)
  {
//    dsAssert(emp->GetDisplayType() == EdgeModel::DisplayType::SCALAR, "UNEXPECTED");
    if (emp->IsUniform())
    {
      WriteUniform(os, number_nodes, emp->GetUniformValue<double>());
    }
    else
    {
      const NodeScalarList<double> &values = emp->GetScalarValuesOnNodes<double>();
      WriteBlock(os, values);
    }
  }
  else
  {
    WriteUniform(os, number_nodes, 0.0);
  }
  os << "\n";

  BreakLine(myfile, os.str());
}

void WriteTriangleEdgeBlockScalar(std::ostream &myfile, const Region &reg, const std::string &model_name)
{
  std::ostringstream os;
  os.copyfmt(myfile);

//  const size_t number_nodes = reg.GetNumberNodes();
  const size_t number_triangles = reg.GetNumberTriangles();
  ConstTriangleEdgeModelPtr emp = reg.GetTriangleEdgeModel(model_name);

  /// in case the model doesn't exist in our region
  if (emp)
  {
//    dsAssert(emp->GetDisplayType() == TriangleEdgeModel::DisplayType::SCALAR, "UNEXPECTED");

    if (emp->IsUniform())
    {
      WriteUniform(os, number_triangles, emp->GetUniformValue<double>());
    }
    else
    {
      std::vector<double> values;
      emp->GetScalarValuesOnElements<double>(values);
      WriteBlock(os, values);
    }
  }
  else
  {
    WriteUniform(os, number_triangles, 0.0);
  }
  os << "\n";
  BreakLine(myfile, os.str());
}

void WriteTetrahedronEdgeBlockScalar(std::ostream &myfile, const Region &reg, const std::string &model_name)
{
  std::ostringstream os;
  os.copyfmt(myfile);
//  const size_t number_nodes = reg.GetNumberNodes();
  const size_t number_tetrahedrons = reg.GetNumberTetrahedrons();
  ConstTetrahedronEdgeModelPtr emp = reg.GetTetrahedronEdgeModel(model_name);

  /// in case the model doesn't exist in our region
  if (emp)
  {
//    dsAssert(emp->GetDisplayType() == TriangleEdgeModel::DisplayType::SCALAR, "UNEXPECTED");

    if (emp->IsUniform())
    {
      WriteUniform(os, number_tetrahedrons, emp->GetUniformValue<double>());
    }
    else
    {
      std::vector<double> values;
      emp->GetScalarValuesOnElements<double>(values);
      WriteBlock(os, values);
    }
  }
  else
  {
    WriteUniform(os, number_tetrahedrons, 0.0);
  }
  os << "\n";
  BreakLine(myfile, os.str());
}

void WriteEdgeBlockVector(std::ostream &myfile, const Region &reg, const std::string &model_name)
{
  const size_t number_nodes = reg.GetNumberNodes();
  const size_t dimension    = reg.GetDimension();

  ConstEdgeModelPtr emp = reg.GetEdgeModel(model_name);

  std::ostringstream osx;
  std::ostringstream osy;
  std::ostringstream osz;

  osx.copyfmt(myfile);
  osy.copyfmt(myfile);
  osz.copyfmt(myfile);

  /// in case the model doesn't exist in our region
  /// TODO: make sure it is the same type in each region
  if (emp)
  {
    dsAssert(emp->GetDisplayType() == EdgeModel::DisplayType::VECTOR, "UNEXPECTED");

    const NodeVectorList<double> &values = emp->GetVectorValuesOnNodes<double>();
    dsAssert(values.size() > 0, "UNEXPECTED");

    NodeVectorList<double>::const_iterator it = values.begin();
    if (it != values.end())
    {
      osx << " " << (*it).Getx();
      osy << " " << (*it).Gety();
      osz << " " << (*it).Getz();
      ++it;
    }
    for (; it != values.end(); ++it)
    {
      osx << " " << (*it).Getx();
      osy << " " << (*it).Gety();
      osz << " " << (*it).Getz();
    }
  }
  else
  {
    WriteUniform(osx, number_nodes, 0.0);
    WriteUniform(osy, number_nodes, 0.0);
    WriteUniform(osz, number_nodes, 0.0);
  }

  osx << "\n";
  BreakLine(myfile, osx.str());

  if (dimension > 1)
  {
    osy << "\n";
    BreakLine(myfile, osy.str());
  }
  if (dimension > 2)
  {
    osz << "\n";
    BreakLine(myfile, osz.str());
  }
}

void WriteNodesAndSolutions(std::ostream &myfile, const Region &reg, const std::set<std::string> &solutions)
{
  for (std::set<std::string>::const_iterator it = solutions.begin(); it != solutions.end(); ++it)
  {
    WriteNodeBlock(myfile, reg, *it);
  }
}

void WriteScalarEdgeModels(std::ostream &myfile, const Region &reg, const std::set<std::string> &solutions)
{
  for (std::set<std::string>::const_iterator it = solutions.begin(); it != solutions.end(); ++it)
  {
    WriteEdgeBlockScalar(myfile, reg, *it);
  }
}

void WriteVectorEdgeModels(std::ostream &myfile, const Region &reg, const std::set<std::string> &solutions)
{
  for (std::set<std::string>::const_iterator it = solutions.begin(); it != solutions.end(); ++it)
  {
    WriteEdgeBlockVector(myfile, reg, *it);
  }
}

void WriteScalarElementEdgeModels(std::ostream &myfile, const Region &reg, const std::set<std::string> &solutions)
{
  const size_t dimension = reg.GetDimension();
  if (dimension == 2)
  {
    for (std::set<std::string>::const_iterator it = solutions.begin(); it != solutions.end(); ++it)
    {
//      std::cerr << "WRITING " << *it << std::endl;
      WriteTriangleEdgeBlockScalar(myfile, reg, *it);
    }
  }
  else if (dimension == 3)
  {
    for (std::set<std::string>::const_iterator it = solutions.begin(); it != solutions.end(); ++it)
    {
      WriteTetrahedronEdgeBlockScalar(myfile, reg, *it);
    }
  }
}

void WriteEdges(std::ostream &myfile, const Region &reg)
{
    const ConstEdgeList &ctl = reg.GetEdgeList();
    for (ConstEdgeList::const_iterator tit = ctl.begin(); tit != ctl.end(); ++tit)
    {
        const ConstNodeList &nlist = (*tit)->GetNodeList();
        myfile <<  (nlist[0]->GetIndex() + 1)
        << " " <<  (nlist[1]->GetIndex() + 1)
        << "\n";
    }
}

void WriteTriangles(std::ostream &myfile, const Region &reg)
{
    const ConstTriangleList &ctl = reg.GetTriangleList();
    for (ConstTriangleList::const_iterator tit = ctl.begin(); tit != ctl.end(); ++tit)
    {
        const ConstNodeList &nlist = (*tit)->GetFENodeList();
        myfile <<  (nlist[0]->GetIndex() + 1)
        << " " <<  (nlist[1]->GetIndex() + 1)
        << " " <<  (nlist[2]->GetIndex() + 1)
        << "\n";
    }
}

void WriteTetrahedra(std::ostream &myfile, const Region &reg)
{
    const ConstTetrahedronList &ctl = reg.GetTetrahedronList();
    for (ConstTetrahedronList::const_iterator tit = ctl.begin(); tit != ctl.end(); ++tit)
    {
        const ConstNodeList &nlist = (*tit)->GetFENodeList();
        myfile <<  (nlist[0]->GetIndex() + 1)
        << " " <<  (nlist[1]->GetIndex() + 1)
        << " " <<  (nlist[2]->GetIndex() + 1)
        << " " <<  (nlist[3]->GetIndex() + 1)
        << "\n";
    }
}

bool WriteSingleDevice(const std::string &dname, std::ostream &myfile, std::string &errorString)
{
  bool ret = true;
  std::ostringstream os;
  os.copyfmt(myfile);

//    myfile << std::setprecision(15) << std::scientific;
  GlobalData   &gdata = GlobalData::GetInstance();

  DevicePtr dp = gdata.GetDevice(dname);

  if (!dp)
  {
    ret = false;
    os << "ERROR: Device " << dname << " does not exist\n";
  }
  else
  {
    Device &dev = *dp;

    size_t dimension = dev.GetDimension();

    //// write solutions line
    std::set<std::string> nodeModelsNoDisplay;
    std::set<std::string> nodeModelsScalar;
    std::set<std::string> edgeModelsNoDisplay;
    std::set<std::string> edgeModelsScalar;
    std::set<std::string> edgeModelsVector;
    std::set<std::string> elementEdgeModelsScalar;
    {
      const Device::RegionList_t &rlist = dev.GetRegionList();
      for (Device::RegionList_t::const_iterator rit = rlist.begin(); rit != rlist.end(); ++rit)
      {
        const Region      &reg   = *(rit->second);
        const Region::NodeModelList_t nmlist = reg.GetNodeModelList();

        for (Region::NodeModelList_t::const_iterator nit = nmlist.begin(); nit != nmlist.end(); ++nit)
        {
          const std::string &name = nit->first;
          if ((name == "x" || name == "y" || name == "z"))
          {
            continue;
          }

          ConstNodeModelPtr emp = nit->second;

          NodeModel::DisplayType display_type=emp->GetDisplayType();

          const bool s_display = (nodeModelsScalar.find(name) != nodeModelsScalar.end());
          const bool n_display = (nodeModelsNoDisplay.find(name) != nodeModelsNoDisplay.end());

          std::string conflicting_type;

          if (display_type == NodeModel::DisplayType::NODISPLAY)
          {
            if (s_display)
            {
              conflicting_type = "scalar";
            }
            else
            {
              nodeModelsNoDisplay.insert(name);
            }
          }
          else if (display_type == NodeModel::DisplayType::SCALAR)
          {
            if (n_display)
            {
              conflicting_type = "nodisplay";
            }
            else
            {
              nodeModelsScalar.insert(name);
            }
          }
          else
          {
            dsAssert(0, "UNEXPECTED");
          }

          if (!conflicting_type.empty())
          {
            std::stringstream os;
            os << "Writing model " << name << " as " << conflicting_type << " since it was the first type encountered\n";
            OutputStream::WriteOut(OutputStream::OutputType::INFO, os.str());
          }
        }

        const Region::EdgeModelList_t emlist = reg.GetEdgeModelList();
        for (Region::EdgeModelList_t::const_iterator eit = emlist.begin(); eit != emlist.end(); ++eit)
        {
          const std::string name = eit->first;
          ConstEdgeModelPtr emp = eit->second;

          EdgeModel::DisplayType display_type=emp->GetDisplayType();

          const bool n_display = (edgeModelsNoDisplay.find(name) != edgeModelsNoDisplay.end());
          const bool v_display = (edgeModelsVector.find(name) != edgeModelsVector.end());
          const bool s_display = (edgeModelsScalar.find(name) != edgeModelsScalar.end());

          std::string conflicting_type;

          if (display_type == EdgeModel::DisplayType::NODISPLAY)
          {
            if (v_display)
            {
              conflicting_type = "vector";
            }
            else if (s_display)
            {
              conflicting_type = "scalar";
            }
            else
            {
              edgeModelsNoDisplay.insert(name);
            }
          }
          else if (display_type == EdgeModel::DisplayType::SCALAR)
          {
            if (v_display)
            {
              conflicting_type = "vector";
            }
            else if (n_display)
            {
              conflicting_type = "nodisplay";
            }
            else
            {
              edgeModelsScalar.insert(name);
            }
          }
          else if (display_type == EdgeModel::DisplayType::VECTOR)
          {
            if (s_display)
            {
              conflicting_type = "scalar";
            }
            else if (n_display)
            {
              conflicting_type = "nodisplay";
            }
            else
            {
              edgeModelsVector.insert(name);
            }
          }
          else
          {
            dsAssert(0, "UNEXPECTED");
          }

          if (!conflicting_type.empty())
          {
            std::stringstream os;
            os << "Writing model " << name << " as " << conflicting_type << " since it was the first type encountered\n";
            OutputStream::WriteOut(OutputStream::OutputType::INFO, os.str());
          }
        }

        const Region::TriangleEdgeModelList_t triangle_edge_model_list = reg.GetTriangleEdgeModelList();
        const Region::TetrahedronEdgeModelList_t tetrahedron_edge_model_list = reg.GetTetrahedronEdgeModelList();

        if (dimension == 2)
        {
          dsAssert(tetrahedron_edge_model_list.empty(), "UNEXPECTED");
        }
        else if (dimension == 3)
        {
          dsAssert(triangle_edge_model_list.empty(), "UNEXPECTED");
        }

        for (Region::TriangleEdgeModelList_t::const_iterator trit = triangle_edge_model_list.begin(); trit != triangle_edge_model_list.end(); ++trit)
        {
          if (trit->second->GetDisplayType() == TriangleEdgeModel::DisplayType::SCALAR)
          {
            elementEdgeModelsScalar.insert(trit->first);
          }
          else
          {
            dsAssert(trit->second->GetDisplayType() == TriangleEdgeModel::DisplayType::NODISPLAY, "UNEXPECTED");
          }
        }
        for (Region::TetrahedronEdgeModelList_t::const_iterator teit = tetrahedron_edge_model_list.begin(); teit != tetrahedron_edge_model_list.end(); ++teit)
        {
          if (teit->second->GetDisplayType() == TetrahedronEdgeModel::DisplayType::SCALAR)
          {
            elementEdgeModelsScalar.insert(teit->first);
          }
          else
          {
            dsAssert(teit->second->GetDisplayType() == TetrahedronEdgeModel::DisplayType::NODISPLAY, "UNEXPECTED");
          }
        }
      }
    }

    myfile << "TITLE = \"" << dname << "\"\n";

    std::ostringstream os;
    os.copyfmt(myfile);

    size_t dim = dev.GetDimension();

    //// position of cell centered quantity
    size_t varloc = 0;
    std::vector<size_t> cell_variables;

    if (dim == 1)
    {
      os << "VARIABLES = " << "\"x\"";
      varloc += 1;
    }
    else if (dim == 2)
    {
      os << "VARIABLES = " << "\"x\", \"y\"";
      varloc += 2;
    }
    else
    {
      os << "VARIABLES = " << "\"x\", \"y\", \"z\"";
      varloc += 3;
    }

    for (std::set<std::string>::iterator nmit = nodeModelsScalar.begin(); nmit != nodeModelsScalar.end(); ++nmit)
    {
        os << ", \"" << *nmit << "\"";
        varloc += 1;
    }

    for (std::set<std::string>::iterator it = edgeModelsScalar.begin(); it != edgeModelsScalar.end(); ++it)
    {
        os << ", \"" << *it << "\"";
        varloc += 1;
    }
    for (std::set<std::string>::iterator it = edgeModelsVector.begin(); it != edgeModelsVector.end(); ++it)
    {
      if (dim == 1)
      {
        os
          << ", \"" << *it << "_x_onNode" << "\""
        ;
        varloc += 1;
      }
      else if (dim == 2)
      {
        os
          << ", \"" << *it << "_x_onNode" << "\""
          << ", \"" << *it << "_y_onNode" << "\""
        ;
        varloc += 2;
      }
      else if (dim == 3)
      {
        os
          << ", \"" << *it << "_x_onNode" << "\""
          << ", \"" << *it << "_y_onNode" << "\""
          << ", \"" << *it << "_z_onNode" << "\""
        ;
        varloc += 3;
      }
      else
      {
        dsAssert(0, "UNEXPECTED");
      }
    }

    for (std::set<std::string>::iterator it = elementEdgeModelsScalar.begin(); it != elementEdgeModelsScalar.end(); ++it)
    {
        os << ", \"" << *it << "\"";
        varloc += 1;
        cell_variables.push_back(varloc);
    }

    os << "\n";
    BreakLine(myfile, os.str());

    const Device::RegionList_t &rlist = dev.GetRegionList();

    std::string cell_variables_string;
    if (!cell_variables.empty())
    {
      std::ostringstream os;
      os.copyfmt(myfile);
      os << ", VARLOCATION=([";
      os << cell_variables[0];
      for (size_t i = 1; i < cell_variables.size(); ++i)
      {
        os << "," << cell_variables[i];
      }
      os << "]=CELLCENTERED)";
      cell_variables_string = os.str();
    }

    for (Device::RegionList_t::const_iterator rit = rlist.begin(); rit != rlist.end(); ++rit)
    {
        const std::string &rname = rit->first;
        const Region      &reg   = *(rit->second);

        const size_t numnodes = reg.GetNumberNodes();

        myfile << "ZONE T=\"" << rname << "\" NODES=" << numnodes;

        if (dim == 1)
        {
          const size_t numelements = reg.GetNumberEdges();
          myfile << ", ELEMENTS=" << numelements
            << ", DATAPACKING=BLOCK, ZONETYPE=FELINESEG"
            << cell_variables_string << "\n";
          WriteNodeBlock(myfile, reg, "x");
        }
        else if (dim == 2)
        {
          const size_t numelements = reg.GetNumberTriangles();
          myfile << ", ELEMENTS=" << numelements
            << ", DATAPACKING=BLOCK, ZONETYPE=FETRIANGLE"
            << cell_variables_string << "\n";
          WriteNodeBlock(myfile, reg, "x");
          WriteNodeBlock(myfile, reg, "y");
        }
        else
        {
          const size_t numelements = reg.GetNumberTetrahedrons();
          myfile << ", ELEMENTS=" << numelements
            << ", DATAPACKING=BLOCK, ZONETYPE=FETETRAHEDRON"
            << cell_variables_string << "\n";
          WriteNodeBlock(myfile, reg, "x");
          WriteNodeBlock(myfile, reg, "y");
          WriteNodeBlock(myfile, reg, "z");
        }

        WriteNodesAndSolutions(myfile, reg, nodeModelsScalar);

        WriteScalarEdgeModels(myfile, reg, edgeModelsScalar);

        WriteVectorEdgeModels(myfile, reg, edgeModelsVector);

        WriteScalarElementEdgeModels(myfile, reg, elementEdgeModelsScalar);

        if (dim == 1)
        {
          WriteEdges(myfile, reg);
        }
        else if (dim == 2)
        {
          WriteTriangles(myfile, reg);
        }
        else
        {
          WriteTetrahedra(myfile, reg);
        }

    }

//TODO:  how about text fields, like parameters?
//TODO:  "interface edges"
//TODO:  "contacts edges"
    }
    myfile << "\n";
    errorString += os.str();
    return ret;

}
}

TecplotWriter::~TecplotWriter()
{
}

bool TecplotWriter::WriteMesh_(const std::string &deviceName, const std::string &filename, std::string &errorString)
{
    bool ret = true;
    std::ostringstream os;

    std::ofstream myfile;
    myfile.open (filename.c_str(), std::ios::out | std::ios::trunc | std::ios::binary);
    if (myfile.bad())
    {
        ret = false;
        os << "Could not open " << filename << " for writing\n";
    }
    else
    {
        ret = Tecplot::WriteSingleDevice(deviceName, myfile, errorString);
    }
    errorString += os.str();
    return ret;
}

bool TecplotWriter::WriteMeshes_(const std::string &filename, std::string &errorString)
{
    bool ret = true;
    std::ostringstream os;

    std::ofstream myfile;
    myfile.open (filename.c_str(), std::ios::out | std::ios::trunc | std::ios::binary);
    if (myfile.bad())
    {
        ret = false;
        os << "Could not open " << filename << " for writing\n";
    }

    GlobalData   &gdata = GlobalData::GetInstance();
    const GlobalData::DeviceList_t &dlist = gdata.GetDeviceList();

    if (dlist.size() > 1)
    {
        ret = false;
        os << "More than 1 device in simulation when output format only supports one device.\n";
    }
    else
    {
        for (GlobalData::DeviceList_t::const_iterator dit = dlist.begin(); dit != dlist.end(); ++dit)
        {
            const std::string &dname = dit->first;
            ret = Tecplot::WriteSingleDevice(dname, myfile, errorString);
        }
    }
    myfile.close();

    errorString += os.str();
    return ret;
}


text:
export interface CalendarOptions {
  title: string;
  subTitle: string;
  viewDate: Date;
  viewType: string;
  locale: string;
}


text:
package pl.hypeapp.episodie.configuration.api;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ApiCredentialsConfiguration {

    @Bean
    public String getApiUsername() {
        return "YOUR_API_USERNAME";
    }

    @Bean
    public String getApiPassword() {
        return "YOUR_API_PASSWORD";
    }

}


text:
package uk.gov.ons.ctp.response.casesvc.utility;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.support.CorrelationData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import uk.gov.ons.ctp.response.casesvc.service.CaseService;

@Slf4j
@Component
public class BespokeConfirmCallback implements RabbitTemplate.ConfirmCallback {

  public final static String DELIVERY_FAILURE_MSG = "Delivery of message to queue failed. Cause is %s.";

  @Autowired
  private CaseService caseService;

  @Override
  public void confirm(CorrelationData correlationData, boolean ack, String cause) {
    String correlationDataId = correlationData.getId();
    log.info("confirming message with ack {} - cause {} - correlationDataId {}", ack, cause, correlationDataId);
    if (!ack) {
      String errorMsg = String.format(DELIVERY_FAILURE_MSG, cause);
      log.error(errorMsg);

      caseService.rollbackForNotificationPublisher(correlationDataId);
    }
  }
}


text:
cd /tmp/ros_tutorials_ws  # Navigate to workspace
catkin build --verbose    # Build all the packages in the workspace


text:
<?php

namespace Jackiedo\DotenvEditor\Contracts;

interface FormatterInterface
{
    /**
     * Formatting the key of setter to writing.
     *
     * @param string $key
     * @param bool   $export optional
     *
     * @return string
     */
    public function formatKey(string $key, bool $export = false);

    /**
     * Build an setter from the individual components for writing.
     *
     * @param string      $key
     * @param null|string $value   optional
     * @param null|string $comment optional
     * @param bool        $export  optional
     *
     * @return string
     */
    public function formatSetter(string $key, ?string $value = null, ?string $comment = null, bool $export = false);

    /**
     * Formatting the comment to writing.
     *
     * @param string $comment
     *
     * @return string
     */
    public function formatComment(?string $comment);
}


text:
<?php

namespace Enroporra\EnroporraBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Enroporra\EnroporraBundle\EntityExtended\cPorrista;
use Enroporra\EnroporraBundle\EntityExtended\cGoleador;

class ClasificacionController extends Controller
{

    public $clasificacion;
    public $PROXIMOS_PARTIDOS;
    public $amigos;

    public function __construct()
    {
        $this->PROXIMOS_PARTIDOS = 4;
    }

    public function indexAction()
    {
        $this->getAmigos();

        $this->clasificacion("completa");

        return $this->render('EnroporraBundle:Front:clasificacion.html.twig', array('clasificacion' => $this->clasificacion)
        );
    }

    public function amigosAction()
    {
        $this->getAmigos();

        $this->clasificacion("amigos");

        return $this->render('EnroporraBundle:Front:clasificacion_amigos.html.twig', array('clasificacion' => $this->clasificacion, 'participantes' => $this->getListadoParticipantes())
        );
    }

    public function detalleAction($competicion, $nick)
    {
        $arbitro = $pichichi = $goles = "";
        $apuestas = array();

        $repPorristas = $this->getDoctrine()->getRepository('EnroporraBundle:Porrista');
        $repApuestas = $this->getDoctrine()->getRepository('EnroporraBundle:Apuesta');
        $repGoles = $this->getDoctrine()->getRepository('EnroporraBundle:Gol');

        $resPorrista = $repPorristas->createQueryBuilder('p')
            ->where('p.pagado = :pagado AND p.nick = :nick AND p.idCompeticion = :idCompeticion')
            ->setParameter('pagado', 1)
            ->setParameter('nick', $nick)
            ->setParameter('idCompeticion', $competicion)
            ->getQuery()
            ->getResult();
        if (!count($resPorrista))
            throw $this->createNotFoundException('Usuario no existente');

        $porrista = $resPorrista[0];

        // Acertar árbitro de la final: se rellena la variable $arbitro
        if (($porrista->getIdArbitro() == $porrista->getIdCompeticion()->getIdArbitro()) && $porrista->getIdArbitro())
            $arbitro = $porrista->getIdArbitro();

        // Acertar Pichichi: se rellena la variable $pichichi
        $cGoleador = new cGoleador($porrista->getIdGoleador(), $this->getDoctrine());
        if ($porrista->getIdCompeticion()->getFinalizada() && $cGoleador->getEsPichichi())
            $pichichi = $porrista->getIdGoleador();

        // Puntos por cada gol del goleador elegido
        $goles = $repGoles->createQueryBuilder('g')
            ->where('g.idGoleador = :idGoleador')
            ->setParameter('idGoleador', $porrista->getIdGoleador())
            ->getQuery()
            ->getResult();

        // Puntos por cada partido acertado
        $resApuestas = $repApuestas->createQueryBuilder('a')
            ->where('a.idPorrista = :idPorrista')
            ->setParameter('idPorrista', $porrista)
            ->getQuery()
            ->getResult();
        foreach ($resApuestas as $apuesta) {
            // Verificamos que el partido se ha disputado (de lo contrario tiene en el resultado un empate a -1)
            if ($apuesta->getIdPartido()->getResultado1() < 0)
                continue;

            if ($apuesta->getQuiniela() == $apuesta->getIdPartido()->getQuiniela()) {
                if ($apuesta->getQuiniela() == 0 ||
                    ($apuesta->getQuiniela() == 1 && $apuesta->getIdEquipo1()->getId() == $apuesta->getIdPartido()->getIdEquipo1()->getId()) ||
                    ($apuesta->getQuiniela() == 2 && $apuesta->getIdEquipo2()->getId() == $apuesta->getIdPartido()->getIdEquipo2()->getId())
                ) {
                    $apuestas[] = $apuesta;
                }
            }
        }

        return $this->render('EnroporraBundle:Front:clasificacion_detalle.html.twig', array('arbitro' => $arbitro, 'pichichi' => $pichichi, 'goles' => $goles, 'apuestas' => $apuestas, 'porrista' => $porrista));
    }

    public function setlistadoamigosAction($competicion, $nick, $valor)
    {

        $repPorristas = $this->getDoctrine()->getRepository('EnroporraBundle:Porrista');

        $resPorrista = $repPorristas->createQueryBuilder('p')
            ->where('p.pagado = :pagado AND p.nick = :nick AND p.idCompeticion = :idCompeticion')
            ->setParameter('pagado', 1)
            ->setParameter('nick', $nick)
            ->setParameter('idCompeticion', $competicion)
            ->getQuery()
            ->getResult();
        if (!count($resPorrista))
            throw $this->createNotFoundException('Usuario no existente');
        if ($valor != 0 && $valor != 1)
            throw $this->createNotFoundException('Valor no posible');

        $amigosEnro = $this->getRequest()->cookies->get("amigosEnro");

        if ($valor) {
            if ($amigosEnro) {
                if (strpos("," . $nick . ",", $amigosEnro) === false) {
                    $amigosEnro.=$nick . ",";
                }
            }
            else
                $amigosEnro = "," . $nick . ",";
        }
        else {
            if ($amigosEnro) {
                $amigosEnro = str_replace("," . $nick . ",", ",", $amigosEnro);
                $amigosEnro = str_replace("," . $nick . ",", ",", $amigosEnro);
                if ($amigosEnro == ",")
                    $amigosEnro = "";
            }
        }

        setcookie("amigosEnro", $amigosEnro, time() + 60 * 60 * 24 * 30, "/");
        return $this->render('EnroporraBundle:Front:clasificacion_amigos_setlistado.html.twig', array('amigosEnro' => $amigosEnro));
    }

    public function getAmigos()
    {
        $this->amigos = array();
        $cookieAmigos = $this->getRequest()->cookies->get("amigosEnro");

        if (!strlen($cookieAmigos)) {
            return;
        }

        $temp = explode(",", $cookieAmigos);
        if (!count($temp))
            return;
        foreach ($temp as $amigo)
            $this->amigos[] = strtolower(str_replace("'", "", $amigo));
    }

    public function cmp($a, $b)
    {
        if ($a->getPuntos() == $b->getPuntos()) {
            return (strtoupper(str_replace("Á", "A", str_replace("Ó", "O", $a->getNombre()))) < strtoupper(str_replace("Á", "A", str_replace("Ó", "O", $b->getNombre())))) ? -1 : 1;
        }
        return ($a->getPuntos() < $b->getPuntos()) ? 1 : -1;
    }

    public function clasificacion($tipo = "completa")
    {

        $this->clasificacion["tipo"] = $tipo;
        $this->clasificacion["destacados"] = ($tipo == "completa") ? 5 : 1;

        $repPartidos = $this->getDoctrine()->getRepository('EnroporraBundle:Partido');
        $repPorristas = $this->getDoctrine()->getRepository('EnroporraBundle:Porrista');
        $repApuestas = $this->getDoctrine()->getRepository('EnroporraBundle:Apuesta');

        $partidos = $repPartidos->createQueryBuilder('p')
            ->where('p.fecha <= :fecha', 'p.resultado1 >= :resultado1')
            ->setParameter('fecha', date("Y-m-d"))
            ->setParameter('resultado1', 0)
            ->getQuery()
            ->getResult();

        $this->clasificacion["numeroPartidos"] = count($partidos);

        if ($this->clasificacion["numeroPartidos"]) {

            $nombresExistentes = array();
            $goleadoresActuales = array();

            $comenzoSegundaFase = (date("Y-m-d H:i:s") > $this->container->getParameter('enroporra_ca_fecha_comienzo_fase2'));
            $condicionFase = ($comenzoSegundaFase) ? 'f.faseDeGrupos <= :fase' : 'f.faseDeGrupos = :fase';

            $resProximosPartidos = $repPartidos->createQueryBuilder('p')
                ->select('p.id')
                ->leftJoin('p.idFase', 'f')
                ->where('p.resultado1 = :resultado1', $condicionFase)
                ->setParameter('fase', 1)
                ->setParameter('resultado1', -1)
                ->orderBy('p.fecha', 'ASC', 'p.hora', 'ASC')
                ->setMaxResults($this->PROXIMOS_PARTIDOS)
                ->getQuery()
                ->getResult();
            $proximosPartidos = array();
            foreach ($resProximosPartidos as $proximoPartido) {
                $proximosPartidos[] = $proximoPartido["id"];
            }

            $porristasBD = $repPorristas->createQueryBuilder('p')
                ->where('p.pagado = :pagado')
                ->setParameter('pagado', 1)
                ->getQuery()
                ->getResult();

            // Generamos un array de cPorrista que tiene métodos y variables extendidas a Porrista. Así no tocamos la Entity
            $porristas = $porristasAmigos = array();
            foreach ($porristasBD as $porrista) {
                $porristas[] = new cPorrista($porrista, $this->getDoctrine(), $this->container);
            }

            foreach ($porristas as $clave => $porrista) {

                if ($tipo == "amigos" && !in_array(strtolower($porrista->getNick()), $this->amigos))
                    continue;
                else if ($tipo == "amigos")
                    $porristasAmigos[] = $porrista;

                if (count($proximosPartidos)) {
                    $proximasApuestas = $repApuestas->createQueryBuilder('a')
                        ->where('a.idPorrista = :idPorrista AND a.idPartido IN (:proximosPartidos)')
                        ->setParameter('proximosPartidos', $proximosPartidos)
                        ->setParameter('idPorrista', $porrista->getIdp())
                        ->getQuery()
                        ->getResult();
                    $porristas[$clave]->setProximasApuestas($proximasApuestas);
                }

                $porristas[$clave]->setNombre($this->get("enroporra.apellidos_con_tilde")->convertir($porrista->getNombre() . " " . $porrista->getApellido()));
                if (in_array($porrista->getNombre(), $nombresExistentes))
                    $porristas[$clave]->setNombre($porrista->getNombre() . " (2)");
                else
                    $nombresExistentes[] = $porrista->getNombre();

                if (!isset($goleadoresActuales[$porrista->getIdGoleador()->getId()])) {
                    $goleadoresActuales[$porrista->getIdGoleador()->getId()] = new cGoleador($porrista->getIdGoleador(), $this->getDoctrine());
                }
                $porristas[$clave]->setGoleador($goleadoresActuales[$porrista->getIdGoleador()->getId()]);
                $porristas[$clave]->calculaPuntos();
            }

            if ($tipo == "amigos")
                $porristas = $porristasAmigos;

            usort($porristas, array($this, "cmp"));

            $puestoClasificacion = $puestoImpreso = $ultimoPuestoImpreso = 1;
            $puntuacionAnterior = "";
            $par = true;
            foreach ($porristas as $clave => $porrista) {

                if ($par) {
                    $porristas[$clave]->setBgColor("#DDDDDD");
                    $par = false;
                } else {
                    $porristas[$clave]->setBgColor("#EEEEEE");
                    $par = true;
                }
                $nickRegistrado = $this->getRequest()->cookies->get("nickRegistrado");
                if ($nickRegistrado && strtolower($porrista->getNick()) == strtolower($nickRegistrado)) {
                    $porristas[$clave]->setBgColor("#FFFF00");
                } else if ($tipo == "completa" && in_array(strtolower($porrista->getNick()), $this->amigos)) {
                    $porristas[$clave]->setBgColor("#DDAA33");
                }

                $puestoImpreso = ($puntuacionAnterior == $porrista->getPuntos()) ? "" : $puestoClasificacion;
                $porristas[$clave]->setClasificacion($puestoImpreso);

                if ($puestoImpreso == $puestoClasificacion)
                    $ultimoPuestoImpreso = $puestoImpreso;
                $porristas[$clave]->setDestacado($ultimoPuestoImpreso <= $this->clasificacion["destacados"]);

                $puntuacionAnterior = $porrista->getPuntos();
                $puestoClasificacion++;
            }

            $this->clasificacion["porristas"] = $porristas;
        }
    }

    public function getListadoParticipantes()
    {

        $repPorristas = $this->getDoctrine()->getRepository('EnroporraBundle:Porrista');
        $porristasBD = $repPorristas->createQueryBuilder('p')
            ->where('p.pagado = :pagado')
            ->setParameter('pagado', 1)
            ->orderBy('p.nombre, p.apellido', 'ASC')
            ->getQuery()
            ->getResult();
        $participantes = array();

        foreach ($porristasBD as $porrista) {
            $participante = array();
            $participante["nick"] = $porrista->getNick();
            $participante["nombre"] = $this->get("enroporra.apellidos_con_tilde")->convertir($porrista->getNombre() . " " . $porrista->getApellido());
            if (in_array(strtolower($porrista->getNick()), $this->amigos))
                $participante["checked"] = "checked";
            else
                $participante["checked"] = "";
            $participantes[] = $participante;
        }

        return $participantes;
    }

}


text:
package net.sourceforge.squirrel_sql.client.gui.mainframe;

import net.sourceforge.squirrel_sql.client.gui.desktopcontainer.IDesktopContainer;

public interface IHasJDesktopPane
{
	/**
	 * Set the <TT>JDesktopPane</TT>.
	 *
	 * @param   desktop	 the <TT>JDesktopPane</TT>.
	 */
	public void setDesktopContainer(IDesktopContainer value);
}


text:
<!---
  category: ContactsAndCalendar
  samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620616
--->

# UserDataAccountManager sample

Shows how to use the [UserDataAccountManager](https://msdn.microsoft.com/library/windows/apps/windows.applicationmodel.userdataaccounts.userdataaccountmanager.aspx) class
to let the user add, manage, and fix errors for accounts that provide email, calendar, and contacts.

> **Note:** This sample is part of a large collection of UWP feature samples.
> If you are unfamiliar with Git and GitHub, you can download the entire collection as a
> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/master.zip), but be
> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.

This sample requires the following capabilities:

- appointments
- contacts
- email

For more info, see [App capability declarations](https://msdn.microsoft.com/library/windows/apps/mt270968).

### Remarks

- This sample will not pass WACK because it uses a special-use capability.

## System requirements

**Client:** Windows 10

**Server:** Windows Server 2016 Technical Preview

**Phone:** Windows 10

## Build the sample

1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
2. Start Microsoft Visual Studio 2017 and select **File** \> **Open** \> **Project/Solution**.
3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++, C#, or JavaScript). Double-click the Visual Studio Solution (.sln) file.
4. Press Ctrl+Shift+B, or select **Build** \> **Build Solution**.

## Run the sample

The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it.

### Deploying the sample

- Select Build > Deploy Solution.

### Deploying and running the sample

- To debug the sample and then run it, press F5 or select Debug >  Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.


text:
<?php

namespace Ivoba\Silex\Exception;

/**
 * Class AccessDeniedException
 * @package Ivoba\Silex\Exception
 */
class AccessDeniedException extends \Exception
{

}