text:
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
 * Copyright (c) 2007 Georgia Tech Research Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation;
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Raj Bhattacharjea <raj.b@gatech.edu>
 */

#ifndef TCP_HEADER_H
#define TCP_HEADER_H

#include <stdint.h>
#include "ns3/header.h"
#include "ns3/tcp-option.h"
#include "ns3/buffer.h"
#include "ns3/tcp-socket-factory.h"
#include "ns3/ipv4-address.h"
#include "ns3/ipv6-address.h"
#include "ns3/sequence-number.h"

namespace ns3 {

/**
 * \ingroup tcp
 * \brief Header for the Transmission Control Protocol
 *
 * This class has fields corresponding to those in a network TCP header
 * (port numbers, sequence and acknowledgement numbers, flags, etc) as well
 * as methods for serialization to and deserialization from a byte buffer.
 */

class TcpHeader : public Header
{
public:
  TcpHeader ();
  virtual ~TcpHeader ();

  /**
   * \brief Print a TCP header into an output stream
   *
   * \param os output stream
   * \param tc TCP header to print
   * \return The ostream passed as first argument
   */
  friend std::ostream& operator<< (std::ostream& os, TcpHeader const & tc);

  /**
   * \brief Converts an integer into a human readable list of Tcp flags
   *
   * \param flags Bitfield of TCP flags to convert to a readable string
   * \param delimiter String to insert between flags
   *
   * FIN=0x1, SYN=0x2, RST=0x4, PSH=0x8, ACK=0x10, URG=0x20, ECE=0x40, CWR=0x80
   * TcpHeader::FlagsToString (0x1) should return the following string;
   *     "FIN"
   *
   * TcpHeader::FlagsToString (0xff) should return the following string;
   *     "FIN|SYN|RST|PSH|ACK|URG|ECE|CWR";
   *
   * \return the generated string
   **/
  static std::string FlagsToString (uint8_t flags, const std::string& delimiter = "|");

  /**
   * \brief Enable checksum calculation for TCP
   *
   * \todo currently has no effect
   */
  void EnableChecksums (void);

//Setters

/**
 * \brief Set the source port
 * \param port The source port for this TcpHeader
 */
  void SetSourcePort (uint16_t port);

  /**
   * \brief Set the destination port
   * \param port the destination port for this TcpHeader
   */
  void SetDestinationPort (uint16_t port);

  /**
   * \brief Set the sequence Number
   * \param sequenceNumber the sequence number for this TcpHeader
   */
  void SetSequenceNumber (SequenceNumber32 sequenceNumber);

  /**
   * \brief Set the ACK number
   * \param ackNumber the ACK number for this TcpHeader
   */
  void SetAckNumber (SequenceNumber32 ackNumber);

  /**
   * \brief Set flags of the header
   * \param flags the flags for this TcpHeader
   */
  void SetFlags (uint8_t flags);

  /**
   * \brief Set the window size
   * \param windowSize the window size for this TcpHeader
   */
  void SetWindowSize (uint16_t windowSize);

  /**
   * \brief Set the urgent pointer
   * \param urgentPointer the urgent pointer for this TcpHeader
   */
  void SetUrgentPointer (uint16_t urgentPointer);

//Getters

  /**
   * \brief Get the source port
   * \return The source port for this TcpHeader
   */
  uint16_t GetSourcePort () const;

  /**
   * \brief Get the destination port
   * \return the destination port for this TcpHeader
   */
  uint16_t GetDestinationPort () const;

  /**
   * \brief Get the sequence number
   * \return the sequence number for this TcpHeader
   */
  SequenceNumber32 GetSequenceNumber () const;

  /**
   * \brief Get the ACK number
   * \return the ACK number for this TcpHeader
   */
  SequenceNumber32 GetAckNumber () const;

  /**
   * \brief Get the length in words
   *
   * A word is 4 bytes; without Tcp Options, header is 5 words (20 bytes).
   * With options, it can reach up to 15 words (60 bytes).
   *
   * \return the length of this TcpHeader
   */
  uint8_t GetLength () const;

  /**
   * \brief Get the flags
   * \return the flags for this TcpHeader
   */
  uint8_t GetFlags () const;

  /**
   * \brief Get the window size
   * \return the window size for this TcpHeader
   */
  uint16_t GetWindowSize () const;

  /**
   * \brief Get the urgent pointer
   * \return the urgent pointer for this TcpHeader
   */
  uint16_t GetUrgentPointer () const;

  /**
   * \brief Get the option specified
   * \param kind the option to retrieve
   * \return Whether the header contains a specific kind of option, or 0
   */
  Ptr<TcpOption> GetOption (uint8_t kind) const;

  /**
   * \brief Get the total length of appended options
   * \return the total length of options appended to this TcpHeader
   */
  uint8_t GetOptionLength () const;

  /**
   * \brief Get maximum option length
   * \return the maximum option length
   */
  uint8_t GetMaxOptionLength () const;

  /**
   * \brief Check if the header has the option specified
   * \param kind Option to check for
   * \return true if the header has the option, false otherwise
   */
  bool HasOption (uint8_t kind) const;

  /**
   * \brief Append an option to the TCP header
   * \param option The option to append
   * \return true if option has been appended, false otherwise
   */
  bool AppendOption (Ptr<TcpOption> option);

  /**
   * \brief Initialize the TCP checksum.
   *
   * If you want to use tcp checksums, you should call this
   * method prior to adding the header to a packet.
   *
   * \param source the IP source to use in the underlying
   *        IP packet.
   * \param destination the IP destination to use in the
   *        underlying IP packet.
   * \param protocol the protocol number to use in the underlying
   *        IP packet.
   *
   */
  void InitializeChecksum (const Ipv4Address &source,
                           const Ipv4Address &destination,
                           uint8_t protocol);

  /**
   * \brief Initialize the TCP checksum.
   *
   * If you want to use tcp checksums, you should call this
   * method prior to adding the header to a packet.
   *
   * \param source the IP source to use in the underlying
   *        IP packet.
   * \param destination the IP destination to use in the
   *        underlying IP packet.
   * \param protocol the protocol number to use in the underlying
   *        IP packet.
   *
   */
  void InitializeChecksum (const Ipv6Address &source,
                           const Ipv6Address &destination,
                           uint8_t protocol);

  /**
   * \brief Initialize the TCP checksum.
   *
   * If you want to use tcp checksums, you should call this
   * method prior to adding the header to a packet.
   *
   * \param source the IP source to use in the underlying
   *        IP packet.
   * \param destination the IP destination to use in the
   *        underlying IP packet.
   * \param protocol the protocol number to use in the underlying
   *        IP packet.
   *
   */
  void InitializeChecksum (const Address &source,
                           const Address &destination,
                           uint8_t protocol);

  /**
   * \brief TCP flag field values
   */
  typedef enum
  {
    NONE = 0,   //!< No flags
    FIN  = 1,   //!< FIN
    SYN  = 2,   //!< SYN
    RST  = 4,   //!< Reset
    PSH  = 8,   //!< Push
    ACK  = 16,  //!< Ack
    URG  = 32,  //!< Urgent
    ECE  = 64,  //!< ECE
    CWR  = 128  //!< CWR
  } Flags_t;

  /**
   * \brief Get the type ID.
   * \return the object TypeId
   */
  static TypeId GetTypeId (void);
  virtual TypeId GetInstanceTypeId (void) const;
  virtual void Print (std::ostream &os) const;
  virtual uint32_t GetSerializedSize (void) const;
  virtual void Serialize (Buffer::Iterator start) const;
  virtual uint32_t Deserialize (Buffer::Iterator start);

  /**
   * \brief Is the TCP checksum correct ?
   * \returns true if the checksum is correct, false otherwise.
   */
  bool IsChecksumOk (void) const;

  /**
   * Comparison operator
   * \param lhs left operand
   * \param rhs right operand
   * \return true if the operands are equal
   */
  friend bool operator== (const TcpHeader &lhs, const TcpHeader &rhs);

private:
  /**
   * \brief Calculate the header checksum
   * \param size packet size
   * \returns the checksum
   */
  uint16_t CalculateHeaderChecksum (uint16_t size) const;

  /**
   * \brief Calculates the header length (in words)
   *
   * Given the standard size of the header, the method checks for options
   * and calculates the real length (in words).
   *
   * \return header length in 4-byte words
   */
  uint8_t CalculateHeaderLength () const;

  uint16_t m_sourcePort;        //!< Source port
  uint16_t m_destinationPort;   //!< Destination port
  SequenceNumber32 m_sequenceNumber;  //!< Sequence number
  SequenceNumber32 m_ackNumber;       //!< ACK number
  uint8_t m_length;             //!< Length (really a uint4_t) in words.
  uint8_t m_flags;              //!< Flags (really a uint6_t)
  uint16_t m_windowSize;        //!< Window size
  uint16_t m_urgentPointer;     //!< Urgent pointer

  Address m_source;       //!< Source IP address
  Address m_destination;  //!< Destination IP address
  uint8_t m_protocol;     //!< Protocol number

  bool m_calcChecksum;    //!< Flag to calculate checksum
  bool m_goodChecksum;    //!< Flag to indicate that checksum is correct

  static const uint8_t m_maxOptionsLen = 40;         //!< Maximum options length
  typedef std::list< Ptr<TcpOption> > TcpOptionList; //!< List of TcpOption
  TcpOptionList m_options;     //!< TcpOption present in the header
  uint8_t m_optionsLen;        //!< Tcp options length.
};

} // namespace ns3

#endif /* TCP_HEADER */


text:
namespace content {

// Maximum number of currently scheduled notifications per origin.
constexpr int kMaximumScheduledNotificationsPerOrigin = 30;

}  // namespace content

#endif  // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_TRIGGER_CONSTANTS_H_

redpajama_set_name: RedPajamaGithub


text:
namespace Smellyriver.TankInspector.Pro.Data.Entities
{
    public interface IArmoredObject
    {
        ArmorGroup GetArmorGroup(string key);
        double GetThickestArmor(bool spaced);
        double GetThinnestArmor(bool spaced);
        double[] GetArmorValues(bool spaced);
    }
}


text:
<?php

    namespace AppBundle\Controller;

    use Symfony\Component\HttpFoundation\Request;
    use Symfony\Bundle\FrameworkBundle\Controller\Controller;
    use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
    use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
    use AppBundle\Entity\Kontzeptua;
    use AppBundle\Form\KontzeptuaType;

    /**
     * Kontzeptua controller.
     *
     * @Route("/admin/kontzeptua")
     */
    class KontzeptuaController extends Controller
    {

        /**
         * Creates a new Kontzeptua entity.
         *
         * @Route("/new/{azpiatalaid}", options = { "expose" = true }, name="admin_kontzeptua_new")
         * @Method({"GET", "POST"})
         */
        public function newAction ( Request $request, $azpiatalaid )
        {
            $em = $this->getDoctrine();

            $azpiatala = $em->getRepository( 'AppBundle:Azpiatala' )->find( $azpiatalaid );
            $kontzeptua = new Kontzeptua();
            $kontzeptua->setAzpiatala( $azpiatala );
            $kontzeptua->setUdala( $this->getUser()->getUdala() );

            $form = $this->createForm( 'AppBundle\Form\KontzeptuaType', $kontzeptua );
            $form->handleRequest( $request );

            if ( $form->isSubmitted() && $form->isValid() ) {
                $em = $this->getDoctrine()->getManager();
                $em->persist( $kontzeptua );
                $em->flush();

                return $this->redirect( $request->headers->get( 'referer' ) . '#kontzeptua'.$kontzeptua->getId());

            }

            return $this->render(
                'kontzeptua/new.html.twig',
                array (
                    'kontzeptua'  => $kontzeptua,
                    'azpiatalaid' => $azpiatalaid,
                    'form'        => $form->createView(),
                )
            );
        }

        /**
         *
         * @Route("/{id}/edit/{ordenantzaid}", options = { "expose" = true }, name="admin_kontzeptua_edit")
         * @Method({"GET", "POST"})
         */
        public function editAction(Request $request, Kontzeptua $kontzeptua, $ordenantzaid)
        {
            $deleteForm = $this->createDeleteForm($kontzeptua);
            $editForm = $this->createForm('AppBundle\Form\KontzeptuaType', $kontzeptua);
            $editForm->handleRequest($request);
            if ($editForm->isSubmitted() && $editForm->isValid()) {
                $em = $this->getDoctrine()->getManager();
                $em->persist($kontzeptua);
                $em->flush();
//                return $this->redirectToRoute('araudia_edit', array('id' => $kontzeptua->getId()));

                //return $this->redirectToRoute('admin_ordenantza_show', array('id' => $ordenantzaid));
                return $this->redirect( $request->headers->get( 'referer' ) . '#kontzeptua'.$kontzeptua->getId());
            }
            return $this->render('kontzeptua/edit.html.twig', array(
                'kontzeptua' => $kontzeptua,
                'ordenantzaid' => $ordenantzaid,
                'form' => $editForm->createView(),
                'delete_form' => $deleteForm->createView(),
            ));

        }

        /**
         *
         * @Route("/ezabatu/{id}", options = { "expose" = true }, name="admin_kontzeptua_ezabatu")
         * @Method("GET")
         */
        public function ezabatuAction(Kontzeptua $kontzeptua)
        {

            $deleteForm = $this->createDeleteForm($kontzeptua);

            return $this->render(':kontzeptua:_kontzeptuadeleteform.html.twig', array(
                'delete_form' => $deleteForm->createView(),
                'id' => $kontzeptua->getId()
            ));
        }

        /**
         * Deletes a Kontzeptua entity.
         *
         * @Route("/{id}", name="admin_kontzeptua_delete")
         * @Method("DELETE")
         */
        public function deleteAction ( Request $request, Kontzeptua $kontzeptua )
        {
            $form = $this->createDeleteForm( $kontzeptua );
            $form->handleRequest( $request );

            if ($form->isSubmitted() && $form->isValid()) {
                $em = $this->getDoctrine()->getManager();
                /* Begiratu ezabatze marka duen (dev) baldin badu, ezabatu
                bestela marka ezarri */
                if ( $kontzeptua->getEzabatu() === 1 ) {
                    $em->remove($kontzeptua);
                } else {
                    $kontzeptua->setEzabatu( 1 );
                  $em->persist( $kontzeptua );
                }

              $em->flush();
            }

            return $this->redirect( $request->headers->get( 'referer' ) );
        }

        /**
         * Creates a form to delete a Kontzeptua entity.
         *
         * @param Kontzeptua $kontzeptua The Kontzeptua entity
         *
         * @return \Symfony\Component\Form\Form The form
         */
        private function createDeleteForm ( Kontzeptua $kontzeptua )
        {
            return $this->createFormBuilder()
                ->setAction( $this->generateUrl( 'admin_kontzeptua_delete', array ('id' => $kontzeptua->getId()) ) )
                ->setMethod( 'DELETE' )
                ->getForm();
        }
    }


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>All Classes (SBT Compiler API 1.0.0-beta4 API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

AbstractCompiler

Analysis

AnalysisProcessor

Compiler

CompilerConfiguration

CompilerException

CompilerLogger

Compilers


text:
typedef int (*PowerOffController)(int);

namespace offActions
{
    std::string off(int index) {
        HINSTANCE hXInputDLL = LoadLibraryA("XInput1_4.dll");

      	if (hXInputDLL == NULL) {
      	  return "failed to load xinput dll";
      	}

        XINPUT_STATE state;
        memset(&state, 0, sizeof(XINPUT_STATE));

        if(XInputGetState(index, &state) == ERROR_SUCCESS)
        {
          PowerOffController(*GetProcAddress(hXInputDLL, (LPCSTR) 103))(index);
        }

        ZeroMemory(&state, sizeof(XINPUT_STATE));

      	FreeLibrary(hXInputDLL);

      	return "";
    }

    std::string offAll() {
      HINSTANCE hXInputDLL = LoadLibraryA("XInput1_4.dll");

      if (hXInputDLL == NULL) {
        return "failed to load xinput dll";
      }

      for(int i = 0; i < XUSER_MAX_COUNT; i++)
      {
        XINPUT_STATE state;
        memset(&state, 0, sizeof(XINPUT_STATE));

        if(XInputGetState(i, &state) == ERROR_SUCCESS)
        {
          PowerOffController(*GetProcAddress(hXInputDLL, (LPCSTR) 103))(i);
        }

        ZeroMemory(&state, sizeof(XINPUT_STATE));
      }

      FreeLibrary(hXInputDLL);

      return "";
    }
}


text:
namespace v8 {
namespace internal {

class ConversionBuiltinsAssembler : public CodeStubAssembler {
 public:
  explicit ConversionBuiltinsAssembler(compiler::CodeAssemblerState* state)
      : CodeStubAssembler(state) {}

 protected:
  void Generate_NonPrimitiveToPrimitive(Node* context, Node* input,
                                        ToPrimitiveHint hint);

  void Generate_OrdinaryToPrimitive(Node* context, Node* input,
                                    OrdinaryToPrimitiveHint hint);
};

// ES6 section 7.1.1 ToPrimitive ( input [ , PreferredType ] )
void ConversionBuiltinsAssembler::Generate_NonPrimitiveToPrimitive(
    Node* context, Node* input, ToPrimitiveHint hint) {
  // Lookup the @@toPrimitive property on the {input}.
  Node* exotic_to_prim =
      GetProperty(context, input, factory()->to_primitive_symbol());

  // Check if {exotic_to_prim} is neither null nor undefined.
  Label ordinary_to_primitive(this);
  GotoIf(IsNullOrUndefined(exotic_to_prim), &ordinary_to_primitive);
  {
    // Invoke the {exotic_to_prim} method on the {input} with a string
    // representation of the {hint}.
    Callable callable =
        CodeFactory::Call(isolate(), ConvertReceiverMode::kNotNullOrUndefined);
    Node* hint_string = HeapConstant(factory()->ToPrimitiveHintString(hint));
    Node* result =
        CallJS(callable, context, exotic_to_prim, input, hint_string);

    // Verify that the {result} is actually a primitive.
    Label if_resultisprimitive(this),
        if_resultisnotprimitive(this, Label::kDeferred);
    GotoIf(TaggedIsSmi(result), &if_resultisprimitive);
    Node* result_instance_type = LoadInstanceType(result);
    STATIC_ASSERT(FIRST_PRIMITIVE_TYPE == FIRST_TYPE);
    Branch(Int32LessThanOrEqual(result_instance_type,
                                Int32Constant(LAST_PRIMITIVE_TYPE)),
           &if_resultisprimitive, &if_resultisnotprimitive);

    BIND(&if_resultisprimitive);
    {
      // Just return the {result}.
      Return(result);
    }

    BIND(&if_resultisnotprimitive);
    {
      // Somehow the @@toPrimitive method on {input} didn't yield a primitive.
      ThrowTypeError(context, MessageTemplate::kCannotConvertToPrimitive);
    }
  }

  // Convert using the OrdinaryToPrimitive algorithm instead.
  BIND(&ordinary_to_primitive);
  {
    Callable callable = CodeFactory::OrdinaryToPrimitive(
        isolate(), (hint == ToPrimitiveHint::kString)
                       ? OrdinaryToPrimitiveHint::kString
                       : OrdinaryToPrimitiveHint::kNumber);
    TailCallStub(callable, context, input);
  }
}

TF_BUILTIN(NonPrimitiveToPrimitive_Default, ConversionBuiltinsAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Generate_NonPrimitiveToPrimitive(context, input, ToPrimitiveHint::kDefault);
}

TF_BUILTIN(NonPrimitiveToPrimitive_Number, ConversionBuiltinsAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Generate_NonPrimitiveToPrimitive(context, input, ToPrimitiveHint::kNumber);
}

TF_BUILTIN(NonPrimitiveToPrimitive_String, ConversionBuiltinsAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Generate_NonPrimitiveToPrimitive(context, input, ToPrimitiveHint::kString);
}

TF_BUILTIN(StringToNumber, CodeStubAssembler) {
  TNode<String> input = CAST(Parameter(Descriptor::kArgument));

  Return(StringToNumber(input));
}

TF_BUILTIN(ToName, CodeStubAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Return(ToName(context, input));
}

TF_BUILTIN(NonNumberToNumber, CodeStubAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Return(NonNumberToNumber(context, input));
}

TF_BUILTIN(NonNumberToNumeric, CodeStubAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Return(NonNumberToNumeric(context, input));
}

TF_BUILTIN(ToNumeric, CodeStubAssembler) {
  TNode<Context> context = CAST(Parameter(Descriptor::kContext));
  TNode<Object> input = CAST(Parameter(Descriptor::kArgument));

  Return(Select<Numeric>(
      IsNumber(input), [=] { return CAST(input); },
      [=] { return NonNumberToNumeric(context, CAST(input)); }));
}

// ES6 section 7.1.3 ToNumber ( argument )
TF_BUILTIN(ToNumber, CodeStubAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Return(ToNumber(context, input));
}

// ES section #sec-tostring-applied-to-the-number-type
TF_BUILTIN(NumberToString, CodeStubAssembler) {
  TNode<Number> input = CAST(Parameter(Descriptor::kArgument));

  Return(NumberToString(input));
}

// ES section #sec-tostring
TF_BUILTIN(ToString, CodeStubAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Return(ToString(context, input));
}

// 7.1.1.1 OrdinaryToPrimitive ( O, hint )
void ConversionBuiltinsAssembler::Generate_OrdinaryToPrimitive(
    Node* context, Node* input, OrdinaryToPrimitiveHint hint) {
  VARIABLE(var_result, MachineRepresentation::kTagged);
  Label return_result(this, &var_result);

  Handle<String> method_names[2];
  switch (hint) {
    case OrdinaryToPrimitiveHint::kNumber:
      method_names[0] = factory()->valueOf_string();
      method_names[1] = factory()->toString_string();
      break;
    case OrdinaryToPrimitiveHint::kString:
      method_names[0] = factory()->toString_string();
      method_names[1] = factory()->valueOf_string();
      break;
  }
  for (Handle<String> name : method_names) {
    // Lookup the {name} on the {input}.
    Node* method = GetProperty(context, input, name);

    // Check if the {method} is callable.
    Label if_methodiscallable(this),
        if_methodisnotcallable(this, Label::kDeferred);
    GotoIf(TaggedIsSmi(method), &if_methodisnotcallable);
    Node* method_map = LoadMap(method);
    Branch(IsCallableMap(method_map), &if_methodiscallable,
           &if_methodisnotcallable);

    BIND(&if_methodiscallable);
    {
      // Call the {method} on the {input}.
      Callable callable = CodeFactory::Call(
          isolate(), ConvertReceiverMode::kNotNullOrUndefined);
      Node* result = CallJS(callable, context, method, input);
      var_result.Bind(result);

      // Return the {result} if it is a primitive.
      GotoIf(TaggedIsSmi(result), &return_result);
      Node* result_instance_type = LoadInstanceType(result);
      STATIC_ASSERT(FIRST_PRIMITIVE_TYPE == FIRST_TYPE);
      GotoIf(Int32LessThanOrEqual(result_instance_type,
                                  Int32Constant(LAST_PRIMITIVE_TYPE)),
             &return_result);
    }

    // Just continue with the next {name} if the {method} is not callable.
    Goto(&if_methodisnotcallable);
    BIND(&if_methodisnotcallable);
  }

  ThrowTypeError(context, MessageTemplate::kCannotConvertToPrimitive);

  BIND(&return_result);
  Return(var_result.value());
}

TF_BUILTIN(OrdinaryToPrimitive_Number, ConversionBuiltinsAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);
  Generate_OrdinaryToPrimitive(context, input,
                               OrdinaryToPrimitiveHint::kNumber);
}

TF_BUILTIN(OrdinaryToPrimitive_String, ConversionBuiltinsAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);
  Generate_OrdinaryToPrimitive(context, input,
                               OrdinaryToPrimitiveHint::kString);
}

// ES6 section 7.1.2 ToBoolean ( argument )
TF_BUILTIN(ToBoolean, CodeStubAssembler) {
  Node* value = Parameter(Descriptor::kArgument);

  Label return_true(this), return_false(this);
  BranchIfToBooleanIsTrue(value, &return_true, &return_false);

  BIND(&return_true);
  Return(TrueConstant());

  BIND(&return_false);
  Return(FalseConstant());
}

// ES6 section 7.1.2 ToBoolean ( argument )
// Requires parameter on stack so that it can be used as a continuation from a
// LAZY deopt.
TF_BUILTIN(ToBooleanLazyDeoptContinuation, CodeStubAssembler) {
  Node* value = Parameter(Descriptor::kArgument);

  Label return_true(this), return_false(this);
  BranchIfToBooleanIsTrue(value, &return_true, &return_false);

  BIND(&return_true);
  Return(TrueConstant());

  BIND(&return_false);
  Return(FalseConstant());
}

TF_BUILTIN(ToLength, CodeStubAssembler) {
  Node* context = Parameter(Descriptor::kContext);

  // We might need to loop once for ToNumber conversion.
  VARIABLE(var_len, MachineRepresentation::kTagged,
           Parameter(Descriptor::kArgument));
  Label loop(this, &var_len);
  Goto(&loop);
  BIND(&loop);
  {
    // Shared entry points.
    Label return_len(this), return_two53minus1(this, Label::kDeferred),
        return_zero(this, Label::kDeferred);

    // Load the current {len} value.
    Node* len = var_len.value();

    // Check if {len} is a positive Smi.
    GotoIf(TaggedIsPositiveSmi(len), &return_len);

    // Check if {len} is a (negative) Smi.
    GotoIf(TaggedIsSmi(len), &return_zero);

    // Check if {len} is a HeapNumber.
    Label if_lenisheapnumber(this),
        if_lenisnotheapnumber(this, Label::kDeferred);
    Branch(IsHeapNumber(len), &if_lenisheapnumber, &if_lenisnotheapnumber);

    BIND(&if_lenisheapnumber);
    {
      // Load the floating-point value of {len}.
      Node* len_value = LoadHeapNumberValue(len);

      // Check if {len} is not greater than zero.
      GotoIfNot(Float64GreaterThan(len_value, Float64Constant(0.0)),
                &return_zero);

      // Check if {len} is greater than or equal to 2^53-1.
      GotoIf(Float64GreaterThanOrEqual(len_value,
                                       Float64Constant(kMaxSafeInteger)),
             &return_two53minus1);

      // Round the {len} towards -Infinity.
      Node* value = Float64Floor(len_value);
      Node* result = ChangeFloat64ToTagged(value);
      Return(result);
    }

    BIND(&if_lenisnotheapnumber);
    {
      // Need to convert {len} to a Number first.
      var_len.Bind(CallBuiltin(Builtins::kNonNumberToNumber, context, len));
      Goto(&loop);
    }

    BIND(&return_len);
    Return(var_len.value());

    BIND(&return_two53minus1);
    Return(NumberConstant(kMaxSafeInteger));

    BIND(&return_zero);
    Return(SmiConstant(0));
  }
}

TF_BUILTIN(ToInteger, CodeStubAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Return(ToInteger(context, input, kNoTruncation));
}

TF_BUILTIN(ToInteger_TruncateMinusZero, CodeStubAssembler) {
  Node* context = Parameter(Descriptor::kContext);
  Node* input = Parameter(Descriptor::kArgument);

  Return(ToInteger(context, input, kTruncateMinusZero));
}

// ES6 section 7.1.13 ToObject (argument)
TF_BUILTIN(ToObject, CodeStubAssembler) {
  Label if_smi(this, Label::kDeferred), if_jsreceiver(this),
      if_noconstructor(this, Label::kDeferred), if_wrapjsvalue(this);

  Node* context = Parameter(Descriptor::kContext);
  Node* object = Parameter(Descriptor::kArgument);

  VARIABLE(constructor_function_index_var,
           MachineType::PointerRepresentation());

  GotoIf(TaggedIsSmi(object), &if_smi);

  Node* map = LoadMap(object);
  Node* instance_type = LoadMapInstanceType(map);
  GotoIf(IsJSReceiverInstanceType(instance_type), &if_jsreceiver);

  Node* constructor_function_index = LoadMapConstructorFunctionIndex(map);
  GotoIf(WordEqual(constructor_function_index,
                   IntPtrConstant(Map::kNoConstructorFunctionIndex)),
         &if_noconstructor);
  constructor_function_index_var.Bind(constructor_function_index);
  Goto(&if_wrapjsvalue);

  BIND(&if_smi);
  constructor_function_index_var.Bind(
      IntPtrConstant(Context::NUMBER_FUNCTION_INDEX));
  Goto(&if_wrapjsvalue);

  BIND(&if_wrapjsvalue);
  Node* native_context = LoadNativeContext(context);
  Node* constructor = LoadFixedArrayElement(
      native_context, constructor_function_index_var.value());
  Node* initial_map =
      LoadObjectField(constructor, JSFunction::kPrototypeOrInitialMapOffset);
  Node* js_value = Allocate(JSValue::kSize);
  StoreMapNoWriteBarrier(js_value, initial_map);
  StoreObjectFieldRoot(js_value, JSValue::kPropertiesOrHashOffset,
                       Heap::kEmptyFixedArrayRootIndex);
  StoreObjectFieldRoot(js_value, JSObject::kElementsOffset,
                       Heap::kEmptyFixedArrayRootIndex);
  StoreObjectField(js_value, JSValue::kValueOffset, object);
  Return(js_value);

  BIND(&if_noconstructor);
  ThrowTypeError(context, MessageTemplate::kUndefinedOrNullToObject,
                 "ToObject");

  BIND(&if_jsreceiver);
  Return(object);
}

// ES6 section 12.5.5 typeof operator
TF_BUILTIN(Typeof, CodeStubAssembler) {
  Node* object = Parameter(TypeofDescriptor::kObject);

  Return(Typeof(object));
}

}  // namespace internal
}  // namespace v8


text:
class SessionsController < ApplicationController
  def new
  end

  def create
    user = login(params[:email], params[:password], true)
    if user
      redirect_back_or_to root_path, notice: "Logged in!"
    else
      redirect_to root_path, alert: "Email or password was invalid."
    end
  end

  def destroy
    logout
    redirect_to root_path, notice: "Logged out!"
  end
end


text:
<assembly>
    <id>dist</id>
    <formats>
        <format>jar</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <dependencySets>
        <dependencySet>
            <unpack>false</unpack>
            <outputDirectory>/lib</outputDirectory>
            <includes>
                <include>org.glassfish:javax.json</include>
                <include>com.smartbear:swagger4j</include>
                <include>com.wordnik:swagger-core</include>
                <include>com.wordnik:swagger-models</include>
                <include>org.apache.http*</include>
            </includes>
        </dependencySet>
        <dependencySet>
            <unpack>true</unpack>
            <outputDirectory>/</outputDirectory>
            <includes>
                <include>org.wso2:apiManager-plugin</include>
                <include>com.smartbear:soapui-swagger-plugin</include>
            </includes>
            <unpackOptions>
                <excludes>
                    <exclude>com\smartbear\swagger\PluginConfig.class</exclude>
                    <exclude>com\smartbear\swagger\*Action*.class</exclude>
                </excludes>
            </unpackOptions>
        </dependencySet>
    </dependencySets>
    <fileSets>
        <fileSet>
            <directory>${project.basedir}</directory>
            <outputDirectory>/META-INF</outputDirectory>
            <includes>
                <include>LICENSE*</include>
            </includes>
        </fileSet>
        <fileSet>
            <directory>${project.basedir}/src/assembly</directory>
            <outputDirectory>/META-INF</outputDirectory>
            <includes>
                <include>readme.txt</include>
            </includes>
        </fileSet>
    </fileSets>
</assembly>


text:
package org.seasar.doma.internal.apt.meta.query;

import java.util.List;
import javax.lang.model.element.ExecutableElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement;
import org.seasar.doma.internal.apt.AptException;
import org.seasar.doma.internal.apt.Context;
import org.seasar.doma.internal.apt.annot.ModifyAnnot;
import org.seasar.doma.internal.apt.annot.SqlAnnot;
import org.seasar.doma.internal.apt.cttype.CtType;
import org.seasar.doma.internal.apt.cttype.EntityCtType;
import org.seasar.doma.internal.apt.cttype.SimpleCtTypeVisitor;
import org.seasar.doma.message.Message;

public class AutoModifyQueryMetaFactory extends AbstractQueryMetaFactory<AutoModifyQueryMeta> {

  public AutoModifyQueryMetaFactory(
      Context ctx, TypeElement daoElement, ExecutableElement methodElement) {
    super(ctx, daoElement, methodElement);
  }

  @Override
  public QueryMeta createQueryMeta() {
    AutoModifyQueryMeta queryMeta = createAutoModifyQueryMeta();
    if (queryMeta == null) {
      return null;
    }
    doTypeParameters(queryMeta);
    doParameters(queryMeta);
    doReturnType(queryMeta);
    doThrowTypes(queryMeta);
    return queryMeta;
  }

  private AutoModifyQueryMeta createAutoModifyQueryMeta() {
    SqlAnnot sqlAnnot = ctx.getAnnotations().newSqlAnnot(methodElement);
    if (sqlAnnot != null) {
      return null;
    }
    AutoModifyQueryMeta queryMeta = new AutoModifyQueryMeta(daoElement, methodElement);
    ModifyAnnot modifyAnnot = ctx.getAnnotations().newInsertAnnot(methodElement);
    if (modifyAnnot != null && !modifyAnnot.getSqlFileValue()) {
      queryMeta.setModifyAnnot(modifyAnnot);
      queryMeta.setQueryKind(QueryKind.AUTO_INSERT);
      return queryMeta;
    }
    modifyAnnot = ctx.getAnnotations().newUpdateAnnot(methodElement);
    if (modifyAnnot != null && !modifyAnnot.getSqlFileValue()) {
      queryMeta.setModifyAnnot(modifyAnnot);
      queryMeta.setQueryKind(QueryKind.AUTO_UPDATE);
      return queryMeta;
    }
    modifyAnnot = ctx.getAnnotations().newDeleteAnnot(methodElement);
    if (modifyAnnot != null && !modifyAnnot.getSqlFileValue()) {
      queryMeta.setModifyAnnot(modifyAnnot);
      queryMeta.setQueryKind(QueryKind.AUTO_DELETE);
      return queryMeta;
    }
    return null;
  }

  @Override
  protected void doReturnType(AutoModifyQueryMeta queryMeta) {
    QueryReturnMeta returnMeta = createReturnMeta(queryMeta);
    EntityCtType entityCtType = queryMeta.getEntityCtType();
    if (entityCtType != null && entityCtType.isImmutable()) {
      if (!returnMeta.isResult(entityCtType)) {
        throw new AptException(Message.DOMA4222, methodElement, new Object[] {});
      }
    } else {
      if (!returnMeta.isPrimitiveInt()) {
        throw new AptException(Message.DOMA4001, methodElement, new Object[] {});
      }
    }
    queryMeta.setReturnMeta(returnMeta);
  }

  @Override
  protected void doParameters(AutoModifyQueryMeta queryMeta) {
    List<? extends VariableElement> parameters = methodElement.getParameters();
    int size = parameters.size();
    if (size != 1) {
      throw new AptException(Message.DOMA4002, methodElement, new Object[] {});
    }
    final QueryParameterMeta parameterMeta = createParameterMeta(parameters.get(0));
    EntityCtType entityCtType =
        parameterMeta
            .getCtType()
            .accept(
                new SimpleCtTypeVisitor<EntityCtType, Void, RuntimeException>() {

                  @Override
                  protected EntityCtType defaultAction(CtType type, Void p)
                      throws RuntimeException {
                    throw new AptException(
                        Message.DOMA4003, parameterMeta.getElement(), new Object[] {});
                  }

                  @Override
                  public EntityCtType visitEntityCtType(EntityCtType ctType, Void p)
                      throws RuntimeException {
                    return ctType;
                  }
                },
                null);
    queryMeta.setEntityCtType(entityCtType);
    queryMeta.setEntityParameterName(parameterMeta.getName());
    queryMeta.addParameterMeta(parameterMeta);
    if (parameterMeta.isBindable()) {
      queryMeta.addBindableParameterCtType(parameterMeta.getName(), parameterMeta.getCtType());
    }
    ModifyAnnot modifyAnnot = queryMeta.getModifyAnnot();
    validateEntityPropertyNames(
        entityCtType.getType(),
        modifyAnnot.getAnnotationMirror(),
        modifyAnnot.getInclude(),
        modifyAnnot.getExclude());
  }
}


text:
<?php

namespace EBT\GeoZipLocation\Translator\BR\Location;

use EBT\GeoZipLocation\Core\Location\Location;
use EBT\GeoZipLocation\Core\Repository\LocationRepositoryInterface;
use EBT\GeoZipLocation\Translator\BR\Repository\AreaRepository;

class Area extends Location
{
    const LOCATION_TYPE = 'area';

    /**
     * Returns Location's Repository
     *
     * @return LocationRepositoryInterface
     */
    public function getRepository()
    {
        return $this->repo;
    }

    /**
     * @inheritdoc
     */
    public function getType()
    {
        return self::LOCATION_TYPE;
    }
}


text:
package org.shipkit.internal.notes.model;

import org.json.simple.Jsonable;

import java.io.Serializable;
import java.util.Collection;

/**
 * A set of contributions
 */
public interface ContributionSet extends Jsonable, Serializable {

    /**
     * All commits in given contribution set, spanning all authors
     */
    Collection<Commit> getAllCommits();

    /**
     * All tickets referenced in commit messages
     */
    Collection<String> getAllTickets();

    /**
     * All contributions in the set.
     */
    Collection<Contribution> getContributions();

    /**
     * All unique authors of this set of contributions.
     * Basically, it's the size of {@link #getContributions()}.
     */
    int getAuthorCount();
}


text:
package kernel

import (
	"errors"
)

type Utsname struct {
	Release [65]byte
}

func uname() (*Utsname, error) {
	return nil, errors.New("Kernel version detection is available only on linux")
}


text:
Developers are notorious for leaving statements like FIXME's, TODO's, Code Broken, Hack, etc... inside the source code.  Review the source code for any comments denoting  passwords, backdoors, or something doesn't work right.  Below is an example of a forms based authentication form. Look for clues to help you log in.

        <form class="form" role="form" method="POST">

                User Name:
                <input type="text" name="username" placeholder="User Name" id="username" class="form-control" required>

                Password
                <input type="password" name="pass" placeholder="Password" id="password" class="form-control" required>

                <input type="submit" name="submit" value="Submit" class="btn btn-default">

        </form>


text:
<?php

namespace Modules\Formbuilder\Database\Seeders;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Seeder;

class FormbuilderDatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run()
    {
        Model::unguard();

        // $this->call("OthersTableSeeder");
    }
}


text:
OilTypeAlias :: OilTypeAlias ( const SourceRef & Ref, const std :: u32string & AliasName, OilTypeRef * AliasedType, OilTemplateDefinition * TemplateDefinition, bool Builtin ):
	AliasedType ( AliasedType ),
	TemplateDefinition ( TemplateDefinition ),
	AliasName ( AliasName ),
	Builtin ( Builtin ),
	Ref ( Ref )
{
}

OilTypeAlias :: ~OilTypeAlias ()
{

	delete AliasedType;

	if ( TemplateDefinition != NULL )
		delete TemplateDefinition;

}

const std :: u32string & OilTypeAlias :: GetName () const
{

	return AliasName;

}

const OilTypeRef * OilTypeAlias :: GetAliasedType () const
{

	return AliasedType;

}

OilTypeRef * OilTypeAlias :: GetAliasedType ()
{

	return AliasedType;

}

bool OilTypeAlias :: IsTemplated () const
{

	return TemplateDefinition != NULL;

}

const OilTemplateDefinition * OilTypeAlias :: GetTemplateDefinition () const
{

	return TemplateDefinition;

}

OilTemplateDefinition * OilTypeAlias :: GetTemplateDefinition ()
{

	return TemplateDefinition;

}

bool OilTypeAlias :: IsBuiltin () const
{

	return Builtin;

}

const SourceRef & OilTypeAlias :: GetSourceRef ()
{

	return Ref;

}


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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>quarkus-resteasy-reactive-servlet-parent</artifactId>
        <groupId>io.quarkus</groupId>
        <version>999-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>quarkus-resteasy-reactive-servlet</artifactId>
    <name>Quarkus - RESTEasy Reactive Servlet - Runtime</name>
    <description>Servlet support for Quarkus RESTEasy Reactive</description>

    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-resteasy-reactive</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-undertow</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-extension-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>io.quarkus</groupId>
                            <artifactId>quarkus-extension-processor</artifactId>
                            <version>${project.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>


text:
<?php

namespace EBC\PublisherClient\Campaign;

use EBT\EBDate\EBDateTime;

/**
 * Schedule
 */
class Schedule
{
    /**
     * @var EBDateTime
     */
    protected $startDate;

    /**
     * @var EBDateTime
     */
    protected $endDate;

    /**
     * @return EBDateTime
     */
    public function getStartDate()
    {
        return $this->startDate;
    }

    /**
     * @return EBDateTime
     */
    public function getEndDate()
    {
        return $this->endDate;
    }
}


text:
{% extends "base-middle-page.html" %}

{% block title %}
    Password Reset Not Valid
{% endblock %}

{% block body %}

Password Reset Not Valid

The URL you used to reset your password is invalid or has expired. You might try resetting your
        password again if it has been a while since you requested a password recovery email.

{% endblock %}


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

namespace AzureRoadshow.VideoStore.Models.EF
{
    public partial class ActorToVideo
    {
        public int RelationId { get; set; }
        public int ActorId { get; set; }
        public int VideoId { get; set; }

        public virtual Actor Actor { get; set; }
        public virtual Video Video { get; set; }
    }
}


text:
package org.apache.spark.deploy.worker

import java.io._
import java.nio.charset.StandardCharsets

import scala.collection.JavaConverters._

import com.google.common.io.Files

import org.apache.spark.{SecurityManager, SparkConf}
import org.apache.spark.deploy.{ApplicationDescription, ExecutorState}
import org.apache.spark.deploy.DeployMessages.ExecutorStateChanged
import org.apache.spark.deploy.StandaloneResourceUtils.prepareResourcesFile
import org.apache.spark.internal.Logging
import org.apache.spark.internal.config.SPARK_EXECUTOR_PREFIX
import org.apache.spark.internal.config.UI._
import org.apache.spark.resource.ResourceInformation
import org.apache.spark.rpc.RpcEndpointRef
import org.apache.spark.util.{ShutdownHookManager, Utils}
import org.apache.spark.util.logging.FileAppender

/**
 * Manages the execution of one executor process.
 * This is currently only used in standalone mode.
 */
private[deploy] class ExecutorRunner(
    val appId: String,
    val execId: Int,
    val appDesc: ApplicationDescription,
    val cores: Int,
    val memory: Int,
    val worker: RpcEndpointRef,
    val workerId: String,
    val webUiScheme: String,
    val host: String,
    val webUiPort: Int,
    val publicAddress: String,
    val sparkHome: File,
    val executorDir: File,
    val workerUrl: String,
    conf: SparkConf,
    val appLocalDirs: Seq[String],
    @volatile var state: ExecutorState.Value,
    val rpId: Int,
    val resources: Map[String, ResourceInformation] = Map.empty)
  extends Logging {

  private val fullId = appId + "/" + execId
  private var workerThread: Thread = null
  private var process: Process = null
  private var stdoutAppender: FileAppender = null
  private var stderrAppender: FileAppender = null

  // Timeout to wait for when trying to terminate an executor.
  private val EXECUTOR_TERMINATE_TIMEOUT_MS = 10 * 1000

  // NOTE: This is now redundant with the automated shut-down enforced by the Executor. It might
  // make sense to remove this in the future.
  private var shutdownHook: AnyRef = null

  private[worker] def start(): Unit = {
    workerThread = new Thread("ExecutorRunner for " + fullId) {
      override def run(): Unit = { fetchAndRunExecutor() }
    }
    workerThread.start()
    // Shutdown hook that kills actors on shutdown.
    shutdownHook = ShutdownHookManager.addShutdownHook { () =>
      // It's possible that we arrive here before calling `fetchAndRunExecutor`, then `state` will
      // be `ExecutorState.LAUNCHING`. In this case, we should set `state` to `FAILED`.
      if (state == ExecutorState.LAUNCHING || state == ExecutorState.RUNNING) {
        state = ExecutorState.FAILED
      }
      killProcess(Some("Worker shutting down")) }
  }

  /**
   * Kill executor process, wait for exit and notify worker to update resource status.
   *
   * @param message the exception message which caused the executor's death
   */
  private def killProcess(message: Option[String]): Unit = {
    var exitCode: Option[Int] = None
    if (process != null) {
      logInfo("Killing process!")
      if (stdoutAppender != null) {
        stdoutAppender.stop()
      }
      if (stderrAppender != null) {
        stderrAppender.stop()
      }
      exitCode = Utils.terminateProcess(process, EXECUTOR_TERMINATE_TIMEOUT_MS)
      if (exitCode.isEmpty) {
        logWarning("Failed to terminate process: " + process +
          ". This process will likely be orphaned.")
      }
    }
    try {
      worker.send(ExecutorStateChanged(appId, execId, state, message, exitCode))
    } catch {
      case e: IllegalStateException => logWarning(e.getMessage(), e)
    }
  }

  /** Stop this executor runner, including killing the process it launched */
  private[worker] def kill(): Unit = {
    if (workerThread != null) {
      // the workerThread will kill the child process when interrupted
      workerThread.interrupt()
      workerThread = null
      state = ExecutorState.KILLED
      try {
        ShutdownHookManager.removeShutdownHook(shutdownHook)
      } catch {
        case e: IllegalStateException => None
      }
    }
  }

  /** Replace variables such as {{EXECUTOR_ID}} and {{CORES}} in a command argument passed to us */
  private[worker] def substituteVariables(argument: String): String = argument match {
    case "{{WORKER_URL}}" => workerUrl
    case "{{EXECUTOR_ID}}" => execId.toString
    case "{{HOSTNAME}}" => host
    case "{{CORES}}" => cores.toString
    case "{{APP_ID}}" => appId
    case "{{RESOURCE_PROFILE_ID}}" => rpId.toString
    case other => other
  }

  /**
   * Download and run the executor described in our ApplicationDescription
   */
  private def fetchAndRunExecutor(): Unit = {
    try {
      val resourceFileOpt = prepareResourcesFile(SPARK_EXECUTOR_PREFIX, resources, executorDir)
      // Launch the process
      val arguments = appDesc.command.arguments ++ resourceFileOpt.map(f =>
        Seq("--resourcesFile", f.getAbsolutePath)).getOrElse(Seq.empty)
      val subsOpts = appDesc.command.javaOpts.map {
        Utils.substituteAppNExecIds(_, appId, execId.toString)
      }
      val subsCommand = appDesc.command.copy(arguments = arguments, javaOpts = subsOpts)
      val builder = CommandUtils.buildProcessBuilder(subsCommand, new SecurityManager(conf),
        memory, sparkHome.getAbsolutePath, substituteVariables)
      val command = builder.command()
      val redactedCommand = Utils.redactCommandLineArgs(conf, command.asScala.toSeq)
        .mkString("\"", "\" \"", "\"")
      logInfo(s"Launch command: $redactedCommand")

      builder.directory(executorDir)
      builder.environment.put("SPARK_EXECUTOR_DIRS", appLocalDirs.mkString(File.pathSeparator))
      // In case we are running this from within the Spark Shell, avoid creating a "scala"
      // parent process for the executor command
      builder.environment.put("SPARK_LAUNCH_WITH_SCALA", "0")

      // Add webUI log urls
      val baseUrl =
        if (conf.get(UI_REVERSE_PROXY)) {
          conf.get(UI_REVERSE_PROXY_URL.key, "").stripSuffix("/") +
            s"/proxy/$workerId/logPage/?appId=$appId&executorId=$execId&logType="
        } else {
          s"$webUiScheme$publicAddress:$webUiPort/logPage/?appId=$appId&executorId=$execId&logType="
        }
      builder.environment.put("SPARK_LOG_URL_STDERR", s"${baseUrl}stderr")
      builder.environment.put("SPARK_LOG_URL_STDOUT", s"${baseUrl}stdout")

      process = builder.start()
      val header = "Spark Executor Command: %s\n%s\n\n".format(
        redactedCommand, "=" * 40)

      // Redirect its stdout and stderr to files
      val stdout = new File(executorDir, "stdout")
      stdoutAppender = FileAppender(process.getInputStream, stdout, conf, true)

      val stderr = new File(executorDir, "stderr")
      Files.write(header, stderr, StandardCharsets.UTF_8)
      stderrAppender = FileAppender(process.getErrorStream, stderr, conf, true)

      state = ExecutorState.RUNNING
      worker.send(ExecutorStateChanged(appId, execId, state, None, None))
      // Wait for it to exit; executor may exit with code 0 (when driver instructs it to shutdown)
      // or with nonzero exit code
      val exitCode = process.waitFor()
      state = ExecutorState.EXITED
      val message = "Command exited with code " + exitCode
      worker.send(ExecutorStateChanged(appId, execId, state, Some(message), Some(exitCode)))
    } catch {
      case interrupted: InterruptedException =>
        logInfo("Runner thread for executor " + fullId + " interrupted")
        state = ExecutorState.KILLED
        killProcess(None)
      case e: Exception =>
        logError("Error running executor", e)
        state = ExecutorState.FAILED
        killProcess(Some(e.toString))
    }
  }
}


text:
package com.github.gwtd3.api.scales;

import com.github.gwtd3.api.arrays.Array;
import com.github.gwtd3.api.core.Formatter;

/**
 * Linear scales are the most common scale, and a good default choice to map a
 * continuous input domain to a continuous output range.
 *

 * The mapping is linear in that the output range value y can be expressed as a
 * linear function of the input domain value x: y = mx + b.
 *

 * The input domain is typically a dimension of the data that you want to
 * visualize, such as the height of students (measured in meters) in a sample
 * population.
 *

 * The output range is typically a dimension of the desired output
 * visualization, such as the height of bars (measured in pixels) in a
 * histogram.
 *

 * The default linear scale has a default domain of [0,1] and the default range
 * [0,1]. Thus, the default linear scale is equivalent to the identity function
 * for numbers; for example linear(0.5) returns 0.5.
 *

 * Although linear scales typically have just two numeric values in their
 * domain, you can specify more than two values for a polylinear scale.
 *

 * In this case, there must be an equivalent number of values in the output
 * range. A polylinear scale represents multiple piecewise linear scales that
 * divide a continuous domain and range. This is particularly useful for
 * defining diverging quantitative scales. For example, to interpolate between
 * white and red for negative values, and white and green for positive values,
 * say:
 *
 *

 * {@code
 * Scale color = d3.scale.linear().domain([-1, 0, 1]).range(["red","white", "green"]);
 * }
 *

 *
 * The resulting value of color(-.5) is rgb(255, 128, 128), and the value of
 * color(.5) is rgb(128, 192, 128).
 *

 * Internally, polylinear scales perform a binary search for the output
 * interpolator corresponding to the given domain value. By repeating values in
 * both the domain and range, you can also force a chunk of the input domain to
 * map to a constant in the output range.
 *

 * The output range must contain two or more values, to match the cardinality of
 * the input domain, otherwise the longer of the two is truncated to match the
 * other.
 *

 * The elements in the output range array need not be numbers; any value that is
 * supported by the underlying interpolator will work.
 *

 * However, numeric ranges are required for the {@link #invert(double)}
 * operator.
 *

 *
 * @author Anthony Schiochet
 *
 */
public class LinearScale extends ContinuousQuantitativeScale<LinearScale> {

	protected LinearScale() {
	}

	// =========== ticks ==========

	/**
	 * Returns approximately count representative values from the scale's input
	 * domain.
	 *

	 * The returned tick values are uniformly spaced, have human-readable values
	 * (such as multiples of powers of 10), and are guaranteed to be within the
	 * extent of the input domain.
	 *

	 * Ticks are often used to display reference lines, or tick marks, in
	 * conjunction with the visualized data. The specified count is only a hint;
	 * the scale may return more or fewer values depending on the input domain.
	 *

	 *
	 * @return
	 */
	public native final <T> Array<T> ticks(int count)/*-{
		return this.ticks(count);
	}-*/;

	/**
	 * Alias for {@link #ticks(int) ticks(10)}.
	 *
	 * @return the array of reference ticks
	 */
	public native final <T> Array<T> ticks()/*-{
		return this.ticks(count);
	}-*/;

	// =========== tickFormat ==========

	/**
	 * Returns a number format function suitable for displaying a tick value.
	 *

	 * The specified count should have the same value as the count that is used
	 * to generate the tick values you want to display.
	 *

	 * You don't have to use the scale's built-in tick format, but it
	 * automatically computes the appropriate precision based on the fixed
	 * interval between tick values.
	 *

	 *
	 * @param the
	 *            number of ticks to take into account to create the
	 *            {@link Formatter}.
	 * @return a number format
	 */
	public native final Formatter tickFormat(int count)/*-{
		return this.tickFormat(count);
	}-*/;

	/**
	 * Returns a number format function suitable for displaying a tick value.
	 *

	 * This is the same as {@link #tickFormat(int)}, except that the format
	 * argument allows a format specifier to be specified.
	 *

	 * If the format specifier doesn't have a defined precision, the precision
	 * will be set automatically by the scale, returning the appropriate format.
	 *

	 * This provides a convenient, declarative way of specifying a format whose
	 * precision will be automatically set by the scale.
	 *

	 *
	 * @param the
	 *            number of ticks to take into account to create the
	 *            {@link Formatter}.
	 * @param the
	 *            format specified, as documented in {@link Formatter}, to be
	 *            used as a basis of the Formatter.
	 * @return a number format
	 */
	public native final Formatter tickFormat(int count, String formatSpecifier)/*-{
		return this.tickFormat(count, formatSpecifier);
	}-*/;

	// =========== nice ==========

	/**
	 * Extends the domain so that it starts and ends on nice round values.
	 *

	 * This method typically modifies the scale's domain, and may only extend
	 * the bounds to the nearest round value.
	 *

	 * The precision of the round value is dependent on the extent of the domain
	 * dx according to the following formula: exp(round(log(*dx*)) - 1).
	 *

	 * Nicing is useful if the domain is computed from data and may be
	 * irregular.
	 *

	 * For example, for a domain of [0.20147987687960267, 0.996679553296417],
	 * the nice domain is [0.2, 1]. If the domain has more than two values,
	 * nicing the domain only affects the first and last value.
	 *

	 *
	 * @return the current scale
	 */
	public native final LinearScale nice()/*-{
		return this.nice();
	}-*/;

	/**
	 * Same as {@link #nice()} but with more control.
	 *

	 * The tick count argument allows greater control over the step size used to
	 * extend the bounds, guaranteeing that the ticks returned by
	 * {@link #ticks(int)} will exactly cover the domain.
	 *

	 *
	 * @return the current scale
	 */
	public native final LinearScale nice(int count)/*-{
		return this.nice(count);
	}-*/;

}


text:
package com.ayuget.redface.ui.event;

import com.ayuget.redface.data.api.model.Topic;

public class PageRefreshRequestEvent {
    private final Topic topic;

    public PageRefreshRequestEvent(Topic topic) {
        this.topic = topic;
    }

    public Topic getTopic() {
        return topic;
    }
}


text:
import pytest

from flex.constants import (
    INTEGER,
    NUMBER,
    STRING,
)
from flex.error_messages import MESSAGES
from flex.exceptions import ValidationError
from flex.loading.definitions.schema import schema_validator

from tests.utils import (
    assert_path_not_in_errors,
    assert_message_in_errors,
)

def test_min_and_max_length_are_not_required():
    """
    Ensure that neither the `minLength` nor the `maxLength` fields of a schema are
    required.
    """
    try:
        schema_validator({})
    except ValidationError as err:
        errors = err.detail
    else:
        errors = {}

    assert_path_not_in_errors('minLength', errors)
    assert_path_not_in_errors('maxLength', errors)

@pytest.mark.parametrize(
    'value',
    ('abc', [1, 2], None, {'a': 1}, True),
)
def test_min_length_for_invalid_types(value):
    with pytest.raises(ValidationError) as err:
        schema_validator({'minLength': value})

    assert_message_in_errors(
        MESSAGES['type']['invalid'],
        err.value.detail,
        'minLength.type',
    )

@pytest.mark.parametrize(
    'type_',
    (
        INTEGER,
        (INTEGER, NUMBER),
    ),
)
def test_type_validation_for_min_length_for_invalid_types(type_):
    with pytest.raises(ValidationError) as err:
        schema_validator({
            'minLength': 5,
            'type': type_,
        })

    assert_message_in_errors(
        MESSAGES['type']['invalid_type_for_min_length'],
        err.value.detail,
        'type',
    )

@pytest.mark.parametrize(
    'type_',
    (
        STRING,
        (INTEGER, STRING),
    ),
)
def test_type_validation_for_min_length_for_valid_types(type_):
    try:
        schema_validator({
            'minLength': 5,
            'type': type_,
        })
    except ValidationError as err:
        errors = err.detail
    else:
        errors = {}

    assert_path_not_in_errors(
        'type',
        errors,
    )

@pytest.mark.parametrize(
    'value',
    ('abc', [1, 2], None, {'a': 1}, True),
)
def test_max_length_for_invalid_types(value):
    with pytest.raises(ValidationError) as err:
        schema_validator({'maxLength': value})

    assert_message_in_errors(
        MESSAGES['type']['invalid'],
        err.value.detail,
        'maxLength.type',
    )

@pytest.mark.parametrize(
    'type_',
    (
        INTEGER,
        (INTEGER, NUMBER),
    ),
)
def test_type_validation_for_max_length_for_invalid_types(type_):
    with pytest.raises(ValidationError) as err:
        schema_validator({
            'maxLength': 5,
            'type': type_,
        })

    assert_message_in_errors(
        MESSAGES['type']['invalid_type_for_max_length'],
        err.value.detail,
        'type',
    )

@pytest.mark.parametrize(
    'type_',
    (
        STRING,
        (INTEGER, STRING),
    ),
)
def test_type_validation_for_max_length_for_valid_types(type_):
    try:
        schema_validator({
            'maxLength': 5,
            'type': type_,
        })
    except ValidationError as err:
        errors = err.detail
    else:
        errors = {}

    assert_path_not_in_errors(
        'type',
        errors,
    )

def test_max_length_must_be_greater_than_or_equal_to_min_length():
    with pytest.raises(ValidationError) as err:
        schema_validator({
            'maxLength': 8,
            'minLength': 9,
        })

    assert_message_in_errors(
        MESSAGES['max_length']['must_be_greater_than_min_length'],
        err.value.detail,
        'maxLength',
    )

def test_min_length_must_be_positive():
    with pytest.raises(ValidationError) as err:
        schema_validator({
            'minLength': -1,
        })

    assert_message_in_errors(
        MESSAGES['minimum']['invalid'],
        err.value.detail,
        'minLength.minimum',
    )

def test_max_length_must_be_greater_than_0():
    with pytest.raises(ValidationError) as err:
        schema_validator({
            'maxLength': 0,
        })

    assert_message_in_errors(
        MESSAGES['minimum']['invalid'],
        err.value.detail,
        'maxLength.minimum',
    )

def test_min_and_max_length_with_valid_values():
    try:
        schema_validator({
            'minLength': 8,
            'maxLength': 10,
        })
    except ValidationError as err:
        errors = err.detail
    else:
        errors = {}

    assert_path_not_in_errors('minLength', errors)
    assert_path_not_in_errors('maxLength', errors)


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Title</title>
    <title>Bootstrap Example</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

Insert data

            <form name="myForm" id="myForm">

                    Name:
                    <input type="text" class="form-control" id="name" placeholder="Enter name" name="name">

                    Surname:
                    <input type="text" class="form-control" id="surname" placeholder="Enter surname" name="surname">

                    Gender
                    <select id="gender" class="form-control" name="gender">
                        <option selected>Choose gender</option>
                        <option>male</option>
                        <option>woman</option>
                    </select>

                    Description:
                    <input type="text" class="form-control" id="description" placeholder="Enter desc" name="description">

                <button type="button" class="btn btn-primary" onclick="return sendJsonPerson();">Submit</button>
            </form>

Info Table

                    Name
                    Surname
                    Gender
                    Description


text:
package org.springframework.http.client;

import java.net.URI;
import java.util.Arrays;

import org.junit.Test;

import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.util.FileCopyUtils;

import static org.junit.Assert.*;

public class BufferingClientHttpRequestFactoryTests extends AbstractHttpRequestFactoryTestCase {

	@Override
	protected ClientHttpRequestFactory createRequestFactory() {
		return new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory());
	}

	@Test
	public void repeatableRead() throws Exception {
		ClientHttpRequest request = factory.createRequest(new URI(baseUrl + "/echo"), HttpMethod.PUT);
		assertEquals("Invalid HTTP method", HttpMethod.PUT, request.getMethod());
		String headerName = "MyHeader";
		String headerValue1 = "value1";
		request.getHeaders().add(headerName, headerValue1);
		String headerValue2 = "value2";
		request.getHeaders().add(headerName, headerValue2);
		byte[] body = "Hello World".getBytes("UTF-8");
		request.getHeaders().setContentLength(body.length);
		FileCopyUtils.copy(body, request.getBody());
		ClientHttpResponse response = request.execute();
		try {
			assertEquals("Invalid status code", HttpStatus.OK, response.getStatusCode());
			assertEquals("Invalid status code", HttpStatus.OK, response.getStatusCode());

			assertTrue("Header not found", response.getHeaders().containsKey(headerName));
			assertTrue("Header not found", response.getHeaders().containsKey(headerName));

			assertEquals("Header value not found", Arrays.asList(headerValue1, headerValue2),
					response.getHeaders().get(headerName));
			assertEquals("Header value not found", Arrays.asList(headerValue1, headerValue2),
					response.getHeaders().get(headerName));

			byte[] result = FileCopyUtils.copyToByteArray(response.getBody());
			assertTrue("Invalid body", Arrays.equals(body, result));
			FileCopyUtils.copyToByteArray(response.getBody());
			assertTrue("Invalid body", Arrays.equals(body, result));
		}
		finally {
			response.close();
		}
	}

}


text:
namespace os {

#ifdef WIN32
    #define OS_SEP _u("\\")
#else
    #define OS_SEP _u("/")
#endif

namespace path {

unicode join(const unicode& p1, const unicode& p2);
unicode join(const std::vector<unicode>& parts);

unicode abs_path(const unicode& p);
unicode norm_path(const unicode& path);
unicode norm_case(const unicode& path);

std::pair<unicode, unicode> split(const unicode &path);
bool exists(const unicode& path);
unicode dir_name(const unicode &path);
bool is_absolute(const unicode& path);
bool is_dir(const unicode& path);
bool is_file(const unicode& path);
bool is_link(const unicode& path);

unicode real_path(const unicode& path);

void hide_dir(const unicode& path);
std::pair<unicode, unicode> split_ext(const unicode& path);
unicode rel_path(const unicode& path, const unicode& start=unicode());
unicode expand_user(const unicode& path);
std::vector<unicode> list_dir(const unicode& path);

std::string read_file_contents(const unicode& path);
unicode exe_path();
unicode exe_dirname();
unicode get_cwd();
std::pair<unicode, unicode> split_ext(const unicode& path);

template<typename T>
std::vector<T> common_prefix(const std::vector<T>& lhs, const std::vector<T>& rhs) {
    if(lhs.empty() && rhs.empty()) {
        return std::vector<T>();
    }

    auto shorter = (lhs.size() < rhs.size()) ? lhs: rhs;
    auto longer = (lhs.size() > rhs.size()) ? lhs: rhs;

    for(int i = 0; i < shorter.size(); ++i) {
        if(shorter[i] != longer[i]) {
            return std::vector<T>(shorter.begin(), shorter.begin() + i);
        }
    }

    return shorter;
}

}
}

#endif


text:
package com.destiny1020.hranalyzer.domain;

import java.util.Arrays;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang3.StringUtils;

import com.destiny1020.hranalyzer.util.StandardizeString;
import com.destiny1020.hranalyzer.xls.HRElement;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Entity
@Table(name = "EMPLOYEE")
@NamedQueries({ @NamedQuery(name = Employee.FIND_EMPLOYEE_BY_EID, query = Employee.FIND_EMPLOYEE_BY_EID_SQL) })
//@JsonSerialize(using = EmployeeSerializer.class)
@JsonIgnoreProperties(value = { "handler", "hibernateLazyInitializer" })
public class Employee {

    public static final String FIND_EMPLOYEE_BY_EID = "findEmployeeByEid";
    public static final String FIND_EMPLOYEE_BY_EID_SQL = "select e from Employee e where e.eid = :eid";

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "PK", updatable = false)
    private Long id;

    @Column(name = "EID", nullable = false, unique = true)
    private String eid;

    @Column(name = "NAME", nullable = false)
    private String name;

    @Column(name = "NAME2", nullable = true)
    private String name2;

    @Column(name = "LAST_NAME", nullable = true)
    private String lastName;

    @Column(name = "FIRST_NAME", nullable = true)
    private String firstName;

    @Column(name = "LAST_NAME2", nullable = true)
    private String lastName2;

    @Column(name = "FIRST_NAME2", nullable = true)
    private String firstName2;

    @Column(name = "LID", nullable = true)
    private String lid;

    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    @JoinColumn(name = "REGISTER_TERM_ID")
    private Term beginTerm;

    @OneToOne(optional = true, fetch = FetchType.EAGER)
    @JoinColumn(name = "CURRENT_RECORD_ID", nullable = true)
    private Record currentRecord;

    @OneToMany(mappedBy = "employee")
    private List<Record> records;

    @Transient
    private String fullname;

    @Transient
    private String fullname2;

    public Employee() {

    }

    public Employee(HRElement element, Term beginTerm) {
        this.eid = element.getEid().trim();
        this.name = StandardizeString.standardize(element.getName());
        this.name2 = StandardizeString.standardize(element.getName2());
        this.lid = element.getLid().trim();

        this.beginTerm = beginTerm;

        // assign lastnames and firstnames
        String[] names = this.name.split(" ");
        System.out.println(Arrays.toString(names));
        if (names.length >= 2) {
            this.lastName = names[0];
            this.firstName = names[names.length - 1];
        }
        this.name = this.name.replaceAll(" +", "");

        if (StringUtils.isNotEmpty(this.name2)) {
            names = this.name2.split(" ");
            if (names.length >= 2) {
                this.lastName2 = names[0];
                this.firstName2 = names[names.length - 1];
            }
            this.name2 = this.name2.replaceAll(" +", "");
        }
    }

    public String getName() {
        return name;
    }

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

    public String getName2() {
        return name2;
    }

    public void setName2(String name2) {
        this.name2 = name2;
    }

//    @JsonIgnore
    public Record getCurrentRecord() {
        return currentRecord;
    }

    public void setCurrentRecord(Record currentRecord) {
        this.currentRecord = currentRecord;
    }

    @JsonIgnore
    public List<Record> getRecords() {
        return records;
    }

    public void setRecords(List<Record> records) {
        this.records = records;
    }

    public Long getId() {
        return id;
    }

    public String getEid() {
        return eid;
    }

    public String getLid() {
        return lid;
    }

    //    @JsonIgnore
    public Term getBeginTerm() {
        return beginTerm;
    }

    public void setBeginTerm(Term beginTerm) {
        this.beginTerm = beginTerm;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName2() {
        return lastName2;
    }

    public void setLastName2(String lastName2) {
        this.lastName2 = lastName2;
    }

    public String getFirstName2() {
        return firstName2;
    }

    public void setFirstName2(String firstName2) {
        this.firstName2 = firstName2;
    }

    public String getFullname() {
        if (StringUtils.isNotEmpty(lastName)
                && StringUtils.isNotEmpty(firstName)) {
            return lastName + " " + firstName;
        }

        return "";
    }

    public void setFullname(String fullname) {
        this.fullname = fullname;
    }

    public String getFullname2() {
        if (StringUtils.isNotEmpty(lastName2)
                && StringUtils.isNotEmpty(firstName2)) {
            return lastName2 + " " + firstName2;
        }

        return "";
    }

    public void setFullname2(String fullname2) {
        this.fullname2 = fullname2;
    }

}


text:
Profile Edit

{MESSAGES}

My Profile

	<form action="{URI_SAFE|htmlspecialchars}" method="post" id="edit_profile">

		<fieldset>

				{I18N_R_TITLE}
				<input class="text short" type="text" id="client-customer-title_before" name="client[customer][title_before]" value="{CLIENT.customer.title_before|htmlspecialchars}" title="Your title, ie Ms, Mr, Miss, Dr" />

				* {I18N_R_FIRST_NAME}
				<input class="required text" type="text" id="client-customer-first_name" name="client[customer][first_name]" value="{CLIENT.customer.first_name|htmlspecialchars}" title="Please type here your first name" />

				* {I18N_R_LAST_NAME}
				<input class="required text" type="text" id="client-customer-last_name" name="client[customer][last_name]" value="{CLIENT.customer.last_name|htmlspecialchars}" title="Your family name" />

				* {I18N_R_EMAIL}
				<input class="required text" type="text" id="client-customer-email" name="client[customer][email]" value="{CLIENT.customer.email}" title="Your valid email address" />

				{I18N_R_TELEPHONE}
				<input class="text" type="text" id="client-customer-telephone" name="client[customer][telephone]" value="{CLIENT.customer.telephone|htmlspecialchars}" title="Contact telephone number"/>

				{I18N_CHANGE_PASSWORD}
				<input class="text" type="text" id="client-customer-password_new" name="password_new" value="" title="Set new password" />

		</fieldset>

		<fieldset>

ID:

{CLIENT.customer.id}

Created:

{CLIENT.customer.created}

Modified:

{CLIENT.customer.modified}

		</fieldset>

			<button class="button save" type="submit" name="save" value="save" onclick="$(this).addClass('saving')" title="Click to save updated records">{I18N_SAVE}</button>

		<input type="hidden" name="csrf_token" value="{CSRF_TOKEN}" />
	</form>

You are authenticated using a different system, i.e. PostgreSQL, you cannot update your profile here.


text:
FROM alpine:3.2
MAINTAINER joff@joff.codes
ENTRYPOINT ["/sbin/smell-baron"]
CMD ["sh"]

ENV BARON_PACKAGES "git gcc make musl-dev"

# Build and install smell-baron, which we use as a simple init system
RUN \
  apk update && \
  apk add $BARON_PACKAGES && \
  git clone https://github.com/ohjames/smell-baron.git /tmp/smell-baron && \
  cd /tmp/smell-baron && \
  make release && \
  mv /tmp/smell-baron/smell-baron /sbin/ && \
  rm -rf /tmp/smell-baron && \
  apk del --purge -r $BARON_PACKAGES


text:
package com.baidu.openrasp.hook.server.catalina;

import com.baidu.openrasp.hook.server.ServerPreRequestHook;
import com.baidu.openrasp.tool.annotation.HookAnnotation;
import javassist.CannotCompileException;
import javassist.CtClass;
import javassist.NotFoundException;

/**
 * Created by zhuming01 on 6/23/17.
 * All rights reserved
 */
@HookAnnotation
public class CoyoteAdapterHook extends ServerPreRequestHook {

    public CoyoteAdapterHook() {
        couldIgnore = false;
    }

    /**
     * (none-javadoc)
     *
     * @see com.baidu.openrasp.hook.AbstractClassHook#isClassMatched(String)
     */
    @Override
    public boolean isClassMatched(String className) {
        return className.endsWith("apache/catalina/connector/CoyoteAdapter");
    }

    /**
     * (none-javadoc)
     *
     * @see com.baidu.openrasp.hook.server.ServerPreRequestHook#hookMethod(CtClass, String)
     */
    @Override
    protected void hookMethod(CtClass ctClass, String src) throws NotFoundException, CannotCompileException {
        insertBefore(ctClass, "service", null, src);
    }

}


text:
using System.IdentityModel.Selectors;
using System.ServiceModel.Security.Tokens;

namespace System.ServiceModel.Security
{
    internal class SupportingTokenProviderSpecification
    {
        private SecurityTokenParameters _tokenParameters;

        public SupportingTokenProviderSpecification(SecurityTokenProvider tokenProvider, SecurityTokenAttachmentMode attachmentMode, SecurityTokenParameters tokenParameters)
        {
            SecurityTokenAttachmentModeHelper.Validate(attachmentMode);
            TokenProvider = tokenProvider ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(tokenProvider));
            SecurityTokenAttachmentMode = attachmentMode;
            _tokenParameters = tokenParameters ?? throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(tokenParameters));
        }

        public SecurityTokenProvider TokenProvider { get; }

        public SecurityTokenAttachmentMode SecurityTokenAttachmentMode { get; }

        public SecurityTokenParameters TokenParameters
        {
            get { return _tokenParameters; }
        }
    }
}


text:
bool map_env_do_iterations(map_env_t *map_env, int num_iterations, bool boost_step_size, bool very_fine_steps) {
    struct timeval tp;
    gettimeofday(&tp, NULL);
    int start_time = tp.tv_sec * 1000 + tp.tv_usec / 1000;
    bool converged = false;
    for (int i = 0; i < num_iterations; i++) {
        converged = map_env_iterate(map_env, NULL, boost_step_size, very_fine_steps);
        boost_step_size = false;
    }
    gettimeofday(&tp, NULL);
    int end_time = tp.tv_sec * 1000 + tp.tv_usec / 1000;
    printf("did %d iterations, %.2f seconds per iteration, %.2f step size\n", num_iterations, (end_time - start_time) / 1000.0 / num_iterations,map_env_get_step_size(map_env));
    return converged;
}

void map_env_do_complete_layout(map_env_t *map_env, int num_iterations_close_repulsion, int num_iterations_finest_layout) {

    printf("iterating from the start to build entire graph\n");

    map_env_set_do_close_repulsion(map_env, false);

    bool boost_step_size = false;
    bool refining_stage = true;
    bool started_close_repulsion = false;
    int iterate_counter = 0;
    int iterate_counter_wait_until = 0;
    while (true) {
        bool converged = map_env_do_iterations(map_env, 50, boost_step_size, false);
        boost_step_size = false;
        iterate_counter += 50;
        if (refining_stage) {
            if (iterate_counter_wait_until > 0 && iterate_counter > iterate_counter_wait_until) {
                printf("refining to finest layout\n");
                map_env_refine_layout(map_env);
                boost_step_size = true;
                refining_stage = false;
                iterate_counter_wait_until = iterate_counter + num_iterations_finest_layout;
            } else if (converged) {
                int num_finer = map_env_number_of_finer_layouts(map_env);
                if (num_finer > 1) {
                    printf("refining layout; %d to go\n", num_finer - 1);
                    map_env_refine_layout(map_env);
                    boost_step_size = true;
                //} else if (num_finer == 1) {
                } else if (num_finer <= 1 && !started_close_repulsion) {
                    printf("doing close repulsion\n");
                    started_close_repulsion = true;
                    map_env_set_do_close_repulsion(map_env, true);
                    boost_step_size = true;
                    iterate_counter_wait_until = iterate_counter + num_iterations_close_repulsion;
                }
            }
        } else {
            // final stage at full refinement
            if (iterate_counter > iterate_counter_wait_until) {
                // finished!
                printf("finished layout\n");
                break;
            }
        }
    }
}