text:
namespace Ps {

AboutBox::AboutBox(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::AboutBox)
{
    ui->setupUi(this);
}

AboutBox::~AboutBox()
{
    Utils::DestructorMsg(this);
    delete ui;
}

}

redpajama_set_name: RedPajamaGithub


text:
namespace GoogleARCoreInternal
{
    internal enum ApiAugmentedFaceRegionType
    {
        Nose = 0,
        ForeheadLeft = 1,
        ForeheadRight = 2,
    }
}


text:
<button class="btn btn-default print" onclick="DownloadPDF()" disabled=""> Print</button>

			<form id="form-download-file" action="http://spms.amaers.tk/getfile.php" method="POST" hidden>
                <input value="" type="text" name="url">
                <input value="" type="text" name="cacheid" ng-model="cacheid">
            </form>

					Class:

				        <?= Form::select('class_id', 0, Arr::assoc_to_keyval($classes, 'id', 'class_name'),
				            array('class'    => 'form-control')); ?>

					Start Date:

					    <input type="text" class="input-sm form-control" name="start"  width="100%"/>

					End Date:

					    <input type="text" class="input-sm form-control" name="end" />

Attendance Report

Date: {{ datePrinted }}

Class: {{ classname }}

	<?php if ($attendances): ?>

				Name
				Attendance

				 {{ range.months }}/{{ range.date }}/{{ range.year }}

				{{studList.attendances[0].lname}}, {{studList.attendances[0].fname}} {{studList.attendances[0].mname[0]}}.
				{{getStatusValue(studList, range)}}

	<?php else: ?>

No Attendances.

	<?php endif; ?>


text:
    <form method="POST" action="/api/login-with-form">
      <input class="js-username" type="text" name="username" placeholder="username" />
      <input class="js-password" type="password" name="password" placeholder="******" />
      <button type="submit">Login</button>
    </form>

Connect with Twitter

Access Basic Auth Realm

Logout Basic Auth Realm


text:
package net.glowstone.block.blocktype;

import net.glowstone.EventFactory;
import net.glowstone.GlowWorld;
import net.glowstone.block.GlowBlock;
import net.glowstone.block.GlowBlockState;
import net.glowstone.block.ItemTable;
import net.glowstone.entity.GlowPlayer;
import net.glowstone.generator.populators.overworld.FlowerForestPopulator;
import org.bukkit.GrassSpecies;
import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.block.BlockGrowEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.material.LongGrass;

public class BlockGrass extends BlockType implements IBlockGrowable {

    public BlockGrass() {
        setDrops(new ItemStack(Material.DIRT, 1));
    }

    @Override
    public boolean isFertilizable(GlowBlock block) {
        return true;
    }

    @Override
    public boolean canTickRandomly() {
        return true;
    }

    @Override
    public boolean canGrowWithChance(GlowBlock block) {
        return true;
    }

    @Override
    public void grow(GlowPlayer player, GlowBlock block) {
        final GlowWorld world = block.getWorld();

        int i = 0;
        do {
            int j = 0;

            while (true) {
                // if there's available space
                if (block.getRelative(BlockFace.UP).getType() == Material.AIR) {
                    final GlowBlock b = block.getRelative(BlockFace.UP);
                    final GlowBlockState blockState = b.getState();
                    if (random.nextFloat() < 0.125D) {
                        // sometimes grow random flower
                        // would be better to call a method that choose a random
                        // flower depending on the biome
                        Material flower = FlowerForestPopulator.FLOWERS[random.nextInt(FlowerForestPopulator.FLOWERS.length)].getType();
                        if (ItemTable.instance().getBlock(flower).canPlaceAt(b, BlockFace.DOWN)) {
                            blockState.setType(flower);
                        }
                    } else {
                        final Material tallGrass = Material.LONG_GRASS;
                        if (ItemTable.instance().getBlock(tallGrass).canPlaceAt(b, BlockFace.DOWN)) {
                            // grow tall grass if possible
                            blockState.setType(tallGrass);
                            blockState.setData(new LongGrass(GrassSpecies.NORMAL));
                        }
                    }
                    BlockGrowEvent growEvent = new BlockGrowEvent(b, blockState);
                    EventFactory.callEvent(growEvent);
                    if (!growEvent.isCancelled()) {
                        blockState.update(true);
                    }
                } else if (j < i / 16) { // look around for grass block
                    int x = block.getX();
                    int y = block.getY();
                    int z = block.getZ();
                    x += random.nextInt(3) - 1;
                    y += (random.nextInt(3)) * random.nextInt(3) / 2;
                    z += random.nextInt(3) - 1;
                    if (world.getBlockAt(x, y, z).getType() == Material.GRASS) {
                        j++;
                        continue;
                    }
                }
                i++;
                break;
            }
        } while (i < 128);
    }

    @Override
    public void updateBlock(GlowBlock block) {
        if (block.getLightLevel() < 4 ||
                block.getRelative(BlockFace.UP).getMaterialValues().getLightOpacity() > 2) {
            // grass block turns into dirt block
            final GlowBlockState state = block.getState();
            state.setType(Material.DIRT);
            BlockFadeEvent fadeEvent = new BlockFadeEvent(block, state);
            EventFactory.callEvent(fadeEvent);
            if (!fadeEvent.isCancelled()) {
                state.update(true);
            }
        } else if (block.getLightLevel() >= 9) {
            final GlowWorld world = block.getWorld();
            int sourceX = block.getX();
            int sourceY = block.getY();
            int sourceZ = block.getZ();

            // grass spread randomly around
            for (int i = 0; i < 4; i++) {
                int x = sourceX + random.nextInt(3) - 1;
                int z = sourceZ + random.nextInt(3) - 1;
                int y = sourceY + random.nextInt(5) - 3;

                final GlowBlock targetBlock = world.getBlockAt(x, y, z);
                if (targetBlock.getType() == Material.DIRT &&
                        targetBlock.getData() == 0 && // only spread on normal dirt
                        targetBlock.getRelative(BlockFace.UP).getMaterialValues().getLightOpacity() <= 2 &&
                        targetBlock.getRelative(BlockFace.UP).getLightLevel() >= 4) {
                    final GlowBlockState state = targetBlock.getState();
                    state.setType(Material.GRASS);
                    state.setRawData((byte) 0);
                    BlockSpreadEvent spreadEvent = new BlockSpreadEvent(state.getBlock(), block, state);
                    EventFactory.callEvent(spreadEvent);
                    if (!spreadEvent.isCancelled()) {
                        state.update(true);
                    }
                }
            }
        }
    }
}


text:
// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.

#ifndef PXS_SOLVERCORESIMD_H
#define PXS_SOLVERCORESIMD_H

#include "PxsSolverCore.h"

namespace physx
{

class PxsSolverCoreSIMD : public PxsSolverCore
{
public:
	static PxsSolverCoreSIMD* create();

	// Implements PxsSolverCore
	virtual void destroyV();

	//! Solve
	virtual void solveV
		(const PxReal dt, const PxU32 positionIterations, const PxU32 velocityIterations,
		PxcSolverBody* PX_RESTRICT atomListStart, PxcSolverBodyData* PX_RESTRICT atomDataList, const PxU32 solverBodyOffset, const PxU32 atomListSize,
		PxcArticulationSolverDesc *PX_RESTRICT articulationListStart, const PxU32 articulationListSize,
		PxcSolverConstraintDesc* PX_RESTRICT constraintList, const PxU32 constraintListSize,
		PxcSolverConstraintDesc* PX_RESTRICT frictionConstraintList, const PxU32 frictionConstraintConstraintListSize,
		Cm::SpatialVector* PX_RESTRICT motionVelocityArray)
		const;

	//~Implements PxsSolverCore
};

}

#endif


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>RUActive | Add Fixture-Score</title>
  <link rel="stylesheet" href="Assets/css/Modules/footer.css"/>
  <link rel="stylesheet" href="Assets/css/Modules/header.css"/>
  <link rel="stylesheet" href="Assets/css/Pages/fixture_score.css"/>
  <link rel="stylesheet" href="Assets/css/main.css"/>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="icon" href="Assets/images/2.png" type="image/png">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">
  <link rel="stylesheet" href="Assets/css/hideDiv.css"/>

Help

ADD FIXTURE SCORE

This form serves to assist the user in the process of adding the scores for an event between two teams.

      <form>

          Event Name

            <select class="form-control" id="id_event_name">
            </select>

          Team Name A

            <select class="form-control" id="id_team_name_1">
            </select>

          Team Name B

            <select class="form-control" id="id_team_name_2">
            </select>

          Score A

            <input type = "text" class = "form-control" id = "id_score_1" name = "#" placeholder = "0">

          Score B

            <input type = "text" class = "form-control" id = "id_score_2" name = "#" placeholder = "0">

          Description

            <textarea rows="4" cols="50" class = "form-control" id = "description" name = "#" ></textarea>

            <button type="button" onclick="submitForm()" class="btn btn-primary btn-lg Add" id="adding">Add Fixture Score</button>

      </form>

Copyright &copy 2017, Original Xception. All Rights Reserved.

Click here to load this Caspio Cloud Database

Cloud Database by Caspio

Click here to load this Caspio Cloud Database

Cloud Database by Caspio

Click here to load this Caspio Cloud Database

Cloud Database by Caspio


text:
/*
See LICENSE folder for this sample's licensing information.

Abstract:
Section headers and footers example
*/

using System;
using System.Collections.Generic;
using System.Linq;
using Conference_Diffable.CompositionalLayout.CellsandSupplementaryViews;
using Foundation;
using UIKit;

namespace Conference_Diffable.CompositionalLayout.BasicsViewControllers {
	public partial class SectionHeadersFootersViewController : UIViewController, IUICollectionViewDelegate {
		static readonly string sectionHeaderElementKind = nameof (sectionHeaderElementKind);
		static readonly string sectionFooterElementKind = nameof (sectionFooterElementKind);

		UICollectionViewDiffableDataSource<NSNumber, NSNumber> dataSource;
		UICollectionView collectionView;

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			// Perform any additional setup after loading the view, typically from a nib.

			NavigationItem.Title = "Section Headers/Footers";
			ConfigureHierarchy ();
			ConfigureDataSource ();
		}

		UICollectionViewLayout CreateLayout ()
		{
			var itemSize = NSCollectionLayoutSize.Create (NSCollectionLayoutDimension.CreateFractionalWidth (1),
				NSCollectionLayoutDimension.CreateFractionalHeight (1));
			var item = NSCollectionLayoutItem.Create (itemSize);

			var groupSize = NSCollectionLayoutSize.Create (NSCollectionLayoutDimension.CreateFractionalWidth (1),
				NSCollectionLayoutDimension.CreateAbsolute (44));
			var group = NSCollectionLayoutGroup.CreateHorizontal (groupSize, item);

			var section = NSCollectionLayoutSection.Create (group);
			section.InterGroupSpacing = 5;
			section.ContentInsets = new NSDirectionalEdgeInsets (0, 10, 0, 10);

			var headerFooterSize = NSCollectionLayoutSize.Create (NSCollectionLayoutDimension.CreateFractionalWidth (1),
				NSCollectionLayoutDimension.CreateAbsolute (44));
			var sectionHeader = NSCollectionLayoutBoundarySupplementaryItem.Create (headerFooterSize, sectionHeaderElementKind, NSRectAlignment.Top);
			var sectionFooter = NSCollectionLayoutBoundarySupplementaryItem.Create (headerFooterSize, sectionFooterElementKind, NSRectAlignment.Bottom);
			section.BoundarySupplementaryItems = new [] { sectionHeader, sectionFooter };

			var layout = new UICollectionViewCompositionalLayout (section);
			return layout;
		}

		void ConfigureHierarchy ()
		{
			collectionView = new UICollectionView (View.Bounds, CreateLayout ()) {
				AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight,
				BackgroundColor = UIColor.SystemBackgroundColor,
				Delegate = this
			};
			collectionView.RegisterClassForCell (typeof (ListCell), ListCell.Key);
			collectionView.RegisterClassForSupplementaryView (typeof (TitleSupplementaryView), new NSString (sectionHeaderElementKind), TitleSupplementaryView.Key);
			collectionView.RegisterClassForSupplementaryView (typeof (TitleSupplementaryView), new NSString (sectionFooterElementKind), TitleSupplementaryView.Key);
			View.AddSubview (collectionView);
		}

		void ConfigureDataSource ()
		{
			dataSource = new UICollectionViewDiffableDataSource<NSNumber, NSNumber> (collectionView, CellProviderHandler) {
				SupplementaryViewProvider = SupplementaryViewProviderHandler
			};

			// initial data
			var itemsPerSection = 5;
			var sections = Enumerable.Range (0, 5).Select (i => NSNumber.FromInt32 (i)).ToArray ();
			var snapshot = new NSDiffableDataSourceSnapshot<NSNumber, NSNumber> ();
			var itemOffset = 0;

			foreach (var section in sections) {
				snapshot.AppendSections (new [] { section });
				var items = Enumerable.Range (itemOffset, itemsPerSection).Select (i => NSNumber.FromInt32 (i)).ToArray ();
				snapshot.AppendItems (items);
				itemOffset += itemsPerSection;
			}

			dataSource.ApplySnapshot (snapshot, false);

			UICollectionViewCell CellProviderHandler (UICollectionView collectionView, NSIndexPath indexPath, NSObject obj)
			{
				// Get a cell of the desired kind.
				var cell = collectionView.DequeueReusableCell (ListCell.Key, indexPath) as ListCell;

				// Populate the cell with our item description.
				cell.Label.Text = $"{indexPath.Section}, {indexPath.Row}";

				// Return the cell.
				return cell;
			}

			UICollectionReusableView SupplementaryViewProviderHandler (UICollectionView collectionView, string kind, NSIndexPath indexPath)
			{
				// Get a supplementary view of the desired kind.
				var supplementaryView = collectionView.DequeueReusableSupplementaryView (new NSString (kind),
					TitleSupplementaryView.Key, indexPath) as TitleSupplementaryView;

				// Populate the view with our section's  description.
				var viewKind = kind == sectionHeaderElementKind ? "Header" : "Footer";
				supplementaryView.Label.Text = $"{viewKind} for section {indexPath.Section}";
				supplementaryView.BackgroundColor = UIColor.LightGray;
				supplementaryView.Layer.BorderColor = UIColor.Black.CGColor;
				supplementaryView.Layer.BorderWidth = 1;

				// Return the view.
				return supplementaryView;
			}
		}

		#region UICollectionView Delegate

		[Export ("collectionView:didSelectItemAtIndexPath:")]
		public void ItemSelected (UICollectionView collectionView, NSIndexPath indexPath)
			=> collectionView.DeselectItem (indexPath, true);

		#endregion
	}
}


text:
void syslog_initialize(String host, uint16_t port);
void syslog_debugf(int level, int line, const char *func, const char *file, const char *msg, ...);
void syslog_printf(int level, const char *tag, const char *msg, ...);

enum {
    LEVEL_EMERGENCY = 0,
    LEVEL_ALERT,
    LEVEL_CRITICAL,
    LEVEL_ERROR,
    LEVEL_WARNING,
    LEVEL_NOTICE,
    LEVEL_INFO,
    LEVEL_DEBUG,
};

#if defined(DEBUG_BUILD) || defined(SYSLOG_DEBUG)
#define LOGA(fmt, ...) do{syslog_debugf(LEVEL_ALERT,__LINE__, __PRETTY_FUNCTION__,__FILE__,fmt,##__VA_ARGS__);}while(0)
#define LOGC(fmt, ...) do{syslog_debugf(LEVEL_CRITICAL,__LINE__, __PRETTY_FUNCTION__,__FILE__,fmt,##__VA_ARGS__);}while(0)
#define LOGE(fmt, ...) do{syslog_debugf(LEVEL_ERROR,__LINE__, __PRETTY_FUNCTION__,__FILE__,fmt,##__VA_ARGS__);}while(0)
#define LOGW(fmt, ...) do{syslog_debugf(LEVEL_WARNING,__LINE__, __PRETTY_FUNCTION__,__FILE__,fmt,##__VA_ARGS__);}while(0)
#define LOGN(fmt, ...) do{syslog_debugf(LEVEL_NOTICE,__LINE__, __PRETTY_FUNCTION__,__FILE__,fmt,##__VA_ARGS__);}while(0)
#define LOGI(fmt, ...) do{syslog_debugf(LEVEL_INFO,__LINE__, __PRETTY_FUNCTION__,__FILE__,fmt,##__VA_ARGS__);}while(0)
#define LOGD(fmt, ...) do{syslog_debugf(LEVEL_DEBUG,__LINE__, __PRETTY_FUNCTION__,__FILE__,fmt,##__VA_ARGS__);}while(0)
#else
#define LOGA(fmt, ...)
#define LOGC(fmt, ...)
#define LOGE(fmt, ...)
#define LOGW(fmt, ...)
#define LOGN(fmt, ...)
#define LOGI(fmt, ...)
#define LOGD(fmt, ...)
#endif


text:
class AddSearchInputBarOnOrgPages < ActiveRecord::Migration
  def up
    Feature.create(name: :search_input_bar_on_org_pages)
  end

  def down
    Feature.find_by(name: :search_input_bar_on_org_pages).destroy
  end
end


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.achieveit.android.MainActivity"
    tools:showIn="@layout/activity_main">

    <TextView
        android:id="@+id/init_hint"
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:gravity="center"
        android:text="@string/init_hint"
        android:textColor="#BDBDBD"
        android:textSize="24sp"
        android:textStyle="italic"
        android:visibility="gone" />

    <android.support.v7.widget.RecyclerView
        android:id="@+id/goal_list"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</LinearLayout>


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright © 2021 Cask Data, Inc.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License"); you may not
  ~ use this file except in compliance with the License. You may obtain a copy of
  ~ the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  ~ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  ~ License for the specific language governing permissions and limitations under
  ~ the License.
  -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>io.cdap.cdap</groupId>
    <artifactId>cdap-metrics-writer-extensions</artifactId>
    <version>1.2.0-SNAPSHOT</version>
  </parent>

  <artifactId>cdap-metrics-writer-ext-gcp-monitoring</artifactId>
  <name>CDAP metrics writer extension for Google Cloud Monitoring</name>
  <packaging>jar</packaging>

  <dependencies>
    <dependency>
      <groupId>com.google.cloud</groupId>
      <artifactId>google-cloud-monitoring</artifactId>
      <version>3.1.0</version>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java-util</artifactId>
      <version>3.19.1</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>31.0.1-jre</version>
    </dependency>
  </dependencies>
</project>


text:
<?php

namespace CmsTwbs\Form\View\Helper\Decorator;

use Zend\Form\Element,
    Zend\Form\ElementInterface,
    Zend\Form\FormInterface,
    CmsCommon\Form\View\Helper\Decorator\AbstractHtmlContainer,
    CmsCommon\View\Helper\Decorator\OrderedDecoratorInterface,
    CmsCommon\View\Helper\Decorator\PlacedDecoratorInterface,
    CmsCommon\View\Helper\HtmlContainer,
    CmsTwbs\View\Helper\Glyphicon;

class FormControlFeedback extends AbstractHtmlContainer implements OrderedDecoratorInterface, PlacedDecoratorInterface
{
    /**
     * @var string
     */
    protected $tagName = 'span';

    /**
     * @var string
     */
    protected $defaultClass = 'form-control-feedback';

    /**
     * @var HtmlContainer
     */
    protected $feedbackHelper;

    /**
     * @var HtmlContainer
     */
    protected $formControlStatusHelper;

    /**
     * @var string
     */
    protected $defaultFeedbackHelper = 'glyphicon';

    /**
     * @var int
     */
    protected $order = 7500;

    /**
     * @var string
     */
    protected $placement = 'append';

    /**
     * {@inheritDoc}
     */
    public function render($content, array $attribs = [], ElementInterface $element = null, FormInterface $form = null)
    {
        if (!$content && !$form) {
            return '';
        }

        if (!$form || !$element) {
            return parent::render($content, $attribs);
        }

        $content = $content ?: $this->getFeedbackContent($element, $form);
        if (!$content) {
            return '';
        }

        if (strpos($element->getAttribute('class'), 'form-control') !== false && (
            $element instanceof Element\Text ||
            $element instanceof Element\Password ||
            $element instanceof Element\Number ||
            $element instanceof Element\Email ||
            $element instanceof Element\Url
        )) {
            $element->setOption('has_feedback', true);
            if (empty($attribs['aria-hidden'])) {
                $attribs['aria-hidden'] = 'true';
            }
        }

        $feedbackHelper = $this->getFeedbackHelper();
        $content = $feedbackHelper($content, $this->mergeAttributes($attribs));

        if ($element->hasAttribute('aria-describedby')
            && ($status = $this->getStatusContent($element, $form))
        ) {
            $formControlStatusHelper = $this->getFormControlStatusHelper();
            $content .= $formControlStatusHelper(
                    "($status)",
                    ['id' => $element->getAttribute('aria-describedby')]
                );
        }

        return $content;
    }

    /**
     * @return HtmlContainer
     */
    protected function getFeedbackHelper()
    {
        if ($this->feedbackHelper) {
            return $this->feedbackHelper;
        }

        if (method_exists($this->view, 'plugin')) {
            $this->feedbackHelper = $this->view->plugin($this->getDefaultFeedbackHelper());
        }

        if (!$this->feedbackHelper instanceof HtmlContainer) {
            $this->feedbackHelper = new Glyphicon();
            $this->feedbackHelper->setView($this->getView());
        }

        return $this->feedbackHelper;
    }

    /**
     * @return string
     */
    protected function getDefaultFeedbackHelper()
    {
        return $this->defaultFeedbackHelper;
    }

    /**
     * @return HtmlContainer
     */
    protected function getFormControlStatusHelper()
    {
        if ($this->formControlStatusHelper) {
            return $this->formControlStatusHelper;
        }

        if (!$this->formControlStatusHelper instanceof HtmlContainer) {
            $this->formControlStatusHelper = new HtmlContainer();
            $this->formControlStatusHelper->setView($this->getView());
        }

        $this->formControlStatusHelper->setTagName('span')
            ->setAttribute('class', 'sr-only');

        return $this->formControlStatusHelper;
    }

    /**
     * Helper method for retrieving element's feedback content
     *
     * @param ElementInterface $element
     * @param FormInterface $form
     * @return void|string
     */
    protected function getFeedbackContent(ElementInterface $element, FormInterface $form)
    {
        if (!$form->hasValidated()) {
            return;
        }

        if ($this->isElementHasError($element, $form)) {
            return 'remove';
        }

        if ($element->getValue()) {
            return $form->getMessages() ? 'warning-sign' : 'ok';
        }
    }

    /**
     * Helper method for retrieving element's status content
     *
     * @param ElementInterface $element
     * @param FormInterface $form
     * @return void|string
     */
    protected function getStatusContent(ElementInterface $element, FormInterface $form)
    {
        if (!$form->hasValidated()) {
            return;
        }

        if ($this->isElementHasError($element, $form)) {
            return 'error';
        }

        if ($element->getValue()) {
            return $form->getMessages() ? 'warning' : 'success';
        }
    }

    /**
     * {@inheritDoc}
     */
    public function getOrder()
    {
        return $this->order;
    }

    /**
     * {@inheritDoc}
     */
    public function getPlacement()
    {
        return $this->placement;
    }
}


text:
namespace appc {
namespace schema {

struct ExecArg : StringType<ExecArg> {
  explicit ExecArg(const std::string& arg)
  : StringType<ExecArg>(arg) {}

  virtual Status validate() const {
    return Valid();
  }
};

struct Exec : ArrayType<Exec, ExecArg> {
  explicit Exec(const std::vector<ExecArg>& args)
  : ArrayType<Exec, ExecArg>(args) {}

  virtual Status validate() const {
    if (array.empty()) {
      return Error("exec must not be empty.");
    }
    if (!pathname::is_absolute(array.front())) {
      return Error("The executable in exec must use absolute path.");
    }
    return Valid();
  }
};

} // namespace schema
} // namespace appc


text:
FROM node:4
MAINTAINER Xie Di "xiedi@orientsoft.cn"
RUN npm config set registry https://registry.npm.taobao.org
RUN npm i -g gulp
RUN rm /etc/localtime
RUN ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EXPOSE 19527
ENTRYPOINT ["node", "/conalog/bin/www"]


text:
The maven `fabric8:create-env` goal queries all the [Services](services.html) in the current namespace along with looking at the JSON file generated via [mvn fabric8:json](mavenFarbic8Json.html) (located at `target/classes/kubernetes.json`) and generates a list of environment variables that would be required to simulate running a process inside Kubernetes.

This makes it easy to run, say, Java programs in your IDE as if it was running inside a Kubernetes environment; discovering all the [services](services.html) available in the namespace and setting all the same environment variables that are defined inside your [pods](pods.html) or [replication controllers](replicationControllers.html)

For a summary of the options see the [Maven Property Reference](#maven-properties)

### Generated files

The goal generates  the following files:

 * `target/env.sh` you can `source` in a shell to setup your environment together
 * `target/env.properties` file you can process easily with Java code or ideally your IDE can accept in its UI for running applications or test cases

### Acessing services

Note that your local machine may not be able to see [services](services.html) using the `PortalIP` address of the service (depending on how your networking is setup).

So the service environment variables like `FOO_SERVICE_HOST` will use the host names on any defined [OpenShift Routes](http://docs.openshift.org/latest/admin_guide/router.html) instead which allow access to services from outside of the Kubernetes cluster.

If you do not have [OpenShift Routes](http://docs.openshift.org/latest/admin_guide/router.html) setup for your services then you can either:

* apply them via [fabric8:apply](mavenFabric8Apply.html) so that it [creates the routes](mavenFabric8Apply.html#creating-routes) by specifying the maven property `fabric8.domain` or the environment variable `$KUBERNETES_DOMAIN` to specify to the DNS/host domain you wish to expose the services on.
* use [fabric8:create-routes](mavenFabric8CreateRoutes.html) to generate any missing [OpenShift Routes](http://docs.openshift.org/latest/admin_guide/router.html) for the current services using the maven property `fabric8.domain` or the environment variable `$KUBERNETES_DOMAIN` to specify to the DNS/host domain you wish to expose the services on.

### Default Configuration

The Kubernetes environment and authentication is defined by the [kubernetes-api environment variables](https://github.com/fabric8io/fabric8/tree/master/components/kubernetes-api#configuration). In particular:

* `KUBERNETES_SERVICE_HOST`:`KUBERNETES_SERVICE_PORT` / `KUBERNETES_MASTER` - the location of the kubernetes master
* `KUBERNETES_NAMESPACE` - the default namespace used on operations

#### Defaults from OpenShift

If no configuration is supplied through maven properties or environment variables, the `fabric8:create-env` goal will try to find the current login token and namespace by parsing the users `~/.config/openshift/config` file.

This means that if you use the [OpenShift](http://www.openshift.org/) command line tool `osc` you can login and change projects (namespaces in kubernetes speak) and those will be used by default by the `fabric8:create-env` goal. e.g.

```
osc login
osc project cheese
mvn fabric8:create-env
```
In the above, if there is no `KUBERNETES_NAMESPACE` environment variable or maven property called `fabric8.namespace` then the `fabric8:create-env` goal will look at the Kubernetes resources to the `cheese` namespace.

## Example

To setup your shell as if its running inside a Kubernetes environment container:

    mvn fabric8:create-env
    source target/env.sh

To specify an explicit namespace:

    mvn fabric8:create-env -Dfabric8.namespace=cheese

### Maven Properties

The following maven property values are used to configure the behaviour of the apply goal:

Parameter
Description

fabric8.namespace
Specifies the namespace (or OpenShift project name) to apply the kubernetes resources to. If not specified it will use the KUBERNETES_NAMESPACE environment variable or use the Defaults from OpenShift


text:
package com.amazonaws.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Documenting annotation to indicate a class is thread-safe and may be shared among multiple threads.
 *
 * @see NotThreadSafe
 */
@Documented
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.CLASS)
public @interface ThreadSafe {
}


text:
using VaultSharp.Core;
using VaultSharp.V1.Commons;
using VaultSharp.V1.SystemBackend.MFA.Duo;
using VaultSharp.V1.SystemBackend.MFA.Okta;
using VaultSharp.V1.SystemBackend.MFA.PingID;
using VaultSharp.V1.SystemBackend.MFA.TOTP;

namespace VaultSharp.V1.SystemBackend.MFA
{
    /// <summary>
    /// MFA provider.
    /// </summary>
    internal class MFAProvider : IMFA
    {
        public MFAProvider(Polymath polymath)
        {
            Duo = new DuoProvider(polymath);
            Okta = new OktaProvider(polymath);
            PingID = new PingIDProvider(polymath);
            TOTP = new TOTPProvider(polymath);
        }

        public IDuo Duo { get; }

        public IOkta Okta { get; }

        public IPingID PingID { get; }

        public ITOTP TOTP { get; }
    }
}


text:
<?php
/*
* Add-on Name: Stats Counter for Visual Composer
* Template : Design layout 05
*/
if(!function_exists('ult_price_generate_design05')) {
	function ult_price_generate_design05($atts,$content = null){
		$package_heading = $package_sub_heading = $package_price = $package_unit = $package_btn_text = $package_link = $package_featured = $color_bg_main = $color_txt_main = $color_bg_highlight = $color_txt_highlight = $color_scheme = $el_class = '';
		extract(shortcode_atts(array(
			"color_scheme" => "",
			"package_heading" => "",
			"package_sub_heading" => "",
			"package_price" => "",
			"package_unit" => "",
			"package_btn_text" => "",
			"package_link" => "",
			"package_featured" => "",
			"color_bg_main" => "",
			"color_txt_main" => "",
			"color_bg_highlight" => "",
			"color_txt_highlight" => "",
			"package_name_font_family" => "",
			"package_name_font_style" => "",
			"package_name_font_size" => "",
			"package_name_font_color" => "",
			"package_name_line_height" => "",
			"subheading_font_family" => "",
			"subheading_font_style" => "",
			"subheading_font_size" => "",
			"subheading_font_color" => "",
			"subheading_line_height" => "",
			"price_font_family" => "",
			"price_font_style" => "",
			"price_font_size" => "",
			"price_font_color" => "",
			"price_line_height" => "",
			"price_unit_font_family" => "",
			"price_unit_font_style" => "",
			"price_unit_font_size" => "",
			"price_unit_font_color" => "",
			"price_unit_line_height" => "",
			"features_font_family" => "",
			"features_font_style" => "",
			"features_font_size" => "",
			"features_font_color" => "",
			"features_line_height" => "",
			"button_font_family" => "",
			"button_font_style" => "",
			"button_font_size" => "",
			"button_font_color" => "",
			"button_line_height" => "",
			"el_class" => "",
		),$atts));
		$output = $link = $target = $featured = $featured_style = $normal_style = $dynamic_style = '';
		if($color_scheme == "custom"){
			if($color_bg_main !== ""){
				$normal_style .= 'background:'.$color_bg_main.';';
			}
			if($color_txt_main !== ""){
				$normal_style .= 'color:'.$color_txt_main.';';
			}
			if($color_bg_highlight!== ""){
				$featured_style .= 'background:'.$color_bg_highlight.';';
			}
			if($color_txt_highlight !== ""){
				$featured_style .= 'color:'.$color_txt_highlight.';';
			}
		}
		if($package_link !== ""){
			$link = vc_build_link($package_link);
			if(isset($link['target'])){
				$target = 'target="'.$link['target'].'"';
			} else {
				$target = '';
			}
			$link = $link['url'];
		} else {
			$link = "#";
		}
		if($package_featured !== ""){
			$featured = "ult_featured";
		}

		/* Typography */

		$package_name_inline = $sub_heading_inline = $price_inline = $price_unit_inline = $features_inline = $button_inline = '';

		// package name/title
		if($package_name_font_family != '')
		{
			$pkgfont_family = get_ultimate_font_family($package_name_font_family);
			$package_name_inline .= 'font-family:\''.$pkgfont_family.'\';';
		}

		$package_name_inline .= get_ultimate_font_style($package_name_font_style);

		if($package_name_font_size != '')
			$package_name_inline .= 'font-size:'.$package_name_font_size.'px;';

		if($package_name_font_color != '')
			$package_name_inline .= 'color:'.$package_name_font_color.';';

		if($package_name_line_height != '')
			$package_name_inline .= 'line-height:'.$package_name_line_height.'px;';

		// sub heading
		if($subheading_font_family != '')
		{
			$shfont_family = get_ultimate_font_family($subheading_font_family);
			$sub_heading_inline .= 'font-family:\''.$shfont_family.'\';';
		}

		$sub_heading_inline .= get_ultimate_font_style($subheading_font_style);

		if($subheading_font_size != '')
			$sub_heading_inline .= 'font-size:'.$subheading_font_size.'px;';

		if($subheading_font_color != '')
			$sub_heading_inline .= 'color:'.$subheading_font_color.';';

		if($subheading_line_height != '')
			$sub_heading_inline .= 'line-height:'.$subheading_line_height.'px;';

		// price
		if($price_font_family != '')
		{
			$pricefont_family = get_ultimate_font_family($price_font_family);
			$price_inline .= 'font-family:\''.$pricefont_family.'\';';
		}

		$price_inline .= get_ultimate_font_style($price_font_style);

		if($price_font_size != '')
			$price_inline .= 'font-size:'.$price_font_size.'px;';

		if($price_font_color != '')
			$price_inline .= 'color:'.$price_font_color.';';

		if($price_line_height != '')
			$price_inline .= 'line-height:'.$price_line_height.'px;';

		// price unit
		if($price_unit_font_family != '')
		{
			$price_unitfont_family = get_ultimate_font_family($price_unit_font_family);
			$price_unit_inline .= 'font-family:\''.$price_unitfont_family.'\';';
		}

		$price_unit_inline .= get_ultimate_font_style($price_unit_font_style);

		if($price_unit_font_size != '')
			$price_unit_inline .= 'font-size:'.$price_unit_font_size.'px;';

		if($price_unit_font_color != '')
			$price_unit_inline .= 'color:'.$price_unit_font_color.';';

		if($price_unit_line_height != '')
			$price_unit_inline .= 'line-height:'.$price_unit_line_height.'px;';

		// features
		if($features_font_family != '')
		{
			$featuresfont_family = get_ultimate_font_family($features_font_family);
			$features_inline .= 'font-family:\''.$featuresfont_family.'\';';
		}

		$features_inline .= get_ultimate_font_style($features_font_style);

		if($features_font_size != '')
			$features_inline .= 'font-size:'.$features_font_size.'px;';

		if($features_font_color != '')
			$features_inline .= 'color:'.$features_font_color.';';

		if($features_line_height != '')
			$features_inline .= 'line-height:'.$features_line_height.'px;';

		// button
		if($button_font_family != '')
		{
			$buttonfont_family = get_ultimate_font_family($button_font_family);
			$button_inline .= 'font-family:\''.$buttonfont_family.'\';';
		}

		$button_inline .= get_ultimate_font_style($button_font_style);

		if($button_font_size != '')
			$button_inline .= 'font-size:'.$button_font_size.'px;';

		if($button_font_color != '')
			$button_inline .= 'color:'.$button_font_color.';';

		if($button_line_height != '')
			$button_inline .= 'line-height:'.$button_line_height.'px;';

		/*$args = array(
			$package_name_font_family, $subheading_font_family, $price_font_family, $features_font_family, $button_font_family
		);
		enquque_ultimate_google_fonts($args);*/

		/* End Typography */

		$output .= '

';
			$output .= '

'.$package_heading.'
';
						if($package_sub_heading !== ''){
							$output .= '
'.$package_sub_heading.'
';
						}
			$output .= '
';
			$output .= '

									'.$package_price.'
									'.$package_unit.'

';
			$output .= '

							'.wpb_js_remove_wpautop(do_shortcode($content), true).'

';
			if($package_btn_text !== ""){
				$output .= '

							'.$package_btn_text.'

';
			}
			$output .= '

';
		return $output;
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:bind="http://schemas.android.com/apk/res-auto"
    >

    <data>

        <variable
            name="vm"
            type="com.popalay.cardme.presentation.screens.adddebt.AddDebtViewModel"
            />
    </data>

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        android:fitsSystemWindows="true"
        >

        <android.support.constraint.ConstraintLayout
            android:id="@+id/root"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            bind:exitByClick="@{true}"
            >

            <LinearLayout
                android:id="@+id/container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="@dimen/large"
                android:background="@drawable/bg_dialog"
                android:clickable="true"
                android:focusable="true"
                android:orientation="vertical"
                android:transitionName="@string/transition_add_debt"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                >

                <AutoCompleteTextView
                    android:id="@+id/input_to"
                    style="@style/Cardme.SingleLineText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/small"
                    android:background="@null"
                    android:hint="@string/who_lent"
                    android:imeOptions="actionNext"
                    android:inputType="textCapSentences|textAutoCorrect"
                    android:padding="@dimen/small"
                    android:text="@={vm.to}"
                    android:textStyle="bold"
                    bind:stringAdapter="@{vm.holderNames}"
                    />

                <View
                    android:layout_width="match_parent"
                    android:layout_height="1px"
                    android:background="@color/grey"
                    />

                <EditText
                    android:id="@+id/input_message"
                    style="@style/Cardme.MultiLineText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/small"
                    android:layout_marginTop="@dimen/small"
                    android:hint="@string/debt_information"
                    android:inputType="textCapSentences|textAutoCorrect|textMultiLine"
                    android:text="@={vm.message}"
                    />

            </LinearLayout>

            <android.support.design.widget.FloatingActionButton
                android:id="@+id/button_save"
                style="@style/Cardme.FloatingButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:enabled="@{vm.canSave}"
                android:scaleX="0"
                android:scaleY="0"
                android:src="@drawable/ic_done"
                app:backgroundTint="@color/selector_fab_bg"
                app:elevation="@dimen/normal_elevation"
                app:layout_constraintBottom_toBottomOf="@id/container"
                app:layout_constraintEnd_toEndOf="@id/container"
                app:layout_constraintHorizontal_bias="1"
                app:layout_constraintTop_toBottomOf="@id/container"
                bind:onClick="@{vm.addClick}"
                />

        </android.support.constraint.ConstraintLayout>

    </ScrollView>

</layout>


text:
import * as test from 'tape';
import * as R from 'ramda'
import { Loader } from './loader'
import * as util from 'gulp-util';

test('Loader.require should return Function from "stylus"',(assert)=>{
    const source = 'stylus'
    let tested = Loader.require(source)
    assert.ok(R.is(Function,tested),'tested is function')
    assert.equal(tested,require('gulp-stylus'),'return gulp-stylus')
    assert.end()
})
test('Loader.require should return Function from "^gulp-stylus"',(assert)=>{
    const source = '^gulp-stylus'
    let tested = Loader.require(source)
    assert.ok(R.is(Function,tested),'tested is function')
    assert.equal(tested,require('gulp-stylus'),'return gulp-stylus')
    assert.notEqual(tested,util.noop,'not return gulp-util.noop')
    assert.end()
})
test('Loader.require should return Function from "^!gulp-stylus"',(assert)=>{
    const source = '^!gulp-stylus'
    let tested = Loader.require(source)
    assert.ok(R.is(Function,tested),'tested is function')
    assert.notEqual(tested,require('gulp-stylus'),'not return gulp-stylus')
    assert.equal(tested,util.noop,'return gulp-util.noop')
    assert.end()
})
test('Loader.require should return Function from "stylus!"',(assert)=>{
    const source = 'stylus!'
    let tested = Loader.require(source)
    assert.ok(R.is(Function,tested),'tested is function')
    assert.equal(tested,util.noop,'return gulp-util.noop')
    assert.end()
})
export default {}


text:
<?php

namespace core\components\locales\commands;

use core\commands\ListCommand as CoreListCommand;

use libraries\service\QueryBuilderManager;

class ListCommand extends CoreListCommand
{
    /**
     * retrieves a multiple rows from the database
     *
     * @param array     URI params
     * @param array     POST params
     */
    public function execute($params = array(), $request = array()){

        $this->getQueryBuilder()->where($params);

        $result = $this->query($this->getQueryBuilder()->getQuery($this->entity, QueryBuilderManager::GET_ALL_ITEMS_QUERY, QueryBuilderManager::PARENT_AND_CHILD));
        $param = get_class($this->entity) . 's';

        $this->httpRequest->setAttribute($param, $result);

        return $this->httpRequest;
    }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Interface javax.xml.crypto.Data (Java Platform SE 8 )</title>
<meta name="date" content="2014-12-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
javax.xml.crypto.Data

Packages that use Data

Package
Description

javax.xml.crypto

Common classes for XML cryptography.

javax.xml.crypto.dsig

Classes for generating and validating XML digital
signatures.

javax.xml.crypto.dsig.keyinfo

Classes for parsing and processing KeyInfo elements and structures.

Uses of Data in javax.xml.crypto

Subinterfaces of Data in javax.xml.crypto

Modifier and Type
Interface and Description

interface
NodeSetData

An abstract representation of a Data type containing a
 node-set.

Classes in javax.xml.crypto that implement Data

Modifier and Type
Class and Description

class
OctetStreamData

A representation of a Data type containing an octet stream.

Methods in javax.xml.crypto that return Data

Modifier and Type
Method and Description

Data
URIDereferencer.dereference(URIReference uriReference,
           XMLCryptoContext context)

Dereferences the specified URIReference and returns the
 dereferenced data.

Uses of Data in javax.xml.crypto.dsig

Methods in javax.xml.crypto.dsig that return Data

Modifier and Type
Method and Description

Data
Reference.getDereferencedData()

Returns the dereferenced data, if
 reference caching
 is enabled.

Data
Transform.transform(Data data,
         XMLCryptoContext context)

Transforms the specified data using the underlying transform algorithm.

Data
Transform.transform(Data data,
         XMLCryptoContext context,
         OutputStream os)

Transforms the specified data using the underlying transform algorithm.

Methods in javax.xml.crypto.dsig with parameters of type Data

Modifier and Type
Method and Description

abstract Reference
XMLSignatureFactory.newReference(String uri,
            DigestMethod dm,
            List appliedTransforms,
            Data result,
            List transforms,
            String type,
            String id)

Creates a Reference with the specified parameters.

Data
Transform.transform(Data data,
         XMLCryptoContext context)

Transforms the specified data using the underlying transform algorithm.

Data
Transform.transform(Data data,
         XMLCryptoContext context,
         OutputStream os)

Transforms the specified data using the underlying transform algorithm.

Uses of Data in javax.xml.crypto.dsig.keyinfo

Methods in javax.xml.crypto.dsig.keyinfo that return Data

Modifier and Type
Method and Description

Data
RetrievalMethod.dereference(XMLCryptoContext context)

Dereferences the KeyInfo information referenced by this
 RetrievalMethod and applies the specified
 Transforms.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Java™ Platform
Standard Ed. 8

Prev

Next

Frames

No Frames

All Classes

 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2015, Oracle and/or its affiliates.  All rights reserved.


text:
package lithium.community.android.sdk.ui.components.adapters;

import android.app.Activity;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import lithium.community.android.sdk.manager.LiSDKManager;
import lithium.community.android.sdk.model.response.LiMessage;
import lithium.community.android.sdk.ui.components.R;
import lithium.community.android.sdk.ui.components.custom.ui.LiSoftKeyboardLsnrLinearLayout;
import lithium.community.android.sdk.ui.components.fragments.LiCreateMessageFragment;
import lithium.community.android.sdk.ui.components.utils.LiUIUtils;

/**
 * This adapter extends {@link RecyclerView.Adapter} that can display a form using which user can post a question on reply to a message
 */
public class LiCreateMessageAdapter extends RecyclerView.Adapter<LiViewHolder> {
    private static final int VIEW_TYPE_INLINE_REPLY = 0;
    private static final int VIEW_TYPE_AUTHORING = 1;
    private boolean canSelectABoard;
    private LiMessage liMessage;
    private int avatarDefaultIcon;
    private LiCreateMessageFragment liCreateMessageFragment;
    private Activity activity;
    private String htmlTemplate;
    public LiCreateMessageAdapter(Activity activity, boolean canSelectABoard,
                                  LiCreateMessageFragment liCreateMessageFragment) {
        this.canSelectABoard = canSelectABoard;
        this.liCreateMessageFragment = liCreateMessageFragment;
        this.activity = activity;
        TypedArray typedArrForBrowse = activity.getTheme().obtainStyledAttributes(
                new int[] { R.attr.li_theme_messageUserAvatarIcon });
        avatarDefaultIcon = typedArrForBrowse.getResourceId(0, -1);
        typedArrForBrowse.recycle();
        htmlTemplate = LiUIUtils.getRawString(activity, R.raw.message_template);
        this.liMessage = liCreateMessageFragment.selectedMessage;
    }

    @Override
    public int getItemViewType(int position) {
        if (position == VIEW_TYPE_INLINE_REPLY) {
            return VIEW_TYPE_INLINE_REPLY;
        }
        else {
            return VIEW_TYPE_AUTHORING;
        }
    }

    @Override
    public LiViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        if (viewType == VIEW_TYPE_INLINE_REPLY && !canSelectABoard) {
            View view = LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.li_conversation_row_view, parent, false);
            return new LiViewHolderConversationMessage(view, activity);
        }
        else {
            return new LiAuthoringViewHolder(LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.li_authoring_row, parent, false));
        }
    }

    /**
     * Sets up the Author details for the message row
     * @param item {@link LiMessage}
     * @param liViewHolder {@link LiViewHolderConversationMessage}
     */
    protected void setupAuthorDetails(LiMessage item, LiViewHolderConversationMessage liViewHolder) {
        String avatarImageUrl = null;
        String loginName = null;
        if (item.getAuthor() != null) {
            if (item.getAuthor().getLoginAsLiString() != null) {
                loginName = item.getAuthor().getLoginAsLiString().getValue();
            }

            if (item.getAuthor() != null
                    && item.getAuthor().getAvatar() != null) {
                avatarImageUrl = item.getAuthor().getAvatar().getMessage();
            }
        }

        if (avatarImageUrl != null) {
            Picasso.with(activity)
                    .load(avatarImageUrl)
                    .error(avatarDefaultIcon)
                    .into(liViewHolder.mUserImage);
        }
        liViewHolder.mUserName.setText(loginName);
    }

    @Override
    public void onBindViewHolder(LiViewHolder holder, int position) {
        if (position == VIEW_TYPE_INLINE_REPLY && !canSelectABoard) {
            LiViewHolderConversationMessage liViewHolderConversationMessage = (LiViewHolderConversationMessage) holder;
            setupAuthorDetails(liMessage, liViewHolderConversationMessage);
            liViewHolderConversationMessage.mPostTimeAgo.setText(
                    LiUIUtils.toDuration(activity, liMessage.getPostTime().getValue()));
            liViewHolderConversationMessage.mPostBody.loadDataWithBaseURL(
                    LiSDKManager.getInstance().getLiAppCredentials().getCommunityUri().toString(),
                    String.format(htmlTemplate, liMessage.getBody()), "text/html", "utf-8", null);
            liViewHolderConversationMessage.mLiPostActionsContainer.setVisibility(View.GONE);
            liViewHolderConversationMessage.mLiConversationActionsButton.setVisibility(View.INVISIBLE);
            liViewHolderConversationMessage.mPostSubjectTxt.setVisibility(View.GONE);
            liViewHolderConversationMessage.mPostStatusHeader.setVisibility(View.GONE);
        }
        else {
            final LiAuthoringViewHolder liAuthoringViewHolder = (LiAuthoringViewHolder) holder;
            liAuthoringViewHolder.askQuestionSubject.requestFocus();
            InputMethodManager imm = (InputMethodManager) activity.getSystemService(
                    Context.INPUT_METHOD_SERVICE
            );
            imm.toggleSoftInput(InputMethodManager.SHOW_FORCED,0);

            if (canSelectABoard) {
                liAuthoringViewHolder.inReplyToContainer.setVisibility(View.GONE);
                liAuthoringViewHolder.liAskQuestionSubjectContainer.setVisibility(View.VISIBLE);
                liAuthoringViewHolder.askQuestionSubject.addTextChangedListener(new TextWatcher() {
                    @Override
                    public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {

                    }

                    @Override
                    public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
                        //since the actual post form resides in the fragment, set the subject text back to fragment
                        liCreateMessageFragment.setAskQuestionSubject(String.valueOf(charSequence));
                    }

                    @Override
                    public void afterTextChanged(Editable editable) {
                    }
                });
            }
            else {
                liAuthoringViewHolder.inReplyToContainer.setVisibility(View.VISIBLE);
                String loginName = null;
                if (liMessage.getAuthor() != null) {
                    if (liMessage.getAuthor().getLoginAsLiString() != null) {
                        loginName = liMessage.getAuthor().getLoginAsLiString().getValue();
                    }
                }
                String inReplyTo = String.format(activity.getString(R.string.li_in_reply_to_text), loginName);
                liAuthoringViewHolder.inReplyToText.setText(inReplyTo);
                liAuthoringViewHolder.liAskQuestionSubjectContainer.setVisibility(View.GONE);
                liAuthoringViewHolder.inReplyToContainer.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        liCreateMessageFragment.focusInlineReply();
                    }
                });
            }

//            liAuthoringViewHolder.mView.addSoftKeyboardLsner(new LiSoftKeyboardLsnrLinearLayout.SoftKeyboardLsner() {
//                @Override
//                public void onSoftKeyboardShow() {}
//
//                @Override
//                public void onSoftKeyboardHide() {
//                    liCreateMessageFragment.focusAuthoring(liAuthoringViewHolder.getView());
//                }
//            });

            liAuthoringViewHolder.askQuestionBody.addTextChangedListener(new TextWatcher() {
                @Override
                public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
                }

                @Override
                public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
                    //since the actual post form resides in the fragment, set the subject text back to fragment
                    liCreateMessageFragment.setAskQuestionBody(String.valueOf(charSequence));
                }

                @Override
                public void afterTextChanged(Editable editable) {
                }
            });
            liAuthoringViewHolder.askQuestionBody.setOnTouchListener(new View.OnTouchListener() {
                public boolean onTouch(View v, MotionEvent event) {
                    if (v.getId() == R.id.li_ask_question_body) {
                        v.getParent().requestDisallowInterceptTouchEvent(true);
                        switch (event.getAction() & MotionEvent.ACTION_MASK){
                            case MotionEvent.ACTION_UP:
                                v.getParent().requestDisallowInterceptTouchEvent(false);
                                break;
                        }
                    }
                    return false;
                }
            });
        }
    }

    @Override
    public int getItemCount() {
        if (canSelectABoard) {
            return 1;
        }
        else {
            return 2;
        }
    }

    /**
     * ViewHolder for authoring layout
     */
    private class LiAuthoringViewHolder extends LiViewHolder {
        final LiSoftKeyboardLsnrLinearLayout mView;
        final EditText askQuestionBody;
        final EditText askQuestionSubject;
        final TextView inReplyToText;
        final RelativeLayout inReplyToContainer;
        final LinearLayout liAskQuestionSubjectContainer;
        LiAuthoringViewHolder(View view) {
            super(view);
            mView = (LiSoftKeyboardLsnrLinearLayout) view;
            askQuestionBody = (EditText) mView.findViewById(R.id.li_ask_question_body);
            askQuestionSubject = (EditText) mView.findViewById(R.id.li_ask_question_subject);
            inReplyToText = (TextView)mView.findViewById(R.id.in_reply_to_text);
            inReplyToContainer = (RelativeLayout) mView.findViewById(R.id.in_reply_to_container);
            liAskQuestionSubjectContainer = (LinearLayout) mView.findViewById(R.id.li_ask_question_subject_container);
        }
    }
}


text:
"""
Extra exception types that may be thrown in CoralNet methods.
These can be useful if:

- When catching exceptions that you've thrown, you don't want
to catch any exceptions that you didn't anticipate.  For example, perhaps
you were going to throw and catch a ValueError in some case, but you're
worried that you'll accidentally catch a ValueError from some other error
case that you didn't think of.

- You want the types of exceptions to better describe the nature of the
exception, for more self-documenting code.  (It's advised to not go
overboard and create tons of exception types, though.)
"""

class FilenameError(Exception):
    """
    When a filename isn't of the expected format; for example, perhaps 2
    or more underscore-separated tokens are expected, and there are no
    underscores in the filename.
    """
    pass

class FileContentError(Exception):
    """
    When file contents are not as expected; for example, a line in a text
    file doesn't have the expected number of words, or one of the words
    in the file is supposed to match something in the database but doesn't.

    Contrast this with IOError, which is for problems with finding a file,
    not being able to read its contents, etc.
    """
    pass

class DirectoryAccessError(Exception):
    """
    Raised when a directory is expected to exist, be readable, and/or be
    writable, and that turns out to not be the case.
    For example, a directory is specified in a settings file and
    we now want to create a file in that directory, but that directory
    doesn't exist.
    """
    pass

class TestfileDirectoryError(Exception):
    """
    When there's something wrong with a directory meant to hold
    temporary test-generated files:
    (1) The directory already has files in it before a test.
    (2) After the test, the directory has a file that was created
        before the test began. (Given (1), this is a serious corner
        case, but still, we do not want to take chances with file
        deletions.)
    """
    pass

class ValueObjectNotFoundError(Exception):
    """
    When a location value object is looked up by name in the database,
    and a value object can't be found.

    Basically a generic-ized error class for Value1.DoesNotExist,
    Value2.DoesNotExist, etc.
    """
    pass


text:
.popup-container {
    z-index: 6;
    display: grid;
    align-content: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 120rem;
    background-color: rgba(0, 0, 0, .5);
    opacity: 0;
}

.popup {
    display: grid;
    align-content: center;
    justify-content: center;
    grid-template-rows: 4rem 1fr auto;
    grid-template-columns: minmax(0, 1fr);
    padding: 1.5rem var(--gap) var(--gap) var(--gap);
    margin: var(--gap);
    min-height: 15rem;
    min-width: 40rem;
    max-width: 110rem;
    word-wrap: break-word;
    background-color: var(--foreground-color);
}

.popup-content {
    max-height: calc(100vh - 11rem);
    overflow-y: auto;
}

.popup-ok-button {
    justify-self: center;
    margin-top: var(--gap);
}

.radio-button-popup .popup-content div:not(:last-child) {
    margin-bottom: var(--small-gap);
}


text:
package org.springframework.security.oauth2.jwt;

import java.security.interfaces.RSAPublicKey;
import java.time.Instant;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
import javax.crypto.SecretKey;

import com.nimbusds.jose.Header;
import com.nimbusds.jose.JOSEException;
import com.nimbusds.jose.JWSAlgorithm;
import com.nimbusds.jose.JWSHeader;
import com.nimbusds.jose.jwk.JWK;
import com.nimbusds.jose.jwk.JWKMatcher;
import com.nimbusds.jose.jwk.JWKSelector;
import com.nimbusds.jose.jwk.source.JWKSecurityContextJWKSet;
import com.nimbusds.jose.jwk.source.JWKSource;
import com.nimbusds.jose.proc.BadJOSEException;
import com.nimbusds.jose.proc.JWKSecurityContext;
import com.nimbusds.jose.proc.JWSKeySelector;
import com.nimbusds.jose.proc.JWSVerificationKeySelector;
import com.nimbusds.jose.proc.SecurityContext;
import com.nimbusds.jwt.JWT;
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.JWTParser;
import com.nimbusds.jwt.PlainJWT;
import com.nimbusds.jwt.SignedJWT;
import com.nimbusds.jwt.proc.DefaultJWTProcessor;
import com.nimbusds.jwt.proc.JWTProcessor;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import org.springframework.core.convert.converter.Converter;
import org.springframework.security.oauth2.core.OAuth2TokenValidator;
import org.springframework.security.oauth2.core.OAuth2TokenValidatorResult;
import org.springframework.security.oauth2.jose.jws.JwsAlgorithm;
import org.springframework.security.oauth2.jose.jws.MacAlgorithm;
import org.springframework.security.oauth2.jose.jws.SignatureAlgorithm;
import org.springframework.util.Assert;
import org.springframework.web.reactive.function.client.WebClient;

/**
 * An implementation of a {@link ReactiveJwtDecoder} that "decodes" a
 * JSON Web Token (JWT) and additionally verifies it's digital signature if the JWT is a
 * JSON Web Signature (JWS).
 *
 *

 * NOTE: This implementation uses the Nimbus JOSE + JWT SDK internally.
 *
 * @author Rob Winch
 * @author Joe Grandja
 * @since 5.1
 * @see ReactiveJwtDecoder
 * @see JSON Web Token (JWT)
 * @see JSON Web Signature (JWS)
 * @see JSON Web Key (JWK)
 * @see Nimbus JOSE + JWT SDK
 */
public final class NimbusReactiveJwtDecoder implements ReactiveJwtDecoder {
	private final Converter<JWT, Mono<JWTClaimsSet>> jwtProcessor;

	private OAuth2TokenValidator<Jwt> jwtValidator = JwtValidators.createDefault();
	private Converter<Map<String, Object>, Map<String, Object>> claimSetConverter =
			MappedJwtClaimSetConverter.withDefaults(Collections.emptyMap());

	/**
	 * Constructs a {@code NimbusReactiveJwtDecoder} using the provided parameters.
	 *
	 * @param jwkSetUrl the JSON Web Key (JWK) Set {@code URL}
	 */
	public NimbusReactiveJwtDecoder(String jwkSetUrl) {
		this(withJwkSetUri(jwkSetUrl).processor());
	}

	/**
	 * Constructs a {@code NimbusReactiveJwtDecoder} using the provided parameters.
	 *
	 * @param publicKey the {@code RSAPublicKey} used to verify the signature
	 * @since 5.2
	 */
	public NimbusReactiveJwtDecoder(RSAPublicKey publicKey) {
		this(withPublicKey(publicKey).processor());
	}

	/**
	 * Constructs a {@code NimbusReactiveJwtDecoder} using the provided parameters.
	 *
	 * @param jwtProcessor the {@link Converter} used to process and verify the signed Jwt and return the Jwt Claim Set
	 * @since 5.2
	 */
	public NimbusReactiveJwtDecoder(Converter<JWT, Mono<JWTClaimsSet>> jwtProcessor) {
		this.jwtProcessor = jwtProcessor;
	}

	/**
	 * Use the provided {@link OAuth2TokenValidator} to validate incoming {@link Jwt}s.
	 *
	 * @param jwtValidator the {@link OAuth2TokenValidator} to use
	 */
	public void setJwtValidator(OAuth2TokenValidator<Jwt> jwtValidator) {
		Assert.notNull(jwtValidator, "jwtValidator cannot be null");
		this.jwtValidator = jwtValidator;
	}

	/**
	 * Use the following {@link Converter} for manipulating the JWT's claim set
	 *
	 * @param claimSetConverter the {@link Converter} to use
	 */
	public void setClaimSetConverter(Converter<Map<String, Object>, Map<String, Object>> claimSetConverter) {
		Assert.notNull(claimSetConverter, "claimSetConverter cannot be null");
		this.claimSetConverter = claimSetConverter;
	}

	@Override
	public Mono<Jwt> decode(String token) throws JwtException {
		JWT jwt = parse(token);
		if (jwt instanceof PlainJWT) {
			throw new JwtException("Unsupported algorithm of " + jwt.getHeader().getAlgorithm());
		}
		return this.decode(jwt);
	}

	private JWT parse(String token) {
		try {
			return JWTParser.parse(token);
		} catch (Exception ex) {
			throw new JwtException("An error occurred while attempting to decode the Jwt: " + ex.getMessage(), ex);
		}
	}

	private Mono<Jwt> decode(JWT parsedToken) {
		try {
			return this.jwtProcessor.convert(parsedToken)
				.map(set -> createJwt(parsedToken, set))
				.map(this::validateJwt)
				.onErrorMap(e -> !(e instanceof IllegalStateException) && !(e instanceof JwtException), e -> new JwtException("An error occurred while attempting to decode the Jwt: ", e));
		} catch (RuntimeException ex) {
			throw new JwtException("An error occurred while attempting to decode the Jwt: " + ex.getMessage(), ex);
		}
	}

	private Jwt createJwt(JWT parsedJwt, JWTClaimsSet jwtClaimsSet) {
		Map<String, Object> headers = new LinkedHashMap<>(parsedJwt.getHeader().toJSONObject());
		Map<String, Object> claims = this.claimSetConverter.convert(jwtClaimsSet.getClaims());

		Instant expiresAt = (Instant) claims.get(JwtClaimNames.EXP);
		Instant issuedAt = (Instant) claims.get(JwtClaimNames.IAT);
		return new Jwt(parsedJwt.getParsedString(), issuedAt, expiresAt, headers, claims);
	}

	private Jwt validateJwt(Jwt jwt) {
		OAuth2TokenValidatorResult result = this.jwtValidator.validate(jwt);

		if ( result.hasErrors() ) {
			String message = result.getErrors().iterator().next().getDescription();
			throw new JwtValidationException(message, result.getErrors());
		}

		return jwt;
	}

	/**
	 * Use the given
	 * JWK Set uri to validate JWTs.
	 *
	 * @param jwkSetUri the JWK Set uri to use
	 * @return a {@link JwkSetUriReactiveJwtDecoderBuilder} for further configurations
	 *
	 * @since 5.2
	 */
	public static JwkSetUriReactiveJwtDecoderBuilder withJwkSetUri(String jwkSetUri) {
		return new JwkSetUriReactiveJwtDecoderBuilder(jwkSetUri);
	}

	/**
	 * Use the given public key to validate JWTs
	 *
	 * @param key the public key to use
	 * @return a {@link PublicKeyReactiveJwtDecoderBuilder} for further configurations
	 *
	 * @since 5.2
	 */
	public static PublicKeyReactiveJwtDecoderBuilder withPublicKey(RSAPublicKey key) {
		return new PublicKeyReactiveJwtDecoderBuilder(key);
	}

	/**
	 * Use the given {@code SecretKey} to validate the MAC on a JSON Web Signature (JWS).
	 *
	 * @param secretKey the {@code SecretKey} used to validate the MAC
	 * @return a {@link SecretKeyReactiveJwtDecoderBuilder} for further configurations
	 *
	 * @since 5.2
	 */
	public static SecretKeyReactiveJwtDecoderBuilder withSecretKey(SecretKey secretKey) {
		return new SecretKeyReactiveJwtDecoderBuilder(secretKey);
	}

	/**
	 * Use the given {@link Function} to validate JWTs
	 *
	 * @param source the {@link Function}
	 * @return a {@link JwkSourceReactiveJwtDecoderBuilder} for further configurations
	 *
	 * @since 5.2
	 */
	public static JwkSourceReactiveJwtDecoderBuilder withJwkSource(Function<SignedJWT, Flux<JWK>> source) {
		return new JwkSourceReactiveJwtDecoderBuilder(source);
	}

	/**
	 * A builder for creating {@link NimbusReactiveJwtDecoder} instances based on a
	 * JWK Set uri.
	 *
	 * @since 5.2
	 */
	public static final class JwkSetUriReactiveJwtDecoderBuilder {
		private final String jwkSetUri;
		private Set<SignatureAlgorithm> signatureAlgorithms = new HashSet<>();
		private WebClient webClient = WebClient.create();

		private JwkSetUriReactiveJwtDecoderBuilder(String jwkSetUri) {
			Assert.hasText(jwkSetUri, "jwkSetUri cannot be empty");
			this.jwkSetUri = jwkSetUri;
		}

		/**
		 * Append the given signing
		 * algorithm
		 * to the set of algorithms to use.
		 *
		 * @param signatureAlgorithm the algorithm to use
		 * @return a {@link JwkSetUriReactiveJwtDecoderBuilder} for further configurations
		 */
		public JwkSetUriReactiveJwtDecoderBuilder jwsAlgorithm(SignatureAlgorithm signatureAlgorithm) {
			Assert.notNull(signatureAlgorithm, "sig cannot be null");
			this.signatureAlgorithms.add(signatureAlgorithm);
			return this;
		}

		/**
		 * Configure the list of
		 * algorithms
		 * to use with the given {@link Consumer}.
		 *
		 * @param signatureAlgorithmsConsumer a {@link Consumer} for further configuring the algorithm list
		 * @return a {@link JwkSetUriReactiveJwtDecoderBuilder} for further configurations
		 */
		public JwkSetUriReactiveJwtDecoderBuilder jwsAlgorithms(Consumer<Set<SignatureAlgorithm>> signatureAlgorithmsConsumer) {
			Assert.notNull(signatureAlgorithmsConsumer, "signatureAlgorithmsConsumer cannot be null");
			signatureAlgorithmsConsumer.accept(this.signatureAlgorithms);
			return this;
		}

		/**
		 * Use the given {@link WebClient} to coordinate with the authorization servers indicated in the
		 * JWK Set uri
		 * as well as the
		 * Issuer.
		 *
		 * @param webClient
		 * @return a {@link JwkSetUriReactiveJwtDecoderBuilder} for further configurations
		 */
		public JwkSetUriReactiveJwtDecoderBuilder webClient(WebClient webClient) {
			Assert.notNull(webClient, "webClient cannot be null");
			this.webClient = webClient;
			return this;
		}

		/**
		 * Build the configured {@link NimbusReactiveJwtDecoder}.
		 *
		 * @return the configured {@link NimbusReactiveJwtDecoder}
		 */
		public NimbusReactiveJwtDecoder build() {
			return new NimbusReactiveJwtDecoder(processor());
		}

		JWSKeySelector<JWKSecurityContext> jwsKeySelector(JWKSource<JWKSecurityContext> jwkSource) {
			if (this.signatureAlgorithms.isEmpty()) {
				return new JWSVerificationKeySelector<>(JWSAlgorithm.RS256, jwkSource);
			} else if (this.signatureAlgorithms.size() == 1) {
				JWSAlgorithm jwsAlgorithm = JWSAlgorithm.parse(this.signatureAlgorithms.iterator().next().getName());
				return new JWSVerificationKeySelector<>(jwsAlgorithm, jwkSource);
			} else {
				Map<JWSAlgorithm, JWSKeySelector<JWKSecurityContext>> jwsKeySelectors = new HashMap<>();
				for (SignatureAlgorithm signatureAlgorithm : this.signatureAlgorithms) {
					JWSAlgorithm jwsAlg = JWSAlgorithm.parse(signatureAlgorithm.getName());
					jwsKeySelectors.put(jwsAlg, new JWSVerificationKeySelector<>(jwsAlg, jwkSource));
				}
				return new JWSAlgorithmMapJWSKeySelector<>(jwsKeySelectors);
			}
		}

		Converter<JWT, Mono<JWTClaimsSet>> processor() {
			JWKSecurityContextJWKSet jwkSource = new JWKSecurityContextJWKSet();
			DefaultJWTProcessor<JWKSecurityContext> jwtProcessor = new DefaultJWTProcessor<>();
			JWSKeySelector<JWKSecurityContext> jwsKeySelector = jwsKeySelector(jwkSource);
			jwtProcessor.setJWSKeySelector(jwsKeySelector);
			jwtProcessor.setJWTClaimsSetVerifier((claims, context) -> {});

			ReactiveRemoteJWKSource source = new ReactiveRemoteJWKSource(this.jwkSetUri);
			source.setWebClient(this.webClient);

			Set<JWSAlgorithm> expectedJwsAlgorithms = getExpectedJwsAlgorithms(jwsKeySelector);
			return jwt -> {
				JWKSelector selector = createSelector(expectedJwsAlgorithms, jwt.getHeader());
				return source.get(selector)
						.onErrorMap(e -> new IllegalStateException("Could not obtain the keys", e))
						.map(jwkList -> createClaimsSet(jwtProcessor, jwt, new JWKSecurityContext(jwkList)));
			};
		}

		private Set<JWSAlgorithm> getExpectedJwsAlgorithms(JWSKeySelector<?> jwsKeySelector) {
			if (jwsKeySelector instanceof JWSVerificationKeySelector) {
				return Collections.singleton(((JWSVerificationKeySelector<?>) jwsKeySelector).getExpectedJWSAlgorithm());
			}
			if (jwsKeySelector instanceof JWSAlgorithmMapJWSKeySelector) {
				return ((JWSAlgorithmMapJWSKeySelector<?>) jwsKeySelector).getExpectedJWSAlgorithms();
			}
			throw new IllegalArgumentException("Unsupported key selector type " + jwsKeySelector.getClass());
		}

		private JWKSelector createSelector(Set<JWSAlgorithm> expectedJwsAlgorithms, Header header) {
			if (!expectedJwsAlgorithms.contains(header.getAlgorithm())) {
				throw new JwtException("Unsupported algorithm of " + header.getAlgorithm());
			}

			return new JWKSelector(JWKMatcher.forJWSHeader((JWSHeader) header));
		}
	}

	/**
	 * A builder for creating {@link NimbusReactiveJwtDecoder} instances based on a public key.
	 *
	 * @since 5.2
	 */
	public static final class PublicKeyReactiveJwtDecoderBuilder {
		private final RSAPublicKey key;
		private JWSAlgorithm jwsAlgorithm;

		private PublicKeyReactiveJwtDecoderBuilder(RSAPublicKey key) {
			Assert.notNull(key, "key cannot be null");
			this.key = key;
			this.jwsAlgorithm = JWSAlgorithm.RS256;
		}

		/**
		 * Use the given signing
		 * algorithm.
		 * The value should be one of
		 * RS256, RS384, or RS512.
		 *
		 * @param signatureAlgorithm the algorithm to use
		 * @return a {@link PublicKeyReactiveJwtDecoderBuilder} for further configurations
		 */
		public PublicKeyReactiveJwtDecoderBuilder signatureAlgorithm(SignatureAlgorithm signatureAlgorithm) {
			Assert.notNull(signatureAlgorithm, "signatureAlgorithm cannot be null");
			this.jwsAlgorithm = JWSAlgorithm.parse(signatureAlgorithm.getName());
			return this;
		}

		/**
		 * Build the configured {@link NimbusReactiveJwtDecoder}.
		 *
		 * @return the configured {@link NimbusReactiveJwtDecoder}
		 */
		public NimbusReactiveJwtDecoder build() {
			return new NimbusReactiveJwtDecoder(processor());
		}

		Converter<JWT, Mono<JWTClaimsSet>> processor() {
			if (!JWSAlgorithm.Family.RSA.contains(this.jwsAlgorithm)) {
				throw new IllegalStateException("The provided key is of type RSA; " +
						"however the signature algorithm is of some other type: " +
						this.jwsAlgorithm + ". Please indicate one of RS256, RS384, or RS512.");
			}

			JWSKeySelector<SecurityContext> jwsKeySelector =
					new SingleKeyJWSKeySelector<>(this.jwsAlgorithm, this.key);
			DefaultJWTProcessor<SecurityContext> jwtProcessor = new DefaultJWTProcessor<>();
			jwtProcessor.setJWSKeySelector(jwsKeySelector);

			// Spring Security validates the claim set independent from Nimbus
			jwtProcessor.setJWTClaimsSetVerifier((claims, context) -> { });

			return jwt -> Mono.just(createClaimsSet(jwtProcessor, jwt, null));
		}
	}

	/**
	 * A builder for creating {@link NimbusReactiveJwtDecoder} instances based on a {@code SecretKey}.
	 *
	 * @since 5.2
	 */
	public static final class SecretKeyReactiveJwtDecoderBuilder {
		private final SecretKey secretKey;
		private JWSAlgorithm jwsAlgorithm = JWSAlgorithm.HS256;

		private SecretKeyReactiveJwtDecoderBuilder(SecretKey secretKey) {
			Assert.notNull(secretKey, "secretKey cannot be null");
			this.secretKey = secretKey;
		}

		/**
		 * Use the given
		 * algorithm
		 * when generating the MAC.
		 *
		 * The value should be one of
		 * HS256, HS384 or HS512.
		 *
		 * @param macAlgorithm the MAC algorithm to use
		 * @return a {@link SecretKeyReactiveJwtDecoderBuilder} for further configurations
		 */
		public SecretKeyReactiveJwtDecoderBuilder macAlgorithm(MacAlgorithm macAlgorithm) {
			Assert.notNull(macAlgorithm, "macAlgorithm cannot be null");
			this.jwsAlgorithm = JWSAlgorithm.parse(macAlgorithm.getName());
			return this;
		}

		/**
		 * Build the configured {@link NimbusReactiveJwtDecoder}.
		 *
		 * @return the configured {@link NimbusReactiveJwtDecoder}
		 */
		public NimbusReactiveJwtDecoder build() {
			return new NimbusReactiveJwtDecoder(processor());
		}

		Converter<JWT, Mono<JWTClaimsSet>> processor() {
			JWSKeySelector<SecurityContext> jwsKeySelector =
					new SingleKeyJWSKeySelector<>(this.jwsAlgorithm, this.secretKey);
			DefaultJWTProcessor<SecurityContext> jwtProcessor = new DefaultJWTProcessor<>();
			jwtProcessor.setJWSKeySelector(jwsKeySelector);

			// Spring Security validates the claim set independent from Nimbus
			jwtProcessor.setJWTClaimsSetVerifier((claims, context) -> { });

			return jwt -> Mono.just(createClaimsSet(jwtProcessor, jwt, null));
		}
	}

	/**
	 * A builder for creating {@link NimbusReactiveJwtDecoder} instances.
	 *
	 * @since 5.2
	 */
	public static final class JwkSourceReactiveJwtDecoderBuilder {
		private final Function<SignedJWT, Flux<JWK>> jwkSource;
		private JWSAlgorithm jwsAlgorithm = JWSAlgorithm.RS256;

		private JwkSourceReactiveJwtDecoderBuilder(Function<SignedJWT, Flux<JWK>> jwkSource) {
			Assert.notNull(jwkSource, "jwkSource cannot be null");
			this.jwkSource = jwkSource;
		}

		/**
		 * Use the given signing
		 * algorithm.
		 *
		 * @param jwsAlgorithm the algorithm to use
		 * @return a {@link JwkSourceReactiveJwtDecoderBuilder} for further configurations
		 */
		public JwkSourceReactiveJwtDecoderBuilder jwsAlgorithm(JwsAlgorithm jwsAlgorithm) {
			Assert.notNull(jwsAlgorithm, "jwsAlgorithm cannot be null");
			this.jwsAlgorithm = JWSAlgorithm.parse(jwsAlgorithm.getName());
			return this;
		}

		/**
		 * Build the configured {@link NimbusReactiveJwtDecoder}.
		 *
		 * @return the configured {@link NimbusReactiveJwtDecoder}
		 */
		public NimbusReactiveJwtDecoder build() {
			return new NimbusReactiveJwtDecoder(processor());
		}

		Converter<JWT, Mono<JWTClaimsSet>> processor() {
			JWKSecurityContextJWKSet jwkSource = new JWKSecurityContextJWKSet();
			JWSKeySelector<JWKSecurityContext> jwsKeySelector =
					new JWSVerificationKeySelector<>(this.jwsAlgorithm, jwkSource);
			DefaultJWTProcessor<JWKSecurityContext> jwtProcessor = new DefaultJWTProcessor<>();
			jwtProcessor.setJWSKeySelector(jwsKeySelector);
			jwtProcessor.setJWTClaimsSetVerifier((claims, context) -> {});

			return jwt -> {
				if (jwt instanceof SignedJWT) {
					return this.jwkSource.apply((SignedJWT) jwt)
							.onErrorMap(e -> new IllegalStateException("Could not obtain the keys", e))
							.collectList()
							.map(jwks -> createClaimsSet(jwtProcessor, jwt, new JWKSecurityContext(jwks)));
				}
				throw new JwtException("Unsupported algorithm of " + jwt.getHeader().getAlgorithm());
			};
		}
	}

	private static <C extends SecurityContext> JWTClaimsSet createClaimsSet(JWTProcessor<C> jwtProcessor,
																			JWT parsedToken, C context) {
		try {
			return jwtProcessor.process(parsedToken, context);
		}
		catch (BadJOSEException | JOSEException e) {
			throw new JwtException("Failed to validate the token", e);
		}
	}
}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.MemoryMappedFiles;

namespace CompressingWebPages
{
	class ScanningWebPages : IDisposable
	{
		private MemoryMappedFile mmf;
		private MemoryMappedViewAccessor accessor;
		private int accessorIndex;
		private List<long> posChunkWebPages;
		public byte[] Container;
		public byte[] PermutedContainer;

		#region CONSTRUCTOR
		public ScanningWebPages(String nameFile, List<long> posChunkWebPages)
		{
			this.mmf = MemoryMappedFile.CreateFromFile(nameFile, FileMode.Open);
			this.accessor = this.mmf.CreateViewAccessor(posChunkWebPages[0], posChunkWebPages[1] - posChunkWebPages[0] + 1);
			this.accessorIndex = 0;
			this.posChunkWebPages = posChunkWebPages;
			this.Container = new byte[1];
			this.PermutedContainer = new byte[1];
		}
		#endregion

		#region WebPageContent
		public void WebPageContent(int i, long start, int length, int marginSpace, int num = 1)
		{
			if (length > this.Container.Length)
			{
				this.Container = new byte[length + marginSpace];
				this.PermutedContainer = new byte[length + marginSpace];
			}

			int q = i / GlobalVars.SIZE_CHUNK_WEBPAGES;
			int r = i % GlobalVars.SIZE_CHUNK_WEBPAGES;
			if (r + num > GlobalVars.SIZE_CHUNK_WEBPAGES)
				throw new InvalidOperationException();

			if (q != this.accessorIndex)
			{
				this.accessor.Dispose();
				this.accessor = this.mmf.CreateViewAccessor(posChunkWebPages[q], posChunkWebPages[q + 1] - posChunkWebPages[q] + 1);
				this.accessorIndex = q;
			}

			this.accessor.ReadArray(start - posChunkWebPages[q], this.Container, 0, length);
		}
		#endregion

		#region Dispose
		public void Dispose()
		{
			this.Container = null;
			this.PermutedContainer = null;
			this.accessor.Dispose();
			this.mmf.Dispose();
		}
		#endregion
	}
}


text:
package com.hazelcast.simulator.tests.icache;

import com.hazelcast.config.CacheConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IList;
import com.hazelcast.logging.ILogger;
import com.hazelcast.logging.Logger;
import com.hazelcast.simulator.test.TestContext;
import com.hazelcast.simulator.test.annotations.Run;
import com.hazelcast.simulator.test.annotations.Setup;
import com.hazelcast.simulator.test.annotations.Verify;

import javax.cache.CacheException;
import javax.cache.CacheManager;
import java.io.Serializable;

import static com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager;
import static org.junit.Assert.assertEquals;

/**
 * In this test we concurrently call createCache. From multi clients/members we expect no exceptions
 * in the setup phase of this test. We count the number of {@link CacheException} thrown when creating the cache
 * from multi members and clients, and at verification we assert that no exceptions where thrown.
 */
public class ConcurrentCreateICacheTest {

    private static final ILogger LOGGER = Logger.getLogger(ConcurrentCreateICacheTest.class);

    // properties
    public String baseName = ConcurrentCreateICacheTest.class.getSimpleName();

    private IList<Counter> counterList;

    @Setup
    public void setup(TestContext testContext) {
        HazelcastInstance hazelcastInstance = testContext.getTargetInstance();
        counterList = hazelcastInstance.getList(baseName);

        CacheConfig config = new CacheConfig();
        config.setName(baseName);

        Counter counter = new Counter();
        try {
            CacheManager cacheManager = createCacheManager(hazelcastInstance);
            cacheManager.createCache(baseName, config);
            counter.create++;
        } catch (CacheException e) {
            LOGGER.severe(baseName + ": createCache exception " + e, e);
            counter.createException++;
        }
        counterList.add(counter);
    }

    @Verify(global = true)
    public void verify() {
        Counter total = new Counter();
        for (Counter counter : counterList) {
            total.add(counter);
        }
        LOGGER.info(baseName + ": " + total + " from " + counterList.size() + " worker threads");

        assertEquals(baseName + ": We expect 0 CacheException from multi node create cache calls", 0, total.createException);
    }

    @Run
    public void run() {
    }

    private static class Counter implements Serializable {

        public long create = 0;
        public long createException = 0;

        public void add(Counter counter) {
            create += counter.create;
            createException += counter.createException;
        }

        @Override
        public String toString() {
            return "Counter{"
                    + " create=" + create
                    + ", createException=" + createException
                    + '}';
        }
    }
}


text:
from __future__ import division

from vistrails.core.configuration import get_vistrails_persistent_configuration, \
    get_vistrails_configuration
from vistrails.gui.open_db_window import QOpenDBWindow, QConnectionDBSetupWindow
from vistrails.core.db.locator import DBLocator, FileLocator
from vistrails.db import VistrailsDBException
from vistrails.core import debug
import vistrails.db.services.io
from PyQt4 import QtGui, QtCore
import vistrails.core.system
import os

##############################################################################
# DB dialogs

def get_load_db_locator_from_gui(parent, obj_type):
    config, obj_id, obj_name = QOpenDBWindow.getOpenDBObject(obj_type)
    if config == {} or obj_id == -1:
        return None
    return DBLocator(config['host'],
                     config['port'],
                     config['db'],
                     config['user'],
                     config['passwd'],
                     obj_name,
                     obj_id=obj_id,
                     obj_type=obj_type,
                     connection_id=config.get('id', None))

def get_save_db_locator_from_gui(parent, obj_type, locator=None):
    config, name = QOpenDBWindow.getSaveDBObject(obj_type)
    if config == {} or name == '':
        return None
    return DBLocator(config['host'],
                     config['port'],
                     config['db'],
                     config['user'],
                     config['passwd'],
                     name,
                     obj_id=None,
                     obj_type=obj_type,
                     connection_id=config.get('id', None))

##############################################################################

def get_db_connection_from_gui(parent, id, name, host, port, user, passwd,
                               database):
    def show_dialog(parent, id, name, host, port, user,
                    passwd, databaseb, create):
        dialog = QConnectionDBSetupWindow(parent, id, name, host, port, user,
                                          passwd, database, create)
        config = None
        if dialog.exec_() == QtGui.QDialog.Accepted:
            config = {'host': str(dialog.hostEdt.text()),
                      'port': int(dialog.portEdt.value()),
                      'user': unicode(dialog.userEdt.text()),
                      'passwd': unicode(dialog.passwdEdt.text()),
                      'db': str(dialog.databaseEdt.text())
                      }
            try:
                vistrails.db.services.io.test_db_connection(config)
                config['succeeded'] = True
                config['name'] = str(dialog.nameEdt.text())
                config['id'] = dialog.id
            except VistrailsDBException, e:
                debug.critical('VisTrails DB Exception',  e)
                config['succeeded'] = False
        return config
    #check if the information is already there
    dbwindow = QOpenDBWindow.getInstance()

    config = dbwindow.connectionList.findConnectionInfo(host,port,database)

    if config:
        testconfig = dict(config)
        del testconfig['id']
        del testconfig['name']
        try:
            vistrails.db.services.io.test_db_connection(testconfig)
            config['succeeded'] = True
        except VistrailsDBException, e:
            config = show_dialog(parent, config['id'],
                                 config['name'], host, port, config['user'],
                                 passwd, database, create = False)

    elif config is None:
        config = show_dialog(parent, -1,"",
                             host, port, user, passwd,
                             database, create = True)
        if config['succeeded'] == True:
            #add to connection list
            dbwindow.connectionList.setConnectionInfo(**config)
    return config

##############################################################################
# File dialogs

suffix_map = {'vistrail': ['.vt', '.xml', '.vtl'],
              'workflow': ['.xml'],
              'log': ['.xml'],
              'registry': ['.xml'],
              'opm_graph': ['.xml'],
              'prov_document': ['.xml']
              }

def get_load_file_locator_from_gui(parent, obj_type):
    suffixes = "*" + " *".join(suffix_map[obj_type])
    fileName = QtGui.QFileDialog.getOpenFileName(
        parent,
        "Open %s..." % obj_type.capitalize(),
        vistrails.core.system.vistrails_file_directory(),
        "VisTrails files (%s)\nOther files (*)" % suffixes)
    if not fileName:
        return None
    filename = os.path.abspath(str(QtCore.QFile.encodeName(fileName)))
    dirName = os.path.dirname(filename)
    vistrails.core.system.set_vistrails_file_directory(dirName)
    return FileLocator(filename)

def get_save_file_locator_from_gui(parent, obj_type, locator=None):
    # Ignore current locator for now
    # In the future, use locator to guide GUI for better starting directory

    suffixes = "*" + " *".join(suffix_map[obj_type])
    fileName = QtGui.QFileDialog.getSaveFileName(
        parent,
        "Save Vistrail...",
        vistrails.core.system.vistrails_file_directory(),
        filter="VisTrails files (%s)" % suffixes, # filetypes.strip()
        options=QtGui.QFileDialog.DontConfirmOverwrite)
    if not fileName:
        return None
    f = str(QtCore.QFile.encodeName(fileName))

    # check for proper suffix
    found_suffix = False
    for suffix in suffix_map[obj_type]:
        if f.endswith(suffix):
            found_suffix = True
            break
    if not found_suffix:
        if obj_type == 'vistrail':
            f += get_vistrails_configuration().defaultFileType
        else:
            f += suffix_map[obj_type][0]

    if os.path.isfile(f):
        msg = QtGui.QMessageBox(QtGui.QMessageBox.Question,
                                "VisTrails",
                                "File exists. Overwrite?",
                                (QtGui.QMessageBox.Yes |
                                 QtGui.QMessageBox.No),
                                parent)
        if msg.exec_() == QtGui.QMessageBox.No:
            return None
    dirName = os.path.dirname(f)
    vistrails.core.system.set_vistrails_file_directory(dirName)
    return FileLocator(f)

def get_autosave_prompt(parent):
    """ get_autosave_prompt(parent: QWidget) -> bool

    """
    result = QtGui.QMessageBox.question(parent,
                                        "AutoSave",
                                        "Autosave data has been found.\nDo you want to open autosave data?",
                                        QtGui.QMessageBox.Open,
                                        QtGui.QMessageBox.Ignore)
    return result == QtGui.QMessageBox.Open

def ask_to_overwrite_file(parent=None, obj_type='vistrail'):
    overwrite = True
    fname = None
    msg = QtGui.QMessageBox(QtGui.QMessageBox.Question,
                            "VisTrails",
                            "File exists and contains changes. Overwrite?",
                            (QtGui.QMessageBox.Yes | QtGui.QMessageBox.No),
                            parent)
    if msg.exec_() == QtGui.QMessageBox.No:
        overwrite = False
        locator = get_save_file_locator_from_gui(parent, obj_type)
        if locator:
            fname = locator._name
    return (overwrite, fname)


text:
package com.intellij.internal.statistic.eventLog.config;

import com.intellij.internal.statistic.eventLog.EventLogFile;
import com.intellij.internal.statistic.eventLog.FilesToSendProvider;
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.util.List;
import java.util.stream.Collectors;

public class EventLogFileListProvider implements FilesToSendProvider {
  private final List<EventLogFile> myFiles;

  public EventLogFileListProvider(@NotNull List<String> paths) {
    myFiles = paths.stream().
      map(path -> new File(path)).
      filter(file -> file.exists()).
      map(file -> new EventLogFile(file)).
      collect(Collectors.toList());
  }

  @NotNull
  @Override
  public List<EventLogFile> getFilesToSend() {
    return myFiles;
  }
}


text:
package utils

import (
	"net/url"
	"strings"
)

func GetDiffFormValues(formValues url.Values, structValues map[string]interface{}) map[string]interface{} {
	Log.Debug("[DIFF}: struct: %v", structValues)
	vals := make(map[string]interface{})
	for key := range formValues {
		Log.Debug("[DIFF]: key: %v", key)
		val, exists := structValues[strings.Title(key)]
		if exists {
			Log.Debug("[DIFF]: val: %v", val)
			vals[key] = val
		}
	}

	return vals
}


text: This is an example for a Maven Site with additional head content.


text:
FROM itzg/gvm

MAINTAINER itzg

RUN ["/run", "install", "springboot"]

ADD run /run
ENTRYPOINT ["/run"]

VOLUME ["/home/spring"]
ADD app.groovy /home/spring/app.groovy
EXPOSE 8080

WORKDIR /home/spring

CMD ["run", "app.groovy"]


text:
"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

/* eslint-disable no-redeclare */
// $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441
var isFinite = Number.isFinite || function (value) {
  return typeof value === 'number' && isFinite(value);
};

var _default = isFinite;
exports.default = _default;


text:
require 'em_test_helper'

class TestPure < Test::Unit::TestCase

  def setup
    @port = next_port
  end

  # These tests are intended to exercise problems that come up in the
  # pure-Ruby implementation. However, we DON'T constrain them such that
  # they only run in pure-Ruby. These tests need to work identically in
  # any implementation.

  #-------------------------------------

  # The EM reactor needs to run down open connections and release other resources
  # when it stops running. Make sure this happens even if user code throws a Ruby
  # exception.
  # If exception handling is incorrect, the second test will fail with a no-bind error
  # because the TCP server opened in the first test will not have been closed.

  def test_exception_handling_releases_resources
    exception = Class.new(StandardError)

    2.times do
      assert_raises(exception) do
        EM.run do
          EM.start_server "127.0.0.1", @port
          raise exception
        end
      end
    end
  end

  # Under some circumstances, the pure Ruby library would emit an Errno::ECONNREFUSED
  # exception on certain kinds of TCP connect-errors.
  # It's always been something of an open question whether EM should throw an exception
  # in these cases but the defined answer has always been to catch it the unbind method.
  # With a connect failure, the latter will always fire, but connection_completed will
  # never fire. So even though the point is arguable, it's incorrect for the pure Ruby
  # version to throw an exception.
  module TestConnrefused
    def unbind
      EM.stop
    end
    def connection_completed
      raise "should never get here"
    end
  end

  def test_connrefused
    assert_nothing_raised do
      EM.run {
        setup_timeout(2)
        EM.connect "127.0.0.1", @port, TestConnrefused
      }
    end
  end

  # Make sure connection_completed gets called as expected with TCP clients. This is the
  # opposite of test_connrefused.
  # If the test fails, it will hang because EM.stop never gets called.
  #
  module TestConnaccepted
    def connection_completed
      EM.stop
    end
  end
  def test_connaccepted
    assert_nothing_raised do
      EM.run {
        EM.start_server "127.0.0.1", @port
        EM.connect "127.0.0.1", @port, TestConnaccepted
        setup_timeout(1)
      }
    end
  end

  def test_reactor_running
    a = false
    EM.run {
      a = EM.reactor_running?
      EM.next_tick {EM.stop}
    }
    assert a
  end

  module TLSServer
    def post_init
      start_tls
    end

    def ssl_handshake_completed
      $server_handshake_completed = true
    end

    def receive_data(data)
      $server_received_data = data
      send_data(data)
    end
  end

  module TLSClient
    def post_init
      start_tls
    end

    def ssl_handshake_completed
      $client_handshake_completed = true
    end

    def connection_completed
      send_data('Hello World!')
    end

    def receive_data(data)
      $client_received_data = data
      close_connection
    end

    def unbind
      EM.stop_event_loop
    end
  end

  def test_start_tls
    $client_handshake_completed, $server_handshake_completed = false, false
    $client_received_data, $server_received_data = nil, nil
    EM.run do
      EM.start_server("127.0.0.1", 16789, TLSServer)
      EM.connect("127.0.0.1", 16789, TLSClient)
    end

    assert($client_handshake_completed)
    assert($server_handshake_completed)
    assert($client_received_data == "Hello World!")
    assert($server_received_data == "Hello World!")
  end
end