text:
<?xml version="1.0" encoding="utf-8"?><!--Layout resource fo user page layout.-->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:card_view="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".ui.fragment.UserFragment">

    <android.support.design.widget.CoordinatorLayout
        android:id="@+id/coordinator_layout"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <android.support.design.widget.AppBarLayout
            android:id="@+id/app_bar_layout"
            android:layout_width="match_parent"
            android:layout_height="192dp"
            android:theme="@style/AppTheme.AppBarOverlay">

            <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/collapsing_toolbar"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:contentScrim="?attr/colorPrimary"
                app:layout_scrollFlags="scroll|exitUntilCollapsed">

                <ImageView
                    android:id="@+id/avatar"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:scaleType="centerCrop"
                    app:layout_collapseMode="parallax"/>

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    android:background="@drawable/toolbar_gradient"
                    app:layout_collapseMode="parallax"/>

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:src="@drawable/toolbar_parallax_shadow"
                    app:layout_collapseMode="parallax"/>

                <android.support.v7.widget.Toolbar
                    android:id="@+id/toolbar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:layout_collapseMode="pin"
                    app:popupTheme="@style/AppTheme.PopupOverlay"/>

            </android.support.design.widget.CollapsingToolbarLayout>

        </android.support.design.widget.AppBarLayout>

        <android.support.v4.widget.SwipeRefreshLayout
            android:id="@+id/swipe_refresh"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior">

            <android.support.v4.widget.NestedScrollView
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:clipChildren="false"
                    android:clipToPadding="false"
                    android:orientation="vertical"
                    android:padding="8dp">

                    <android.support.v7.widget.CardView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="4dp"
                        card_view:cardBackgroundColor="@color/card_color">

                        <include layout="@layout/content_user_status"/>

                    </android.support.v7.widget.CardView>

                    <android.support.v7.widget.CardView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="4dp"
                        android:layout_marginTop="4dp"
                        card_view:cardBackgroundColor="@color/card_color">

                        <include layout="@layout/content_user_backpack"/>

                    </android.support.v7.widget.CardView>

                    <android.support.v7.widget.CardView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginBottom="4dp"
                        android:layout_marginTop="4dp"
                        card_view:cardBackgroundColor="@color/card_color">

                        <include layout="@layout/content_user_reputation"/>

                    </android.support.v7.widget.CardView>

                    <android.support.v7.widget.CardView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="4dp"
                        card_view:cardBackgroundColor="@color/card_color">

                        <include layout="@layout/content_user_links"/>

                    </android.support.v7.widget.CardView>

                </LinearLayout>

            </android.support.v4.widget.NestedScrollView>

        </android.support.v4.widget.SwipeRefreshLayout>

    </android.support.design.widget.CoordinatorLayout>

</LinearLayout>


text:
id: functions-overview
title: Pulsar Functions overview
sidebar_label: "Overview"
original_id: functions-overview
---

**Pulsar Functions** are lightweight compute processes that

* consume messages from one or more Pulsar topics,
* apply a user-supplied processing logic to each message,
* publish the results of the computation to another topic.

## Goals
With Pulsar Functions, you can create complex processing logic without deploying a separate neighboring system (such as [Apache Storm](http://storm.apache.org/), [Apache Heron](https://heron.incubator.apache.org/), [Apache Flink](https://flink.apache.org/)). Pulsar Functions are computing infrastructure of Pulsar messaging system. The core goal is tied to a series of other goals:

* Developer productivity (language-native vs Pulsar Functions SDK functions)
* Easy troubleshooting
* Operational simplicity (no need for an external processing system)

## Inspirations
Pulsar Functions are inspired by (and take cues from) several systems and paradigms:

* Stream processing engines such as [Apache Storm](http://storm.apache.org/), [Apache Heron](https://apache.github.io/incubator-heron), and [Apache Flink](https://flink.apache.org)
* "Serverless" and "Function as a Service" (FaaS) cloud platforms like [Amazon Web Services Lambda](https://aws.amazon.com/lambda/), [Google Cloud Functions](https://cloud.google.com/functions/), and [Azure Cloud Functions](https://azure.microsoft.com/en-us/services/functions/)

Pulsar Functions can be described as

* [Lambda](https://aws.amazon.com/lambda/)-style functions that are
* specifically designed to use Pulsar as a message bus.

## Programming model
Pulsar Functions provide a wide range of functionality, and the core programming model is simple. Functions receive messages from one or more **input [topics](reference-terminology.md#topic)**. Each time a message is received, the function will complete the following tasks.

  * Apply some processing logic to the input and write output to:
    * An **output topic** in Pulsar
    * [Apache BookKeeper](functions-develop.md#state-storage)
  * Write logs to a **log topic** (potentially for debugging purposes)
  * Increment a [counter](#word-count-example)

![Pulsar Functions core programming model](/assets/pulsar-functions-overview.png)

You can use Pulsar Functions to set up the following processing chain:

* A Python function listens for the `raw-sentences` topic and "sanitizes" incoming strings (removing extraneous whitespace and converting all characters to lowercase) and then publishes the results to a `sanitized-sentences` topic.
* A Java function listens for the `sanitized-sentences` topic, counts the number of times each word appears within a specified time window, and publishes the results to a `results` topic
* Finally, a Python function listens for the `results` topic and writes the results to a MySQL table.

### Word count example

If you implement the classic word count example using Pulsar Functions, it looks something like this:

![Pulsar Functions word count example](/assets/pulsar-functions-word-count.png)

To write the function in Java with [Pulsar Functions SDK for Java](functions-develop.md#available-apis), you can write the function as follows.

```java

package org.example.functions;

import org.apache.pulsar.functions.api.Context;
import org.apache.pulsar.functions.api.Function;

import java.util.Arrays;

public class WordCountFunction implements Function<String, Void> {
    // This function is invoked every time a message is published to the input topic
    @Override
    public Void process(String input, Context context) throws Exception {
        Arrays.asList(input.split(" ")).forEach(word -> {
            String counterKey = word.toLowerCase();
            context.incrCounter(counterKey, 1);
        });
        return null;
    }
}

```

Bundle and build the JAR file to be deployed, and then deploy it in your Pulsar cluster using the [command line](functions-deploy.md#command-line-interface) as follows.

```bash

$ bin/pulsar-admin functions create \
  --jar target/my-jar-with-dependencies.jar \
  --classname org.example.functions.WordCountFunction \
  --tenant public \
  --namespace default \
  --name word-count \
  --inputs persistent://public/default/sentences \
  --output persistent://public/default/count

```

### Content-based routing example

Pulsar Functions are used in many cases. The following is a sophisticated example that involves content-based routing.

For example, a function takes items (strings) as input and publishes them to either a `fruits` or `vegetables` topic, depending on the item. Or, if an item is neither fruit nor vegetable, a warning is logged to a [log topic](functions-develop.md#logger). The following is a visual representation.

![Pulsar Functions routing example](/assets/pulsar-functions-routing-example.png)

If you implement this routing functionality in Python, it looks something like this:

```python

from pulsar import Function

class RoutingFunction(Function):
    def __init__(self):
        self.fruits_topic = "persistent://public/default/fruits"
        self.vegetables_topic = "persistent://public/default/vegetables"

    @staticmethod
    def is_fruit(item):
        return item in [b"apple", b"orange", b"pear", b"other fruits..."]

    @staticmethod
    def is_vegetable(item):
        return item in [b"carrot", b"lettuce", b"radish", b"other vegetables..."]

    def process(self, item, context):
        if self.is_fruit(item):
            context.publish(self.fruits_topic, item)
        elif self.is_vegetable(item):
            context.publish(self.vegetables_topic, item)
        else:
            warning = "The item {0} is neither a fruit nor a vegetable".format(item)
            context.get_logger().warn(warning)

```

If this code is stored in `~/router.py`, then you can deploy it in your Pulsar cluster using the [command line](functions-deploy.md#command-line-interface) as follows.

```bash

$ bin/pulsar-admin functions create \
  --py ~/router.py \
  --classname router.RoutingFunction \
  --tenant public \
  --namespace default \
  --name route-fruit-veg \
  --inputs persistent://public/default/basket-items

```

### Functions, messages and message types
Pulsar Functions take byte arrays as inputs and spit out byte arrays as output. However in languages that support typed interfaces(Java), you can write typed Functions, and bind messages to types in the following ways.
* [Schema Registry](functions-develop.md#schema-registry)
* [SerDe](functions-develop.md#serde)

## Fully Qualified Function Name (FQFN)
Each Pulsar Function has a **Fully Qualified Function Name** (FQFN) that consists of three elements: the function tenant, namespace, and function name. FQFN looks like this:

```http

tenant/namespace/name

```

FQFNs enable you to create multiple functions with the same name provided that they are in different namespaces.

## Supported languages
Currently, you can write Pulsar Functions in Java, Python, and Go. For details, refer to [Develop Pulsar Functions](functions-develop).

## Processing guarantees
Pulsar Functions provide three different messaging semantics that you can apply to any function.

Delivery semantics | Description
:------------------|:-------
**At-most-once** delivery | Each message sent to the function is likely to be processed, or not to be processed (hence "at most").
**At-least-once** delivery | Each message sent to the function can be processed more than once (hence the "at least").
**Effectively-once** delivery | Each message sent to the function will have one output associated with it.

### Apply processing guarantees to a function
You can set the processing guarantees for a Pulsar Function when you create the Function. The following [`pulsar-function create`](reference-pulsar-admin.md#create-1) command creates a function with effectively-once guarantees applied.

```bash

$ bin/pulsar-admin functions create \
  --name my-effectively-once-function \
  --processing-guarantees EFFECTIVELY_ONCE \
  # Other function configs

```

The available options for `--processing-guarantees` are:

* `ATMOST_ONCE`
* `ATLEAST_ONCE`
* `EFFECTIVELY_ONCE`

> By default, Pulsar Functions provide at-least-once delivery guarantees. So if you create a function without supplying a value for the `--processingGuarantees` flag, the function provides at-least-once guarantees.

### Update the processing guarantees of a function
You can change the processing guarantees applied to a function using the [`update`](reference-pulsar-admin.md#update-1) command. The following is an example.

```bash

$ bin/pulsar-admin functions update \
  --processing-guarantees ATMOST_ONCE \
  # Other function configs

```

redpajama_set_name: RedPajamaGithub


text:
package com.google.android.libraries.remixer.ui.gesture;

import android.annotation.SuppressLint;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.util.SparseArray;
import android.view.MotionEvent;
import android.view.View;
import com.google.android.libraries.remixer.ui.view.RemixerFragment;

/**
 * A Gesture Listener that expects multi-finger swipes in a direction to trigger the display of a
 * RemixerFragment.
 *
 * <p>It is configurable, allowing you to set the number of fingers (two or more), and the direction
 * of the swipe. It can be set up by calling {@link #attach(FragmentActivity, Direction, int,
 * RemixerFragment)} or {@link RemixerFragment#attachToGesture(FragmentActivity, Direction, int)}.
 */
public class GestureListener implements View.OnTouchListener {

  /**
   * Minimum movement in pixels to consider this a successful swipe
   */
  private static final int THRESHOLD = 100;
  /**
   * The FragmentManager for the activity, it is used to show the RemixerFragment.
   */
  private final FragmentManager fragmentManager;
  /**
   * Minimum number of fingers to swipe to trigger the callback.
   */
  private final int numberOfFingers;
  /**
   * Direction to swipe.
   */
  private final Direction direction;
  /**
   * The remixer fragment to show once the swipe succeeds.
   */
  private final RemixerFragment remixerFragment;

  /**
   * Map of all the fingers that are currently touching the screen.
   */
  private SparseArray<FingerPosition> fingerPositions = new SparseArray<>();

  /**
   * Attaches a GestureListener to {@code activity} that watches for swipes in the direction {@code
   * direction} with at least {@code numberOfFingers} and shows {@code remixerFragment} when found.
   */
  public static void attach(
      FragmentActivity activity,
      Direction direction,
      int numberOfFingers,
      RemixerFragment remixerFragment) {
    activity.findViewById(android.R.id.content).setOnTouchListener(
        new GestureListener(
            direction, numberOfFingers, activity.getSupportFragmentManager(), remixerFragment));
  }

  private GestureListener(
      Direction direction,
      int numberOfFingers,
      FragmentManager fragmentManager,
      RemixerFragment remixerFragment) {
    if (numberOfFingers < 2) {
      throw new IllegalArgumentException("GestureListener requires at least 2 fingers");
    }
    this.direction = direction;
    this.numberOfFingers = numberOfFingers;
    this.fragmentManager = fragmentManager;
    this.remixerFragment = remixerFragment;
  }

  @Override
  @SuppressLint("ClickableViewAccessibility")
  public boolean onTouch(View view, MotionEvent motionEvent) {
    int pointerIndex = motionEvent.getActionIndex();
    int pointerId = motionEvent.getPointerId(pointerIndex);
    FingerPosition position;
    switch (motionEvent.getActionMasked()) {
      case MotionEvent.ACTION_DOWN:
        // Paranoia mode, if it's the first finger down make sure that we're in a clean slate
        fingerPositions.clear();
        // fall-through
      case MotionEvent.ACTION_POINTER_DOWN:
        position =
            new FingerPosition(motionEvent.getX(pointerIndex), motionEvent.getY(pointerIndex));
        fingerPositions.put(pointerId, position);
        break;
      case MotionEvent.ACTION_MOVE:
        // When the action is MotionEvent.ACTION_MOVE, the action index is meaningless, it is
        // always the original pointer from ACTION_DOWN, you have to iterate through all of them
        // because they all could contain updates.
        for (int i = 0; i < motionEvent.getPointerCount(); i++) {
          int movedPointerId = motionEvent.getPointerId(i);
          position = fingerPositions.get(movedPointerId);
          position.setCurrentPosition(motionEvent.getX(i), motionEvent.getY(i));
        }
        break;
      case MotionEvent.ACTION_UP:
        boolean correctlySwiped = fingerPositions.size() == numberOfFingers;
        for (int i = 0; i < fingerPositions.size() && correctlySwiped; i++) {
          if (!fingerPositions.valueAt(i).movedInDirectionPastThreshold(direction)) {
            correctlySwiped = false;
          }
        }
        if (correctlySwiped) {
          remixerFragment.showRemixer(fragmentManager, RemixerFragment.REMIXER_TAG);
        }
        // fall-through
      case MotionEvent.ACTION_CANCEL:
        fingerPositions.clear();
        break;
      case MotionEvent.ACTION_POINTER_UP:
        break;
    }
    return true;
  }

  /**
   * Simple struct that represents the finger position, including a value for where it used to be
   * when it first touched the screen.
   */
  private static class FingerPosition {
    private final float initialX;
    private final float initialY;
    private float currentX;
    private float currentY;

    private FingerPosition(float initialX, float initialY) {
      this.initialX = initialX;
      this.initialY = initialY;
      currentX = initialX;
      currentY = initialY;
    }

    public void setCurrentPosition(float currentX, float currentY) {
      this.currentX = currentX;
      this.currentY = currentY;
    }

    /**
     * Checks whether this finger has moved at least {@link #THRESHOLD} in the correct direction.
     */
    public boolean movedInDirectionPastThreshold(Direction direction) {
      return direction.checkMovement(currentX - initialX, currentY - initialY, THRESHOLD);
    }
  }
}


text:
Contact Us

Contact

            Business Inquiries

            neomed.healthcare@yahoo.co.in

            India

              Hyderabad

              #1-10-71/2, 1st Floor, Street No. 11, Ashok Nagar, Hyderabad, Telangana, INDIA

Tel: +040 2767 4604

              Kakinada

              #8-13-9-23/1,Penumudi Street, Pratap Nagar, Kakinada, Andhra Pradesh, INDIA

Tel: +0884 237 1062

In case of queries or complaints, you can either write to us or call the respective telephone numbers. We request you to be as specific as possible so that we can respond back with the most accurate answer.

Please use the form below.

        <form name="contactForm" method="get" action="#!/requestSuccess">

            Email Address:
            <input type="email" id="emailInput" placeholder="Enter email here.." required/>

            Mobile:
            <input type="num" id="mobileInput" placeholder="Enter number here.." required/>

            Message:
            <textarea  id="messageInput" rows="3" placeholder="Enter your message here.."></textarea>

          <input type="submit" value="SUBMIT"/>
        </form>


text:
<?php
$firstName =$_POST['full_Name'];
$lastName =$_POST['last_Name'];
$email =$_POST['email'];
$link = mysqli_connect("localhost",
    "root",
    "lict@2",
    "students");

$query = "INSERT INTO `students`.`users` ( `first_name` , `last_name`,`email_add` )

                                        VALUES ('$firstName','$lastName','$email')";
mysqli_query($link, $query);


text:
package org.apache.druid.data.input.protobuf;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.os72.protobuf.dynamic.DynamicSchema;
import com.google.common.annotations.VisibleForTesting;
import com.google.protobuf.ByteString;
import com.google.protobuf.Descriptors;
import com.google.protobuf.DynamicMessage;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.common.parsers.ParseException;

import java.nio.ByteBuffer;
import java.util.Objects;
import java.util.Set;

public abstract class DescriptorBasedProtobufBytesDecoder implements ProtobufBytesDecoder
{
  private Descriptors.Descriptor descriptor;
  private final String protoMessageType;

  public DescriptorBasedProtobufBytesDecoder(
      final String protoMessageType
  )
  {
    this.protoMessageType = protoMessageType;
  }

  @JsonProperty
  public String getProtoMessageType()
  {
    return protoMessageType;
  }

  public Descriptors.Descriptor getDescriptor()
  {
    return descriptor;
  }

  @VisibleForTesting
  void initDescriptor()
  {
    if (this.descriptor == null) {
      final DynamicSchema dynamicSchema = generateDynamicSchema();
      this.descriptor = generateDescriptor(dynamicSchema);
    }
  }

  protected abstract DynamicSchema generateDynamicSchema();

  @Override
  public DynamicMessage parse(ByteBuffer bytes)
  {
    try {
      DynamicMessage message = DynamicMessage.parseFrom(descriptor, ByteString.copyFrom(bytes));
      return message;
    }
    catch (Exception e) {
      throw new ParseException(null, e, "Fail to decode protobuf message!");
    }
  }

  private Descriptors.Descriptor generateDescriptor(DynamicSchema dynamicSchema)
  {
    Set<String> messageTypes = dynamicSchema.getMessageTypes();
    if (messageTypes.size() == 0) {
      throw new ParseException(null, "No message types found in the descriptor.");
    }

    String messageType = protoMessageType == null ? (String) messageTypes.toArray()[0] : protoMessageType;
    Descriptors.Descriptor desc = dynamicSchema.getMessageDescriptor(messageType);
    if (desc == null) {
      throw new ParseException(
          null,
          StringUtils.format(
              "Protobuf message type %s not found in the specified descriptor.  Available messages types are %s",
              protoMessageType,
              messageTypes
          )
      );
    }
    return desc;
  }

  @Override
  public boolean equals(Object o)
  {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    DescriptorBasedProtobufBytesDecoder that = (DescriptorBasedProtobufBytesDecoder) o;
    return Objects.equals(getProtoMessageType(), that.getProtoMessageType());
  }

  @Override
  public int hashCode()
  {
    return Objects.hash(getProtoMessageType());
  }
}


text:
import { difference } from '../index';
export default difference;


text:
package org.cloudio.morpheus.tutor.chat.frag.misc.sharedState.case2

import org.morpheus._
import org.morpheus.Morpheus._

/**
* A demonstration of sharing state between fragments.
*
* In this case we separate the common state to a new fragment.
*
* Created by zslajchrt on 26/05/15.
*/

@fragment trait Contact {
  var name: String = null
}

trait ContactState {
  var address: String
  def sendMessage(msg: String): Unit
}

@fragment trait OfflineContact extends ContactState {
  this: Contact =>

  private var email: String = null
  override def address: String = email
  override def address_=(em: String): Unit = {
    email = em
  }

  override def sendMessage(msg: String) {
    // todo
    println(s"Sending message to $name <$address> by email")
  }
}

@fragment trait OnlineContact extends ContactState {
  this: Contact =>

  private var chatId: String = null
  override def address: String = chatId
  override def address_=(em: String): Unit = {
    chatId = em
  }

  override def sendMessage(msg: String) {
    // todo
    println(s"Sending message to $name <$address> by chat")
  }
}

object Session {
  def main(args: Array[String]) {
    type ContactMorphType = Contact with (OfflineContact or OnlineContact)
    val contactKernel = singleton[ContactMorphType]
    val contact = contactKernel.~
    contact.name = "Josef"
    contact.address = "pepa@gmail.com"
    println(contact.address)
    contact.sendMessage("ssss")

    contactKernel.~.remorph(promote[ContactMorphType](1))

    contact.address = "chat:pepa"
    contact.sendMessage("ssss")

    contact.name = "Josef2"
    contact.sendMessage("ssss")

    contact.address = "chat:pepa2"
    contactKernel.~.remorph(promote[ContactMorphType](0))
    contact.sendMessage("ssss")

  }
}


text:
var json = {
	encode: JSON.stringify,
	decode: JSON.parse
};

var MsgPack = require('node-msgpack');
msgpack = {
	encode: MsgPack.pack,
	decode: function(str) { return MsgPack.unpack(new Buffer(str)); }
};

bison = require('bison');

module.exports = json;
//module.exports = msgpack;
//module.exports = bison;


text:
@charset "UTF-8";
html {
  box-sizing: border-box; }

*, *::after, *::before {
  box-sizing: inherit; }

button, input[type="button"], input[type="reset"], input[type="submit"] {
  appearance: none;
  background-color: #996600;
  border: 0;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-family: "Kreon", serif;
  font-size: 1.3em;
  -webkit-font-smoothing: antialiased;
  font-weight: 600;
  line-height: 1;
  padding: 0.75em 1.5em;
  text-align: center;
  text-decoration: none;
  transition: background-color 150ms ease;
  user-select: none;
  vertical-align: middle;
  white-space: nowrap; }
  button:hover, button:focus, input[type="button"]:hover, input[type="button"]:focus, input[type="reset"]:hover, input[type="reset"]:focus, input[type="submit"]:hover, input[type="submit"]:focus {
    background-color: #7a5200;
    color: #fff; }
  button:disabled, input[type="button"]:disabled, input[type="reset"]:disabled, input[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.5; }
    button:disabled:hover, input[type="button"]:disabled:hover, input[type="reset"]:disabled:hover, input[type="submit"]:disabled:hover {
      background-color: #996600; }

fieldset {
  background-color: transparent;
  border: 0;
  margin: 0;
  padding: 0; }

legend {
  font-weight: 600;
  margin-bottom: 0.375em;
  padding: 0; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375em; }

input,
select,
textarea {
  display: block;
  font-family: "Kreon", serif;
  font-size: 1.3em; }

input[type="color"], input[type="date"], input[type="datetime"], input[type="datetime-local"], input[type="email"], input[type="month"], input[type="number"], input[type="password"], input[type="search"], input[type="tel"], input[type="text"], input[type="time"], input[type="url"], input[type="week"], input:not([type]), textarea {
  appearance: none;
  background-color: #FFFFFF;
  border: 1px solid #ddd;
  border-radius: 3px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
  margin-bottom: 0.75em;
  padding: 0.5em;
  transition: border-color 150ms ease;
  width: 100%; }
  input[type="color"]:hover, input[type="date"]:hover, input[type="datetime"]:hover, input[type="datetime-local"]:hover, input[type="email"]:hover, input[type="month"]:hover, input[type="number"]:hover, input[type="password"]:hover, input[type="search"]:hover, input[type="tel"]:hover, input[type="text"]:hover, input[type="time"]:hover, input[type="url"]:hover, input[type="week"]:hover, input:not([type]):hover, textarea:hover {
    border-color: #b1b1b1; }
  input[type="color"]:focus, input[type="date"]:focus, input[type="datetime"]:focus, input[type="datetime-local"]:focus, input[type="email"]:focus, input[type="month"]:focus, input[type="number"]:focus, input[type="password"]:focus, input[type="search"]:focus, input[type="tel"]:focus, input[type="text"]:focus, input[type="time"]:focus, input[type="url"]:focus, input[type="week"]:focus, input:not([type]):focus, textarea:focus {
    border-color: #996600;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 5px rgba(128, 85, 0, 0.7);
    outline: none; }
  input[type="color"]:disabled, input[type="date"]:disabled, input[type="datetime"]:disabled, input[type="datetime-local"]:disabled, input[type="email"]:disabled, input[type="month"]:disabled, input[type="number"]:disabled, input[type="password"]:disabled, input[type="search"]:disabled, input[type="tel"]:disabled, input[type="text"]:disabled, input[type="time"]:disabled, input[type="url"]:disabled, input[type="week"]:disabled, input:not([type]):disabled, textarea:disabled {
    background-color: #f2f2f2;
    cursor: not-allowed; }
    input[type="color"]:disabled:hover, input[type="date"]:disabled:hover, input[type="datetime"]:disabled:hover, input[type="datetime-local"]:disabled:hover, input[type="email"]:disabled:hover, input[type="month"]:disabled:hover, input[type="number"]:disabled:hover, input[type="password"]:disabled:hover, input[type="search"]:disabled:hover, input[type="tel"]:disabled:hover, input[type="text"]:disabled:hover, input[type="time"]:disabled:hover, input[type="url"]:disabled:hover, input[type="week"]:disabled:hover, input:not([type]):disabled:hover, textarea:disabled:hover {
      border: 1px solid #ddd; }
  input[type="color"]::placeholder, input[type="date"]::placeholder, input[type="datetime"]::placeholder, input[type="datetime-local"]::placeholder, input[type="email"]::placeholder, input[type="month"]::placeholder, input[type="number"]::placeholder, input[type="password"]::placeholder, input[type="search"]::placeholder, input[type="tel"]::placeholder, input[type="text"]::placeholder, input[type="time"]::placeholder, input[type="url"]::placeholder, input[type="week"]::placeholder, input:not([type])::placeholder, textarea::placeholder {
    color: #858585; }

textarea {
  resize: vertical; }

[type="checkbox"],
[type="radio"] {
  display: inline;
  margin-right: 0.375em; }

[type="file"] {
  margin-bottom: 0.75em;
  width: 100%; }

select {
  margin-bottom: 0.75em;
  width: 100%; }

html {
  box-sizing: border-box; }

*,
*::before,
*::after {
  box-sizing: inherit; }

html,
body {
  height: 100%; }

ul,
ol {
  list-style-type: none;
  margin: 0;
  padding: 0; }

dl {
  margin: 0; }

dt {
  font-weight: 600;
  margin: 0; }

dd {
  margin: 0; }

figure {
  margin: 0; }

img,
picture {
  margin: 0;
  max-width: 100%; }

table {
  border-collapse: collapse;
  margin: 0.75em 0;
  table-layout: fixed;
  width: 100%; }

th {
  border-bottom: 1px solid #a6a6a6;
  font-weight: 600;
  padding: 0.75em 0;
  text-align: left; }

td {
  border-bottom: 1px solid #ddd;
  padding: 0.75em 0; }

tr,
td,
th {
  vertical-align: middle; }

body {
  color: #333;
  font-family: "Kreon", serif;
  font-size: 1.3em;
  line-height: 1.5; }

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Walter Turncoat", cursive;
  font-size: 1.333em;
  line-height: 1.2;
  margin: 0 0 0.75em; }

p {
  margin: 0 0 0.75em; }

a {
  color: #996600;
  text-decoration: none;
  transition: color 150ms ease; }
  a:active, a:focus, a:hover {
    color: #734d00; }

hr {
  border-bottom: 1px solid #ddd;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  margin: 1.5em 0; }

.gold {
  color: #996600; }

body {
  margin: 0; }

main {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  background-color: #FFFFFF; }
  main::after {
    clear: both;
    content: "";
    display: block; }

header nav {
  padding: 2.35765%;
  float: left;
  display: block;
  margin-right: 2.35765%;
  width: 100%;
  text-align: center; }
  header nav:last-child {
    margin-right: 0; }
  header nav ul li {
    display: inline; }
    @media screen and (max-width: 600px) {
      header nav ul li {
        display: block; } }
    header nav ul li h3 {
      padding: 0 1.5em;
      display: inline; }

section {
  background-color: #FFFFFF;
  float: left;
  display: block;
  margin-right: 2.35765%;
  width: 100%;
  padding: 2.35765%; }
  section:last-child {
    margin-right: 0; }

#registery div,
#rsvp div {
  padding: 2.35765%; }
#registery a,
#rsvp a {
  text-decoration: underline; }

section + section {
  margin-top: 30px; }

footer {
  margin-top: 30px;
  color: #999;
  text-align: center; }

p::selection {
  color: #FFFFFF;
  background-color: #996600; }

hr {
  padding: 0;
  margin-bottom: 0;
  border: none;
  border-top: 2px dashed #999;
  color: #996600;
  text-align: center; }

hr:after {
  content: '♥';
  display: inline-block;
  position: relative;
  top: -0.7em;
  font-size: 1.8em;
  padding: 0 0.25em;
  background: #FFFFFF; }

.getting-there,
.accomodations {
  margin-top: 30px;
  float: left;
  display: block;
  margin-right: 2.35765%;
  width: 100%; }
  .getting-there p,
  .accomodations p {
    font-size: .8em; }
  .getting-there:last-child,
  .accomodations:last-child {
    margin-right: 0; }

.directions {
  display: block; }
  .directions::after {
    clear: both;
    content: "";
    display: block; }
  .directions div {
    float: left;
    display: block;
    margin-right: 2.35765%;
    width: 48.82117%; }
    .directions div:last-child {
      margin-right: 0; }
  .directions ul {
    margin-bottom: 40px; }
    .directions ul h5 {
      font-size: 1.0em; }
  .directions li p {
    margin: 0;
    padding: 0;
    font-size: .8em;
    font-weight: normal; }

sup {
  font-size: .6em; }

.billboard {
  background-position: center top, center;
  background-repeat: no-repeat, repeat-x;
  background-size: cover;
  height: 500px;
  background-image: url("../../assets/img/banner.png");
  background-image: url("../../assets/img/banner.png"); }
  @media screen and (max-width: 600px) {
    .billboard {
      margin-left: -420px; } }
  .billboard .welcome {
    float: left;
    display: block;
    margin-right: 2.35765%;
    width: 48.82117%;
    margin-left: 8.5298%;
    padding: 2.35765%;
    color: #FFFFFF;
    position: relative;
    max-width: 800px;
    top: 30px;
    background-color: rgba(0, 0, 0, 0.7); }
    @media screen and (max-width: 600px) {
      .billboard .welcome {
        margin-left: 400px; } }
    .billboard .welcome:last-child {
      margin-right: 0; }
    .billboard .welcome h1 {
      font-size: 3.6em;
      margin: 0; }
    .billboard .welcome h3 {
      font-size: 1.8em;
      margin: 0; }
    .billboard .welcome h3 + h4 {
      margin-top: 60px;
      margin-bottom: 0; }
    .billboard .welcome span {
      color: #996600; }

.party-people > div {
  float: left;
  display: block;
  margin-right: 2.35765%;
  width: 48.82117%;
  padding: 2.35765%;
  background-color: #f7f7f7;
  height: 320px; }
  .party-people > div:last-child {
    margin-right: 0; }

.ceremony {
  padding: 2.35765%;
  height: 200px; }
  .ceremony .address {
    margin-left: 25.58941%;
    float: left;
    display: block;
    margin-right: 2.35765%;
    width: 31.76157%; }
    .ceremony .address:last-child {
      margin-right: 0; }
    .ceremony .address p {
      margin: 0; }
  .ceremony .date {
    color: #996600;
    float: left;
    display: block;
    margin-right: 2.35765%;
    width: 31.76157%; }
    .ceremony .date:last-child {
      margin-right: 0; }
    .ceremony .date h1 {
      margin-top: 30px; }

.expander {
  text-align: center; }
  .expander h3 {
    display: inline-block; }
  .expander .expander-trigger {
    float: right;
    width: 40%;
    text-align: left;
    margin: 0 auto;
    color: #996600;
    cursor: pointer;
    display: block;
    font-size: 1em;
    margin-bottom: 1em;
    padding-bottom: 0.25em;
    text-decoration: none;
    user-select: none; }
  .expander .expander-content p {
    color: #333;
    line-height: 1.5; }
  .expander .expander-hidden + .expander-content {
    display: none; }

#map {
  float: left;
  display: block;
  margin-right: 2.35765%;
  width: 100%;
  margin-bottom: 30px;
  height: 400px; }
  #map:last-child {
    margin-right: 0; }
  #map div {
    height: 400px; }
  #map img {
    max-width: none; }
  #map .content {
    padding: 0 0.5em 1em 0.5em; }
  #map .heading {
    font-size: 1em;
    font-weight: bold;
    line-height: 1em;
    margin: 0; }
  #map #content p {
    font-size: 1em;
    margin: 0; }

#rsvp p {
  text-align: center; }

.accordion-tabs-minimal {
  line-height: 1.5;
  padding: 0; }
  .accordion-tabs-minimal::after {
    clear: both;
    content: "";
    display: block; }
  .accordion-tabs-minimal .tab-header-and-content {
    list-style: none; }
    @media screen and (min-width: 600px) {
      .accordion-tabs-minimal .tab-header-and-content {
        display: inline; } }
  .accordion-tabs-minimal .tab-link {
    background-color: #FFFFFF;
    border-top: 1px solid #ddd;
    color: #333;
    display: block;
    padding: 0.75em 1.618em;
    text-decoration: none; }
    @media screen and (min-width: 600px) {
      .accordion-tabs-minimal .tab-link {
        border-top: 0;
        display: inline-block; } }
    .accordion-tabs-minimal .tab-link:hover {
      color: #996600; }
    .accordion-tabs-minimal .tab-link:focus {
      outline: none; }
    .accordion-tabs-minimal .tab-link.is-active {
      border-bottom: 0; }
      @media screen and (min-width: 600px) {
        .accordion-tabs-minimal .tab-link.is-active {
          border: 1px solid #ddd;
          border-bottom-color: #FFFFFF;
          margin-bottom: -1px; } }
  .accordion-tabs-minimal .tab-content {
    display: none;
    padding: 1.5em 1.618em;
    width: 100%; }
    @media screen and (min-width: 600px) {
      .accordion-tabs-minimal .tab-content {
        border-top: 1px solid #ddd;
        float: left; } }

/*# sourceMappingURL=styles.css.map */


text:
class User < ApplicationRecord
  has_many :games
  has_many :screenshots, through: :games
  validates :username, presence: :true
  # Include default devise modules. Others available are:
  # :confirmable, :lockable, :timeoutable and :omniauthable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable, :omniauthable

  def self.from_omniauth(auth)
    where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
      binding.pry
      user.provider = auth.provider
      user.uid = auth.uid
      user.email = auth.info.email
      user.username = auth.info.nickname
      user.password = Devise.friendly_token[0,20]
    end
  end
end


text:
Simple package to assist you in converting/mapping ISO 3166-1 Alpha-2, Alpha-3, and Numeric Country Codes.

## Installation

Install the latest version with

```bash
$ composer require graftak/country-code-helper
```

## Usage

Include these two classes:
```php
use Graftak\CountryCodeHelper;
use Graftak\CountryCodeHelper\CountryCodes;
```

Then, in your code, just use the static method `map`:

```php
CountryCodeHelper::map($value, $toType);
```

The first parameter `$value` is the country code (string) you want to map **from**. For example:
- `'NL'` (2-letter country code for The Netherlands)
- `'BRA'` (3-letter country code for Brazil)
- `'024'` (numeric country code for Angola)

The second parameter `$toType` is the type you want to map **to**. These types are supported:
```
CountryCodes::ALPHA_2
CountryCodes::ALPHA_3
CountryCodes::NUMERIC
CountryCodes::SHORT_NAME_ENGLISH
CountryCodes::SHORT_NAME_FRENCH
```

Optionally you can supply the third parameter to explicitly define the type of the given `$value` (you can use any of the constants above).

### Examples
```php
<?php

use Graftak\CountryCodeHelper;
use Graftak\CountryCodeHelper\CountryCodes;

// Example 1 (The Netherlands): Two-letter to three-letter code.
print CountryCodeHelper::map('NL', CountryCodes::ALPHA_3);
// Output: 'NLD'

// Example 2 (Philippines): Numeric to two-letter code.
print CountryCodeHelper::map(608, CountryCodes::ALPHA_2);
// Output: 'PH'

// Example 3 (Virgin Islands): Two-letter to English name.
print CountryCodeHelper::map('VG', CountryCodes::SHORT_NAME_ENGLISH);
// Output: 'Virgin Islands (British)'
```

## About

### Requirements

- PHP 5.6 or up

### Country Codes - ISO 3166

What is ISO 3166?
ISO 3166 is the International Standard for country codes and codes for their subdivisions.

The purpose of ISO 3166 is to define internationally recognised codes of letters and/or numbers that we can use when we refer to countries and subdivisions. However, it does not define the names of countries – this information comes from United Nations sources (Terminology Bulletin Country Names and the Country and Region Codes for Statistical Use maintained by the United Nations Statistics Divisions).

Using codes saves time and avoids errors as instead of using a country's name (which will change depending on the language being used) we can use a combination of letters and/or numbers that are understood all over the world.

For example, all national postal organizations throughout the world exchange international mail in containers identified with the relevant country code. Internet domain name systems use the codes to define top level domain names such as '.fr' for France, '.au' for Australia. In addition, in machine readable passports, the codes are used to determine the nationality of the user and when we send money from one bank to another the country codes are a way to identify where the bank is based.

Excerpt from: https://www.iso.org/iso-3166-country-codes.html

### Submitting bugs and feature requests

Bugs and feature request are tracked on [GitHub](https://github.com/graftak/country-code-helper/issues)

### Author

Bert van der Genugten

### License

Country Code Helper is licensed under the BSD-3-Clause License - see the `LICENSE` file for details

### Acknowledgements
Data source: https://www.iso.org/obp/ui/#search/code/

More information about ISO 3166 can be found on the official website of ISO (International Organization for Standardization):
https://www.iso.org/iso-3166-country-codes.html


text:
<!DOCTYPE html>

    <meta name="project_path" value="/php/docs/reference/_project.yaml">
    <meta name="book_path" value="/php/docs/reference/vision/latest/_book.yaml">

    {% verbatim %}

Class CropHintsParams (v2.2.2)

Parameters for crop hints annotation request.

Generated from protobuf message google.cloud.vision.v1.CropHintsParams

Methods

__construct

Constructor.

  Parameters

        Name
        Description

        data

          array

Optional. Data for populating the Message object.

        ↳ aspect_ratios

          array<float></float>

Aspect ratios in floats, representing the ratio of the width to the height of the image. For example, if the desired aspect ratio is 4/3, the corresponding float value should be 1.33333. If not specified, the best possible crop is returned. The number of provided aspect ratios is limited to a maximum of 16; any aspect ratios provided after the 16th are ignored.

getAspectRatios

Aspect ratios in floats, representing the ratio of the width to the height
of the image. For example, if the desired aspect ratio is 4/3, the
corresponding float value should be 1.33333.  If not specified, the
best possible crop is returned. The number of provided aspect ratios is
limited to a maximum of 16; any aspect ratios provided after the 16th are
ignored.

Generated from protobuf field repeated float aspect_ratios = 1;

  Returns

        Type
        Description

        Google\Protobuf\Internal\RepeatedField

setAspectRatios

Aspect ratios in floats, representing the ratio of the width to the height
of the image. For example, if the desired aspect ratio is 4/3, the
corresponding float value should be 1.33333.  If not specified, the
best possible crop is returned. The number of provided aspect ratios is
limited to a maximum of 16; any aspect ratios provided after the 16th are
ignored.

Generated from protobuf field repeated float aspect_ratios = 1;

  Parameter

        Name
        Description

        var

          float[]

  Returns

        Type
        Description

        $this

    {% endverbatim %}


text:
#include "stdafx.h"
#include <windows.h>
#if !defined(UNDER_CE)
#include <shellapi.h>
#endif

#include "UIGroups.hpp"
#include "UIMicroBlog.hpp"
#include "main_frame.hpp"
#include "color_skin.hpp"
#include "chat_dialog.hpp"

const TCHAR* const kTitleControlName = _T("apptitle");
const TCHAR* const kCloseButtonControlName = _T("closebtn");
const TCHAR* const kMinButtonControlName = _T("minbtn");
const TCHAR* const kMaxButtonControlName = _T("maxbtn");
const TCHAR* const kRestoreButtonControlName = _T("restorebtn");

const TCHAR* const kTabControlName = _T("tabs");

const TCHAR* const kFriendButtonControlName = _T("friendbtn");
const TCHAR* const kGroupButtonControlName = _T("groupbtn");
const TCHAR* const kMicroBlogButtonControlName = _T("microblogbtn");

const TCHAR* const kFriendsListControlName = _T("friends");
const TCHAR* const kGroupsListControlName = _T("groups");
const TCHAR* const kMicroBlogListControlName = _T("microblog");

const TCHAR* const kHideLeftMainPannelControlName = _T("btnleft");
const TCHAR* const kShowLeftMainPannelControlName = _T("btnright");
const TCHAR* const kLeftMainPannelControlName = _T("LeftMainPanel");

const TCHAR* const kSignatureTipsControlName = _T("signaturetip");
const TCHAR* const kSignatureControlName = _T("signature");

const TCHAR* const kSearchEditTipControlName = _T("search_tip");
const TCHAR* const kSearchEditControlName = _T("search_edit");

const TCHAR* const kChangeBkSkinControlName = _T("bkskinbtn");
const TCHAR* const kChangeColorSkinControlName = _T("colorskinbtn");

const TCHAR* const kBackgroundControlName = _T("bg");

const int kBackgroundSkinImageCount = 3;

MainFrame::MainFrame()
: bk_image_index_(0)
{}

MainFrame::~MainFrame()
{
    PostQuitMessage(0);
}

LPCTSTR MainFrame::GetWindowClassName() const
{
    return _T("TXGuiFoundation");
}

CControlUI* MainFrame::CreateControl(LPCTSTR pstrClass)
{
    if (_tcsicmp(pstrClass, _T("FriendList")) == 0)
    {
        return new CFriendsUI(m_PaintManager);
    }
    else if (_tcsicmp(pstrClass, _T("GroupList")) == 0)
    {
        return new CGroupsUI(m_PaintManager);
    }
    else if (_tcsicmp(pstrClass, _T("MicroBlog")) == 0)
    {
        return new CMicroBlogUI(m_PaintManager);
    }

    return NULL;
}

void MainFrame::OnFinalMessage(HWND hWnd)
{
    WindowImplBase::OnFinalMessage(hWnd);
    delete this;
}

CDuiString MainFrame::GetSkinFile()
{
    return _T("main_frame.xml");
}

CDuiString MainFrame::GetSkinFolder()
{
    return  _T("skin\\");
}

LRESULT MainFrame::OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    bHandled = FALSE;
    return 0;
}

LRESULT MainFrame::OnSysCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
#if defined(WIN32) && !defined(UNDER_CE)
    BOOL bZoomed = ::IsZoomed(m_hWnd);
    LRESULT lRes = CWindowWnd::HandleMessage(uMsg, wParam, lParam);
    if (::IsZoomed(m_hWnd) != bZoomed)
    {
        if (!bZoomed)
        {
            CControlUI* pControl = static_cast<CControlUI*>(m_PaintManager.FindControl(kMaxButtonControlName));
            if( pControl ) pControl->SetVisible(false);
            pControl = static_cast<CControlUI*>(m_PaintManager.FindControl(kRestoreButtonControlName));
            if( pControl ) pControl->SetVisible(true);
        }
        else
        {
            CControlUI* pControl = static_cast<CControlUI*>(m_PaintManager.FindControl(kMaxButtonControlName));
            if( pControl ) pControl->SetVisible(true);
            pControl = static_cast<CControlUI*>(m_PaintManager.FindControl(kRestoreButtonControlName));
            if( pControl ) pControl->SetVisible(false);
        }
    }
#else
    return __super::OnSysCommand(uMsg, wParam, lParam, bHandled);
#endif

    return 0;
}

LRESULT MainFrame::ResponseDefaultKeyEvent(WPARAM wParam)
{
    if (wParam == VK_RETURN)
    {
        return FALSE;
    }
    else if (wParam == VK_ESCAPE)
    {
        return TRUE;
    }
    return FALSE;
}

void MainFrame::OnTimer(TNotifyUI& msg)
{
}

void MainFrame::OnExit(TNotifyUI& msg)
{
    Close();
}

void MainFrame::InitWindow()
{}

DWORD MainFrame::GetBkColor()
{
    CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
    if (background != NULL)
        return background->GetBkColor();

    return 0;
}

void MainFrame::SetBkColor(DWORD dwBackColor)
{
    CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
    if (background != NULL)
    {
        background->SetBkImage(_T(""));
        background->SetBkColor(dwBackColor);
        background->NeedUpdate();

        SkinChangedParam param;
        param.bkcolor = background->GetBkColor();
        param.bgimage = background->GetBkImage();
        skin_changed_observer_.Broadcast(param);
    }
}

void MainFrame::UpdateFriendsList()
{
    CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(m_PaintManager.FindControl(kFriendsListControlName));
    if (pFriendsList != NULL)
    {
        if (!friends_.empty())
            friends_.clear();
        if (pFriendsList->GetCount() > 0)
            pFriendsList->RemoveAll();

        FriendListItemInfo item;

        item.id = _T("0");
        item.folder = true;
        item.empty = false;
        item.nick_name = _T("我的好友");

        Node* root_parent = pFriendsList->AddNode(item, NULL);
        friends_.push_back(item);

        item.id = _T("1");
        item.folder = false;
        item.logo = _T("man.png");
        item.nick_name = _T("tojen");
        item.description = _T("tojen.me@gmail.com");

        myself_info_ = item;

        pFriendsList->AddNode(item, root_parent);
        friends_.push_back(item);

        item.id = _T("2");
        item.folder = false;
        item.logo = _T("default.png");
        item.nick_name = _T("achellies");
        item.description = _T("achellies@hotmail.com");
        pFriendsList->AddNode(item, root_parent);
        friends_.push_back(item);

        item.id = _T("2");
        item.folder = false;
        item.logo = _T("default.png");
        item.nick_name = _T("wangchyz");
        item.description = _T("wangchyz@gmail.com");
        pFriendsList->AddNode(item, root_parent);
        friends_.push_back(item);

        for( int i = 0; i < 100; ++i )
        {
            item.id = _T("2");
            item.folder = false;
            item.logo = _T("default.png");
            item.nick_name = _T("duilib");
            item.description = _T("www.duilib.com");
            pFriendsList->AddNode(item, root_parent);
            friends_.push_back(item);
        }

        item.id = _T("3");
        item.folder = true;
        item.empty = false;
        item.nick_name = _T("企业好友");
        Node* root_parent2 = pFriendsList->AddNode(item, NULL);
        friends_.push_back(item);

        item.id = _T("4");
        item.folder = false;
        item.logo = _T("icon_home.png");
        item.nick_name = _T("腾讯企业QQ的官方展示号");
        item.description = _T("");
        pFriendsList->AddNode(item, root_parent2);
        friends_.push_back(item);

        item.id = _T("5");
        item.folder = true;
        item.empty = false;
        item.nick_name = _T("陌生人");
        Node* root_parent3 = pFriendsList->AddNode(item, NULL);
        friends_.push_back(item);

        item.id = _T("6");
        item.folder = true;
        item.empty = false;
        item.nick_name = _T("黑名单");
        Node* root_parent4 = pFriendsList->AddNode(item, NULL);
        friends_.push_back(item);
    }
}

void MainFrame::UpdateGroupsList()
{
    CGroupsUI* pGroupsList = static_cast<CGroupsUI*>(m_PaintManager.FindControl(kGroupsListControlName));
    if (pGroupsList != NULL)
    {
        if (pGroupsList->GetCount() > 0)
            pGroupsList->RemoveAll();

        GroupsListItemInfo item;

        item.folder = true;
        item.empty = false;
        item.nick_name = _T("我的QQ群");

        Node* root_parent = pGroupsList->AddNode(item, NULL);

        item.folder = false;
        item.logo = _T("duilib.png");
        item.nick_name = _T("Duilib官方交流群");
        item.description = _T("153787916");
        pGroupsList->AddNode(item, root_parent);

        item.folder = false;
        item.logo = _T("groups.png");
        item.nick_name = _T("Duilib官方交流群2");
        item.description = _T("79145400");
        pGroupsList->AddNode(item, root_parent);
    }
}

void MainFrame::UpdateMicroBlogList()
{
    CMicroBlogUI* pMicroBlogList = static_cast<CMicroBlogUI*>(m_PaintManager.FindControl(kMicroBlogListControlName));
    if (pMicroBlogList != NULL)
    {}
}

void MainFrame::OnPrepare(TNotifyUI& msg)
{
    CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
    if (background != NULL)
    {
        TCHAR szBuf[MAX_PATH] = {0};
#if defined(UNDER_WINCE)
        _stprintf(szBuf, _T("file='bg%d.png' corner='600,200,1,1'"), bk_image_index_);
#else
        _stprintf_s(szBuf, MAX_PATH - 1, _T("file='bg%d.png' corner='600,200,1,1'"), bk_image_index_);
#endif
        background->SetBkImage(szBuf);
    }

    UpdateFriendsList();

    UpdateGroupsList();

    UpdateMicroBlogList();
}

void MainFrame::Notify(TNotifyUI& msg)
{
    if (_tcsicmp(msg.sType, _T("windowinit")) == 0)
    {
        OnPrepare(msg);
    }
    else if (_tcsicmp(msg.sType, _T("killfocus")) == 0)
    {
        if (_tcsicmp(msg.pSender->GetName(), kSignatureControlName) == 0)
        {
            msg.pSender->SetVisible(false);
            CControlUI* signature_tip = m_PaintManager.FindControl(kSignatureTipsControlName);
            if (signature_tip != NULL)
            {
                CRichEditUI* signature = static_cast<CRichEditUI*>(msg.pSender);
                if (signature != NULL)
                    signature_tip->SetText(signature->GetText());
                signature_tip->SetVisible(true);
            }
        }
        else if (_tcsicmp(msg.pSender->GetName(), kSearchEditControlName) == 0)
        {
            msg.pSender->SetVisible(false);
            CControlUI* search_tip = static_cast<CRichEditUI*>(m_PaintManager.FindControl(kSearchEditTipControlName));
            if (search_tip != NULL)
            {
                CRichEditUI* search_edit = static_cast<CRichEditUI*>(msg.pSender);
                if (search_edit != NULL)
                    search_tip->SetText(search_edit->GetText());
                search_tip->SetVisible(true);
            }
        }
    }
    else if (_tcsicmp(msg.sType, _T("click")) == 0)
    {
        if (_tcsicmp(msg.pSender->GetName(), kCloseButtonControlName) == 0)
        {
            OnExit(msg);
        }
        else if (_tcsicmp(msg.pSender->GetName(), kMinButtonControlName) == 0)
        {
#if defined(UNDER_CE)
            ::ShowWindow(m_hWnd, SW_MINIMIZE);
#else
            SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
#endif
        }
        else if (_tcsicmp(msg.pSender->GetName(), kMaxButtonControlName) == 0)
        {
#if defined(UNDER_CE)
            ::ShowWindow(m_hWnd, SW_MAXIMIZE);
            CControlUI* pControl = static_cast<CControlUI*>(m_PaintManager.FindControl(kMaxButtonControlName));
            if( pControl ) pControl->SetVisible(false);
            pControl = static_cast<CControlUI*>(m_PaintManager.FindControl(kRestoreButtonControlName));
            if( pControl ) pControl->SetVisible(true);
#else
            SendMessage(WM_SYSCOMMAND, SC_MAXIMIZE, 0);
#endif
        }
        else if (_tcsicmp(msg.pSender->GetName(), kRestoreButtonControlName) == 0)
        {
#if defined(UNDER_CE)
            ::ShowWindow(m_hWnd, SW_RESTORE);
            CControlUI* pControl = static_cast<CControlUI*>(m_PaintManager.FindControl(kMaxButtonControlName));
            if( pControl ) pControl->SetVisible(true);
            pControl = static_cast<CControlUI*>(m_PaintManager.FindControl(kRestoreButtonControlName));
            if( pControl ) pControl->SetVisible(false);
#else
            SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0);
#endif
        }
        else if (_tcsicmp(msg.pSender->GetName(), kHideLeftMainPannelControlName) == 0)
        {
            CControlUI* left_main_pannel = m_PaintManager.FindControl(kLeftMainPannelControlName);
            CControlUI* hide_left_main_pannel = m_PaintManager.FindControl(kHideLeftMainPannelControlName);
            CControlUI* show_left_main_pannel = m_PaintManager.FindControl(kShowLeftMainPannelControlName);
            if ((left_main_pannel != NULL) && (show_left_main_pannel != NULL) && (hide_left_main_pannel != NULL))
            {
                hide_left_main_pannel->SetVisible(false);
                left_main_pannel->SetVisible(false);
                show_left_main_pannel->SetVisible(true);
            }
        }
        else if (_tcsicmp(msg.pSender->GetName(), kShowLeftMainPannelControlName) == 0)
        {
            CControlUI* left_main_pannel = m_PaintManager.FindControl(kLeftMainPannelControlName);
            CControlUI* hide_left_main_pannel = m_PaintManager.FindControl(kHideLeftMainPannelControlName);
            CControlUI* show_left_main_pannel = m_PaintManager.FindControl(kShowLeftMainPannelControlName);
            if ((left_main_pannel != NULL) && (show_left_main_pannel != NULL) && (hide_left_main_pannel != NULL))
            {
                hide_left_main_pannel->SetVisible(true);
                left_main_pannel->SetVisible(true);
                show_left_main_pannel->SetVisible(false);
            }
        }
        else if (_tcsicmp(msg.pSender->GetName(), kSignatureTipsControlName) == 0)
        {
            msg.pSender->SetVisible(false);
            CRichEditUI* signature = static_cast<CRichEditUI*>(m_PaintManager.FindControl(kSignatureControlName));
            if (signature != NULL)
            {
                signature->SetText(msg.pSender->GetText());
                signature->SetVisible(true);
            }
        }
        else if (_tcsicmp(msg.pSender->GetName(), kSearchEditTipControlName) == 0)
        {
            msg.pSender->SetVisible(false);
            CRichEditUI* search_edit = static_cast<CRichEditUI*>(m_PaintManager.FindControl(kSearchEditControlName));
            if (search_edit != NULL)
            {
                search_edit->SetText(msg.pSender->GetText());
                search_edit->SetVisible(true);
            }
        }
        else if (_tcsicmp(msg.pSender->GetName(), kChangeBkSkinControlName) == 0)
        {
            CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
            if (background != NULL)
            {
                TCHAR szBuf[MAX_PATH] = {0};
                ++bk_image_index_;
                if (kBackgroundSkinImageCount < bk_image_index_)
                    bk_image_index_ = 0;

#if defined(UNDER_WINCE)
                _stprintf(szBuf, _T("file='bg%d.png' corner='600,200,1,1'"), bk_image_index_);
#else
                _stprintf_s(szBuf, MAX_PATH - 1, _T("file='bg%d.png' corner='600,200,1,1'"), bk_image_index_);
#endif
                background->SetBkImage(szBuf);

                SkinChangedParam param;
                CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
                if (background != NULL)
                {
                    param.bkcolor = background->GetBkColor();
                    if (_tcslen(background->GetBkImage()) > 0)
                    {
#if defined(UNDER_WINCE)
                        _stprintf(szBuf, _T("bg%d.png"), bk_image_index_);
#else
                        _stprintf_s(szBuf, MAX_PATH - 1, _T("bg%d.png"), bk_image_index_);
#endif
                    }

                    param.bgimage = szBuf;
                }
                skin_changed_observer_.Broadcast(param);
            }
        }
        else if (_tcsicmp(msg.pSender->GetName(), kChangeColorSkinControlName) == 0)
        {
            CDuiRect rcWindow;
            GetWindowRect(m_hWnd, &rcWindow);
            rcWindow.top = rcWindow.top + msg.pSender->GetPos().bottom;
            new ColorSkinWindow(this, rcWindow);
        }
    }
    else if (_tcsicmp(msg.sType, _T("timer")) == 0)
    {
        return OnTimer(msg);
    }
    else if (_tcsicmp(msg.sType, _T("selectchanged")) == 0)
    {
        CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kTabControlName));
        if (_tcsicmp(msg.pSender->GetName(), kFriendButtonControlName) == 0)
        {
            if (pTabControl && pTabControl->GetCurSel() != 0)
            {
                pTabControl->SelectItem(0);
                UpdateFriendsList();
            }
        }
        else if (_tcsicmp(msg.pSender->GetName(), kGroupButtonControlName) == 0)
        {
            if (pTabControl && pTabControl->GetCurSel() != 1)
            {
                pTabControl->SelectItem(1);
                UpdateGroupsList();
            }
        }
        else if (_tcsicmp(msg.pSender->GetName(), kMicroBlogButtonControlName) == 0)
        {
            if (pTabControl && pTabControl->GetCurSel() != 2)
            {
                pTabControl->SelectItem(2);
                UpdateMicroBlogList();
            }
        }
    }
    else if (_tcsicmp(msg.sType, _T("itemactivate")) == 0)
    {
        CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kTabControlName));
        if (pTabControl != NULL)
        {
            if (pTabControl->GetCurSel() == 0)
            {
                CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(m_PaintManager.FindControl(kFriendsListControlName));
                if ((pFriendsList != NULL) &&  pFriendsList->GetItemIndex(msg.pSender) != -1)
                {
                    if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
                    {
                        Node* node = (Node*)msg.pSender->GetTag();

                        CControlUI* background = m_PaintManager.FindControl(kBackgroundControlName);
                        if (!pFriendsList->CanExpand(node) && (background != NULL))
                        {
                            FriendListItemInfo friend_info;

                            for (std::vector<FriendListItemInfo>::const_iterator citer = friends_.begin(); citer != friends_.end(); ++citer)
                            {
                                if (_tcsicmp(citer->id, node->data().value) == 0)
                                {
                                    friend_info = *citer;
                                    break;
                                }
                            }
                            TCHAR szBuf[MAX_PATH] = {0};
                            if (_tcslen(background->GetBkImage()) > 0)
                            {
#if defined(UNDER_WINCE)
                                _stprintf(szBuf, _T("bg%d.png"), bk_image_index_);
#else
                                _stprintf_s(szBuf, MAX_PATH - 1, _T("bg%d.png"), bk_image_index_);
#endif
                            }

                            ChatDialog* pChatDialog = new ChatDialog(szBuf, background->GetBkColor(), myself_info_, friend_info);
                            if( pChatDialog == NULL )
                                return;
#if defined(WIN32) && !defined(UNDER_CE)
                            pChatDialog->Create(NULL, _T("ChatDialog"), UI_WNDSTYLE_FRAME | WS_POPUP,  NULL, 0, 0, 0, 0);
#else
                            pChatDialog->Create(NULL, _T("ChatDialog"), UI_WNDSTYLE_FRAME | WS_POPUP, NULL, 0, 0, 0, 0);
#endif
                            skin_changed_observer_.AddReceiver(pChatDialog);

                            pChatDialog->CenterWindow();
                            ::ShowWindow(*pChatDialog, SW_SHOW);
                        }
                    }
                }
            }
        }
    }
    else if (_tcsicmp(msg.sType, _T("itemclick")) == 0)
    {
        CTabLayoutUI* pTabControl = static_cast<CTabLayoutUI*>(m_PaintManager.FindControl(kTabControlName));
        if (pTabControl != NULL)
        {
            if (pTabControl->GetCurSel() == 0)
            {
                CFriendsUI* pFriendsList = static_cast<CFriendsUI*>(m_PaintManager.FindControl(kFriendsListControlName));
                if ((pFriendsList != NULL) &&  pFriendsList->GetItemIndex(msg.pSender) != -1)
                {
                    if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
                    {
                        Node* node = (Node*)msg.pSender->GetTag();

                        if (pFriendsList->CanExpand(node))
                        {
                            pFriendsList->SetChildVisible(node, !node->data().child_visible_);
                        }
                    }
                }
            }
            else if (pTabControl->GetCurSel() == 1)
            {
                CGroupsUI* pGroupsList = static_cast<CGroupsUI*>(m_PaintManager.FindControl(kGroupsListControlName));
                if ((pGroupsList != NULL) &&  pGroupsList->GetItemIndex(msg.pSender) != -1)
                {
                    if (_tcsicmp(msg.pSender->GetClass(), _T("ListContainerElementUI")) == 0)
                    {
                        Node* node = (Node*)msg.pSender->GetTag();

                        if (pGroupsList->CanExpand(node))
                        {
                            pGroupsList->SetChildVisible(node, !node->data().child_visible_);
                        }
                    }
                }
            }

        }
    }
}

LRESULT MainFrame::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
    return 0;
}

UILIB_RESOURCETYPE MainFrame::GetResourceType() const
{
    return UILIB_ZIPRESOURCE;
}

LPCTSTR MainFrame::GetResourceID() const
{
    return MAKEINTRESOURCE(101);
}


text:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

/*
 * Created on 2005/05/04
 *
 */

/**
 * @author mori
 *
 */
public class ControlPanel extends JPanel implements ActionListener {
    private MainPanel mainPanel;

    private JButton addButton;
    private JButton clearButton;
    private JButton learnButton;
    private JButton recognizeButton;

    public ControlPanel(MainPanel mainPanel) {
        this.mainPanel = mainPanel;

        addButton = new JButton("'ljÁ");
        clearButton = new JButton("Á‹Ž");
        learnButton = new JButton("ŠwK");
        recognizeButton = new JButton(""FŽ¯");

        addButton.addActionListener(this);
        clearButton.addActionListener(this);
        learnButton.addActionListener(this);
        recognizeButton.addActionListener(this);

        learnButton.setEnabled(false);
        recognizeButton.setEnabled(false);

        add(addButton);
        add(clearButton);
        add(learnButton);
        add(recognizeButton);
    }

    public void actionPerformed(ActionEvent e) {
        if (e.getSource() == addButton) {
            mainPanel.addPattern();
            learnButton.setEnabled(true);
        } else if (e.getSource() == clearButton) {
            mainPanel.clearPattern();
        } else if (e.getSource() == learnButton) {
            mainPanel.learnPattern();
            addButton.setEnabled(false);
            learnButton.setEnabled(false);
            recognizeButton.setEnabled(true);
        } else if (e.getSource() == recognizeButton) {
            mainPanel.recognizePattern();
        }
    }
}


text:
package org.wikimedia.elasticsearch.swift.repositories;

import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
import org.javaswift.joss.client.factory.AccountConfig;
import org.javaswift.joss.client.factory.AccountFactory;
import org.javaswift.joss.client.factory.AuthenticationMethod;
import org.javaswift.joss.client.factory.AuthenticationMethodScope;
import org.javaswift.joss.model.Account;
import org.wikimedia.elasticsearch.swift.SwiftPerms;
import org.wikimedia.elasticsearch.swift.util.retry.WithTimeout;

import java.util.concurrent.TimeUnit;

public class SwiftService extends AbstractLifecycleComponent {
    private static final String V3_AUTH_URL_SUFFIX = "/auth/tokens";

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

    private final boolean allowCaching;
    private final WithTimeout.Factory withTimeoutFactory;
    private final ThreadPool threadPool;
    private final int retryIntervalS;
    private final int shortOperationTimeoutS;
    private final Boolean allowConcurrentIO;

    /**
     * Constructor
     *
     * @param envSettings
     *            Settings for our repository. Injected.
     *
     * @param threadPool for retry()
     */
    @Inject
    public SwiftService(Settings envSettings, ThreadPool threadPool) {
        this.threadPool = threadPool;
        allowCaching = SwiftRepository.Swift.ALLOW_CACHING_SETTING.get(envSettings);
        withTimeoutFactory = new WithTimeout.Factory();
        retryIntervalS = SwiftRepository.Swift.RETRY_INTERVAL_S_SETTING.get(envSettings);
        shortOperationTimeoutS = SwiftRepository.Swift.SHORT_OPERATION_TIMEOUT_S_SETTING.get(envSettings);
        allowConcurrentIO = SwiftRepository.Swift.ALLOW_CONCURRENT_IO_SETTING.get(envSettings);
    }

    private WithTimeout withTimeout() {
        return withTimeoutFactory.from(this.threadPool != null && allowConcurrentIO ? this.threadPool : null);
    }

    /**
     * Create a Swift account object and connect it to Swift
     *
     * @param url
     *            The auth url (eg: localhost:8080/auth/v1.0/)
     * @param username
     *            The username
     * @param password
     *            The password
     * @param preferredRegion
     *            The preferred region set
     * @return swift Account
     */
    public Account swiftBasic(String url, String username, String password, String preferredRegion) {
        try {
            AccountConfig conf = getStandardConfig(url, username, password, AuthenticationMethod.BASIC,
                    preferredRegion);
            return createAccount(conf);
        }
        catch (Exception ce) {
            throw new ElasticsearchException("Unable to authenticate to Swift Basic " + url + "/" + username +
                "/" + password, ce);
        }
    }

    private Account createAccount(final AccountConfig conf) throws Exception {
        return withTimeout().retry(retryIntervalS, shortOperationTimeoutS, TimeUnit.SECONDS,() -> {
            try {
                return SwiftPerms.exec(() -> new AccountFactory(conf).createAccount());
            }
            catch (Exception e) {
                logger.warn("cannot authenticate", e);
                throw e;
            }
        });
    }

    public Account swiftKeyStone(String url,
                                 String username,
                                 String password,
                                 String tenantName,
                                 String preferredRegion) {
        try {
            AccountConfig conf = getStandardConfig(url,
                username,
                password,
                AuthenticationMethod.KEYSTONE,
                preferredRegion);
            conf.setTenantName(tenantName);
            return createAccount(conf);
        }
        catch (Exception ce) {
            String msg = "Unable to authenticate to Swift Keystone " + url + "/" + username + "/" + password + "/" + tenantName;
            throw new ElasticsearchException(msg, ce);
        }
    }

    public Account swiftKeyStoneV3(String url,
                                                String username,
                                                String password,
                                                String tenantName,
                                                String domainName,
                                                String preferredRegion) {
        try {
            if (!url.endsWith(V3_AUTH_URL_SUFFIX)) {
                url = StringUtils.chomp(url,"/") + V3_AUTH_URL_SUFFIX;
            }

            AccountConfig conf = getStandardConfig(url,
                username,
                password,
                AuthenticationMethod.KEYSTONE_V3,
                preferredRegion);

            if (StringUtils.isNotEmpty(tenantName)) {
                conf.setTenantName(tenantName);
                conf.setAuthenticationMethodScope(AuthenticationMethodScope.PROJECT_NAME);
            }
            else if (StringUtils.isNotEmpty(domainName) && !"Default".equalsIgnoreCase(domainName)) {
                conf.setDomain(domainName);
                conf.setAuthenticationMethodScope(AuthenticationMethodScope.DOMAIN_NAME);
            }

            return createAccount(conf);
        }
        catch (Exception ce) {
            String msg = "Unable to authenticate to Swift Keystone V3" + url + "/" + username + "/" + password + "/" +
                tenantName + "/" + domainName;
            throw new ElasticsearchException(msg, ce);
        }
    }

    public Account swiftTempAuth(String url, String username, String password, String preferredRegion) {
        try {
            AccountConfig conf = getStandardConfig(url,
                username,
                password,
                AuthenticationMethod.TEMPAUTH,
                preferredRegion);
            return createAccount(conf);
        }
        catch (Exception ce) {
            throw new ElasticsearchException("Unable to authenticate to Swift Temp", ce);
        }
    }

    private AccountConfig getStandardConfig(String url,
                                            String username,
                                            String password,
                                            AuthenticationMethod method,
                                            String preferredRegion) {
        AccountConfig conf = new AccountConfig();
        conf.setAuthUrl(url);
        conf.setUsername(username);
        conf.setPassword(password);
        conf.setAuthenticationMethod(method);
        conf.setAllowContainerCaching(allowCaching);
        conf.setAllowCaching(allowCaching);

        if (StringUtils.isNotEmpty(preferredRegion)) {
            conf.setPreferredRegion(preferredRegion);
        }

        return conf;
    }

    /**
     * Start the service. No-op here.
     */
    @Override
    protected void doStart() throws ElasticsearchException {
    }

    /**
     * Stop the service. No-op here.
     */
    @Override
    protected void doStop() throws ElasticsearchException {
    }

    /**
     * Close the service. No-op here.
     */
    @Override
    protected void doClose() throws ElasticsearchException {
    }
}


text:
"""Tests for parser module."""

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

from tensorflow.python.autograph.pyct import parser
from tensorflow.python.platform import test

class ParserTest(test.TestCase):

  def test_parse_entity(self):

    def f(x):
      return x + 1

    node, _ = parser.parse_entity(f, future_features=())
    self.assertEqual('f', node.name)

  def test_parse_entity_print_function(self):

    def f(x):
      print(x)

    node, _ = parser.parse_entity(f, future_features=('print_function',))
    self.assertEqual('f', node.name)

  def test_parse_comments(self):

    def f():
# unindented comment
      pass

    with self.assertRaises(ValueError):
      parser.parse_entity(f, future_features=())

  def test_parse_multiline_strings(self):

    def f():
      print("""
some
multiline
string""")

    with self.assertRaises(ValueError):
      parser.parse_entity(f, future_features=())

  def test_parse_expression(self):
    node = parser.parse_expression('a.b')
    self.assertEqual('a', node.value.id)
    self.assertEqual('b', node.attr)

if __name__ == '__main__':
  test.main()


text:
package rocket_bucket

import (
	"fmt"
	"net/http"
)

type Server struct {
	Config   *Config
	Selector *Selector
}

func (s *Server) HandleBucketDump(w http.ResponseWriter, r *http.Request) {
	s.handleSession(&DumpBucketsRequestHandler{Config: s.Config}, w, r)
}

func (s *Server) HandleBucketAssignment(w http.ResponseWriter, r *http.Request) {
	s.handleSession(&AssignBucketsRequestHandler{UserID: r.URL.Query().Get("user_id"), Selector: s.Selector}, w, r)
}

func (s *Server) handleSession(handler BucketRequestHandler, w http.ResponseWriter, r *http.Request) {
	session := Session{}
	session.Process(handler, w, r, s.Config)
}

func (s *Server) Run() {
	Info("listening: assignment_url=`%s`, dump_url=`%s`, port=`%d`",
		s.Config.Server.URL, s.Config.Server.BucketDumpURL, s.Config.Server.Port)

	http.HandleFunc(s.Config.Server.URL, s.HandleBucketAssignment)
	http.HandleFunc(s.Config.Server.BucketDumpURL, s.HandleBucketDump)

	http.ListenAndServe(fmt.Sprintf(":%d", s.Config.Server.Port), nil)
}


text:
package datamanagement;

import org.jdom.Document;
import org.jdom.input.SAXBuilder;
import java.io.FileWriter;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
import java.io.IOException;
import org.jdom.JDOMException;

public class XMLManager {
private static XMLManager self = null;

        private Document doc;
        public static XMLManager getXML() { if (self == null ) self = new XMLManager(); return self;
}
    private XMLManager() {init();

}

public void init() {
        String s = AppProperties.getInstance().getProperties().getProperty("XMLFILE");
try {
            SAXBuilder b = new SAXBuilder();
    b.setExpandEntities(true);
                        doc = b.build(s);}

                catch (JDOMException e) {
System.err.printf( "%s", "DBMD: XMLManager : init : caught JDOMException\n" );
throw new RuntimeException("DBMD: XMLManager : init : JDOMException");}
        catch (IOException e) {
            System.err.printf( "%s", "DBMD: XMLManager : init : caught IOException\n" );

throw new RuntimeException("DBMD: XMLManager : init : IOException");
        }
                }
    public Document getDocument() {
        return doc;
    }

    public void saveDocument() {
        String xmlfile = AppProperties.getInstance().getProperties().getProperty("XMLFILE");
                try (FileWriter fout = new FileWriter(xmlfile)) {
XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat());
    outputter.output(doc, fout);
                    fout.close();
}
        catch (IOException ioe) {
System.err.printf( "%s\n", "DBMD : XMLManager : saveDocument : Error saving XML to " + xmlfile);
                    throw new RuntimeException("DBMD: XMLManager : saveDocument : error writing to file");
        }}}


text:
package ro.pub.cs.systems.pdsd.lab06.clientservercommunication.views;

import java.io.BufferedReader;
import java.net.Socket;

import ro.pub.cs.systems.pdsd.lab06.clientservercommunication.R;
import ro.pub.cs.systems.pdsd.lab06.clientservercommunication.general.Constants;
import ro.pub.cs.systems.pdsd.lab06.clientservercommunication.general.Utilities;
import android.app.Fragment;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class ClientFragment extends Fragment {

	private EditText serverAddressEditText, serverPortEditText;
	private TextView serverMessageTextView;

	private class ClientThread implements Runnable {

		private Socket socket = null;

		@Override
		public void run() {
			try {

				// TODO: exercise 6b
				// - reset the content of serverMessageTextView (on UI thread !!!)
				// - get the connection parameters (serverAddress from serverAddressEditText, serverPort from serverPortEditText)
				// - open a socket to the server
				// - get the BufferedReader object in order to read from the socket (use Utilities.getReader())
				// - while the line that was read is not null (EOF was not sent), append the content to serverMessageTextView (on UI thread !!!)
				// - close the socket to the server
				String addr = serverAddressEditText.getText().toString();
				int port = Integer.parseInt(serverPortEditText.getText().toString());

				socket = new Socket(addr, port);
				BufferedReader br = Utilities.getReader(socket);
				String line;
				StringBuilder buildMsg = new StringBuilder();

				line = br.readLine();
				 while (line != null) {
					Log.d("ALEX", "Line = " + line);
					buildMsg.append(line);
					line = br.readLine();
				}

				socket.close();
				final String msg = buildMsg.toString();
				serverMessageTextView.post(new Runnable() {

					@Override
					public void run() {
						// TODO Auto-generated method stub
						serverMessageTextView.setText(msg);
					}
				});

			} catch (Exception exception) {
				Log.e(Constants.TAG, "An exception has occurred: "+exception.getMessage());
				if (Constants.DEBUG) {
					exception.printStackTrace();
				}
			}
		}
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle state) {
		return inflater.inflate(R.layout.fragment_client, parent, false);
	}

	@Override
	public void onActivityCreated(Bundle state) {
		super.onActivityCreated(state);

		serverAddressEditText = (EditText)getActivity().findViewById(R.id.server_address_edit_text);
		serverPortEditText = (EditText)getActivity().findViewById(R.id.server_port_edit_text);
		serverMessageTextView = (TextView)getActivity().findViewById(R.id.server_message_text_view);

		Button displayMessageButton = (Button)getActivity().findViewById(R.id.display_message_button);
		displayMessageButton.setOnClickListener(new Button.OnClickListener() {
			@Override
			public void onClick(View view) {
				new Thread(new ClientThread()).start();
			}
		});

	}

}


text:
from up.commands.command import BaseCommand, BaseCommandHandler

class AltitudeCommand(BaseCommand):
    NAME = 'up.altitude.change'

    ALTITUDE_KEY = 'altitude'

    def __init__(self):
        super().__init__(AltitudeCommand.NAME)

class AltitudeCommandFactory:
    @staticmethod
    def create(altitude) -> AltitudeCommand:
        cmd = AltitudeCommand()
        cmd.data = {AltitudeCommand.ALTITUDE_KEY: altitude}
        return cmd

class AltitudeCommandHandler(BaseCommandHandler):
    def __init__(self, provider):
        super().__init__()
        self.__altitude_provider = provider

    def run_action(self, command):
        if command.data.get(AltitudeCommand.ALTITUDE_KEY, None) is not None:
            self.__altitude_provider.altitude = command.data[AltitudeCommand.ALTITUDE_KEY]


text:
@me.kenzierocks.autoergel.osadata.util.annotation.NonnullByDefault
package me.kenzierocks.autoergel.osadata.data.property;


text:
(function( $, undefined ) {

$.effects.shake = function(o) {

	return this.queue(function() {

		// Create element
		var el = $(this), props = ['position','top','bottom','left','right'];

		// Set options
		var mode = $.effects.setMode(el, o.options.mode || 'effect'); // Set Mode
		var direction = o.options.direction || 'left'; // Default direction
		var distance = o.options.distance || 20; // Default distance
		var times = o.options.times || 3; // Default # of times
		var speed = o.duration || o.options.duration || 140; // Default speed per shake

		// Adjust
		$.effects.save(el, props); el.show(); // Save & Show
		$.effects.createWrapper(el); // Create Wrapper
		var ref = (direction == 'up' || direction == 'down') ? 'top' : 'left';
		var motion = (direction == 'up' || direction == 'left') ? 'pos' : 'neg';

		// Animation
		var animation = {}, animation1 = {}, animation2 = {};
		animation[ref] = (motion == 'pos' ? '-=' : '+=')  + distance;
		animation1[ref] = (motion == 'pos' ? '+=' : '-=')  + distance * 2;
		animation2[ref] = (motion == 'pos' ? '-=' : '+=')  + distance * 2;

		// Animate
		el.animate(animation, speed, o.options.easing);
		for (var i = 1; i < times; i++) { // Shakes
			el.animate(animation1, speed, o.options.easing).animate(animation2, speed, o.options.easing);
		};
		el.animate(animation1, speed, o.options.easing).
		animate(animation, speed / 2, o.options.easing, function(){ // Last shake
			$.effects.restore(el, props); $.effects.removeWrapper(el); // Restore
			if(o.callback) o.callback.apply(this, arguments); // Callback
		});
		el.queue('fx', function() { el.dequeue(); });
		el.dequeue();
	});

};

})(jQuery);


text:
package qinv

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

// Test the instanciation of a PhysicalMachine
func TestNewMachine(t *testing.T) {
	exp := Machine{
		ID:       "host1",
		Hostname: "host1",
		Kernel:   "4.7.10",
	}
	got, _ := NewMachine("host1", "4.7.10")
	assert.Equal(t, exp, got)
}

// GetID test if the id is returned correctly
func TestMachineGetID(t *testing.T) {
	m, _ := NewMachine("host1", "4.7.10")
	got := m.GetID()
	assert.Equal(t, "host1", got)
}

// Test GetMe call, which returns a casted version
func TestMachineGetMe(t *testing.T) {
	m, _ := NewMachine("host1", "4.7.10")
	got := m.GetMe()
	assert.Equal(t, m.GetID(), got.GetID())
}


text:
package org.theospi.portfolio.worksite.intf;

public interface WorksiteAware {
   public String getSiteId();
}


text:
using Xunit;
using Microsoft.Xunit.Performance;

namespace System.Globalization.Tests
{
    public class Perf_CultureInfo
    {
        [Benchmark]
        public void GetCurrentCulture()
        {
            CultureInfo result;
            foreach (var iteration in Benchmark.Iterations)
                using (iteration.StartMeasurement())
                {
                    for (int i = 0; i < 40000; i++)
                    {
                        result = CultureInfo.CurrentCulture; result = CultureInfo.CurrentCulture; result = CultureInfo.CurrentCulture;
                        result = CultureInfo.CurrentCulture; result = CultureInfo.CurrentCulture; result = CultureInfo.CurrentCulture;
                        result = CultureInfo.CurrentCulture; result = CultureInfo.CurrentCulture; result = CultureInfo.CurrentCulture;
                    }
                }
        }

        [Benchmark]
        public void GetInvariantCulture()
        {
            CultureInfo result;
            foreach (var iteration in Benchmark.Iterations)
                using (iteration.StartMeasurement())
                {
                    for (int i = 0; i < 40000; i++)
                    {
                        result = CultureInfo.InvariantCulture; result = CultureInfo.InvariantCulture; result = CultureInfo.InvariantCulture;
                        result = CultureInfo.InvariantCulture; result = CultureInfo.InvariantCulture; result = CultureInfo.InvariantCulture;
                        result = CultureInfo.InvariantCulture; result = CultureInfo.InvariantCulture; result = CultureInfo.InvariantCulture;
                    }
                }
        }
    }
}


text:
class RDoc::Markup::TextFormatterTestCase < RDoc::Markup::FormatterTestCase

  ##
  # Adds test cases to the calling TestCase.

  def self.add_text_tests
    self.class_eval do

      ##
      # Test case that calls <tt>@to.accept_heading</tt>

      def test_accept_heading_indent
        @to.start_accepting
        @to.indent = 3
        @to.accept_heading @RM::Heading.new(1, 'Hello')

        accept_heading_indent
      end

      ##
      # Test case that calls <tt>@to.accept_rule</tt>

      def test_accept_rule_indent
        @to.start_accepting
        @to.indent = 3
        @to.accept_rule @RM::Rule.new(1)

        accept_rule_indent
      end

      ##
      # Test case that calls <tt>@to.accept_verbatim</tt>

      def test_accept_verbatim_indent
        @to.start_accepting
        @to.indent = 2
        @to.accept_verbatim @RM::Verbatim.new("hi\n", " world\n")

        accept_verbatim_indent
      end

      ##
      # Test case that calls <tt>@to.accept_verbatim</tt> with a big indent

      def test_accept_verbatim_big_indent
        @to.start_accepting
        @to.indent = 2
        @to.accept_verbatim @RM::Verbatim.new("hi\n", "world\n")

        accept_verbatim_big_indent
      end

      ##
      # Test case that calls <tt>@to.accept_paragraph</tt> with an indent

      def test_accept_paragraph_indent
        @to.start_accepting
        @to.indent = 3
        @to.accept_paragraph @RM::Paragraph.new(('words ' * 30).strip)

        accept_paragraph_indent
      end

      ##
      # Test case that calls <tt>@to.accept_paragraph</tt> with a long line

      def test_accept_paragraph_wrap
        @to.start_accepting
        @to.accept_paragraph @RM::Paragraph.new(('words ' * 30).strip)

        accept_paragraph_wrap
      end

      ##
      # Test case that calls <tt>@to.attributes</tt> with an escaped
      # cross-reference.  If this test doesn't pass something may be very
      # wrong.

      def test_attributes
        assert_equal 'Dog', @to.attributes("\\Dog")
      end

    end
  end

end


text:
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._
import sbt.Keys._
import sbt._

object Dependencies {

  object Version {

    val scala211 = "2.11.8"

    val scala212 = "2.12.0"

    val scalaAsync = "0.9.6"

    val upickle = "0.3.1"

    val scalatest = "3.0.0"

    val utest = "0.3.0"

    val scalaJSDOM = "0.9.1"

    val chandu0101Macros = "2016.11.0"

    val scalaMeta = "1.4.0"

  }

  val utestJS = libraryDependencies += "com.lihaoyi" %%% "utest" % "0.3.0" % Test

  val scalatestJS = libraryDependencies += "org.scalatest" %%% "scalatest" % Version.scalatest % Test

  val scalaAsync = libraryDependencies += "org.scala-lang.modules" %% "scala-async" % Version.scalaAsync

  val scalaJSUpickle = libraryDependencies += "com.lihaoyi" %%% "upickle" % Version.upickle

  val scalaJSDOM = libraryDependencies += "org.scala-js" %%% "scalajs-dom" % Version.scalaJSDOM

  val chandu0101Macros = libraryDependencies += "com.github.chandu0101" %%% "macros" % Version.chandu0101Macros

  val vdom = libraryDependencies += "com.github.chandu0101" %%% "sri-web-vdom" % "0.7.0-SNAPSHOT"

  val enzyme = libraryDependencies += "com.github.chandu0101" %%% "sri-enzyme" % "2017.1.0-SNAPSHOT"

  val scalaReflect = libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided

  val scalaMeta = libraryDependencies += "org.scalameta" %% "scalameta" % Version.scalaMeta

  val coreModuleDeps = Seq(
    scalaJSDOM,
    chandu0101Macros
  )

  val webModuleDeps = Seq(

  )

  val mobileModuleDeps = Seq(

  )

  val mobileExamplesModuleDeps = Seq(scalaAsync)

  val webExamplesModuleDeps = Seq()

  val testModuleDeps = Seq()

//  val toolsModuleDeps = Seq(scalaMeta)

  val scalatestJSSettings = Seq(scalatestJS,
    scalaJSStage in Global := FastOptStage,
//    scalaJSStage in Global := FullOptStage,
    jsDependencies += RuntimeDOM
//    jsDependencies += ProvidedJS / "test-bundle.js" % Test,
//    jsEnv in Test := new PhantomJS2Env(scalaJSPhantomJSClassLoader.value, addArgs = Seq("--web-security=no"))
//        jsEnv in Test := new NodeJSEnv()
  )

  val utestSettings = Seq(utestJS,
    scalaJSStage in Global := FastOptStage,
    jsDependencies += RuntimeDOM,
    testFrameworks += new TestFramework("utest.runner.Framework"),
    jsEnv in Test := new PhantomJS2Env(scalaJSPhantomJSClassLoader.value, addArgs = Seq("--web-security=no"))
  )

}


text:
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Reactor_Token_T.h
 *
 *  @author Steve Huston <shuston@riverace.com>
 */
//=============================================================================

#ifndef ACE_REACTOR_TOKEN_T_H
#define ACE_REACTOR_TOKEN_T_H
#include /**/ "ace/pre.h"

#include "ace/Reactor_Impl.h"
#include "ace/Token.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

/**
 * @class ACE_Reactor_Token_T
 *
 * @internal For ACE internal use only.
 *
 * @brief Used as a synchronization mechanism to coordinate concurrent
 * access to an ACE_Reactor_Impl object.
 *
 * This class is used to make access to a reactor's internals and
 * demultiplexing mechanism thread-safe.  By default, the thread that
 * runs the handle_events() loop holds the token, even when it is blocked
 * in the demultiplexer.  Whenever another thread wants to access the
 * reactor, such as via the register_handler(), remove_handler(), etc.
 * methods, it must ask the token owner for temporary release of the token.
 * To accomplish this, this class reimplements the ACE_Token::sleep_hook()
 * method through which the owning thread can be notified to temporarily
 * release the token if the current situation permits.
 *
 * The owner of the token is responsible for deciding which
 * request for the token can be granted.  By using the
 * ACE_Token::renew() method, the thread that releases the token
 * temporarily can specify to get the token back right after the
 * other thread has completed using the token.  Thus, there is a
 * dedicated thread that owns the token by default.  This
 * thread grants other threads access to the token by ensuring
 * that whenever somebody else has finished using the token the
 * original owner reclaims the token again, i.e., the owner has the
 * chance to schedule other threads. The thread that most likely needs
 * the token most of the time is the thread running the dispatch loop.
 */
template <class ACE_TOKEN_TYPE>
class ACE_Reactor_Token_T : public ACE_TOKEN_TYPE
{
public:
  ACE_Reactor_Token_T (ACE_Reactor_Impl &r,
                       int s_queue = ACE_TOKEN_TYPE::FIFO);
  ACE_Reactor_Token_T (int s_queue = ACE_TOKEN_TYPE::FIFO);
  virtual ~ACE_Reactor_Token_T (void);

  /// Called just before a token waiter goes to sleep.
  /// @see ACE_Token::sleep_hook
  virtual void sleep_hook (void);

  /// Get the reactor implementation
  ACE_Reactor_Impl &reactor (void);

  /// Set the reactor implementation
  void reactor (ACE_Reactor_Impl &);

  /// Dump the state of an object.
  virtual void dump (void) const;

  /// Declare the dynamic allocation hooks.
  ACE_ALLOC_HOOK_DECLARE;

private:
  ACE_Reactor_Impl *reactor_;
};

ACE_END_VERSIONED_NAMESPACE_DECL

#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "ace/Reactor_Token_T.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */

#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
#pragma implementation ("Reactor_Token_T.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */

#include /**/ "ace/post.h"
#endif /* ACE_REACTOR_TOKEN_T_H */


text:
class Event::Agents::Tasks::Node::PagesController < ApplicationController
  include Cms::PublicFilter::Node
  include Event::GeneratorFilter::Ical

  def generate
    written = generate_node @node
    if written
      @task.log "#{@node.url}index.html" if @task
    end

    # initialize context before generating rss
    init_context
    if generate_node_ical @node
      @task.log "#{@node.url}index.ics" if @task
    end

    @start_date = Time.zone.today.advance(years: -1)
    @close_date = Time.zone.today.advance(years: 1)

    remove_old_pages
    generate_new_pages

    written
  end

  private

  def event_display_options
    %w(index list table)
  end

  def each_month(from, to)
    i = from
    while i <= to
      yield i
      i += 1.month
    end
  end

  def remove_old_pages
    each_month(@start_date.advance(years: -1), @close_date) do |m|
      date = sprintf("#{m.year}%02d", m.month)

      file = "#{@node.path}/#{date}.html"
      Fs.rm_rf(file) if Fs.exist?(file)

      event_display_options.each do |display|
        base = "#{@node.path}/#{date}/#{display}"
        file = "#{base}.html"
        Fs.rm_rf(file) if Fs.exist?(file)
        file = "#{base}.ics"
        Fs.rm_rf(file) if Fs.exist?(file)
      end
    end
  end

  def generate_new_pages
    each_month(@start_date, @close_date) do |m|
      date = sprintf("#{m.year}%02d", m.month)
      event_display_options.each do |display|
        url  = "#{@node.url}#{date}/#{display}.html"
        file = "#{@node.path}/#{date}/#{display}.html"

        init_context
        if generate_node(@node, url: url, file: file)
          @task.log url if @task
        end
      end
    end
  end
end


text:
La végétation est modélisée à l'aide d'une famille de la catégorie Composant de site de {{logiciel}}.

Le nom du type de végétation doit suivre le schéma suivant :

> VRD-VEGT-_CODE OBJET_-_désignation de l'objet_

Les valeurs possibles sont indiquées ci-dessous :

#### Nom des types de végétation

{% include "/00_Referentiel/VRD/NomDesVegetations.md" %}