text:
///////////////////////////////////////////////////////////////////////////////
//               Dem Bones - Skinning Decomposition Library                  //
//         Copyright (c) 2019, Electronic Arts. All rights reserved.         //
///////////////////////////////////////////////////////////////////////////////

#ifndef DEM_BONES_INDEXING
#define DEM_BONES_INDEXING

#ifdef _MSC_VER
#pragma warning(disable:4172)
#endif

#include <Eigen/Dense>

namespace Dem
{

/** NullaryOp forward mapping for matrix with row indices and column indices,
	check: https://eigen.tuxfamily.org/dox/TopicCustomizing_NullaryExpr.html
*/
template<class ArgType, class RowIndexType, class ColIndexType>
class indexing_functor_row_col {
	const ArgType &m_arg;
	const RowIndexType &m_rowIndices;
	const ColIndexType &m_colIndices;
public:
	typedef Eigen::Matrix<typename ArgType::Scalar,
		RowIndexType::SizeAtCompileTime,
		ColIndexType::SizeAtCompileTime,
		ArgType::Flags& Eigen::RowMajorBit?Eigen::RowMajor:Eigen::ColMajor,
		RowIndexType::MaxSizeAtCompileTime,
		ColIndexType::MaxSizeAtCompileTime> MatrixType;
	indexing_functor_row_col(const ArgType& arg, const RowIndexType& row_indices, const ColIndexType& col_indices)
		: m_arg(arg), m_rowIndices(row_indices), m_colIndices(col_indices) {}
	const typename ArgType::Scalar& operator() (Eigen::Index row, Eigen::Index col) const {
		return m_arg(m_rowIndices[row], m_colIndices[col]);
	}
};

/**	Function forward mapping for matrix with row indices and column indices,
	check: https://eigen.tuxfamily.org/dox/TopicCustomizing_NullaryExpr.html
*/
template <class ArgType, class RowIndexType, class ColIndexType>
Eigen::CwiseNullaryOp<indexing_functor_row_col<ArgType, RowIndexType, ColIndexType>, typename indexing_functor_row_col<ArgType, RowIndexType, ColIndexType>::MatrixType>
indexing_row_col(const Eigen::MatrixBase<ArgType>& arg, const RowIndexType& row_indices, const ColIndexType& col_indices) {
	typedef indexing_functor_row_col<ArgType, RowIndexType, ColIndexType> Func;
	typedef typename Func::MatrixType MatrixType;
	return MatrixType::NullaryExpr(row_indices.size(), col_indices.size(), Func(arg.derived(), row_indices, col_indices));
}

/** NullaryOp forward mapping for matrix with row indices,
	check: https://eigen.tuxfamily.org/dox/TopicCustomizing_NullaryExpr.html
*/
template<class ArgType, class RowIndexType>
class indexing_functor_row {
	const ArgType &m_arg;
	const RowIndexType &m_rowIndices;
public:
	typedef Eigen::Matrix<typename ArgType::Scalar,
		RowIndexType::SizeAtCompileTime,
		ArgType::ColsAtCompileTime,
		ArgType::Flags& Eigen::RowMajorBit?Eigen::RowMajor:Eigen::ColMajor,
		RowIndexType::MaxSizeAtCompileTime,
		ArgType::MaxColsAtCompileTime> MatrixType;
	indexing_functor_row(const ArgType& arg, const RowIndexType& row_indices)
		: m_arg(arg), m_rowIndices(row_indices) {}
	const typename ArgType::Scalar& operator() (Eigen::Index row, Eigen::Index col) const {
		return m_arg(m_rowIndices[row], col);
	}
};

/** Function forward mapping for matrix with row indices,
	check: https://eigen.tuxfamily.org/dox/TopicCustomizing_NullaryExpr.html
*/
template <class ArgType, class RowIndexType>
Eigen::CwiseNullaryOp<indexing_functor_row<ArgType, RowIndexType>, typename indexing_functor_row<ArgType, RowIndexType>::MatrixType>
indexing_row(const Eigen::MatrixBase<ArgType>& arg, const RowIndexType& row_indices) {
	typedef indexing_functor_row<ArgType, RowIndexType> Func;
	typedef typename Func::MatrixType MatrixType;
	return MatrixType::NullaryExpr(row_indices.size(), arg.cols(), Func(arg.derived(), row_indices));
}

/** NullaryOp forward mapping for vector with indices,
	check: https://eigen.tuxfamily.org/dox/TopicCustomizing_NullaryExpr.html
*/
template<class ArgType, class IndexType>
class indexing_functor_vector {
	const ArgType &m_arg;
	const IndexType &m_indices;
public:
	typedef Eigen::Matrix<typename ArgType::Scalar,
		IndexType::SizeAtCompileTime,
		1,
		Eigen::ColMajor,
		IndexType::MaxSizeAtCompileTime,
		1> VectorType;
	indexing_functor_vector(const ArgType& arg, const IndexType& indices)
		: m_arg(arg), m_indices(indices) {}
	const typename ArgType::Scalar& operator() (Eigen::Index idx) const {
		return m_arg(m_indices[idx]);
	}
};

/** Function forward mapping for vector with indices,
	check: https://eigen.tuxfamily.org/dox/TopicCustomizing_NullaryExpr.html
*/
template <class ArgType, class IndexType>
Eigen::CwiseNullaryOp<indexing_functor_vector<ArgType, IndexType>, typename indexing_functor_vector<ArgType, IndexType>::VectorType>
indexing_vector(const Eigen::MatrixBase<ArgType>& arg, const IndexType& indices) {
	typedef indexing_functor_vector<ArgType, IndexType> Func;
	typedef typename Func::VectorType VectorType;
	return VectorType::NullaryExpr(indices.size(), Func(arg.derived(), indices));
}

}

#endif


text:
namespace Sitecore.SharedSource.MobileDeviceDetector.Rules.Conditions
{
  using Sitecore.Rules;

  /// <summary>
  /// UserAgentCondition
  /// </summary>
  /// <typeparam name="T"></typeparam>
  public class HardwareVendorCondition<T> : StringPropertyCondition<T> where T : RuleContext
  {
    public HardwareVendorCondition()
    {
      this.Property = "HardwareVendor";
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<animation-list
	xmlns:android="http://schemas.android.com/apk/res/android"
  	android:oneshot="false">
    <item android:drawable="@drawable/progress_01" android:duration="200"/>
    <item android:drawable="@drawable/progress_02" android:duration="200"/>
    <item android:drawable="@drawable/progress_03" android:duration="200"/>
    <item android:drawable="@drawable/progress_04" android:duration="200"/>
    <item android:drawable="@drawable/progress_05" android:duration="200"/>
    <item android:drawable="@drawable/progress_06" android:duration="200"/>
    <item android:drawable="@drawable/progress_07" android:duration="200"/>
    <item android:drawable="@drawable/progress_08" android:duration="200"/>
    <item android:drawable="@drawable/progress_09" android:duration="200"/>
    <item android:drawable="@drawable/progress_10" android:duration="200"/>
    <item android:drawable="@drawable/progress_11" android:duration="200"/>
    <item android:drawable="@drawable/progress_12" android:duration="200"/>
</animation-list>


text:
<?php

//Configure the data to be sent
$to = 'sai.sudheer9@gmail.com';
$subject = 'New Message - IamSaiSudheer';
$fields = array(
                'name' => 'Sender Name ',
                'email' => 'Sender Email ',
                'message' => 'Message '
                );

//Success and Failure Message Content
$okMessage = 'Contact form successfully submitted. Thank you, I will get back to you soon!';
$errorMessage = 'There was an error while submitting the form. Please try again later';

//To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";

//Additional headers
$headers .= "From: " . strip_tags($_POST['email']) . "\r\n";
$headers .= "Reply-To: ". strip_tags($_POST['email']) . "\r\n";
$headers .= "CC: sai.sudheer9@yahoo.in\r\n";

try
{
    $message = "Hey Sai Sudheer !

 You have a message sent via IamSaiSudheer.com

";

    foreach ($_POST as $key => $value) {

        if (isset($fields[$key])) {
            $message .= "$fields[$key] : $value

";
        }
    }

    // Initiate the Mail Functionality
    mail($to, $subject, $message, $headers);
    $responseArray = array('type' => 'success', 'message' => $okMessage);
}
catch (Exception $e)
{
    $responseArray = array('type' => 'danger', 'message' => $errorMessage);
}

if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
    $encoded = json_encode($responseArray);

    header('Content-Type: application/json');

    echo $encoded;
}
else {
    echo $responseArray['message'];
}
?>


text:
import {DocumentBadgeComponent} from '@sanity/base'

export const PublishedStatusBadge: DocumentBadgeComponent = (props) => {
  return props.published
    ? {
        label: 'Published',
        color: 'success',
      }
    : null
}


text:
package me.reddev.osucelebrity.twitch;

import static me.reddev.osucelebrity.Commands.DOWNVOTE;
import static me.reddev.osucelebrity.Commands.UPVOTE;
import static me.reddev.osucelebrity.core.QQueuedPlayer.queuedPlayer;

import com.querydsl.jdo.JDOQuery;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.reddev.osucelebrity.AbstractIrcBot;
import me.reddev.osucelebrity.Commands;
import me.reddev.osucelebrity.OsuResponses;
import me.reddev.osucelebrity.Responses;
import me.reddev.osucelebrity.TwitchResponses;
import me.reddev.osucelebrity.UserException;
import me.reddev.osucelebrity.core.Clock;
import me.reddev.osucelebrity.core.QueueVote;
import me.reddev.osucelebrity.core.QueuedPlayer;
import me.reddev.osucelebrity.core.QueuedPlayer.QueueSource;
import me.reddev.osucelebrity.core.Spectator;
import me.reddev.osucelebrity.core.Trust;
import me.reddev.osucelebrity.core.VoteType;
import me.reddev.osucelebrity.osu.Osu;
import me.reddev.osucelebrity.osu.OsuStatus;
import me.reddev.osucelebrity.osu.OsuStatus.Type;
import me.reddev.osucelebrity.osu.OsuUser;
import me.reddev.osucelebrity.osuapi.OsuApi;
import me.reddev.osucelebrity.twitchapi.TwitchApi;
import org.pircbotx.Configuration;
import org.pircbotx.PircBotX;
import org.pircbotx.hooks.events.JoinEvent;
import org.pircbotx.hooks.events.MessageEvent;
import org.slf4j.Logger;
import org.tillerino.osuApiModel.GameModes;

import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;

import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.jdo.PersistenceManager;
import javax.jdo.PersistenceManagerFactory;

@Slf4j
@RequiredArgsConstructor(onConstructor = @__(@Inject))
public class TwitchIrcBot extends AbstractIrcBot {
  @FunctionalInterface
  interface CommandHandler {
    boolean handle(MessageEvent<PircBotX> event, String message, String twitchUserName,
        PersistenceManager pm) throws UserException, IOException;
  }

  @FunctionalInterface
  interface ConfirmedCommandHandler {
    void handle(MessageEvent<PircBotX> event, String arguments, String twitchUserName,
        PersistenceManager pm) throws UserException, IOException;
  }

  private final TwitchIrcSettings settings;

  private final OsuApi osuApi;

  private final TwitchApi twitchApi;

  private final Osu osu;

  private final PersistenceManagerFactory pmf;

  private final Spectator spectator;

  private final Clock clock;

  private final TwitchWhisperBot whisperBot;

  private final Trust trust;

  private final Twitch twitch;

  private final List<String> subscribers = new ArrayList<String>();

  private final List<CommandHandler> handlers = new ArrayList<>();

  {
    handlers.add(createHandler(false, this::handleQueue, Commands.QUEUE));
    handlers.add(this::handleVote);
    handlers.add(createHandler(false, this::handlePosition, Commands.POSITION));
    handlers.add(createHandler(false, this::handleNowPlaying, Commands.NOW_PLAYING));
    handlers.add(createHandler(false, this::handleReplaySpecific, Commands.REPLAY));
    handlers.add(createHandler(false, this::handleReplayCurrent, Commands.REPLAY_CURRENT));
    handlers.add(createHandler(false, this::handleLink, Commands.START_LINK));

    // MOD COMMANDS
    handlers.add(createHandler(true, this::handleAdvance, Commands.FORCESKIP));
    handlers.add(createHandler(true, this::handleForceSpec, Commands.FORCESPEC));
    handlers.add(createHandler(true, this::handleFixClient, Commands.RESTART_CLIENT));
    handlers.add(createHandler(true, this::handleBoost, Commands.BOOST));
    handlers.add(createHandler(true, this::handleTimeout, Commands.TIMEOUT));
    handlers.add(createHandler(true, this::handleBannedMapsFilter, Commands.ADD_BANNED_MAPS_FILTER));
    handlers.add(createHandler(true, this::handleGameMode, Commands.GAME_MODE));
    handlers.add(createHandler(true, this::handleExtend, Commands.EXTEND));
    handlers.add(createHandler(true, this::handleFreeze, Commands.FREEZE));
    handlers.add(createHandler(true, this::handleUnfreeze, Commands.UNFREEZE));
  }

  @Override
  protected Configuration<PircBotX> getConfiguration() {
    return new Configuration.Builder<PircBotX>()
            .setName(settings.getTwitchIrcUsername())
            .setLogin(settings.getTwitchIrcUsername())
            .addListener(this)
            .setServer(settings.getTwitchIrcHost(), settings.getTwitchIrcPort(),
                settings.getTwitchToken()).setAutoReconnect(true)
            .addAutoJoinChannel(settings.getTwitchIrcChannel()).buildConfiguration();
  }

  /**
   * Sends a message to the current IRC channel.
   *
   * @param message The message to send to the channel
   */
  public void sendMessage(String message) {
    getBot().sendIRC().message(settings.getTwitchIrcChannel(), message);
  }

  @Override
  public void onMessage(MessageEvent<PircBotX> event) {
    String message = event.getMessage();
    // Search through for command calls
    if (!message.startsWith(settings.getTwitchIrcCommand())) {
      log.debug("Received Twitch message from {}: {}", event.getUser().getNick(), message);
      return;
    }

    message = message.substring(settings.getTwitchIrcCommand().length());

    PersistenceManager pm = pmf.getPersistenceManager();
    try {
      for (CommandHandler commandHandler : handlers) {
        if (commandHandler.handle(event, message, event.getUser().getNick(), pm)) {
          return;
        }
      }
      log.debug("Received unknown twitch command from {}: {}", event.getUser().getNick(), message);
    } catch (Exception e) {
      Consumer<String> messager =
          x -> whisperBot.whisper(event.getUser().getNick(), x);
      UserException.handleException(log, e, messager);
    } finally {
      pm.close();
    }
  }

  void handleQueue(MessageEvent<PircBotX> event, String targetUser, String requesterNick,
      PersistenceManager pm) throws UserException, IOException {
    checkTrust(pm, requesterNick);

    // Permits: !spec username : reason
    // Example: !spec Tillerino: for awesomeness Keepo
    targetUser = targetUser.split(":")[0].trim();

    OsuUser requestedUser = getUserOrThrow(pm, targetUser, TimeUnit.DAYS.toMillis(1));
    QueuedPlayer queueRequest =
        new QueuedPlayer(requestedUser, QueueSource.TWITCH, clock.getTime());
    spectator.performEnqueue(pm, queueRequest, QueueVote.TWITCH + requesterNick, log,
        event::respond, msg -> whisperBot.whisper(requesterNick, msg));
  }

  void checkTrust(PersistenceManager pm, String subject) throws IOException, UserException {
    trust.checkTrust(pm, twitch.getUser(pm, subject, 60 * 1000L, true));
  }

  boolean handleVote(MessageEvent<PircBotX> event, String message, String twitchUserName,
      PersistenceManager pm) throws UserException, IOException {
    VoteType type = null;
    if (Commands.detect(message, UPVOTE) != null) {
      type = VoteType.UP;
    }
    if (Commands.detect(message, DOWNVOTE) != null) {
      type = VoteType.DOWN;
    }
    if (type == null) {
      return false;
    }
    log.debug("{} votes {}", twitchUserName, type);

    checkTrust(pm, twitchUserName);

    spectator.vote(pm, twitchUserName, type, event.getMessage());
    return true;
  }

  void requireMod(MessageEvent<PircBotX> event) throws UserException {
    if (!twitchApi.isModerator(event.getUser().getNick())) {
      throw new UserException("You're not a mod.");
    }
  }

  void handleAdvance(MessageEvent<PircBotX> event, String message, String twitchUserName,
      PersistenceManager pm) throws UserException, IOException {
    if (spectator.advanceConditional(pm, message)) {
      sendMessage(String.format(TwitchResponses.SKIPPED_FORCE, message, event.getUser()
          .getNick()));
    }
  }

  void handleForceSpec(MessageEvent<PircBotX> event, String message, String twitchUserName,
      PersistenceManager pm) throws UserException, IOException {
    OsuUser ircUser = getUserOrThrow(pm, message, TimeUnit.DAYS.toMillis(1));
    if (spectator.promote(pm, ircUser)) {
      sendMessage(String.format(TwitchResponses.SPECTATE_FORCE,
          event.getUser().getNick(), message));
    }
  }

  @Nonnull
  private OsuUser getUserOrThrow(PersistenceManager pm, String username, long maxAge)
      throws IOException, UserException {
    OsuUser ircUser = osuApi.getUser(username, pm, maxAge);
    if (ircUser == null) {
      throw new UserException(String.format(Responses.INVALID_USER, username));
    }
    return ircUser;
  }

  void handlePosition(MessageEvent<PircBotX> event, String message, String twitchUserName,
      PersistenceManager pm) throws UserException, IOException {
    OsuUser ircUser = getUserOrThrow(pm, message, 0);
    int position = spectator.getQueuePosition(pm, ircUser);
    if (position != -1) {
      event.getChannel().send().message(String.format(OsuResponses.POSITION,
          ircUser.getUserName(), position));
    } else {
      throw new UserException(String.format(OsuResponses.NOT_IN_QUEUE,
          ircUser.getUserName()));
    }
  }

  void handleNowPlaying(MessageEvent<PircBotX> event, String message, String twitchUserName,
      PersistenceManager pm) throws UserException, IOException {
    QueuedPlayer player = spectator.getCurrentPlayer(pm);
    if (player == null) {
      return;
    }

    OsuStatus status = osu.getClientStatus();
    String detail = status.getDetail();
    if (status.getType() != Type.PLAYING || detail == null) {
      return;
    }

    String formatted =
        String.format(OsuResponses.NOW_PLAYING, player.getPlayer().getUserName(),
                player.getPlayer().getUserId(), detail);
    Integer beatmapId = osu.getBeatmapId(detail);
    if (beatmapId != null) {
      formatted += " https://osu.ppy.sh/b/" + beatmapId;
    }
    event.getChannel().send().message(formatted);
  }

  void handleFixClient(MessageEvent<PircBotX> event, String message, String twitchUserName,
      PersistenceManager pm) throws UserException, IOException {
    try {
      osu.restartClient();
    } catch (InterruptedException e) {
      // w/e
    }
  }

  void handleBoost(MessageEvent<PircBotX> event, String boostedUser, String twitchUserName,
      PersistenceManager pm) throws UserException, IOException {
    spectator.boost(pm, getUserOrThrow(pm, boostedUser, 0));

    event.getChannel().send()
        .message(String.format(TwitchResponses.BOOST_QUEUE, boostedUser, event.getUser().getNick()));
  }

  void handleTimeout(MessageEvent<PircBotX> event, String message, String twitchUserName,
      PersistenceManager pm) throws UserException, IOException {
    String[] split = message.split(" ", 2);

    int minutes = Math.max(0, Integer.parseInt(split[0]));
    OsuUser timeoutUser = getUserOrThrow(pm, split[1], 0);

    timeoutUser.setTimeOutUntil(clock.getTime() + 60L * 1000 * minutes);

    event.getChannel().send()
        .message(String.format(TwitchResponses.TIMEOUT, timeoutUser.getUserName(), minutes));
  }

  void handleBannedMapsFilter(MessageEvent<PircBotX> event, String message,
      String twitchUserName, PersistenceManager pm) throws UserException, IOException {
    spectator.addBannedMapFilter(pm, message);

    event.getChannel().send().message(String.format(TwitchResponses.ADDED_BANNED_MAPS_FILTER));
  }

  void handleGameMode(MessageEvent<PircBotX> event, String message,
      String twitchUserName, PersistenceManager pm) throws UserException, IOException {
    String[] split = message.split(" ", 2);

    OsuUser user = getUserOrThrow(pm, split[1], 0);

    if (split[0].equalsIgnoreCase("osu")) {
      user.setGameMode(GameModes.OSU);
    } else if (split[0].equalsIgnoreCase("taiko")) {
      user.setGameMode(GameModes.TAIKO);
    } else if (split[0].equalsIgnoreCase("ctb")) {
      user.setGameMode(GameModes.CTB);
    } else if (split[0].equalsIgnoreCase("mania")) {
      user.setGameMode(GameModes.MANIA);
    } else {
      throw new UserException("Unknown game mode.");
    }

    event.getChannel().send().message(Responses.GAME_MODE_CHANGED);
  }

  void handleExtend(MessageEvent<PircBotX> event, String targetUser,
      String twitchUserName, PersistenceManager pm) throws UserException, IOException {
    spectator.extendConditional(pm, targetUser);
  }

  void handleFreeze(MessageEvent<PircBotX> event, String message,
      String twitchUserName, PersistenceManager pm) throws UserException, IOException {
    spectator.setFrozen(true);
  }

  void handleUnfreeze(MessageEvent<PircBotX> event, String message,
      String twitchUserName, PersistenceManager pm) throws UserException, IOException {
    spectator.setFrozen(false);
  }

  void handleLink(MessageEvent<PircBotX> event, String message,
      String twitchUserName, PersistenceManager pm) throws UserException, IOException {
    TwitchUser user = twitch.getUser(pm, twitchUserName, 60 * 1000L, true);

    if (user.getOsuUser() != null) {
      throw new UserException("Your account is already linked.");
    }

    user.setLinkString(UUID.randomUUID().toString());

    whisperBot.whisper(twitchUserName,
        String.format(TwitchResponses.LINK_INSTRUCTIONS, user.getLinkString()));
  }

  void handleReplayCurrent(MessageEvent<PircBotX> event, String message,
      String twitchUserName, PersistenceManager pm) throws UserException, IOException {
    QueuedPlayer currentPlayer = spectator.getCurrentPlayer(pm);
    if (currentPlayer == null) {
      return;
    }

    URL replayLink = twitchApi.getReplayLink(currentPlayer);
    if (replayLink == null) {
      throw new UserException(String.format(Responses.REPLAY_NOT_FOUND, currentPlayer.getPlayer()
          .getUserName()));
    }

    event
        .getChannel()
        .send()
        .message(
            String.format(TwitchResponses.REPLAY, currentPlayer.getPlayer().getUserName(),
                replayLink.toString()));
  }

  void handleReplaySpecific(MessageEvent<PircBotX> event, String targetPlayer,
      String twitchUserName, PersistenceManager pm) throws UserException, IOException {
    QueuedPlayer player;
    try (JDOQuery<QueuedPlayer> query = new JDOQuery<>(pm).select(queuedPlayer).from(queuedPlayer)) {
      player =
          query
              .where(
                  queuedPlayer.player.userName.toLowerCase().eq(targetPlayer.trim().toLowerCase()),
                  queuedPlayer.state.loe(QueuedPlayer.SPECTATING)).orderBy(queuedPlayer.id.desc())
              .fetchFirst();
    }

    if (player == null) {
      throw new UserException(String.format(Responses.REPLAY_NOT_FOUND, targetPlayer));
    }

    URL replayLink = twitchApi.getReplayLink(player);
    if (replayLink == null) {
      throw new UserException(String.format(Responses.REPLAY_NOT_FOUND, player.getPlayer().getUserName()));
    }

    event
        .getChannel()
        .send()
        .message(
            String.format(TwitchResponses.REPLAY, player.getPlayer().getUserName(),
                replayLink.toString()));
  }

  @Override
  public void onJoin(JoinEvent<PircBotX> event) {
    if (event.getUser().getLogin().equalsIgnoreCase(settings.getTwitchIrcUsername())) {
      // Ask for subscription and admin information
      event.getBot().sendRaw().rawLine("CAP REQ :twitch.tv/membership");
      log.info(String.format("Joined %s", event.getChannel().getName()));
    }
  }

  // End Listeners

  /**
   * @return The list of subscribers in the IRC channel.
   */
  public List<String> getSubscribers() {
    return subscribers;
  }

  CommandHandler createHandler(boolean requiresMod, ConfirmedCommandHandler handler,
      String... triggers) {
    return (event, message, twitchUserName, pm) -> {
      String remainingMessage = Commands.detect(message, triggers);
      if (remainingMessage == null) {
        return false;
      }
      if (requiresMod) {
        requireMod(event);
      }
      log.debug("{} invokes {}{}", twitchUserName, settings.getTwitchIrcCommand(), message);
      handler.handle(event, remainingMessage, twitchUserName, pm);
      return true;
    };
  }

  @Override
  protected Logger getLog() {
    return log;
  }
}


text:
{{ extend 'layout.html' }}
{{ include 'catalog.html' }}

Product Categories:

{{ show(categories, function='category') }}

{{ if featured: }}

Featured Products

    {{ show(featured) }}
{{ pass }}


text:
var Transform = require('pipestream').Transform;
var util = require('../util');
var config = require('../config');
var HTTPS_FIELD = config.HTTPS_FIELD;
var HTTPS_FLAG = config.HTTPS_FLAG;
var HTTPS_FLAG_LEN = HTTPS_FLAG.length;
var HTTPS_RE = /https:(\/\/|\\\/\\\/)/ig;
var RESET_COOKIE_RE = /secure;?|domain=([^;]*);?/ig;

function getTransform() {
	var transform = new Transform();
	var rest = '';
	transform._transform = function(chunk, encoding, callback) {
		if (chunk) {
			rest = chunk = (rest + chunk).replace(HTTPS_RE, 'http:$1' + HTTPS_FLAG);
			var len = chunk.length - 7;
			if (len > 0) {
				rest = chunk.substring(len);
				chunk = chunk.substring(0, len);
			} else {
				chunk = null;
			}
		} else {
			chunk = rest || null;
		}
		callback(null, chunk);
	};
	return transform;
}

module.exports = function(req, res, next) {
	if (req.headers[HTTPS_FIELD] || req.socket.isHttps) {//防止socket长连接导致新请求的头部无法加util.HTTPS_FIELD
		req.socket.isHttps = true;
		req.isHttps = true;
		delete req.headers[HTTPS_FIELD];
	} else {
		var host = req.headers.host;
		var isHttps = host && host.indexOf(HTTPS_FLAG) == 0 && host.indexOf('.', HTTPS_FLAG_LEN) != -1;
		if (isHttps) {
			host = req.headers.host = host.substring(HTTPS_FLAG_LEN);
			req.isHttps = req.isWhistleHttps = true;
			var referer = req.headers.referer;
			if (referer) {
				req.headers.referer = referer.replace('http://' + HTTPS_FLAG, 'https://');
			}

			res.on('src', function(_res) {
				var headers = _res.headers;
				if (/^https:\/\//i.test(headers.location)) {
					headers.location = 'http:' + HTTPS_FLAG + util.removeProtocol(headers.location, true);
				}

				var cookies = headers['set-cookie'];
				if (Array.isArray(cookies)) {
					host = host.split(':')[0].split('.');
					host = '.' + host.slice(host.length - 2).join('.');
					headers['set-cookie'] = cookies.map(function(cookie) {
						return cookie.replace(RESET_COOKIE_RE, '') + '; DOMAIN=' + host + ';';
					});
				}

				if (util.supportHtmlTransform(_res)) {
					res.addTextTransform(getTransform(), true);
				}
			});
		}
	}

	next();
};


text:
require 'euler003'

describe 'Euler 003 solution' do
  it 'should calculate 003 correctly' do
    expect(largest_prime_number(600_851_475_143)).to eq 6857
  end
end


text:
(function () { "use strict";
function $extend(from, fields) {
	function Inherit() {} Inherit.prototype = from; var proto = new Inherit();
	for (var name in fields) proto[name] = fields[name];
	if( fields.toString !== Object.prototype.toString ) proto.toString = fields.toString;
	return proto;
}
var Main = function() {
	this.game = new Phaser.Game(960,640,Phaser.AUTO,"game",{ preload : $bind(this,this.preload), create : $bind(this,this.create), update : $bind(this,this.update), render : $bind(this,this.render)});
};
Main.__name__ = true;
Main.main = function() {
	new Main();
};
Main.prototype = {
	preload: function() {
		this.game.load.image("cube","assets/cube.png");
		this.game.time.advancedTiming = true;
		this.game.plugins.add(new Phaser.Plugin.Isometric(this.game));
		this.game.iso.anchor.setTo(0.5,0.2);
	}
	,create: function() {
		this.isoGroup = this.game.add.group();
		var cube;
		var xx = 256;
		var yy;
		while(xx > 0) {
			yy = 256;
			while(yy > 0) {
				cube = new MyIsoSprite(this.game,xx,yy,0,"cube",0);
				this.game.add.existing(cube);
				this.isoGroup.add(cube);
				cube.oldZ = cube.z;
				this.game.add.tween(cube).to({ isoZ : 10},100 * ((xx + yy) % 10),Phaser.Easing.Quadratic.InOut,true,0,Math.POSITIVE_INFINITY,true);
				yy -= 48;
			}
			xx -= 48;
		}
		this.sorted = false;
		this.game.input.onDown.add($bind(this,this.onDown));
	}
	,onDown: function() {
		this.sorted = !this.sorted;
		if(this.sorted) this.game.iso.simpleSort(this.isoGroup); else this.isoGroup.sort("oldZ");
	}
	,update: function() {
	}
	,render: function() {
		this.game.debug.text("Click to toggle! Sorting enabled: " + Std.string(this.sorted),2,36,"#ffffff");
		this.game.debug.text(Std.string(this.game.time.fps),2,14,"#a7aebe");
	}
};
Math.__name__ = true;
var MyIsoSprite = function(game,x,y,z,key,frame) {
	Phaser.Plugin.Isometric.IsoSprite.call(this,game,x,y,z,key,frame);
	this.anchor.set(0.5);
};
MyIsoSprite.__name__ = true;
MyIsoSprite.__super__ = Phaser.Plugin.Isometric.IsoSprite;
MyIsoSprite.prototype = $extend(Phaser.Plugin.Isometric.IsoSprite.prototype,{
});
var Std = function() { };
Std.__name__ = true;
Std.string = function(s) {
	return js.Boot.__string_rec(s,"");
};
var js = {};
js.Boot = function() { };
js.Boot.__name__ = true;
js.Boot.__string_rec = function(o,s) {
	if(o == null) return "null";
	if(s.length >= 5) return "<...>";
	var t = typeof(o);
	if(t == "function" && (o.__name__ || o.__ename__)) t = "object";
	switch(t) {
	case "object":
		if(o instanceof Array) {
			if(o.__enum__) {
				if(o.length == 2) return o[0];
				var str = o[0] + "(";
				s += "\t";
				var _g1 = 2;
				var _g = o.length;
				while(_g1 < _g) {
					var i = _g1++;
					if(i != 2) str += "," + js.Boot.__string_rec(o[i],s); else str += js.Boot.__string_rec(o[i],s);
				}
				return str + ")";
			}
			var l = o.length;
			var i1;
			var str1 = "[";
			s += "\t";
			var _g2 = 0;
			while(_g2 < l) {
				var i2 = _g2++;
				str1 += (i2 > 0?",":"") + js.Boot.__string_rec(o[i2],s);
			}
			str1 += "]";
			return str1;
		}
		var tostr;
		try {
			tostr = o.toString;
		} catch( e ) {
			return "???";
		}
		if(tostr != null && tostr != Object.toString) {
			var s2 = o.toString();
			if(s2 != "[object Object]") return s2;
		}
		var k = null;
		var str2 = "{\n";
		s += "\t";
		var hasp = o.hasOwnProperty != null;
		for( var k in o ) {
		if(hasp && !o.hasOwnProperty(k)) {
			continue;
		}
		if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") {
			continue;
		}
		if(str2.length != 2) str2 += ", \n";
		str2 += s + k + " : " + js.Boot.__string_rec(o[k],s);
		}
		s = s.substring(1);
		str2 += "\n" + s + "}";
		return str2;
	case "function":
		return "<function>";
	case "string":
		return o;
	default:
		return String(o);
	}
};
var phaser = {};
phaser.plugin = {};
phaser.plugin.isometric = {};
phaser.plugin.isometric.IsoUtils = function() { };
phaser.plugin.isometric.IsoUtils.__name__ = true;
phaser.plugin.isometric.IsoUtils.octree = function(obj,octree,color) {
	if(color == null) color = "rgba(255,0,0,0.3)";
	return obj.octree(octree,color);
};
phaser.plugin.isometric.IsoUtils.iso = function(obj) {
	return obj.iso;
};
phaser.plugin.isometric.IsoUtils.isoArcade = function(obj) {
	return obj.isoArcade;
};
phaser.plugin.isometric.IsoUtilsGameObjectCreator = function() { };
phaser.plugin.isometric.IsoUtilsGameObjectCreator.__name__ = true;
phaser.plugin.isometric.IsoUtilsGameObjectCreator.isoSprite = function(obj,x,y,z,key,frame) {
	return obj.isoSprite(x,y,z,key,frame);
};
phaser.plugin.isometric.IsoUtilsGameObjectFactory = function() { };
phaser.plugin.isometric.IsoUtilsGameObjectFactory.__name__ = true;
phaser.plugin.isometric.IsoUtilsGameObjectFactory.isoSprite = function(obj,x,y,z,key,frame,group) {
	return obj.isoSprite(x,y,z,key,frame,group);
};
phaser.plugin.isometric.IsoUtilsDebug = function() { };
phaser.plugin.isometric.IsoUtilsDebug.__name__ = true;
phaser.plugin.isometric.IsoUtilsDebug.isoSprite = function(obj,sprite,color,filled) {
	if(filled == null) filled = true;
	if(color == null) color = "rgba(0,255,0,0.4)";
	return obj.isoSprite(sprite,color,filled);
};
var $_, $fid = 0;
function $bind(o,m) { if( m == null ) return null; if( m.__id__ == null ) m.__id__ = $fid++; var f; if( o.hx__closures__ == null ) o.hx__closures__ = {}; else f = o.hx__closures__[m.__id__]; if( f == null ) { f = function(){ return f.method.apply(f.scope, arguments); }; f.scope = o; f.method = m; o.hx__closures__[m.__id__] = f; } return f; }
Math.NaN = Number.NaN;
Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
Math.isFinite = function(i) {
	return isFinite(i);
};
Math.isNaN = function(i1) {
	return isNaN(i1);
};
String.__name__ = true;
Array.__name__ = true;
Main.main();
})();


text:
var twitterUsername='hankewins';//Your twitter username to fetch tweets.
var latitude=22.5393;//Langitude and latitude of place that you want tobe shown in contact form.
var longitude=114.0212;//Langitude and latitude of place that you want tobe shown in contact form.

$(document).ready(function() {
$("a[rel^='prettyPhoto']").prettyPhoto();
    function showPageElements(pageSelector){
        var counter=1;
        var elementCount= $(pageSelector).find('.hide-show').length;
        $(pageSelector).find('.hide-show').each(function(){
            var el=$(this);

            var delay=counter*120;
            counter = counter<elementCount ? counter+1 : counter;

         fadeIn(el,delay,elementCount);

        })
    }

    setTimeout(function() {

        $('.vcard-title').addClass('animated fadeInRight');

    }, 500);
    setTimeout(function() {

        $('.footer-holder').addClass('animated fadeInRight');

    }, 800);
    setTimeout(function() {

        showPageElements('.page-homepage');

    }, 1000);

    setTimeout(function() {

       // $('.current-page').find('.promo-block-1x1,.promo-block-2x1,.promo-block-2x2,.back-button-holder,.promo-block-long').addClass('transition');
        $("body").append(twitterScript);
      //  $('.slider-block').addClass('open');
         $('.slider-block i').animate({
          bottom: '15px',
    'font-size': '26px',
    right: '21px'
      });
        var slidersCounter=1;
           $('.blueberry').each(function(){
                $(this).removeClass('hidden').blueberry({

            interval:((slidersCounter%6)+1)*2000,
            pager:false
        });
        slidersCounter++;
           })

    }, 3000);

   var tweetsHtml;
    //This method parse the json file into tweet area
    parseTweets= function (twitters) {

        var statusHTML = [];
        for (var i=0; i<twitters.length; i++){
            var username = twitters[i].user.screen_name;
            var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) {
                return ''+url+'';
            }).replace(/\B@([_a-z0-9]+)/ig, function(reply) {
                return  reply.charAt(0)+''+reply.substring(1)+'';
            });
            if(i==1){
                statusHTML.push('
'+status+'
');
            }else{
                statusHTML.push('
'+status+'
');
            }

        }
        tweetsHtml=statusHTML.join('');

       checkTwitterModule();

    }

function checkTwitterModule(){

 if($('.current-page').length>0 &&  !$('.current-page .twitter-block').hasClass('open')){

    //  $('.current-page .twitter-block').addClass('open');

      $('.current-page .twitter-block i').animate({
          bottom: '15px',
    'font-size': '26px',
    right: '21px'
      });
             $('.current-page .tweets-holder ul').html(tweetsHtml);

        $('.current-page .tweets-holder').removeClass('hidden');

        }else{
            $('.current-page .tweets-holder ul').html('');
             $('.current-page .tweets-holder ul').html(tweetsHtml);

        }

          swapTweet();
}
    //Embed and shows your two recent tweets

    var twitterScript = document.createElement("script");
    twitterScript.type = "text/javascript";
    //twitterScript.src = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name="+twitterUsername+"&count=2&callback=parseTweets";

    //   =====================================================

    // Swap the tweets
    var swapTweet=function swapTweet() {
var hiddenTweet=$('.current-page .tweets-holder li.hide');
var visibleTweet=$('.current-page .tweets-holder li').not('.current-page .tweets-holder li.hide');
setTimeout(function(){
  visibleTweet.stop(true).fadeOut(function(){
             setTimeout(function(){
                  hiddenTweet.stop(true).fadeIn(
                function(){
                    visibleTweet.addClass('hide');
                     hiddenTweet.removeClass('hide');

              swapTweet();
                }
                );

             }, 1000)

            });

},1000)

    }

    //   =====================================================
   var horizontalScrollIsReady=false;
   var portfolioPageIsReady=false;
    var currentlyOpenPageID=$('.page-homepage').attr('id');

    $('.nav-link').click(function(event){
        event.preventDefault();
        var targetPageID=$(this).attr('data-opening-page-id');

        showPage(targetPageID,$('.current-page'));
    })
        var interestsPageIsReady=false;
    function showPage(openingPageID,closingPage){

        var counter=1;
        //close page

        var closeElementCount= $(closingPage).find('.hide-show').length;
        $(closingPage).find('.hide-show').each(function(){
            var el=$(this);

            var delay=counter*100;

            counter = counter<closeElementCount ? counter+1 : counter;
       //  el.removeClass('transition');

         fadeOut(el,delay,closeElementCount);

        });

        $('body').bind('closingFinished',function() {
          $('body').unbind('closingFinished');
              var openingPage=$('#'+openingPageID);
              $(closingPage).removeClass('current-page');
              $(openingPage).addClass('current-page');
            //   console.log('closedNow',closingPage,openingPage);
            counter=1;

            //open page
            var openElementCount= $(openingPage).find('.hide-show').length;
            $(openingPage).find('.hide-show').each(function(){
                var el=$(this);

                var delay=counter*120;
                counter = counter<openElementCount ? counter+1 : counter;
         fadeIn(el,delay,openElementCount);

            })

        });

    $('body').bind('openingFinished',function(){

      $('body').unbind('openingFinished');

                 if($('.current-page').hasClass('interests-page')){
//console.log('Interests Setup Now');
                     setupInterestsPage();

                     }

                      if($('.current-page').hasClass('portfolio-page')){
//console.log('Portfolio Setup Now');
                     setupPortfolioPage();

                     }

//checkTwitterModule();
antiscrollSetup();

checkGoogleMap();
    })
      }

   var fadeOutCounter=0;

    function fadeOut(element,delay,maxElements){

         fadeOutCounter=maxElements <fadeOutCounter ? 0 : fadeOutCounter;
         var cleft=parseInt(element.css('left'));

       element.stop(true,true,true).delay(delay).animate({
           'left':cleft-10,
           opacity:0
       },500,'linear',function(){

          fadeOutCounter++;

          if(fadeOutCounter==maxElements){

              $('body').trigger('closingFinished');
               //$('body').die('closingFinished');

              fadeOutCounter=0;
          }
           // element.addClass('hidden').addClass('invisible');

       });

    }
    var fadeInCounter=0;
    function fadeIn(element,delay,maxElements){
        fadeInCounter=maxElements <fadeInCounter ? 0 : fadeInCounter;

      element.removeClass('hidden').removeClass('invisible');
        element.css('left',0).css('opacity',0);
                             var antiEl=$('.current-page').find('.antiscroll-inner');
           antiEl.scrollLeft(0);

        var cleft=parseInt(element.css('left'));
        element.css('left',cleft+10);
       element.stop(true,true).delay(delay).animate({
           'left':cleft,
           opacity:1
       },500,'linear',function(){

           fadeInCounter++;
            if(fadeInCounter==maxElements){
                fadeInCounter=0;
              $('body').trigger('openingFinished')
          }

       });
//       console.log(fadeInCounter)
    }

      var gmapIsActive=new Array();
   function checkGoogleMap(){
        if($('.current-page').find('.map-holder').length>0 && gmapIsActive[$('.current-page').attr('ID')]==undefined){

    setTimeout(function(){

           gmapIsActive[$('.current-page').attr('ID')]=true;

$('.map-holder').gmap3({
 map:{
    options:{
     center:[latitude, longitude],

     zoom:6,
      mapTypeControl: false,

     navigationControl: false,
     scrollwheel: true,
     streetViewControl: false
    }
 },
 marker:{
    latLng:[latitude, longitude]
 }
});
      }, 500);

        }
   }

    var antiscrollIsActive=new Array();
   function antiscrollSetup(){

       var el=$('.current-page').find('.antiscroll-wrap');
     el.removeClass('init');
     el.find('.init').removeClass('init');
       if(el.length>0 && antiscrollIsActive[$('.current-page').attr('ID')]==undefined){

            el.antiscroll();
           antiscrollIsActive[$('.current-page').attr('ID')]=true;

 }
   }

   function setupInterestsPage(){
      if(!interestsPageIsReady){
           interestsPageIsReady=true;
       var el=$('.interest-holder');
       var widthToBe=el.length*(el.width()+parseInt(el.css('margin-left'))+parseInt(el.css('margin-right')) );
       $('.interests-page .scroll-holder').width(widthToBe);

                   horizontalScrollSetup('interest');

      }

   }

      function setupPortfolioPage(){
      if(!portfolioPageIsReady){
            portfolioPageIsReady=true;

       var el=$('.current-page .horizontal-scroll-item ');

       var widthToBe=el.length*(el.width()+parseInt(el.next().css('margin-left'))+parseInt(el.next().css('margin-right')) );
       $('.current-page .scroll-holder').width(widthToBe);

       horizontalScrollSetup('portfolio');
      }
//      console.log(portfolioPageIsReady);
   }
    //  triggers contact form validation
    var formStatus=$("#contact-form").validate();
    //   =====================================================

    //sending contact form
    $("#contact-form").submit(function(e){
        e.preventDefault();
        if(formStatus.errorList.length==0){
            $("#contact-form .submit").fadeOut(function(){
                $('#loading').css('visibility','visible');
                $.post('feedback',$("#contact-form").serialize(),function(){
                    $("#contact-form").hide('slow').after('
感谢您的反馈!
');
                    $('#loading').css('visibility','hidden');
                    $("#contact-form .submit").removeClass('disabled');
                });
            });
        }

    })
    //   =====================================================

function horizontalScrollSetup(id){
    var horizonScroll=$('.current-page .antiscroll-wrap');
    var antiEl=$('.current-page').find('.antiscroll-inner');
    var blocksWidth=new Array();
    var index=id;

    blocksWidth[index]=0;
    horizonScroll.find('.horizontal-scroll-item').each(function(){
        blocksWidth[index]+= $(this).width()+parseInt($(this).css('margin-left'))+parseInt($(this).css('margin-right'));
    });

    var initLeft=antiEl.scrollLeft();

    $('.horizontal-scroll').parent().parent().bind('mousewheel',{minLeft:initLeft,index:index},function (event, delta) {
        event.preventDefault();
        var minLeft=event.data.minLeft;
        var index=event.data.index;

        var currentLeft = new Array();
        var maxLeft=new Array();

        currentLeft[index]=antiEl.scrollLeft();
        currentLeft[index] -= (delta * 10);
        //  console.log(index,currentLeft[index],delta);
        antiEl.scrollLeft(currentLeft[index]);
    });
}

$('a.normal-link').click(function(){

 //alert('This is a normal Hyperlink!');
});

})


text:
package org.apache.servicecomb.serviceregistry.task;

import org.apache.servicecomb.serviceregistry.event.ExceptionEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;

public class ServiceCenterTask implements Runnable {
  private static final Logger LOGGER = LoggerFactory.getLogger(ServiceCenterTask.class);

  private EventBus eventBus;

  private int interval;

  private MicroserviceServiceCenterTask microserviceServiceCenterTask;

  private boolean registerInstanceSuccess = false;

  private ServiceCenterTaskMonitor serviceCenterTaskMonitor = new ServiceCenterTaskMonitor();

  public ServiceCenterTask(EventBus eventBus, int interval,
      MicroserviceServiceCenterTask microserviceServiceCenterTask) {
    this.eventBus = eventBus;
    this.interval = interval;
    this.microserviceServiceCenterTask = microserviceServiceCenterTask;

    this.eventBus.register(this);
  }

  // messages given in register error
  @Subscribe
  public void onRegisterTask(AbstractRegisterTask task) {
    LOGGER.info("read {} status is {}", task.getClass().getSimpleName(), task.taskStatus);
    if (task.getTaskStatus() == TaskStatus.FINISHED) {
      registerInstanceSuccess = true;
    } else {
      onException();
    }
  }

  // messages given in heartbeat
  @Subscribe
  public void onMicroserviceInstanceHeartbeatTask(MicroserviceInstanceHeartbeatTask task) {
    if (task.getHeartbeatResult() != HeartbeatResult.SUCCESS) {
      LOGGER.info("read MicroserviceInstanceHeartbeatTask status is {}", task.taskStatus);
      onException();
    }
  }

  // messages given in watch error
  @Subscribe
  public void onExceptionEvent(ExceptionEvent event) {
    LOGGER.info("read exception event, message is :{}", event.getThrowable().getMessage());
    onException();
  }

  private void onException() {
    if (registerInstanceSuccess) {
      registerInstanceSuccess = false;
    }
  }

  public void init() {
    microserviceServiceCenterTask.run();
  }

  @Override
  public void run() {
    try {
      serviceCenterTaskMonitor.beginCycle(interval);
      microserviceServiceCenterTask.run();
      serviceCenterTaskMonitor.endCycle();
    } catch (Throwable e) {
      LOGGER.error("unexpected exception caught from service center task. ", e);
    }
  }

  @VisibleForTesting
  public boolean isRegisterInstanceSuccess() {
    return this.registerInstanceSuccess;
  }
}


text:
package com.yuqirong.rxnews.module.news.view;

import com.yuqirong.rxnews.event.NewsDetailEvent;

/**
 * Created by Anyway on 2016/3/9.
 */
public interface INewsDetailView {

    public void showLoading();

    public void closeLoading();

    public void showSuccess(NewsDetailEvent event);

    public void showError();
}


text:
angular.module('puszekApp')
    .directive('pIcon', function pIconDirective(Config) {
        return {
            restrict: 'E',
            scope: {
                src: '@'
            },
            template: '<ng-include src="getPath()"></ng-include>',
            transclude: true,
            link: function(scope, element, attributes) {
                scope.getPath = function() {
                    return Config.basePath + attributes.src;
                }
            }
        };
    });


text:
/****** Object:  StoredProcedure [AddA07_Country_ReChild] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[AddA07_Country_ReChild]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [AddA07_Country_ReChild]
GO

CREATE PROCEDURE [AddA07_Country_ReChild]
    @Country_ID2 int,
    @Country_Child_Name varchar(50)
AS
    BEGIN

        SET NOCOUNT ON

        /* Insert object into 3_Countries_ReChild */
        INSERT INTO [3_Countries_ReChild]
        (
            [Country_ID2],
            [Country_Child_Name]
        )
        VALUES
        (
            @Country_ID2,
            @Country_Child_Name
        )

    END
GO

/****** Object:  StoredProcedure [UpdateA07_Country_ReChild] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[UpdateA07_Country_ReChild]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [UpdateA07_Country_ReChild]
GO

CREATE PROCEDURE [UpdateA07_Country_ReChild]
    @Country_ID2 int,
    @Country_Child_Name varchar(50)
AS
    BEGIN

        SET NOCOUNT ON

        /* Check for object existence */
        IF NOT EXISTS
        (
            SELECT [Country_ID2] FROM [3_Countries_ReChild]
            WHERE
                [Country_ID2] = @Country_ID2
        )
        BEGIN
            RAISERROR ('''A07_Country_ReChild'' object not found. It was probably removed by another user.', 16, 1)
            RETURN
        END

        /* Update object in 3_Countries_ReChild */
        UPDATE [3_Countries_ReChild]
        SET
            [Country_Child_Name] = @Country_Child_Name
        WHERE
            [Country_ID2] = @Country_ID2

    END
GO

/****** Object:  StoredProcedure [DeleteA07_Country_ReChild] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[DeleteA07_Country_ReChild]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [DeleteA07_Country_ReChild]
GO

CREATE PROCEDURE [DeleteA07_Country_ReChild]
    @Country_ID2 int
AS
    BEGIN

        SET NOCOUNT ON

        /* Check for object existence */
        IF NOT EXISTS
        (
            SELECT [Country_ID2] FROM [3_Countries_ReChild]
            WHERE
                [Country_ID2] = @Country_ID2
        )
        BEGIN
            RAISERROR ('''A07_Country_ReChild'' object not found. It was probably removed by another user.', 16, 1)
            RETURN
        END

        /* Delete A07_Country_ReChild object from 3_Countries_ReChild */
        DELETE
        FROM [3_Countries_ReChild]
        WHERE
            [3_Countries_ReChild].[Country_ID2] = @Country_ID2

    END
GO


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;

using SlimDX;
using SlimDX.Direct3D11;

using VVVV.PluginInterfaces.V2;
using VVVV.PluginInterfaces.V1;

using FeralTic.DX11;
using FeralTic.DX11.Resources;

namespace VVVV.DX11.Nodes.Geometry
{
    [PluginInfo(Name = "BoundingBox", Category = "DX11.Geometry", Version = "Set", Author = "vux")]
    public class SetBoundingBoxGeometryNode : IPluginEvaluate, IDX11ResourceHost
    {
        [Input("Geometry In", CheckIfChanged = true)]
        protected Pin<DX11Resource<IDX11Geometry>> FInGeom;

        [Input("Minimum",DefaultValue=-1)]
        protected ISpread<Vector3> FMin;

        [Input("Maximum",DefaultValue=1)]
        protected ISpread<Vector3> FMax;

        [Input("Enabled",DefaultValue=1)]
        protected ISpread<bool> FEnabled;

        [Output("Geometry Out")]
        protected ISpread<DX11Resource<IDX11Geometry>> FOutGeom;

        private int spmax;

        public void Evaluate(int SpreadMax)
        {
            this.FOutGeom.SliceCount = SpreadMax;
            for (int i = 0; i < SpreadMax; i++)
            {
                if (this.FOutGeom[i] == null) { this.FOutGeom[i] = new DX11Resource<IDX11Geometry>(); }
            }

            this.spmax = SpreadMax;
        }

        public void Update(DX11RenderContext context)
        {
            if (this.FInGeom.PluginIO.IsConnected)
            {
                for (int i = 0; i < spmax; i++)
                {
                    if (this.FEnabled[i])
                    {
                        IDX11Geometry g = this.FInGeom[i][context].ShallowCopy();
                        BoundingBox b = new BoundingBox(this.FMin[i], this.FMax[i]);
                        g.HasBoundingBox = true;
                        g.BoundingBox = b;
                        this.FOutGeom[i][context] = g;
                    }
                }
            }
        }

        public void Destroy(DX11RenderContext context, bool force)
        {

        }
    }
}


text:
import yaml
import io
import re
import os

class ConfigYaml():
    """
    Yaml Configuration File Implementation

    - support for environment variable substitution
    - support for default value
    - substitution syntax: {ENV[:default]}
    - if and ENV value is not resolved and there is no default
      an exception is thrown

    - sample yaml
    config:
      udl_read_auth: 'user:pass'
      # mongo database
      mongodb_db: "{MONGODB_DB:test}"
      mongodb_host: "{MONGODB_HOST:127.0.0.1}"
      # value is a number - no quotes
      mongodb_port: {MONGODB_PORT:27017}

    """

    @staticmethod
    def substitueWithEnv(line: str) -> str:
        """
        substitute environment variables into placeholders

        """

        # check if line is just a comment
        if re.match(r"^\s*?#", line):
            return line

        regex = r"\{(.*?)\}"
        matches = re.finditer(regex, line, re.DOTALL)

        for matchNum, match in enumerate(matches):
            for groupNum in range(0, len(match.groups())):
                match_value = match.group(1)
                pair = match_value.split(':', maxsplit=1)
                replace_value = None
                if len(pair) == 2:
                    # use the default if env var not found and there is a default
                    replace_value = pair[1]

                if os.environ.get(pair[0]):
                    replace_value = os.environ.get(pair[0])

                if replace_value:
                    sub_regex = r"\{" + match_value + r"\}"
                    line = re.sub(sub_regex, replace_value, line)
                else:
                    msg = 'no substitution value found for {' + \
                        match_value + '}'
                    raise Exception(msg)
        return line

    @staticmethod
    def fromYmlFile(ymlFile: str) -> any:
        """
        read ymlFile into python object
        """
        if (ymlFile is None):
            raise Exception("ymlFile must be a valid string.")

        if (not os.path.exists(ymlFile)):
            msg = f"ympFile does not exist: {ymlFile}"
            raise Exception(msg)

        if (not os.path.isfile(ymlFile)):
            msg = f"ympFile is not a valid file: {ymlFile}"
            raise Exception(msg)

        obj = None

        substituted_string = ""

        # read file line by line and do any os env substitutions
        with open(file=ymlFile, mode='r') as f:
            lines = f.readlines()
            for line in lines:
                sline = ConfigYaml.substitueWithEnv(line)
                substituted_string += sline

        obj = ConfigYaml.fromYml(substituted_string)

        return obj

    @staticmethod
    def fromYml(yml_string: str) -> any:
        """
        read yml string into python object
        """
        obj = None
        with io.StringIO(yml_string) as string_as_file:
            obj = yaml.load(string_as_file, Loader=yaml.FullLoader)
        return obj

    @staticmethod
    def toYml(obj: object) -> str:
        """
        convert python object into yml string
        """
        yml_string = None
        with io.StringIO() as string_as_file:
            yaml.dump(obj, string_as_file)
            yml_string = string_as_file.getvalue()
        return yml_string


text:
<?php
namespace Poirot\Stream\Wrapper\FileAccessControl;

class ACWPermissions
{
    protected $hasRead  = true;
    protected $hasWrite = true;

    function grantRead()
    {
        $this->hasRead = true;

        return $this;
    }

    function revokeRead()
    {
        $this->hasRead = false;

        return $this;
    }

    function hasReadAccess()
    {
        return $this->hasRead;
    }

    function grantWrite()
    {
        $this->hasWrite = true;

        return $this;
    }

    function revokeWrite()
    {
        $this->hasWrite = false;

        return $this;
    }

    function hasWriteAccess()
    {
        return $this->hasWrite;
    }
}


text:
require 'active_record'
require 'acts_as_learnable/base'

module ActsAsLearnable
  # Extend ActiveRecord if defined
  if defined?(ActiveRecord::Base)
    ActiveRecord::Base.extend(ActsAsLearnable::Base)
  end
end