text:
package com.xcc.advancedday13.adapters;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.xcc.advancedday13.R;
import com.xcc.advancedday13.model.TravelRoot;
import com.xcc.advancedday13.utils.DateUtil;
import com.xcc.advancedday13.utils.PxUtils;

import org.xutils.image.ImageOptions;
import org.xutils.x;

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

import butterknife.BindView;
import butterknife.ButterKnife;

public class TravelsAdapter extends RecyclerView.Adapter<TravelsAdapter.ViewHolder> implements View.OnClickListener {
    private final Context context;
    private List<TravelRoot.DataBean> data;
    private LayoutInflater inflater;
    private ImageOptions options;
    private OnReadAllClicked readAllClicked;
    private RecyclerView recyclerView;
    private OnUserIconClicked userIconClicked;
    private OnUserMoreClicked userMoreClicked;

    public void setUserMoreClicked(OnUserMoreClicked userMoreClicked) {
        this.userMoreClicked = userMoreClicked;
    }

    public void setReadAllClicked(OnReadAllClicked readAllClicked) {
        this.readAllClicked = readAllClicked;
    }

    public void setUserIconClicked(OnUserIconClicked userIconClicked) {
        this.userIconClicked = userIconClicked;
    }

    public TravelsAdapter(Context context, List<TravelRoot.DataBean> data) {
        this.context = context;
        if (data != null) {
            this.data = data;
        } else {
            this.data = new ArrayList<>();
        }
        options = new ImageOptions.Builder()
                .setCircular(true)
                .setLoadingDrawableId(R.mipmap.travels_image_default)
                .setRadius(30)
                .build();
        inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    }

    public void addRes(List<TravelRoot.DataBean> data) {
        if (data != null) {
            this.data.addAll(data);
            notifyDataSetChanged();
        }
    }

    public void updateRes(List<TravelRoot.DataBean> data) {
        if (data != null) {
            this.data.clear();
            this.data.addAll(data);
            notifyDataSetChanged();
        }
    }

    @Override
    public void onAttachedToRecyclerView(RecyclerView recyclerView) {
        super.onAttachedToRecyclerView(recyclerView);
        this.recyclerView = recyclerView;
    }

    @Override
    public int getItemCount() {
        return data != null ? data.size() : 0;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View itemView = inflater.inflate(R.layout.travels_recycler_item, parent, false);
        return new ViewHolder(itemView);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {

        x.image().bind(holder.travelsActivityPhotoUrl, data.get(position).getActivity().getUser().getPhoto_url(), options);
        holder.travelsActivityPhotoUrl.setOnClickListener(this);
//        ViewGroup.LayoutParams layoutParams1 = holder.travelsActivityPhotoUrl.getLayoutParams();
        holder.travelsActivityName.setText(data.get(position).getActivity().getUser().getName());
        holder.travelsName.setText(data.get(position).getUser().getName());
        int gender = data.get(position).getActivity().getUser().getGender();
        if (gender == 0) {
            holder.travelsFollow.setText("关注她");
        } else {
            holder.travelsFollow.setText("关注他");
        }
        List<TravelRoot.DataBean.ActivityBean.ContentsBean> photoContentsUrl = data.get(position).getActivity().getContents();
        holder.travelsActivityContentsPhotoUrlOthers.removeAllViews();
        for (int i = 1; i < photoContentsUrl.size(); i++) {
            ImageView imageView = new ImageView(context);
            holder.travelsActivityContentsPhotoUrlOthers.addView(imageView);
            imageView.setImageResource(R.mipmap.travels_image_default);
            ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) imageView.getLayoutParams();
            imageView.setScaleType(ImageView.ScaleType.FIT_XY);
            marginLayoutParams.width = PxUtils.dp2px(context, 120);
            marginLayoutParams.height = ViewGroup.LayoutParams.MATCH_PARENT;
            if (i != 1) {
                marginLayoutParams.leftMargin = PxUtils.dp2px(context, 5);
            }
            imageView.setLayoutParams(marginLayoutParams);
//            Picasso.with(context).load(data.get(position).getActivity().getContents().get(i).getPhoto_url())
////                .error()
//                    .placeholder(R.mipmap.travels_image_default)
//                    .into(imageView);
        }
        ViewGroup.LayoutParams layoutParams = holder.travelsActivityContentsPhotoUrlOne.getLayoutParams();
        layoutParams.height = data.get(position).getActivity().getContents().get(0).getHeight();
        holder.travelsActivityContentsPhotoUrlOne.setLayoutParams(layoutParams);
//        Picasso.with(context).load(data.get(position).getActivity().getContents().get(0).getPhoto_url())
////                .error()
//                .placeholder(R.mipmap.travels_image_default)
//                .into(holder.travelsActivityContentsPhotoUrlOne);
        holder.travelsActivityTopic.setText(data.get(position).getActivity().getTopic());
        String description = data.get(position).getActivity().getDescription();
        holder.travelsActivityDescription.setText(description);
        if (data.get(position).getActivity().isReadAllClicked()) {
            if (data.get(position).getActivity().isShowDetail()) {
                String toDetail = data.get(position).getActivity().getUser().getName() + ":"
                        + data.get(position).getActivity().getDistricts().get(0).getName() + "旅行记(" +
                        data.get(position).getActivity().getParent_district_count() + "篇)";
                holder.travelsActivityDistrictsToDetail.setVisibility(View.VISIBLE);
                holder.travelsActivityDistrictsToDetail.setText(toDetail);
            }else {
                holder.travelsActivityDistrictsToDetail.setVisibility(View.GONE);
            }
            holder.travelsActivityDescription.setSingleLine(false);
            holder.travelsReadAll.setVisibility(View.GONE);
        }else {
            if (description.length() > 180) {
                holder.travelsActivityDistrictsToDetail.setVisibility(View.GONE);
                holder.travelsActivityDescription.setMaxLines(6);
                holder.travelsReadAll.setVisibility(View.VISIBLE);
            } else {
                if (data.get(position).getActivity().getParent_district_count()>1) {

                    String toDetail = data.get(position).getActivity().getUser().getName() + ":"
                            + data.get(position).getActivity().getDistricts().get(0).getName() + "旅行记(" +
                            data.get(position).getActivity().getParent_district_count() + "篇)";
                    holder.travelsActivityDistrictsToDetail.setText(toDetail);
                    holder.travelsActivityDistrictsToDetail.setVisibility(View.VISIBLE);
                }else {
                    holder.travelsActivityDistrictsToDetail.setVisibility(View.GONE);
                }
                holder.travelsReadAll.setVisibility(View.GONE);
            }
        }
        holder.travelsMore.setOnClickListener(this);
        holder.travelsReadAll.setOnClickListener(this);
        List<TravelRoot.DataBean.ActivityBean.DistrictsBean> districts = data.get(position).getActivity().getDistricts();
        holder.travelsActivityDistricts.removeAllViews();

        for (int i = 0; i < districts.size(); i++) {
            TextView district = new TextView(context);
            holder.travelsActivityDistricts.addView(district);
            district.setTextSize(TypedValue.COMPLEX_UNIT_PX, PxUtils.sp2px(context, 12));
            district.setPadding(PxUtils.dp2px(context,10),PxUtils.dp2px(context,5),PxUtils.dp2px(context,10),PxUtils.dp2px(context,5));
            district.setGravity(Gravity.CENTER);
            ViewGroup.MarginLayoutParams districtLayoutParams = (ViewGroup.MarginLayoutParams) district.getLayoutParams();
            districtLayoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
            districtLayoutParams.height = PxUtils.dp2px(context, 25);
            if (i != 0) {
                districtLayoutParams.leftMargin = PxUtils.dp2px(context, 5);
            }
            district.setLayoutParams(districtLayoutParams);
            district.setText(districts.get(i).getName());
            district.setBackgroundResource(R.drawable.travels_district_shape);
        }

        TravelRoot.DataBean.ActivityBean.PoiBean pois = data.get(position).getActivity().getPoi();
        if (pois != null) {
            TextView poi = new TextView(context);
            holder.travelsActivityDistricts.addView(poi);
            poi.setTextSize(TypedValue.COMPLEX_UNIT_PX, PxUtils.sp2px(context, 12));
            poi.setPadding(PxUtils.dp2px(context,10),PxUtils.dp2px(context,5),PxUtils.dp2px(context,10),PxUtils.dp2px(context,5));
            poi.setGravity(Gravity.CENTER);
            ViewGroup.MarginLayoutParams poiLayoutParams = (ViewGroup.MarginLayoutParams) poi.getLayoutParams();
            poiLayoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
            poiLayoutParams.height = PxUtils.dp2px(context, 25);
            poiLayoutParams.leftMargin = PxUtils.dp2px(context, 5);
            poi.setLayoutParams(poiLayoutParams);
            poi.setText(pois.getName());
            poi.setBackgroundResource(R.drawable.travels_district_shape);
        }

        List<TravelRoot.DataBean.ActivityBean.Categorie> categories = data.get(position).getActivity().getCategories();
        if (categories != null) {
            for (int i = 0; i < categories.size(); i++) {
                TextView categorie = new TextView(context);
                holder.travelsActivityDistricts.addView(categorie);
                categorie.setTextSize(TypedValue.COMPLEX_UNIT_PX, PxUtils.sp2px(context, 12));
                categorie.setPadding(PxUtils.dp2px(context,10),PxUtils.dp2px(context,5),PxUtils.dp2px(context,10),PxUtils.dp2px(context,5));
                categorie.setGravity(Gravity.CENTER);
                ViewGroup.MarginLayoutParams categorieLayoutParams = (ViewGroup.MarginLayoutParams) categorie.getLayoutParams();
                categorieLayoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
                categorieLayoutParams.height = PxUtils.dp2px(context, 25);
                categorieLayoutParams.leftMargin = PxUtils.dp2px(context, 5);
                categorie.setLayoutParams(categorieLayoutParams);
                categorie.setText(categories.get(i).getName());
                categorie.setBackgroundResource(R.drawable.travels_district_shape);
            }
        }

        String createdAt = data.get(position).getActivity().getCreated_at();
        if (createdAt != null) {
            String[] split = createdAt.split("-");
            TextView time = new TextView(context);
            holder.travelsActivityDistricts.addView(time);
            time.setTextSize(TypedValue.COMPLEX_UNIT_PX, PxUtils.sp2px(context, 12));
            time.setPadding(PxUtils.dp2px(context,10),PxUtils.dp2px(context,5),PxUtils.dp2px(context,10),PxUtils.dp2px(context,5));
            time.setGravity(Gravity.CENTER);
            ViewGroup.MarginLayoutParams poiLayoutParams = (ViewGroup.MarginLayoutParams) time.getLayoutParams();
            poiLayoutParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
            poiLayoutParams.height = PxUtils.dp2px(context, 25);
            poiLayoutParams.leftMargin = PxUtils.dp2px(context, 5);
            time.setLayoutParams(poiLayoutParams);
            time.setText(DateUtil.smallToBig(Integer.parseInt(split[1])));
            time.setBackgroundResource(R.drawable.travels_district_shape);
        }
        int likesCount = data.get(position).getActivity().getLikes_count();
        if (likesCount == 0) {
            holder.travelsActivityLikesCount.setText("");
        } else {
            holder.travelsActivityLikesCount.setText(String.valueOf(likesCount));
        }
        int commentsCount = data.get(position).getActivity().getComments_count();
        if (commentsCount == 0) {
            holder.travelsActivityCommentsCount.setText("");
        } else {
            holder.travelsActivityCommentsCount.setText(String.valueOf(commentsCount));
        }
        int favoritesCount = data.get(position).getActivity().getFavorites_count();
        if (favoritesCount == 0) {
            holder.travelsActivityFavoritesCount.setText("");
        } else {
            holder.travelsActivityFavoritesCount.setText(String.valueOf(favoritesCount));
        }
        int level = data.get(position).getActivity().getUser().getLevel();
        if (level <= 2) {
            holder.travelsUserV.setVisibility(View.GONE);
        } else {
            holder.travelsUserV.setVisibility(View.VISIBLE);
        }
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.travels_recycler_item_activity_photo_url:
                userIconClicked.onUserIconClicked(data.get(recyclerView.getChildAdapterPosition((LinearLayout) v.getParent().getParent().getParent())));
                break;
            case R.id.travels_recycler_item_name:
                break;
            case R.id.travels_recycler_item_follow:
                break;
            case R.id.travels_recycler_item_activity_contents_photo_url_one:
                break;
            case R.id.travels_recycler_item_read_all:
                int childAdapterPosition = recyclerView.getChildAdapterPosition((LinearLayout) v.getParent().getParent());
                readAllClicked.onReadAllClicked(data.get(childAdapterPosition));
                break;
            case R.id.travels_recycler_item_activity_districts_to_detail:
                break;
            case R.id.travels_recycler_item_activity_likes_count:
                break;
            case R.id.travels_recycler_item_activity_comments_count:
                break;
            case R.id.travels_recycler_item_activity_favorites_count:
                break;
            case R.id.travels_recycler_item_more:
                userMoreClicked.onUserMoreClicked(data.get(recyclerView.getChildAdapterPosition((LinearLayout) v.getParent().getParent().getParent())),v);
                break;
        }
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.travels_recycler_item_activity_photo_url)
        ImageView travelsActivityPhotoUrl;
        @BindView(R.id.travels_recycler_item_activity_name)
        TextView travelsActivityName;
        @BindView(R.id.travels_recycler_item_name)
        TextView travelsName;
        @BindView(R.id.travels_recycler_item_follow)
        Button travelsFollow;
        @BindView(R.id.travels_recycler_item_activity_contents_photo_url_one)
        ImageView travelsActivityContentsPhotoUrlOne;
        @BindView(R.id.travels_recycler_item_activity_contents_photo_url_others)
        LinearLayout travelsActivityContentsPhotoUrlOthers;
        @BindView(R.id.travels_recycler_item_activity_topic)
        TextView travelsActivityTopic;
        @BindView(R.id.travels_recycler_item_activity_description)
        TextView travelsActivityDescription;
        @BindView(R.id.travels_recycler_item_read_all)
        TextView travelsReadAll;
        @BindView(R.id.travels_recycler_item_activity_districts_to_detail)
        TextView travelsActivityDistrictsToDetail;
        @BindView(R.id.travels_recycler_item_activity_districts)
        LinearLayout travelsActivityDistricts;
        @BindView(R.id.travels_recycler_item_activity_likes_count)
        CheckBox travelsActivityLikesCount;
        @BindView(R.id.travels_recycler_item_activity_comments_count)
        CheckBox travelsActivityCommentsCount;
        @BindView(R.id.travels_recycler_item_activity_favorites_count)
        CheckBox travelsActivityFavoritesCount;
        @BindView(R.id.travels_recycler_item_more)
        TextView travelsMore;
        @BindView(R.id.travels_recycler_item_user_v)
        ImageView travelsUserV;

        public ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }

    public interface OnReadAllClicked {
        void onReadAllClicked(TravelRoot.DataBean item);
    }
    public interface OnUserIconClicked {
        void onUserIconClicked(TravelRoot.DataBean item);
    }
    public interface OnUserMoreClicked {
        void onUserMoreClicked(TravelRoot.DataBean item,View view);
    }
}


text:
package javax.naming.ldap;

import javax.naming.NamingException;

/**
 * See RFC2251 for the definition of an UnsolicitedNotification.
 *
 * @see ExtendedResponse
 * @see HasControls
 *
 */
public interface UnsolicitedNotification
    extends ExtendedResponse, HasControls {

    /*
     * -------------------------------------------------------------------
     * Methods
     * -------------------------------------------------------------------
     */

    /**
     * Gets the referrals associated with this UnsolicitedNotification
     *  instance.
     *
     * @return  the referrals associated with this
     *          UnsolicitedNotification instance
     */
    String[] getReferrals();

    /**
     * Gets the naming exception associated with this
     * UnsolicitedNotification instance.
     *
     * @return  the naming exception associated with this
     *          UnsolicitedNotification instance
     */
    NamingException getException();

}

redpajama_set_name: RedPajamaGithub


text:
A script and associated package designed to associate computers with a locations from a given list.
Save the new reports in the Unsorted folder (script will generate if not present)
Run the script
Look at the results in ogs, Located, and Unlocated, as well the console output.

Right now a lot of aspects of the script are hardcoded which would ideally be setup in a config file later.
Some of these include
-The actual field names read from both computer reports and location files
-The order of the fields by which the script attempts to sort computers (right now: Domain->Name->IP)
-the actual bounds of the naming convention (currently checks first 5 characters, why not more/less?)
-The behaviour of log files (should be built bit by bit, not in one go.)
-The behaviour of the "prefix report" that occurs at the end of the script (could vary prefix length, and minimum count)
-the conventions for writing files (similar to reading)
-the number of folders that can be searched for new reports (fixed, poorly coded)


text:
# Spectacle

[![Join the chat at https://gitter.im/FormidableLabs/spectacle](https://badges.gitter.im/FormidableLabs/spectacle.svg)](https://gitter.im/FormidableLabs/spectacle?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Travis Status][trav_img]][trav_site]
ReactJS based Presentation Library

[Spectacle Boilerplate](https://github.com/FormidableLabs/spectacle-boilerplate/)

## Contents

- [Getting Started](#getting-started)
- [One Page](#one-page)
- [Development](#development)
- [Build & Deployment](#build--deployment)
- [Presenting](#presenting)
- [Controls](#controls)
- [Fullscreen](#fullscreen)
- [PDF Export](#pdf-export)
- [Basic Concepts](#basic-concepts)
  - [Main file](#main-file)
  - [Themes](#themes)
    - [createTheme(colors, fonts)](#createthemecolors-fonts)
- [Tag API](#tag-api)
  - [Main Tags](#main-tags)
    - [Deck](#deck)
    - [Slide (Base)](#slide-base)
    - [Notes](#notes)
    - [MarkdownSlides](#markdown-slides)
  - [Layout Tags](#layout-tags)
    - [Layout](#layout)
    - [Fit](#fit)
    - [Fill](#fill)
  - [Markdown Tag](#markdown-tag)
    - [Markdown](#markdown)
  - [Element Tags](#element-tags)
    - [Appear](#appear)
    - [BlockQuote, Quote and Cite (Base)](#blockquote-quote-and-cite-base)
    - [CodePane (Base)](#codepane-base)
    - [Code (Base)](#code-base)
    - [ComponentPlayground](#component-playground)
    - [Heading (Base)](#heading-base)
    - [Image (Base)](#image-base)
    - [Link (Base)](#link-base)
    - [List & ListItem (Base)](#list--listitem-base)
    - [S (Base)](#s-base)
    - [Table, TableRow, TableBody, TableHeader, TableHeaderItem and TableItem (Base)](#table-tablerow-tableheaderitem-and-tableitem-base)
    - [Text (Base)](#text-base)
    - [Typeface](#typeface)
  - [Base Props](#base-props)
- [Third Party Extensions](#third-party)

## Getting Started

The new best way to get started is by running `create-react-app my-presentation --scripts-version spectacle-scripts`. This will use `create-react-app` to create almost everything you need. This however, doesn't include publish scripts, and ejecting is required for fancy stuff.

The second best way to get started is by using the [Spectacle Boilerplate](https://github.com/FormidableLabs/spectacle-boilerplate).

Alternatively, you can `npm install spectacle` and write your own build configurations. We also provide full UMD builds (with a `Spectacle` global variable) of the library at `dist/spectacle.js` and `dist/spectacle.min.js` for more general use cases. You could, for example, include the library via a script tag with: `https://unpkg.com/spectacle@VERSION/dist/spectacle.min.js`.

Note that we have webpack externals for `react`, `react-dom`, and `prop-types`, so you will need to provide them in your upstream build or something like linking in via `script` tags in your HTML page for all three libraries. This comports with our project dependencies which place these three libraries in `peerDependencies`.

But really, it is SO much easier to just use the boilerplate. Trust me.

## One Page

To aid with speedy development / kicking the tires on spectacle, we support using a simple boilerplate HTML page with a bespoke script tag that contains your entire presentation. The rest of the setup will take care of transpiling your React/ESnext code, providing Spectacle, React, and ReactDOM libraries, and being raring to go with a minimum of effort.

We can start with this project's sample at [`one-page.html`](./one-page.html). It's essentially, the same presentation as the fully-built-from-source version, with a few notable exceptions:

1. There are no `import`s or `require`s. Everything must come from the global namespace. This includes `Spectacle`, `React`, `ReactDOM` and all the Spectacle exports from [`./src/index.js`](./src/index.js) -- `Deck`, `Slide`, `themes`, etc.
2. The presentation must include exactly **one** script tag with the type `text/spectacle` that is a function. Presently, that function is directly inserted inline into a wrapper code boilerplate as a React Component `render` function. The wrapper is transpiled. There should not be any extraneous content around it like outer variables or comments.

    **Good** examples:

    ```html
    <script type="text/spectacle">
      () => (
        <Deck>{/* SLIDES */}</Deck>
      )
    </script>
    ```

    ```html
    <script type="text/spectacle">
      () => {
        // Code-y code stuff in JS...

        return (
          <Deck>{/* SLIDES */}</Deck>
        );
      }
    </script>
    ```

    **Bad** examples of what not to do:

    ```html
    <script type="text/spectacle">
      // Outer comment (BAD)
      const outerVariable = "BAD";

      () => (
        <Deck>{/* SLIDES */}</Deck>
      )
    </script>
    ```

... with those guidelines in mind, here's the boilerplate that you can literally copy-and-paste into an HTML file and start a Spectacle presentation that works from the get go!

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width initial-scale=1 user-scalable=no" />
    <title>Spectacle</title>
    <link href="https://fonts.googleapis.com/css?family=Lobster+Two:400,700" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700" rel="stylesheet" type="text/css">
    <link href="https://unpkg.com/prismjs@1/themes/prism-tomorrow.css" rel="stylesheet" type="text/css">
    <link href="https://unpkg.com/normalize.css@7/normalize.css" rel="stylesheet" type="text/css">
    <link href="https://unpkg.com/spectacle/lib/themes/default/index.css" rel="stylesheet" type="text/css">
</head>
<body>
    <div id="root"></div>
    <script src="https://unpkg.com/prismjs@1/prism.js"></script>
    <script src="https://unpkg.com/prismjs@1/components/prism-jsx.min.js"></script>
    <script src="https://unpkg.com/prop-types@15/prop-types.js"></script>
    <script src="https://unpkg.com/react@15/dist/react.js"></script>
    <script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.js"></script>
    <script src="https://unpkg.com/spectacle/dist/spectacle.js"></script>
    <script src="https://unpkg.com/spectacle/lib/one-page.js"></script>
    <script type="text/spectacle">
      () => {
        // Your JS Code goes here

        return (
          <Deck>
          {/* Throw in some slides here! */}
          </Deck>
        );
      }
    </script>
</body>
</html>
```

## Development

After downloading the boilerplate, your first order of business is to open terminal and run `npm install`

Next run `rm -R .git` to remove the existing version control.

Then, to start up the local server, run `npm start`

Open a browser and hit [http://localhost:3000](http://localhost:3000), and we are ready to roll

## Build & Deployment

Building the dist version of the slides is as easy as running `npm run build:dist`

If you want to deploy the slideshow to surge, run `npm run deploy`

⚠ If you are deploying the dist version to [GitHub Pages](https://pages.github.com/ 'GitHub Pages'), note that the built bundle uses an absolute path to the `/dist/` directory while GitHub Pages requires the relative `./dist/` to find any embedded assets and/or images. A very hacky way to fix this is to edit one place in the produced bundle, as shown [in this GitHub issue](https://github.com/FormidableLabs/spectacle/issues/326#issue-233283633 'GitHub: spectacle issue #326').

## Presenting

Spectacle comes with a built in presenter mode. It shows you a slide lookahead, current time and your current slide:

![http://i.imgur.com/jW8uMYY.png](http://i.imgur.com/jW8uMYY.png)

Otherwise, it can also show you a stopwatch to count the elapsed time:

![http://i.imgur.com/VDltgmZ.png](http://i.imgur.com/VDltgmZ.png)

To present:

- Run `npm start`
- Open two browser windows on two different screens
- On your screen visit [http://localhost:3000/](http://localhost:3000/). You will be redirected to a URL containing the slide id.
- Add `presenter&` or `presenter&timer` immediately after the questionmark, e.g.: [http://localhost:3000/#/0?presenter](http://localhost:3000/#/0?presenter) or [http://localhost:3000/#/0?presenter&timer](http://localhost:3000/#/?presenter&timer&_k=wbyhif)
- On the presentation screen visit [http://localhost:3000/](http://localhost:3000/)
- Give an amazingly stylish presentation

_Note: Any windows/tabs in the same browser that are running Spectacle will sync to one another, even if you don't want to use presentation mode_

Check it out:

![http://i.imgur.com/H7o2qHI.gif](http://i.imgur.com/H7o2qHI.gif_)

You can toggle the presenter or overview mode by pressing respectively `alt+p` and `alt+o`.

## Controls

|Key Combination|Function|
|---|---|
|Right Arrow|Next Slide|
|Left Arrow|Previous Slide|
|Space|Next Slide|
|Shift+Space|Previous Slide|
|Alt/Option + O|Toggle Overview Mode|
|Alt/Option + P|Toggle Presenter Mode|
|Alt/Option + T|Toggle Timer in Presenter Mode|
|Alt/Option + A|Start autoplay (if enabled)|

## Fullscreen

Fullscreen can be toggled via browser options, or by **hovering over the bottom right corner of your window until the fullscreen icon appears and clicking it**.

## PDF Export

Exporting a totally sweet looking PDF from your totally sweet looking Spectacle presentation is absurdly easy.

- Run `npm start`
- Open [http://localhost:3000/](http://localhost:3000/)
- Add `export&` after the `?` on the URL of page you are redirected to, e.g.: [http://localhost:3000/#/?export&_k=wbyhif](http://localhost:3000/#/?export&_k=wbyhif)
- Bring up the print dialog `(ctrl or cmd + p)`
- Check "Background Graphics" to on if you are about that life
- Change destination to "Save as PDF", as shown below:

![http://i.imgur.com/t6GL5Oc.png](http://i.imgur.com/t6GL5Oc.png)

If you want to print your slides, and want a printer friendly version, simply repeat the above process but instead print from [http://localhost:3000/?export&print](http://localhost:3000/?export&print)

## Basic Concepts

### Main file

Your presentation files & assets will live in the `presentation` folder.

The main `.js` file you write your deck in is `/presentation/index.js`

Check it out [here](https://github.com/FormidableLabs/spectacle-boilerplate/blob/master/presentation/index.js) in the boilerplate.

```jsx
// index.js

import React, { Component } from 'react';
import {
  Appear, BlockQuote, Cite, CodePane, Code, Deck, Fill, Fit,
  Heading, Image, Layout, ListItem, List, Quote, Slide, Text
} from 'spectacle';

export default class extends Component {
  render() {
    return (
      <Deck>
        <Slide>
          <Text>Hello</Text>
        </Slide>
      </Deck>
    );
  }
}

```

Here is where you can use the library's tags to compose your presentation. While you can use any JSX syntax here, building your presentation with the supplied tags allows for theming to work properly.

The bare minimum you need to start is a`Deck` element and a `Slide` element. Each `Slide` element represents a slide inside of your slideshow.

### Themes

In Spectacle, themes are functions that return style objects for `screen` & `print`.

You can import the default theme from:

```jsx
import createTheme from "spectacle/lib/themes/default";
```

Or create your own based upon the source.

`index.js` is what you would edit in order to create a custom theme of your own, using ReactJS style inline style objects.

You will want to edit `index.html` to include any web fonts or additional CSS that your theme requires.

#### createTheme(colors, fonts)

Spectacle's functional theme system allows you to pass in color and font variables that you can use on your elements. The fonts configuration object can take a string for a system font or an object that specifies it's a Google Font. If you use a Google Font you can provide a styles array for loading different weights and variations. Google Font tags will be automatically created. See the example below:

```jsx
const theme = createTheme({
  primary: "red",
  secondary: "blue"
}, {
  primary: "Helvetica",
  secondary: { name: "Droid Serif", googleFont: true, styles: [ "400", "700i" ] }
});
```

The returned theme object can then be passed to the `Deck` tag via the `theme` prop, and will override the default styles.

## Tag API

In Spectacle, presentations are composed of a set of base tags. We can separate these into three categories: Main tags, Layout tags & Element tags.

### Main Tags

#### Deck

The Deck tag is the root level tag for your presentation. It supports the following props:

|Name|PropType|Description|
|---|---|---|
|controls| PropTypes.bool| Show control arrows when not in fullscreen
|contentHeight| PropTypes.numbers| Baseline content area height (default: 700)
|contentWidth| PropTypes.numbers| Baseline content area width (default: 1000)
|history|PropTypes.object|Accepts custom configuration for [history](https://github.com/ReactTraining/history)
|progress| PropTypes.string|Accepts `pacman`, `bar`, `number` or `none`. To override the color, change the 'quarternary' color in the theme.
|theme|PropTypes.object|Accepts a theme object for styling your presentation|
|transition|PropTypes.array|Accepts `slide`, `zoom`, `fade` or `spin`, and can be combined. Sets global slide transitions. **Note: If you use the 'scale' transition, fitted text won't work in Safari.**|
|transitionDuration| PropTypes.number| Accepts integer value in milliseconds for global transition duration.
|autoplay|PropTypes.bool| Automatically advance slides.
|autoplayDuration|PropTypes.number| Accepts integer value in milliseconds for global autoplay duration, defaults to 7000.

#### Slide (Base)

The slide tag represents each slide in the presentation. Giving a slide tag an `id` attribute will replace its number based navigation hash with the `id` provided. It supports the following props, in addition to any of the props outlined in the Base class props listing:

|Name|PropType|Description|
|---|---|---|
|align| PropTypes.string | Accepts a space delimited value for positioning interior content. The first value can be `flex-start` (left), `center` (middle), or `flex-end` (right). The second value can be `flex-start` (top) , `center` (middle), or `flex-end` (bottom). You would provide this prop like `align="center center"`, which is its default.
|id| PropTypes.string | Used to create a string based hash.
|maxHeight| PropTypes.number | Used to set max dimensions of the Slide.
|maxWidth| PropTypes.number | Used to set max dimensions of the Slide.
|notes| PropTypes.string| Text which will appear in the presenter mode. Can be HTML.
|transition|PropTypes.array|Accepts `slide`, `zoom`, `fade` or `spin`, and can be combined. Sets the slide transition. **Note: If you use the 'scale' transition, fitted text won't work in Safari.**|
|transitionDuration| PropTypes.number| Accepts integer value in milliseconds for slide transition duration.

#### Notes

The notes tag allows to use any tree of react elements as the notes of a slide. It is used as a child node of a slide tag and its children override any value given as the `notes` attribute of its parent slide.

```jsx
<Slide ...>
  <Notes>
    <h4>Slide notes</h4>
    <ol>
      <li>First note</li>
      <li>Second note</li>
    </ol>
  </Notes>
  {/* Slide content */}
</Slide>
```

### MarkdownSlides

The MarkdownSlides function lets you create a single or multiple slides using Markdown. It can be used as a tagged template literal or a function. Three dashes (`---`) are used as a delimiter between slides.

**Tagged Template Literal Usage**

```jsx
<Deck ...>
  {MarkdownSlides`
## Slide One Title
Slide Content
---
## Slide Two Title
Slide Content
  `}
</Deck>
```

**Function Usage**

```jsx
import slidesMarkdown from "raw!markdown.md";

<Deck ...>
  {MarkdownSlides(slidesMarkdown)}
</Deck>
```

### Layout Tags

Layout tags are used for layout using Flexbox within your slide. They are `Layout`, `Fit` & `Fill`.

#### Layout

The layout tag is used to wrap `Fit` and `Fill` tags to provide a row.

#### Fit

The fit tag only takes up as much space as its bounds provide.

#### Fill

The fill tag takes up all the space available to it. For example, if you have a `Fill` tag next to a `Fit` tag, the `Fill` tag will take up the rest of the space. Adjacent `Fill` tags split the difference and form an equidistant grid.

### Markdown Tag

#### Markdown

The Markdown tag is used to add inline markdown to your slide. You can provide markdown source via the `source` prop, or as children. You can also provide a custom [mdast configuration](https://github.com/wooorm/mdast) via the `mdastConfig` prop.

Markdown generated tags aren't prop configurable, and instead render with your theme defaults.

|Name|PropType|Description|
|---|---|---|
|source|PropTypes.string| Markdown source |

### Element Tags

The element tags are the bread and butter of your slide content. Most of these tags derive their props from the Base class, but the ones that have special options will have them listed:

#### Appear

This tag does not extend from Base. It's special. Wrapping elements in the appear tag makes them appear/disappear in order in response to navigation.

#### BlockQuote, Quote and Cite (Base)

These tags create a styled blockquote. Use them as follows:

```jsx
<BlockQuote>
  <Quote>Ken Wheeler is amazing</Quote>
  <Cite>Everyone</Cite>
</BlockQuote>
```

#### CodePane (Base)

This tag displays a styled, highlighted code preview. I prefer putting my code samples in external `.example` files and requiring them using `raw-loader` as shown in the demo. Here are the props:

|Name|PropType|Description|
|---|---|---|
|lang|PropTypes.string| Prism compatible language name. i.e: 'javascript' |
|source| PropTypes.string| String of code to be shown |

You can change your syntax highlighting theme by swapping the prism.js CSS file in `index.html`

#### Code (Base)

A simple tag for wrapping inline text that you want lightly styled in a monospace font.

#### Component Playground

This tag displays a two-pane view with a ES6 source code editor on the right and a preview pane on the left for showing off custom React components. `React` and `render` from `ReactDOM` are supplied as variables. To render a component use the domContainer `mountNode`. Any `console` output will be forwarded to the main console in the browser.

|Name|PropType|Description|
|---|---|---|
|code|PropTypes.string|The code block you want to initially supply to the component playground. If none is supplied a demo component will be displayed.|
|previewBackgroundColor|PropTypes.string|The background color you want for the preview pane. Defaults to `#fff`.|
|theme|PropTypes.string|Accepts `light` or `dark` for the source editor's syntax highlighting. Defaults to `light`.|
|scope|PropTypes.object|Defines any outside modules or components to expose to the playground. React, Component, and render are supplied for you.|

Example code blocks:

```jsx
const Button = ({ title }) => (<button type="button">{ title }</button>);
render(<Button title="My Button" />, mountNode);
```

```jsx
class View extends React.Component {
  componentDidMount() {
    console.log("Hello");
  }

  render() {
    return (<div>My View</div>);
  }
}
render(<View />, mountNode);
```

#### Heading (Base)

Heading tags are special in that, when you specify a `size` prop, they generate the appropriate heading tag, and extend themselves with a style that is defined in the theme file for that heading. Line height can be adjusted via a numeric `lineHeight` prop.

|Name|PropType|Description|
|---|---|---|
|fit|PropTypes.boolean| When set to true, fits text to the slide's width. **Note: If you use the 'scale' transition, this won't work in Safari.** |
|lineHeight|PropTypes.number| Sets the line height of your text.|

#### Image (Base)

|Name|PropType|Description|
|---|---|---|
|display|PropTypes.string| Set the display style property of the image |
|height|PropTypes.string or PropTypes.number| Supply a height to the image |
|src|PropTypes.string| Image src |
|width|PropTypes.string or PropTypes.number| Supply a width to the image |

#### Link (Base)

The link tag is used to render `<a>` tags. It accepts an `href` prop:

|Name|PropType|Description|
|---|---|---|
|href|PropTypes.string| String of url for `href` attribute |
|target|PropTypes.string| Set the `target` attribute |

#### List & ListItem (Base)

|Name|PropType|Description|
|---|---|---|
|ordered|PropTypes.bool| Render as `<ol>`-tag|
|reversed|PropTypes.bool| Set the `reversed` attribute |
|start|PropTypes.bool| Set the `start` attribute, Default: 1 |
|type|PropTypes.bool| Set the `type` attribute. Default: "1" |

These tags create lists. Use them as follows:

Ordered lists:
```jsx
<List ordered start={2} type="A">
  <ListItem>Item 1</ListItem>
  <ListItem>Item 2</ListItem>
  <ListItem>Item 3</ListItem>
  <ListItem>Item 4</ListItem>
</List>
```

Unordered lists:
```jsx
<List>
  <ListItem>Item 1</ListItem>
  <ListItem>Item 2</ListItem>
  <ListItem>Item 3</ListItem>
  <ListItem>Item 4</ListItem>
</List>
```

#### S (Base)

The `S` tag is used to add inline styling to a piece of text, such as underline or strikethrough.

|Name|PropType|Description|
|---|---|---|
|type|PropTypes.string| Accepts `strikethrough`, `underline`, `bold` or `italic`|

#### Table, TableRow, TableHeaderItem and TableItem (Base)

The `Table` tag is used to add table to your slide. It is used with `TableHeader`, `TableBody`, `TableRow`, `TableHeaderItem` and `TableItem`. Use them as follows:

```jsx
<Table>
  <TableHeader>
    <TableRow>
      <TableHeaderItem></TableHeaderItem>
      <TableHeaderItem>2011</TableHeaderItem>
    </TableRow>
  </TableHeader>
  <TableBody>
    <TableRow>
      <TableItem>None</TableItem>
      <TableItem>61.8%</TableItem>
    </TableRow>
    <TableRow>
      <TableItem>jQuery</TableItem>
      <TableItem>28.3%</TableItem>
    </TableRow>
  </TableBody>
</Table>
```

#### Text (Base)

The `Text` tag is used to add text to your slide. Line height can be adjusted via a numeric `lineHeight` prop.

|Name|PropType|Description|
|---|---|---|
|fit|PropTypes.boolean| When set to true, fits text to the slide's width. **Note: If you use the 'scale' transition, this won't work in Safari.** |
|lineHeight|PropTypes.number| Sets the line height of your text.|

### Base Props

Every component above that has `(Base)` after it has been extended from a common class that includes the following props:

| Name | PropType | Description |
| ---- | -------- | ----------- |
| italic | PropTypes.boolean | Set `fontStyle` to `italic` |
| bold | PropTypes.boolean | Set `fontWeight` to `bold ` |
| caps | PropTypes.boolean | Set `textTransform` to `uppercase ` |
| margin | PropTypes.number or string | Set `margin` value|
| padding | PropTypes.number or string | Set `padding` value|
| textColor | PropTypes.string | Set `color` value|
| textSize | PropTypes.string | Set `fontSize` value|
| textAlign | PropTypes.string | Set `textAlign` value|
| textFont | PropTypes.string | Set `textFont` value|
| bgColor | PropTypes.string | Set `backgroundColor` value|
| bgImage | PropTypes.string | Set `backgroundImage` value|
| bgDarken | PropTypes.number | Float value from 0.0 to 1.0 specifying how much to darken the bgImage image|

#### Typeface

The `Typeface` tag is used to apply a specific font to text content. It can either use a font that exists on the system or load a font from the Google Fonts library. `Typeface` requires either `font` or `googleFont` to be defined.

| Name | PropType | Description |
| ---- | -------- | ----------- |
| font | PropTypes.string | Use a font from the local system |
| googleFont | PropTypes.string | Use a font from the Google Fonts library |
| weight | PropTypes.number | Numeric weight value for the font. Default: `400`. |
| italic | PropTypes.boolean | Use an italics variant of the font if it exists. Default: `false`. |

```jsx
<Typeface googleFont="Roboto Slab" weight={600}>
  <Text>This text is using bold Roboto Slab from Google Fonts.</Text>
</Typeface>
```

```jsx
<Typeface font="SF Text" weight={400} italic={true}>
  <Text>This text is using the San Francisco Text font from the system.</Text>
</Typeface>
```

## Third Party Extensions

- [Spectacle Code Slide](https://github.com/thejameskyle/spectacle-code-slide) - Step through lines of code using this awesome slide extension by @thejameskyle
- [Spectacle Terminal Slide](https://github.com/elijahmanor/spectacle-terminal) - Terminal component that can be used in a spectacle slide deck by @elijahmanor
- [Spectacle Image Slide](https://github.com/FezVrasta/spectacle-image-slide) - Show a slide with a big image and a title on top

[trav_img]: https://api.travis-ci.org/FormidableLabs/spectacle.svg
[trav_site]: https://travis-ci.org/FormidableLabs/spectacle


text:
title: Month View
page_title: Month View - RadScheduler
description: Check our Web Forms article about Month View.
slug: scheduler/views/month-view
tags: month,view
published: True
position: 3
---

# Month View

The **Month View** is a standard cell list, which shows all appointments for a specific month. Each cell represents a separate day.

## Month View Settings

* **AdaptiveRowHeight**- Increase the cell height when containing appointments and reduces its height if there are no appointments for that specific day.

* **DayHeaderDateFormat**- Sets the date format for each cell header.

* **FirstDayHeaderDateFormat**- Sets the date format only for first day of the current month.

* **MinimumRowHeight**- Sets the minimum cell height.

* **VisibleAppointmentsPerDay**- Indicates how many appointments could be listed for a day. When there are more appointments for a specific day a "more" link will be placed at the bottom of the day cell and will navigate to the day view if clicked.

## Grouping

**Month View** will provide full support for Resource and Date grouping, namely:

* No groping (Basic look)![scheduler-views-dayview-nogrouping](images/scheduler-views-dayview-nogrouping.png)

* Grouped by Resource (**Horizontal**)![scheduler-views-monthview-horizontalgroupingbyresource](images/scheduler-views-monthview-horizontalgroupingbyresource.png)

* Grouped by Resource (**Vertical**)![scheduler-views-monthview-verticalgroupingbyresource](images/scheduler-views-monthview-verticalgroupingbyresource.png)

* Grouped by Date, Resource (**Horizontal**)![scheduler-views-monthview-horizontalgroupingbyresourceanddate](images/scheduler-views-monthview-horizontalgroupingbyresourceanddate.png)

* Grouped by Date, Resource (**Vertical**)![scheduler-views-monthview-horizontalgroupingbyresourceanddate](images/scheduler-views-monthview-horizontalgroupingbyresourceanddate.png)


text:
package io.reactivex.internal.operators.observable;

import static org.junit.Assert.*;

import java.util.List;
import java.util.concurrent.TimeUnit;

import org.junit.Test;

import io.reactivex.*;
import io.reactivex.disposables.*;
import io.reactivex.exceptions.*;
import io.reactivex.functions.Function;
import io.reactivex.internal.fuseable.*;
import io.reactivex.observers.*;
import io.reactivex.schedulers.Schedulers;
import io.reactivex.subjects.PublishSubject;

public class ObservableFlatMapCompletableTest {

    @Test
    public void normalObservable() {
        Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        }).toObservable()
        .test()
        .assertResult();
    }

    @Test
    public void mapperThrowsObservable() {
        PublishSubject<Integer> ps = PublishSubject.create();

        TestObserver<Integer> to = ps
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                throw new TestException();
            }
        }).<Integer>toObservable()
        .test();

        assertTrue(ps.hasObservers());

        ps.onNext(1);

        to.assertFailure(TestException.class);

        assertFalse(ps.hasObservers());
    }

    @Test
    public void mapperReturnsNullObservable() {
        PublishSubject<Integer> ps = PublishSubject.create();

        TestObserver<Integer> to = ps
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return null;
            }
        }).<Integer>toObservable()
        .test();

        assertTrue(ps.hasObservers());

        ps.onNext(1);

        to.assertFailure(NullPointerException.class);

        assertFalse(ps.hasObservers());
    }

    @Test
    public void normalDelayErrorObservable() {
        Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        }, true).toObservable()
        .test()
        .assertResult();
    }

    @Test
    public void normalAsyncObservable() {
        Observable.range(1, 1000)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Observable.range(1, 100).subscribeOn(Schedulers.computation()).ignoreElements();
            }
        }).toObservable()
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult();
    }

    @Test
    public void normalDelayErrorAllObservable() {
        TestObserver<Integer> to = Observable.range(1, 10).concatWith(Observable.<Integer>error(new TestException()))
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.error(new TestException());
            }
        }, true).<Integer>toObservable()
        .test()
        .assertFailure(CompositeException.class);

        List<Throwable> errors = TestHelper.compositeList(to.errors().get(0));

        for (int i = 0; i < 11; i++) {
            TestHelper.assertError(errors, i, TestException.class);
        }
    }

    @Test
    public void normalDelayInnerErrorAllObservable() {
        TestObserver<Integer> to = Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.error(new TestException());
            }
        }, true).<Integer>toObservable()
        .test()
        .assertFailure(CompositeException.class);

        List<Throwable> errors = TestHelper.compositeList(to.errors().get(0));

        for (int i = 0; i < 10; i++) {
            TestHelper.assertError(errors, i, TestException.class);
        }
    }

    @Test
    public void normalNonDelayErrorOuterObservable() {
        Observable.range(1, 10).concatWith(Observable.<Integer>error(new TestException()))
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        }, false).toObservable()
        .test()
        .assertFailure(TestException.class);
    }

    @Test
    public void fusedObservable() {
        TestObserver<Integer> to = ObserverFusion.newTest(QueueFuseable.ANY);

        Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        }).<Integer>toObservable()
        .subscribe(to);

        to
        .assertOf(ObserverFusion.<Integer>assertFuseable())
        .assertOf(ObserverFusion.<Integer>assertFusionMode(QueueFuseable.ASYNC))
        .assertResult();
    }

    @Test
    public void disposedObservable() {
        TestHelper.checkDisposed(Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        }).toObservable());
    }

    @Test
    public void normal() {
        Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        })
        .test()
        .assertResult();
    }

    @Test
    public void mapperThrows() {
        PublishSubject<Integer> ps = PublishSubject.create();

        TestObserver<Void> to = ps
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                throw new TestException();
            }
        })
        .test();

        assertTrue(ps.hasObservers());

        ps.onNext(1);

        to.assertFailure(TestException.class);

        assertFalse(ps.hasObservers());
    }

    @Test
    public void mapperReturnsNull() {
        PublishSubject<Integer> ps = PublishSubject.create();

        TestObserver<Void> to = ps
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return null;
            }
        })
        .test();

        assertTrue(ps.hasObservers());

        ps.onNext(1);

        to.assertFailure(NullPointerException.class);

        assertFalse(ps.hasObservers());
    }

    @Test
    public void normalDelayError() {
        Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        }, true)
        .test()
        .assertResult();
    }

    @Test
    public void normalAsync() {
        Observable.range(1, 1000)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Observable.range(1, 100).subscribeOn(Schedulers.computation()).ignoreElements();
            }
        })
        .test()
        .awaitDone(5, TimeUnit.SECONDS)
        .assertResult();
    }

    @Test
    public void normalDelayErrorAll() {
        TestObserver<Void> to = Observable.range(1, 10).concatWith(Observable.<Integer>error(new TestException()))
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.error(new TestException());
            }
        }, true)
        .test()
        .assertFailure(CompositeException.class);

        List<Throwable> errors = TestHelper.compositeList(to.errors().get(0));

        for (int i = 0; i < 11; i++) {
            TestHelper.assertError(errors, i, TestException.class);
        }
    }

    @Test
    public void normalDelayInnerErrorAll() {
        TestObserver<Void> to = Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.error(new TestException());
            }
        }, true)
        .test()
        .assertFailure(CompositeException.class);

        List<Throwable> errors = TestHelper.compositeList(to.errors().get(0));

        for (int i = 0; i < 10; i++) {
            TestHelper.assertError(errors, i, TestException.class);
        }
    }

    @Test
    public void normalNonDelayErrorOuter() {
        Observable.range(1, 10).concatWith(Observable.<Integer>error(new TestException()))
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        }, false)
        .test()
        .assertFailure(TestException.class);
    }

    @Test
    public void fused() {
        TestObserver<Integer> to = ObserverFusion.newTest(QueueFuseable.ANY);

        Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        })
        .<Integer>toObservable()
        .subscribe(to);

        to
        .assertOf(ObserverFusion.<Integer>assertFuseable())
        .assertOf(ObserverFusion.<Integer>assertFusionMode(QueueFuseable.ASYNC))
        .assertResult();
    }

    @Test
    public void disposed() {
        TestHelper.checkDisposed(Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        }));
    }

    @Test
    public void innerObserver() {
        Observable.range(1, 3)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return new Completable() {
                    @Override
                    protected void subscribeActual(CompletableObserver s) {
                        s.onSubscribe(Disposables.empty());

                        assertFalse(((Disposable)s).isDisposed());

                        ((Disposable)s).dispose();

                        assertTrue(((Disposable)s).isDisposed());
                    }
                };
            }
        })
        .test();
    }

    @Test
    public void badSource() {
        TestHelper.checkBadSourceObservable(new Function<Observable<Integer>, Object>() {
            @Override
            public Object apply(Observable<Integer> o) throws Exception {
                return o.flatMapCompletable(new Function<Integer, CompletableSource>() {
                    @Override
                    public CompletableSource apply(Integer v) throws Exception {
                        return Completable.complete();
                    }
                });
            }
        }, false, 1, null);
    }

    @Test
    public void fusedInternalsObservable() {
        Observable.range(1, 10)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return Completable.complete();
            }
        })
        .toObservable()
        .subscribe(new Observer<Object>() {
            @Override
            public void onSubscribe(Disposable d) {
                QueueDisposable<?> qd = (QueueDisposable<?>)d;
                try {
                    assertNull(qd.poll());
                } catch (Throwable ex) {
                    throw new RuntimeException(ex);
                }
                assertTrue(qd.isEmpty());
                qd.clear();
            }

            @Override
            public void onNext(Object t) {
            }

            @Override
            public void onError(Throwable t) {
            }

            @Override
            public void onComplete() {
            }
        });
    }

    @Test
    public void innerObserverObservable() {
        Observable.range(1, 3)
        .flatMapCompletable(new Function<Integer, CompletableSource>() {
            @Override
            public CompletableSource apply(Integer v) throws Exception {
                return new Completable() {
                    @Override
                    protected void subscribeActual(CompletableObserver s) {
                        s.onSubscribe(Disposables.empty());

                        assertFalse(((Disposable)s).isDisposed());

                        ((Disposable)s).dispose();

                        assertTrue(((Disposable)s).isDisposed());
                    }
                };
            }
        })
        .toObservable()
        .test();
    }

    @Test
    public void badSourceObservable() {
        TestHelper.checkBadSourceObservable(new Function<Observable<Integer>, Object>() {
            @Override
            public Object apply(Observable<Integer> o) throws Exception {
                return o.flatMapCompletable(new Function<Integer, CompletableSource>() {
                    @Override
                    public CompletableSource apply(Integer v) throws Exception {
                        return Completable.complete();
                    }
                }).toObservable();
            }
        }, false, 1, null);
    }
}


text:
module Exceptor
  module InstanceMethods

    def exceptor(constant = nil,&block)
      constant ||= self.class._default_exceptor
      begin
        block.call
      rescue => e
        instance_exec(ContextDelegator.new(block.binding),e,&constant.exceptors[e.class])
      end
    end

  end
end


text:
package com.facebook.imagepipeline.producers;

import javax.annotation.Nullable;
import javax.annotation.concurrent.GuardedBy;

import java.util.Map;
import java.util.concurrent.Executor;

import android.graphics.Bitmap;

import com.facebook.common.internal.ImmutableMap;
import com.facebook.common.internal.Preconditions;
import com.facebook.common.references.CloseableReference;
import com.facebook.common.util.UriUtil;
import com.facebook.imagepipeline.common.ImageDecodeOptions;
import com.facebook.imagepipeline.decoder.ImageDecoder;
import com.facebook.imagepipeline.decoder.ProgressiveJpegConfig;
import com.facebook.imagepipeline.decoder.ProgressiveJpegParser;
import com.facebook.imagepipeline.image.CloseableImage;
import com.facebook.imagepipeline.image.CloseableStaticBitmap;
import com.facebook.imagepipeline.image.EncodedImage;
import com.facebook.imagepipeline.image.ImmutableQualityInfo;
import com.facebook.imagepipeline.image.QualityInfo;
import com.facebook.imagepipeline.memory.ByteArrayPool;
import com.facebook.imagepipeline.request.ImageRequest;

import static com.facebook.imagepipeline.producers.JobScheduler.JobRunnable;

/**
 * Decodes images.
 *
 *
 Progressive JPEGs are decoded progressively as new data arrives.
 */
public class DecodeProducer implements Producer<CloseableReference<CloseableImage>> {

  public static final String PRODUCER_NAME = "DecodeProducer";

  // keys for extra map
  private static final String BITMAP_SIZE_KEY = "bitmapSize";
  private static final String HAS_GOOD_QUALITY_KEY = "hasGoodQuality";
  private static final String IMAGE_TYPE_KEY = "imageType";
  private static final String IS_FINAL_KEY = "isFinal";

  private final ByteArrayPool mByteArrayPool;
  private final Executor mExecutor;
  private final ImageDecoder mImageDecoder;
  private final ProgressiveJpegConfig mProgressiveJpegConfig;
  private final Producer<EncodedImage> mInputProducer;
  private final boolean mDownsampleEnabled;
  private final boolean mDownsampleEnabledForNetwork;

  public DecodeProducer(
      final ByteArrayPool byteArrayPool,
      final Executor executor,
      final ImageDecoder imageDecoder,
      final ProgressiveJpegConfig progressiveJpegConfig,
      final boolean downsampleEnabled,
      final boolean downsampleEnabledForNetwork,
      final Producer<EncodedImage> inputProducer) {
    mByteArrayPool = Preconditions.checkNotNull(byteArrayPool);
    mExecutor = Preconditions.checkNotNull(executor);
    mImageDecoder = Preconditions.checkNotNull(imageDecoder);
    mProgressiveJpegConfig = Preconditions.checkNotNull(progressiveJpegConfig);
    mDownsampleEnabled = downsampleEnabled;
    mDownsampleEnabledForNetwork = downsampleEnabledForNetwork;
    mInputProducer = Preconditions.checkNotNull(inputProducer);
  }

  @Override
  public void produceResults(
      final Consumer<CloseableReference<CloseableImage>> consumer,
      final ProducerContext producerContext) {
    final ImageRequest imageRequest = producerContext.getImageRequest();
    ProgressiveDecoder progressiveDecoder;
    if (!UriUtil.isNetworkUri(imageRequest.getSourceUri())) {
      progressiveDecoder = new LocalImagesProgressiveDecoder(consumer, producerContext);
    } else {
      ProgressiveJpegParser jpegParser = new ProgressiveJpegParser(mByteArrayPool);
      progressiveDecoder = new NetworkImagesProgressiveDecoder(
          consumer,
          producerContext,
          jpegParser,
          mProgressiveJpegConfig);
    }
    mInputProducer.produceResults(progressiveDecoder, producerContext);
  }

  private abstract class ProgressiveDecoder extends DelegatingConsumer<
      EncodedImage, CloseableReference<CloseableImage>> {

    private final ProducerContext mProducerContext;
    private final ProducerListener mProducerListener;
    private final ImageDecodeOptions mImageDecodeOptions;

    @GuardedBy("this")
    private boolean mIsFinished;

    private final JobScheduler mJobScheduler;

    public ProgressiveDecoder(
        final Consumer<CloseableReference<CloseableImage>> consumer,
        final ProducerContext producerContext) {
      super(consumer);
      mProducerContext = producerContext;
      mProducerListener = producerContext.getListener();
      mImageDecodeOptions = producerContext.getImageRequest().getImageDecodeOptions();
      mIsFinished = false;
      JobRunnable job = new JobRunnable() {
        @Override
        public void run(EncodedImage encodedImage, boolean isLast) {
          if (encodedImage != null) {
            if (mDownsampleEnabled) {
              ImageRequest request = producerContext.getImageRequest();
              if (mDownsampleEnabledForNetwork ||
                  !UriUtil.isNetworkUri(request.getSourceUri())) {
                encodedImage.setSampleSize(DownsampleUtil.determineSampleSize(
                    request, encodedImage));
              }
            }
            doDecode(encodedImage, isLast);
          }
        }
      };
      mJobScheduler = new JobScheduler(mExecutor, job, mImageDecodeOptions.minDecodeIntervalMs);
      mProducerContext.addCallbacks(
          new BaseProducerContextCallbacks() {
            @Override
            public void onIsIntermediateResultExpectedChanged() {
              if (mProducerContext.isIntermediateResultExpected()) {
                mJobScheduler.scheduleJob();
              }
            }
          });
    }

    @Override
    public void onNewResultImpl(EncodedImage newResult, boolean isLast) {
      if (isLast && !EncodedImage.isValid(newResult)) {
        handleError(new NullPointerException("Encoded image is not valid."));
        return;
      }
      if (!updateDecodeJob(newResult, isLast)) {
        return;
      }
      if (isLast || mProducerContext.isIntermediateResultExpected()) {
        mJobScheduler.scheduleJob();
      }
    }

    @Override
    public void onFailureImpl(Throwable t) {
      handleError(t);
    }

    @Override
    public void onCancellationImpl() {
      handleCancellation();
    }

    /** Updates the decode job. */
    protected boolean updateDecodeJob(EncodedImage ref, boolean isLast) {
      return mJobScheduler.updateJob(ref, isLast);
    }

    /** Performs the decode synchronously. */
    private void doDecode(EncodedImage encodedImage, boolean isLast) {
      if (isFinished() || !EncodedImage.isValid(encodedImage)) {
        return;
      }

      try {
        long queueTime = mJobScheduler.getQueuedTime();
        int length = isLast ?
            encodedImage.getSize() : getIntermediateImageEndOffset(encodedImage);
        QualityInfo quality = isLast ? ImmutableQualityInfo.FULL_QUALITY : getQualityInfo();

        mProducerListener.onProducerStart(mProducerContext.getId(), PRODUCER_NAME);
        CloseableImage image = null;
        try {
          image = mImageDecoder.decodeImage(encodedImage, length, quality, mImageDecodeOptions);
        } catch (Exception e) {
          Map<String, String> extraMap = getExtraMap(image, queueTime, quality, isLast);
          mProducerListener.
              onProducerFinishWithFailure(mProducerContext.getId(), PRODUCER_NAME, e, extraMap);
          handleError(e);
          return;
        }
        Map<String, String> extraMap = getExtraMap(image, queueTime, quality, isLast);
        mProducerListener.
            onProducerFinishWithSuccess(mProducerContext.getId(), PRODUCER_NAME, extraMap);
        handleResult(image, isLast);
      } finally {
        EncodedImage.closeSafely(encodedImage);
      }
    }

    private Map<String, String> getExtraMap(
        @Nullable CloseableImage image,
        long queueTime,
        QualityInfo quality,
        boolean isFinal) {
      if (!mProducerListener.requiresExtraMap(mProducerContext.getId())) {
        return null;
      }
      String queueStr = String.valueOf(queueTime);
      String qualityStr = String.valueOf(quality.isOfGoodEnoughQuality());
      String finalStr = String.valueOf(isFinal);
      String imageTypeStr = String.valueOf(mProducerContext.getImageRequest().getImageType());
      if (image instanceof CloseableStaticBitmap) {
        Bitmap bitmap = ((CloseableStaticBitmap) image).getUnderlyingBitmap();
        String sizeStr = bitmap.getWidth() + "x" + bitmap.getHeight();
        return ImmutableMap.of(
            BITMAP_SIZE_KEY,
            sizeStr,
            JobScheduler.QUEUE_TIME_KEY,
            queueStr,
            HAS_GOOD_QUALITY_KEY,
            qualityStr,
            IS_FINAL_KEY,
            finalStr,
            IMAGE_TYPE_KEY,
            imageTypeStr);
      } else {
        return ImmutableMap.of(
            JobScheduler.QUEUE_TIME_KEY,
            queueStr,
            HAS_GOOD_QUALITY_KEY,
            qualityStr,
            IS_FINAL_KEY,
            finalStr,
            IMAGE_TYPE_KEY,
            imageTypeStr);
      }
    }

    /**
     * @return true if producer is finished
     */
    private synchronized boolean isFinished() {
      return mIsFinished;
    }

    /**
     * Finishes if not already finished and shouldFinish is specified.
     *
 If just finished, the intermediate image gets released.
     */
    private void maybeFinish(boolean shouldFinish) {
      synchronized (ProgressiveDecoder.this) {
        if (!shouldFinish || mIsFinished) {
          return;
        }
        mIsFinished = true;
      }
      mJobScheduler.clearJob();
    }

    /**
     * Notifies consumer of new result and finishes if the result is final.
     */
    private void handleResult(final CloseableImage decodedImage, final boolean isFinal) {
      CloseableReference<CloseableImage> decodedImageRef = CloseableReference.of(decodedImage);
      try {
        maybeFinish(isFinal);
        getConsumer().onNewResult(decodedImageRef, isFinal);
      } finally {
        CloseableReference.closeSafely(decodedImageRef);
      }
    }

    /**
     * Notifies consumer about the failure and finishes.
     */
    private void handleError(Throwable t) {
      maybeFinish(true);
      getConsumer().onFailure(t);
    }

    /**
     * Notifies consumer about the cancellation and finishes.
     */
    private void handleCancellation() {
      maybeFinish(true);
      getConsumer().onCancellation();
    }

    protected abstract int getIntermediateImageEndOffset(EncodedImage encodedImage);

    protected abstract QualityInfo getQualityInfo();
  }

  private class LocalImagesProgressiveDecoder extends ProgressiveDecoder {

    public LocalImagesProgressiveDecoder(
        final Consumer<CloseableReference<CloseableImage>> consumer,
        final ProducerContext producerContext) {
      super(consumer, producerContext);
    }

    @Override
    protected synchronized boolean updateDecodeJob(EncodedImage encodedImage, boolean isLast) {
      if (!isLast) {
        return false;
      }
      return super.updateDecodeJob(encodedImage, isLast);
    }

    @Override
    protected int getIntermediateImageEndOffset(EncodedImage encodedImage) {
      return encodedImage.getSize();
    }

    @Override
    protected QualityInfo getQualityInfo() {
      return ImmutableQualityInfo.of(0, false, false);
    }
  }

  private class NetworkImagesProgressiveDecoder extends ProgressiveDecoder {

    private final ProgressiveJpegParser mProgressiveJpegParser;
    private final ProgressiveJpegConfig mProgressiveJpegConfig;
    private int mLastScheduledScanNumber;

    public NetworkImagesProgressiveDecoder(
        final Consumer<CloseableReference<CloseableImage>> consumer,
        final ProducerContext producerContext,
        final ProgressiveJpegParser progressiveJpegParser,
        final ProgressiveJpegConfig progressiveJpegConfig) {
      super(consumer, producerContext);
      mProgressiveJpegParser = Preconditions.checkNotNull(progressiveJpegParser);
      mProgressiveJpegConfig = Preconditions.checkNotNull(progressiveJpegConfig);
      mLastScheduledScanNumber = 0;
    }

    @Override
    protected synchronized boolean updateDecodeJob(EncodedImage encodedImage, boolean isLast) {
      boolean ret = super.updateDecodeJob(encodedImage, isLast);
      if (!isLast && EncodedImage.isValid(encodedImage)) {
        if (!mProgressiveJpegParser.parseMoreData(encodedImage)) {
          return false;
        }
        int scanNum = mProgressiveJpegParser.getBestScanNumber();
        if (scanNum <= mLastScheduledScanNumber ||
            scanNum < mProgressiveJpegConfig.getNextScanNumberToDecode(
                mLastScheduledScanNumber)) {
          return false;
        }
        mLastScheduledScanNumber = scanNum;
      }
      return ret;
    }

    @Override
    protected int getIntermediateImageEndOffset(EncodedImage encodedImage) {
      return mProgressiveJpegParser.getBestScanEndOffset();
    }

    @Override
    protected QualityInfo getQualityInfo() {
      return mProgressiveJpegConfig.getQualityInfo(mProgressiveJpegParser.getBestScanNumber());
    }
  }
}


text:
Ext.define('OppUI.view.loadTestDashboard.loadtestreport.loadtestreportmain.LoadTestReportMainModel', {
    extend: 'Ext.app.ViewModel',
    alias: 'viewmodel.loadtestreportmain',
    data: {
        name: 'OppUI'
    }

});


text:
/* This file maybe included more than once */

/*
** ASF_TASK_DEF_TYPE should be defined to be either
**
**     ASF_TASK_IDS
**     ASF_QUEUE_IDS
**     ASF_STACK_SETUP
**     ASF_TASK_SETUP
**     ASF_TASK_DECLARE
**
** by the including file
*/

/*-------------------------------------------------------------------------------------------------*\
 |    C O N S T A N T S   &   M A C R O S
\*-------------------------------------------------------------------------------------------------*/
#if !defined (IN_ASF_TASK_DEF)
# error This file can only be included in ASF_TaskDefType.h
#endif

#if ASF_TASK_DEF_TYPE == ASF_TASK_IDS
# define ASF_TASK_STATIC( ThreadId, EntryFunction, Priority, StackSize, QueueSize ) ThreadId,
#endif

#if ASF_TASK_DEF_TYPE == ASF_STACK_SETUP
# define ASF_TASK_STATIC( ThreadId, EntryFunction, Priority, StackSize, QueueSize )           \
    const uint32_t ThreadId##_StkSize = StackSize;
#endif

#if ASF_TASK_DEF_TYPE == ASF_QUEUE_SETUP
# define ASF_TASK_STATIC( ThreadId, EntryFunction, Priority, StackSize, QueueSize )           \
    osMailQDef(ThreadId, QueueSize, MessageBlock);
#endif

#if ASF_TASK_DEF_TYPE == ASF_TASK_DECLARE
# define ASF_TASK_STATIC( ThreadId, EntryFunction, Priority, StackSize, QueueSize )             \
       extern void EntryFunction(void);
#endif

#if ASF_TASK_DEF_TYPE == ASF_TASK_SETUP
# define ASF_TASK_STATIC( ThreadId, EntryFunction, Priority, StackSize, QueueSize )             \
        { ThreadId, EntryFunction, #EntryFunction, StackSize, Priority, #ThreadId, osThread(EntryFunction),osMailQ(ThreadId),osTimer(ThreadId)},
#endif

#if ASF_TASK_DEF_TYPE == ASF_TOTAL_STACK_NEEDED
# define ASF_TASK_STATIC( ThreadId, EntryFunction, Priority, StackSize, QueueSize )           \
    +ThreadId##_StkSize
#endif

#if ASF_TASK_DEF_TYPE == ASF_THREAD_SETUP
# define ASF_TASK_STATIC( ThreadId, EntryFunction, Priority, StackSize, QueueSize )           \
    osThreadDef(EntryFunction,Priority,1,StackSize);
#endif

#if ASF_TASK_DEF_TYPE == ASF_TIMER_SETUP
#define ASF_TASK_STATIC( ThreadId, EntryFunction, Priority, StackSize, QueueSize )           \
    osTimerDef(ThreadId, ASFTimerCallback);
#endif

/*-------------------------------------------------------------------------------------------------*\
 |    E N D   O F   F I L E
\*-------------------------------------------------------------------------------------------------*/


text:
<?php namespace Fungku\NetSuite\Classes;

class WorkOrderItemItemCommitInventory {
	static $paramtypesmap = array(
	);
	const _availableQty = "_availableQty";
	const _completeQty = "_completeQty";
	const _doNotCommit = "_doNotCommit";
}


text:
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="AppTheme.Base">
        <!-- Customize your theme here. -->
        <item name="android:statusBarColor">@android:color/transparent</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
    </style>

</resources>


text:
Edit Project

				<form name="addProjectForm" class="form-horizontal">

						Name:
						<input type="text" id="proj-name" class="form-control" ng-model="project.Name" required="required"/>

						Description:
						<input type="text" id="proj-desc" class="form-control" ng-model="project.Description" required="required"/>

						LeadId: (current id: {{project.Lead.Id}})
						<select id="proj-lead-id" ng-if="currentUser.isAdmin" class="form-control" ng-model="project.Lead.Id" required="required">
							<option ng-repeat="user in users | orderBy:'Username'" value="{{user.Id}}">{{user.Username}}</option>
						</select>

						Priorities: (comma-separated)
						<input type="text" id="project-priorities" class="form-control" ng-model="project.priorities" ng-change="complete()" placeholder="Add New Priorities" />

						Labels: (comma-separated)
						<input type="text" id="project-labels" class="form-control" ng-model="project.labels" ng-change="complete()" placeholder="Add New Labels" />

						<button class="btn btn-success btn-lg" ng-disabled="addProjectForm.$invalid" ng-click="createProject(project)">Create Project</button>

				</form>


text:
from __future__ import unicode_literals

from django.db import migrations, models
import wagtail.wagtailcore.fields

class Migration(migrations.Migration):

    dependencies = [
        ('wagtailcore', '0019_verbose_names_cleanup'),
        ('blog', '0002_blogpage_image'),
    ]

    operations = [
        migrations.CreateModel(
            name='BlogIndexPage',
            fields=[
                ('page_ptr', models.OneToOneField(parent_link=True, to='wagtailcore.Page', auto_created=True, serialize=False, primary_key=True)),
                ('body', wagtail.wagtailcore.fields.RichTextField(blank=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtailcore.page',),
        ),
    ]


text:
package ro.lrg.xcore.metametamodel;

public interface IRelationBuilder <ElementType extends XEntity, Entity extends XEntity> {
	Group<ElementType> buildGroup(Entity entity);
}


text:
module TopicsHelper
  def topic_last_path(topic)
    topic_path(topic, page: (topic.total_pages if topic.total_pages > 1), anchor: (topic.comments_count if topic.comments_count > 0))
  end
end


text:
package software.amazon.awssdk.enhanced.dynamodb.model;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.nullValue;
import static software.amazon.awssdk.enhanced.dynamodb.internal.AttributeValues.stringValue;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
import software.amazon.awssdk.enhanced.dynamodb.Expression;
import software.amazon.awssdk.enhanced.dynamodb.Key;
import software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity;
import software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics;

@RunWith(MockitoJUnitRunner.class)
public class DeleteItemEnhancedRequestTest {

    @Test
    public void builder_minimal() {
        DeleteItemEnhancedRequest builtObject = DeleteItemEnhancedRequest.builder().build();

        assertThat(builtObject.key(), is(nullValue()));
        assertThat(builtObject.conditionExpression(), is(nullValue()));
        assertThat(builtObject.returnConsumedCapacity(), is(nullValue()));
        assertThat(builtObject.returnConsumedCapacityAsString(), is(nullValue()));
        assertThat(builtObject.returnItemCollectionMetrics(), is(nullValue()));
        assertThat(builtObject.returnItemCollectionMetricsAsString(), is(nullValue()));
    }

    @Test
    public void builder_maximal() {
        Key key = Key.builder().partitionValue("key").build();

        Expression conditionExpression = Expression.builder()
                                                   .expression("#key = :value OR #key1 = :value1")
                                                   .putExpressionName("#key", "attribute")
                                                   .putExpressionName("#key1", "attribute3")
                                                   .putExpressionValue(":value", stringValue("wrong"))
                                                   .putExpressionValue(":value1", stringValue("three"))
                                                   .build();

        ReturnConsumedCapacity returnConsumedCapacity = ReturnConsumedCapacity.TOTAL;
        ReturnItemCollectionMetrics returnItemCollectionMetrics = ReturnItemCollectionMetrics.SIZE;

        DeleteItemEnhancedRequest builtObject = DeleteItemEnhancedRequest.builder()
                                                                         .key(key)
                                                                         .conditionExpression(conditionExpression)
                                                                         .returnConsumedCapacity(returnConsumedCapacity)
                                                                         .returnItemCollectionMetrics(returnItemCollectionMetrics)
                                                                         .build();

        assertThat(builtObject.key(), is(key));
        assertThat(builtObject.conditionExpression(), is(conditionExpression));
        assertThat(builtObject.returnConsumedCapacity(), is(returnConsumedCapacity));
        assertThat(builtObject.returnConsumedCapacityAsString(), is(returnConsumedCapacity.toString()));
        assertThat(builtObject.returnItemCollectionMetrics(), is(returnItemCollectionMetrics));
        assertThat(builtObject.returnItemCollectionMetricsAsString(), is(returnItemCollectionMetrics.toString()));
    }

    @Test
    public void toBuilder() {
        Key key = Key.builder().partitionValue("key").build();

        Expression conditionExpression = Expression.builder()
                                                   .expression("#key = :value OR #key1 = :value1")
                                                   .putExpressionName("#key", "attribute")
                                                   .putExpressionName("#key1", "attribute3")
                                                   .putExpressionValue(":value", stringValue("wrong"))
                                                   .putExpressionValue(":value1", stringValue("three"))
                                                   .build();

        ReturnConsumedCapacity returnConsumedCapacity = ReturnConsumedCapacity.TOTAL;
        ReturnItemCollectionMetrics returnItemCollectionMetrics = ReturnItemCollectionMetrics.SIZE;

        DeleteItemEnhancedRequest builtObject = DeleteItemEnhancedRequest.builder()
                                                                         .key(key)
                                                                         .conditionExpression(conditionExpression)
                                                                         .returnConsumedCapacity(returnConsumedCapacity)
                                                                         .returnItemCollectionMetrics(returnItemCollectionMetrics)
                                                                         .build();

        DeleteItemEnhancedRequest copiedObject = builtObject.toBuilder().build();

        assertThat(copiedObject, is(builtObject));
    }

    @Test
    public void equals_keyNotEqual() {
        Key key1 = Key.builder().partitionValue("key1").build();
        Key key2 = Key.builder().partitionValue("key2").build();

        DeleteItemEnhancedRequest builtObject1 = DeleteItemEnhancedRequest.builder().key(key1).build();
        DeleteItemEnhancedRequest builtObject2 = DeleteItemEnhancedRequest.builder().key(key2).build();

        assertThat(builtObject1, not(equalTo(builtObject2)));
    }

    @Test
    public void equals_conditionExpressionNotEqual() {
        Expression conditionExpression1 = Expression.builder()
                                                   .expression("#key = :value OR #key1 = :value1")
                                                   .putExpressionName("#key", "attribute")
                                                   .putExpressionName("#key1", "attribute3")
                                                   .putExpressionValue(":value", stringValue("wrong"))
                                                   .putExpressionValue(":value1", stringValue("three"))
                                                   .build();

        Expression conditionExpression2 = Expression.builder()
                                                   .expression("#key = :value AND #key1 = :value1")
                                                   .putExpressionName("#key", "attribute")
                                                   .putExpressionName("#key1", "attribute3")
                                                   .putExpressionValue(":value", stringValue("wrong"))
                                                   .putExpressionValue(":value1", stringValue("three"))
                                                   .build();

        DeleteItemEnhancedRequest builtObject1 = DeleteItemEnhancedRequest.builder()
                                                                          .conditionExpression(conditionExpression1)
                                                                          .build();

        DeleteItemEnhancedRequest builtObject2 = DeleteItemEnhancedRequest.builder()
                                                                          .conditionExpression(conditionExpression2)
                                                                          .build();

        assertThat(builtObject1, not(equalTo(builtObject2)));
    }

    @Test
    public void equals_returnConsumedCapacityNotEqual() {
        ReturnConsumedCapacity returnConsumedCapacity1 = ReturnConsumedCapacity.TOTAL;
        ReturnConsumedCapacity returnConsumedCapacity2 = ReturnConsumedCapacity.NONE;

        DeleteItemEnhancedRequest builtObject1 = DeleteItemEnhancedRequest.builder()
                                                                          .returnConsumedCapacity(returnConsumedCapacity1)
                                                                          .build();
        DeleteItemEnhancedRequest builtObject2 = DeleteItemEnhancedRequest.builder()
                                                                          .returnConsumedCapacity(returnConsumedCapacity2)
                                                                          .build();

        assertThat(builtObject1, not(equalTo(builtObject2)));
    }

    @Test
    public void equals_returnItemCollectionMetricsNotEqual() {
        ReturnItemCollectionMetrics returnItemCollectionMetrics1 = ReturnItemCollectionMetrics.SIZE;
        ReturnItemCollectionMetrics returnItemCollectionMetrics2 = ReturnItemCollectionMetrics.NONE;

        DeleteItemEnhancedRequest builtObject1 = DeleteItemEnhancedRequest.builder()
                                                                          .returnItemCollectionMetrics(returnItemCollectionMetrics1)
                                                                          .build();
        DeleteItemEnhancedRequest builtObject2 = DeleteItemEnhancedRequest.builder()
                                                                          .returnItemCollectionMetrics(returnItemCollectionMetrics2)
                                                                          .build();

        assertThat(builtObject1, not(equalTo(builtObject2)));
    }

    @Test
    public void hashCode_minimal() {
        DeleteItemEnhancedRequest emptyRequest = DeleteItemEnhancedRequest.builder().build();

        assertThat(emptyRequest.hashCode(), equalTo(0));
    }

    @Test
    public void hashCode_includesKey() {
        DeleteItemEnhancedRequest emptyRequest = DeleteItemEnhancedRequest.builder().build();

        Key key = Key.builder().partitionValue("key").build();

        DeleteItemEnhancedRequest containsKey = DeleteItemEnhancedRequest.builder().key(key).build();

        assertThat(containsKey.hashCode(), not(equalTo(emptyRequest.hashCode())));
    }

    @Test
    public void hashCode_includesConditionExpression() {
        DeleteItemEnhancedRequest emptyRequest = DeleteItemEnhancedRequest.builder().build();

        Expression conditionExpression = Expression.builder()
                                                   .expression("#key = :value OR #key1 = :value1")
                                                   .putExpressionName("#key", "attribute")
                                                   .putExpressionName("#key1", "attribute3")
                                                   .putExpressionValue(":value", stringValue("wrong"))
                                                   .putExpressionValue(":value1", stringValue("three"))
                                                   .build();

        DeleteItemEnhancedRequest containsKey = DeleteItemEnhancedRequest.builder()
                                                                         .conditionExpression(conditionExpression)
                                                                         .build();

        assertThat(containsKey.hashCode(), not(equalTo(emptyRequest.hashCode())));
    }

    @Test
    public void hashCode_includesReturnConsumedCapacity() {
        DeleteItemEnhancedRequest emptyRequest = DeleteItemEnhancedRequest.builder().build();

        ReturnConsumedCapacity returnConsumedCapacity = ReturnConsumedCapacity.TOTAL;

        DeleteItemEnhancedRequest containsKey = DeleteItemEnhancedRequest.builder()
                                                                         .returnConsumedCapacity(returnConsumedCapacity)
                                                                         .build();

        assertThat(containsKey.hashCode(), not(equalTo(emptyRequest.hashCode())));
    }

    @Test
    public void hashCode_includesReturnItemCollectionMetrics() {
        DeleteItemEnhancedRequest emptyRequest = DeleteItemEnhancedRequest.builder().build();

        ReturnItemCollectionMetrics returnItemCollectionMetrics = ReturnItemCollectionMetrics.SIZE;

        DeleteItemEnhancedRequest containsKey = DeleteItemEnhancedRequest.builder()
                                                                         .returnItemCollectionMetrics(returnItemCollectionMetrics)
                                                                         .build();

        assertThat(containsKey.hashCode(), not(equalTo(emptyRequest.hashCode())));
    }
}


text:
package org.apache.kafka.streams.state.internals;

import org.apache.kafka.common.utils.Bytes;
import org.junit.Test;

import java.nio.ByteBuffer;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.IsEqual.equalTo;

public class SegmentedCacheFunctionTest {

    private static final int SEGMENT_INTERVAL = 17;
    private static final int TIMESTAMP = 736213517;

    private static final Bytes THE_KEY = WindowStoreUtils.toBinaryKey(new byte[]{0xA, 0xB, 0xC}, TIMESTAMP, 42);
    private final static Bytes THE_CACHE_KEY = Bytes.wrap(
        ByteBuffer.allocate(8 + THE_KEY.get().length)
            .putLong(TIMESTAMP / SEGMENT_INTERVAL)
            .put(THE_KEY.get()).array()
    );

    private final SegmentedCacheFunction cacheFunction = new SegmentedCacheFunction(new WindowKeySchema(), SEGMENT_INTERVAL);

    @Test
    public void key() throws Exception {
        assertThat(
            cacheFunction.key(THE_CACHE_KEY),
            equalTo(THE_KEY)
        );
    }

    @Test
    public void cacheKey() throws Exception {
        final long segmentId = TIMESTAMP / SEGMENT_INTERVAL;

        final Bytes actualCacheKey = cacheFunction.cacheKey(THE_KEY);
        final ByteBuffer buffer = ByteBuffer.wrap(actualCacheKey.get());

        assertThat(buffer.getLong(), equalTo(segmentId));

        byte[] actualKey = new byte[buffer.remaining()];
        buffer.get(actualKey);
        assertThat(Bytes.wrap(actualKey), equalTo(THE_KEY));
    }

    @Test
    public void testRoundTripping() throws Exception {
        assertThat(
            cacheFunction.key(cacheFunction.cacheKey(THE_KEY)),
            equalTo(THE_KEY)
        );

        assertThat(
            cacheFunction.cacheKey(cacheFunction.key(THE_CACHE_KEY)),
            equalTo(THE_CACHE_KEY)
        );
    }

    @Test
    public void compareSegmentedKeys() throws Exception {
        assertThat(
            "same key in same segment should be ranked the same",
            cacheFunction.compareSegmentedKeys(
                cacheFunction.cacheKey(THE_KEY),
                THE_KEY
            ) == 0
        );

        final Bytes sameKeyInPriorSegment = WindowStoreUtils.toBinaryKey(new byte[]{0xA, 0xB, 0xC}, 1234, 42);

        assertThat(
            "same keys in different segments should be ordered according to segment",
            cacheFunction.compareSegmentedKeys(
                cacheFunction.cacheKey(sameKeyInPriorSegment),
                THE_KEY
            ) < 0
        );

        assertThat(
            "same keys in different segments should be ordered according to segment",
            cacheFunction.compareSegmentedKeys(
                cacheFunction.cacheKey(THE_KEY),
                sameKeyInPriorSegment
            ) > 0
        );

        final Bytes lowerKeyInSameSegment = WindowStoreUtils.toBinaryKey(new byte[]{0xA, 0xB, 0xB}, TIMESTAMP - 1, 0);

        assertThat(
            "different keys in same segments should be ordered according to key",
            cacheFunction.compareSegmentedKeys(
                cacheFunction.cacheKey(THE_KEY),
                lowerKeyInSameSegment
            ) > 0
        );

        assertThat(
            "different keys in same segments should be ordered according to key",
            cacheFunction.compareSegmentedKeys(
                cacheFunction.cacheKey(lowerKeyInSameSegment),
                THE_KEY
            ) < 0
        );
    }

}