text:
#ifndef TILEMAPTEXTSETTINGS_H
#define TILEMAPTEXTSETTINGS_H

#include "config.h"

#include<map>

#ifdef __SYMBIAN32__
#include <e32std.h>
#endif

class TileMapTextSettings {
public:

   /// Copying replacement for the old font_pair_t
   class font_pair_t {
   public:
      font_pair_t() : first(0), second(0) {}
#ifdef __SYMBIAN__
      /// This one only supports ascii names.
      font_pair_t( const TDesC& name, int size );
#endif
      font_pair_t( const char* name, int size );
      font_pair_t( const font_pair_t& other );
      ~font_pair_t();
      font_pair_t& operator=( const font_pair_t& other);

      char* first;
      int   second;
   };

   /**
    *   Empty constructor. Sets all to HARDCODED_FONT.
    */
   TileMapTextSettings();

   /**
    *   NB! The strings will not be copied!
    *   @param lineFonts         Map of fonts to use for lines with the
    *                            minimum line width in first and
    *                            font in second.
    *   @param horizontalFont    Font for horizontal placement e.g. under
    *                            citycentres.
    *   @param roundRectFont     Font for placement in road number signs.
    *   @param insidePolygonFont Font for placement inside polygons.
    *   @param progressIndicatorFont   Font for progress indicator.
    *   @param copyrightFont     Font for the copyright string.
    *
    */
   TileMapTextSettings( const std::map<int, font_pair_t>& lineFonts,
                        const font_pair_t& horizontalFont,
                        const font_pair_t& roundRectFont,
                        const font_pair_t& insidePolygonFont,
                        const font_pair_t& progressIndicatorFont,
                        const font_pair_t& copyrightFont );

   /// @return The font to be used for lines with the supplied width.
   const font_pair_t& getLineFont( int width ) const;

   /// @return The font to be used for horizontal placement (cc:s)
   const font_pair_t& getHorizontalFont() const {
      return m_horizFont;
   }

   /// @return The font to be used for road signs.
   const font_pair_t& getRoundRectFont() const {
      return m_roundRectFont;
   }

   /// @return The font to be used when placing text in a polygon.
   const font_pair_t& getInsidePolygonFont() const {
      return m_insidePolygonFont;
   }

   /// @return The font to be used for the progress indicator.
   const font_pair_t& getProgressIndicatorFont() const {
      return m_progressIndicatorFont;
   }

   /// @return The font to be used for the copyright string.
   const font_pair_t& getCopyrightFont() const {
      return m_copyrightFont;
   }

   /// Map of line fonts
   std::map<int, font_pair_t> m_lineFonts;
   /// Horizontal font
   font_pair_t m_horizFont;
   /// Roundrect font
   font_pair_t m_roundRectFont;
   /// Inside polygon font
   font_pair_t m_insidePolygonFont;
   /// Progress indicator font
   font_pair_t m_progressIndicatorFont;
   /// Copyright font
   font_pair_t m_copyrightFont;
};

#endif


text:
<?php

/**
 * Register the templates
 */
TemplateLoader::addFiles(array
(
	'be_news'         => 'system/modules/be_news/templates',
));

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Specialized;
using NUnit.Framework;
using StructureMap.Configuration;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;
using StructureMap.Testing.TestData;
using StructureMap.Testing.Widget;
using StructureMap.Testing.Widget3;

namespace StructureMap.Testing
{
    [TestFixture]
    public class ImplicitPluginFromPluggedTypeAttributeTester
    {
        #region Setup/Teardown

        [SetUp]
        public void SetUp()
        {
            Type pluggedType = typeof (StubbedGateway);

            var values = new NameValueCollection();
            values.Add(XmlConstants.PLUGGED_TYPE, pluggedType.AssemblyQualifiedName);
            _memento = new MemoryInstanceMemento(string.Empty, "Frank", values);

            _expectedPlugin = new Plugin(pluggedType);
        }

        #endregion

        private MemoryInstanceMemento _memento;
        private Plugin _expectedPlugin;

        [Test]
        public void CanBuildTheInstance()
        {
            var builder = new GraphBuilder(new Registry[0]);
            Type thePluginType = typeof (IGateway);
            PluginFamily family = builder.PluginGraph.FindFamily(thePluginType);
            family.DefaultInstanceKey = _memento.InstanceKey;

            family.AddInstance(_memento);

            PluginGraph graph = builder.PluginGraph;
            var manager = new Container(graph);

            var gateway = (StubbedGateway) manager.GetInstance(typeof (IGateway), _memento.InstanceKey);

            Assert.IsNotNull(gateway);
        }

        [Test]
        public void RunThroughXml()
        {
            PluginGraph graph = DataMother.GetPluginGraph("PluggedTypeTest.xml");
            var manager = new Container(graph);

            var widget = (NotPluggableWidget) manager.GetInstance(typeof (IWidget), "Me");
            Assert.AreEqual("Jeremy", widget.Name);
        }
    }
}


text:
package kafka.tools

import joptsimple._
import org.I0Itec.zkclient.ZkClient
import kafka.utils.{Json, ZkUtils, ZKStringSerializer, Logging}
import kafka.consumer.SimpleConsumer
import kafka.api.{PartitionOffsetRequestInfo, OffsetRequest}
import kafka.common.{BrokerNotAvailableException, TopicAndPartition}
import scala.collection._

object ConsumerOffsetChecker extends Logging {

  private val consumerMap: mutable.Map[Int, Option[SimpleConsumer]] = mutable.Map()

  private def getConsumer(zkClient: ZkClient, bid: Int): Option[SimpleConsumer] = {
    try {
      ZkUtils.readDataMaybeNull(zkClient, ZkUtils.BrokerIdsPath + "/" + bid)._1 match {
        case Some(brokerInfoString) =>
          Json.parseFull(brokerInfoString) match {
            case Some(m) =>
              val brokerInfo = m.asInstanceOf[Map[String, Any]]
              val host = brokerInfo.get("host").get.asInstanceOf[String]
              val port = brokerInfo.get("port").get.asInstanceOf[Int]
              Some(new SimpleConsumer(host, port, 10000, 100000, "ConsumerOffsetChecker"))
            case None =>
              throw new BrokerNotAvailableException("Broker id %d does not exist".format(bid))
          }
        case None =>
          throw new BrokerNotAvailableException("Broker id %d does not exist".format(bid))
      }
    } catch {
      case t: Throwable =>
        error("Could not parse broker info", t)
        None
    }
  }

  private def processPartition(zkClient: ZkClient,
                               group: String, topic: String, pid: Int) {
    val offset = ZkUtils.readData(zkClient, "/consumers/%s/offsets/%s/%s".
            format(group, topic, pid))._1.toLong
    val owner = ZkUtils.readDataMaybeNull(zkClient, "/consumers/%s/owners/%s/%s".
            format(group, topic, pid))._1

    ZkUtils.getLeaderForPartition(zkClient, topic, pid) match {
      case Some(bid) =>
        val consumerOpt = consumerMap.getOrElseUpdate(bid, getConsumer(zkClient, bid))
        consumerOpt match {
          case Some(consumer) =>
            val topicAndPartition = TopicAndPartition(topic, pid)
            val request =
              OffsetRequest(immutable.Map(topicAndPartition -> PartitionOffsetRequestInfo(OffsetRequest.LatestTime, 1)))
            val logSize = consumer.getOffsetsBefore(request).partitionErrorAndOffsets(topicAndPartition).offsets.head

            val lag = logSize - offset
            println("%-15s %-30s %-3s %-15s %-15s %-15s %s".format(group, topic, pid, offset, logSize, lag,
              owner match {case Some(ownerStr) => ownerStr case None => "none"}))
          case None => // ignore
        }
      case None =>
        error("No broker for partition %s - %s".format(topic, pid))
    }
  }

  private def processTopic(zkClient: ZkClient, group: String, topic: String) {
    val pidMap = ZkUtils.getPartitionsForTopics(zkClient, Seq(topic))
    pidMap.get(topic) match {
      case Some(pids) =>
        pids.sorted.foreach {
          pid => processPartition(zkClient, group, topic, pid)
        }
      case None => // ignore
    }
  }

  private def printBrokerInfo() {
    println("BROKER INFO")
    for ((bid, consumerOpt) <- consumerMap)
      consumerOpt match {
        case Some(consumer) =>
          println("%s -> %s:%d".format(bid, consumer.host, consumer.port))
        case None => // ignore
      }
  }

  def main(args: Array[String]) {
    val parser = new OptionParser()

    val zkConnectOpt = parser.accepts("zkconnect", "ZooKeeper connect string.").
            withRequiredArg().defaultsTo("localhost:2181").ofType(classOf[String]);
    val topicsOpt = parser.accepts("topic",
            "Comma-separated list of consumer topics (all topics if absent).").
            withRequiredArg().ofType(classOf[String])
    val groupOpt = parser.accepts("group", "Consumer group.").
            withRequiredArg().ofType(classOf[String])
    parser.accepts("broker-info", "Print broker info")
    parser.accepts("help", "Print this message.")

    val options = parser.parse(args : _*)

    if (options.has("help")) {
       parser.printHelpOn(System.out)
       System.exit(0)
    }

    for (opt <- List(groupOpt))
      if (!options.has(opt)) {
        System.err.println("Missing required argument: %s".format(opt))
        parser.printHelpOn(System.err)
        System.exit(1)
      }

    val zkConnect = options.valueOf(zkConnectOpt)
    val group = options.valueOf(groupOpt)
    val topics = if (options.has(topicsOpt)) Some(options.valueOf(topicsOpt))
      else None

    var zkClient: ZkClient = null
    try {
      zkClient = new ZkClient(zkConnect, 30000, 30000, ZKStringSerializer)

      val topicList = topics match {
        case Some(x) => x.split(",").view.toList
        case None => ZkUtils.getChildren(
          zkClient, "/consumers/%s/offsets".format(group)).toList
      }

      debug("zkConnect = %s; topics = %s; group = %s".format(
        zkConnect, topicList.toString(), group))

      println("%-15s %-30s %-3s %-15s %-15s %-15s %s".format("Group", "Topic", "Pid", "Offset", "logSize", "Lag", "Owner"))
      topicList.sorted.foreach {
        topic => processTopic(zkClient, group, topic)
      }

      if (options.has("broker-info"))
        printBrokerInfo();

      for ((_, consumerOpt) <- consumerMap)
        consumerOpt match {
          case Some(consumer) => consumer.close()
          case None => // ignore
        }
    }
    finally {
      for (consumerOpt <- consumerMap.values) {
        consumerOpt match {
          case Some(consumer) => consumer.close()
          case None => // ignore
        }
      }
      if (zkClient != null)
        zkClient.close()
    }
  }
}


text:
Servers
======

These are all the official server-side implementations that can receive CrashDump data from CrashDumper.
If you would like to add an implementation, we would be happy to receive a pull request!

## crashdumpbrowser
This is the "official" server-side implementation, commissioned by me ([Larsiusprime](http://github.com/larsiusprime)) and written by [Adam Perry](http://github.com/arperry), aka [@hoursgoby](http://www.twitter.com/hoursgoby). It uses PHP and is a full-featured, web-based solution for CrashDumper. It logs your crashdumps, and has some robust UI stuff for viewing, organizing, and processing the results.

## nodejs
This implementation was generously provided by [misterpah](http://github.com/misterpah), originally written as [crashdumper-logger](https://github.com/misterpah/crashdumper-logger). It uses NodeJS and can run on both localhost and a remote server.


text:
package org.apache.skywalking.apm.collector.storage.table.alarm;

import org.apache.skywalking.apm.collector.storage.table.CommonMetricTable;

/**
 * @author peng-yongsheng
 */
public class ServiceAlarmListTable extends CommonMetricTable {
    public static final String TABLE = "service_alarm_list";
    public static final String COLUMN_ALARM_TYPE = "alarm_type";
    public static final String COLUMN_ALARM_CONTENT = "alarm_content";
}


text:
package org.apache.harmony.test.func.api.java.rmi.basicsecurity;

import java.rmi.Naming;
import java.rmi.RMISecurityManager;
import java.security.Policy;

import org.apache.harmony.test.func.api.java.rmi.share.ServerInterface;
import org.apache.harmony.share.Result;

/**
 * This object used for managing of server
 *
 */

public class BSTest implements BSTestInterface {

    public void removeSecurityManager() {
        System.setSecurityManager(null);
    }

    public int test(final String host, final int port) {

        System.setProperty("java.security.policy", "NoPolicy!");
        Policy.getPolicy().refresh();
        System.setSecurityManager(new RMISecurityManager());
        try {
            ServerInterface obj = (ServerInterface) Naming.lookup("rmi://"
                    + host + ":" + port + "/Server");
            obj.remoteMethod("1 v pole ne voin");
            System.out.println("SecurityException wasn't thrown");

            return Result.FAIL;
        } catch (Throwable ex) {
            Throwable th = ex;
            while (th != null) {
                if (th instanceof SecurityException) {
                    return Result.PASS;
                }
                th = th.getCause();
            }
            ex.printStackTrace();
            return Result.FAIL;
        }
    }
}


text:
cask "font-imprima" do
  version :latest
  sha256 :no_check

  url "https://github.com/google/fonts/raw/main/ofl/imprima/Imprima-Regular.ttf",
      verified: "github.com/google/fonts/"
  name "Imprima"
  homepage "https://fonts.google.com/specimen/Imprima"

  font "Imprima-Regular.ttf"
end


text:
<?php

/**
 * Морфологический фильтр phpmorphy для zend lucene
 */
class SearchFilterMorph extends Zend_Search_Lucene_Analysis_TokenFilter {

    private $morphy;

    public function __construct() {

        //инициализируем объект phpMorphy

        $path = YiiBase::getPathOfAlias('application.vendors');

        require_once $path . "/phpmorphy/src/common.php";

        $dir = $path . '/phpmorphy/dicts';

        $opts = array(
		'storage' => PHPMORPHY_STORAGE_FILE
        );

        $this->morphy = new phpMorphy($dir, "ru_RU", $opts);

    }

    public function normalize(Zend_Search_Lucene_Analysis_Token $srcToken) {

        //извлекаем корень слова
        $pseudo_root = $this->morphy->getPseudoRoot(mb_strtoupper($srcToken->getTermText(), "utf-8"));

        if ($pseudo_root === false)
            $newStr = mb_strtoupper($srcToken->getTermText(), "utf-8");
        //если корень извлечь не удалось, тогда используем все слово целиком
        else
            $newStr = $pseudo_root[0];

        //если лексема короче 3 символов, то не используем её
        if (mb_strlen($newStr, "utf-8") < 3)
            return null;

        $newToken = new Zend_Search_Lucene_Analysis_Token(
                        $newStr,
                        $srcToken->getStartOffset(),
                        $srcToken->getEndOffset()
        );

        $newToken->setPositionIncrement($srcToken->getPositionIncrement());

        return $newToken;
    }

}

?>


text:
package com.smoothsync.smoothsetup.wizard;

import android.content.Context;

import com.smoothsync.smoothsetup.microfragments.ChooseProviderMicroFragment;
import com.smoothsync.smoothsetup.utils.LoginInfo;

import org.dmfs.android.microfragments.MicroFragment;
import org.dmfs.android.microwizard.MicroWizard;
import org.dmfs.android.microwizard.box.AbstractSingleBox;
import org.dmfs.android.microwizard.box.Box;

/**
 * @author Marten Gajda
 */
public final class ChooseProvider implements MicroWizard<ChooseProviderMicroFragment.ProviderSelection>
{
    private final MicroWizard<LoginInfo> mNext;

    public ChooseProvider(MicroWizard<LoginInfo> next)
    {
        mNext = next;
    }

    @Override
    public MicroFragment<?> microFragment(Context context, ChooseProviderMicroFragment.ProviderSelection selection)
    {
        return new ChooseProviderMicroFragment(selection, mNext);
    }

    @Override
    public Box<MicroWizard<ChooseProviderMicroFragment.ProviderSelection>> boxed()
    {
        return new WizardBox(mNext);
    }

    private final static class WizardBox extends AbstractSingleBox<MicroWizard<LoginInfo>, MicroWizard<ChooseProviderMicroFragment.ProviderSelection>>
    {

        WizardBox(MicroWizard<LoginInfo> next)
        {
            super(next, ChooseProvider::new);
        }

        public final static Creator<Box<MicroWizard<ChooseProviderMicroFragment.ProviderSelection>>> CREATOR =
                new SingleBoxableBoxCreator<>(
                        WizardBox::new,
                        WizardBox[]::new);
    }
}


text:
CardGame
========

Card Game


text:
/** ********************************************************************************************************************
 *
 * flash messages
 * @exports {function} initFlashMessages
 *
 **********************************************************************************************************************/
import {DEBUG} from "../../config";
const SELECTOR_INPUTS = "input[type=file]";

/*
 * get text node from input ============================================================================================
 * @param {Node} input - the file input
 * @returns {Node} span
 */
const getTextNode = input => {
    let label = input.parentNode;
    let span;
    if (label.nodeName === "LABEL") {
        // parent of input should be <label>
        for (let labelChild of label.childNodes) {
            if (labelChild.nodeName === "SPAN") {
                // one of label children should be <span>
                span = labelChild;
            }
        }
    }
    return span;
};

/*
 * initialize file upload fields =======================================================================================
 */
const initFileUploadFields = () => {
    const inputs = document.querySelectorAll(SELECTOR_INPUTS);
    let num = 0;
    // return if no inputs
    if (!inputs) return;
    for (let input of inputs) {
        let text = getTextNode(input);
        if (input && text) {
            num++;
            input.addEventListener("change", function() {
                text.textContent = this.value.split("\\").pop();
            });
        }
    }
    DEBUG && console.log(`bound ${num} event listeners for file uploads.`);
};

export {initFileUploadFields};


text:
using System;

namespace NUnit.Framework.Extensions
{
	/// <summary>
	/// Summary description for MaxTimeAttribute.
	/// </summary>
	[AttributeUsage( AttributeTargets.Method, AllowMultiple=false, Inherited=false )]
	public sealed class MaxTimeAttribute : Attribute
	{
		private int maxTime;
		private bool expectFailure;

		public MaxTimeAttribute( int maxTime )
		{
			this.maxTime = maxTime;
		}

		public int MaxTime
		{
			get { return maxTime; }
		}

		/// <summary>
		/// ExpectFailure is an optional attribute used for testing
		/// cases where the timeout is actually expected.
		/// </summary>
		public bool ExpectFailure
		{
			get { return expectFailure; }
			set { expectFailure = value; }
		}
	}
}