text:
import os
import tempfile
from .. import settings
from functools import wraps
from utils import singleton

class Environment():
    __metaclass__ = singleton.Singleton

    def __init__(self):
        """XDG compliant system environment abstraction."""
        self._app = settings.APP_NAME

        # Create XDG compliant cache directory
        default_cachedir = os.path.join(os.environ['HOME'], '.cache')
        xdg_cachedir = os.getenv('XDG_CACHE_HOME', default_cachedir)
        app_cachedir = os.path.join(xdg_cachedir, self._app)

        # Create XDG compliant data directory
        default_datadir = os.path.expanduser('~/.local/share')
        xdg_datadir = os.getenv('XDG_DATA_HOME', default_datadir)
        app_datadir = os.path.join(xdg_datadir, self._app)

        # Create XDG compliant config directory
        default_configdir = os.path.join(os.environ['HOME'], '.config')
        xdg_configdir = os.getenv('XDG_CONFIG_HOME', default_configdir)
        app_configdir = os.path.join(xdg_configdir, self._app)

        # Create XDG compliant runtime directory
        default_runtimedir = tempfile.gettempdir()
        xdg_runtimedir = os.getenv('XDG_RUNTIME_DIR', default_runtimedir)
        app_runtimedir = os.path.join(xdg_runtimedir, self._app)

        self._cache_dir = app_cachedir
        self._data_dir = app_datadir
        self._config_dir = app_configdir
        self._runtime_dir = app_runtimedir

        # LogicBlox Home
        self._logicblox_home = os.getenv('LOGICBLOX_HOME')

    def mkdirs(prop):
        """Decorator that targets directory returning properties.

        In case the returned directory does not exist, it creates it
        along with all of its parent directories.
        """
        @wraps(prop)
        def wrapped(self):
            # Get application directory by caling original method
            appdir = prop(self)
            # Create non-existing directories
            if not os.path.exists(appdir):
                os.makedirs(appdir)
            # Return application directory
            return appdir
        return wrapped

    def __repr__(self):
        return (
            "{}("
            "cache_dir={cache_dir!r}, "
            "data_dir={data_dir!r}, "
            "config_dir={config_dir!r}, "
            "runtime_dir={runtime_dir!r}, "
            "logicblox_home={logicblox_home!r}"
            ")"
        ).format(
            self.__class__.__name__,
            # Fields of interest
            cache_dir=self._cache_dir,
            data_dir=self._data_dir,
            config_dir=self._config_dir,
            runtime_dir=self._runtime_dir,
            logicblox_home=self._logicblox_home
        )

    # --------------------------------------------------------------------------
    # Define directory-returning properties
    # --------------------------------------------------------------------------

    @property
    @mkdirs
    def user_cache_dir(self):
        return self._cache_dir

    @property
    @mkdirs
    def user_data_dir(self):
        return self._data_dir

    @property
    @mkdirs
    def user_config_dir(self):
        return self._config_dir

    @property
    @mkdirs
    def user_runtime_dir(self):
        return self._runtime_dir

    @property
    def user_config_file(self):
        return os.path.join(self.user_config_dir, "config")

    @property
    def local_config_file(self):
        return os.path.join(".{}".format(self._app), "config")

    @property
    @mkdirs
    def user_log_dir(self):
        return os.path.join(self.user_cache_dir, 'logs')

    @property
    def user_log_file(self):
        logfile = "{}.log".format(self._app)
        return os.path.join(self.user_log_dir, logfile)

    @property
    def logicblox_home(self):
        return self._logicblox_home

redpajama_set_name: RedPajamaGithub


text:
;(function(context){
  "use strict";

  // Create a new module.
  // Define the namespace and runs the specified callback.
  // By default, the last namespace component will be defined as
  // as function. You can create a regular object by setting the
  // third argument to anything you want.
  //
  //     Module("Todo.Application", function(Application){
  //       Application.fn.initialize = function(){};
  //     });
  //
  // The module's prototype will be defined as a shortcut called `Module#fn`.
  // Any initialization must be performed on the `Module#initialize()` function.
  function Module(namespace, callback, object) {
    var components = namespace.split(".")
      , scope = context
      , component
      , last
    ;

    if (typeof callback !== "function") {
      object = callback;
      callback = null;
    }

    object = object || build();

    // Process all components but the last, which will store the
    // specified object attribute.
    for (var i = 0, count = components.length; i < count; i++) {
      last = (i == count - 1);
      scope[components[i]] = (last ? object : scope[components[i]] || {});
      scope = scope[components[i]];
    }

    if (callback) {
      callback.call(scope, scope);
    }
  }

  // Build a new module with the correct attributes and methods.
  function build() {
    var Constructor, Instance;

    Constructor = function() {
      // Initialize a new instance, which won't do nothing but
      // inheriting the prototype.
      var instance = new Instance();

      // Apply the initializer on the given instance.
      instance.initialize.apply(instance, arguments);

      return instance;
    };

    // Define the function that will be used to
    // initialize the instance.
    Instance = function() {};
    Instance.prototype = Constructor.prototype;

    // Save some typing and make an alias to the prototype.
    Constructor.fn = Constructor.prototype;

    // Define a noop initializer.
    Constructor.fn.initialize = function() {};

    return Constructor;
  }

  // Expose the module function.
  context.Module = Module;
})(window);


text:
#region Copyright

#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Wosad.Loads.ASCE7.Lateral.Seismic.BuildingFundamentalPeriod
{
    /// <summary>
    /// Interaction logic for Wosad.Loads.ASCE7v10.Lateral.Seismic.BuildingFundamentalPeriod.SeismicSystemTypeGeneralProcedureSelectionView.xaml
    /// </summary>
    public partial class SeismicSystemTypeGeneralProcedureSelectionView: UserControl
    {
        public SeismicSystemTypeGeneralProcedureSelectionView()
        {
            InitializeComponent();
        }
    }
}


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

<title>I-Index</title>
<meta name="date" content="2015-12-03">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G I J L M N O P R S T V W X Y

I

Identification - Class in <Unnamed>

PeoplAce
 CS 2334, Section 010
 March 27, 2015

 Creates each Team by compiling all the needed attributes.

Identification(String) - Constructor for class Identification

Constructs a Team object which contains the name of the team, the city of the team, and the state of the team.

identificationList - Static variable in class DataBase

Instantiates a LinkedHashMap used to store all the Teams in a given data file, with the keys as Team names, and values as Teams.

image - Variable in class ImagePanel

Variable to hold the plate caree map of the United States.

ImagePanel - Class in <Unnamed>

PeoplAce
 CS 2334, Section 010
 March 27, 2015

 Constructs the Plate Caree Map to be viewed by the User.

ImagePanel(List<Person>, Season) - Constructor for class ImagePanel

Constructs the image of the map along with the displayed locations of each Person's home town and distance from Team.

ImportListener() - Constructor for class Controller.ImportListener

A B C D E F G I J L M N O P R S T V W X Y

Skip navigation links

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
package controllers

import "github.com/goadesign/goa"

// PublicController implements the public resource.
type PublicController struct {
	*goa.Controller
}

// NewPublic creates a public controller.
func NewPublic(service *goa.Service) *PublicController {
	return &PublicController{Controller: service.NewController("PublicController")}
}


text:
<!DOCTYPE html>

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1"/>

  <title>Lucy</title>
  <meta name="author" content="" />
  <meta name="description"
        content="Um misto de ficção científica e ação policial. Lucy (Scarlett Johansson) começa como vítima de circunstâncias que a levam a se tornar prisioneira de uma máfia chinesa e burro de carga de uma nova..."/>

  <meta name="yandex-verification" content="48a8210fc043c5e8" />

  <meta name="generator" content="Hugo 0.54.0" />

  <meta itemprop="name" content="Lucy"/>
  <meta itemprop="description"
        content="Um misto de ficção científica e ação policial. Lucy (Scarlett Johansson) começa como vítima de circunstâncias que a levam a se tornar prisioneira de uma máfia chinesa e burro de carga de uma nova..."/>
  <meta itemprop="image"
        content="/img/logo.svg"/>

  <meta property="og:title" content="Lucy"/>
  <meta property="og:type"
        content="article"/>
  <meta property="og:url" content="http://www.cinetenisverde.com.br/lucy/"/>
  <meta property="og:image"
        content="/img/logo.svg"/>
  <meta property="og:description"
        content="Um misto de ficção científica e ação policial. Lucy (Scarlett Johansson) começa como vítima de circunstâncias que a levam a se tornar prisioneira de uma máfia chinesa e burro de carga de uma nova..."/>
  <meta property="og:site_name" content="Cine Tênis Verde"/>
  <meta property="article:published_time"
        content="2014-11-30T00:00:00+00:00"/>
  <meta property="article:section" content="post"/>

  <meta name="twitter:card" content="summary"/>
  <meta name="twitter:site"
        content=""/>
  <meta name="twitter:title" content="Lucy"/>
  <meta name="twitter:description"
        content="Um misto de ficção científica e ação policial. Lucy (Scarlett Johansson) começa como vítima de circunstâncias que a levam a se tornar prisioneira de uma máfia chinesa e burro de carga de uma nova..."/>
  <meta name="twitter:creator"
        content=""/>
  <meta name="twitter:image:src"
        content="/img/logo.svg"/>

  <link rel="stylesheet" type="text/css" href="/css/capsule.min.css"/>
  <link rel="stylesheet" type="text/css" href="/css/custom.css"/>

  <link rel="apple-touch-icon" href="/img/apple-touch-icon.png"/>
  <link rel="icon" href="/img/favicon.ico"/>

 Cine Tênis Verde

    <input type="checkbox" id="navbar-burger-state"/>

      search

      twitter

      rss

Lucy

    ★★★☆☆

 Wanderley Caloni, November 30, 2014

Um misto de ficção científica e ação policial. Lucy (Scarlett Johansson) começa como vítima de circunstâncias que a levam a se tornar prisioneira de uma máfia chinesa e burro de carga de uma nova droga desenvolvida que aumenta consideravelmente o uso do cérebro. Concomitantemente somos apresentados ao professor Normal (Morgan Freeman), que possui uma teoria de que se isso fosse possível poderíamos controlar completamente nosso corpo e até o corpo de outras pessoas (e sabe-se-lá mais o quê).

O que começa sendo o ponto fraco da trama, já que essa história dos humanos usarem apenas 10% do cérebro é uma falácia conhecida, mas que para Luc Besson – que dirige e escreve o roteiro – isso já seria o suficiente para despertar nossa curiosidade quando o corpo de Lucy acidentalmente entra em contato com uma quantidade absurda dessa droga e a garota começa a ganhar poderes cada vez mais implausíveis.

Assim como o recente Transcedence, com Johny Depp, Lucy tenta ser um estudo filosófico a respeito de seres humanos cada vez mais conectados. Veja bem, ele tenta. Porém, partindo em vários momentos para coreografias de ação sem propósito (que máfia fica tão exposta assim por um carregamento de drogas?) o filme se perde entre essas duas linhas narrativas. E mesmo que seu final “Árvore da Vida” seja no mínimo interessante, já é tarde demais.

           Imagens e créditos no IMDB.

    ★★★☆☆

 Lucy ● Lucy. Lucy (France, 2014). Dirigido por Luc Besson. Escrito por Luc Besson. Com Scarlett Johansson, Morgan Freeman, Min-sik Choi, Amr Waked, Julian Rhind-Tutt, Pilou Asbæk, Analeigh Tipton, Nicolas Phongpheth, Jan Oliver Schroeder. ● Nota: 3/5. Categoria: movies.  Publicado em 2014-11-30.  Texto escrito por Wanderley Caloni.

Quer comentar?

      Share


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Partitioner (Apache Hadoop Main 2.7.3 API)</title>
<meta name="date" content="2016-08-18">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.apache.hadoop.mapred

Interface Partitioner<K2,V2>

All Superinterfaces:

JobConfigurable

All Known Implementing Classes:

BinaryPartitioner, HashPartitioner, KeyFieldBasedPartitioner, TotalOrderPartitioner

@InterfaceAudience.Public
@InterfaceStability.Stable
public interface Partitioner<K2,V2>
extends JobConfigurable

Partitions the key space.

Partitioner controls the partitioning of the keys of the
 intermediate map-outputs. The key (or a subset of the key) is used to derive
 the partition, typically by a hash function. The total number of partitions
 is the same as the number of reduce tasks for the job. Hence this controls
 which of the m reduce tasks the intermediate key (and hence the
 record) is sent for reduction.

See Also:

Reducer

Method Summary

Methods

Modifier and Type
Method and Description

int
getPartition(K2 key,
                        V2 value,
                        int numPartitions)

Get the paritition number for a given key (hence record) given the total
 number of partitions i.e.

Methods inherited from interface org.apache.hadoop.mapred.JobConfigurable

configure

Method Detail

getPartition

int getPartition(K2 key,
               V2 value,
               int numPartitions)

Get the paritition number for a given key (hence record) given the total
 number of partitions i.e. number of reduce-tasks for the job.

Typically a hash function on a all or a subset of the key.

Parameters:

key - the key to be paritioned.

value - the entry value.

numPartitions - the total number of partitions.

Returns:

the partition number for the key.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Copyright © 2016 Apache Software Foundation. All rights reserved.


text:
module ActiveMerchant #:nodoc:
  module Billing #:nodoc:
    class SoEasyPayGateway < Gateway
      self.live_url = self.test_url = 'https://secure.soeasypay.com/gateway.asmx'
      self.money_format = :cents

      self.supported_countries = [
        'US', 'CA', 'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE',
        'FI', 'FR', 'DE', 'GR', 'HU', 'IE', 'IT', 'LV', 'LT', 'LU',
        'MT', 'NL', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'GB',
        'IS', 'NO', 'CH'
      ]
      self.supported_cardtypes = [:visa, :master, :american_express, :discover, :maestro, :jcb, :solo, :diners_club]
      self.homepage_url = 'http://www.soeasypay.com/'
      self.display_name = 'SoEasyPay'

      def initialize(options = {})
        requires!(options, :login, :password)
        super
      end

      def authorize(money, payment_source, options = {})
        if payment_source.respond_to?(:number)
          commit('AuthorizeTransaction', do_authorization(money, payment_source, options), options)
        else
          commit('ReauthorizeTransaction', do_reauthorization(money, payment_source, options), options)
        end
      end

      def purchase(money, payment_source, options = {})
        if payment_source.respond_to?(:number)
          commit('SaleTransaction', do_sale(money, payment_source, options), options)
        else
          commit('RebillTransaction', do_rebill(money, payment_source, options), options)
        end
      end

      def capture(money, authorization, options = {})
        commit('CaptureTransaction', do_capture(money, authorization, options), options)
      end

      def refund(money, authorization, options={})
        commit('RefundTransaction', do_refund(money, authorization, options), options)
      end

      def void(authorization, options={})
        commit('CancelTransaction', do_void(authorization, options), options)
      end

      private

      def do_authorization(money, card, options)
        build_soap('AuthorizeTransaction') do |soap|
          fill_credentials(soap, options)
          fill_order_info(soap, money, options)
          fill_cardholder(soap, card, options)
          fill_card(soap, card)
        end
      end

      def do_sale(money, card, options)
        build_soap('SaleTransaction') do |soap|
          fill_credentials(soap, options)
          fill_order_info(soap, money, options)
          fill_cardholder(soap, card, options)
          fill_card(soap, card)
        end
      end

      def do_reauthorization(money, authorization, options)
        build_soap('ReauthorizeTransaction') do |soap|
          fill_credentials(soap, options)
          fill_order_info(soap, money, options)
          fill_transaction_id(soap, authorization)
        end
      end

      def do_rebill(money, authorization, options)
        build_soap('RebillTransaction') do |soap|
          fill_credentials(soap, options)
          fill_order_info(soap, money, options)
          fill_transaction_id(soap, authorization)
        end
      end

      def do_capture(money, authorization, options)
        build_soap('CaptureTransaction') do |soap|
          fill_credentials(soap, options)
          fill_order_info(soap, money, options, :no_currency)
          fill_transaction_id(soap, authorization)
        end
      end

      def do_refund(money, authorization, options)
        build_soap('RefundTransaction') do |soap|
          fill_credentials(soap, options)
          fill_order_info(soap, money, options, :no_currency)
          fill_transaction_id(soap, authorization)
        end
      end

      def do_void(authorization, options)
        build_soap('CancelTransaction') do |soap|
          fill_credentials(soap, options)
          fill_transaction_id(soap, authorization)
        end
      end

      def fill_credentials(soap, options)
        soap.tag!('websiteID', @options[:login].to_s)
        soap.tag!('password', @options[:password].to_s)
      end

      def fill_cardholder(soap, card, options)
        ch_info = options[:billing_address] || options[:address]

        soap.tag!('customerIP',options[:ip].to_s)
        name = card.name || ch_info[:name]
        soap.tag!('cardHolderName', name.to_s)
        address = ch_info[:address1] || ''
        address << ch_info[:address2] if ch_info[:address2]
        soap.tag!('cardHolderAddress', address.to_s)
        soap.tag!('cardHolderZipcode', ch_info[:zip].to_s)
        soap.tag!('cardHolderCity', ch_info[:city].to_s)
        soap.tag!('cardHolderState', ch_info[:state].to_s)
        soap.tag!('cardHolderCountryCode', ch_info[:country].to_s)
        soap.tag!('cardHolderPhone', ch_info[:phone].to_s)
        soap.tag!('cardHolderEmail', options[:email].to_s)
      end

      def fill_transaction_id(soap, transaction_id)
        soap.tag!('transactionID', transaction_id.to_s)
      end

      def fill_card(soap, card)
        soap.tag!('cardNumber', card.number.to_s)
        soap.tag!('cardSecurityCode', card.verification_value.to_s)
        soap.tag!('cardExpireMonth', card.month.to_s.rjust(2, '0'))
        soap.tag!('cardExpireYear', card.year.to_s)
      end

      def fill_order_info(soap, money, options, skip_currency=false)
        soap.tag!('orderID', options[:order_id].to_s)
        soap.tag!('orderDescription', "Order #{options[:order_id]}")
        soap.tag!('amount', amount(money).to_s)
        soap.tag!('currency', (options[:currency] || currency(money)).to_s) unless skip_currency
      end

      def parse(response, action)
        result = {}
        document = REXML::Document.new(response)
        response_element = document.root.get_elements("//[@xsi:type='tns:#{action}Response']").first
        response_element.elements.each do |element|
          result[element.name.underscore] = element.text
        end
        result
      end

      def commit(soap_action, soap, options)
        headers = {'SOAPAction' => "\"urn:Interface##{soap_action}\"",
                   'Content-Type' => 'text/xml; charset=utf-8'}
        response_string = ssl_post(test? ? self.test_url : self.live_url, soap, headers)
        response = parse(response_string, soap_action)
        return Response.new(response['errorcode'] == '000',
                            response['errormessage'],
                            response,
                            :test => test?,
                            :authorization => response['transaction_id'])
      end

      def build_soap(request)
        retval = Builder::XmlMarkup.new(:indent => 2)
        retval.instruct!(:xml, :version => '1.0', :encoding => 'utf-8')
        retval.tag!('soap:Envelope', {
            'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
            'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',
            'xmlns:soapenc' => 'http://schemas.xmlsoap.org/soap/encoding/',
            'xmlns:tns' => 'urn:Interface',
            'xmlns:types' => 'urn:Interface/encodedTypes',
            'xmlns:soap' => 'http://schemas.xmlsoap.org/soap/envelope/'}) do
          retval.tag!('soap:Body', {'soap:encodingStyle'=>'http://schemas.xmlsoap.org/soap/encoding/'}) do
            retval.tag!("tns:#{request}") do
              retval.tag!("#{request}Request", {'xsi:type'=>"tns:#{request}Request"}) do
                yield retval
              end
            end
          end
        end
        retval.target!
      end

    end
  end
end


text:
package com.portier.oauth.providers.outlook;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;

/**
 * This class stores the entity date for Azure Discovery process.
 * @author DJ
 */
@XmlRootElement
@JsonIgnoreProperties(ignoreUnknown = true)
public class AzureDiscoveryEntity
{
  /**
   * endpoint url.
  */
  @XmlAttribute
  public String serviceEndpointUri;

  /**
   * resource id.
   */
  @XmlAttribute
  public String serviceResourceId;

  /**
   * api version.
   */
  @XmlAttribute
  public String serviceApiVersion;

  /**
   * service name.
   */
  @XmlAttribute
  public String serviceName;

  @Override
  public String toString()
  {
    return "AzureDiscoveryEntity [serviceEndpointUri="
        + serviceEndpointUri
        + ", serviceResourceId=" + serviceResourceId
        + ", serviceApiVersion=" + serviceApiVersion
        + ", serviceName="
        + serviceName + "]";
  }
}


text:
layout: blog
title: Ich bin Pirat
category: blog
tags: [Präambel]
summary:
image: plakat_baer.png
---


text:
namespace EduHub.Data.SchemaParser.C7
{
    public class C7Procedure : IC7Element
    {
        public string Description { get; set; }
        public string Content { get; set; }
        public string SchemaComment { get; set; }

        public override string ToString() => $"PROCEDURE: Description={Description}; (Content Not Parsed); Comment={SchemaComment}";
    }
}


text:
You don't need Mustache files for your application.

I've used them to separate different sections of pages and layouts
to make it easier to figure out the structure and each pages's elements.

Otherwise you may have to dig through lots of static HTML code to figure out things.

Template files are inside *app/views* folder.
Refer to *app/views/layouts/default.mustache* file as a starting point
to figure out the general structure of HTML elements and sections.

Please read the docs for more info.


text:
package pl.combosolutions.backup

import scala.annotation.implicitNotFound

case class Result[T](exitValue: Int, stdout: List[String], stderr: List[String]) {

  @implicitNotFound("No implicit interpretation of Result[T] into type U found")
  type Interpreter[U] = Result[T] => U

  def interpret[U](implicit interpreter: Interpreter[U]): U = interpreter(this)

  def asSpecific[U]: Result[U] = this.asInstanceOf[Result[U]]
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PosSystem.Core
{
  public class KeyValue
  {
    public KeyValue()
    {

    }

     public KeyValue(string key, string val)
     {
       Key = key;
       Value = val;
     }

    public string Key { get; set; }
    public string Value { get; set; }
  }
}


text:
/**
 * Base class of all ID generators.
 *
 * @thHidden
 */
export abstract class BaseIdGenerator {

  /**
   * Generates a new ID that is different from any of the given existing IDs.
   *
   * @param existingIds - IDs that already exist.
   * @returns Newly generated ID.
   */
  generate(existingIds: Iterable<string>): string {
    const existingSet = new Set(existingIds);
    let id = this.newId();
    while (existingSet.has(id)) {
      id = this.resolveConflict(id);
    }

    return id;
  }

  /**
   * Generates a new ID.
   *
   * @returns The newly generated ID.
   */
  protected abstract newId(): string;

  /**
   * Attempts to resolve a conflict for the given ID.
   *
   * @remarks
   * This is a best effort method to come up with another ID based on the knowledge that the given
   * ID already conflicts.
   *
   * @param id - The conflicting ID.
   * @returns Best effort new ID.
   */
  protected abstract resolveConflict(id: string): string;
}


text:
  <link href='http://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css'>

  <title>Rachel Trantham | Ceramic Arts | New Orleans, LA</title>

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

  <title>Rachel Trantham Programmer | Ceramic Artist</title>

Rachel Tratham

Programmer | Ceramic Artist

    About

    Portfolio

    Contact

          rachelleecampbell@gmail.com |
          New Orleans, LA


text:
<?php

namespace BibliothequeBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class BibliothequeBundle extends Bundle
{
}


text:
package com.nhnsoft.bitcoin.crypto;

import org.bitcoinj.wallet.Protos;

import javax.annotation.Nullable;

/**
 * Provides a uniform way to access something that can be optionally encrypted with a
 * {@link com.nhnsoft.bitcoin.crypto.KeyCrypter}, yielding an {@link com.nhnsoft.bitcoin.crypto.EncryptedData}, and
 * which can have a creation time associated with it.
 */
trait EncryptableItem {
    /** Returns whether the item is encrypted or not. If it is, then {@link #getSecretBytes()} will return null. */
    def isEncrypted() : Boolean

    /** Returns the raw bytes of the item, if not encrypted, or null if encrypted or the secret is missing. */
    @Nullable
    def getSecretBytes() : Array[Byte]

    /** Returns the initialization vector and encrypted secret bytes, or null if not encrypted. */
    @Nullable
    def getEncryptedData() : EncryptedData

    /** Returns an enum constant describing what algorithm was used to encrypt the key or UNENCRYPTED. */
    def getEncryptionType() : Protos.Wallet.EncryptionType

    /** Returns the time in seconds since the UNIX epoch at which this encryptable item was first created/derived. */
    def getCreationTimeSeconds() : Long
}


text:
package com.googlecode.totallylazy.template;

import com.googlecode.totallylazy.Strings;
import com.googlecode.totallylazy.predicates.Predicates;
import org.junit.Test;

import java.io.PrintWriter;

import static com.googlecode.totallylazy.Assert.assertThat;
import static com.googlecode.totallylazy.Maps.map;
import static com.googlecode.totallylazy.Strings.contains;
import static com.googlecode.totallylazy.Strings.startsWith;
import static com.googlecode.totallylazy.predicates.Predicates.contains;
import static com.googlecode.totallylazy.predicates.Predicates.instanceOf;
import static com.googlecode.totallylazy.predicates.Predicates.is;
import static com.googlecode.totallylazy.predicates.Predicates.not;
import static com.googlecode.totallylazy.template.Templates.templates;

public class TemplatesTest {
    @Test
    public void registeredRenderersAreCorrectlyCalled() throws Exception {
        Templates templates = templates(getClass()).extension("st");
        templates.add(instanceOf(String.class), s -> Strings.string(s.hashCode()));
        String value = "Dan";
        assertThat(templates.get("hello").render(map("name", value)), is("Hello " + value.hashCode()));
        assertThat(templates.get("parent").render(map("name", value)), is("Say Hello " + value.hashCode()));
    }

    @Test
    public void defaultTemplatesSupportsEncoding() throws Exception {
        Templates templates = templates().addDefault();
        Template template = Template.template("Hello $html(first)$", templates);
        String result = template.render(map("first", "<Dan>"));
        assertThat(result, is("Hello <Dan>"));
    }

    @Test
    public void canLoadFromClassPath() throws Exception {
        Templates templates = templates(getClass()).extension("st");
        String result = templates.get("hello").render(map("name", "Dan"));
        assertThat(result, is("Hello Dan"));
    }

    @Test
    public void supportsIndirection() throws Exception {
        Templates templates = templates().addDefault();
        Template template = Template.template("Hello $(encoding)(first)$", templates);
        String result = template.render(map("first", "<Dan>", "encoding", "html"));
        assertThat(result, is("Hello <Dan>"));
    }

    @Test
    public void canUseTemplatesFromClassPathAndDefaultTemplates() throws Exception {
        Templates templates = templates(getClass()).addDefault().extension("st");
        Template template = Template.template("Say $hello()$", templates);
        String result = template.render(map("name", "Dan"));
        assertThat(result, is("Say Hello Dan"));
    }

    @Test
    public void doesNotThrowWhenASubTemplateIsNotFoundButReturnsEmptyStringAndLogs() throws Exception {
        StringBuilder builder = new StringBuilder();
        Templates templates = templates(getClass()).add("works", ignore -> "Other templates still work").logger(builder);
        String result = templates.get("error.st").render(map());
        assertThat(result, is("Other templates still work\nSub template returned ''"));
        String log = builder.toString();
        assertThat(log, startsWith("Unable to load template 'foo' because: "));
        assertThat(log, not(contains("Unable to load template 'works' because: ")));
    }

    @Test
    public void orderOfChainedMethodsDoNotMatter() throws Exception {
        Templates templates1 = templates(getClass()).add("works", ignore -> "Other templates still work").logger(new StringBuilder());
        assertThat(templates1.get("error.st").render(map()), is("Other templates still work\nSub template returned ''"));

        Templates templates2 = templates(getClass()).logger(new StringBuilder()).add("works", ignore -> "Other templates still work");
        assertThat(templates2.get("error.st").render(map()), is("Other templates still work\nSub template returned ''"));
    }
}


text:
from flask import Flask, jsonify, make_response, request
from flask_restful import Api, Resource, reqparse
from werkzeug.datastructures import FileStorage
from utils import token as base_token, \
    server_info, InitIsolateEnv, logger, get_dir_hash
from flask_httpauth import HTTPTokenAuth
from language import languages
from result import RESULT, RE_RESULT
from oj_ import OJ
from config import BASE_PATH, JUDGE_DEFAULT_PATH  # '/var/local/lib/isolate/'
from compiler import Compiler
from judger import Judger
from exception import JudgeServerError, CompileError, SandboxError, \
    VSubmitFailed, VLoginFailed
from update_status import update_submission_status
from zipfile import ZipFile
from oj_poj import poj_submit
from oj_hdu import hdu_submit
from oj_cf import codeforces_submit
import socket
import shutil
import os

app = Flask(__name__)
api = Api(app)
auth = HTTPTokenAuth(scheme='Token')

@auth.verify_token
def verify_token(token):
    # 3c469e9d6c5875d37a43f353d4f88e61fcf812c66eee3457465a40b0da4153e0
    # print token
    # print TOKEN
    return token == base_token

@auth.error_handler
def unauthorized():
    return make_response(jsonify({'error': 'Unauthorized access'}), 401)

class PingAPI(Resource):
    # decorators = [auth.login_required]

    def __init__(self):
        self.flag = 'powered by crazyX for LETTers'

    def get(self):
        info = server_info()
        ip = request.remote_addr
        info['more'] = self.flag
        info['ip'] = ip
        return {'code': 0, 'data': info}

# def run(self, submission_id, language_code, code, time_limit, memory_limit, test_case_id,)
class JudgeAPI(Resource):
    decorators = [auth.login_required]

    def __init__(self):
        self.reqparse = reqparse.RequestParser()

        self.reqparse.add_argument('language_name', type=str, required=True,
                                   choices=languages.keys(),
                                   help='Only support c,c++,java,python2,python3', location='json')

        self.reqparse.add_argument('src_code', type=str, required=True, location='json')
        # ms
        self.reqparse.add_argument('time_limit', type=int, required=True, location='json')
        # kb
        self.reqparse.add_argument('memory_limit', type=int, required=True, location='json')

        self.reqparse.add_argument('test_case_id', type=str, required=True, location='json')

        self.reqparse.add_argument('submission_id', type=int, required=True, location='json')

        self.reqparse.add_argument('spj_code', type=str, location='json')

        super(JudgeAPI, self).__init__()

    @staticmethod
    def judge(args, ip):
        with InitIsolateEnv() as box_id:
            compile_config = languages[args['language_name']]['compile']
            run_config = languages[args['language_name']]['run']
            src_name = compile_config['src_name']
            time_limit = args['time_limit'] / 1000.0
            if args['language_name'] == 'java':
                memory_limit = 512 * 1024
            else:
                memory_limit = args['memory_limit']
            test_case_id = args['test_case_id']
            submission_id = args['submission_id']
	    logger.exception(test_case_id)

            path = os.path.join(JUDGE_DEFAULT_PATH, str(box_id))
            host_name = socket.gethostname()
            is_spj = True if 'spj_code' in args and args['spj_code'] else False

            # write source code into file
            try:
                src_path = os.path.join(path, 'box', src_name)
                f = open(src_path, "w")
                f.write(args['src_code'].encode("utf8"))
                f.close()
            except Exception as e:
                logger.exception(e)
                raise JudgeServerError('unable write code to file')
            # write spj code into file
            if is_spj:
                spj_src_path = os.path.join(path, 'box', 'spj.c')
                f = open(spj_src_path, "w")
                f.write(args['spj_code'].encode("utf8"))
                f.close()

            update_submission_status(ip, submission_id, 'compiling')

            # compile
            compiler = Compiler(compile_config=compile_config, box_id=box_id)
            compiler.compile()
            # compile spj code
            if is_spj:
                spj_config = languages['c++']['compile']
                spj_config['src_name'] = 'spj.c'
                spj_config['exe_name'] = 'spj'
                spj_compiler = Compiler(compile_config=spj_config, box_id=box_id)
                spj_compiler.compile()

            update_submission_status(ip, submission_id, 'running & judging')

            # run
            judger = Judger(run_config=run_config, max_cpu_time=time_limit,
                            max_memory=memory_limit, test_case_id=test_case_id,
                            box_id=box_id, server_ip=ip, submission_id=submission_id, is_spj=is_spj)
            result = judger.run()
            judge_result = {"status": RESULT["accepted"], "info": result,
                            "time": None, "memory": None, "server": host_name}
            for item in judge_result["info"]:
                if item["status"] != RESULT['accepted']:
                    judge_result["status"] = item["status"]
                    break
            else:
                st = sorted(result, key=lambda k: k['info']['time'])
                judge_result["time"] = st[-1]['info']["time"] * 1000
                # TODO 我也不知道为啥除了10之后内存和实际相符
                # 2017.04.06 update:
                # VSS - Virtual Set Size 虚拟耗用内存(包含共享库占用的内存)
                # RSS - Resident Set Size 实际使用物理内存(包含共享库占用的内存)
                # PSS - Proportional Set Size 实际使用的物理内存(比例分配共享库占用的内存)
                # USS - Unique Set Size 进程独自占用的物理内存(不包含共享库占用的内存)
                # 目前来看大概rss/10=uss
                # 经过测试 poj使用的是uss hdu使用的是rss
                judge_result["memory"] = st[-1]['info']["max-rss"]

            judge_result["status"] = RE_RESULT[judge_result["status"]]
            for item in judge_result["info"]:
                item["status"] = RE_RESULT[item["status"]]

            return judge_result

    def post(self):
        args = self.reqparse.parse_args()
        ip = request.remote_addr
        try:
            result = self.judge(args, ip)
            print result
            return {'code': 0, 'result': result}
        except CompileError as e:
            logger.exception(e)
            ret = dict()
            ret["err"] = e.__class__.__name__
            ret["data"] = e.message
            result = {"status": "compile error", "info": ret, }
            return {'code': 0, 'result': result}
        except (JudgeServerError, SandboxError) as e:
            logger.exception(e)
            ret = dict()
            ret["err"] = e.__class__.__name__
            ret["data"] = e.message
            return {'code': 1, 'result': ret}
        except Exception as e:
            logger.exception(e)
            ret = dict()
            ret["err"] = "JudgeClientError"
            ret["data"] = e.__class__.__name__ + ":" + e.message
            return {'code': 2, 'result': ret}

class VJudgeAPI(Resource):
    decorators = [auth.login_required]

    # problem_id, language_name, src_code

    def __init__(self):
        self.reqparse = reqparse.RequestParser()

        self.reqparse.add_argument('oj', type=int, choices=OJ.keys(), required=True, location='json')
        # TODO change the oj type to string

        self.reqparse.add_argument('problem_id', type=str, required=True, location='json')
        self.reqparse.add_argument('language_name', type=str, required=True, location='json')
        self.reqparse.add_argument('src_code', type=str, required=True, location='json')
        self.reqparse.add_argument('submission_id', type=str, required=True,
                                   help='No submission_id provided', location='json')
        self.reqparse.add_argument('username', type=str, location='json')
        self.reqparse.add_argument('password', type=str, location='json')
        super(VJudgeAPI, self).__init__()

    @staticmethod
    def virtual_judge(args):
        oj = args['oj']
        username = args['username']
        pwd = args['password']
        oj_name = OJ[oj]
        func_name = '{oj}_submit'.format(oj=oj_name)
        func = eval(func_name)
        if username:
            result = func(args['problem_id'], args['language_name'], args['src_code'],
                          args['ip'], args['submission_id'], username, pwd)
        else:
            result = func(args['problem_id'], args['language_name'], args['src_code'],
                          args['ip'], args['submission_id'],)

        return result

    def post(self):
        args = self.reqparse.parse_args()
        ip = request.remote_addr
        args['ip'] = ip
        try:
            result = self.virtual_judge(args)
            return {'code': 0, 'result': result}
        except (VLoginFailed, VSubmitFailed) as e:
            logger.exception(e)
            ret = dict()
            ret["err"] = e.__class__.__name__
            ret["data"] = e.message
            return {'code': 1, 'result': ret}
        except Exception as e:
            logger.exception(e)
            ret = dict()
            ret["err"] = "JudgeClientError"
            ret["data"] = e.__class__.__name__ + ":" + e.message
            return {'code': 2, 'result': ret}

class TestCaseHashAPI(Resource):
    decorators = [auth.login_required]

    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        self.reqparse.add_argument('test_case_id', type=str, required=True)

    def post(self):
        args = self.reqparse.parse_args()
        test_case_id = args['test_case_id']
        path = os.path.join(BASE_PATH, 'test_case', test_case_id)
        value = get_dir_hash(path)
        return value

class SyncAPI(Resource):
    decorators = [auth.login_required]

    def __init__(self):
        self.reqparse = reqparse.RequestParser()
        self.reqparse.add_argument('test_case_id', type=str, required=True)
        self.reqparse.add_argument('zipfile', type=FileStorage, location='files', required=True)

    def post(self):
        args = self.reqparse.parse_args()
        test_case_id = args['test_case_id']
        s_file = args['zipfile']
        print type(test_case_id), test_case_id

        if test_case_id == 'ALL':
            aim = os.path.join(BASE_PATH, 'test_case')
        else:
            aim = os.path.join(BASE_PATH, 'test_case', str(test_case_id))
            hash_dir = os.path.join(BASE_PATH, 'test_case', 'md5', str(test_case_id))
            if os.path.exists(hash_dir):
                shutil.rmtree(hash_dir,ignore_errors=True)
        if os.path.exists(aim):
            shutil.rmtree(aim, ignore_errors=True)

        os.mkdir(aim)
        os.chmod(aim, 0777)

        path = os.path.join('/tmp', s_file.filename)
        s_file.save(path)

        zipfile = ZipFile(path)
        for sub_file in zipfile.namelist():
            zipfile.extract(sub_file, aim)
            os.chmod(os.path.join(aim, sub_file), 0777)
        zipfile.close()

        os.remove(path)
        return "Done!"

api.add_resource(PingAPI, '/ping/', endpoint='ping')
api.add_resource(JudgeAPI, '/judge/', endpoint='judge')
api.add_resource(VJudgeAPI, '/vjudge/', endpoint='vjudge')
api.add_resource(TestCaseHashAPI, '/hash/', endpoint='hash')
api.add_resource(SyncAPI, '/sync/', endpoint='sync')

if __name__ == '__main__':
    app.run(host='0.0.0.0')


text:
The CommandDecoder module decodes one command extracting the name and arguments and passes the call to the supplied actionCallback.

## Public API
**SRS_COMMAND_DECODER_99_001: [**  The CommandDecoder module shall expose the following API: **]**

```c
#define COMMANDDECODER_RESULT_VALUES \
    COMMANDDECODER_OK, \
    COMMANDDECODER_ERROR, \
    COMMANDDECODER_INVALID_ARG, \

DEFINE_ENUM(COMMANDDECODER_RESULT, COMMANDDECODER_RESULT_VALUES)

#ifdef __cplusplus
extern "C" {
#endif

typedef void* COMMAND_DECODER_HANDLE;
typedef int(*ACTION_CALLBACK_FUNC)(void* actionCallbackContext, const char* relativeActionPath, const char* actionName, size_t argCount, const AGENT_DATA_TYPE* args);
typedef METHODRETURN_HANDLE(*METHOD_CALLBACK_FUNC)(void* methodCallbackContext, const char* relativeMethodPath, const char* methodName, size_t argCount, const AGENT_DATA_TYPE* args);

extern COMMAND_DECODER_HANDLE CommandDecoder_Create(SCHEMA_MODEL_TYPE_HANDLE modelHandle, ACTION_CALLBACK_FUNC actionCallback, void* actionCallbackContext, METHOD_CALLBACK_FUNC, methodCallback, void*, methodCallbackContext);

extern EXECUTE_COMMAND_RESULT CommandDecoder_ExecuteCommand(COMMAND_DECODER_HANDLE handle, const char* command);
extern METHODRETURN_HANDLE CommandDecoder_ExecuteMethod(COMMAND_DECODER_HANDLE handle, const char* fullMethodName, const char* methodPayload);

extern void CommandDecoder_Destroy(COMMAND_DECODER_HANDLE commandDecoderHandle);

extern EXECUTE_COMMAND_RESULT CommandDecoder_IngestDesiredProperties( void* startAddress, COMMAND_DECODER_HANDLE handle, const char* desiredProperties);

#ifdef __cplusplus
}
#endif
```

### CommandDecoder_Create
```c
extern COMMAND_DECODER_HANDLE CommandDecoder_Create(SCHEMA_MODEL_TYPE_HANDLE modelHandle, ACTION_CALLBACK_FUNC actionCallback, void* actionCallbackContext);
```

**SRS_COMMAND_DECODER_01_001: [** CommandDecoder_Create shall create a new instance of a CommandDecoder. **]**

**SRS_COMMAND_DECODER_01_003: [** If `modelHandle` is NULL, CommandDecoder_Create shall return NULL. **]**

**SRS_COMMAND_DECODER_01_004: [** If any error is encountered during CommandDecoder_Create CommandDecoder_Create shall return NULL. **]**

### CommandDecoder_Destroy
```c
extern void CommandDecoder_Destroy(COMMAND_DECODER_HANDLE commandDecoderHandle);
```

**SRS_COMMAND_DECODER_01_005: [** CommandDecoder_Destroy shall free all resources associated with the commandDecoderHandle instance. **]**

**SRS_COMMAND_DECODER_01_007: [** If CommandDecoder_Destroy is called with a NULL handle, CommandDecoder_Destroy shall do nothing. **]**

### CommandDecoder_ExecuteCommand
```c
extern EXECUTE_COMMAND_RESULT CommandDecoder_ExecuteCommand(COMMAND_DECODER_HANDLE handle, const char* command);
```

**SRS_COMMAND_DECODER_01_009: [** Whenever CommandDecoder_ExecuteCommand is the command shall be decoded and further dispatched to the actionCallback passed in CommandDecoder_Create. **]**

**SRS_COMMAND_DECODER_01_010: [** If either parameter is NULL, the processing shall stop and the command shall not be dispatched and it shall return EXECUTE_COMMAND_ERROR. **]**

**SRS_COMMAND_DECODER_01_011: [** If the size of the command is 0 then the processing shall stop and the command shall not be dispatched and it shall return EXECUTE_COMMAND_ERROR. **]**

**SRS_COMMAND_DECODER_01_012: [** CommandDecoder shall decode the command JSON contained in buffer to a multi-tree by using JSONDecoder_JSON_To_MultiTree. **]**

**SRS_COMMAND_DECODER_01_013: [** If parsing the JSON to a multi tree fails, the processing shall stop and the command shall not be dispatched and it shall return EXECUTE_COMMAND_ERROR. **]**

**SRS_COMMAND_DECODER_01_014: [** CommandDecoder shall use the MultiTree APIs to extract a specific element from the command JSON. **]**

**SRS_COMMAND_DECODER_01_015: [** If any MultiTree API call fails then the processing shall stop and the command shall not be dispatched and it shall return EXECUTE_COMMAND_ERROR. **]**

**SRS_COMMAND_DECODER_01_016: [** CommandDecoder shall ensure that the multi-tree resulting from JSONDecoder_JSON_To_MultiTree is freed after the commands are executed. **]**

**SRS_COMMAND_DECODER_99_005: [**  If an action is decoded successfully then the callback actionCallback shall be called, passing to it the callback action context, decoded name and arguments. **]**

**SRS_COMMAND_DECODER_99_006: [**  The action name shall be decoded from the element "Name" of the command JSON. **]**

**SRS_COMMAND_DECODER_99_009: [**  CommandDecoder shall call Schema_GetModelActionByName to obtain the information about a specific action. **]**

**SRS_COMMAND_DECODER_99_022: [**  CommandDecoder shall use the Schema APIs to obtain the information about the entity set name and namespace **]**

**SRS_COMMAND_DECODER_99_010: [**  If any Schema API fails then the command shall not be dispatched and it shall return EXECUTE_COMMAND_ERROR. **]**

**SRS_COMMAND_DECODER_99_011: [**  CommandDecoder shall attempt to extract the command arguments from the command JSON by looking them up under the node "Parameters". **]**

**SRS_COMMAND_DECODER_01_008: [** Each argument shall be looked up as a field, member of the "Parameters" node. **]**

The below example shows the argument State having the value true. In this case State has the type Edm.Boolean.
```json
{
  "Name" : "SetACState",
  "Parameters" :
  {
      "State" : "true"
  }
}
```

**SRS_COMMAND_DECODER_99_012: [**  If any argument is missing in the command text then the command shall not be dispatched and it shall return EXECUTE_COMMAND_ERROR. **]**

**SRS_COMMAND_DECODER_99_021: [**  If the parsing of the command fails for any other reason the command shall not be dispatched. **]**

**SRS_COMMAND_DECODER_99_027: [**  The value for an argument of primitive type shall be decoded by using the CreateAgentDataType_From_String API. **]**

**SRS_COMMAND_DECODER_99_028: [**  If decoding the argument fails then the command shall not be dispatched and it shall return EXECUTE_COMMAND_ERROR. **]**

**SRS_COMMAND_DECODER_99_029: [**  If the argument type is complex then a complex type value shall be built from the child nodes. **]**

**SRS_COMMAND_DECODER_99_030: [**  For each child node a value shall be built by using AgentTypeSystem APIs. **]**

**SRS_COMMAND_DECODER_99_031: [**  The complex type value that aggregates the children shall be built by using the Create_AGENT_DATA_TYPE_from_Members. **]**

**SRS_COMMAND_DECODER_99_032: [**  Nesting shall be supported for complex type. **]**

**SRS_COMMAND_DECODER_99_033: [**  In order to determine which are the members of a complex types, Schema APIs for structure types shall be used. **]**

**SRS_COMMAND_DECODER_99_034: [**  If Schema APIs indicate that a complex type has 0 members then the command shall not be dispatched and it shall return EXECUTE_COMMAND_ERROR. **]**

**SRS_COMMAND_DECODER_99_035: [**  CommandDecoder_ExecuteCommand shall support paths to actions that are in child models (i.e. ChildModel/SomeAction. **]**

**SRS_COMMAND_DECODER_99_036: [**  If a child model cannot be found by using Schema APIs then the command shall not be dispatched and it shall return EXECUTE_COMMAND_ERROR. **]**

**SRS_COMMAND_DECODER_99_037: [**  The relative path passed to the actionCallback shall be in the format "childModel1/childModel2/.../childModelN". **]**

Miscellaneous
**SRS_COMMAND_DECODER_99_019: [**  For all exposed APIs argument validity checks shall precede other checks. **]**

If any parameter is NULL then CommandDecoder_ExecuteCommand shall return EXECUTE_COMMAND_ERROR.

### CommandDecoder_IngestDesiredProperties
```c
extern EXECUTE_COMMAND_RESULT CommandDecoder_IngestDesiredProperties( void* startAddress, COMMAND_DECODER_HANDLE handle, const char* desiredProperties);
```

`CommandDecoder_IngestDesiredProperties` applies `desiredProperties` to the device at `startAddress` in memory. It is not transactional (so far).

**SRS_COMMAND_DECODER_02_001: [** If `startAddress` is NULL then `CommandDecoder_IngestDesiredProperties` shall fail and return `EXECUTE_COMMAND_ERROR`. **]**

**SRS_COMMAND_DECODER_02_002: [** If `handle` is NULL then `CommandDecoder_IngestDesiredProperties` shall fail and return `EXECUTE_COMMAND_ERROR`. **]**

**SRS_COMMAND_DECODER_02_003: [** If `desiredProperties` is NULL then `CommandDecoder_IngestDesiredProperties` shall fail and return `EXECUTE_COMMAND_ERROR`. **]**

**SRS_COMMAND_DECODER_02_004: [** `CommandDecoder_IngestDesiredProperties` shall clone `desiredProperties`. **]**

**SRS_COMMAND_DECODER_02_005: [** `CommandDecoder_IngestDesiredProperties` shall create a MULTITREE_HANDLE ouf of the clone of `desiredProperties`. **]**

**SRS_COMMAND_DECODER_02_006: [** `CommandDecoder_IngestDesiredProperties` shall parse the MULTITREEE recursively. **]**

**SRS_COMMAND_DECODER_02_007: [** If the child name corresponds to a desired property then an AGENT_DATA_TYPE shall be constructed from the MULTITREE node. **]**

**SRS_COMMAND_DECODER_02_008: [** The desired property shall be constructed in memory by calling pfDesiredPropertyFromAGENT_DATA_TYPE. **]**

**SRS_COMMAND_DECODER_02_013: [** If the desired property has a non-`NULL` `pfOnDesiredProperty` then it shall be called. **]**

**SRS_COMMAND_DECODER_02_009: [** If the child name corresponds to a model in model then the function shall call itself recursively. **]**

**SRS_COMMAND_DECODER_02_012: [** If the child model in model has a non-`NULL` `pfOnDesiredProperty` then `pfOnDesiredProperty` shall be called. **]**

**SRS_COMMAND_DECODER_02_010: [** If the complete MULTITREE has been parsed then `CommandDecoder_IngestDesiredProperties` shall succeed and return `EXECUTE_COMMAND_SUCCESS`. **]**

**SRS_COMMAND_DECODER_02_011: [** Otherwise `CommandDecoder_IngestDesiredProperties` shall fail and return `EXECUTE_COMMAND_FAILED`. **]**

### CommandDecoder_ExecuteMethod
```c
METHODRETURN_HANDLE CommandDecoder_ExecuteMethod(COMMAND_DECODER_HANDLE handle, const char* fullMethodName, const char* methodPayload)
```

`CommandDecoder_ExecuteMethod` calls the method callback passing the decoded arguments from `fullMethodPayload`. A `fullMethodName` includes
several segments as in `model1/model2/model3/methodName`. A segment is a model_in_model name.

**SRS_COMMAND_DECODER_02_014: [** If `handle` is `NULL` then `CommandDecoder_ExecuteMethod` shall fail and return `NULL`. **]**

**SRS_COMMAND_DECODER_02_015: [** If `fullMethodName` is `NULL` then `CommandDecoder_ExecuteMethod` shall fail and return `NULL`. **]**

**SRS_COMMAND_DECODER_02_025: [** If `methodCallback` is `NULL` then `CommandDecoder_ExecuteMethod` shall fail and return `NULL`. **]**

**SRS_COMMAND_DECODER_02_016: [** If `methodPayload` is not `NULL` then `CommandDecoder_ExecuteMethod` shall build a `MULTITREE_HANDLE` out of `methodPayload`. **]**

**SRS_COMMAND_DECODER_02_017: [** `CommandDecoder_ExecuteMethod` shall get the `SCHEMA_HANDLE` associated with the modelHandle passed at `CommandDecoder_Create`. **]**

**SRS_COMMAND_DECODER_02_018: [** `CommandDecoder_ExecuteMethod` shall validate that consecutive segments of the `fullMethodName` exist in the model. **]**

**SRS_COMMAND_DECODER_02_019: [** `CommandDecoder_ExecuteMethod` shall locate the final model to which the `methodName` applies. **]**

**SRS_COMMAND_DECODER_02_020: [** `CommandDecoder_ExecuteMethod` shall verify that the model has a method called `methodName`. **]**

**SRS_COMMAND_DECODER_02_021: [** For every argument of `methodName`, `CommandDecoder_ExecuteMethod` shall build an `AGENT_DATA_TYPE` from the node with the same name from the `MULTITREE_HANDLE`. **]**

**SRS_COMMAND_DECODER_02_022: [** `CommandDecoder_ExecuteMethod` shall call `methodCallback` passing the context, the `methodName`, number of arguments and the `AGENT_DATA_TYPE`. **]**

**SRS_COMMAND_DECODER_02_023: [** If any of the previous operations fail, then `CommandDecoder_ExecuteMethod` shall return `NULL`. **]**

**SRS_COMMAND_DECODER_02_024: [** Otherwise, `CommandDecoder_ExecuteMethod` shall return what `methodCallback` returns. **]**


text:
using System;
using System.Linq;
using System.Net.WebSockets;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace Slackbot
{
    class SocketConnection
    {
        readonly Func<Task<string>> GetWebsocketUrl;
        public event EventHandler<string> OnData;
        private ClientWebSocket Socket;

        public SocketConnection(Func<Task<string>> getWebSocketUrl)
        {
            this.GetWebsocketUrl = getWebSocketUrl;
            Connect();
        }

        public async void SendData(ArraySegment<byte> data)
        {
            await Socket.SendAsync(data, WebSocketMessageType.Text, true, CancellationToken.None);
        }

        async void Connect()
        {
            await TryConnect();
        }

        private async System.Threading.Tasks.Task TryConnect()
        {
            int retryCounter = 0;
            int maxRetryCount = 4;
            int secondsBetweenRetry = 2;

            while (retryCounter < maxRetryCount)
            {
                try
                {
                    Socket = new System.Net.WebSockets.ClientWebSocket();
                    await Socket.ConnectAsync(new Uri(await this.GetWebsocketUrl()), CancellationToken.None);

                    var receiveBytes = new byte[4096];
                    var receiveBuffer = new ArraySegment<byte>(receiveBytes);

                    while (Socket.State == WebSocketState.Open)
                    {
                        var receivedMessage = await Socket.ReceiveAsync(receiveBuffer, CancellationToken.None);
                        if (receivedMessage.MessageType == WebSocketMessageType.Close)
                        {
                            await
                                Socket.CloseAsync(WebSocketCloseStatus.NormalClosure, "closing websocket",
                                    CancellationToken.None);
                        }
                        else
                        {
                            var messageBytes = receiveBuffer.Skip(receiveBuffer.Offset).Take(receivedMessage.Count).ToArray();

                            var rawMessage = new UTF8Encoding().GetString(messageBytes);
                            OnData.Invoke(this, rawMessage);
                        }
                    }
                    break;
                }
                catch (Exception e)
                {
                    int sleepTimeSeconds = Convert.ToInt32(Math.Pow(secondsBetweenRetry, retryCounter + 1));
                    retryCounter++;

                    if (retryCounter >= maxRetryCount)
                    {
                        throw e;
                    }
                    else
                    {
                        Thread.Sleep(sleepTimeSeconds * 1000);
                    }
                }
            }
        }
    }
}


text:
package org.openeos.services.ui.vaadin.internal;

import org.hibernate.FlushMode;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.orm.hibernate4.SessionFactoryUtils;
import org.springframework.orm.hibernate4.SessionHolder;
import org.springframework.transaction.support.TransactionSynchronizationManager;

import org.openeos.services.ui.vaadin.ApplicationLifecycleListener;
import org.openeos.vaadin.main.IUnoVaadinApplication;

public class OpenSessionInViewListener implements ApplicationLifecycleListener {

	private static final Logger LOG = LoggerFactory.getLogger(OpenSessionInViewListener.class);

	private SessionFactory sessionFactory;

	private ThreadLocal<Session> tlSession = new ThreadLocal<Session>();

	public OpenSessionInViewListener(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@Override
	public void onInit(IUnoVaadinApplication application) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onClose(IUnoVaadinApplication application) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onTransactionStart(IUnoVaadinApplication application) {
		if (sessionFactory != null) {
			if (TransactionSynchronizationManager.hasResource(sessionFactory)) {
				LOG.debug("Participating in existing open session.");
			} else {
				LOG.debug("Opening session in View...");
				Session session = SessionFactoryUtils.openSession(sessionFactory);
				session.setFlushMode(FlushMode.MANUAL);
				TransactionSynchronizationManager.bindResource(sessionFactory, new SessionHolder(session));
				tlSession.set(session);
			}
		}
	}

	@Override
	public void onTransactionEnd(IUnoVaadinApplication application) {
		if (tlSession.get() != null) {
			LOG.debug("Open session in view is binding... closing it.");
			SessionHolder sessionHolder = (SessionHolder) TransactionSynchronizationManager.unbindResource(sessionFactory);
			SessionFactoryUtils.closeSession(sessionHolder.getSession());
			tlSession.set(null);
		}
	}

}


text:
package net.iaeste.iws.core.services;

import net.iaeste.iws.api.enums.exchange.OfferFields;
import net.iaeste.iws.api.requests.exchange.OfferCSVUploadRequest;
import net.iaeste.iws.common.configuration.Settings;
import net.iaeste.iws.persistence.BasicDao;

import java.util.ArrayList;
import java.util.List;

/**
 * @author  Kim Jensen / last $Author:$
 * @version $Revision:$ / $Date:$
 * @since   IWS 1.2
 */
class CommonCSVService<T extends BasicDao> extends CommonService<T> {

    protected static final OfferCSVUploadRequest.FieldDelimiter DELIMITER = OfferCSVUploadRequest.FieldDelimiter.COMMA;

    CommonCSVService(final Settings settings, final T dao) {
        super(settings, dao);
    }

    protected static List<String> createFirstRow(final OfferFields.Type type) {
        final List<String> result = new ArrayList<>();

        addField(result, OfferFields.REF_NO, type);
        addField(result, OfferFields.OFFER_TYPE, type);
        addField(result, OfferFields.EXCHANGE_TYPE, type);
        addField(result, OfferFields.DEADLINE, type);
        addField(result, OfferFields.COMMENT, type);
        addField(result, OfferFields.EMPLOYER, type);
        addField(result, OfferFields.DEPARTMENT, type);
        addField(result, OfferFields.STREET1, type);
        addField(result, OfferFields.STREET2, type);
        addField(result, OfferFields.POSTBOX, type);
        addField(result, OfferFields.POSTAL_CODE, type);
        addField(result, OfferFields.CITY, type);
        addField(result, OfferFields.STATE, type);
        addField(result, OfferFields.COUNTRY, type);
        addField(result, OfferFields.WEBSITE, type);
        addField(result, OfferFields.WORKPLACE, type);
        addField(result, OfferFields.BUSINESS, type);
        addField(result, OfferFields.RESPONSIBLE, type);
        addField(result, OfferFields.AIRPORT, type);
        addField(result, OfferFields.TRANSPORT, type);
        addField(result, OfferFields.EMPLOYEES, type);
        addField(result, OfferFields.HOURS_WEEKLY, type);
        addField(result, OfferFields.HOURS_DAILY, type);
        addField(result, OfferFields.CANTEEN, type);
        addField(result, OfferFields.FACULTY, type);
        addField(result, OfferFields.SPECIALIZATION, type);
        addField(result, OfferFields.TRAINING_REQUIRED, type);
        addField(result, OfferFields.OTHER_REQUIREMENTS, type);
        addField(result, OfferFields.WORK_KIND, type);
        addField(result, OfferFields.WEEKS_MIN, type);
        addField(result, OfferFields.WEEKS_MAX, type);
        addField(result, OfferFields.FROM, type);
        addField(result, OfferFields.TO, type);
        addField(result, OfferFields.STUDY_COMPLETED_BEGINNING, type);
        addField(result, OfferFields.STUDY_COMPLETED_MIDDLE, type);
        addField(result, OfferFields.STUDY_COMPLETED_END, type);
        addField(result, OfferFields.WORK_TYPE_P, type);
        addField(result, OfferFields.WORK_TYPE_R, type);
        addField(result, OfferFields.WORK_TYPE_W, type);
        addField(result, OfferFields.WORK_TYPE_N, type);
        addField(result, OfferFields.LANGUAGE_1, type);
        addField(result, OfferFields.LANGUAGE_1_LEVEL, type);
        addField(result, OfferFields.LANGUAGE_1_OR, type);
        addField(result, OfferFields.LANGUAGE_2, type);
        addField(result, OfferFields.LANGUAGE_2_LEVEL, type);
        addField(result, OfferFields.LANGUAGE_2_OR, type);
        addField(result, OfferFields.LANGUAGE_3, type);
        addField(result, OfferFields.LANGUAGE_3_LEVEL, type);
        addField(result, OfferFields.CURRENCY, type);
        addField(result, OfferFields.PAYMENT, type);
        addField(result, OfferFields.PAYMENT_FREQUENCY, type);
        addField(result, OfferFields.DEDUCTION, type);
        addField(result, OfferFields.LODGING, type);
        addField(result, OfferFields.LODGING_COST, type);
        addField(result, OfferFields.LODGING_COST_FREQUENCY, type);
        addField(result, OfferFields.LIVING_COST, type);
        addField(result, OfferFields.LIVING_COST_FREQUENCY, type);
        addField(result, OfferFields.NO_HARD_COPIES, type);
        addField(result, OfferFields.STATUS, type);
        addField(result, OfferFields.PERIOD_2_FROM, type);
        addField(result, OfferFields.PERIOD_2_TO, type);
        addField(result, OfferFields.HOLIDAYS_FROM, type);
        addField(result, OfferFields.HOLIDAYS_TO, type);
        addField(result, OfferFields.ADDITIONAL_INFO, type);
        addField(result, OfferFields.SHARED, type);
        addField(result, OfferFields.LAST_MODIFIED, type);
        addField(result, OfferFields.NS_FIRST_NAME, type);
        addField(result, OfferFields.NS_LAST_NAME, type);

        return result;
    }

    private static void addField(final List<String> row, final OfferFields field, final OfferFields.Type type) {
        if (field.useField(type)) {
            row.add(field.getField());
        }
    }
}


text:
#pragma once
#include <aws/lexv2-models/LexModelsV2_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <aws/lexv2-models/model/PathFormat.h>
#include <aws/lexv2-models/model/TranscriptFormat.h>
#include <aws/lexv2-models/model/TranscriptFilter.h>
#include <utility>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace LexModelsV2
{
namespace Model
{

  /**
   *
The object representing the Amazon S3 bucket containing the transcript, as
   * well as the associated metadata.

See Also:
   AWS
   * API Reference

   */
  class AWS_LEXMODELSV2_API S3BucketTranscriptSource
  {
  public:
    S3BucketTranscriptSource();
    S3BucketTranscriptSource(Aws::Utils::Json::JsonView jsonValue);
    S3BucketTranscriptSource& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
The name of the bucket containing the transcript and the associated
     * metadata.

     */
    inline const Aws::String& GetS3BucketName() const{ return m_s3BucketName; }

    /**
     *
The name of the bucket containing the transcript and the associated
     * metadata.

     */
    inline bool S3BucketNameHasBeenSet() const { return m_s3BucketNameHasBeenSet; }

    /**
     *
The name of the bucket containing the transcript and the associated
     * metadata.

     */
    inline void SetS3BucketName(const Aws::String& value) { m_s3BucketNameHasBeenSet = true; m_s3BucketName = value; }

    /**
     *
The name of the bucket containing the transcript and the associated
     * metadata.

     */
    inline void SetS3BucketName(Aws::String&& value) { m_s3BucketNameHasBeenSet = true; m_s3BucketName = std::move(value); }

    /**
     *
The name of the bucket containing the transcript and the associated
     * metadata.

     */
    inline void SetS3BucketName(const char* value) { m_s3BucketNameHasBeenSet = true; m_s3BucketName.assign(value); }

    /**
     *
The name of the bucket containing the transcript and the associated
     * metadata.

     */
    inline S3BucketTranscriptSource& WithS3BucketName(const Aws::String& value) { SetS3BucketName(value); return *this;}

    /**
     *
The name of the bucket containing the transcript and the associated
     * metadata.

     */
    inline S3BucketTranscriptSource& WithS3BucketName(Aws::String&& value) { SetS3BucketName(std::move(value)); return *this;}

    /**
     *
The name of the bucket containing the transcript and the associated
     * metadata.

     */
    inline S3BucketTranscriptSource& WithS3BucketName(const char* value) { SetS3BucketName(value); return *this;}

    /**
     *
The object that contains a path format that will be applied when Amazon Lex
     * reads the transcript file in the bucket you provide. Specify this object if you
     * only want Lex to read a subset of files in your Amazon S3 bucket.

     */
    inline const PathFormat& GetPathFormat() const{ return m_pathFormat; }

    /**
     *
The object that contains a path format that will be applied when Amazon Lex
     * reads the transcript file in the bucket you provide. Specify this object if you
     * only want Lex to read a subset of files in your Amazon S3 bucket.

     */
    inline bool PathFormatHasBeenSet() const { return m_pathFormatHasBeenSet; }

    /**
     *
The object that contains a path format that will be applied when Amazon Lex
     * reads the transcript file in the bucket you provide. Specify this object if you
     * only want Lex to read a subset of files in your Amazon S3 bucket.

     */
    inline void SetPathFormat(const PathFormat& value) { m_pathFormatHasBeenSet = true; m_pathFormat = value; }

    /**
     *
The object that contains a path format that will be applied when Amazon Lex
     * reads the transcript file in the bucket you provide. Specify this object if you
     * only want Lex to read a subset of files in your Amazon S3 bucket.

     */
    inline void SetPathFormat(PathFormat&& value) { m_pathFormatHasBeenSet = true; m_pathFormat = std::move(value); }

    /**
     *
The object that contains a path format that will be applied when Amazon Lex
     * reads the transcript file in the bucket you provide. Specify this object if you
     * only want Lex to read a subset of files in your Amazon S3 bucket.

     */
    inline S3BucketTranscriptSource& WithPathFormat(const PathFormat& value) { SetPathFormat(value); return *this;}

    /**
     *
The object that contains a path format that will be applied when Amazon Lex
     * reads the transcript file in the bucket you provide. Specify this object if you
     * only want Lex to read a subset of files in your Amazon S3 bucket.

     */
    inline S3BucketTranscriptSource& WithPathFormat(PathFormat&& value) { SetPathFormat(std::move(value)); return *this;}

    /**
     *
The format of the transcript content. Currently, Genie only supports the
     * Amazon Lex transcript format.

     */
    inline const TranscriptFormat& GetTranscriptFormat() const{ return m_transcriptFormat; }

    /**
     *
The format of the transcript content. Currently, Genie only supports the
     * Amazon Lex transcript format.

     */
    inline bool TranscriptFormatHasBeenSet() const { return m_transcriptFormatHasBeenSet; }

    /**
     *
The format of the transcript content. Currently, Genie only supports the
     * Amazon Lex transcript format.

     */
    inline void SetTranscriptFormat(const TranscriptFormat& value) { m_transcriptFormatHasBeenSet = true; m_transcriptFormat = value; }

    /**
     *
The format of the transcript content. Currently, Genie only supports the
     * Amazon Lex transcript format.

     */
    inline void SetTranscriptFormat(TranscriptFormat&& value) { m_transcriptFormatHasBeenSet = true; m_transcriptFormat = std::move(value); }

    /**
     *
The format of the transcript content. Currently, Genie only supports the
     * Amazon Lex transcript format.

     */
    inline S3BucketTranscriptSource& WithTranscriptFormat(const TranscriptFormat& value) { SetTranscriptFormat(value); return *this;}

    /**
     *
The format of the transcript content. Currently, Genie only supports the
     * Amazon Lex transcript format.

     */
    inline S3BucketTranscriptSource& WithTranscriptFormat(TranscriptFormat&& value) { SetTranscriptFormat(std::move(value)); return *this;}

    /**
     *
The object that contains the filter which will be applied when Amazon Lex
     * reads through the Amazon S3 bucket. Specify this object if you want Amazon Lex
     * to read only a subset of the Amazon S3 bucket based on the filter you
     * provide.

     */
    inline const TranscriptFilter& GetTranscriptFilter() const{ return m_transcriptFilter; }

    /**
     *
The object that contains the filter which will be applied when Amazon Lex
     * reads through the Amazon S3 bucket. Specify this object if you want Amazon Lex
     * to read only a subset of the Amazon S3 bucket based on the filter you
     * provide.

     */
    inline bool TranscriptFilterHasBeenSet() const { return m_transcriptFilterHasBeenSet; }

    /**
     *
The object that contains the filter which will be applied when Amazon Lex
     * reads through the Amazon S3 bucket. Specify this object if you want Amazon Lex
     * to read only a subset of the Amazon S3 bucket based on the filter you
     * provide.

     */
    inline void SetTranscriptFilter(const TranscriptFilter& value) { m_transcriptFilterHasBeenSet = true; m_transcriptFilter = value; }

    /**
     *
The object that contains the filter which will be applied when Amazon Lex
     * reads through the Amazon S3 bucket. Specify this object if you want Amazon Lex
     * to read only a subset of the Amazon S3 bucket based on the filter you
     * provide.

     */
    inline void SetTranscriptFilter(TranscriptFilter&& value) { m_transcriptFilterHasBeenSet = true; m_transcriptFilter = std::move(value); }

    /**
     *
The object that contains the filter which will be applied when Amazon Lex
     * reads through the Amazon S3 bucket. Specify this object if you want Amazon Lex
     * to read only a subset of the Amazon S3 bucket based on the filter you
     * provide.

     */
    inline S3BucketTranscriptSource& WithTranscriptFilter(const TranscriptFilter& value) { SetTranscriptFilter(value); return *this;}

    /**
     *
The object that contains the filter which will be applied when Amazon Lex
     * reads through the Amazon S3 bucket. Specify this object if you want Amazon Lex
     * to read only a subset of the Amazon S3 bucket based on the filter you
     * provide.

     */
    inline S3BucketTranscriptSource& WithTranscriptFilter(TranscriptFilter&& value) { SetTranscriptFilter(std::move(value)); return *this;}

    /**
     *
The ARN of the KMS key that customer use to encrypt their Amazon S3 bucket.
     * Only use this field if your bucket is encrypted using a customer managed KMS
     * key.

     */
    inline const Aws::String& GetKmsKeyArn() const{ return m_kmsKeyArn; }

    /**
     *
The ARN of the KMS key that customer use to encrypt their Amazon S3 bucket.
     * Only use this field if your bucket is encrypted using a customer managed KMS
     * key.

     */
    inline bool KmsKeyArnHasBeenSet() const { return m_kmsKeyArnHasBeenSet; }

    /**
     *
The ARN of the KMS key that customer use to encrypt their Amazon S3 bucket.
     * Only use this field if your bucket is encrypted using a customer managed KMS
     * key.

     */
    inline void SetKmsKeyArn(const Aws::String& value) { m_kmsKeyArnHasBeenSet = true; m_kmsKeyArn = value; }

    /**
     *
The ARN of the KMS key that customer use to encrypt their Amazon S3 bucket.
     * Only use this field if your bucket is encrypted using a customer managed KMS
     * key.

     */
    inline void SetKmsKeyArn(Aws::String&& value) { m_kmsKeyArnHasBeenSet = true; m_kmsKeyArn = std::move(value); }

    /**
     *
The ARN of the KMS key that customer use to encrypt their Amazon S3 bucket.
     * Only use this field if your bucket is encrypted using a customer managed KMS
     * key.

     */
    inline void SetKmsKeyArn(const char* value) { m_kmsKeyArnHasBeenSet = true; m_kmsKeyArn.assign(value); }

    /**
     *
The ARN of the KMS key that customer use to encrypt their Amazon S3 bucket.
     * Only use this field if your bucket is encrypted using a customer managed KMS
     * key.

     */
    inline S3BucketTranscriptSource& WithKmsKeyArn(const Aws::String& value) { SetKmsKeyArn(value); return *this;}

    /**
     *
The ARN of the KMS key that customer use to encrypt their Amazon S3 bucket.
     * Only use this field if your bucket is encrypted using a customer managed KMS
     * key.

     */
    inline S3BucketTranscriptSource& WithKmsKeyArn(Aws::String&& value) { SetKmsKeyArn(std::move(value)); return *this;}

    /**
     *
The ARN of the KMS key that customer use to encrypt their Amazon S3 bucket.
     * Only use this field if your bucket is encrypted using a customer managed KMS
     * key.

     */
    inline S3BucketTranscriptSource& WithKmsKeyArn(const char* value) { SetKmsKeyArn(value); return *this;}

  private:

    Aws::String m_s3BucketName;
    bool m_s3BucketNameHasBeenSet = false;

    PathFormat m_pathFormat;
    bool m_pathFormatHasBeenSet = false;

    TranscriptFormat m_transcriptFormat;
    bool m_transcriptFormatHasBeenSet = false;

    TranscriptFilter m_transcriptFilter;
    bool m_transcriptFilterHasBeenSet = false;

    Aws::String m_kmsKeyArn;
    bool m_kmsKeyArnHasBeenSet = false;
  };

} // namespace Model
} // namespace LexModelsV2
} // namespace Aws


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Olá seja bem vindo ao blog do Ismael Soares. Compartilho aqui meus estudos sobre TDD, BDD, Tech Talks, Gestão, Banco de dados e meus pensamentos ágeis.">

    <title>Inteligência Emocional na Liderança - Ismael Soares</title>

    <link rel="canonical" href="http://rkmael.com/2014/12/02/inteligencia-emocional-lideranca/">

    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <link rel="stylesheet" href="/css/clean-blog.css">

    <link rel="stylesheet" href="/css/syntax.css">

    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>

            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                Toggle navigation

            </button>
            Ismael Soares

                    Home

                    Sobre Mim

                    Contato

                    TDD

                    Tech talks

                    Gestão

                    Banco de dados

Inteligência Emocional na Liderança

                    Posted by  on December 2, 2014

Este post é extremamente importante para você! Por quê?
Porque mesmo que você não atue numa posição de liderança no seu trabalho mas exerce algum tipo influência sobre alguém, as dicas contidas neste post irão te ajudar a controlar suas emoções de forma inteligente.

Na apresentação Emoções de um Líder, afirmei que um time é diretamente contagiado pelo seu líder. Isto significa, que como líder, você deve ter atenção dobrada com suas emoções para influenciar positivamente as pessoas que estão ao seu redor.

O que é Inteligência Emocional?

Pense em alguém que nunca perde o controle independente dos problemas que enfrenta, alguém que confia totalmente na sua equipe, que fala sempre gentilmente, que ouve as pessoas, alguém com quem é fácil falar e que toma decisões cuidadosamente calculadas. Estas caraterísticas são de alguém com elevados níveis de inteligência emocional.

Pode se dizer então, que Inteligência Emocional é a capacidade para entender e gerir suas emoções e as dos que o rodeiam. Parece difícil, mas a boa notícia é ela pode ser aprendida ou aperfeiçoada.

Em seu artigo  "Porque é que a inteligência emocional é tão importante para os líderes? 5 Passos para a poder potenciar" publicado no Portal da Liderança, Bruna Martinuzzi, fundadora da Clarion Enterprise, nos dá algumas dicas para melhorar nossa Inteligência Emocional.

1º Autoconhecimento

"Quem conhece a si próprio, sabe sempre como se sente e como é que as suas emoções e ações podem afetar os que o rodeiam."

Tenha um diário

Isto mesmo! Os diários ajudam a melhorar o autoconhecimento. Reserve alguns minutos do seu dia para refletir nas suas ações. Principalmente nas ações reativas, ou seja, aquelas que você simplesmente reagiu resposta a determinada situação.

Mantenha a calma

Manter a calma em momentos de frustações ou fortes emoções não é nada fácil. No entanto, pense que você não é uma vítima e pode escolher como quer reagir em cada tipo de situação.

2º Autocontrole

"Os líderes que conseguem se controlar eficazmente, raramente atacam os outros verbalmente, tomam decisões apressadas ou emocionais, estereotipam as pessoas ou comprometem os seus valores. O autocontrole tem tudo a ver com estar sempre no controle"

Conheça seus valores

Já parou para pensar quais os valores mais importantes para você? Tem ideia de onde não estaria disposto a comprometer-se? Possui um "código de ética"? Se as respostas forem NÃO, então você precisar refletir sobre isto. Gaste um tempo escrevendo seus valores. Procure coisas que façam sentido para você e não apenas para os outros.

Responsabilize-se

Não culpe os outros quando algo der errado. Assuma os erros e enfrente as consequências. Isto irá te ajudar a conquistar o respeito das pessoas que o rodeiam.

Pratique se acalmar

Quando você estiver nervoso, desejando dizer algumas "verdades" à alguém, escreva tudo numa folha de papel, procure um lugar reservado e leia em voz alta como se estivesse falando com a pessoa. Em seguida, rasgue o papel. Pronto, você liberou seu stress emocional e não agrediu verbalmente ninguém. Mas procure terminar seu "monológo" com palavras que expirem reconciliação, como: "eu te desculpo, vamos esquecer o passado e seguir em frente". Este final é importante porque a mente tem o poder fazer com que situações que nunca existiram pareçam reais e nunca é bom terminar uma conversa com o ânimo exaltado.

3º Motivação

Segundo Martinuzzi, líderes automotivados trabalham constantemente em direção às metas e têm elevados níveis de qualidade para o seu trabalho.

Procure sentido

Reveja porque você está fazendo isto. Tente lembrar porque você está trabalhando neste emprego, o que o motivou?

Em que posição você está?

Determine o quão motivado está para liderar. "Os líderes motivados são, por norma, otimistas, independentemente da situação que enfrentam. Haverá quase sempre algo positivo, basta procurá-lo."

4º Empatia

"Para os líderes, ter empatia é crucial para gerir qualquer equipe ou organização com sucesso. Os líderes empáticos têm a capacidade de se colocarem no lugar do outro, ajudam a desenvolver as pessoas na sua equipe, desafiam os outros quando estes não agem de uma forma justa, dão feedback construtivo e ouvem aqueles que necessitam de ser ouvidos."

Coloque-se no lugar do outro

"É fácil defender o seu ponto de vista. Afinal de contas, é o seu ponto de vista! No entanto, você deve olhar para as situações nas perspetivas dos outros."

Cuidado com a linguagem corporal

Cruzar os braços, andar para trás e para a frente ou morder os lábios, indicam como você está se sentindo em determinada situação. Isto pode ser ruim. Aprenda linguagem corporal e você terá a oportunidade de responder de forma apropriada.

Reaja aos sentimentos

Quando alguém vier conversar com você sobre algum problema pessoal. Escute-o, mostre que você se importa. Se pedir para alguém ficar até mais tarde, por exemplo, e notar um descontentamento na pessoa, reaja! Agradeça e diga a ela o quanto você se senta mal por estar fazendo isto.

5º Competências sociais

"Líderes estão abertos tanto para as boas como para as más notícias e são especialistas em conseguir que a sua equipe o defenda ou que fiquem contentes com uma nova missão ou projeto."

Aprenda a resolver conflitos

"Os líderes devem saber como resolver conflitos entre membros da sua equipe, clientes ou vendedores. Aprender diferentes competências para a resolução do conflito é extremamente importante se quer ser bem-sucedido."

Aprenda a elogiar os outros

Inspire a lealdade da sua equipe ao dar elogios quando estes são merecidos. Aprender a dar elogios eficazmente é uma arte que vale bem a pena dominar.

Teste sua inteligência emocional

Você pode testar como está em cada uma das competências citadas acima clicando aqui.

Assista apresentação que fiz à equipe da Bluesoft:

                Tweet

                        ← Previous Post

                        Next Post →

                Tweets de @rkmael

            Please enable JavaScript to view the comments powered by Disqus.
            comments powered by Disqus

Copyright © Ismael Soares 2016


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>io.github.thankpoint</groupId>
    <artifactId>thanks4java-core-impl</artifactId>
    <version>1.0.0-SNAPSHOT</version>
  </parent>
  <artifactId>thanks4java-core-impl-v001</artifactId>
  <packaging>jar</packaging>
  <name>${project.artifactId}</name>
  <description>Implementation of core API to manage thank-tokens and calculate thankpoints.</description>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>thanks4java-core-impl-base</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpg-jdk15on</artifactId>
      <version>1.56</version>
    </dependency>
  </dependencies>

</project>


text:
#ifndef UTEE_SYSCALLS_H
#define UTEE_SYSCALLS_H

#include <compiler.h>
#include <stddef.h>
#include <stdint.h>

#include <utee_types.h>
#include <tee_api_types.h>
#include <trace.h>

void utee_return(uint32_t ret) __noreturn;

void utee_log(const void *buf, size_t len);

void utee_panic(uint32_t code) __noreturn;

uint32_t utee_dummy(uint32_t *a);

uint32_t utee_dummy_7args(uint32_t a1, uint32_t a2, uint32_t a3, uint32_t a4,
			  uint32_t a5, uint32_t a6, uint32_t a7);

uint32_t utee_nocall(void);

TEE_Result utee_get_property(enum utee_property prop, void *buf, uint32_t len);

TEE_Result utee_open_ta_session(const TEE_UUID *dest,
				uint32_t cancel_req_to, uint32_t param_types,
				TEE_Param params[4], TEE_TASessionHandle *sess,
				uint32_t *ret_orig);

TEE_Result utee_close_ta_session(TEE_TASessionHandle sess);

TEE_Result utee_invoke_ta_command(TEE_TASessionHandle sess,
				  uint32_t cancel_req_to, uint32_t cmd_id,
				  uint32_t param_types, TEE_Param params[4],
				  uint32_t *ret_orig);

TEE_Result utee_check_access_rights(uint32_t flags, const void *buf,
				    size_t len);

TEE_Result utee_get_cancellation_flag(bool *cancel);

TEE_Result utee_unmask_cancellation(bool *old_mask);

TEE_Result utee_mask_cancellation(bool *old_mask);

TEE_Result utee_wait(uint32_t timeout);

TEE_Result utee_get_time(enum utee_time_category cat, TEE_Time *time);

TEE_Result utee_set_ta_time(const TEE_Time *time);

TEE_Result utee_cryp_state_alloc(uint32_t algo, uint32_t op_mode,
				 uint32_t key1, uint32_t key2,
				 uint32_t *state);
TEE_Result utee_cryp_state_copy(uint32_t dst, uint32_t src);
TEE_Result utee_cryp_state_free(uint32_t state);

/* iv and iv_len are ignored for some algorithms */
TEE_Result utee_hash_init(uint32_t state, const void *iv, size_t iv_len);
TEE_Result utee_hash_update(uint32_t state, const void *chunk,
			    size_t chunk_size);
TEE_Result utee_hash_final(uint32_t state, const void *chunk,
			   size_t chunk_size, void *hash, uint32_t *hash_len);

TEE_Result utee_cipher_init(uint32_t state, const void *iv, size_t iv_len);
TEE_Result utee_cipher_update(uint32_t state, const void *src, size_t src_len,
			      void *dest, uint32_t *dest_len);
TEE_Result utee_cipher_final(uint32_t state, const void *src, size_t src_len,
			     void *dest, uint32_t *dest_len);

/* Generic Object Functions */
TEE_Result utee_cryp_obj_get_info(uint32_t obj, TEE_ObjectInfo *info);
TEE_Result utee_cryp_obj_restrict_usage(uint32_t obj, uint32_t usage);
TEE_Result utee_cryp_obj_get_attr(uint32_t obj, uint32_t attr_id,
				  void *buffer, uint32_t *size);

/* Transient Object Functions */
TEE_Result utee_cryp_obj_alloc(TEE_ObjectType type, uint32_t max_size,
			       uint32_t *obj);
TEE_Result utee_cryp_obj_close(uint32_t obj);
TEE_Result utee_cryp_obj_reset(uint32_t obj);
TEE_Result utee_cryp_obj_populate(uint32_t obj, TEE_Attribute *attrs,
				  uint32_t attr_count);
TEE_Result utee_cryp_obj_copy(uint32_t dst_obj, uint32_t src_obj);

TEE_Result utee_cryp_obj_generate_key(uint32_t obj, uint32_t key_size,
				      const TEE_Attribute *params,
				      uint32_t param_count);

TEE_Result utee_cryp_derive_key(uint32_t state, const TEE_Attribute *params,
				uint32_t param_count, uint32_t derived_key);

TEE_Result utee_cryp_random_number_generate(void *buf, size_t blen);

TEE_Result utee_authenc_init(uint32_t state, const void *nonce,
			     size_t nonce_len, size_t tag_len, size_t aad_len,
			     size_t payload_len);
TEE_Result utee_authenc_update_aad(uint32_t state, const void *aad_data,
				   size_t aad_data_len);
TEE_Result utee_authenc_update_payload(uint32_t state, const void *src_data,
				       size_t src_len, void *dest_data,
				       uint32_t *dest_len);
TEE_Result utee_authenc_enc_final(uint32_t state, const void *src_data,
				  size_t src_len, void *dest_data,
				  uint32_t *dest_len, void *tag,
				  uint32_t *tag_len);
TEE_Result utee_authenc_dec_final(uint32_t state, const void *src_data,
				  size_t src_len, void *dest_data,
				  uint32_t *dest_len, const void *tag,
				  size_t tag_len);

TEE_Result utee_asymm_operate(uint32_t state, const TEE_Attribute *params,
			      uint32_t num_params, const void *src_data,
			      size_t src_len, void *dest_data,
			      uint32_t *dest_len);

TEE_Result utee_asymm_verify(uint32_t state,
			     const TEE_Attribute *params, uint32_t num_params,
			     const void *data, size_t data_len, const void *sig,
			     size_t sig_len);

/* Persistant Object Functions */
TEE_Result utee_storage_obj_open(uint32_t storage_id, void *object_id,
				 uint32_t object_id_len, uint32_t flags,
				 TEE_ObjectHandle *obj);

TEE_Result utee_storage_obj_create(uint32_t storage_id, void *object_id,
				   uint32_t object_id_len, uint32_t flags,
				   TEE_ObjectHandle attr, const void *data,
				   uint32_t len, TEE_ObjectHandle *obj);

TEE_Result utee_storage_obj_del(TEE_ObjectHandle obj);

TEE_Result utee_storage_obj_rename(TEE_ObjectHandle obj, const void *new_obj_id,
				   size_t new_obj_id_len);

/* Persistent Object Enumeration Functions */
TEE_Result utee_storage_alloc_enum(TEE_ObjectEnumHandle *obj_enum);

TEE_Result utee_storage_free_enum(TEE_ObjectEnumHandle obj_enum);

TEE_Result utee_storage_reset_enum(TEE_ObjectEnumHandle obj_enum);

TEE_Result utee_storage_start_enum(TEE_ObjectEnumHandle obj_enum,
				   uint32_t storage_id);

TEE_Result utee_storage_next_enum(TEE_ObjectEnumHandle obj_enum,
				  TEE_ObjectInfo *info, void *obj_id,
				  uint32_t *len);

/* Data Stream Access Functions */
TEE_Result utee_storage_obj_read(TEE_ObjectHandle obj, void *data, size_t len,
				 uint32_t *count);

TEE_Result utee_storage_obj_write(TEE_ObjectHandle obj, const void *data,
				  size_t len);

TEE_Result utee_storage_obj_trunc(TEE_ObjectHandle obj, size_t len);

TEE_Result utee_storage_obj_seek(TEE_ObjectHandle obj, int32_t offset,
				 TEE_Whence whence);

TEE_Result utee_se_service_open(
		TEE_SEServiceHandle *seServiceHandle);

TEE_Result utee_se_service_close(
		TEE_SEServiceHandle seServiceHandle);

TEE_Result utee_se_service_get_readers(
		TEE_SEServiceHandle seServiceHandle,
		TEE_SEReaderHandle *r, size_t *len);

TEE_Result utee_se_reader_get_prop(TEE_SEReaderHandle r,
				TEE_SEReaderProperties *p);

TEE_Result utee_se_reader_get_name(TEE_SEReaderHandle r,
		char *name, size_t *name_len);

TEE_Result utee_se_reader_open_session(TEE_SEReaderHandle r,
		TEE_SESessionHandle *s);

TEE_Result utee_se_reader_close_sessions(TEE_SEReaderHandle r);

TEE_Result utee_se_session_is_closed(TEE_SESessionHandle s);

TEE_Result utee_se_session_get_atr(TEE_SESessionHandle s,
		void *atr, size_t *atr_len);

TEE_Result utee_se_session_open_channel(TEE_SESessionHandle s,
		bool is_logical, TEE_SEAID *aid, TEE_SEChannelHandle *c);

TEE_Result utee_se_session_close(TEE_SESessionHandle s);

TEE_Result utee_se_channel_select_next(TEE_SEChannelHandle c);

TEE_Result utee_se_channel_get_select_resp(TEE_SEChannelHandle c,
	void *resp, size_t *resp_len);

TEE_Result utee_se_channel_transmit(TEE_SEChannelHandle c,
	void *cmd, size_t cmd_len, void *resp, size_t *resp_len);

TEE_Result utee_se_channel_close(TEE_SEChannelHandle c);

TEE_Result utee_cache_operation(void *va, size_t l,
				enum utee_cache_operation op);

#endif /* UTEE_SYSCALLS_H */