text:
<?php

namespace ForkCMS\Modules\Faq\Domain\Question;

use ForkCMS\Modules\Faq\Domain\Category\Category;
use ForkCMS\Core\Common\Model;
use ForkCMS\Modules\Internationalisation\Domain\Locale\Locale;
use Doctrine\ORM\NoResultException;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

/**
 * @method Question|null find($id, $lockMode = null, $lockVersion = null)
 * @method Question|null findOneBy(array $criteria, array $orderBy = null)
 * @method Question[] findAll()
 * @method Question[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
 */
final class QuestionRepository extends ServiceEntityRepository
{
    public function __construct(ManagerRegistry $registry)
    {
        parent::__construct($registry, Question::class);
    }

    public function add(Question $question): void
    {
        $this->getEntityManager()->persist($question);
        $this->getEntityManager()->flush();
    }

    public function remove(Question $question): void
    {
        $this->getEntityManager()->remove($question);
        $this->getEntityManager()->flush();
    }

    /**
     * @param string $url
     * @param Locale $locale
     *
     * @return Question
     *
     * @throws NoResultException When no result is found
     */
    public function findOneByUrl(string $url, Locale $locale): Question
    {
        return $this
            ->createQueryBuilder('q')
            ->innerJoin('q.meta', 'm')
            ->andWhere('m.url = :url')
            ->andWhere('q.locale = :locale')
            ->setParameter(':url', $url)
            ->setParameter(':locale', $locale)
            ->getQuery()
            ->getSingleResult()
        ;
    }

    public function findByCategory(
        Category $category,
        Locale $locale,
        int $limit = null,
        array $excludeIds = array()
    ): array {
        $query = $this
            ->createQueryBuilder('q')
            ->andWhere('q.category = :category')
            ->andWhere('q.hidden = :hidden')
            ->andWhere('q.locale = :locale')
            ->setParameter(':category', $category)
            ->setParameter(':hidden', false)
            ->setParameter(':locale', $locale)
            ->orderBy('q.sequence', 'DESC')
        ;

        if ($limit !== null) {
            $query->setMaxResults($limit);
        }

        if (!empty($excludeIds)) {
            $query->andWhere(
                $query->expr()->not(
                    $query->expr()->in('q.id', $excludeIds)
                )
            );
        }

        return $query->getQuery()->getResult();
    }

    public function findMultiple(array $ids, Locale $locale): array
    {
        return $this->findBy(
            [
                'id' => $ids,
                'locale' => $locale->getLocale(),
                'hidden' => false,
            ],
            ['question' => 'ASC']
        );
    }

    public function findMostRead(int $limit, Locale $locale): array
    {
        return $this
            ->createQueryBuilder('q')
            ->andWhere('q.numberOfViews > 0')
            ->andWhere('q.locale = :locale')
            ->andWhere('q.hidden = :hidden')
            ->setParameter(':locale', $locale)
            ->setParameter(':hidden', false)
            ->orderBy('q.numberOfUsefulYes + q.numberOfUsefulNo', 'DESC')
            ->setMaxResults($limit)
            ->getQuery()
            ->getResult()
        ;
    }

    public function findMaximumSequence(Category $category, Locale $locale): int
    {
        $queryBuilder = $this->createQueryBuilder('q');

        return (int) $queryBuilder
            ->select($queryBuilder->expr()->max('q.sequence'))
            ->andWhere('q.category = :category')
            ->andWhere('q.locale = :locale')
            ->setParameter(':category', $category)
            ->setParameter(':locale', $locale)
            ->getQuery()
            ->getSingleScalarResult()
        ;
    }

    public function getUrl(string $url, Locale $locale, int $id = null): string
    {
        $queryBuilder = $this->createQueryBuilder('q');

        $query = $queryBuilder
            ->select($queryBuilder->expr()->count('q.id'))
            ->innerJoin('q.meta', 'm')
            ->andWhere('m.url = :url')
            ->andWhere('q.locale = :locale')
            ->setParameter(':url', $url)
            ->setParameter(':locale', $locale)
        ;

        if ($id !== null) {
            $query
                ->andWhere('q.id != :id')
                ->setParameter(':id', $id)
            ;
        }

        if ((int) $query->getQuery()->getSingleScalarResult() === 0) {
            return $url;
        }

        return $this->getUrl(Model::addNumber($url), $locale, $id);
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<INTERACTIONS>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>297-IRINOTECAN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="IRINOTECAN" rxcui="51499">
<ATC code="L01XX19" />
</DRUG>
</DRUG1>
<DRUG2>
<CLASS name="ENZYMATIC INDUCERS" code="N03-J05-001" /></DRUG2>
<DESCRIPTION>Probable decrease of the plasma concentrations of the active metabolite of the irinotecan, with risk of failure of the cytotoxic treatment</DESCRIPTION>
<SEVERITY>Not recommended</SEVERITY>
</INTERACTION>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>297-IRINOTECAN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="IRINOTECAN" rxcui="51499">
<ATC code="L01XX19" />
</DRUG>
</DRUG1>
<DRUG2>
<CLASS name="STRONG INHIBITORS OF CYP3A4" code="J02-J05" /></DRUG2>
<DESCRIPTION>Risk of increase of the undesirable effects of the irinotecan due to increase of the plasma concentrations of its active metabolite</DESCRIPTION>
<SEVERITY>Not recommended</SEVERITY>
</INTERACTION>
<INTERACTION>
<SOURCE>
<CLINICAL_SOURCE>ANSM</CLINICAL_SOURCE>
<SOURCE_FILE>297-IRINOTECAN.html
</SOURCE_FILE>
</SOURCE>
<DRUG1>
<DRUG name="IRINOTECAN" rxcui="51499">
<ATC code="L01XX19" />
</DRUG>
</DRUG1>
<DRUG2>
<DRUG name="ST JOHNS WORT" rxcui="258326">
</DRUG>
</DRUG2>
<DESCRIPTION>Decrease of the plasma concentrations of the active metabolite of the irinotecan, with risk of failure of the cytotoxic treatment</DESCRIPTION>
<SEVERITY>CONTRAINDICATION</SEVERITY>
</INTERACTION>
</INTERACTIONS>

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<com.stylingandroid.presenter.engine.presentation.SlideLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:sap="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:id="@id/slide"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_gravity="center"
  android:gravity="center"
  android:orientation="vertical"
  sap:nextInAnimation="@anim/fadein"
  sap:nextOutAnimation="@anim/fadeout"
  sap:tweet="@string/vectors_tweet_svg_animated10"
  tools:context=".display.DisplayActivity">

  <RelativeLayout
    android:id="@+id/transition_graphics"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
      android:id="@+id/title"
      style="@style/Widget.TextView.Large"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="50dp"
      android:gravity="center"
      android:text="AnimatedVectorDrawable" />

    <FrameLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:layout_below="@id/title"
      android:layout_centerHorizontal="true">

      <com.stylingandroid.presenter.engine.presentation.AnimatedImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:contentDescription="@null"
        android:src="@drawable/isometric"
        sap:hidePhase="1" />

      <com.stylingandroid.presenter.engine.presentation.AnimatedImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:contentDescription="@null"
        android:src="@drawable/animated_isometric"
        sap:showPhase="1" />
    </FrameLayout>

  </RelativeLayout>
</com.stylingandroid.presenter.engine.presentation.SlideLayout>


text:
<?php

namespace Cgit;

class Breadcrumb
{
    /**
     * List of breadcrumb entries
     *
     * @var array
     */
    protected $items = [];

    /**
     * List of default names
     *
     * @var array
     */
    protected $names = [];

    /**
     * List of WordPress conditional functions
     *
     * @var array
     */
    protected $conditions = [
        'is_front_page',
        'is_home',
        'is_page',
        'is_singular',
        'is_category',
        'is_tag',
        'is_tax',
        'is_search',
        'is_day',
        'is_month',
        'is_year',
        'is_post_type_archive',
        'is_archive',
        'is_404',
    ];

    /**
     * List of HTML item templates
     *
     * @var array
     */
    protected $templates = [
        'url' => '%1$s',
        'current' => '%s',
        'span' => '%s',
    ];

    /**
     * Constructor
     *
     * Assign the default names for the home page and posts index, add the home
     * page to the list of items, and update the breadcrumb list to include any
     * other items.
     *
     * @param array $names
     * @return void
     */
    public function __construct($names = [])
    {
        $this->setNames($names);
        $this->setTemplates();

        $this->add($this->names['home'], home_url('/'));
        $this->update();
    }

    /**
     * Set home and index names
     *
     * @param array $names
     * @return void
     */
    protected function setNames($names = [])
    {
        $type = get_post_type_object('post');

        $defaults = [
            'home' => 'Home',
            'index' => $type->label ?? 'Posts',
        ];

        // If the site has an index page, use the title of that page in the
        // index link as the default value.
        if ($this->hasFrontPage()) {
            $index_id = $this->indexId();

            if ($index_id) {
                $defaults['index'] = get_the_title($index_id);
            }
        }

        // Set names based on optional parameters, then default values. Then
        // apply filter to allow customization.
        $this->names = apply_filters('cgit_breadcrumb_names', wp_parse_args($names, $defaults));
    }

    /**
     * Set template values
     *
     * @return void
     */
    protected function setTemplates()
    {
        $this->templates = apply_filters('cgit_breadcrumb_templates', $this->templates);
    }

    /**
     * Append a breadcrumb item to the list
     *
     * @param string $text
     * @param mixed $url
     * @param boolean $current
     */
    protected function add($text, $url = false, $current = false)
    {
        $this->items[] = [
            'text' => $text,
            'url' => $url,
            'current' => $current,
        ];
    }

    /**
     * Append parent pages to the list
     *
     * @param WP_Post|integer $page
     * @return void
     */
    protected function addParents($page)
    {
        $page = get_post($page);
        $parent_id = $page->post_parent;
        $ancestors = [];

        if (!$parent_id) {
            return;
        }

        // Assemble a list of ancestor pages
        while ($parent_id) {
            $parent_post = get_post($parent_id);
            $parent_id = $parent_post->post_parent;
            $ancestors[] = $parent_post;
        }

        // Reverse the order of the ancestor pages
        $ancestors = array_reverse($ancestors);

        // Add each ancestor page to the breadcrumb list
        foreach ($ancestors as $ancestor) {
            $this->add(get_the_title($ancestor), get_permalink($ancestor));
        }
    }

    /**
     * Append index page to the list
     *
     * @return void
     */
    protected function addIndexPage()
    {
        $id = $this->indexId();
        $title = $this->names['index'];
        $url = null;

        if ($id) {
            $title = get_the_title($id);
            $url = get_permalink($id);

            $this->addParents($id);
        }

        if (is_home()) {
            return $this->add($title, null, true);
        }

        $this->add($title, $url);
    }

    /**
     * Update the breadcrumb list
     *
     * Run each WordPress conditional function in turn until we can work out
     * what sort of page we are viewing. Then add or amend the items in the
     * breadcrumb list accordingly.
     *
     * @return void
     */
    protected function update()
    {
        foreach ($this->conditions as $condition) {
            if (!$condition()) {
                continue;
            }

            $method = lcfirst(str_replace('_', '', ucwords($condition, '_')));
            $this->$method();

            break;
        }
    }

    /**
     * Return breadcrumb items as an array
     *
     * @return array
     */
    public function getItems()
    {
        return $this->items;
    }

    /**
     * Return breadcrumb links as an array
     *
     * Uses sprintf and the array of templates to generate HTML links or spans
     * from each of the breadcrumb items.
     *
     * @return array
     */
    public function getLinks()
    {
        return array_map(function ($item) {
            foreach ($this->templates as $key => $template) {
                if (isset($item[$key]) && $item[$key]) {
                    return sprintf($template, $item['text'], $item['url']);
                }

                return sprintf($this->templates['span'], $item['text']);
            }
        }, $this->items);
    }

    /**
     * Return HTML breadcrumb with separator
     *
     * @param string $sep
     * @return string
     */
    public function render($sep = ' / ')
    {
        return implode($sep, $this->getLinks());
    }

    /**
     * Return HTML breadcrumb list
     *
     * @param string $element
     * @return string
     */
    public function renderList($element = 'ol')
    {
        $items = array_map(function ($link) {
            return '
' . $link . '
';
        }, $this->getLinks());

        return "<$element>" . implode(PHP_EOL, $items) . "</$element>";
    }

    /**
     * Amend breadcrumb list: front page
     *
     * Removes the URL from the first (home page) breadcrumb item and marks it
     * as the current page.
     *
     * @return void
     */
    protected function isFrontPage()
    {
        $this->items[0]['url'] = false;
        $this->items[0]['current'] = true;
    }

    /**
     * Amend breadcrumb list: home page (posts index)
     *
     * If the site is set to use a static front page, add the posts index page
     * to the breadcrumb list. Otherwise, run the front page method.
     *
     * @return void
     */
    protected function isHome()
    {
        if ($this->hasFrontPage()) {
            return $this->addIndexPage();
        }

        $this->isFrontPage();
    }

    /**
     * Amend breadcrumb list: page
     *
     * A standard page may be part of a hierarchy. Assembles a list of ancestor
     * pages, reverses them, and adds them in turn. Then adds the current page
     * to the breadcrumb.
     *
     * @return void
     */
    protected function isPage()
    {
        global $post;

        // Add parent pages to the list
        $this->addParents($post);

        // Add the current page to the list
        $this->add(get_the_title(), false, true);
    }

    /**
     * Amend breadcrumb list: singular post or custom post type
     *
     * @return void
     */
    protected function isSingular()
    {
        global $post;

        $type = get_post_type($post);

        // If this is a standard post and the site is using a static front page,
        // add the posts index page to the list.
        if ($type == 'post' && $this->hasFrontPage()) {
            $this->addIndexPage();
        }

        // If this is not a standard post, add the custom post type archive URL
        // to the list.
        if ($type != 'post') {
            $type_object = get_post_type_object($type);
            $this->add(
                $type_object->labels->name,
                get_post_type_archive_link($type)
            );
        }

        // Add the post itself to the breadcrumb list
        $this->add(get_the_title(), false, true);
    }

    /**
     * Amend breadcrumb list: category
     *
     * @return void
     */
    protected function isCategory()
    {
        if ($this->hasFrontPage()) {
            $this->addIndexPage();
        }

        $this->add('Category');
        $this->add(single_cat_title('', false), false, true);
    }

    /**
     * Amend breadcrumb list: tag
     *
     * @return void
     */
    protected function isTag()
    {
        if ($this->hasFrontPage()) {
            $this->addIndexPage();
        }

        $this->add('Tag');
        $this->add(single_tag_title('', false), false, true);
    }

    /**
     * Amend breadcrumb list: custom taxonomy
     *
     * @return void
     */
    protected function isTax()
    {
        $taxonomy = get_taxonomy(get_query_var('taxonomy'));
        $term = get_term_by('slug', get_query_var('term'), $taxonomy->name);

        $this->add($taxonomy->labels->name);
        $this->add($term->name, false, true);
    }

    /**
     * Amend breadcrumb list: search results
     *
     * @return void
     */
    protected function isSearch()
    {
        $this->add('Search results', false, true);
    }

    /**
     * Amend breadcrumb list: day archive
     *
     * @return void
     */
    public function isDay()
    {
        if ($this->hasFrontPage()) {
            $this->addIndexPage();
        }

        $this->add(get_the_date(), false, true);
    }

    /**
     * Amend breadcrumb list: month archive
     *
     * @return void
     */
    protected function isMonth()
    {
        if ($this->hasFrontPage()) {
            $this->addIndexPage();
        }

        $this->add(get_the_date('F Y'), false, true);
    }

    /**
     * Amend breadcrumb list: year archive
     *
     * @return void
     */
    protected function isYear()
    {
        if ($this->hasFrontPage()) {
            $this->addIndexPage();
        }

        $this->add(get_the_date('Y'), false, true);
    }

    /**
     * Amend breadcrumb list: custom post type archive
     *
     * @return void
     */
    protected function isPostTypeArchive()
    {
        $this->add(post_type_archive_title('', false), false, true);
    }

    /**
     * Amend breadcrumb list: archive
     *
     * @return void
     */
    protected function isArchive()
    {
        $this->add('Archive', false, true);
    }

    /**
     * Amend breadcrumb list: 404 page
     *
     * @return void
     */
    protected function is404()
    {
        $this->add('Page not found', false, true);
    }

    /**
     * Site has page for posts?
     *
     * @return boolean
     */
    protected function hasFrontPage()
    {
        return get_option('show_on_front') === 'page';
    }

    /**
     * Front page ID
     *
     * @return integer
     */
    protected function indexId()
    {
        if (!$this->hasFrontPage()) {
            return 0;
        }

        return (int) get_option('page_for_posts');
    }
}


text:
declare module '@nacho-ui/core/testing' {
  export interface ITesting<T> {
    [key: string]: T;
  }
}


text:
<?php

/**
 * Class CreatePost_Notify_Background
 */
class CreatePost_Notify_Background extends SMF_BackgroundTask
{
	/**
	 * Constants for reply types.
	 */
	const NOTIFY_TYPE_REPLIES_AND_MODERATION = 1;
	const NOTIFY_TYPE_REPLIES_AND_OWN_TOPIC_MODERATION = 2;
	const NOTIFY_TYPE_ONLY_REPLIES = 3;
	const NOTIFY_TYPE_NOTHING = 4;

	/**
	 * Constants for frequencies.
	 */
	const FREQUENCY_NOTHING = 0;
	const FREQUENCY_EVERYTHING = 1;
	const FREQUENCY_FIRST_UNREAD_MSG = 2;
	const FREQUENCY_DAILY_DIGEST = 3;
	const FREQUENCY_WEEKLY_DIGEST = 4;

	/**
	 * Minutes to wait before sending notifications about about mentions
	 * and quotes in unwatched and/or edited posts.
	 */
	const MENTION_DELAY = 5;

	/**
	 * @var array Info about members to be notified.
	 */
	private $members = array(
		// These three contain nested arrays of member info.
		'mentioned' => array(),
		'quoted' => array(),
		'watching' => array(),

		// These ones just contain member IDs.
		'all' => array(),
		'emailed' => array(),
		'alerted' => array(),
		'done' => array(),
	);

	/**
	 * @var array Alerts to be inserted into the alerts table.
	 */
	private $alert_rows = array();

	/**
	 * @var array Members' notification and alert preferences.
	 */
	private $prefs = array();

	/**
	 * @var int Timestamp after which email notifications should be sent about
	 *			mentions and quotes in unwatched and/or edited posts.
	 */
	private $mention_mail_time = 0;

	/**
	 * This executes the task: loads up the info, puts the email in the queue
	 * and inserts any alerts as needed.
	 *
	 * @return bool Always returns true
	 * @throws Exception
	 */
	public function execute()
	{
		global $smcFunc, $sourcedir, $scripturl, $language, $modSettings, $user_info;

		require_once($sourcedir . '/Subs-Post.php');
		require_once($sourcedir . '/Mentions.php');
		require_once($sourcedir . '/Subs-Notify.php');
		require_once($sourcedir . '/Subs.php');
		require_once($sourcedir . '/ScheduledTasks.php');
		loadEssentialThemeData();

		$msgOptions = &$this->_details['msgOptions'];
		$topicOptions = &$this->_details['topicOptions'];
		$posterOptions = &$this->_details['posterOptions'];
		$type = &$this->_details['type'];

		$this->mention_mail_time = (isset($msgOptions['poster_time']) ? $msgOptions['poster_time'] : 0) + self::MENTION_DELAY * 60;

		// We need some more info about the quoted and mentioned members.
		if (!empty($msgOptions['quoted_members']))
			$this->members['quoted'] = Mentions::getMentionsByContent('quote', $msgOptions['id'], array_keys($msgOptions['quoted_members']));
		if (!empty($msgOptions['mentioned_members']))
			$this->members['mentioned'] = Mentions::getMentionsByContent('msg', $msgOptions['id'], array_keys($msgOptions['mentioned_members']));

		// Find the people interested in receiving notifications for this topic
		$request = $smcFunc['db_query']('', '
			SELECT
				ln.id_member, ln.id_board, ln.id_topic, ln.sent,
				mem.email_address, mem.lngfile, mem.pm_ignore_list,
				mem.id_group, mem.id_post_group, mem.additional_groups,
				mem.time_format, mem.time_offset, mem.timezone,
				b.member_groups, t.id_member_started, t.id_member_updated
			FROM {db_prefix}log_notify AS ln
				INNER JOIN {db_prefix}members AS mem ON (ln.id_member = mem.id_member)
				LEFT JOIN {db_prefix}topics AS t ON (t.id_topic = ln.id_topic)
				LEFT JOIN {db_prefix}boards AS b ON (b.id_board = ln.id_board OR b.id_board = t.id_board)
			WHERE ln.id_member != {int:member}
				AND (ln.id_topic = {int:topic} OR ln.id_board = {int:board})',
			array(
				'member' => $posterOptions['id'],
				'topic' => $topicOptions['id'],
				'board' => $topicOptions['board'],
			)
		);
		while ($row = $smcFunc['db_fetch_assoc']($request))
		{
			// Skip members who aren't allowed to see this board
			$groups = array_merge(array($row['id_group'], $row['id_post_group']), (empty($row['additional_groups']) ? array() : explode(',', $row['additional_groups'])));

			$allowed_groups = explode(',', $row['member_groups']);

			if (!in_array(1, $groups) && count(array_intersect($groups, $allowed_groups)) == 0)
				continue;
			else
			{
				$row['groups'] = $groups;
				unset($row['id_group'], $row['id_post_group'], $row['additional_groups']);
			}

			$this->members['watching'][$row['id_member']] = $row;
		}
		$smcFunc['db_free_result']($request);

		// Filter out mentioned and quoted members who can't see this board.
		if (!empty($this->members['mentioned']) || !empty($this->members['quoted']))
		{
			// This won't be set yet if no one is watching this board or topic.
			if (!isset($allowed_groups))
			{
				$request = $smcFunc['db_query']('', '
					SELECT member_groups
					FROM {db_prefix}boards
					WHERE id_board = {int:board}',
					array(
						'board' => $topicOptions['board'],
					)
				);
				list($allowed_groups) = $smcFunc['db_fetch_row']($request);
				$smcFunc['db_free_result']($request);
				$allowed_groups = explode(',', $allowed_groups);
			}

			foreach (array('mentioned', 'quoted') as $member_type)
			{
				foreach ($this->members[$member_type] as $member_id => $member_data)
				{
					if (!in_array(1, $member_data['groups']) && count(array_intersect($member_data['groups'], $allowed_groups)) == 0)
						unset($this->members[$member_type][$member_id], $msgOptions[$member_type . '_members'][$member_id]);
				}
			}
		}

		$unnotified = array_filter($this->members['watching'], function ($member) {
			return empty($member['sent']);
		});

		// Modified post, or dealing with delayed mention and quote notifications.
		if ($type == 'edit' || !empty($this->_details['respawns']))
		{
			// Filter out members who have already been notified about this post's topic
			$this->members['quoted'] = array_intersect_key($this->members['quoted'], $unnotified);
			$this->members['mentioned'] = array_intersect_key($this->members['mentioned'], $unnotified);

			// Notifications about modified posts only go to members who were mentioned or quoted
			$this->members['watching'] = $type == 'edit' ? array(): $unnotified;

			// If this post has no quotes or mentions, just delete any obsolete alerts and bail out.
			if (empty($this->members['quoted']) && empty($this->members['mentioned']))
			{
				$this->updateAlerts($msgOptions['id']);
				return true;
			}

			// Never notify about edits to ancient posts.
			if (!empty($modSettings['oldTopicDays']) && time() > $msgOptions['poster_time'] + $modSettings['oldTopicDays'] * 86400)
				return true;

			// If editing is only allowed for a brief time, send after editing becomes disabled.
			if (!empty($modSettings['edit_disable_time']) && $modSettings['edit_disable_time'] <= self::MENTION_DELAY)
			{
				$this->mention_mail_time = $msgOptions['poster_time'] + $modSettings['edit_disable_time'] * 60;
			}
			// Otherwise, impose a delay before sending notifications about edited posts.
			else
			{
				if (!empty($this->_details['respawns']))
				{
					$request = $smcFunc['db_query']('', '
						SELECT modified_time
						FROM {db_prefix}messages
						WHERE id_msg = {int:msg}
						LIMIT 1',
						array(
							'msg' => $msgOptions['id'],
						)
					);
					list($real_modified_time) = $smcFunc['db_fetch_row']($request);
					$smcFunc['db_free_result']($request);

					// If it was modified again while we weren't looking, bail out.
					// A future instance of this task will take care of it instead.
					if ($msgOptions['modify_time'] < $real_modified_time)
						return true;
				}

				$this->mention_mail_time = $msgOptions['modify_time'] + self::MENTION_DELAY * 60;
			}
		}

		$this->members['all'] = array_unique(array_merge(array_keys($this->members['watching']), array_keys($this->members['quoted']), array_keys($this->members['mentioned'])));

		if (empty($this->members['all']))
			return true;

		$this->prefs = getNotifyPrefs($this->members['all'], '', true);

		// May as well disable these, since they'll be stripped out anyway.
		$disable = array('attach', 'img', 'iurl', 'url', 'youtube');
		if (!empty($modSettings['disabledBBC']))
		{
			$disabledBBC = $modSettings['disabledBBC'];
			$disable = array_unique(array_merge($disable, explode(',', $modSettings['disabledBBC'])));
		}
		$modSettings['disabledBBC'] = implode(',', $disable);

		// Notify any members who were mentioned.
		if (!empty($this->members['mentioned']))
			$this->handleMentionedNotifications();

		// Notify any members who were quoted.
		if (!empty($this->members['quoted']))
			$this->handleQuoteNotifications();

		// Handle rest of the notifications for watched topics and boards
		if (!empty($this->members['watching']))
			$this->handleWatchedNotifications();

		// Put this back the way we found it.
		if (!empty($disabledBBC))
			$modSettings['disabledBBC'] = $disabledBBC;

		// Track what we sent.
		$members_to_log = array_intersect($this->members['emailed'], array_keys($this->members['watching']));
		if (!empty($members_to_log))
		{
			$smcFunc['db_query']('', '
				UPDATE {db_prefix}log_notify
				SET sent = {int:is_sent}
				WHERE (id_topic = {int:topic} OR id_board = {int:board})
					AND id_member IN ({array_int:members})',
				array(
					'topic' => $topicOptions['id'],
					'board' => $topicOptions['board'],
					// 'members' => $this->members['emailed'],
					'members' => $members_to_log,
					'is_sent' => 1,
				)
			);
		}

		// Insert it into the digest for daily/weekly notifications
		if ($type != 'edit' && empty($this->_details['respawns']))
		{
			$smcFunc['db_insert']('',
				'{db_prefix}log_digest',
				array(
					'id_topic' => 'int', 'id_msg' => 'int', 'note_type' => 'string', 'exclude' => 'int',
				),
				array($topicOptions['id'], $msgOptions['id'], $type, $posterOptions['id']),
				array()
			);
		}

		// Insert the alerts if any
		$this->updateAlerts($msgOptions['id']);

		// If there is anyone still to notify via email, create a new task later.
		$unnotified = array_diff_key($unnotified, array_flip($this->members['emailed']));
		if (!empty($unnotified) || !empty($msgOptions['mentioned_members']) || !empty($msgOptions['quoted_members']))
		{
			$new_details = $this->_details;

			if (empty($new_details['respawns']))
				$new_details['respawns'] = 0;

			if ($new_details['respawns']++ < 10)
			{
				$smcFunc['db_insert']('',
					'{db_prefix}background_tasks',
					array(
						'task_file' => 'string',
						'task_class' => 'string',
						'task_data' => 'string',
						'claimed_time' => 'int',
					),
					array(
						'$sourcedir/tasks/CreatePost-Notify.php',
						'CreatePost_Notify_Background',
						$smcFunc['json_encode']($new_details),
						max(0, $this->mention_mail_time - MAX_CLAIM_THRESHOLD),
					),
					array('id_task')
				);
			}
		}

		return true;
	}

	private function updateAlerts($msg_id)
	{
		global $smcFunc;

		// We send alerts only on the first iteration of this task.
		if (!empty($this->_details['respawns']))
			return;

		// Delete alerts about any mentions and quotes that no longer exist.
		if ($this->_details['type'] == 'edit')
		{
			$old_alerts = array();

			$request = $smcFunc['db_query']('', '
				SELECT content_action, id_member
				FROM {db_prefix}user_alerts
				WHERE content_id = {int:msg_id}
					AND content_type = {literal:msg}
					AND (content_action = {literal:quote} OR content_action = {literal:mention})',
				array(
					'msg_id' => $msg_id,
				)
			);
			if ($smcFunc['db_num_rows']($request) != 0)
			{
				while ($row = $smcFunc['db_fetch_assoc']($request))
					$old_alerts[$row['content_action']][$row['id_member']] = $row['id_member'];
			}
			$smcFunc['db_free_result']($request);

			if (!empty($old_alerts))
			{
				$request = $smcFunc['db_query']('', '
					SELECT content_type, id_mentioned
					FROM {db_prefix}mentions
					WHERE content_id = {int:msg_id}
						AND (content_type = {literal:quote} OR content_type = {literal:msg})',
					array(
						'msg_id' => $msg_id,
					)
				);
				while ($row = $smcFunc['db_fetch_assoc']($request))
				{
					$content_action = $row['content_type'] == 'quote' ? 'quote' : 'mention';
					unset($old_alerts[$content_action][$row['id_mentioned']]);
				}
				$smcFunc['db_free_result']($request);

				$conditions = array();

				if (!empty($old_alerts['quote']))
					$conditions[] = '(content_action = {literal:quote} AND id_member IN ({array_int:members_not_quoted}))';

				if (!empty($old_alerts['mention']))
					$conditions[] = '(content_action = {literal:mention} AND id_member IN ({array_int:members_not_mentioned}))';

				if (!empty($conditions))
				{
					$smcFunc['db_query']('', '
						DELETE FROM {db_prefix}user_alerts
						WHERE content_id = {int:msg_id}
							AND content_type = {literal:msg}
							AND (' . implode(' OR ', $conditions) . ')',
						array(
							'msg_id' => $msg_id,
							'members_not_quoted' => empty($old_alerts['quote']) ? array(0) : $old_alerts['quote'],
							'members_not_mentioned' => empty($old_alerts['mention']) ? array(0) : $old_alerts['mention'],
						)
					);

					foreach ($old_alerts as $member_ids)
						updateMemberData($member_ids, array('alerts' => '-'));
				}
			}
		}

		// Insert the new alerts.
		if (!empty($this->alert_rows))
		{
			$smcFunc['db_insert']('',
				'{db_prefix}user_alerts',
				array(
					'alert_time' => 'int',
					'id_member' => 'int',
					'id_member_started' => 'int',
					'member_name' => 'string',
					'content_type' => 'string',
					'content_id' => 'int',
					'content_action' => 'string',
					'is_read' => 'int',
					'extra' => 'string',
				),
				$this->alert_rows,
				array()
			);

			$new_alerts = array();
			foreach ($this->alert_rows as $row)
			{
				$group = implode(' ', array($row['content_type'], $row['content_id'], $row['content_action']));
				$new_alerts[$group] = $row['id_member'];
			}

			foreach ($new_alerts as $member_ids)
				updateMemberData($member_ids, array('alerts' => '+'));
		}
	}

	/**
	 * Notifies members about new posts in topics they are watching
	 * and new topics in boards they are watching.
	 */
	protected function handleWatchedNotifications()
	{
		global $smcFunc, $scripturl, $modSettings, $user_info;

		$msgOptions = &$this->_details['msgOptions'];
		$topicOptions = &$this->_details['topicOptions'];
		$posterOptions = &$this->_details['posterOptions'];
		$type = &$this->_details['type'];

		$members_info = $this->getMinUserInfo(array_keys($this->members['watching']));

		$parsed_message = array();
		foreach ($this->members['watching'] as $member_id => $member_data)
		{
			if (in_array($member_id, $this->members['done']))
				continue;

			$frequency = isset($this->prefs[$member_id]['msg_notify_pref']) ? $this->prefs[$member_id]['msg_notify_pref'] : self::FREQUENCY_NOTHING;
			$notify_types = !empty($this->prefs[$member_id]['msg_notify_type']) ? $this->prefs[$member_id]['msg_notify_type'] : self::NOTIFY_TYPE_REPLIES_AND_MODERATION;

			// Don't send a notification if:
			// 1. The watching member ignored the member who did the action.
			if (!empty($member_data['pm_ignore_list']) && in_array($member_data['id_member_updated'], explode(',', $member_data['pm_ignore_list'])))
				continue;

			// 2. The watching member is not interested in moderation on this topic.
			if (!in_array($type, array('reply', 'topic')) && ($notify_types == self::NOTIFY_TYPE_ONLY_REPLIES || ($notify_types == self::NOTIFY_TYPE_REPLIES_AND_OWN_TOPIC_MODERATION && $member_id != $member_data['id_member_started'])))
				continue;

			// 3. This is the watching member's own post.
			if (in_array($type, array('reply', 'topic')) && $member_id == $posterOptions['id'])
				continue;

			// 4. The watching member doesn't want any notifications at all.
			if ($notify_types == self::NOTIFY_TYPE_NOTHING)
				continue;

			// 5. The watching member doesn't want notifications until later.
			if (in_array($frequency, array(
				self::FREQUENCY_NOTHING,
				self::FREQUENCY_DAILY_DIGEST,
				self::FREQUENCY_WEEKLY_DIGEST)))
				continue;

			// 6. We already sent one and the watching member doesn't want more.
			if ($frequency == self::FREQUENCY_FIRST_UNREAD_MSG && $member_data['sent'])
				continue;

			// 7. The watching member isn't on club security's VIP list.
			if (!empty($this->_details['members_only']) && !in_array($member_id, $this->_details['members_only']))
				continue;

			// Watched topic?
			if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($this->prefs[$member_id]))
			{
				$pref = !empty($this->prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ?
					$this->prefs[$member_id]['topic_notify_' . $topicOptions['id']] :
					(!empty($this->prefs[$member_id]['topic_notify']) ? $this->prefs[$member_id]['topic_notify'] : 0);

				$message_type = 'notification_' . $type;

				if ($type == 'reply')
				{
					if (empty($modSettings['disallow_sendBody']) && !empty($this->prefs[$member_id]['msg_receive_body']))
						$message_type .= '_body';

					if (!empty($frequency))
						$message_type .= '_once';
				}

				$content_type = 'topic';
			}
			// A new topic in a watched board then?
			elseif ($type == 'topic')
			{
				$pref = !empty($this->prefs[$member_id]['board_notify_' . $topicOptions['board']]) ?
					$this->prefs[$member_id]['board_notify_' . $topicOptions['board']] :
					(!empty($this->prefs[$member_id]['board_notify']) ? $this->prefs[$member_id]['board_notify'] : 0);

				$content_type = 'board';

				$message_type = !empty($frequency) ? 'notify_boards_once' : 'notify_boards';

				if (empty($modSettings['disallow_sendBody']) && !empty($this->prefs[$member_id]['msg_receive_body']))
					$message_type .= '_body';
			}

			// If neither of the above, this might be a redundant row due to the OR clause in our SQL query, skip
			else
				continue;

			// We need to fake some of $user_info to make BBC parsing work correctly.
			if (isset($user_info))
				$real_user_info = $user_info;

			$user_info = $members_info[$member_id];

			loadLanguage('index+Modifications', $member_data['lngfile'], false);

			// Censor and parse BBC in the receiver's localization. Don't repeat unnecessarily.
			$localization = implode('|', array($member_data['lngfile'], $user_info['time_offset'], $user_info['time_format']));
			if (empty($parsed_message[$localization]))
			{
				$parsed_message[$localization]['subject'] = $msgOptions['subject'];
				$parsed_message[$localization]['body'] = $msgOptions['body'];

				censorText($parsed_message[$localization]['subject']);
				censorText($parsed_message[$localization]['body']);

				$parsed_message[$localization]['subject'] = un_htmlspecialchars($parsed_message[$localization]['subject']);
				$parsed_message[$localization]['body'] = trim(un_htmlspecialchars(strip_tags(strtr(parse_bbc($parsed_message[$localization]['body'], false), array('
' => "\n", '
' => "\n", '
' => "\n", '[' => '[', ']' => ']', ''' => '\'', '
' => "\n", '	' => "\t", '
' => "\n---------------------------------------------------------------\n")))));
			}

			// Put $user_info back the way we found it.
			if (isset($real_user_info))
			{
				$user_info = $real_user_info;
				unset($real_user_info);
			}
			else
				$user_info = null;

			// Bitwise check: Receiving a alert?
			if ($pref & self::RECEIVE_NOTIFY_ALERT)
			{
				$this->alert_rows[] = array(
					'alert_time' => time(),
					'id_member' => $member_id,
					// Only tell sender's information for new topics and replies
					'id_member_started' => in_array($type, array('topic', 'reply')) ? $posterOptions['id'] : 0,
					'member_name' => in_array($type, array('topic', 'reply')) ? $posterOptions['name'] : '',
					'content_type' => $content_type,
					'content_id' => $topicOptions['id'],
					'content_action' => $type,
					'is_read' => 0,
					'extra' => $smcFunc['json_encode'](array(
						'topic' => $topicOptions['id'],
						'board' => $topicOptions['board'],
						'content_subject' => $parsed_message[$localization]['subject'],
						'content_link' => $scripturl . '?topic=' . $topicOptions['id'] . (in_array($type, array('reply', 'topic')) ? '.new;topicseen#new' : '.0'),
					)),
				);
			}

			// Bitwise check: Receiving a email notification?
			if ($pref & self::RECEIVE_NOTIFY_EMAIL)
			{
				$itemID = $content_type == 'board' ? $topicOptions['board'] : $topicOptions['id'];

				$token = createUnsubscribeToken($member_data['id_member'], $member_data['email_address'], $content_type, $itemID);

				$replacements = array(
					'TOPICSUBJECT' => $parsed_message[$localization]['subject'],
					'POSTERNAME' => un_htmlspecialchars($posterOptions['name']),
					'TOPICLINK' => $scripturl . '?topic=' . $topicOptions['id'] . '.new#new',
					'MESSAGE' => $parsed_message[$localization]['body'],
					'UNSUBSCRIBELINK' => $scripturl . '?action=notify' . $content_type . ';' . $content_type . '=' . $itemID . ';sa=off;u=' . $member_data['id_member'] . ';token=' . $token,
				);

				$emaildata = loadEmailTemplate($message_type, $replacements, $member_data['lngfile']);
				$mail_result = sendmail($member_data['email_address'], $emaildata['subject'], $emaildata['body'], null, 'm' . $topicOptions['id'], $emaildata['is_html']);

				if ($mail_result !== false)
					$this->members['emailed'][] = $member_id;
			}

			$this->members['done'][] = $member_id;
		}
	}

	/**
	 * Notifies members when their posts are quoted in other posts.
	 */
	protected function handleQuoteNotifications()
	{
		global $smcFunc, $modSettings, $language, $scripturl;

		$msgOptions = &$this->_details['msgOptions'];
		$posterOptions = &$this->_details['posterOptions'];

		foreach ($this->members['quoted'] as $member_id => $member_data)
		{
			if (in_array($member_id, $this->members['done']))
				continue;

			if (!isset($this->prefs[$member_id]) || empty($this->prefs[$member_id]['msg_quote']))
				continue;
			else
				$pref = $this->prefs[$member_id]['msg_quote'];

			// You don't need to be notified about quoting yourself.
			if ($member_id == $posterOptions['id'])
				continue;

			// Bitwise check: Receiving an alert?
			if ($pref & self::RECEIVE_NOTIFY_ALERT)
			{
				$this->alert_rows[] = array(
					'alert_time' => time(),
					'id_member' => $member_data['id'],
					'id_member_started' => $posterOptions['id'],
					'member_name' => $posterOptions['name'],
					'content_type' => 'msg',
					'content_id' => $msgOptions['id'],
					'content_action' => 'quote',
					'is_read' => 0,
					'extra' => $smcFunc['json_encode'](array(
						'content_subject' => $msgOptions['subject'],
						'content_link' => $scripturl . '?msg=' . $msgOptions['id'],
					)),
				);
			}

			// Bitwise check: Receiving a email notification?
			if (!($pref & self::RECEIVE_NOTIFY_EMAIL))
			{
				// Don't want an email, so forget this member in any respawned tasks.
				unset($msgOptions['quoted_members'][$member_id]);
			}
			elseif (TIME_START >= $this->mention_mail_time || in_array($member_id, $this->members['watched']))
			{
				$replacements = array(
					'CONTENTSUBJECT' => $msgOptions['subject'],
					'QUOTENAME' => $posterOptions['name'],
					'MEMBERNAME' => $member_data['real_name'],
					'CONTENTLINK' => $scripturl . '?msg=' . $msgOptions['id'],
				);

				$emaildata = loadEmailTemplate('msg_quote', $replacements, empty($member_data['lngfile']) || empty($modSettings['userLanguage']) ? $language : $member_data['lngfile']);
				$mail_result = sendmail($member_data['email_address'], $emaildata['subject'], $emaildata['body'], null, 'msg_quote_' . $msgOptions['id'], $emaildata['is_html'], 2);

				if ($mail_result !== false)
				{
					// Don't send multiple notifications about the same post.
					$this->members['emailed'][] = $member_id;

					// Ensure respawned tasks don't send this again.
					unset($msgOptions['quoted_members'][$member_id]);
				}
			}

			$this->members['done'][] = $member_id;
		}
	}

	/**
	 * Notifies members when they are mentioned in other members' posts.
	 */
	protected function handleMentionedNotifications()
	{
		global $smcFunc, $scripturl, $language, $modSettings;

		$msgOptions = &$this->_details['msgOptions'];

		foreach ($this->members['mentioned'] as $member_id => $member_data)
		{
			if (in_array($member_id, $this->members['done']))
				continue;

			if (empty($this->prefs[$member_id]) || empty($this->prefs[$member_id]['msg_mention']))
				continue;
			else
				$pref = $this->prefs[$member_id]['msg_mention'];

			// Mentioning yourself is silly, and we aren't going to notify you about it.
			if ($member_id == $member_data['mentioned_by']['id'])
				continue;

			// Bitwise check: Receiving an alert?
			if ($pref & self::RECEIVE_NOTIFY_ALERT)
			{
				$this->alert_rows[] = array(
					'alert_time' => time(),
					'id_member' => $member_data['id'],
					'id_member_started' => $member_data['mentioned_by']['id'],
					'member_name' => $member_data['mentioned_by']['name'],
					'content_type' => 'msg',
					'content_id' => $msgOptions['id'],
					'content_action' => 'mention',
					'is_read' => 0,
					'extra' => $smcFunc['json_encode'](array(
						'content_subject' => $msgOptions['subject'],
						'content_link' => $scripturl . '?msg=' . $msgOptions['id'],
					)),
				);
			}

			// Bitwise check: Receiving a email notification?
			if (!($pref & self::RECEIVE_NOTIFY_EMAIL))
			{
				// Don't want an email, so forget this member in any respawned tasks.
				unset($msgOptions['mentioned_members'][$member_id]);
			}
			elseif (TIME_START >= $this->mention_mail_time || in_array($member_id, $this->members['watched']))
			{
				$replacements = array(
					'CONTENTSUBJECT' => $msgOptions['subject'],
					'MENTIONNAME' => $member_data['mentioned_by']['name'],
					'MEMBERNAME' => $member_data['real_name'],
					'CONTENTLINK' => $scripturl . '?msg=' . $msgOptions['id'],
				);

				$emaildata = loadEmailTemplate('msg_mention', $replacements, empty($member_data['lngfile']) || empty($modSettings['userLanguage']) ? $language : $member_data['lngfile']);
				$mail_result = sendmail($member_data['email_address'], $emaildata['subject'], $emaildata['body'], null, 'msg_mention_' . $msgOptions['id'], $emaildata['is_html'], 2);

				if ($mail_result !== false)
				{
					// Don't send multiple notifications about the same post.
					$this->members['emailed'][] = $member_id;

					// Ensure respawned tasks don't send this again.
					unset($msgOptions['mentioned_members'][$member_id]);
				}
			}

			$this->members['done'][] = $member_id;
		}
	}
}

?>


text:
{-#Language GeneralizedNewtypeDeriving
          , DeriveDataTypeable
          , FlexibleInstances
          , TypeSynonymInstances
          #-}

module Control.Monad.MiniKanren.Term where

import Control.Monad.MiniKanren.Core

import Data.Data

-- A datatype for playing around with lists
data Term = Symbol String
          | Cons (LVar Term) (LVar Term)
          | Nil
  deriving (Show, Eq, Ord, Data, Typeable)

-- Define unification for our new datatype
instance Unifiable Term where
  unifyValue (Symbol a) (Symbol b) | a == b = successful
  unifyValue Nil Nil = successful
  unifyValue (Cons a1 a2) (Cons b1 b2) = do
    a1 === b1
    a2 === b2
  unifyValue _ _ = unsuccessful

-- This class is just for convenience. It makes it much easier to construct
--  terms and makes our unification operator (===) much more flexible
class CanBeTerm a where
  newTerm :: (MonadKanren m) => a -> m (LVar Term)

instance CanBeTerm String where
  newTerm s = newLVar $ Symbol s

instance (CanBeTerm a, CanBeTerm b) => CanBeTerm (a, b) where
  newTerm (a, b) = do
    a' <- newTerm a
    b' <- newTerm b
    newLVar $ Cons a' b'

instance CanBeTerm () where
  newTerm () = newLVar Nil

instance CanBeTerm Term where
  newTerm a = newLVar a

instance CanBeTerm (LVar Term) where
  newTerm a = return a

-- Define fresh in terms of our type. This just tacks a type signature onto
-- freshLVar to help the type inferrer out and make the error messages clearer
fresh :: (MonadKanren m) => m (LVar Term)
fresh = freshLVar

(===) :: (MonadKanren m, CanBeTerm a, CanBeTerm b) => a -> b -> m ()
a === b = do
  a' <- newTerm a
  b' <- newTerm b
  unifyLVar a' b'


text:
<?php

namespace ABC\Test\Builder;

use \ABC\Builder\BuilderAbstract;

class SimpleBuilder extends BuilderAbstract
{
}


text:
<?php namespace App\Semi\BaseFunction;

use Illuminate\Support\ServiceProvider;

class BaseFunctionServiceProvider extends ServiceProvider {

    /**
     * Bootstrap the application services.
     *
     * @return void
     */
    public function boot()
    {
        //
    }

    /**
     * Register the application services.
     *
     * @return void
     */
    public function register()
    {

        $this->app['basefunction'] = $this->app->share(function($app)
        {
            return new BaseFunctionManager;
        });

        // Shortcut so developers don't need to add an Alias in app/config/app.php
        $this->app->booting(function()
        {
            $loader = \Illuminate\Foundation\AliasLoader::getInstance();
            $loader->alias('BaseFunction', 'App\Semi\BaseFunction\Facades\BaseFunction');
            $loader->alias('BF', 'App\Semi\BaseFunction\Facades\BaseFunction');
        });
    }

}


text:
package domala.async

import scala.concurrent.ExecutionContext
import scala.util.DynamicVariable

/** A context of asynchronous processing */
trait AsyncContext {
  /** ExecutionContext used when accessing DB */
  val executionContext: ExecutionContext

  /** A operation performed for each Future
    *
    * For transaction control, logging etc
    *
    * When [[domala.async.Async#apply]] is used, a Future is created for each Async Action,
    * and when [[domala.async.Async#transactionally]] is used, it is grouped into one Future
    *
    **/
  def atomicOperation[R](thunk: => R): R

  private val asyncStateHolder: DynamicVariable[AsyncState] = new DynamicVariable[AsyncState](AsyncState.Outside)

  private[async] def asyncState: AsyncState = asyncStateHolder.value

  private[async] def withAsyncStatus[R](status: AsyncState)(thunk: => R): R = asyncStateHolder.withValue(status)(thunk)

}

sealed trait AsyncState

object AsyncState {
  case object Outside extends AsyncState
  case object Async extends AsyncState
  case object Transactional extends AsyncState
}


text:
package ru.aveselov.lesson4.exceptions;

/**
 * Exception for user's incorrect menu item choice.
 *
 * @author Veselov Alexey.
 * @version 1.00
 * @since 31.03.2017
 */
public class MenuOutRangeException extends Exception {

    /**
     * Constructor.
     * @param message - message about this eception.
     */
    public MenuOutRangeException(String message) {
        super(message);
    }
}


text:
const { characters, patrick, places, timecards } = require('./data');

const random = (arr) => arr[Math.floor(Math.random() * arr.length)];

const name = () => random(characters);
const place = () => random(places);
const quote = () => random(patrick);

const quotes = (number) => {
  let string = quote();
  for (let i = 1; i < number; i += 1) {
    string = `${string} ${quote()}`;
  }
  return string;
};

const firstName = () => name().split(' ')[0];

const lastName = () => {
  const names = name().split(' ');
  return names[names.length - 1];
};

const username = () => {
  const seed = random([name(), place()]);
  const adjective = random(['sucks', 'rocks', 'is cool']);
  const delimiter = random(['-', '_', '.']);
  const user = `${seed} ${adjective}`;
  return user.replace('.', '').replace(/ /g, delimiter);
};

const timecard = () => random(timecards);

const word = () => random(quote().match(/\b(\w+)'?(\w+)?\b/g));

module.exports = {
  firstName,
  lastName,
  name,
  place,
  quote,
  quotes,
  timecard,
  username,
  word,
};


text:
from .accounts_operations import AccountsOperations
from .operations import Operations
from .check_sku_availability_operations import CheckSkuAvailabilityOperations

__all__ = [
    'AccountsOperations',
    'Operations',
    'CheckSkuAvailabilityOperations',
]


text:
getJasmineRequireObj().JsApiReporter = function() {

  var noopTimer = {
    start: function(){},
    elapsed: function(){ return 0; }
  };

  function JsApiReporter(options) {
    var timer = options.timer || noopTimer,
        status = "loaded";

    this.started = false;
    this.finished = false;

    this.jasmineStarted = function() {
      this.started = true;
      status = 'started';
      timer.start();
    };

    var executionTime;

    this.jasmineDone = function() {
      this.finished = true;
      executionTime = timer.elapsed();
      status = 'done';
    };

    this.status = function() {
      return status;
    };

    var suites = {};

    this.suiteStarted = function(result) {
      storeSuite(result);
    };

    this.suiteDone = function(result) {
      storeSuite(result);
    };

    function storeSuite(result) {
      suites[result.id] = result;
    }

    this.suites = function() {
      return suites;
    };

    var specs = [];
    this.specStarted = function(result) { };

    this.specDone = function(result) {
      specs.push(result);
    };

    this.specResults = function(index, length) {
      return specs.slice(index, index + length);
    };

    this.specs = function() {
      return specs;
    };

    this.executionTime = function() {
      return executionTime;
    };

  }

  return JsApiReporter;
};


text:
__author__ = 'zhu'

import atexit
import os
import readline

historyPath = None

def save_history():
    readline.write_history_file(historyPath)

def register(path):
    global historyPath
    historyPath = path
    if os.path.exists(historyPath):
        readline.read_history_file(historyPath)
    readline.set_history_length(100)
    atexit.register(save_history)


text:
// -------------------------------------------
// Control Freak 2
// Copyright (C) 2013-2016 Dan's Game Tools
// http://DansGameTools.com
// -------------------------------------------

#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;

using ControlFreak2Editor;
using ControlFreak2;
using ControlFreak2.Internal;
using ControlFreak2Editor.Internal;

namespace ControlFreak2Editor.Inspectors
{

[CustomEditor(typeof(ControlFreak2.TouchButtonSpriteAnimator))]
public class TouchButtonSpriteAnimatorInspector : UnityEditor.Editor
	{
	private SpriteConfigInspector
		spriteNeutral,
		spritePressed,
		spriteToggled,
		spriteToggledAndPressed;

	// ---------------------
	void OnEnable()
		{
		this.spriteNeutral 				= new SpriteConfigInspector(new GUIContent("Neutral State", "Neutral Sprite and Color"));
		this.spritePressed 				= new SpriteConfigInspector(new GUIContent("Pressed State", "Pressed Sprite and Color"));
		this.spriteToggled 				= new SpriteConfigInspector(new GUIContent("Toggled State", "Toggled Sprite and Color"));
		this.spriteToggledAndPressed	= new SpriteConfigInspector(new GUIContent("Toggled And Pressed State", "Toggled And Pressed Sprite and Color"));

		}

	// ---------------
	public override void OnInspectorGUI()
		{

		TouchButtonSpriteAnimator target = this.target as TouchButtonSpriteAnimator;
		if ((target == null))
			return;

		if (!TouchControlSpriteAnimatorInspector.DrawSourceGUI(target))
			return;

		if (target.sourceControl == null)
			{ } //InspectorUtils.DrawErrorBox("Source Button is not connected!");
		else
			{
			InspectorUtils.BeginIndentedSection(new GUIContent("Sprite Settings"));

			this.spriteNeutral.Draw(target.spriteNeutral, target, true, false);

				{
				EditorGUILayout.Space();
				this.spritePressed.Draw(target.spritePressed, target, target.IsIllegallyAttachedToSource());

				if (((TouchButton)target.sourceControl).toggle)
					{
					EditorGUILayout.Space();
					this.spriteToggled.Draw(target.spriteToggled, target, target.IsIllegallyAttachedToSource());

					EditorGUILayout.Space();
					this.spriteToggledAndPressed.Draw(target.spriteToggledAndPressed, target, target.IsIllegallyAttachedToSource());
					}
				}

			InspectorUtils.EndIndentedSection();
			}

		}

	}

}
#endif


text:
Rails.configuration.to_prepare do
  Asset.class_eval do
    # Transit
    include TransamTransitAsset
  end
  Organization.class_eval do
    include TestTransamAccountableOrg
  end
end

### TEMP EXTENSION FOR org association with grants
### currently in accounting -- needs to be fixed
module TestTransamAccountableOrg
  #------------------------------------------------------------------------------
  #
  # Accountable
  #
  # Injects methods and associations for managing depreciable assets into an
  # Organization class
  #
  # Model
  #
  #------------------------------------------------------------------------------
  extend ActiveSupport::Concern

  included do
    has_many :grants
  end
end


text:
import { PropertyAnnotation } from 'substance'

export default class Annotation extends PropertyAnnotation {}
Annotation.schema = {
  type: 'annotation'
}


text:
layout: post
title: "Nested category list in WordPress"
tags:
 - WordPress
 - PHP
---
I have just added a nested category item to our category list (on the right side of our page) and wondered why the nested item was not shown as child entry in the sidebar.
After hours of looking around in the WordPress documentation, I figured out how to get a hierarchical (nested) category list.

<!--more-->

The method ``wp_list_categories()`` can receive various arguments to control the output.
When you are using widgets in your templates and especially the category list widget, you can not easily open a PHP file, change the arguments as desired and upload the file again.
In order to manipulate/change the arguments you have to add filters in your function.php file of the current template.

As you can see in the code example at the end of this post, you may change ANY of the arguments passed to the function ``wp_list_categories()`` by just merging them to the ``$args`` array inside a special filter.

In the case of SystemOutPrintln.de we wanted to have a hierarchical (nested) list, instead of a plain one (shortened) as show below:

* Software development
* Miscellaneous
* OS X
* Common

We wanted the result to look like this (shortened):

* Software development
* Miscellaneous
	* OS X
* Common

You see: OS X is now displayed as a child entry of the category "Miscellaneous".
This makes the list much clearer and readable to you, the user of our website.
When you set the argument ``hierarchical`` to ``true``, the list will look like this (shortened):

* Categories
	* Software development
	* Miscellaneous
		* OS X
	* Common

A new level holding just one entry (Categories) appears.
But as we do not want this, you can just unset the title by setting ``title_li`` to ``''`` (an empty string).
The result looks like this:

* (the empty string)
	* Software development
	* Miscellaneous
		* OS X
	* Common

Now  you can simply style the whole list using CSS.
If you want to see a CSS example, look at the code example below.
We provide you with our CSS styles for our nested category list and with an expert of our functions.php file.

As you can see, it is very easy to manipulate the output of the category widget by just adding a filter to the ``widgets_category_args`` (as shown below).

We hope that this article helps you to understand filters in WordPress and how to change the output of the widgets on the front page.

{% gist b31eeca2d672e3947992 %}

{% gist 456c358f40ea3e2fc109 %}


text:
[![Coverage Status](https://coveralls.io/repos/github/CS2103JAN2017-W14-B4/main/badge.svg)](https://coveralls.io/github/CS2103JAN2017-W14-B4/main?branch=master)
[![Build Status](https://travis-ci.org/CS2103JAN2017-W14-B4/main.svg?branch=master)](https://travis-ci.org/CS2103JAN2017-W14-B4/main)
[![Build status](https://ci.appveyor.com/api/projects/status/3boko2x2vr5cc3w2?svg=true)](https://ci.appveyor.com/project/e0003133/main)
[![CircleCI](https://circleci.com/gh/CS2103JAN2017-W14-B4/main.svg?style=svg)](https://circleci.com/gh/CS2103JAN2017-W14-B4/main)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/3dbcf8e8ed8544b0a97d73c547890322)](https://www.codacy.com/app/e0003133/main?utm_source=github.com&utm_medium=referral&utm_content=CS2103JAN2017-W14-B4/main&utm_campaign=Badge_Grade)

* This is a desktop task manager application. It has a GUI but most of the user interactions happen using
  a CLI (Command Line Interface).
* It is **written in OOP fashion**.

#### Site Map
* [User Guide](docs/UserGuide.md)
* [Developer Guide](docs/DeveloperGuide.md)
* [About Us](docs/AboutUs.md)
* [Contact Us](docs/ContactUs.md)

#### Acknowledgements

* The original source of the code was a sample project created by **SE-EDU initiative** at https://github.com/se-edu/.
* Some parts of this sample application were inspired by the excellent
  [Java FX tutorial](http://code.makery.ch/library/javafx-8-tutorial/) by *Marco Jakob*.

#### Licence : [MIT](LICENSE)


text:
'use strict';

const mongoose = require('mongoose');
const bcrypt = require('bcrypt-nodejs');

/**
 * This is the configuration of the users that are allowed to connected to your authorization
 * server. These represent users of different client applications that can connect to the
 * authorization server. At a minimum you need the required properties of
 *
 * id       : A unique numeric id of your user
 * username : The user name of the user
 * password : The password of your user
 * name     : The name of your user
 */
/* const users = [{
  id       : '1',
  username : 'bob',
  password : 'secret',
  name     : 'Bob Smith',
}, {
  id       : '2',
  username : 'joe',
  password : 'password',
  name     : 'Joe Davis',
}]; */

const userSchema = mongoose.Schema({
  _id     : mongoose.Schema.Types.ObjectId,
  name    : String,
  username: { type: String, lowercase: true  },
  password: String,
  emails: [{
    email : { type: String, lowercase: true  },
    registrationDate : Date,
    confirmationDate : Date,
    confirmationToken : String,
    isConfirmed : { type: Boolean, default: false },
  }],
  masterApiKey : String,
});

userSchema.pre('save', function save(next) {
  const user = this;
  if (!user.isModified('password')) {
    next();
    return;
  }
  bcrypt.genSalt(10, (err, salt) => {
    if (err) {
      next(err);
      return;
    }
    bcrypt.hash(user.password, salt, undefined, (err1, hash) => {
      if (err1) {
        next(err);
        return;
      }
      user.password = hash;
      next();
    });
  });
});

userSchema.methods.comparePassword = function comparePassword(candidatePassword, cb) {
  bcrypt.compare(candidatePassword, this.password, (err, isMatch) => {
    cb(err, isMatch);
  });
};

const User = mongoose.model('User', userSchema);

/**
 * Returns a user if it finds one, otherwise returns null if a user is not found.
 * @param   {String}   _id - The unique id of the user to find
 * @returns {Promise} resolved user if found, otherwise resolves undefined
 */
exports.findUserById = _id => User.findById(_id).exec();

/**
 * Returns a user if it finds one, otherwise returns null if a user is not found.
 * @param   {String}   username - The unique user name to find
 * @param   {Function} done     - The user if found, otherwise returns undefined
 * @returns {Promise} resolved user if found, otherwise resolves undefined
 */
exports.findUserByUsername =
  username => User.findOne({ $or: [{ username }, { 'emails.email': { $in: [username] } }] }).exec();

exports.save = user => user.save(user);

exports.User = User;


text:
// -----------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// 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.
// -----------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.Batch.Models
{

    public class PSResourceFile
    {

        internal Microsoft.Azure.Batch.ResourceFile omObject;

        public PSResourceFile(string blobSource, string filePath, string fileMode = null)
        {
            this.omObject = new Microsoft.Azure.Batch.ResourceFile(blobSource, filePath, fileMode);
        }

        internal PSResourceFile(Microsoft.Azure.Batch.ResourceFile omObject)
        {
            if ((omObject == null))
            {
                throw new System.ArgumentNullException("omObject");
            }
            this.omObject = omObject;
        }

        public string BlobSource
        {
            get
            {
                return this.omObject.BlobSource;
            }
        }

        public string FileMode
        {
            get
            {
                return this.omObject.FileMode;
            }
        }

        public string FilePath
        {
            get
            {
                return this.omObject.FilePath;
            }
        }
    }
}


text:
<?php
session_start();
if(!isset($_SESSION['portcust']))
{
  header('Location: login.php');
  echo "Doh! You need to login!";
  exit();
}
require_once('../includes/database.php'); $db = database();
require_once('../includes/getconfig.php');
require_once('../includes/ipfunctions.php'); handleCFIPs();
require_once('../includes/hooks.php'); $hooks = new Hook();
?>
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Client Area | <?php echo $sitename; ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <link href="css/bootstrap.css" rel="stylesheet">

    <link href="css/bootstrap-responsive.css" rel="stylesheet">

    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="../assets/ico/favicon.png">

          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">

          </button>
          <?php echo $sitename; ?>

              <button class="btn btn-warning">Customer #<?php echo $_SESSION['portcust']; ?></button>

Home

Main Website

Main

Home

My Balance

Invoices

Support Tickets

              <?php
                $hooks->getHooks("client", "client_page_nav");
              ?>

My Invoices

              <?php
                if(isset($_GET['inv_id']))
                {
                  // Payment Processing VALID
                  $inv_id = $_GET['inv_id'];
                  $inv_type = $_GET['inv_type'];
                  $inv_ip = $_GET['ip'];
                  if(!is_numeric($inv_id) or !is_numeric($inv_type))
                  {
                    exit("You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near LIMIT 1");
                  }
                  if($inv_ip != $_SERVER['REMOTE_ADDR'])
                  {
                    exit("Purchase declined. IP mismatch.");
                  }
                  else
                  {
                    // Update invoice, generate ticket
                    $query = $db->prepare('UPDATE `customer_invoices` SET `status` = "1" WHERE `id` = ? AND `customer_id` = ?');
                    $query->execute(array($inv_id, $_SESSION['portcust']));
                    // Obtain customer email
                    $customer_id = $_SESSION['portcust'];
                    $qcust = $db->prepare('SELECT * FROM `customers` WHERE `customer_id` = ?');
                    $qcust->execute(array($customer_id));
                    foreach($qcust as $row)
                    {
                      $cust_email = $row['customer_email'];
                    }
                    $cust_msg = "Invoice #".$inv_id." paid successfully for customer #".$customer_id;
                    // Open support ticket
                    $qone = $db->prepare('INSERT INTO `support_tickets`(`id`, `name`, `email`, `message`, `status`) VALUES (NULL, ?, ?, ?, "0")');
                    $qone->execute(array($customer_id, $cust_email, $cust_msg));
                    // Tell customer it was paid successfully
                    echo "Invoice paid successfully. Please allow up to 24 hours for processing of purchase as we currently do anti-fraud checks.";
                  }
                }
                if(isset($_GET['do']))
                {
                  $do = $_GET['do'];
                  if($do == "pay")
                  {
                    $id = $_GET['id'];
                    if(!is_numeric($id))
                    {
                      // honeypot
                      exit("You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near LIMIT 1");
                    }
                    // send payment method options
                    $query = $db->prepare('SELECT * FROM `customer_invoices` WHERE `customer_id` = ? AND `id` = ?');
                    $query->execute(array($_SESSION['portcust'], $id));
                    foreach($query as $row)
                    {
                      $invoice_cost = $row['invoice_cost'];
                      $inv_type = $row['product_id'];
                    }
                    $hooks->getHooks("client", "client_invoicepayment_processing");
                    ?>
                    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
                    <input type="hidden" name="cmd" value="_xclick">
                    <input type="hidden" name="business" value="<?php echo $paypal_address; ?>">
                    <input type="hidden" name="lc" value="CA">
                    <input type="hidden" name="item_name" value="Payment for Invoice <?php echo $id; ?>">
                    <input type="hidden" name="amount" value="<?php echo $invoice_cost; ?>">
                    <input type="hidden" name="currency_code" value="USD">
                    <input type="hidden" name="button_subtype" value="services">
                    <input type="hidden" name="no_note" value="0">
                    <input type="hidden" name="cn" value="Add special instructions to the seller:">
                    <input type="hidden" name="no_shipping" value="2">
                    <input type="hidden" name="rm" value="1">
                    <input type="hidden" name="return" value="<?php echo $baseurl; ?>clients/invoices.php?inv_id=<?php echo $id; ?>&inv_type=<?php echo $inv_type; ?>&ip=<?php echo $_SERVER['REMOTE_ADDR']; ?>">
                    <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
                    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

                    </form>

                    <?php
                  }
                }
                $balquery = $db->prepare('SELECT * FROM `customer_invoices` WHERE `customer_id` = ? AND `status` = "0"');
                $balquery->execute(array($_SESSION['portcust']));
                foreach($balquery as $row)
                {
                  echo "Invoice #".$row['id']." - Amount: $".$row['invoice_cost']." ";
                  echo "
";
                }
              ?>

          <?php
            $hooks->getHooks("client", "page_content_below");
          ?>

© Company 2015


text:
class AddImageUrlColumnToUser < ActiveRecord::Migration
  def change
    add_column :users, :image_url, :string
  end
end


text:
<?php

namespace SabreForRainLoop\VObject\Parser;

abstract class Parser {

    /**
     * Turning on this option makes the parser more forgiving.
     *
     * In the case of the MimeDir parser, this means that the parser will
     * accept slashes and underscores in property names, and it will also
     * attempt to fix Microsoft vCard 2.1's broken line folding.
     */
    const OPTION_FORGIVING = 1;

    /**
     * If this option is turned on, any lines we cannot parse will be ignored
     * by the reader.
     */
    const OPTION_IGNORE_INVALID_LINES = 2;

    /**
     * Bitmask of parser options
     *
     * @var int
     */
    protected $options;

    /**
     * Creates the parser.
     *
     * Optionally, it's possible to parse the input stream here.
     *
     * @param mixed $input
     * @param int $options Any parser options (OPTION constants).
     * @return void
     */
    public function __construct($input = null, $options = 0) {

        if (!is_null($input)) {
            $this->setInput($input);
        }
        $this->options = $options;
    }

    /**
     * This method starts the parsing process.
     *
     * If the input was not supplied during construction, it's possible to pass
     * it here instead.
     *
     * If either input or options are not supplied, the defaults will be used.
     *
     * @param mixed $input
     * @param int|null $options
     * @return array
     */
    abstract public function parse($input = null, $options = null);

    /**
     * Sets the input data
     *
     * @param mixed $input
     * @return void
     */
    abstract public function setInput($input);

}


text:
package org.springframework.cache.ehcache;

import java.util.Collection;
import java.util.LinkedHashSet;

import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Status;

import org.springframework.cache.Cache;
import org.springframework.cache.transaction.AbstractTransactionSupportingCacheManager;
import org.springframework.util.Assert;

/**
 * CacheManager backed by an EhCache {@link net.sf.ehcache.CacheManager}.
 *
 * @author Costin Leau
 * @author Juergen Hoeller
 * @author Stephane Nicoll
 * @since 3.1
 */
public class EhCacheCacheManager extends AbstractTransactionSupportingCacheManager {

	private net.sf.ehcache.CacheManager cacheManager;

	/**
	 * Create a new EhCacheCacheManager, setting the target EhCache CacheManager
	 * through the {@link #setCacheManager} bean property.
	 */
	public EhCacheCacheManager() {
	}

	/**
	 * Create a new EhCacheCacheManager for the given backing EhCache CacheManager.
	 * @param cacheManager the backing EhCache {@link net.sf.ehcache.CacheManager}
	 */
	public EhCacheCacheManager(net.sf.ehcache.CacheManager cacheManager) {
		this.cacheManager = cacheManager;
	}

	/**
	 * Set the backing EhCache {@link net.sf.ehcache.CacheManager}.
	 */
	public void setCacheManager(net.sf.ehcache.CacheManager cacheManager) {
		this.cacheManager = cacheManager;
	}

	/**
	 * Return the backing EhCache {@link net.sf.ehcache.CacheManager}.
	 */
	public net.sf.ehcache.CacheManager getCacheManager() {
		return this.cacheManager;
	}

	@Override
	public void afterPropertiesSet() {
		if (getCacheManager() == null) {
			setCacheManager(EhCacheManagerUtils.buildCacheManager());
		}
		super.afterPropertiesSet();
	}

	@Override
	protected Collection<Cache> loadCaches() {
		Status status = getCacheManager().getStatus();
		Assert.isTrue(Status.STATUS_ALIVE.equals(status),
				"An 'alive' EhCache CacheManager is required - current cache is " + status.toString());

		String[] names = getCacheManager().getCacheNames();
		Collection<Cache> caches = new LinkedHashSet<Cache>(names.length);
		for (String name : names) {
			caches.add(new EhCacheCache(getCacheManager().getEhcache(name)));
		}
		return caches;
	}

	@Override
	protected Cache getMissingCache(String name) {
		// check the EhCache cache again
		// (in case the cache was added at runtime)
		Ehcache ehcache = getCacheManager().getEhcache(name);
		if (ehcache != null) {
			return new EhCacheCache(ehcache);
		}
		return null;
	}

}


text:
分享
再战

明日
再战

分享
再战

明日
再战

分享
再战

明日
再战

<% widget.scriptStart() %>

<% widget.scriptEnd() %>


text:
package DDG::Goodie::IsAwesome::AcriCAA;
# ABSTRACT: Write an abstract here
# Start at https://duck.co/duckduckhack/goodie_overview if you are new
# to instant answer development

use DDG::Goodie;
use strict;

zci answer_type => "is_awesome_acri_caa";
zci is_cached   => 1;

# Metadata.  See https://duck.co/duckduckhack/metadata for help in filling out this section.
name "IsAwesome AcriCAA";
description "Succinct explanation of what this instant answer does";
primary_example_queries "first example query", "second example query";
secondary_example_queries "optional -- demonstrate any additional triggers";
# Uncomment and complete: https://duck.co/duckduckhack/metadata#category
# category "";
# Uncomment and complete: https://duck.co/duckduckhack/metadata#topics
# topics "";
code_url "https://github.com/duckduckgo/zeroclickinfo-goodies/blob/master/lib/DDG/Goodie/IsAwesome/AcriCAA.pm";
attribution github => ["GitHubAccount", "Friendly Name"],
            twitter => "twitterhandle";

# Triggers
triggers start => "duckduckhack acricaa";

# Handle statement
handle remainder => sub {
    return if $_;
    return "AcriCAA is awesome and has successfully completed the DuckDuckHack Goodie tutorial!";
};

1;