text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="15dp"
    android:background="#8000"
    android:orientation="vertical">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:textColor="#fff"
        android:textSize="20sp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="15dp"
        android:textColor="#fff"
        android:id="@+id/confort_text" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="15dp"
        android:textColor="#fff"
        android:id="@+id/car_wash_text"
         />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="15dp"
        android:textColor="#fff"
        android:id="@+id/sport_text"
         />

</LinearLayout>


text:
"""In-graph simulation step of a vectorized algorithm with environments."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import tensorflow as tf

from . import streaming_mean

def simulate(batch_env, algo, log=True, reset=False):
  """Simulation step of a vecrotized algorithm with in-graph environments.

  Integrates the operations implemented by the algorithm and the environments
  into a combined operation.

  Args:
    batch_env: In-graph batch environment.
    algo: Algorithm instance implementing required operations.
    log: Tensor indicating whether to compute and return summaries.
    reset: Tensor causing all environments to reset.

  Returns:
    Tuple of tensors containing done flags for the current episodes, possibly
    intermediate scores for the episodes, and a summary tensor.
  """

  def _define_begin_episode(agent_indices):
    """Reset environments, intermediate scores and durations for new episodes.

    Args:
      agent_indices: Tensor containing batch indices starting an episode.

    Returns:
      Summary tensor.
    """
    assert agent_indices.shape.ndims == 1
    zero_scores = tf.zeros_like(agent_indices, tf.float32)
    zero_durations = tf.zeros_like(agent_indices)
    reset_ops = [
        batch_env.reset(agent_indices),
        tf.scatter_update(score, agent_indices, zero_scores),
        tf.scatter_update(length, agent_indices, zero_durations)
    ]
    with tf.control_dependencies(reset_ops):
      return algo.begin_episode(agent_indices)

  def _define_step():
    """Request actions from the algorithm and apply them to the environments.

    Increments the lengths of all episodes and increases their scores by the
    current reward. After stepping the environments, provides the full
    transition tuple to the algorithm.

    Returns:
      Summary tensor.
    """
    prevob = batch_env.observ + 0  # Ensure a copy of the variable value.
    agent_indices = tf.range(len(batch_env))
    action, step_summary = algo.perform(agent_indices, prevob)
    action.set_shape(batch_env.action.shape)
    with tf.control_dependencies([batch_env.simulate(action)]):
      add_score = score.assign_add(batch_env.reward)
      inc_length = length.assign_add(tf.ones(len(batch_env), tf.int32))
    with tf.control_dependencies([add_score, inc_length]):
      agent_indices = tf.range(len(batch_env))
      experience_summary = algo.experience(agent_indices, prevob, batch_env.action,
                                           batch_env.reward, batch_env.done, batch_env.observ)
    return tf.summary.merge([step_summary, experience_summary])

  def _define_end_episode(agent_indices):
    """Notify the algorithm of ending episodes.

    Also updates the mean score and length counters used for summaries.

    Args:
      agent_indices: Tensor holding batch indices that end their episodes.

    Returns:
      Summary tensor.
    """
    assert agent_indices.shape.ndims == 1
    submit_score = mean_score.submit(tf.gather(score, agent_indices))
    submit_length = mean_length.submit(tf.cast(tf.gather(length, agent_indices), tf.float32))
    with tf.control_dependencies([submit_score, submit_length]):
      return algo.end_episode(agent_indices)

  def _define_summaries():
    """Reset the average score and duration, and return them as summary.

    Returns:
      Summary string.
    """
    score_summary = tf.cond(tf.logical_and(log, tf.cast(
        mean_score.count, tf.bool)), lambda: tf.summary.scalar('mean_score', mean_score.clear()),
                            str)
    length_summary = tf.cond(tf.logical_and(
        log, tf.cast(mean_length.count,
                     tf.bool)), lambda: tf.summary.scalar('mean_length', mean_length.clear()), str)
    return tf.summary.merge([score_summary, length_summary])

  with tf.name_scope('simulate'):
    log = tf.convert_to_tensor(log)
    reset = tf.convert_to_tensor(reset)
    with tf.variable_scope('simulate_temporary'):
      score = tf.Variable(tf.zeros(len(batch_env), dtype=tf.float32), False, name='score')
      length = tf.Variable(tf.zeros(len(batch_env), dtype=tf.int32), False, name='length')
    mean_score = streaming_mean.StreamingMean((), tf.float32)
    mean_length = streaming_mean.StreamingMean((), tf.float32)
    agent_indices = tf.cond(reset, lambda: tf.range(len(batch_env)), lambda: tf.cast(
        tf.where(batch_env.done)[:, 0], tf.int32))
    begin_episode = tf.cond(tf.cast(tf.shape(agent_indices)[0],
                                    tf.bool), lambda: _define_begin_episode(agent_indices), str)
    with tf.control_dependencies([begin_episode]):
      step = _define_step()
    with tf.control_dependencies([step]):
      agent_indices = tf.cast(tf.where(batch_env.done)[:, 0], tf.int32)
      end_episode = tf.cond(tf.cast(tf.shape(agent_indices)[0],
                                    tf.bool), lambda: _define_end_episode(agent_indices), str)
    with tf.control_dependencies([end_episode]):
      summary = tf.summary.merge([_define_summaries(), begin_episode, step, end_episode])
    with tf.control_dependencies([summary]):
      done, score = tf.identity(batch_env.done), tf.identity(score)
    return done, score, summary

redpajama_set_name: RedPajamaGithub


text:
layout: page
title: Santiago Industries Conference
date: 2016-05-24
author: Janice Choi
tags: weekly links, java
status: published
summary: Curabitur euismod aliquet elit sit amet.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 07/13/2018
  endDate: 07/18/2018
  ctyhocn: UINILHX
  groupCode: SIC
published: true
---
Praesent a tempus sapien. Curabitur convallis sit amet nisl vel fermentum. Nam sit amet neque eu justo dapibus tempor non vel diam. Nullam lectus ligula, egestas in finibus sit amet, pellentesque sit amet erat. Pellentesque facilisis, est ac tristique viverra, nunc est tincidunt magna, scelerisque convallis lacus dolor eget mi. In malesuada eros felis, vel fermentum justo aliquam quis. Nam fringilla risus in mi sollicitudin, a mattis odio imperdiet. Sed luctus, urna et egestas mattis, ante elit egestas massa, non volutpat turpis est in tellus. Curabitur quis dolor velit.

* Aliquam consectetur enim at quam accumsan, vitae fermentum erat aliquam.

Nullam sollicitudin aliquam maximus. Vivamus eget metus ut ipsum euismod porta. Proin tortor diam, pellentesque in magna id, cursus finibus magna. Nunc pulvinar non dui sed consequat. Aenean lobortis, tortor non placerat posuere, ex erat convallis augue, sit amet interdum nisi metus ac sem. Donec interdum turpis in purus faucibus tempus dignissim et odio. Duis ut nulla tortor. Proin vitae nisl odio. Morbi et arcu suscipit, accumsan ipsum eget, dictum eros. Praesent dictum magna ex, a imperdiet odio semper vel. Pellentesque nec purus sagittis sapien elementum tristique sit amet laoreet arcu. Maecenas facilisis sagittis ornare. Fusce a odio efficitur, hendrerit augue ac, rutrum massa. Donec facilisis diam et urna egestas sagittis. Proin non lorem justo. Morbi sapien est, aliquet sit amet turpis in, ullamcorper ornare nulla.


text:
import argparse
import re
from molutils.util.molecule import Molecule
from molutils.util.job_formatters.psi4 import Psi4JobFormatter
from molutils.util.job_formatters.gamess import GamessJobFormatter

def main(args):
    for file in args.input:
        molecules = Molecule.from_file(file, psi4_path=args.path_to_psi4)
        if args.n_frags > 1:
            molecules = molecules.fragment(args.n_frags)
        else:
            molecules = [molecules]

        # Psi4 calcs
        if args.output_format.lower() == "psi4":
            job_formatter = Psi4JobFormatter(molecules, basis_set=args.basis_set, memory=args.memory, memory_units="Gb")
            _output(job_formatter.format(args.calc_type, args.calc_method, guess_charge=args.guess_charge),
                    file,
                    'inp',
                    args.output_to)

        # GAMESS calcs
        elif args.output_format.lower() == "gamess":
            i = 0
            for m in molecules:
                if len(molecules) > 1:
                    output_file = "%i_%s" % (i, file)
                else:
                    output_file = file
                job_formatter = GamessJobFormatter(m, args.basis_set, args.memory, args.memory_ddi)
                _output(job_formatter.format(args.calc_type, args.calc_method, guess_charge=args.guess_charge),
                        output_file,
                        'inp',
                        args.output_to)
                i += 1

        else:
            raise NotImplemented("%s output format not yet implemented" % args.output_format)

def _output(content, input_file_name, output_ext, destination):
    file_name_parts = input_file_name.rsplit('.', 1)
    if len(file_name_parts) > 1:
        ext_matcher = re.compile('\\.(%s)$' % file_name_parts[-1])
    else:
        ext_matcher = None
    if destination == "STDOUT":
        print(content)
        return
    elif destination == "AUTO":
        if ext_matcher:
            output_file_name = ext_matcher.sub('.'+output_ext, input_file_name, count=1)
        else:
            output_file_name = "%s.%s" % (input_file_name, output_ext)
        print("Created: %s" % output_file_name)
    else:
        output_file_name = destination

    with open(output_file_name, "w") as f:
        f.write(content)

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("input", help="the input XYZ files to process", nargs="+", type=str)
    parser.add_argument("--output_format", help="the software for which an input file should be generated", type=str,
                        choices=['psi4', 'gamess'], default="psi4")
    parser.add_argument("--output_to", help="file name for output to be written,"
                                            "'STDOUT' to print to screen, or 'AUTO' to autogenerate file names",
                        type=str, default="STDOUT")
    parser.add_argument("--calc_type", help="the type of calculation to request", type=str,
                        choices=['energy', 'makefp'],
                        default="energy")
    parser.add_argument("--calc_method", help="the method of calculation (e.g. type=energy, method=mp2)", type=str,
                        default=None)
    parser.add_argument("--basis_set", help="the basis set to use", type=str, default=None)
    parser.add_argument("--n_frags", help="the number of fragments the XYZ file should be split into", type=int,
                        default=1)
    parser.add_argument("--guess_charge", help="guess the charge", action="store_true", default=False)
    parser.add_argument("--memory", help="memory to use in calculation in GB", type=int, default=1)
    parser.add_argument("--memory_ddi", help="distributed memory to use in GAMESS calculations in GB", type=int,
                        default=1)
    parser.add_argument("--path_to_psi4", help="path to the psi4 executable", default="psi4")
    args = parser.parse_args()
    main(args)


text:
body {
  min-width:525px;
}

#main .progress {
  background-color: #898989;
  margin-bottom: 0;
}

#pre .csr {
  text-align: center;
}

#pre .highlight .string {
  color: green;
}

#pre .highlight .number {
  color: darkorange;
}

#pre .highlight .boolean {
  color: blue;
}

#pre .highlight .null {
  color: magenta;
}

#pre .highlight .key {
  color: red;
}

#main .password-verdict {
  white-space: nowrap;
}

/*http://tobiasahlin.com/spinkit/*/

#main .sk-fading-circle {
  margin: 100px auto;
  width:200px;
  height: 200px;
  position: relative;
}

#main .sk-fading-circle .sk-circle {
  width: 100%;
  height: 100%;
  position: absolute;
  left: 0;
  top: 0;
}

#main .sk-fading-circle .sk-circle:before {
  content: '';
  display: block;
  margin: 0 auto;
  width: 15%;
  height: 15%;
  background-color: #333;
  border-radius: 100%;
  -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out both;
          animation: sk-circleFadeDelay 1.2s infinite ease-in-out both;
}

#main .sk-fading-circle .sk-circle2 {
  -webkit-transform: rotate(30deg);
      -ms-transform: rotate(30deg);
          transform: rotate(30deg);
}

#main .sk-fading-circle .sk-circle3 {
  -webkit-transform: rotate(60deg);
      -ms-transform: rotate(60deg);
          transform: rotate(60deg);
}
#main .sk-fading-circle .sk-circle4 {
  -webkit-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
          transform: rotate(90deg);
}
#main .sk-fading-circle .sk-circle5 {
  -webkit-transform: rotate(120deg);
      -ms-transform: rotate(120deg);
          transform: rotate(120deg);
}
#main .sk-fading-circle .sk-circle6 {
  -webkit-transform: rotate(150deg);
      -ms-transform: rotate(150deg);
          transform: rotate(150deg);
}
#main .sk-fading-circle .sk-circle7 {
  -webkit-transform: rotate(180deg);
      -ms-transform: rotate(180deg);
          transform: rotate(180deg);
}
#main .sk-fading-circle .sk-circle8 {
  -webkit-transform: rotate(210deg);
      -ms-transform: rotate(210deg);
          transform: rotate(210deg);
}
#main .sk-fading-circle .sk-circle9 {
  -webkit-transform: rotate(240deg);
      -ms-transform: rotate(240deg);
          transform: rotate(240deg);
}
#main .sk-fading-circle .sk-circle10 {
  -webkit-transform: rotate(270deg);
      -ms-transform: rotate(270deg);
          transform: rotate(270deg);
}
#main .sk-fading-circle .sk-circle11 {
  -webkit-transform: rotate(300deg);
      -ms-transform: rotate(300deg);
          transform: rotate(300deg);
}
#main .sk-fading-circle .sk-circle12 {
  -webkit-transform: rotate(330deg);
      -ms-transform: rotate(330deg);
          transform: rotate(330deg);
}
#main .sk-fading-circle .sk-circle2:before {
  -webkit-animation-delay: -1.1s;
          animation-delay: -1.1s;
}
#main .sk-fading-circle .sk-circle3:before {
  -webkit-animation-delay: -1s;
          animation-delay: -1s;
}
#main .sk-fading-circle .sk-circle4:before {
  -webkit-animation-delay: -0.9s;
          animation-delay: -0.9s;
}
#main .sk-fading-circle .sk-circle5:before {
  -webkit-animation-delay: -0.8s;
          animation-delay: -0.8s;
}
#main .sk-fading-circle .sk-circle6:before {
  -webkit-animation-delay: -0.7s;
          animation-delay: -0.7s;
}
#main .sk-fading-circle .sk-circle7:before {
  -webkit-animation-delay: -0.6s;
          animation-delay: -0.6s;
}
#main .sk-fading-circle .sk-circle8:before {
  -webkit-animation-delay: -0.5s;
          animation-delay: -0.5s;
}
#main .sk-fading-circle .sk-circle9:before {
  -webkit-animation-delay: -0.4s;
          animation-delay: -0.4s;
}
#main .sk-fading-circle .sk-circle10:before {
  -webkit-animation-delay: -0.3s;
          animation-delay: -0.3s;
}
#main .sk-fading-circle .sk-circle11:before {
  -webkit-animation-delay: -0.2s;
          animation-delay: -0.2s;
}
#main .sk-fading-circle .sk-circle12:before {
  -webkit-animation-delay: -0.1s;
          animation-delay: -0.1s;
}

@-webkit-keyframes sk-circleFadeDelay {
  0%, 39%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

@keyframes sk-circleFadeDelay {
  0%, 39%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

#popup_overlay {
  opacity: 0.3 !important;
  background-color: black !important;
}

.codefield {
    font-family: monospace;
    resize: none;
    font-size: 0.5em;
    display: block;
    text-align: center;
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 100%;
    max-width: 600px;
    height: 300px;
    min-height: 100%;
    margin: auto;
}

.codefield:focus{
    outline:none;
}

.help {
  color:blue;
  cursor:pointer;
}

.form-horizontal .control-label {
  text-align: left !important; /* !important added for priority in SO snippet. */
}

#head {
  font-size: 36px;
  min-height:41px;
}

#head > span {
  margin-top: 5px;
  margin-bottom: 10px;
  display: inline-block;
}

#back, #home {
    cursor: pointer;
    color: blue;
}

#back span, #home span {
    top: 5px;
}

#back {
  margin-right: 10px;
}

#home {
  margin-right: 30px;
}

.top-buffer {
  margin-top:20px;
}

#main .remove_button_css {
  color: #23527c;
  outline: none;
  padding: 0;
  border: 0;
  box-sizing: none;
  background-color: transparent;
  text-decoration: underline;
}

#main .remove_button_css:hover {
  color: #2352fc;
}

#updatesDiv {
    max-width: 200px;
    float: left;
    margin-bottom: 5px;
    margin-top: -5px;
}


text:
<?php

class Roles extends Application
{

    public function actor($role = ROLE__GUEST)
    {
        $this->session->set_userdata('userrole', $role);
        redirect($_SERVER['HTTP_REFERER']);
    }
}


text:
use std::io;
use super::byte_buffer::ByteBuffer;
use super::ipv4_header;
use super::ipv4_packet::{Ipv4Packet, MAX_PACKET_LENGTH};

pub struct Ipv4PacketBuffer {
    buf: ByteBuffer,
}

impl Ipv4PacketBuffer {
    pub fn new() -> Self {
        Self { buf: ByteBuffer::new(MAX_PACKET_LENGTH) }
    }

    pub fn read_from<R: io::Read>(&mut self, source: &mut R) -> io::Result<(bool)> {
        self.buf.read_from(source)
    }

    fn available_packet_length(&self) -> Option<u16> {
        let data = self.buf.peek();
        if let Some((version, length)) = ipv4_header::peek_version_length(data) {
            assert!(version == 4, "Not an Ipv4 packet, version={}", version);
            if length as usize <= data.len() {
                // full packet available
                Some(length)
            } else {
                // no full packet available
                None
            }
        } else {
            // no packet
            None
        }
    }

    pub fn as_ipv4_packet<'a>(&'a mut self) -> Option<Ipv4Packet<'a>> {
        if self.available_packet_length().is_some() {
            let data = self.buf.peek_mut();
            Some(Ipv4Packet::parse(data))
        } else {
            None
        }
    }

    pub fn next(&mut self) {
        // remove the packet in front of the buffer
        let length = self.available_packet_length().expect(
            "next() called while there was no packet",
        ) as usize;
        self.buf.consume(length);
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use std::io;
    use byteorder::{BigEndian, WriteBytesExt};
    use relay::ipv4_header::Protocol;
    use relay::transport_header::TransportHeaderData;

    fn create_packet() -> Vec<u8> {
        let mut raw = Vec::new();
        write_packet_to(&mut raw);
        raw
    }

    fn write_packet_to(raw: &mut Vec<u8>) {
        raw.write_u8(4u8 << 4 | 5).unwrap();
        raw.write_u8(0).unwrap(); // ToS
        raw.write_u16::<BigEndian>(32).unwrap(); // total length 20 + 8 + 4
        raw.write_u32::<BigEndian>(0).unwrap(); // id_flags_fragment_offset
        raw.write_u8(0).unwrap(); // TTL
        raw.write_u8(17).unwrap(); // protocol (UDP)
        raw.write_u16::<BigEndian>(0).unwrap(); // checksum
        raw.write_u32::<BigEndian>(0x12345678).unwrap(); // source address
        raw.write_u32::<BigEndian>(0x42424242).unwrap(); // destination address

        raw.write_u16::<BigEndian>(1234).unwrap(); // source port
        raw.write_u16::<BigEndian>(5678).unwrap(); // destination port
        raw.write_u16::<BigEndian>(12).unwrap(); // length
        raw.write_u16::<BigEndian>(0).unwrap(); // checksum

        raw.write_u32::<BigEndian>(0x11223344).unwrap(); // payload
    }

    fn write_another_packet_to(raw: &mut Vec<u8>) {
        raw.write_u8(4u8 << 4 | 5).unwrap();
        raw.write_u8(0).unwrap(); // ToS
        raw.write_u16::<BigEndian>(29).unwrap(); // total length 20 + 8 + 1
        raw.write_u32::<BigEndian>(0).unwrap(); // id_flags_fragment_offset
        raw.write_u8(0).unwrap(); // TTL
        raw.write_u8(17).unwrap(); // protocol (UDP)
        raw.write_u16::<BigEndian>(0).unwrap(); // checksum
        raw.write_u32::<BigEndian>(0x11111111).unwrap(); // source address
        raw.write_u32::<BigEndian>(0x22222222).unwrap(); // destination address

        raw.write_u16::<BigEndian>(1111).unwrap(); // source port
        raw.write_u16::<BigEndian>(2222).unwrap(); // destination port
        raw.write_u16::<BigEndian>(9).unwrap(); // length
        raw.write_u16::<BigEndian>(0).unwrap(); // checksum

        raw.write_u8(0x99).unwrap(); // payload
    }

    fn check_packet_headers(ipv4_packet: &Ipv4Packet) {
        let ipv4_header = ipv4_packet.ipv4_header();
        assert_eq!(20, ipv4_header.header_length());
        assert_eq!(32, ipv4_header.total_length());
        assert_eq!(Protocol::Udp, ipv4_header.protocol());
        assert_eq!(0x12345678, ipv4_header.source());
        assert_eq!(0x42424242, ipv4_header.destination());

        if let Some(&TransportHeaderData::Udp(ref udp_header)) =
            ipv4_packet.transport_header_data()
        {
            assert_eq!(1234, udp_header.source_port());
            assert_eq!(5678, udp_header.destination_port());
        } else {
            panic!("No UDP transport header");
        }
    }

    fn check_another_packet_headers(ipv4_packet: &Ipv4Packet) {
        let ipv4_header = ipv4_packet.ipv4_header();
        assert_eq!(20, ipv4_header.header_length());
        assert_eq!(29, ipv4_header.total_length());
        assert_eq!(Protocol::Udp, ipv4_header.protocol());
        assert_eq!(0x11111111, ipv4_header.source());
        assert_eq!(0x22222222, ipv4_header.destination());

        if let Some(&TransportHeaderData::Udp(ref udp_header)) =
            ipv4_packet.transport_header_data()
        {
            assert_eq!(1111, udp_header.source_port());
            assert_eq!(2222, udp_header.destination_port());
        } else {
            panic!("No UDP transport header");
        }
    }

    #[test]
    fn parse_ipv4_packet_buffer() {
        let raw = create_packet();
        let mut packet_buffer = Ipv4PacketBuffer::new();

        let mut cursor = io::Cursor::new(raw);
        packet_buffer.read_from(&mut cursor).unwrap();

        let packet = packet_buffer.as_ipv4_packet().unwrap();
        check_packet_headers(&packet);
    }

    #[test]
    fn parse_fragmented_ipv4_packet_buffer() {
        let raw = create_packet();
        let mut packet_buffer = Ipv4PacketBuffer::new();

        let mut cursor = io::Cursor::new(&raw[..14]);
        packet_buffer.read_from(&mut cursor).unwrap();

        assert!(packet_buffer.as_ipv4_packet().is_none());

        let mut cursor = io::Cursor::new(&raw[14..]);
        packet_buffer.read_from(&mut cursor).unwrap();

        let packet = packet_buffer.as_ipv4_packet().unwrap();
        check_packet_headers(&packet);
    }

    fn create_multi_packets() -> Vec<u8> {
        let mut raw = Vec::new();
        write_packet_to(&mut raw);
        write_another_packet_to(&mut raw);
        write_packet_to(&mut raw);
        raw
    }

    #[test]
    fn parse_multi_packets() {
        let raw = create_multi_packets();
        let mut packet_buffer = Ipv4PacketBuffer::new();

        let mut cursor = io::Cursor::new(raw);
        packet_buffer.read_from(&mut cursor).unwrap();

        check_packet_headers(&packet_buffer.as_ipv4_packet().unwrap());
        packet_buffer.next();
        check_another_packet_headers(&packet_buffer.as_ipv4_packet().unwrap());
        packet_buffer.next();
        check_packet_headers(&packet_buffer.as_ipv4_packet().unwrap());
        packet_buffer.next();

        assert!(packet_buffer.as_ipv4_packet().is_none());
    }
}


text:
package demo.domain;

public class Employee {

	private String name;
	private String salary;

	public Employee(String name, String salary) {
		this.name = name;
		this.salary = salary;
	}

	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSalary() {
		return salary;
	}
	public void setSalary(String salary) {
		this.salary = salary;
	}

}


text:
SYNONYM

#### According to
GRIN Taxonomy for Plants

#### Published in
Fl. nov. -zel. 1:272. 1853

#### Original name
null

### Remarks
null


text:
// ========================================================================
// SproutCore -- JavaScript Application Framework
// Copyright ©2006-2011, Strobe Inc. and contributors.
// Portions copyright ©2008 Apple Inc.  All rights reserved.
// ========================================================================

/* evil:true */

sc_require('coders/object');

/** @class

  A DesignCoder encodes specifically the design for a set of views.

  @extends SC.ObjectCoder
*/
SC.DesignCoder = SC.ObjectCoder.extend({
  extendMethodName: 'design',
  encodeMethodName: 'encodeDesign'
});


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Bulletin Labor. Orto Bot. de R. Univ. Siena 5: 60 (1902)

#### Original name
Hendersonia sambuci Peck, 1878

### Remarks
null


text:
/**
 *
 */
package com.notbed.simplegame.client.ui.slick;

import com.notbed.simplegame.brotocol.ConnectionProvider;
import com.notbed.simplegame.client.SimpleGameModel;
import com.notbed.simplegame.client.ThreadEstablishConnection;
import com.notbed.simplegame.client.ui.slick.util.SimpleBasicGameState;
import com.notbed.simplegame.client.ui.slick.util.SlickConstants;
import com.notbed.simplegame.client.ui.slick.util.SlickUtil;
import com.notbed.simplegame.client.util.Constants;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import java.io.IOException;

/**
 * @author Alexandru-Constantin Bledea
 * @since Aug 31, 2015
 */
final class StateConnecting extends SimpleBasicGameState {

    private final ThreadEstablishConnection threadEstablishConnection;

    StateConnecting(final SimpleGameModel model, final ConnectionProvider connectionProvider) {
        super(model);
        this.threadEstablishConnection = new ThreadEstablishConnection(model, connectionProvider);
    }

    @Override
    public void init(final GameContainer arg0, final StateBasedGame arg1) throws SlickException {
        this.threadEstablishConnection.start();
    }

    @Override
    public void update(final GameContainer gc, final StateBasedGame sbg, final int arg2) throws SlickException {
        if (this.threadEstablishConnection.isAlive()) {
            return; // still loading...
        }
        final IOException exception = this.threadEstablishConnection.getException();
        if (null != exception) {
            sbg.enterState(SlickConstants.STATE_SERVER_UNREACHABLE);
            return;
        }
        sbg.enterState(SlickConstants.STATE_LOGIN);
    }

    @Override
    public void render(final GameContainer gc, final StateBasedGame sbg, final Graphics g) throws SlickException {
        SlickUtil.writeCenteredText("Connecting...", SlickUtil.FONT_HUGE, gc.getWidth(), 100);
        SlickUtil.writeCenteredText(Constants.NAME, SlickUtil.FONT_SMALL, gc.getWidth(), gc.getHeight() - 30);
        SlickUtil.FONT_SMALL.drawString(10, gc.getHeight() - 30, "Version " + Constants.VERSION);
    }

    @Override
    public int getID() {
        return SlickConstants.STATE_CONNECTING;
    }

}


text:
require("./src/OAuth2Express.js");
require("./src/OAuth2Utilities.js");


text:
import logging
import pygame
import random
from pygame.locals import *
from menu import MainMenu, PreGameMenu
from powerup import *
import math
from agent import Player
from constants import *
from functions import *

class World():
    """The game world. Connects the logic of all WorldObjects with controller and the rest of the game"""
    def __init__(self, controller, map_type):
        self.screen = controller.screen
        self.controller = controller
        self.objects = []	# Collection of all current World Objects
        self.map_type = map_type
        self.powerups = []
        self.font = pygame.font.Font("fonts/8bitwonder.ttf", 14)
        self.update_world_objs = True

        for pup in range(0, random.randint(0, 10)):
            self.objects.append(Health(self, "random", "random"))

    def generate(self):
        """Generate the game world and it's objects"""

        self.bg_surface = pygame.Surface(SCREEN_SIZE, flags=pygame.HWSURFACE)
        self.world_objs_surface = pygame.Surface(SCREEN_SIZE, flags=pygame.HWSURFACE + pygame.SRCALPHA)

        if self.map_type == "grass":
            self.ground_sprite = pygame.image.load("images/grass.png")
            if not FASTRUN:
                for i in range(random.randint(1, 5)):
                    self.objects.append(Water(self, self.world_objs_surface))

                for i in range(random.randint(2, 10)):
                    self.objects.append(Bush(self, self.world_objs_surface))

                for i in range(random.randint(3, 15)):
                    self.objects.append(Stone(self, self.world_objs_surface))

        elif self.map_type == "sand":
            self.ground_sprite = pygame.image.load("images/sand.png")
            if not FASTRUN:
                for i in range(random.randint(1, 3)):
                    self.objects.append(Water(self, self.world_objs_surface))

                for i in range(random.randint(1, 2)):
                    self.objects.append(Bush(self, self.world_objs_surface))

                for i in range(random.randint(1, 10)):
                    self.objects.append(DeadBush(self, self.world_objs_surface))

                for i in range(random.randint(3, 10)):
                    self.objects.append(Stone(self, self.world_objs_surface))

                for i in range(random.randint(3, 12)):
                    self.objects.append(DesertStone(self, self.world_objs_surface))

        self.ground_sprite_width = self.ground_sprite.get_width()
        self.ground_sprite_height = self.ground_sprite.get_height()

        for x in range(0, SCREEN_SIZE[0], self.ground_sprite_width):
            for y in range(0, SCREEN_SIZE[1], self.ground_sprite_height):
                self.bg_surface.blit(self.ground_sprite,(x,y))

    def draw(self):
        """Draw the game-world and all it's objects"""
        self.screen.blit(self.bg_surface, (0, 0))
        self.screen.blit(self.world_objs_surface, (0, 0))

        if self.update_world_objs:
            self.world_objs_surface.fill((0, 0, 0, 0))

            for obj in self.objects:
                obj.draw()

            self.update_world_objs = False

class WorldObject(object):
    """General attributes and methods for all WorldObjects"""
    def __init__(self, world, surface):
        self.surface = surface
        self.controller = world.controller
        self.x, self.y = 0,0
        self.name = "Undefined WorldObject"
        self.solid = 0
        self.destroyable = False

    def draw(self):
        """General drawing-function for normal objects"""
        self.surface.blit(self.image, (self.x-self.image.get_width()/2, self.y-self.image.get_height()/2))

        if self.controller.debug:   #Collision-detection-testing
            pygame.draw.circle(self.surface, (255,0,0), (int(self.x), int(self.y)), self.radius, 2)

class Object(WorldObject):
    """Normal objects -> An image that only exists on one coordinate"""
    def __init__(self, world, surface):
        WorldObject.__init__(self, world, surface)
        self.type = 0 #worldobject
        self.name = "Undefined Standard-object"

    def check_spawn_point(self):
        """Makes sure that Normal Objects only spawn on the screen and not on top of other WorldObjects"""
        while True:
            self.x = random.randint(self.radius, SCREEN_SIZE[0]-self.radius)
            self.y = random.randint(self.radius, SCREEN_SIZE[1]-self.radius)

            for obj in self.controller.map.objects:
                if detect_collision(self, obj):
                    break   #exit the for-loop and get new pos for self

            else:   #object IS spawning on screen and NOT on top of other WorldObject
                break

    def get_random_sprite(self, sprites_list, folder, width, height):
        """Pick a random sprite from sprites_list and set it as the objects sprite.

        Inputs:
            * List with strings of filenames of images
            * String with folder-path
            * Width and height of sprite
        Result:
            Set a random sprite for the object"""
        image = random.choice(sprites_list)
        full_path = folder + image
        return pygame.transform.scale(pygame.image.load(full_path), (width, height))

    def get_shot(self, damage):
        """Update health of WorldObject. Remove if it gets destroyed"""
        self.health -= damage
        if self.health <= 0:
            self.controller.map.objects.remove(self)
            #update map here
            self.controller.map.update_world_objs = True

class Area(WorldObject):
    """Area Objects that is made out of several smaller circle-objets to take up an area"""
    def __init__(self, world, surface):
        WorldObject.__init__(self, world, surface)
        self.type = 1 #area
        self.circles = []
        self.name = "Undefined Area-object"
        self.area()
        self.solid = 50

    def area(self):
        """Generate area and only do so on screen"""
        radius = 40
        x = random.randint(radius, SCREEN_SIZE[0]-radius)
        y = random.randint(radius, SCREEN_SIZE[1]-radius)
        phi = random.randint(1,10) * 2 * math.pi
        circle = Circle(x, y, phi, radius)
        self.circles.append(circle)

        for i in range(0, random.randint(15, 30)):
            phi = random.randint(int((self.circles[-1].phi - math.radians(random.randint(1, 360)))), int((self.circles[-1].phi + math.radians(random.randint(1, 360)))))
            x = self.circles[-1].x + math.sin(phi) * radius
            y = self.circles[-1].y + math.cos(phi) * radius

            while True: #Only spawn next circle on screen
                if x > SCREEN_SIZE[0]-radius or x < radius or y > SCREEN_SIZE[1]-radius or y < radius:
                    phi = random.randint(int((self.circles[-1].phi - math.radians(random.randint(1, 360)))), int((self.circles[-1].phi + math.radians(random.randint(1, 360)))))
                    x = self.circles[-1].x + math.sin(phi) * radius
                    y = self.circles[-1].y + math.cos(phi) * radius
                else:   #next pos for circle is on the screen, continue
                    break
            circle = Circle(x, y, phi, radius)
            self.circles.append(circle)

class Circle():
    """These circle-objects make up Area-objects"""
    def __init__(self, x, y, phi, radius):
        self.x = x
        self.y = y
        self.phi = phi
        self.radius = radius

class Water(Area):
    """Spawns in various sizes, shapes and colors"""
    def __init__(self, world, surface):
        Area.__init__(self, world, surface)
        self.color = (0, random.randint(0, 100), random.randint(110, 255))
        self.name = "Water"
        self.solid = 50

    def draw(self):
        for circle in self.circles:
            pygame.draw.circle(self.surface, self.color, (int(circle.x), int(circle.y)), int(circle.radius), 0)

class DeadBush(Object):
    """Only spawning on sand-maps"""
    def __init__(self, world, surface):
        Object.__init__(self, world, surface)
        self.name = "DeadBush"
        self.solid = 20
        self.image = pygame.transform.scale(pygame.image.load("images/deadtree.png"), (DEAD_BUSH_SIZE, DEAD_BUSH_SIZE))
        self.radius = self.image.get_width()//3
        self.check_spawn_point()

class Bush(DeadBush):
    """Spawning on grass- and sand-maps"""
    def __init__(self, world, surface):
        DeadBush.__init__(self, world, surface)
        self.name = 'Bush'
        self.solid = 100
        self.image = pygame.image.load('images/busksten.png')
        self.radius = self.image.get_width()//2
        self.check_spawn_point()

class Stone(Object):
    """Spawning in various shapes, sizes and with randomized sprites depending on world.map_type.
        Is completely solid --> Can't be driven through"""
    def __init__(self, world, surface):
        Object.__init__(self, world, surface)
        self.name = "Stone"
        self.solid = 100
        self.width = random.randint(80, STONE_MAX_SIZE)
        self.height = self.width #values are the same to not trash image quality or collisions
        self.health = self.width * 2.5
        sprites_list = ['a10010.png', 'a10011.png', 'a10015.png', 'a10002.png']
        folder = 'images/stones/'
        self.image = self.get_random_sprite(sprites_list, folder, self.width, self.height)
        self.radius = self.image.get_height()//4
        self.check_spawn_point()

class DesertStone(Stone):
    """Much like a Stone, but a different sprite and size"""
    def __init__(self, world, surface):
        Stone.__init__(self, world, surface)
        self.name = "DesertStone"
        self.width = random.randint(50, DESERT_STONE_MAX_SIZE)
        self.height = self.width
        sprites_list = ['c40007.png', 'c30011.png', 'c40000.png', 'c40010.png']
        folder = 'images/stones/'
        self.image = self.get_random_sprite(sprites_list, folder, self.width, self.height)
        self.radius = self.image.get_width()//4
        self.check_spawn_point()


text:
let path = document.location.pathname,
    details,
    login,
    url;

if (m = path.match(/^\/([\w-]+)\??.*?/)) {
    login = m[1].trim();
    if (-1 === ['timeline', 'languages', 'blog', 'explore'].indexOf(login)) {
        url = 'http://coderstats.net/github#' + login;
        details = document.getElementsByClassName('vcard-details');
        if (details.length > 0) {
            addLink();
        }
    }
}

function addLink() {
    let li = document.createElement('li');
    li.setAttribute('id', 'coderstats');
    li.setAttribute('class', 'vcard-detail pt-1');
    li.setAttribute('itemprop', 'url');

    let span = document.createElement('span');
    span.setAttribute('class', 'octicon');
    span.setAttribute('style', 'margin-top:-2px;');
    span.textContent = "📊";
    li.appendChild(span)

    let a = document.createElement('a');
    a.setAttribute('href', url);
    a.textContent = "CoderStats('" + login + "')";

    li.appendChild(a);
    details[0].appendChild(li);
}


text:
package com.kotkovets.fines.modules.userguide.entity;

/**
 * Created by igork on 9/25/16.
 */
public class UserGuideSlide {
    private String mTitle;
    private String mSourceURL;

    public UserGuideSlide(String mTitle, String mSourceURL) {
        this.mTitle = mTitle;
        this.mSourceURL = mSourceURL;
    }

    public String getTitle() {
        return mTitle;
    }

    public String getSourceURL() {
        return mSourceURL;
    }
}


text:
#ifndef	__E500_H__
#define __E500_H__

#ifndef __ASSEMBLY__

typedef struct
{
	unsigned long freq_processor[CONFIG_MAX_CPUS];
	unsigned long freq_systembus;
	unsigned long freq_ddrbus;
	unsigned long freq_localbus;
	unsigned long freq_qe;
#ifdef CONFIG_SYS_DPAA_FMAN
	unsigned long freq_fman[CONFIG_SYS_NUM_FMAN];
#endif
#ifdef CONFIG_SYS_DPAA_QBMAN
	unsigned long freq_qman;
#endif
#ifdef CONFIG_SYS_DPAA_PME
	unsigned long freq_pme;
#endif
#ifdef CONFIG_SYS_FSL_SINGLE_SOURCE_CLK
	unsigned char diff_sysclk;
#endif
} MPC85xx_SYS_INFO;

#endif  /* _ASMLANGUAGE */

#define RESET_VECTOR	0xfffffffc

#endif	/* __E500_H__ */


text:
autocommit off;

update joe.employees_v
   set ssn = (select product_code, descr from joe.inventory_v);
rollback work;
rollback;


text:
<?php

namespace Rx\Functional\Operator;

use Exception;
use Rx\Functional\FunctionalTestCase;
use Rx\Observable\GroupedObservable;
use Rx\Testing\MockObserver;

class GroupByTest extends FunctionalTestCase
{
    /**
     * @test
     */
    public function it_passes_on_complete()
    {
        $xs         = $this->createHotObservableWithData();
        $keyInvoked = 0;

        $results = $this->scheduler->startWithCreate(function() use ($xs, &$keyInvoked) {
            return $xs->groupBy(function($elem) use (&$keyInvoked) {
                $keyInvoked++;
                return trim(strtolower($elem));
            })->select(function(GroupedObservable $observable) {
                return $observable->getKey();
            });
        });

        $this->assertEquals(12, $keyInvoked);

        $this->assertMessages(array(
            onNext(220, "foo"),
            onNext(270, "bar"),
            onNext(350, "baz"),
            onNext(360, "qux"),
            onCompleted(570),
        ), $results->getMessages());
    }

    /**
     * @test
     */
    public function it_passes_on_error()
    {
        $xs         = $this->createHotObservableWithData(true);
        $keyInvoked = 0;

        $results = $this->scheduler->startWithCreate(function() use ($xs, &$keyInvoked) {
            return $xs->groupBy(function($elem) use (&$keyInvoked) {
                $keyInvoked++;
                return trim(strtolower($elem));
            })->select(function(GroupedObservable $observable) {
                return $observable->getKey();
            });
        });

        $this->assertEquals(12, $keyInvoked);

        $this->assertMessages(array(
            onNext(220, "foo"),
            onNext(270, "bar"),
            onNext(350, "baz"),
            onNext(360, "qux"),
            onError(570, new Exception()),
        ), $results->getMessages());
    }

    /**
     * @test
     */
    public function it_disposes_the_outer_subscription()
    {
        $xs         = $this->createHotObservableWithData(true);
        $keyInvoked = 0;

        $results = $this->scheduler->startWithDispose(function() use ($xs, &$keyInvoked) {
            return $xs->groupBy(function($elem) use (&$keyInvoked) {
                $keyInvoked++;
                return trim(strtolower($elem));
            })->select(function(GroupedObservable $observable) {
                return $observable->getKey();
            });
        }, 355);

        $this->assertEquals(5, $keyInvoked);

        $this->assertMessages(array(
            onNext(220, "foo"),
            onNext(270, "bar"),
            onNext(350, "baz"),
        ), $results->getMessages());
    }

    /**
     * @test
     */
    public function it_calls_on_error_if_keyselector_throws()
    {
        $xs         = $this->createHotObservableWithData(true);
        $keyInvoked = 0;

        $results = $this->scheduler->startWithCreate(function() use ($xs, &$keyInvoked) {
            return $xs->groupBy(function($elem) use (&$keyInvoked) {
                $keyInvoked++;

                if ($keyInvoked === 10) {
                    throw new Exception();
                }

                return trim(strtolower($elem));
            })->select(function(GroupedObservable $observable) {
                return $observable->getKey();
            });
        });

        $this->assertEquals(10, $keyInvoked);

        $this->assertMessages(array(
            onNext(220, "foo"),
            onNext(270, "bar"),
            onNext(350, "baz"),
            onNext(360, "qux"),
            onError(480, new Exception()),
        ), $results->getMessages());
    }

    /**
     * @test
     */
    public function it_calls_on_error_if_elementselector_throws()
    {
        $xs             = $this->createHotObservableWithData(true);
        $elementInvoked = 0;

        $results = $this->scheduler->startWithCreate(function() use ($xs, &$elementInvoked) {
            return $xs->groupBy(function($elem) {
                return trim(strtolower($elem));
            }, function($element) use (&$elementInvoked) {
                $elementInvoked++;

                if ($elementInvoked === 10) {
                    throw new Exception('');
                }

                return $element;
            })->select(function(GroupedObservable $observable) {
                return $observable->getKey();
            });
        });

        $this->assertEquals(10, $elementInvoked);

        $this->assertMessages(array(
            onNext(220, "foo"),
            onNext(270, "bar"),
            onNext(350, "baz"),
            onNext(360, "qux"),
            onError(480, new Exception()),
        ), $results->getMessages());
    }

    /**
     * @test
     */
    public function it_calls_on_error_if_durationselector_throws()
    {
        $xs             = $this->createHotObservableWithData(true);

        $results = $this->scheduler->startWithCreate(function() use ($xs) {
            return $xs->groupByUntil(function($elem) { return $elem; },
                null,
                function() { throw new Exception(''); }
            )->select(function(GroupedObservable $observable) {
                return $observable->getKey();
            });
        });

        $this->assertMessages(array(
            onError(220, new Exception()),
        ), $results->getMessages());
    }

    /**
     * @test
     */
    public function it_passes_on_error_if_duration_observable_calls_on_error()
    {
        $xs = $this->createHotObservableWithData();

        $results = $this->scheduler->startWithCreate(function() use ($xs) {
            return $xs->groupByUntil(function($elem) {
                    return trim(strtolower($elem));
                },
                null,
                function(GroupedObservable $observable) {
                    return $observable->select(function() { throw new Exception('meh.'); });
            })->select(function(GroupedObservable $observable) {
                return $observable->getKey();
            });
        });

        $this->scheduler->start();
        $this->assertMessages(array(
            onNext(220, 'foo'),
            onError(220, new Exception()),
        ), $results->getMessages());
    }

    /**
     * @test
     */
    public function it_calls_on_completed_on_inner_subscription_if_subscription_expires_otherwise_it_passes()
    {
        $xs = $this->createHotObservableWithData();

        $observable = $xs->groupByUntil(function($elem) {
                return trim(strtolower($elem));
            },
            null,
            function(GroupedObservable $observable) {
                return $observable->skip(2);
            }
        );

        $innerSubscriptions = array();
        $scheduler = $this->scheduler;
        $observable->subscribeCallback(function(GroupedObservable $observable) use (&$innerSubscriptions, $scheduler) {
            $observer = new MockObserver($scheduler);
            $observable->subscribe($observer);

            $innerSubscriptions[] = array(
                'key'      => $observable->getKey(),
                'observer' => $observer,
            );
        });

        $this->scheduler->start();

        // on complete gets called after duration is "over"
        $this->assertCount(4, $innerSubscriptions[0]['observer']->getMessages());
        $this->assertMessages(array(
            onNext(90, "error"),
            onNext(110, "error"),
            onNext(130, "error"),
            onCompleted(130),
        ), $innerSubscriptions[0]['observer']->getMessages());

        $this->assertCount(4, $innerSubscriptions[1]['observer']->getMessages());
        $this->assertMessages(array(
            onNext(220, "  foo"),
            onNext(240, " FoO "),
            onNext(310, "foO "),
            onCompleted(310),
        ), $innerSubscriptions[1]['observer']->getMessages());

        $this->assertCount(4, $innerSubscriptions[2]['observer']->getMessages());
        $this->assertMessages(array(
            onNext(270, "baR  "),
            onNext(390, "   bar"),
            onNext(420, " BAR  "),
            onCompleted(420),
        ), $innerSubscriptions[2]['observer']->getMessages());

        $this->assertCount(4, $innerSubscriptions[3]['observer']->getMessages());
        $this->assertMessages(array(
            onNext(350, " Baz   "),
            onNext(480, "baz  "),
            onNext(510, " bAZ "),
            onCompleted(510),
        ), $innerSubscriptions[3]['observer']->getMessages());

        // Otherwise the original on complete is passed
        $this->assertCount(2, $innerSubscriptions[4]['observer']->getMessages());
        $this->assertMessages(array(
            onNext(360, "  qux "),
            onCompleted(570),
        ), $innerSubscriptions[4]['observer']->getMessages());

        $this->assertCount(3, $innerSubscriptions[5]['observer']->getMessages());
        $this->assertMessages(array(
            onNext(470, "FOO "),
            onNext(530, "    fOo    "),
            onCompleted(570),
        ), $innerSubscriptions[5]['observer']->getMessages());
    }

    protected function createHotObservableWithData($error = false)
    {
        return $this->createHotObservable(array(
            onNext(90, "error"),
            onNext(110, "error"),
            onNext(130, "error"),
            onNext(220, "  foo"),
            onNext(240, " FoO "),
            onNext(270, "baR  "),
            onNext(310, "foO "),
            onNext(350, " Baz   "),
            onNext(360, "  qux "),
            onNext(390, "   bar"),
            onNext(420, " BAR  "),
            onNext(470, "FOO "),
            onNext(480, "baz  "),
            onNext(510, " bAZ "),
            onNext(530, "    fOo    "),
            $error ? onError(570, new Exception()) : onCompleted(570),
            onNext(580, "error"),
            onCompleted(600),
            onError(650, new Exception()),
        ));
    }
}


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

namespace Microsoft.AspNetCore.Identity.Module.Services
{
    public interface IEmailSender
    {
        Task SendEmailAsync(string email, string subject, string message);
    }
}


text:
require 'spec_helper'

describe ResqueHelpers do
  xit 'should be specified'
end


text:
#include "awt_InputEvent.h"
#include "awt.h"

/************************************************************************
 * AwtInputEvent fields
 */

jfieldID AwtInputEvent::modifiersID;

/************************************************************************
 * AwtInputEvent native methods
 */

extern "C" {

JNIEXPORT void JNICALL
Java_java_awt_event_InputEvent_initIDs(JNIEnv *env, jclass cls) {
    AwtInputEvent::modifiersID = env->GetFieldID(cls, "modifiers", "I");

    DASSERT(AwtInputEvent::modifiersID != NULL);
}

} /* extern "C" */


text:
namespace otus {

namespace internal {
    static constexpr size_t Max = std::numeric_limits<size_t>::max();

    // == Index of type ============================================================
    template<typename Target, class Tuple> struct index_of_type;
    template<typename Target>
        struct index_of_type<Target, std::tuple<>> {
            static constexpr size_t value = Max;
        };
    template<typename Target, typename... Rest>
        struct index_of_type<Target, std::tuple<Target, Rest...>> {
            static constexpr size_t value = 0;
        };
    template<typename Target, typename First, typename... Rest>
        struct index_of_type<Target, std::tuple<First, Rest...>> {
            static constexpr size_t next = index_of_type<Target, std::tuple<Rest...>>::value;
            static constexpr size_t value = next == Max ? Max : next + 1;
        };
} // namespace

namespace tmp {
    template<typename F>
    struct function_traits;

    template<typename R, typename... Args>
    struct function_traits<R(Args...)> {
        using return_type = R;
        using param_types = std::tuple<typename std::remove_pointer<typename std::remove_reference<Args>::type>::type...>;
    };

    template<typename T, typename R, typename... Args>
    struct function_traits<R(T::*)(Args...) const> {
        using return_type = R;
        // using param_types = std::tuple<Args...>;
        using param_types = std::tuple<typename std::remove_pointer<typename std::remove_reference<Args>::type>::type...>;
    };

    template<typename R, typename... Args>
    struct function_traits<R(*)(Args...)> : function_traits<R(Args...)> {};

    template<typename Class, typename R>
    struct function_traits<R(Class::*)> {};

    template<typename Class, typename R, typename... Args>
    struct function_traits<R(Class::*)(Args...)> : public function_traits<R(Class&, Args...)> {};

    template<typename T> struct function_traits : public function_traits<decltype(&T::operator())> {};

    // == Apply ============================================================
    template<typename F, template<typename...> class Params, typename... Args, std::size_t... I>
        auto apply_helper(F& f, Params<Args...>&& params, std::index_sequence<I...>) {
            return f(*std::get<I>(params)...);
        }
    template<typename F, template<typename...> class Params, typename... Args>
        auto apply(F& f, Params<Args...>&& params) {
            return apply_helper(f, std::move(params), std::index_sequence_for<Args...>{});
        }

    template<typename F, template<typename...> class Params, typename... Args, std::size_t... I>
        auto apply_helper(F& f, size_t id, Params<Args...>&& params, std::index_sequence<I...>) {
            return f(id, *std::get<I>(params)...);
        }
    template<typename F, template<typename...> class Params, typename... Args>
        auto apply(F& f, size_t id, Params<Args...>&& params) {
            return apply_helper(f, id, std::move(params), std::index_sequence_for<Args...>{});
        }

    template<typename Target, class Tuple>
        struct index_of_type {
            static constexpr size_t value = internal::index_of_type<Target, Tuple>::value;
            static_assert(value != internal::Max, "No such type in provided tuple");
        };

    // == Index of type ============================================================
    template <typename Target, class Tuple>
        struct has_type {
            static constexpr bool value = internal::index_of_type<Target, Tuple>::value != internal::Max;
        };

    // == Tuple at index ============================================================
    template<typename T, typename... C>
        auto& tuple_at(std::tuple<C...>& t) {
            return std::get<index_of_type<T, typename std::remove_reference<decltype(t)>::type>::value>(t);
        }

    // == For each in tuple ==========================================================
    template<size_t I, typename F, template<typename...> class Tuple, typename... Args,
        typename std::enable_if<I == sizeof...(Args)>::type* = nullptr>
        void tuple_each(Tuple<Args...>&, F&) {}
    template<size_t I, typename F, template<typename...> class Tuple, typename... Args,
        typename std::enable_if<I < sizeof...(Args)>::type* = nullptr>
        void tuple_each(Tuple<Args...>& t, F f) {
            f(std::get<I>(t));
            tuple_each<I + 1, F>(t, f);
        }
    template<typename T, typename F>
        void tuple_each(T& t, F f) {
            tuple_each<0, F>(t, f);
        }

} // namespace tmp
} // namespace otus


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/txtSpeechInput"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="100dp"
        android:layout_centerInParent="true"
        android:textSize="26dp"
        android:gravity="center"
        android:textStyle="normal"
        android:text="LaunchByVoice"
        android:textAlignment="center"/>

    <HorizontalScrollView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/horizontalScrollView"
        android:layout_below="@+id/txtSpeechInput"
        android:gravity="center"
        >
        <LinearLayout
            android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@+id/horizontalLL"
            android:layout_alignParentStart="true"></LinearLayout>
     </HorizontalScrollView>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:layout_marginBottom="60dp"
        android:gravity="center"
        android:orientation="vertical"
        android:id="@+id/linearLayout">

        <ImageButton
            android:id="@+id/btnSpeak"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@null"
            android:src="@drawable/mic" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:text="@string/tap"
            android:textSize="15dp"
            android:textStyle="normal" />
    </LinearLayout>

</RelativeLayout>


text:
* Adds a single name for every message event to work ok with MS Edge.

###v0.14.0
* Adds a new flag `singleParent` that prevents the same node to be added twice into the the state tree. Thanks to @nathanial.

###v0.13.0
* Fixes bug making apps unresponsive in FF when an error happens in a listener.

###v0.12.2
* Fixes duplicated detached warnings in non detached nodes.

###v0.12.1
* Recovers trigger method deleted by default

###v0.12.0
* Adds a warning mechanism to detect errors quickly.
* Adds warning for setting non numeric attributes for arrays.
* Adds warning for updating detached nodes.
* Adds method `sort` for array.
* `trigger` method for events has been renamed to `emit`, added a deprecation warning for `trigger` method.
* Updates to the docs. Thanks to @YPCrumble @ahmadnassri @dantman.
* Fixes errors with strict Content Security Policy. Thanks to @greghuc.

###v0.11.2
* Fixes deep children losing the parent reference on resetting the state.

###v0.11.1
* `update` event handlers now receive the previous state.

###v0.11.0
* Removes console.log calls
* Trigger an event now return the last callback return value that is not `undefined`.
* Now class instances are handled like tree leaves.
* Adds the freezeInstance options to handle class instances as freezer nodes.

###v0.10.0
* Fixes not returning the pivot on non-modifying updates. Thanks @oigewan
* Adds `getEventHub` method.
* Refactors event triggering on nodes. Now the freezer object shares the events with the root node.
* The prototype of the objects are now preserved, so class instances can now be saved in a freezer store.

###v0.9.6
* Fixes orphan markDirty call.
* Fixes setting null value. Thanks @kuraga
* Improved readme. Thanks @ivantm

###v0.9.4
* Not working internally with dirty nodes anymore.
* Fixed some nodes getting out of sync when having nested duplicate nodes.

###v0.9.3
* Using messages for nextTick implementation only in browsers. Needed to make freezer work with react native.

###v0.9.2
* Not triggering events in all parents when a node have more than one parent.

###v0.9.1
* Fixed specialEvents problem in build

###v0.9.0
* Added `beforeAll` and `afterAll` events.
* `this` in event listeners now point to the current freezer object.
* Fixed `Freezer.prototype.set` not working with plain objects.
* Fixed some typos in README.

###v0.8.2
* Fixed `set` not accepting numerical keys.

###v0.8.1
* `once` now returns the listener/freezer object.

###v0.8.0
* `now` returns the current node, like any other updater method.
* Fixed nodes losing the live mode on update. Thanks to @zenfe.
* Fixed nodes triggering event in the wrong order when pivot. Thanks to @zenfe.
* Tests passing now in Node 4. Thanks @kuraga.
* Adds setting properties to undefined. Thanks to @rsamec.

###v0.7.1
* Fixed `now` method triggering `update` event twice.
* Fixed live mode not triggering events in intermediate nodes.

###v0.7.0
* Added `pivot`` method.
* Added `now` method.

###v0.6.1
* Fixed binding parents to the nodes on reset.
* Fixed not removing an specific listener when using `off`.

###v0.6.0
* Added options to freezer initialization.
* Added mutable option in order of create mutable freezer objects.
* Added live mode option.

###v0.5.2
* Fixed reseting top nodes not updating the store
* Fixed some == comparisons that would modify incorrect attributes.
* Fixed modifying the object passed to `set` as argument.
* Added the playground to the readme file.

###v0.5.1
* Fixed some typos in the readme file
* Freezer is now extendable using ES6 classes

###v0.5.0
* Fixed: Now duplicated nodes are updated properly when they are children of the root node.
* Added: Transactions
* Added: Non-frozen nodes.

###v0.4.2
* Added: `reset` method to nodes.
* Fixed: Some typos.
* Added: An example to the README.md

###v0.4.1
* Licensed changed to MIT.

###v0.4.0
* Improved: Array nodes are now real arrays
* Fixed: Parent links are now working properly when a Freezer store is reseted.
* Removed: `toJSON` method is not needed anymore, since arrays are acutal arrays now.
* Added: Created a test HTML page.

###v0.3.3
* Improved: Performance on refreshing parent nodes on update.
* Added: `toJS` and `toJSON` methods on nodes to get a pure JS object from a node.
* Removed: Path legacy code from curxor.js

###v0.3.2
* Fixed: Chained calls should trigger update with the value of all operations. https://github.com/arqex/freezer/issues/2

###v0.3.1
* Fixed: A cloned node in a frozen should update all the parents at the same time.
* Fixed: Array concat method doesn't work as expected. https://github.com/arqex/freezer/issues/1

###v0.3.0
* First released version after forking curxor.
* Binding nodes using references to parents.


text:
using namespace std;

//page text cleanup tool
static inline char formatWords(char c)
{
  return (isalpha(c) ? ::tolower(c) : ' ');
}

//BookIndex
//loads byPage class variable with book contents
bool BookIndex::splitIntoPages(stringstream &book)
{
  //newline,any number of whitespaces, 1 or more digits, any amt of
  //whitespace, newline
  string bookstr(book.str()); //DVP:revisit, wasted extra copy?
  boost::regex pageNumRegex("[\n|\r]\\s*\\d+\\s*[\n|\r]");
  boost::regex_iterator<string::iterator> findPageNum (bookstr.begin(), bookstr.end(), pageNumRegex);
  boost::regex_iterator<string::iterator> rEnd; //defaults to end-of-seq
  unsigned int currMatchPos = 0, currMatchLen = 0, lastMatchPos = 0;

  for (; findPageNum != rEnd; ++findPageNum) {
    currMatchPos = findPageNum->position();
    string matchStr = findPageNum->str();
    currMatchLen = matchStr.length();
    string pgnum = matchStr.substr(0,currMatchLen-1);
    int pgnumint = atoi(pgnum.c_str());

    //new pair to insert
    BookIndex::PagePair *newPair = new(BookIndex::PagePair);
    newPair->first = pgnumint;
    newPair->second = bookstr.substr(lastMatchPos, currMatchPos);

    //scrub text on page - tolower, remove non alpha
    transform(newPair.second.begin(), newPair.second.end(),
              newPair.second.begin(), formatWords);

    this->byPage.push_back(newPair);

    lastMatchPos = currMatchPos + currMatchLen;
  }
  return true;
}

//constructor when book info has been already loaded
BookIndex::BookIndex(CommonWordHash *cWords,
                     std::vector<BookIndex::PagePair> *thesePages)
{
  this->cWords = cWords;
  this->byPage = *thesePages;
}

//BookIndex
//loads & formats data needed to generate index
bool BookIndex::LoadBookInfo(CommonWordHash* cwords, stringstream &book)
{
  this->cWords = cwords;

  return (splitIntoPages(book));
}


text:
<?php

namespace Bolt\Storage\Mapping\Type;

use Carbon\Carbon;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\DateTimeType;

class CarbonDateTimeType extends DateTimeType
{
    /**
     * {@inheritdoc}
     */
    public function convertToPHPValue($value, AbstractPlatform $platform)
    {
        if ($value === null) {
            return $value;
        }

        return Carbon::instance(parent::convertToPHPValue($value, $platform));
    }
}


text:
game.EnemyBaseEntity = me.Entity.extend({
    init: function(x, y, settings) {
        this._super(me.Entity, 'init', [x, y, {
                // Properties of the base, how wide, how tall etc.
            image: "tower",
            width: 100,
            height: 100,
            spritewidth: "100",
            spriteheight: "100",
            getShape: function() {
                return (new me.Rect(0, 0, 100, 70)).toPolygon();
            }
        }]);
     this.broken = false;
        this.health= game.data.enemyBaseHealth;
        this.alwaysUpdate=true;
        this.body.onCollision = this.onCollision.bind(this);
        this.type= "EnemyBaseEntity";

           this.renderable.addAnimation("idle", [0]);
           this.renderable.addAnimation("broken", [1]);
           this.renderable.setCurrentAnimation("idle");

      },
    update: function(delta) {
          if(this.health<=0){
              this.broken=true;
              this.renderable.setCurrentAnimation("broken");
          }
          this.body.update(delta);

          this._super(me.Entity, "update", [delta]);
          return true;
    },

    loseHealth: function (damage) {
        this.health = this.health - damage;
    },

    onCollision: function () {

    }

});


text:
#pragma once
#include <aws/codestar/CodeStar_EXPORTS.h>
#include <aws/codestar/CodeStarRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>

namespace Aws
{
namespace CodeStar
{
namespace Model
{

  /**
   */
  class AWS_CODESTAR_API DisassociateTeamMemberRequest : public CodeStarRequest
  {
  public:
    DisassociateTeamMemberRequest();
    Aws::String SerializePayload() const override;

    Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;

    /**
     *
The ID of the AWS CodeStar project from which you want to remove a team
     * member.

     */
    inline const Aws::String& GetProjectId() const{ return m_projectId; }

    /**
     *
The ID of the AWS CodeStar project from which you want to remove a team
     * member.

     */
    inline void SetProjectId(const Aws::String& value) { m_projectIdHasBeenSet = true; m_projectId = value; }

    /**
     *
The ID of the AWS CodeStar project from which you want to remove a team
     * member.

     */
    inline void SetProjectId(Aws::String&& value) { m_projectIdHasBeenSet = true; m_projectId = std::move(value); }

    /**
     *
The ID of the AWS CodeStar project from which you want to remove a team
     * member.

     */
    inline void SetProjectId(const char* value) { m_projectIdHasBeenSet = true; m_projectId.assign(value); }

    /**
     *
The ID of the AWS CodeStar project from which you want to remove a team
     * member.

     */
    inline DisassociateTeamMemberRequest& WithProjectId(const Aws::String& value) { SetProjectId(value); return *this;}

    /**
     *
The ID of the AWS CodeStar project from which you want to remove a team
     * member.

     */
    inline DisassociateTeamMemberRequest& WithProjectId(Aws::String&& value) { SetProjectId(std::move(value)); return *this;}

    /**
     *
The ID of the AWS CodeStar project from which you want to remove a team
     * member.

     */
    inline DisassociateTeamMemberRequest& WithProjectId(const char* value) { SetProjectId(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the IAM user or group whom you want to
     * remove from the project.

     */
    inline const Aws::String& GetUserArn() const{ return m_userArn; }

    /**
     *
The Amazon Resource Name (ARN) of the IAM user or group whom you want to
     * remove from the project.

     */
    inline void SetUserArn(const Aws::String& value) { m_userArnHasBeenSet = true; m_userArn = value; }

    /**
     *
The Amazon Resource Name (ARN) of the IAM user or group whom you want to
     * remove from the project.

     */
    inline void SetUserArn(Aws::String&& value) { m_userArnHasBeenSet = true; m_userArn = std::move(value); }

    /**
     *
The Amazon Resource Name (ARN) of the IAM user or group whom you want to
     * remove from the project.

     */
    inline void SetUserArn(const char* value) { m_userArnHasBeenSet = true; m_userArn.assign(value); }

    /**
     *
The Amazon Resource Name (ARN) of the IAM user or group whom you want to
     * remove from the project.

     */
    inline DisassociateTeamMemberRequest& WithUserArn(const Aws::String& value) { SetUserArn(value); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the IAM user or group whom you want to
     * remove from the project.

     */
    inline DisassociateTeamMemberRequest& WithUserArn(Aws::String&& value) { SetUserArn(std::move(value)); return *this;}

    /**
     *
The Amazon Resource Name (ARN) of the IAM user or group whom you want to
     * remove from the project.

     */
    inline DisassociateTeamMemberRequest& WithUserArn(const char* value) { SetUserArn(value); return *this;}

  private:
    Aws::String m_projectId;
    bool m_projectIdHasBeenSet;
    Aws::String m_userArn;
    bool m_userArnHasBeenSet;
  };

} // namespace Model
} // namespace CodeStar
} // namespace Aws


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Magazin Ges. naturf. Freunde, Berlin 8: 27 (1816)

#### Original name
Hypodermium leguminosarum Link

### Remarks
null


text:
package com.javarush.test.level22.lesson05.home01;

class TooShortStringSecondThreadException extends RuntimeException {

  TooShortStringSecondThreadException(StringIndexOutOfBoundsException e) {
  }
}


text:
package com.lachesis.support.auth.repository;

import java.io.Serializable;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.lachesis.support.auth.model.AuthRole;

public interface AuthRoleRepository {
	AuthRole findById(@Param("id") Serializable id);
	List<AuthRole> findByIds(@Param("ids") List<Long> ids);
	List<AuthRole> findByUserId(@Param("userId") Serializable userId);
}


text:
package com.emc.storageos.model.application;

import java.util.HashSet;
import java.util.Set;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import org.codehaus.jackson.annotate.JsonProperty;

import com.emc.storageos.model.DataObjectRestRep;
import com.emc.storageos.model.NamedRelatedResourceRep;
import com.emc.storageos.model.RelatedResourceRep;

@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlRootElement(name = "volume_group")
public class VolumeGroupRestRep extends DataObjectRestRep {
    private String description;
    private Set<String> roles;
    private RelatedResourceRep parent;
    private String migrationType;
    private String migrationGroupBy;
    private Set<String> replicationGroupNames;
    private Set<NamedRelatedResourceRep> virtualArrays;

    @XmlElement
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @XmlElementWrapper(name = "roles")
    /**
     * Roles of the volume group
     *
     */
    @XmlElement(name = "role")
    public Set<String> getRoles() {
        if (roles == null) {
            roles = new HashSet<String>();
        }
        return roles;
    }

    public void setRoles(Set<String> roles) {
        this.roles = roles;
    }

    /**
     * Related parent volume group
     *
     */
    @XmlElement(name = "parent")
    @JsonProperty("parent")
    public RelatedResourceRep getParent() {
        return parent;
    }

    public void setParent(RelatedResourceRep parent) {
        this.parent = parent;
    }

    /**
     * Migration type for the mobility group
     *
     * @return migration type
     */
    @XmlElement(name = "migrationType")
    public String getMigrationType() {
        return migrationType;
    }

    public void setMigrationType(String migrationType) {
        this.migrationType = migrationType;
    }

    /**
     * Migration group by type for the mobility group
     *
     * @return migration group by
     */
    @XmlElement(name = "migrationGroupBy")
    public String getMigrationGroupBy() {
        return migrationGroupBy;
    }

    public void setMigrationGroupBy(String migrationGroupBy) {
        this.migrationGroupBy = migrationGroupBy;
    }

    /**
     * @return the replicationGroupNames
     */
    @XmlElementWrapper(name = "replication_group_names")
    @XmlElement(name = "replication_group_name")
    public Set<String> getReplicationGroupNames() {
        if (replicationGroupNames == null) {
            replicationGroupNames = new HashSet<String>();
        }
        return replicationGroupNames;
    }

    /**
     * @param replicationGroupNames the replicationGroupNames to set
     */
    public void setReplicationGroupNames(Set<String> replicationGroupNames) {
        this.replicationGroupNames = replicationGroupNames;
    }

    /**
     * @return the virtualArrays
     */
    @XmlElementWrapper(name = "virtual_arrays")
    @XmlElement(name = "virtual_array")
    public Set<NamedRelatedResourceRep> getVirtualArrays() {
        return virtualArrays;
    }

    /**
     * @param virtualArrays the virtualArrays to set
     */
    public void setVirtualArrays(Set<NamedRelatedResourceRep> virtualArrays) {
        this.virtualArrays = virtualArrays;
    }
}