text:
package com.box.boxjavalibv2.dao;

import java.util.Map;

import com.fasterxml.jackson.annotation.JsonProperty;

public class BoxItemPermissions extends BoxObject {

    public static final String FIELD_CAN_DOWNLOAD = "can_download";
    public static final String FIELD_CAN_PREVIEW = "can_preview";
    public static final String FIELD_CAN_UPLOAD = "can_upload";
    public static final String FIELD_CAN_SHARE = "can_share";
    public static final String FIELD_CAN_RENAME = "can_rename";
    public static final String FIELD_CAN_DELETE = "can_delete";
    public static final String FIELD_CAN_SET_SHARE_ACCESS = "can_set_share_access";
    public static final String FIELD_CAN_INVITE_COLLABORATOR = "can_invite_collaborator";
    public static final String FIELD_CAN_COMMENT = "can_comment";

    public BoxItemPermissions() {
    }

    /**
     * Copy constructor, this does deep copy for all the fields.
     *
     * @param obj
     */
    public BoxItemPermissions(BoxItemPermissions obj) {
        super(obj);
    }

    /**
     * Instantiate the object from a map. Each entry in the map reflects to a field.
     *
     * @param map
     */
    public BoxItemPermissions(Map<String, Object> map) {
        super(map);
    }

    public BoxItemPermissions(IBoxParcelWrapper in) {
        super(in);
    }

    @JsonProperty(FIELD_CAN_DOWNLOAD)
    public Boolean canDownload() {
        return (Boolean) getValue(FIELD_CAN_DOWNLOAD);
    }

    @JsonProperty(FIELD_CAN_DOWNLOAD)
    private void setCanDownload(Boolean canDownload) {
        put(FIELD_CAN_DOWNLOAD, canDownload);
    }

    @JsonProperty(FIELD_CAN_PREVIEW)
    public Boolean canPreivew() {
        return (Boolean) getValue(FIELD_CAN_PREVIEW);
    }

    @JsonProperty(FIELD_CAN_PREVIEW)
    private void setCanPreview(Boolean canPreview) {
        put(FIELD_CAN_PREVIEW, canPreview);
    }

    @JsonProperty(FIELD_CAN_UPLOAD)
    public Boolean canUpload() {
        return (Boolean) getValue(FIELD_CAN_UPLOAD);
    }

    @JsonProperty(FIELD_CAN_UPLOAD)
    private void setCanUpload(Boolean canUpload) {
        put(FIELD_CAN_UPLOAD, canUpload);
    }

    @JsonProperty(FIELD_CAN_SHARE)
    public Boolean canShare() {
        return (Boolean) getValue(FIELD_CAN_SHARE);
    }

    @JsonProperty(FIELD_CAN_SHARE)
    private void setCanShare(Boolean canshare) {
        put(FIELD_CAN_SHARE, canshare);
    }

    @JsonProperty(FIELD_CAN_RENAME)
    public Boolean canRename() {
        return (Boolean) getValue(FIELD_CAN_RENAME);
    }

    @JsonProperty(FIELD_CAN_RENAME)
    private void setCanRename(Boolean canrename) {
        put(FIELD_CAN_RENAME, canrename);
    }

    @JsonProperty(FIELD_CAN_DELETE)
    public Boolean canDelete() {
        return (Boolean) getValue(FIELD_CAN_DELETE);
    }

    @JsonProperty(FIELD_CAN_DELETE)
    private void setCanDelete(Boolean canDelete) {
        put(FIELD_CAN_DELETE, canDelete);
    }

    @JsonProperty(FIELD_CAN_SET_SHARE_ACCESS)
    public Boolean canSetShareAccess() {
        return (Boolean) getValue(FIELD_CAN_SET_SHARE_ACCESS);
    }

    @JsonProperty(FIELD_CAN_SET_SHARE_ACCESS)
    private void setCanSetShareAccess(Boolean canSetShareAccess) {
        put(FIELD_CAN_SET_SHARE_ACCESS, canSetShareAccess);
    }

    @JsonProperty(FIELD_CAN_INVITE_COLLABORATOR)
    public Boolean canInviteCollaborator() {
        return (Boolean) getValue(FIELD_CAN_INVITE_COLLABORATOR);
    }

    @JsonProperty(FIELD_CAN_INVITE_COLLABORATOR)
    private void setCanInviteCollaborator(Boolean canInviteCollaborator) {
        put(FIELD_CAN_INVITE_COLLABORATOR, canInviteCollaborator);
    }

    @JsonProperty(FIELD_CAN_COMMENT)
    public Boolean canComment() {
        return (Boolean) getValue(FIELD_CAN_COMMENT);
    }

    @JsonProperty(FIELD_CAN_COMMENT)
    private void setCanComment(Boolean canComment) {
        put(FIELD_CAN_COMMENT, canComment);
    }
}


text:
Czas przeterminowania dla zakończenia połączeń TCP

<tt>smtp_connect_timeout</tt>

Ten parametr określa dla klienta SMTP czas przeterminowania zakończenia
połączenia TCP w sekundach.

Jeśli w ciągu tego czasu nie zostanie nawiązane połączenie, klient SMTP
będzie probował następnego adresu z listy wymiany poczty. Podaj 0, aby
wyłączyć czas przeterminowania.

redpajama_set_name: RedPajamaGithub


text:
    public function executeNew(sfWebRequest $request)
    {
        $this->form = $this->configuration->getForm();
        $this-><?php echo $this->getSingularName() ?> = $this->form->getObject();

        sfContext::getInstance()->getConfiguration()->loadHelpers('I18N');
        $<?php echo $this->getSingularName() ?> = $this-><?php echo $this->getSingularName() ?>;
        $this->getResponse()->setTitle( <?php echo $this->getI18NString('new.title') ?>);

        <?php echo isset($this->params['disable_form_customization']) && $this->params['disable_form_customization'] ? '' : $this->getFormCustomization('new'); ?>
    }


text:
var chai = require('chai');
var path = require('path');

var config = require('../src/cli').config
config.set({root: path.join(__dirname,'fixtures')})

var cmsData = require('../src/cli').cmsData;
var Manager = require('../src/cli').Manager;
var fse = require('fs-extra');

describe('fileAttr', function() {
  before( function(done) {
    Manager.instance.init()
      .then(function () {
        Manager.instance._whereKeys = ['title', 'priority', 'abe_meta', 'articles']
        Manager.instance.updateList()

        this.fixture = {
          jsonDraft: fse.readJsonSync(__dirname + '/fixtures/data/article-1-abe-d20160919T125255138Z.json')
        }
        done()

      }.bind(this))
  });

  /**
   * cmsData.fileAttr.test
   *
   */
  it('cmsData.fileAttr.test()', function() {
    var bool = cmsData.fileAttr.test(this.fixture.jsonDraft.abe_meta.latest.abeUrl)
    chai.expect(bool).to.be.true;
    bool = cmsData.fileAttr.test(this.fixture.jsonDraft.abe_meta.link)
    chai.expect(bool).to.be.false;
  });

  /**
   * cmsData.fileAttr.delete
   *
   */
  it('cmsData.fileAttr.delete()', function() {
  	var str = cmsData.fileAttr.delete(this.fixture.jsonDraft.abe_meta.latest.abeUrl)
    var bool = cmsData.fileAttr.test(str)
    chai.expect(bool).to.be.false;
  });
});


text:
.. _aggs:

``aggs``
========

..block::

    struct aggs {
        1: string key,
        2: i32 count,
    }

.. _kwargs:

``kwargs``
==========

..block::

    struct kwargs {
        1: string key,
        2: value value,
    }

Esta ``struct`` é utilizada pelo serviço :ref:`search`, para transportar
parametros de configuração de uma pesquisa no elasticsearch.

https://elasticsearch-py.readthedocs.org/en/master/api.html#elasticsearch.Elasticsearch.search

.. _filters:

``filters``
===========

definição::

    struct filters {
        1: string param,
        2: string value
    }

Esta ``struct`` quando aceita por uma função, permite realizar filtros no escopo
da pesquisa. Os filtros permitidos podem variar de acordo com a função
utilizada.

Para funções de recuperação de indicadores de periódico (journals), os metodos
aceitos são:

    * collection
    * subject_areas
    * issn
    * status
    * included_at_year

Para funções de recuperação de indicadores de documentos (documents), os metodos
aceitos são:

    * collection
    * subject_areas
    * languages
    * aff_countries
    * publication_year
    * document_type
    * issn


text:
package com.qiniu.pili.droid.streaming.demo.gles;

/**
 * Created by jerikc on 16/2/23.
 */
import android.opengl.Matrix;

import com.qiniu.pili.droid.streaming.demo.filter.IFilter;

/**
 * This class essentially represents a viewport-sized sprite that will be rendered with
 * a texture, usually from an external source like the camera.
 */
public class FullFrameRect {
    private final Drawable2d mRectDrawable = new Drawable2d();
    private IFilter mFilter;
    public final float[] IDENTITY_MATRIX = new float[16];

    /**
     * Prepares the object.
     *
     * @param program The program to use.  FullFrameRect takes ownership, and will release
     * the program when no longer needed.
     */
    public FullFrameRect(IFilter program) {
        mFilter = program;
        Matrix.setIdentityM(IDENTITY_MATRIX, 0);
    }

    /**
     * Releases resources.
     *

     * This must be called with the appropriate EGL context current (i.e. the one that was
     * current when the constructor was called).  If we're about to destroy the EGL context,
     * there's no value in having the caller make it current just to do this cleanup, so you
     * can pass a flag that will tell this function to skip any EGL-context-specific cleanup.
     */
    public void release(boolean doEglCleanup) {
        if (mFilter != null) {
            if (doEglCleanup) {
                mFilter.releaseProgram();
            }
            mFilter = null;
        }
    }

    /**
     * Returns the program currently in use.
     */
    public IFilter getFilter() {
        return mFilter;
    }

    /**
     * Changes the program.  The previous program will be released.
     *

     * The appropriate EGL context must be current.
     */
    public void changeProgram(IFilter newFilter) {
        mFilter.releaseProgram();
        mFilter = newFilter;
    }

    /**
     * Draws a viewport-filling rect, texturing it with the specified texture object.
     */
    public void drawFrame(int textureId) {
        // Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport.
        mFilter.onDraw(IDENTITY_MATRIX, mRectDrawable.getVertexArray(), 0,
                mRectDrawable.getVertexCount(), mRectDrawable.getCoordsPerVertex(),
                mRectDrawable.getVertexStride(), mRectDrawable.getTexCoordArray(),
                textureId, mRectDrawable.getTexCoordStride());
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;

namespace asg5AutoGenerated
{
    public partial class sampleWebform2 : System.Web.UI.Page
    {
        string conStr = @"Data Source=DESKTOP-KSO3AP7;Initial Catalog=db_Srinu;Integrated Security=True";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                SqlConnection Connection = new SqlConnection(conStr);
                Connection.Open();
                string qrCntry = "SELECT DISTINCT(Country) FROM tblCustomer;";
                SqlCommand cmdFilter = new SqlCommand(qrCntry, Connection);
                var result = cmdFilter.ExecuteReader();
                ddlCountry.DataTextField = "Country";
                ddlCountry.DataSource = result;
                ddlCountry.DataBind();
                Connection.Close();
            }
        }

        protected void FIlter_Click(object sender, EventArgs e)
        {
            SqlConnection Connection1 = new SqlConnection(conStr);
            Connection1.Open();
            SqlCommand cd1 = new SqlCommand("getCustomerByCountry", Connection1);
            cd1.CommandType = CommandType.StoredProcedure;
            cd1.CommandText = "getCustomerByCountry";
            cd1.Parameters.Add("Country", SqlDbType.VarChar).Value = ddlCountry.SelectedValue;
            var ds = cd1.ExecuteReader();
            gvFilterCusoterInfo.DataSource = ds;
            gvFilterCusoterInfo.DataBind();
            Connection1.Close();
        }
    }
}


text:
package de.slava.schoolaccounting.manage.children;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.content.ContextCompat;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

import com.wefika.flowlayout.FlowLayout;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import butterknife.Bind;
import butterknife.ButterKnife;
import de.slava.schoolaccounting.Main;
import de.slava.schoolaccounting.R;
import de.slava.schoolaccounting.model.Category;
import de.slava.schoolaccounting.model.Child;
import de.slava.schoolaccounting.model.db.CategoryDao;
import de.slava.schoolaccounting.model.db.ChildDao;
import de.slava.schoolaccounting.model.db.EntityManager;
import de.slava.schoolaccounting.room.RoomChildItem;

public class ManageChildFragment extends Fragment {
    public final String PARAM_CHILD_ID = "CHILD_ID";
    private Integer originalId;
    private Child child;
    private ChildUpdateListener mListener;

    @Bind(R.id.paneMain) ViewGroup paneMain;
    @Bind(R.id.txtId) TextView txtId;
    @Bind(R.id.imgChild) ImageView imgChild;
    @Bind(R.id.chkActive) CheckBox chkActive;
    @Bind(R.id.txtName) EditText txtName;
    @Bind(R.id.paneCategories) ViewGroup paneCategories;
    @Bind(R.id.btnSave) Button btnSave;
    @Bind(R.id.btnCancel) Button btnCancel;
    private Map<Category, ImageButton> cat2Btn = new HashMap<>();

    public ManageChildFragment() {
        // Required empty public constructor
    }

    private EntityManager getDb() {
        return EntityManager.instance(getContext());
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            if (getArguments().containsKey(PARAM_CHILD_ID)) {
                int childId = getArguments().getInt(PARAM_CHILD_ID);
                Log.d(Main.getTag(), String.format("Received child ID %d through parameter", childId));
                if (childId >= 0) {
                    Child inDb = getDb().getDao(ChildDao.class).getById(childId);
                    if (inDb != null) {
                        originalId = inDb.getId();
                        child = new Child(inDb);
                    } else {
                        child = new Child();
                    }
                } else {
                    child = new Child();
                }
                syncUIWithData();
            }
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_manage_child, container, false);
        ButterKnife.bind(this, view);
        // add categories
        if (!view.isInEditMode()) {
            CategoryDao dao = getDb().getDao(CategoryDao.class);
            List<Category> categories = dao.getAll(null, null, CategoryDao.COLUMN_NAME + " ASC");
            for (Category category : categories) {
                ImageButton btn = new ImageButton(getContext());
                cat2Btn.put(category, btn);
                btn.setLayoutParams(new FlowLayout.LayoutParams(FlowLayout.LayoutParams.WRAP_CONTENT, FlowLayout.LayoutParams.WRAP_CONTENT));
                paneCategories.addView(btn);
                int resId = category.getImage().getSid().getResourceId();
                Drawable image = ContextCompat.getDrawable(getContext(), resId);
                btn.setBackground(image);
            }
        }
        // add action listeners
        txtName.setOnEditorActionListener((v, id, event) -> {
            if (id == EditorInfo.IME_ACTION_DONE) {
                if (this.child != null) {
                    this.child.setNameFull(txtName.getText().toString());
                }
            }
            return false;
        });
        imgChild.setOnClickListener(click -> openImgChooseDialog());
        chkActive.setOnCheckedChangeListener((v, checked) -> {
            if (this.child != null)
                this.child.setActive(checked);
        });
        for (Map.Entry<Category, ImageButton> it : cat2Btn.entrySet()) {
            final Category category = it.getKey();
            it.getValue().setOnClickListener(v -> {
                if (this.child == null || child.getCategory() == category)
                    return;
                syncCategoryUI(child.getCategory(), false);
                child.setCategory(category);
                syncCategoryUI(child.getCategory(), true);
            });
        }
        btnSave.setOnClickListener(v -> onBtnSave());
        btnCancel.setOnClickListener(v -> onBtnRevert());
        return view;
    }

    private void openImgChooseDialog() {
        ManageChildImageDialogFragment imageDialog = new ManageChildImageDialogFragment();
        imageDialog.setClickListener(image -> {
            Log.d(Main.getTag(), String.format("Selected %s", image.getSid()));
            this.child.setImage(image);
            syncUIWithData();
            return true;
        });
        imageDialog.show(getFragmentManager(), "manageImage");
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        if (context instanceof ChildUpdateListener) {
            mListener = (ChildUpdateListener) context;
        } else {
            Log.w(Main.getTag(), "The activity should implement ChildUpdateListener to get notifications");
        }
    }

    @Override
    public void onDetach() {
        super.onDetach();
        mListener = null;
    }

    public void setData(Child child) {
        Log.d(Main.getTag(), String.format("Show child %s", child));
        if (child != null) {
            this.originalId = child.getId();
            this.child = new Child(child);
        } else {
            this.originalId = null;
            this.child = null;
        }
        syncUIWithData();
    }

    private void syncUIWithData() {
        if (child != null) {
            paneMain.setVisibility(View.VISIBLE);
            txtId.setText(this.originalId != null ? this.originalId.toString() : "+");
            RoomChildItem.setupImageView(getContext(), imgChild, child);
            chkActive.setChecked(child.isActive());
            txtName.setText(child != null ? child.getNameFull() : "");
            for (Category cat : cat2Btn.keySet()) {
                syncCategoryUI(cat, child != null && child.getCategory() == cat);
            }
        } else {
            paneMain.setVisibility(View.INVISIBLE);
        }
    }

    private void syncCategoryUI(Category cat, boolean active) {
        ImageButton btn = cat2Btn.get(cat);
        if (btn == null)
            return;
        btn.setAlpha(active ? 1.f : 0.3f);
    }

    private void onBtnSave() {
        if (child == null)
            return;
        // commit the EditText to model if saving while still editing the text
        this.child.setNameFull(txtName.getText().toString());
        child.setId(originalId);
        Child persistent = getDb().getDao(ChildDao.class).upsert(child);
        if (originalId == null) {
            // we have a new child, let the room know, the child is there
            persistent.moveToToom(persistent.getRoom());
        }
        setData(persistent);
        if (mListener != null)
            mListener.onChildUpdated(child);
    }

    private void onBtnRevert() {
        if (child == null)
            return;
        if (originalId == null) {
            child = new Child();
        } else {
            Child fromDb = getDb().getDao(ChildDao.class).getById(originalId);
            if (fromDb == null) {
                Main.toast(R.string.manage_child_error_not_found_in_db);
                child = new Child();
            } else {
                child = new Child(fromDb);
            }
        }
        syncUIWithData();
    }

    public static interface ChildUpdateListener {
        void onChildUpdated(Child item);
    }
}


text:
module FAlgebra where

----------------
-- Algebra:
-- (1) A way to construct expressions
-- (2) A way to evaluate expressions (produce a single value)

-- define our expressions (non-recursive)
-- ExprF :: a -> ExprF a
-- ExprF :: * -> *
data ExprF a = Const Int
             | Add a a
             | Mul a a

fixpoint :: (a -> a) -> a
fixpoint f = f valA
  where valA = fixpoint f

-- define our fix-point type-level function
-- Fix :: (a -> a) -> Fix t
-- Fix :: (* -> *) -> *
newtype Fix f = Fx (f (Fix f))

-- Fx :: f (Fix f) -> Fix f
unFix :: Fix f -> f (Fix f)
unFix (Fx x) = x

-- define Expr as the fix-point of ExprF
-- Expr = Fx $ ExrFC $ Fx
type Expr = Fix ExprF

-- we can map over expr
-- endofunctor: maps a given category into itself
-- Hask: the category of all Haskell types
instance Functor ExprF where
  fmap _    (Const i) = Const i
  fmap eval (Add l r) = Add (eval l) (eval r)
  fmap eval (Mul l r) = Mul (eval l) (eval r)

-- our evaluator for a single top-level expression
-- picked one type (Int) as our evaluation target (carrier type of the algebra)
alg :: ExprF Int -> Int
alg (Const i) = i
alg (Add l r) = l + r
alg (Mul l r) = l * r

-- hand-rolled eval
evalFull :: Expr -> Int
evalFull (Fx (Const n)) = n
evalFull (Fx (Add l r)) = evalFull l + evalFull r
evalFull (Fx (Mul l r)) = evalFull l * evalFull r

-- partial
evalShape :: Expr -> ExprF Int
evalShape (Fx (Const n)) = Const n
evalShape (Fx (Add l r)) = Add (alg $ evalShape l) (alg $ evalShape r)
evalShape (Fx (Mul l r)) = Mul (alg $ evalShape l) (alg $ evalShape r)

evalFull2 :: Expr -> Int
evalFull2 = alg . evalShape

-- eval using alg & fmap
evalFull3 :: Expr -> Int
evalFull3 = alg . evalShape'
  where
    evalShape' :: Expr -> ExprF Int
    evalShape' = fmap (alg . evalShape') . unFix

-- general evaluation function for any reduction / evaluator function
evalGeneral :: (ExprF a -> a) -> Expr -> a
evalGeneral red = red . evalShape'
  where
    evalShape' = fmap (red . evalShape') . unFix

----------------
-- F-Algebra

-- 1. structure: functor f (endofunctor)
-- 2. carrier type:  a
-- 3. evaluator: morphism from f(a) -> a
type Algebra f a = f a -> a

type SimpleA = Algebra ExprF Int
alg' :: SimpleA
alg' = alg

-- initial algebra (doesn't loose any information!)
type ExprInitAlg = Algebra ExprF (Fix ExprF)
ex_init_alg :: ExprInitAlg
ex_init_alg = Fx

-- homomorphism: a mapping that preserves certain strucutre, in case of an
-- algebra, we want to keep the functor fixed, so homomorphism should map
-- carrier types and evaluators.
--
-- homomorphism from initial algebra
-- g :: Fix f -> a
-- fmap g :: f (Fix f) -> f a

-- f (Fix f) --- fmap g ---> f a
--    |                       |
--   Fx                      alg
--    |                       |
--    v                       v
--  Fix f ------- g --------> a
--
--  Reversing Fx we get:
--
-- f (Fix f) --- fmap g ---> f a
--    ^                       |
--    |                       |
--  unFix                    alg
--    |                       |
--    |                       v
--  Fix f ------- g --------> a
--
--  So to implement g, our general evaluator, we should apply `unFix`, `fmap g`
--  and then `alg`.
--
-- g = alg . (fmap g) . unFix
--   where alg :: f a -> a

g :: Expr -> Int
g = alg . (fmap g) . unFix

cata :: (Functor f) => Algebra f a -> Fix f -> a
cata algg = gg'
  where gg' = algg . (fmap gg') . unFix

-- Lists
data ListF a b = Nil | Cons a b

instance Functor (ListF a) where
  fmap f (Nil     ) = Nil
  fmap f (Cons a b) = Cons a (f b)

algSum :: ListF Int Int -> Int
algSum (Nil     ) = 0
algSum (Cons a b) = a + b

lst :: Fix (ListF Int)
lst = Fx $ Cons 1 $ Fx $ Cons 2 $ Fx $ Cons 3 $ Fx Nil

sumLst :: Fix (ListF Int) -> Int
sumLst = cata algSum


text:
use strict;
use FileHandle;
my $DEBUG = 0;
if( $ARGV[0] eq '-d' ) {
    $DEBUG = 1;
    shift( @ARGV );
}

my $SOURCEFILE = $ARGV[0];
my $DESTFILE = $ARGV[1];
if( ! $SOURCEFILE || ! $DESTFILE ) {
    die "ERROR: Must supply the input and output file names.\n\nUsage: closeSections.pl compiled-book.html closed.html\n";
}
if( ! -f $SOURCEFILE ) {
    die "ERROR: Unable to read file: $SOURCEFILE\n";
}

print 'Source: ' . $SOURCEFILE . "\n";
print 'Destination: ' . $DESTFILE . "\n";
my $SUFFIX = '.html';
my $SECTION_DEPTH = -1;

open( INPUT, "<${SOURCEFILE}" )
    or die "Unable to read sourcefile: ${SOURCEFILE}\n";

my $OUTPUTFH = FileHandle->new( $DESTFILE, 'w' );

# Front and end matter elements
my %sectionmatter = (
    'Preface'           => 'preface',
    'Foreword'          => 'foreword',
#    'Introduction'      => 'introduction',  # O'Reilly doesn't use this yet
    'Introduction'      => 'preface',
    'Afterword'         => 'afterword',
    'Acknowledgements'  => 'acknowledgements',
    'Conclusion'        => 'conclusion',
    'Colophon'          => 'colophon',
);

# Start a loop that outputs each line, starting a new file after each chapter or part break
my $line;
my $linenum = 0;
my $LEVEL0_IS_DIV = 0;
my $STRIP_NEXT_HEADER = 0;
while( $line = <INPUT> ) {
    $linenum++;

    # If section level changes, close off the previous section
    if( $line =~ m|^\s*
| ) {
        my $depth = $1;
        my $idlabel = &cleanIdLabel( $2 );

        print "LINE $linenum: Starting sect${depth} id=${idlabel}\n" if $DEBUG;
        print $OUTPUTFH &closeSection( $depth, $linenum );
        print $OUTPUTFH qq|
\n|;
        next;
    }

    # Change filehandles at each chapter start
    elsif( $line =~ m|^
| ) {
        my $namespace = $1;
        my $idlabel = &cleanIdLabel( $2 );

        # Close off the previous section
        print $OUTPUTFH &closeSection( 0, $linenum );
        $LEVEL0_IS_DIV = 0;

        print "LINE $linenum: Starting new chapter.\n" if $DEBUG;
        print "LINE $linenum: Starting chapter id=${idlabel}\n" if $DEBUG;
        print $OUTPUTFH qq|
\n|;
        next;
    }

    elsif( $STRIP_NEXT_HEADER && $line =~ s/^(\s*
)(?:Part|Appendix)\s+\w+:\s+/$1/i ) {
        $STRIP_NEXT_HEADER = 0;
        print $OUTPUTFH $line;
    }

    # Parse out top-level elements
    elsif( $line =~ m|^\s*
| ) {
        my $namespace = $1;
        my $title = $2;
        my $idlabel = $title;

        # Ensure the ID label is html-safe
        $idlabel =~ s/\s+/_/g;
        $idlabel =~ s/[^\w\-]//g;

        # Close off the previous section
        print $OUTPUTFH &closeSection( 0, $linenum );

        # if this is front or end matter
        if( $sectionmatter{ $title } ) {
            print $OUTPUTFH qq|
\n|;
            next;
        }

        # Is this a new book part? Strip the "part" text
        elsif( $title =~ s/^part\s+([^:]+):\s+//i ) {
            my $partnum = $1;
            $LEVEL0_IS_DIV = 1;
            $STRIP_NEXT_HEADER = 1;

            # Restart pages at first part
            my $optional = '';
            if( $partnum eq 'I' ) {
                $optional = ' class="pagenumrestart"';
            }

            # Output the line
            print "LINE $linenum: Starting book Part ${partnum}.\n" if $DEBUG;
            print $OUTPUTFH qq|
\n|;
        }

        # Is this an appendix?
        elsif( $title =~ s/^appendix\s+([\w]+):\s+//i ) {
            my $appname = $1;
            $LEVEL0_IS_DIV = 0;
            $STRIP_NEXT_HEADER = 1;

            # Output the line
            print "LINE $linenum: Starting Appendix $appname.\n" if $DEBUG;
            print $OUTPUTFH qq|
\n|;
        }

        else {
            die "ERROR at LINE $linenum: Found top-level section element which isn't a new part, appendix, nor valid front or end matter: $title = $idlabel\n";
        }
    }

    # Otherwise just print the line
    else {
        print $OUTPUTFH $line;
    }
}
print $OUTPUTFH &closeSection( 0, $linenum );
$OUTPUTFH->close();
print "LINE $linenum: Finished book.\n" if $DEBUG;

close( INPUT )
    or die;

exit 0;

sub cleanIdLabel() {
    my $idlabel = shift;
    $idlabel =~ s/\s+/_/g;
    $idlabel =~ s/[^\w\-]//g;
    return $idlabel;
}

sub closeSection() {
    use vars qw( $DEBUG $SECTION_DEPTH $LEVEL0_IS_DIV );
    my $newdepth = shift;
    my $linenum = shift;
    my $text = '';

    # Now do the right thing for the various changes
    if( $newdepth > $SECTION_DEPTH ) {
        print "LINE $linenum: Entering section level $newdepth\n" if $DEBUG;
    }
    else {
        if( $newdepth < $SECTION_DEPTH ) {
            # Close out the current section and any levels in between
            # e.g. from 3 up to 1 is closing 3, 2, and previous 1...
            my $uplevels = $SECTION_DEPTH - $newdepth + 1;
            for( my $uplevel = $SECTION_DEPTH; $uplevel > $newdepth ; $uplevel-- ) {
                $text .= "
\n\n";
                print "LINE $linenum: Closed out section level $uplevel\n" if $DEBUG;
            }
        }
        # At this point section depth and new depth are equal, now close current depth
        # We have to handle 0-depth book parts are divs not sections
        if( $newdepth == 0 ) {
            if( $LEVEL0_IS_DIV ) {
                $text .= "
\n\n";
                $LEVEL0_IS_DIV = 0;
            }
            else {
                $text .= "
\n";
            }
        }
        else {
            $text .= "
\n\n";
        }

        print "LINE $linenum: Starting new section level $newdepth\n" if $DEBUG;
    }
    $SECTION_DEPTH = $newdepth;

    return $text;
}


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

public class SocialAchievements
{
	public const string NO_ACHIEVEMENT = "";

	public const string FIRST_MATCH = "<id removed>";
	public const string MULTIPLAYER_MATCH = "<id removed>";

	private static List<string> accumulatePointsAchievements = new List<string>{
		"<id removed>",
		"<id removed>",
	};

	private static Dictionary<string, int> pointsInOneMatchAchievements = new Dictionary<string, int>{
		{"<id removed>", 500},
	};

	public static void ForEachAccumulatePointsAchievement(Action<string> action)
	{
		accumulatePointsAchievements.ForEach(action);
	}

	public static void ForEachPointsInOneMatchAchievement(Action<string, int> action)
	{
		foreach (KeyValuePair<string, int> achievement in pointsInOneMatchAchievements) {
			action(achievement.Key, achievement.Value);
		}
	}
}


text:
require 'simplecov'
SimpleCov.start

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'creative_rails_utilities'
require 'timecop'
require 'pry'
Time.zone = "UTC"

RSpec.configure do |c|
  c.example_status_persistence_file_path = "spec/failures.txt"
  c.run_all_when_everything_filtered = true
end


text:
package io.quarkus.restclient.runtime.graal;

import javax.ws.rs.client.ClientBuilder;

import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.internal.LocalResteasyProviderFactory;
import org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl;

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

import io.quarkus.restclient.runtime.RestClientRecorder;

@TargetClass(ClientBuilder.class)
final class ClientBuilderReplacement {

    @Substitute
    public static ClientBuilder newBuilder() {
        ResteasyClientBuilder client = new ResteasyClientBuilderImpl();
        client.providerFactory(new LocalResteasyProviderFactory(RestClientRecorder.providerFactory));
        return client;
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.qweather.android">

    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name="org.litepal.LitePalApplication"
        android:allowBackup="true"
        android:icon="@mipmap/logo"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".WeatherActivity"
            android:label="@string/title_activity_weather"
            android:theme="@style/AppTheme">
        </activity>

        <service
            android:name=".service.AutoUpdateService"
            android:enabled="true"
            android:exported="true" />

    </application>

</manifest>


text:
/*
* This is a manifest file that includes stylesheets for spree_frontend
 * require normalize
 * require spree/frontend/screen
 *=require_tree .
 * require self
*/


text:
package org.gnucash.android.importer;

import android.database.sqlite.SQLiteDatabase;
import android.preference.PreferenceManager;
import android.util.Log;

import org.gnucash.android.app.GnuCashApplication;
import org.gnucash.android.export.Exporter;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PushbackInputStream;
import java.sql.Timestamp;
import java.util.zip.GZIPInputStream;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

/**
 * Importer for Gnucash XML files and GNCA (GnuCash Android) XML files
 *
 * @author Ngewi Fet <ngewif@gmail.com>
 */
public class GncXmlImporter {

    /**
     * Parses XML into an already open database.
     *
This method is used mainly by the {@link org.gnucash.android.db.DatabaseHelper} for database migrations.

     *     You should probably use {@link #parse(java.io.InputStream)} instead

     * @param db SQLite Database
     * @param gncXmlInputStream Input stream of GnuCash XML
     */
    public static void parse(SQLiteDatabase db, InputStream gncXmlInputStream) throws Exception {
        SAXParserFactory spf = SAXParserFactory.newInstance();
        SAXParser sp = spf.newSAXParser();
        XMLReader xr = sp.getXMLReader();

        BufferedInputStream bos = new BufferedInputStream(gncXmlInputStream);

        /** Create handler to handle XML Tags ( extends DefaultHandler ) */

        GncXmlHandler handler = new GncXmlHandler(db);

        xr.setContentHandler(handler);
        xr.parse(new InputSource(bos));
    }

    /**
     * Parse GnuCash XML input and populates the database
     * @param gncXmlInputStream InputStream source of the GnuCash XML file
     */
    public static void parse(InputStream gncXmlInputStream) throws ParserConfigurationException, SAXException, IOException {
        SAXParserFactory spf = SAXParserFactory.newInstance();
        SAXParser sp = spf.newSAXParser();
        XMLReader xr = sp.getXMLReader();

        BufferedInputStream bos;
        PushbackInputStream pb = new PushbackInputStream( gncXmlInputStream, 2 ); //we need a pushbackstream to look ahead
        byte [] signature = new byte[2];
        pb.read( signature ); //read the signature
        pb.unread( signature ); //push back the signature to the stream
        if( signature[ 0 ] == (byte) 0x1f && signature[ 1 ] == (byte) 0x8b ) //check if matches standard gzip magic number
            bos = new BufferedInputStream(new GZIPInputStream(pb));
        else
            bos = new BufferedInputStream(pb);

        //TODO: Set an error handler which can log errors
        Log.d(GncXmlImporter.class.getSimpleName(), "Start import");
        GncXmlHandler handler = new GncXmlHandler();
        xr.setContentHandler(handler);
        long startTime = System.nanoTime();
        xr.parse(new InputSource(bos));
        long endTime = System.nanoTime();

        String timeStamp = new Timestamp(System.currentTimeMillis()).toString();
        PreferenceManager.getDefaultSharedPreferences(GnuCashApplication.getAppContext()).edit().putString(Exporter.PREF_LAST_EXPORT_TIME, timeStamp).apply();

        Log.d(GncXmlImporter.class.getSimpleName(), String.format("%d ns spent on importing the file", endTime-startTime));
    }
}


text:
package com.github.milenkovicm.avro.io.encoder;

import org.apache.avro.generic.GenericRecord;
import org.junit.Assert;
import org.junit.Test;

import com.github.milenkovicm.avro.Helper;

public class EncoderBooleanTest {

    @Test
    public void test_plus_value() {
        final GenericRecord record = Helper.genericBoolean(false);
        Assert.assertArrayEquals("should be equal " + record, Helper.avroGenericBinaryEncoder(record), Helper.avroGenericByteBufEncoder(record));
    }

    @Test
    public void test_minus_value() {
        final GenericRecord record = Helper.genericBoolean(false);
        Assert.assertArrayEquals("should be equal -" + record, Helper.avroGenericBinaryEncoder(record), Helper.avroGenericByteBufEncoder(record));
    }
}


text:
FROM ruby:2.4.2-stretch
MAINTAINER Ryan Moore <moorer@udel.edu>

RUN apt-get -y update && apt-get -y install r-base libopenblas-base gcc g++ cmake git vim

# Install R libs
RUN Rscript -e "install.packages('gplots', repos = 'http://cran.us.r-project.org')"
RUN Rscript -e "install.packages('ape', repos = 'http://cran.us.r-project.org')"

# Install MMseqs2
WORKDIR /opt/mmseqs

# Copying the local mmseqs so we don't have to worry about a new version breaking LSA
COPY vendor/MMseqs2 .

WORKDIR build_sse
RUN cmake -DHAVE_SSE4_1=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..
RUN make && make install

WORKDIR ../build_avx
RUN cmake -DHAVE_AVX2=1 -DHAVE_MPI=0 -DHAVE_TESTS=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=. ..
RUN make && make install

# Copy mmseqs
RUN mv /opt/mmseqs/build_sse/bin/mmseqs /usr/local/bin/mmseqs_sse42
RUN mv /opt/mmseqs/build_avx/bin/mmseqs /usr/local/bin/mmseqs_avx2
RUN mv /opt/mmseqs/util/mmseqs_wrapper.sh /usr/local/bin/mmseqs

# Set up Ruby and the lsa program

RUN gem install bundler

RUN \curl -sSL https://github.com/mooreryan/lsa_for_genomes/archive/v0.11.6.tar.gz \
    | tar -v -C /home -xz
RUN mv /home/lsa_for_genomes-0.11.6 /home/lsa_for_genomes

WORKDIR /home/lsa_for_genomes
RUN bundle install

WORKDIR /home/lsa_for_genomes/vendor
RUN git clone https://github.com/mooreryan/redsvd.git

WORKDIR /home/lsa_for_genomes
RUN make clean && make

CMD ["ruby", "/home/lsa_for_genomes/lsa.rb", "--help"]


text:
This code example shows how you can run
[Cloud Dataflow](https://cloud.google.com/dataflow/) pipelines from
[App Engine](https://cloud.google.com/appengine/) apps, as a replacement
for the older
[GAE Python MapReduce libraries](https://github.com/GoogleCloudPlatform/appengine-mapreduce),
as well as do much more.

The example shows how to periodically launch a Python Dataflow pipeline from GAE, to
analyze data stored in Cloud Datastore; in this case, tweets from Twitter.

This example uses the Dataflow SDK to launch the pipeline jobs.  Because of its use of the SDK, it requires App Engine Flex.
For an example that uses the same pipeline, but uses [Dataflow Templates](https://cloud.google.com/dataflow/docs/templates/overview) to launch the pipeline jobs, see the ['job_template_launch'](../job_template_launch) directory, which uses App Engine Standard.
Now that Dataflow Templates are available, they are likely the more straightforward option for this type of task in most cases, so you may want to start with the ['job_template_launch'](../job_template_launch) directory.

The example is a GAE app with two [services (previously, 'modules')](https://cloud.google.com/appengine/docs/standard/python/an-overview-of-app-engine#services_the_building_blocks_of_app_engine):

 - a [GAE Standard](https://cloud.google.com/appengine/docs/standard/) service that periodically pulls in timeline tweets from Twitter and stores them in Datastore; and

 - a [GAE Flexible](https://cloud.google.com/appengine/docs/flexible/) service that periodically launches a Python Dataflow pipeline to analyze the tweet data in the Datastore.

###  The Dataflow pipeline

The Python Dataflow pipeline reads recent tweets from the past N days from Cloud Datastore, then
essentially splits into three processing branches. It finds the top N most popular words in terms of
the percentage of tweets they were found in, calculates the top N most popular URLs in terms of
their count, and then derives relevant word co-occurrences (bigrams) using an
approximation to a [tf*idf](https://en.wikipedia.org/wiki/Tf%E2%80%93idf)
ranking metric.  It writes the results to three BigQuery tables.

## Prerequisites for running the example

### 1. Basic GCP setup

Follow the "Before you begin" steps on
[this page](https://cloud.google.com/dataflow/docs/quickstarts/quickstart-python#before-you-begin).
Note your project and bucket name; you will need them in a moment.

For local testing (not required, but may be useful), follow the next section on the same page to
[install pip and the Dataflow SDK](https://cloud.google.com/dataflow/docs/quickstarts/quickstart-
python#Setup).

### 2. Create a BigQuery dataset in your project

The app will write its analytic results to BigQuery.  In your project, [create a new
dataset](https://cloud.google.com/bigquery/quickstart-web-ui#create_a_dataset) to use for this
purpose, or note the name of an existing dataset that you will use.

### 3. Create a Twitter App

[Create a Twitter application.](https://apps.twitter.com/).  Note the credentials under the 'Keys
and Access Tokens' tag: 'Consumer Key (API Key)', 'Consumer Secret (API Secret)', 'Access Token',
and 'Access Token Secret'.  You'll need these in moment.

### 4. Library installation and config

1. We need to 'vendor' the libraries used by the app's frontend.
Install the dependencies into the app's `lib` subdirectory like this:

```sh
pip install --target=lib -r standard_requirements.txt
```

(Take a look at `appengine_config.py` to see where we specify to GAE to add those libs).

2. Then, edit `app.yaml` to add the Twitter app credentials that you generated above.

3. Edit the `Dockerfile` to specify the env vars for your `PROJECT`, GCS `BUCKET`, and `DATASET`
   names, created as described above. (For the bucket, do NOT add the 'gs://' prefix; just use the
   name).

## Deploying the App

The example app is essentially 'headless', with no user-facing frontend. It would be
straightforward to add user-facing content, but as is, it just runs two app [cron](https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml) jobs: one to
periodically pull tweets from Twitter and add them to the Datastore, and one to periodically
analyze the tweet data. The analysis results are written to BigQuery.

More specifically, the app consists of two services: a GAE Standard service, which fetches tweets
and stores them in the Datastore; and a GAE Flex service, which launches a Dataflow pipeline to
analyze the tweet data.  Both are triggered by App Engine cron jobs.

So, the app has four .yaml files.
There is one for each service: [`app.yaml`]('app.yaml') (which
uses [`main.py`](main.py)) and [`backend.yaml`](backend.yaml) (which uses [`main_df.py`](main_df.py)).
The GAE flex service is a [custom runtime](https://cloud.google.com/appengine/docs/flexible/custom-runtimes/),
and it uses the [`Dockerfile`](Dockerfile) and [`requirements.txt`](requirements.txt)
in this directory when it builds and deploys.

Then, the app has a [`dispatch.yaml`](dispatch.yaml) file that specifies how to route requests to
the two services; and a [`cron.yaml`](cron.yaml) file that defines the cron jobs.

Deploy the parts of the app like this, in this order:

```
gcloud app deploy app.yaml
gcloud app deploy backend.yaml
gcloud app deploy dispatch.yaml
gcloud app deploy cron.yaml
```

If you change something in either service's script, you only need to re-deploy that `.yaml` file.
You don't need to redeploy the dispatch file again unless you change the routing. If you should want
to change the cron job timings, just edit and redeploy the `cron.yaml` file.

## Testing your deployment

To test your deployment, manually trigger the cron jobs.  To do this, go to the
[cloud console](https://console.cloud.google.com) for your project,
and visit the [App Engine pane](https://console.cloud.google.com/appengine).
Then, click on 'Task Queues' in the left navbar, then the 'Cron Jobs' tab in the center pane.

Then, click `Run now` for the `/timeline` cron job.  This is the job that fetches tweets and stores
them in the Datastore. After it runs, you should be able to see `Tweet` entities in the Datastore.
Visit the [Datastore](https://console.cloud.google.com/datastore/entities) pane in the Cloud
Console, and select `Tweet` from the 'Entities' pull-down menu. You can also try a GQL query:

```
select * from Tweet order by created_at desc
```

Once you know that the 'fetch tweets' cron is running successfully, click `Run now` for the
`/launchpipeline` cron. This should kick off a Dataflow job and return within a few seconds.  You
should be able to see it running in the [Dataflow pane](https://console.cloud.google.com/dataflow)
of the Cloud Console. It should finish in a few minutes. Check that it finishes without error.

Once it has finished, you ought to see three new tables in your BigQuery dataset: `urls`,
`word_counts`, and `word_cooccur`.

If you see any problems, make sure that you've configured the `app.yaml` and `Dockerfile` as
described above, and check the logs for clues.

Note: the `/launchpipeline` request handler is configured to return without launching the pipeline
if the request has not originated as a cron request. You can comment out that logic in `main_df.py`,
in the `launch()` function, if you'd like to override that behavior.

## Running the 'backend' script locally

If you'd like, you can directly run the `main_df.py` script, which launches the Dataflow pipeline,
locally. You might find this easier if you're trying to debug some change you've made. To do this,
first make sure you've followed
[these](https://cloud.google.com/dataflow/docs/quickstarts/quickstart-python#Setup) instructions.
Make sure you have all the required dependencies by running
the following in your virtual environment:

```sh
pip install --target=lib -r requirements.txt
```

Then, set the necessary environment vars in your shell (changing the following for your correct values):

```sh
export PROJECT=your-project
export BUCKET=your-bucket-name
export DATASET=your-dataset-name
```

Then, edit `main_df.py` and in `launch()`, comment out the code that checks that the request has
the `'X-Appengine-Cron'`header.

Then run:

```sh
python main_df.py
```

The script will start a web server on `localhost` port 8080.
Visit [http://localhost:8080/launchpipeline](http://localhost:8080/launchpipeline).
That should kick off the Dataflow pipeline deployment.

## Exploring the analytics results in BigQuery

Once our example app is up and running, it periodically writes the results of its analysis to BigQuery. Then, we can run some fun queries on the data.

For example, we can find recent word co-occurrences that are 'interesting' by our metric:

Or look for emerging word pairs, that have become 'interesting' in the last day or so (as of early April 2017):

We can contrast the 'interesting' word pairs with the words that are simply the most popular within a given period (you can see that most of these words are common, but not particularly newsworthy):

Or, find the most often-tweeted URLs from the past few days (some URLs are truncated in the output):

## What next?

This example walks through how you can programmatically launch Dataflow pipelines — that read from Datastore — directly from your App Engine app, in order to support a range of processing and analytics tasks.

There are lots of interesting ways that this example could be extended. For example, you could add
a user-facing frontend to the web app, that fetches and displays results from BigQuery. You might
also look at trends over time (e.g. for bigrams) -- either from BigQuery, or by extending the
Dataflow pipeline.

## Contributions

Contributions are not currently accepted.  This is not an official Google product.


text:
#pragma once
#include <aws/cognito-idp/CognitoIdentityProvider_EXPORTS.h>
#include <aws/cognito-idp/CognitoIdentityProviderRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace CognitoIdentityProvider
{
namespace Model
{

  /**
   *
Represents the request to disable any user as an administrator.

   */
  class AWS_COGNITOIDENTITYPROVIDER_API AdminDisableUserRequest : public CognitoIdentityProviderRequest
  {
  public:
    AdminDisableUserRequest();
    Aws::String SerializePayload() const override;

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

    /**
     *
The user pool ID for the user pool where you want to disable the user.

     */
    inline const Aws::String& GetUserPoolId() const{ return m_userPoolId; }

    /**
     *
The user pool ID for the user pool where you want to disable the user.

     */
    inline void SetUserPoolId(const Aws::String& value) { m_userPoolIdHasBeenSet = true; m_userPoolId = value; }

    /**
     *
The user pool ID for the user pool where you want to disable the user.

     */
    inline void SetUserPoolId(Aws::String&& value) { m_userPoolIdHasBeenSet = true; m_userPoolId = value; }

    /**
     *
The user pool ID for the user pool where you want to disable the user.

     */
    inline void SetUserPoolId(const char* value) { m_userPoolIdHasBeenSet = true; m_userPoolId.assign(value); }

    /**
     *
The user pool ID for the user pool where you want to disable the user.

     */
    inline AdminDisableUserRequest& WithUserPoolId(const Aws::String& value) { SetUserPoolId(value); return *this;}

    /**
     *
The user pool ID for the user pool where you want to disable the user.

     */
    inline AdminDisableUserRequest& WithUserPoolId(Aws::String&& value) { SetUserPoolId(value); return *this;}

    /**
     *
The user pool ID for the user pool where you want to disable the user.

     */
    inline AdminDisableUserRequest& WithUserPoolId(const char* value) { SetUserPoolId(value); return *this;}

    /**
     *
The user name of the user you wish to disable.

     */
    inline const Aws::String& GetUsername() const{ return m_username; }

    /**
     *
The user name of the user you wish to disable.

     */
    inline void SetUsername(const Aws::String& value) { m_usernameHasBeenSet = true; m_username = value; }

    /**
     *
The user name of the user you wish to disable.

     */
    inline void SetUsername(Aws::String&& value) { m_usernameHasBeenSet = true; m_username = value; }

    /**
     *
The user name of the user you wish to disable.

     */
    inline void SetUsername(const char* value) { m_usernameHasBeenSet = true; m_username.assign(value); }

    /**
     *
The user name of the user you wish to disable.

     */
    inline AdminDisableUserRequest& WithUsername(const Aws::String& value) { SetUsername(value); return *this;}

    /**
     *
The user name of the user you wish to disable.

     */
    inline AdminDisableUserRequest& WithUsername(Aws::String&& value) { SetUsername(value); return *this;}

    /**
     *
The user name of the user you wish to disable.

     */
    inline AdminDisableUserRequest& WithUsername(const char* value) { SetUsername(value); return *this;}

  private:
    Aws::String m_userPoolId;
    bool m_userPoolIdHasBeenSet;
    Aws::String m_username;
    bool m_usernameHasBeenSet;
  };

} // namespace Model
} // namespace CognitoIdentityProvider
} // namespace Aws


text:
namespace autofill {

class AutofillDriver;
class AutofillExternalDelegate;
class AutofillManagerDelegate;
struct FormData;

// Per-tab Autocomplete history manager. Handles receiving form data
// from the renderer and the storing and retrieving of form data
// through WebDataServiceBase.
class AutocompleteHistoryManager : public WebDataServiceConsumer {
 public:
  AutocompleteHistoryManager(AutofillDriver* driver,
                             AutofillManagerDelegate* delegate);
  virtual ~AutocompleteHistoryManager();

  // WebDataServiceConsumer implementation.
  virtual void OnWebDataServiceRequestDone(
      WebDataServiceBase::Handle h,
      const WDTypedResult* result) OVERRIDE;

  // Pass-through functions that are called by AutofillManager, after it has
  // dispatched a message.
  void OnGetAutocompleteSuggestions(
      int query_id,
      const base::string16& name,
      const base::string16& prefix,
      const std::string form_control_type,
      const std::vector<base::string16>& autofill_values,
      const std::vector<base::string16>& autofill_labels,
      const std::vector<base::string16>& autofill_icons,
      const std::vector<int>& autofill_unique_ids);
  virtual void OnFormSubmitted(const FormData& form);

  // Must be public for the external delegate to use.
  void OnRemoveAutocompleteEntry(const base::string16& name,
                                 const base::string16& value);

  // Sets our external delegate.
  void SetExternalDelegate(AutofillExternalDelegate* delegate);

 protected:
  friend class AutofillManagerTest;

  // Sends the given |suggestions| for display in the Autofill popup.
  void SendSuggestions(const std::vector<base::string16>* suggestions);

 private:
  // Cancels the currently pending WebDataService query, if there is one.
  void CancelPendingQuery();

  // Provides driver-level context. Must outlive this object.
  AutofillDriver* driver_;
  scoped_refptr<AutofillWebDataService> database_;

  // When the manager makes a request from WebDataServiceBase, the database is
  // queried on another thread, we record the query handle until we get called
  // back.  We also store the autofill results so we can send them together.
  WebDataServiceBase::Handle pending_query_handle_;
  int query_id_;
  std::vector<base::string16> autofill_values_;
  std::vector<base::string16> autofill_labels_;
  std::vector<base::string16> autofill_icons_;
  std::vector<int> autofill_unique_ids_;

  // Delegate to perform external processing (display, selection) on
  // our behalf.  Weak.
  AutofillExternalDelegate* external_delegate_;

  // Delegate to provide whether or not autocomplete functionality is enabled.
  AutofillManagerDelegate* const manager_delegate_;

  // Whether IPC is sent.
  bool send_ipc_;

  DISALLOW_COPY_AND_ASSIGN(AutocompleteHistoryManager);
};

}  // namespace autofill

#endif  // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOCOMPLETE_HISTORY_MANAGER_H_


text:
dmTalkPlugin provides an HTML/CSS/JS web chat. It allows to create rooms and chat without any registration.
The plugin is fully extensible. Only works with [Diem 5](http://diem-project.org/) installed.

See the [online demo](http://talk.diem-project.org/)

Documentation
-------------

See the online documentation : [Diem Talk plugin documentation](http://diem-project.org/plugins/dmtalkplugin)


text:
require 'chef/win32/api/unicode'

class Chef
  module ReservedNames::Win32
    class Unicode
      include Chef::ReservedNames::Win32::API::Unicode
      extend Chef::ReservedNames::Win32::API::Unicode
    end
  end
end

module FFI
  class Pointer
    def read_wstring(num_wchars = nil)
      if num_wchars.nil?
        # Find the length of the string
        length = 0
        last_char = nil
        while last_char != "\000\000" do
          length += 1
          last_char = self.get_bytes(0,length * 2)[-2..-1]
        end

        num_wchars = length
      end

      Chef::ReservedNames::Win32::Unicode.wide_to_utf8(self.get_bytes(0, num_wchars*2))
    end
  end
end

class String
  def to_wstring
    Chef::ReservedNames::Win32::Unicode.utf8_to_wide(self)
  end
end


text:
// Copyright (c) Tunnel Vision Laboratories, LLC. All Rights Reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

#nullable disable

namespace StyleCop.Analyzers.Test.SpacingRules
{
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.CodeAnalysis.CSharp;
    using Microsoft.CodeAnalysis.Testing;
    using StyleCop.Analyzers.SpacingRules;
    using Xunit;
    using static StyleCop.Analyzers.Test.Verifiers.StyleCopCodeFixVerifier<
        StyleCop.Analyzers.SpacingRules.SA1000KeywordsMustBeSpacedCorrectly,
        StyleCop.Analyzers.SpacingRules.TokenSpacingCodeFixProvider>;

    /// <summary>
    /// This class contains unit tests for <see cref="SA1000KeywordsMustBeSpacedCorrectly"/> and
    /// <see cref="TokenSpacingCodeFixProvider"/>.
    /// </summary>
    public class SA1000UnitTests
    {
        [Fact]
        public async Task TestCatchallStatementAsync()
        {
            string statement = @"try
{
}
catch
{
}
";

            await this.TestKeywordStatementAsync(statement, DiagnosticResult.EmptyDiagnosticResults, statement).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestCatchStatementAsync()
        {
            string statementWithoutSpace = @"try
{
}
catch(Exception ex)
{
}
";

            string statementWithSpace = @"try
{
}
catch (Exception ex)
{
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("catch", string.Empty, "followed").WithLocation(15, 1);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestFixedStatementAsync()
        {
            string statementWithoutSpace = @"byte[] y = new byte[10];
fixed(byte* b = &y[0])
{
}
";

            string statementWithSpace = @"byte[] y = new byte[10];
fixed (byte* b = &y[0])
{
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("fixed", string.Empty, "followed").WithLocation(13, 1);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestForStatementAsync()
        {
            string statementWithoutSpace = @"for(int x = 0; x < 10; x++)
{
}
";

            string statementWithSpace = @"for (int x = 0; x < 10; x++)
{
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("for", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestForeachStatementAsync()
        {
            string statementWithoutSpace = @"foreach(int x in new int[0])
{
}
";

            string statementWithSpace = @"foreach (int x in new int[0])
{
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("foreach", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestFromStatementAsync()
        {
            string statementWithoutSpace = @"var result = from@x in new int[3] select x;";

            string statementWithSpace = @"var result = from @x in new int[3] select x;";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("from", string.Empty, "followed").WithLocation(12, 26);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestGroupStatementAsync()
        {
            string statementWithoutSpace = @"var result = from x in new[] { new { A = 3 } }
group@x by x.A into z
select z;";

            string statementWithSpace = @"var result = from x in new[] { new { A = 3 } }
group @x by x.A into z
select z;";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("group", string.Empty, "followed").WithLocation(13, 1);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestIfStatementAsync()
        {
            string statementWithoutSpace = @"if(true)
{
}
";

            string statementWithSpace = @"if (true)
{
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("if", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestInStatementAsync()
        {
            string statementWithoutSpace = @"var y = new int[3]; var result = from x in@y select x;";

            string statementWithSpace = @"var y = new int[3]; var result = from x in @y select x;";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("in", string.Empty, "followed").WithLocation(12, 53);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestIntoStatementAsync()
        {
            string statementWithoutSpace = @"var result = from x in new[] { new { A = 3 } }
group x by x.A into@z
select z;";

            string statementWithSpace = @"var result = from x in new[] { new { A = 3 } }
group x by x.A into @z
select z;";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("into", string.Empty, "followed").WithLocation(13, 16);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestJoinStatementAsync()
        {
            string statementWithoutSpace = @"var result = from x in new[] { new { A = 3 } }
join@a in new[] { new { B = 3 } } on x.A equals a.B
select x;";

            string statementWithSpace = @"var result = from x in new[] { new { A = 3 } }
join @a in new[] { new { B = 3 } } on x.A equals a.B
select x;";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("join", string.Empty, "followed").WithLocation(13, 1);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestLetStatementAsync()
        {
            string statementWithoutSpace = @"var result = from x in new int[3]
let@z = 3
select x;";

            string statementWithSpace = @"var result = from x in new int[3]
let @z = 3
select x;";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("let", string.Empty, "followed").WithLocation(13, 1);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestLockStatementAsync()
        {
            string statementWithoutSpace = @"lock(new object())
{
}
";

            string statementWithSpace = @"lock (new object())
{
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("lock", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestOrderbyStatementAsync()
        {
            string statementWithoutSpace = @"var result = from x in new[] { new { A = 3 } }
orderby(x.A)
select x;";

            string statementWithSpace = @"var result = from x in new[] { new { A = 3 } }
orderby (x.A)
select x;";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("orderby", string.Empty, "followed").WithLocation(13, 1);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestReturnVoidStatementAsync()
        {
            string statementWithoutSpace = @"return;";

            string statementWithSpace = @"return ;";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("return", " not", "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestReturnIntStatementAsync()
        {
            string statementWithoutSpace = @"return(3);";

            string statementWithSpace = @"return (3);";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace, returnType: "int").ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("return", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace, returnType: "int").ConfigureAwait(false);
        }

        [Fact]
        public async Task TestSelectStatementAsync()
        {
            string statementWithoutSpace = @"var result = from x in new int[3] select@x;";

            string statementWithSpace = @"var result = from x in new int[3] select @x;";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("select", string.Empty, "followed").WithLocation(12, 47);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestStackallocStatementAsync()
        {
            string statementWithoutSpace = @"int* x = stackalloc@Int32[3];";

            string statementWithSpace = @"int* x = stackalloc @Int32[3];";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("stackalloc", string.Empty, "followed").WithLocation(12, 22);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestSwitchStatementAsync()
        {
            string statementWithoutSpace = @"switch(3)
{
default:
    break;
}
";

            string statementWithSpace = @"switch (3)
{
default:
    break;
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("switch", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestThrowStatementAsync()
        {
            string statementWithoutSpace = @"throw(new Exception());";

            string statementWithSpace = @"throw (new Exception());";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("throw", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestRethrowStatementAsync()
        {
            string statementWithoutSpace = @"try
{
}
catch (Exception ex)
{
    throw;
}
";

            string statementWithSpace = @"try
{
}
catch (Exception ex)
{
    throw ;
}
";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("throw", " not", "followed").WithLocation(17, 5);

            await this.TestKeywordStatementAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestUsingStatementAsync()
        {
            string statementWithoutSpace = @"using(default(IDisposable))
{
}
";

            string statementWithSpace = @"using (default(IDisposable))
{
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("using", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestWhereStatementAsync()
        {
            string statementWithoutSpace = @"var result = from x in new[] { new { A = true } }
where(x.A)
select x;";

            string statementWithSpace = @"var result = from x in new[] { new { A = true } }
where (x.A)
select x;";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("where", string.Empty, "followed").WithLocation(13, 1);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestWhileStatementAsync()
        {
            string statementWithoutSpace = @"while(false)
{
}
";

            string statementWithSpace = @"while (false)
{
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("while", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestYieldReturnStatementAsync()
        {
            // There is no way to have a 'yield' keyword which is not followed by a space. All we need to do is verify
            // that no diagnostic is reported for its use with a space.
            string statementWithSpace = @"yield return 3;";
            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace, returnType: "IEnumerable<int>").ConfigureAwait(false);
        }

        [Fact]
        public async Task TestYieldBreakStatementAsync()
        {
            // There is no way to have a 'yield' keyword which is not followed by a space. All we need to do is verify
            // that no diagnostic is reported for its use with a space.
            string statementWithSpace = @"yield break;";
            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace, returnType: "IEnumerable<int>").ConfigureAwait(false);
        }

        [Fact]
        public async Task TestCheckedStatementAsync()
        {
            string statementWithoutSpace = @"int x = checked(3);";

            string statementWithSpace = @"int x = checked (3);";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("checked", " not", "followed").WithLocation(12, 21);

            await this.TestKeywordStatementAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);

            statementWithoutSpace = @"checked{ };";

            statementWithSpace = @"checked { };";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            expected = Diagnostic().WithArguments("checked", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestDefaultCaseStatementAsync()
        {
            string statementWithoutSpace = @"switch (3)
{
default:
    break;
}
";

            string statementWithSpace = @"switch (3)
{
default :
    break;
}
";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("default", " not", "followed").WithLocation(14, 1);

            await this.TestKeywordStatementAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestDefaultValueStatementAsync()
        {
            string statementWithoutSpace = @"int x = default(int);";

            string statementWithSpace = @"int x = default (int);";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("default", " not", "followed").WithLocation(12, 21);

            await this.TestKeywordStatementAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNameofStatementAsync()
        {
            string statementWithoutSpace = @"string x = nameof(x);";

            string statementWithSpace = @"string x = nameof (x);";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("nameof", " not", "followed").WithLocation(12, 24);

            await this.TestKeywordStatementAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestSizeofStatementAsync()
        {
            string statementWithoutSpace = @"int x = sizeof(int);";

            string statementWithSpace = @"int x = sizeof (int);";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("sizeof", " not", "followed").WithLocation(12, 21);

            await this.TestKeywordStatementAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestTypeofStatementAsync()
        {
            string statementWithoutSpace = @"Type x = typeof(int);";

            string statementWithSpace = @"Type x = typeof (int);";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("typeof", " not", "followed").WithLocation(12, 22);

            await this.TestKeywordStatementAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestUncheckedStatementAsync()
        {
            string statementWithoutSpace = @"int x = unchecked(3);";

            string statementWithSpace = @"int x = unchecked (3);";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("unchecked", " not", "followed").WithLocation(12, 21);

            await this.TestKeywordStatementAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);

            statementWithoutSpace = @"unchecked{ };";

            statementWithSpace = @"unchecked { };";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            expected = Diagnostic().WithArguments("unchecked", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNewObjectStatementAsync()
        {
            string statementWithoutSpace = @"int x = new@Int32();";

            string statementWithSpace = @"int x = new @Int32();";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("new", string.Empty, "followed").WithLocation(12, 21);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNewArrayStatementAsync()
        {
            string statementWithoutSpace = @"int[] x = new@Int32[3];";

            string statementWithSpace = @"int[] x = new @Int32[3];";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("new", string.Empty, "followed").WithLocation(12, 23);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNewImplicitArrayStatementAsync()
        {
            string statementWithoutSpace = @"int[] x = new[] { 3 };";

            string statementWithSpace = @"int[] x = new [] { 3 };";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            // this case is handled by SA1026, so it shouldn't be reported here
            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        [WorkItem(2419, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2419")]
        public async Task TestVarIdentifierAsync()
        {
            string statementWithoutSpace = @"int[] x = null; x.Select(var => var.ToString());";

            string statementWithSpace = @"int[] x = null; x.Select(var => var .ToString());";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            // this case is handled by SA1019, so it shouldn't be reported here
            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);
        }

        /// <summary>
        /// Verifies that calls on 'var' are handled properly.
        /// </summary>
        /// <returns>A <see cref="Task"/> representing the asynchronous unit test.</returns>
        /// <seealso cref="SA1008UnitTests.TestVarIdentifierInvocationAsync"/>
        [Fact]
        [WorkItem(2419, "https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/2419")]
        public async Task TestVarIdentifierInvocationAsync()
        {
            string statementWithoutSpace = @"Func<int>[] x = null; x.Select(var => var());";

            string statementWithSpace = @"Func<int>[] x = null; x.Select(var => var ());";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            // this case is handled by SA1008, so it shouldn't be reported here
            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNewConstructorContraintStatement_TypeAsync()
        {
            string statementWithSpace = @"public class Foo<T> where T : new ()
{
}";

            string statementWithoutSpace = @"public class Foo<T> where T : new()
{
}";

            await this.TestKeywordDeclarationAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("new", " not", "followed").WithLocation(9, 39);

            await this.TestKeywordDeclarationAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNewConstructorContraintStatement_TypeWithMultipleConstraintsAsync()
        {
            string statementWithSpace = @"public class Foo<T> where T : IDisposable, new ()
{
}";

            string statementWithoutSpace = @"public class Foo<T> where T : IDisposable, new()
{
}";

            await this.TestKeywordDeclarationAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("new", " not", "followed").WithLocation(9, 52);

            await this.TestKeywordDeclarationAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNewConstructorContraintStatement_TypeWithClassConstraintsAsync()
        {
            string statementWithSpace = @"public class Foo<T> where T : class, new ()
{
}";

            string statementWithoutSpace = @"public class Foo<T> where T : class, new()
{
}";

            await this.TestKeywordDeclarationAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("new", " not", "followed").WithLocation(9, 46);

            await this.TestKeywordDeclarationAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNewConstructorContraintStatement_MethodAsync()
        {
            string statementWithSpace = @"public void Foo<T>() where T : new ()
{
}";

            string statementWithoutSpace = @"public void Foo<T>() where T : new()
{
}";

            await this.TestKeywordDeclarationAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("new", " not", "followed").WithLocation(9, 40);

            await this.TestKeywordDeclarationAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNewConstructorContraintStatement_MethodWithMultipleConstraintsAsync()
        {
            string statementWithSpace = @"public void Foo<T>() where T : IDisposable, new ()
{
}";

            string statementWithoutSpace = @"public void Foo<T>() where T : IDisposable, new()
{
}";

            await this.TestKeywordDeclarationAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("new", " not", "followed").WithLocation(9, 53);

            await this.TestKeywordDeclarationAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestNewConstructorContraintStatement_MethodWithClassConstraintsAsync()
        {
            string statementWithSpace = @"public void Foo<T>() where T : class, new ()
{
}";

            string statementWithoutSpace = @"public void Foo<T>() where T : class, new()
{
}";

            await this.TestKeywordDeclarationAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("new", " not", "followed").WithLocation(9, 47);

            await this.TestKeywordDeclarationAsync(statementWithSpace, expected, statementWithoutSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestAwaitIdentifierAsync()
        {
            string statementWithoutSpace = @"var result = await(default(Task<int>));";

            string statementWithSpace = @"var result = await (default(Task<int>));";

            await this.TestKeywordStatementAsync(statementWithoutSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithoutSpace, asyncMethod: false).ConfigureAwait(false);
            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace, asyncMethod: false).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestAwaitStatementAsync()
        {
            string statementWithoutSpace = @"var result = await(default(Task<int>));";

            string statementWithSpace = @"var result = await (default(Task<int>));";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace, asyncMethod: true).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("await", string.Empty, "followed").WithLocation(12, 26);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace, asyncMethod: true).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestCaseStatementAsync()
        {
            string statementWithoutSpace = @"switch (3)
{
case(3):
default:
    break;
}
";

            string statementWithSpace = @"switch (3)
{
case (3):
default:
    break;
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("case", string.Empty, "followed").WithLocation(14, 1);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestGotoCaseStatementAsync()
        {
            string statementWithoutSpace = @"switch (3)
{
case 2:
    goto case(3);

case 3:
default:
    break;
}
";

            string statementWithSpace = @"switch (3)
{
case 2:
    goto case (3);

case 3:
default:
    break;
}
";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("case", string.Empty, "followed").WithLocation(15, 10);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestVarKeywordAsync()
        {
            string statementWithoutSpace = @"var@x = ""test"";";

            string statementWithSpace = @"var @x = ""test"";";

            await this.TestKeywordStatementAsync(statementWithSpace, DiagnosticResult.EmptyDiagnosticResults, statementWithSpace).ConfigureAwait(false);

            DiagnosticResult expected = Diagnostic().WithArguments("var", string.Empty, "followed").WithLocation(12, 13);

            await this.TestKeywordStatementAsync(statementWithoutSpace, expected, statementWithSpace).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestMissingSelectTokenAsync()
        {
            string testCode = @"
class ClassName
{
    void MethodName()
    {
        var result = from x in new int[0];
    }
}
";

            var expected = DiagnosticResult.CompilerError("CS0742").WithMessage("A query body must end with a select clause or a group clause").WithLocation(6, 42);
            await VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);
        }

        [Fact]
        public async Task TestTrailingCommentAsync()
        {
            string testCode = @"
class ClassName
{
    void MethodName()
    {
        if/*comment*/ (true)
        {
        }
    }
}
";
            string fixedCode = @"
class ClassName
{
    void MethodName()
    {
        if /*comment*/ (true)
        {
        }
    }
}
";

            var expected = Diagnostic().WithArguments("if", string.Empty, "followed").WithLocation(6, 9);
            await VerifyCSharpFixAsync(testCode, expected, fixedCode, CancellationToken.None).ConfigureAwait(false);
        }

        protected Task TestKeywordStatementAsync(string statement, DiagnosticResult expected, string fixedStatement, string returnType = "void", bool asyncMethod = false, LanguageVersion? languageVersion = default)
        {
            return this.TestKeywordStatementAsync(statement, new[] { expected }, fixedStatement, returnType, asyncMethod, languageVersion);
        }

        protected async Task TestKeywordStatementAsync(string statement, DiagnosticResult[] expected, string fixedStatement, string returnType = "void", bool asyncMethod = false, LanguageVersion? languageVersion = default)
        {
            string testCodeFormat = @"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Namespace
{{
    {2}class ClassName
    {{
        {0}{4} Foo()
        {{
            {1}
        }}
        {3}
    }}
}}
";

            string unsafeModifier = asyncMethod ? string.Empty : "unsafe ";
            string asyncModifier = asyncMethod ? "async " : string.Empty;
            string awaitMethod = asyncMethod ? string.Empty : "int await(Task task) { return 0; }";
            string testCode = string.Format(testCodeFormat, asyncModifier, statement, unsafeModifier, awaitMethod, returnType);
            string fixedTest = string.Format(testCodeFormat, asyncModifier, fixedStatement, unsafeModifier, awaitMethod, returnType);

            await VerifyCSharpFixAsync(languageVersion, testCode, expected, fixedTest, CancellationToken.None).ConfigureAwait(false);
        }

        private Task TestKeywordDeclarationAsync(string statement, DiagnosticResult expected, string fixedStatement)
        {
            return this.TestKeywordDeclarationAsync(statement, new[] { expected }, fixedStatement);
        }

        private async Task TestKeywordDeclarationAsync(string statement, DiagnosticResult[] expected, string fixedStatement)
        {
            string testCodeFormat = @"
using System;
using System.Linq;
using System.Threading.Tasks;
namespace Namespace
{{
    class ClassName
    {{
        {0}
    }}
}}
";

            string testCode = string.Format(testCodeFormat, statement);
            string fixedTest = string.Format(testCodeFormat, fixedStatement);

            var test = new CSharpTest
            {
                TestCode = testCode,
                FixedCode = fixedTest,
            };

            test.ExpectedDiagnostics.AddRange(expected);
            await test.RunAsync(CancellationToken.None).ConfigureAwait(false);
        }
    }
}


text:
layout: post
date: 2017-01-08
title: "Jonathan James Couture Marilyn"
category: Jonathan James Couture
tags: [Jonathan James Couture]
---
### Jonathan James Couture Marilyn
Just **$269.99**
###

BRANDS	Jonathan James Couture

Buy it: [https://www.readybrides.com/en/jonathan-james-couture/36394-jonathan-james-couture-marilyn.html](https://www.readybrides.com/en/jonathan-james-couture/36394-jonathan-james-couture-marilyn.html)


text:
layout: default
---

{{ page.title }}

          {% if page.categories %} {% for cat in page.categories %} {{ cat }} {% endfor %} {% endif %}

{{ content }}


text:
require 'spec_helper'

describe "Flick Android Validations" do

  before :all do
    androids = ["TA64300B9C", "emulator-5554"] #set one real device and one emulator
    @options = {platform: "android", flick_dir: "#{Dir.home}/.flick", dir_name: "sdcard/flick", outdir: Dir.pwd, specs: true}
    Flick::Android.new(@options).check_for_devices
    abort unless (Flick::Android.new(@options).devices - androids).empty?
    `rm *.png *.mp4 >> /dev/null 2>&1`
  end

  after :each do
    `rm *.png *.mp4 >> /dev/null 2>&1`
  end

  it 'capture a screenshot on device' do
    @options.merge!({udid: "TA64300B9C", name: "android-device-screenshot"})
    flick = Screenshot.new(@options)
    file = "#{@options[:name]}.png"
    flick.screenshot
    expect(File.file? file).to eq true
  end

  it 'capture a screenshot on emulator' do
    @options.merge!({udid: "emulator-5554", name: "android-emulator-screenshot"})
    flick = Screenshot.new(@options)
    file = "#{@options[:name]}.png"
    flick.screenshot
    expect(File.file? file).to eq true
  end

  it 'capture a video on device' do
    @options.merge!({udid: "TA64300B9C", name: "android-device-video"})
    flick = Video.new(@options)
    file = "#{@options[:name]}.mp4"
    flick.start; sleep 3 #need to wait for video to start
    flick.stop
    expect(File.file? file).to eq true
  end

  it 'capture extended video on device' do
    #must have something activily running on the screen. mp4box will limit video to uniqueness otherwise.
    @options.merge!({udid: "TA64300B9C", name: "android-device-video-extended", extend: true, limit: 5})
    flick = Video.new(@options)
    file = "#{@options[:name]}.mp4"
    flick.start; sleep 10 #Wait for SDK limit to exceed.
    flick.stop
    expect(File.file? file).to eq true
    runtime = Flick::System.video_length(file)
    expect(DateTime.parse(runtime).sec).to be > 5
  end

  it 'capture a video on emulator' do
    @options.merge!({ count: 500, seconds: 0.5, udid: "emulator-5554", name: "android-emulator-video"})
    flick = Video.new(@options)
    file = "#{@options[:name]}.mp4"
    flick.start; sleep 3
    flick.stop
    start = Time.now
    until File.file? file
      sleep 1; break if Time.now - start > 30
    end
    expect(File.file? file).to eq true
  end

  it 'screenshot count exceeded on emulator' do
    @options.merge!({ count: 10, seconds: 0.5, udid: "emulator-5554", name: "android-emulator-video-exceeded"})
    flick = Video.new(@options)
    file = "#{@options[:name]}.mp4"
    flick.start
    start = Time.now
    until File.file? file
      sleep 1; break if Time.now - start > 30
    end
    expect(File.file? file).to eq true
  end

  xit 'pull all files' do
    @options.merge!({ count: 10, seconds: 0.5, udid: "emulator-5554", name: "android-emulator-video-all-files", unique: false})
    flick = Video.new(@options)
    file = "#{@options[:name]}.mp4"
    flick.start
    start = Time.now
    until File.file? file
      sleep 1; break if Time.now - start > 30
    end
    expect(File.file? file).to eq true
  end
end


text:
""" Core context processors. """
from django.conf import settings

def core(_request):
    """ Site-wide context processor. """
    return {
        'platform_name': settings.PLATFORM_NAME
    }


text:
@extends('sirtrevorjs::html.video.base')

@section('video')
  <iframe loading="lazy" src="https://embed.redtube.com/?id={!! $remote !!}&bgcolor=000000" width="434" height="344"
  title="{!! $title !!}"></iframe>
@stop


text: sudo apt install texlive-full dvipng -y