text:
.class final enum Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;
.super Ljava/lang/Enum;
.source "WpsApDialog.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x401a
    name = "DialogState"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Enum",
        "<",
        "Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;",
        ">;"
    }
.end annotation

# static fields
.field private static final synthetic $VALUES:[Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

.field public static final enum CONNECTED:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

.field public static final enum WPS_COMPLETE:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

.field public static final enum WPS_FAILED:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

.field public static final enum WPS_INIT:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

.field public static final enum WPS_START:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

# direct methods
.method static constructor <clinit>()V
    .locals 7

    const/4 v6, 0x4

    const/4 v5, 0x3

    const/4 v4, 0x2

    const/4 v3, 0x1

    const/4 v2, 0x0

    new-instance v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    const-string/jumbo v1, "WPS_INIT"

    invoke-direct {v0, v1, v2}, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->WPS_INIT:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    new-instance v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    const-string/jumbo v1, "WPS_START"

    invoke-direct {v0, v1, v3}, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->WPS_START:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    new-instance v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    const-string/jumbo v1, "WPS_COMPLETE"

    invoke-direct {v0, v1, v4}, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->WPS_COMPLETE:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    new-instance v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    const-string/jumbo v1, "CONNECTED"

    invoke-direct {v0, v1, v5}, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->CONNECTED:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    new-instance v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    const-string/jumbo v1, "WPS_FAILED"

    invoke-direct {v0, v1, v6}, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;-><init>(Ljava/lang/String;I)V

    sput-object v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->WPS_FAILED:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    const/4 v0, 0x5

    new-array v0, v0, [Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    sget-object v1, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->WPS_INIT:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    aput-object v1, v0, v2

    sget-object v1, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->WPS_START:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    aput-object v1, v0, v3

    sget-object v1, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->WPS_COMPLETE:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    aput-object v1, v0, v4

    sget-object v1, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->CONNECTED:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    aput-object v1, v0, v5

    sget-object v1, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->WPS_FAILED:Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    aput-object v1, v0, v6

    sput-object v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->$VALUES:[Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    return-void
.end method

.method private constructor <init>(Ljava/lang/String;I)V
    .locals 0

    invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V

    return-void
.end method

.method public static valueOf(Ljava/lang/String;)Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;
    .locals 1

    const-class v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;

    move-result-object v0

    check-cast v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    return-object v0
.end method

.method public static values()[Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;
    .locals 1

    sget-object v0, Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;->$VALUES:[Lcom/samsung/android/settings/wifi/mobileap/WpsApDialog$DialogState;

    return-object v0
.end method


text:
<ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/favicon"
    android:src="@drawable/ic_action_site"
    android:scaleType="centerCrop"
    android:layout_width="48dp"
    android:layout_height="48dp"
    android:background="@android:color/white"/>

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
  <ShortName>A project is cool</ShortName>
  <Description>Search A project documentation</Description>
  <Image type="image/png">http://localhost:8000/favicon-dark.png</Image>
  <Url type="text/html" template="http://localhost:8000?q={searchTerms}#search"/>
</OpenSearchDescription>


text:
package thor12022.expertusmagia;

/*
 * Check all the classes for (hopefully) detailed descriptions of what it does. There will also be tidbits of comments throughout the codebase.
 * If you wish to add a description to a class, or extend/change an existing one, submit a PR with your changes.
 */

import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.common.MinecraftForge;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import thor12022.expertusmagia.blocks.BlockRecipeRegistry;
import thor12022.expertusmagia.blocks.BlockRegistry;
import thor12022.expertusmagia.client.gui.CreativeTabBaseMod;
import thor12022.expertusmagia.client.gui.GuiHandler;
import thor12022.expertusmagia.enchantments.BaseEnchantment;
import thor12022.expertusmagia.items.ItemRecipeRegistry;
import thor12022.expertusmagia.items.ItemRegistry;
import thor12022.expertusmagia.proxies.CommonProxy;
import thor12022.expertusmagia.util.EventHandler;
import thor12022.expertusmagia.util.GenerationHandler;
import thor12022.expertusmagia.util.OreDictHandler;
import thor12022.expertusmagia.util.TextHelper;

@Mod(modid = ModInformation.ID, name = ModInformation.NAME, version = ModInformation.VERSION, dependencies = ModInformation.DEPEND, guiFactory = ModInformation.GUIFACTORY)
public class ExpertusMagia
{

   @SidedProxy(clientSide = ModInformation.CLIENTPROXY, serverSide = ModInformation.COMMONPROXY)
   public static CommonProxy proxy;

   public static CreativeTabs tabBaseMod = new CreativeTabBaseMod(ModInformation.ID + ".creativeTab");
   public static Logger logger = LogManager.getLogger(ModInformation.NAME);

   @Mod.Instance
   public static ExpertusMagia instance;

   @Mod.EventHandler
   public void preInit(FMLPreInitializationEvent event)
   {
      logger.info(TextHelper.localize("info." + ModInformation.ID + ".console.load.preInit"));

      ConfigHandler.init(event.getSuggestedConfigurationFile());

      ItemRegistry.registerItems();
      BlockRegistry.registerBlocks();
      BaseEnchantment.registerEnchantments();

      OreDictHandler.registerOreDict();
      FMLCommonHandler.instance().bus().register(new EventHandler());
      MinecraftForge.EVENT_BUS.register(new EventHandler());
      NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());

      GameRegistry.registerWorldGenerator(new GenerationHandler(), 2);
   }

   @Mod.EventHandler
   public void init(FMLInitializationEvent event)
   {
      logger.info(TextHelper.localize("info." + ModInformation.ID + ".console.load.init"));

      ItemRecipeRegistry.registerItemRecipes();
      BlockRecipeRegistry.registerBlockRecipes();
   }

   @Mod.EventHandler
   public void postInit(FMLPostInitializationEvent event)
   {
      logger.info(TextHelper.localize("info." + ModInformation.ID + ".console.load.postInit"));
   }
}


text:
<?php

/**
 * This code was generated by
 * \ / _    _  _|   _  _
 * | (_)\/(_)(_|\/| |(/_  v1.0.0
 * /       /
 */

namespace Twilio\Rest\Supersim\V1;

use Twilio\Options;
use Twilio\Values;

/**
 * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
 */
abstract class UsageRecordOptions {
    /**
     * @param string $sim SID or unique name of a Sim resource. Only show
     *                    UsageRecords representing usage incurred by this Super
     *                    SIM.
     * @param string $fleet SID or unique name of a Fleet resource. Only show
     *                      UsageRecords representing usage for Super SIMs
     *                      belonging to this Fleet resource at the time the usage
     *                      occurred.
     * @param string $network SID of a Network resource. Only show UsageRecords
     *                        representing usage on this network.
     * @param string $isoCountry Alpha-2 ISO Country Code. Only show UsageRecords
     *                           representing usage in this country.
     * @param string $group Dimension over which to aggregate usage records.
     * @param string $granularity Time-based grouping that UsageRecords should be
     *                            aggregated by. Can be: `hour`, `day`, or `all`.
     *                            Default is `all`.
     * @param \DateTime $startTime Only include usage that occurred at or after
     *                             this time.
     * @param \DateTime $endTime Only include usage that occurred before this time
     *                           (exclusive).
     * @return ReadUsageRecordOptions Options builder
     */
    public static function read(string $sim = Values::NONE, string $fleet = Values::NONE, string $network = Values::NONE, string $isoCountry = Values::NONE, string $group = Values::NONE, string $granularity = Values::NONE, \DateTime $startTime = Values::NONE, \DateTime $endTime = Values::NONE): ReadUsageRecordOptions {
        return new ReadUsageRecordOptions($sim, $fleet, $network, $isoCountry, $group, $granularity, $startTime, $endTime);
    }
}

class ReadUsageRecordOptions extends Options {
    /**
     * @param string $sim SID or unique name of a Sim resource. Only show
     *                    UsageRecords representing usage incurred by this Super
     *                    SIM.
     * @param string $fleet SID or unique name of a Fleet resource. Only show
     *                      UsageRecords representing usage for Super SIMs
     *                      belonging to this Fleet resource at the time the usage
     *                      occurred.
     * @param string $network SID of a Network resource. Only show UsageRecords
     *                        representing usage on this network.
     * @param string $isoCountry Alpha-2 ISO Country Code. Only show UsageRecords
     *                           representing usage in this country.
     * @param string $group Dimension over which to aggregate usage records.
     * @param string $granularity Time-based grouping that UsageRecords should be
     *                            aggregated by. Can be: `hour`, `day`, or `all`.
     *                            Default is `all`.
     * @param \DateTime $startTime Only include usage that occurred at or after
     *                             this time.
     * @param \DateTime $endTime Only include usage that occurred before this time
     *                           (exclusive).
     */
    public function __construct(string $sim = Values::NONE, string $fleet = Values::NONE, string $network = Values::NONE, string $isoCountry = Values::NONE, string $group = Values::NONE, string $granularity = Values::NONE, \DateTime $startTime = Values::NONE, \DateTime $endTime = Values::NONE) {
        $this->options['sim'] = $sim;
        $this->options['fleet'] = $fleet;
        $this->options['network'] = $network;
        $this->options['isoCountry'] = $isoCountry;
        $this->options['group'] = $group;
        $this->options['granularity'] = $granularity;
        $this->options['startTime'] = $startTime;
        $this->options['endTime'] = $endTime;
    }

    /**
     * SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM.
     *
     * @param string $sim SID or unique name of a Sim resource. Only show
     *                    UsageRecords representing usage incurred by this Super
     *                    SIM.
     * @return $this Fluent Builder
     */
    public function setSim(string $sim): self {
        $this->options['sim'] = $sim;
        return $this;
    }

    /**
     * SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred.
     *
     * @param string $fleet SID or unique name of a Fleet resource. Only show
     *                      UsageRecords representing usage for Super SIMs
     *                      belonging to this Fleet resource at the time the usage
     *                      occurred.
     * @return $this Fluent Builder
     */
    public function setFleet(string $fleet): self {
        $this->options['fleet'] = $fleet;
        return $this;
    }

    /**
     * SID of a Network resource. Only show UsageRecords representing usage on this network.
     *
     * @param string $network SID of a Network resource. Only show UsageRecords
     *                        representing usage on this network.
     * @return $this Fluent Builder
     */
    public function setNetwork(string $network): self {
        $this->options['network'] = $network;
        return $this;
    }

    /**
     * Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country.
     *
     * @param string $isoCountry Alpha-2 ISO Country Code. Only show UsageRecords
     *                           representing usage in this country.
     * @return $this Fluent Builder
     */
    public function setIsoCountry(string $isoCountry): self {
        $this->options['isoCountry'] = $isoCountry;
        return $this;
    }

    /**
     * Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter.
     *
     * @param string $group Dimension over which to aggregate usage records.
     * @return $this Fluent Builder
     */
    public function setGroup(string $group): self {
        $this->options['group'] = $group;
        return $this;
    }

    /**
     * Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period.
     *
     * @param string $granularity Time-based grouping that UsageRecords should be
     *                            aggregated by. Can be: `hour`, `day`, or `all`.
     *                            Default is `all`.
     * @return $this Fluent Builder
     */
    public function setGranularity(string $granularity): self {
        $this->options['granularity'] = $granularity;
        return $this;
    }

    /**
     * Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`.
     *
     * @param \DateTime $startTime Only include usage that occurred at or after
     *                             this time.
     * @return $this Fluent Builder
     */
    public function setStartTime(\DateTime $startTime): self {
        $this->options['startTime'] = $startTime;
        return $this;
    }

    /**
     * Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time.
     *
     * @param \DateTime $endTime Only include usage that occurred before this time
     *                           (exclusive).
     * @return $this Fluent Builder
     */
    public function setEndTime(\DateTime $endTime): self {
        $this->options['endTime'] = $endTime;
        return $this;
    }

    /**
     * Provide a friendly representation
     *
     * @return string Machine friendly representation
     */
    public function __toString(): string {
        $options = \http_build_query(Values::of($this->options), '', ' ');
        return '[Twilio.Supersim.V1.ReadUsageRecordOptions ' . $options . ']';
    }
}


text:
<?php

defined('WEKIT_VERSION') || exit('Forbidden');

class PwReplyRead extends PwReadDataSource
{
    public $tid;
    public $pid;

    public function __construct($tid, $pid)
    {
        $this->tid = $tid;
        $this->pid = $pid;
    }

    public function execute()
    {
        $value = Wekit::load('forum.PwThread')->getPost($this->pid);
        $this->data[] = $value;
        $value['aids'] && $this->_aids[] = $value['pid'];
        $this->_uids[] = $value['created_userid'];
        $this->firstFloor = Wekit::load('forum.PwThread')->countPostByTidUnderPid($this->tid, $this->pid) + 1;
    }
}


text:
package org.jetbrains.plugins.scala.statistics

import com.intellij.internal.statistic.libraryUsage.LibraryUsageImportProcessor
import com.intellij.psi.{PsiElement, PsiFile}
import org.jetbrains.plugins.scala.extensions.{IteratorExt, PsiElementExt}
import org.jetbrains.plugins.scala.lang.psi.ScImportsHolder
import org.jetbrains.plugins.scala.lang.psi.api.ScalaFile
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.ScPackaging
import org.jetbrains.plugins.scala.lang.psi.api.toplevel.imports.{ScImportExpr, ScImportStmt}

import java.util
import scala.jdk.CollectionConverters.SeqHasAsJava

class ScalaUsageImportProcessor extends LibraryUsageImportProcessor[ScImportExpr] {
  override def imports(psiFile: PsiFile): util.List[ScImportExpr] = psiFile match {
    case scalaFile: ScalaFile =>
      val importStatements = collectImportsStatements(scalaFile)
      val importExpressions = importStatements.flatMap(_.importExprs)
      importExpressions.asJava
    case _ =>
      util.List.of()
  }

  override def importQualifier(importExpr: ScImportExpr): String =
    importExpr.qualifier.map(_.qualName).orNull

  override def isSingleElementImport(importExpr: ScImportExpr): Boolean =
    importExpr.selectorSet.isEmpty && !importExpr.hasWildcardSelector

  override def resolve(importExpr: ScImportExpr): PsiElement =
    importExpr.qualifier.map(_.resolve()).orNull

  private def collectImportsStatements(fileOrPackage: ScImportsHolder): Seq[ScImportStmt] = {
    val nestedPackagings = fileOrPackage.children.filterByType[ScPackaging]
    fileOrPackage.getImportStatements ++ nestedPackagings.flatMap(collectImportsStatements)
  }
}


text:
``` diff
 namespace Microsoft.AspNetCore.Builder {
     public static class ControllerEndpointRouteBuilderExtensions {
+        public static void MapDynamicControllerRoute<TTransformer>(this IEndpointRouteBuilder endpoints, string pattern, object state) where TTransformer : DynamicRouteValueTransformer;
     }
     public static class RazorPagesEndpointRouteBuilderExtensions {
+        public static void MapDynamicPageRoute<TTransformer>(this IEndpointRouteBuilder endpoints, string pattern, object state) where TTransformer : DynamicRouteValueTransformer;
     }
 }
```


text:
package progress

import (
	"io"
	"time"
)

// Writer declares the interfaces that can be used to setup and render a
// Progress tracker with one or more trackers.
type Writer interface {
	AppendTracker(tracker *Tracker)
	AppendTrackers(trackers []*Tracker)
	IsRenderInProgress() bool
	Length() int
	LengthActive() int
	LengthDone() int
	LengthInQueue() int
	Log(msg string, a ...interface{})
	SetAutoStop(autoStop bool)
	SetMessageWidth(width int)
	SetNumTrackersExpected(numTrackers int)
	SetOutputWriter(output io.Writer)
	SetPinnedMessages(messages ...string)
	SetSortBy(sortBy SortBy)
	SetStyle(style Style)
	SetTrackerLength(length int)
	SetTrackerPosition(position Position)
	// Deprecated: in favor of Style().Visibility.ETA
	ShowETA(show bool)
	// Deprecated: in favor of Style().Visibility.TrackerOverall
	ShowOverallTracker(show bool)
	// Deprecated: in favor of Style().Visibility.Percentage
	ShowPercentage(show bool)
	// Deprecated: in favor of Style().Visibility.Time
	ShowTime(show bool)
	// Deprecated: in favor of Style().Visibility.Tracker
	ShowTracker(show bool)
	// Deprecated: in favor of Style().Visibility.Value
	ShowValue(show bool)
	SetUpdateFrequency(frequency time.Duration)
	Stop()
	Style() *Style
	Render()
}

// NewWriter initializes and returns a Writer.
func NewWriter() Writer {
	return &Progress{}
}


text:
%	Copyright © 2015 Alexander Isakov. Contact: <alexander.isakov@tuhh.de>
%	Copyright © 2015 Marina Krotofil. Contact: <marina.krotofil@tuhh.de>
%	Copyright © 2015 TUHH-SVA Security in Distributed Applications.
%	All rights reserved.
%	License: http://opensource.org/licenses/BSD-3-Clause
%	----------------------------------------------------------------------
function fullscreen(window)

    if isfigure(window)
        set(window, 'Units', 'pixels');
        set(window, 'OuterPosition', [0 30 1280 770])
    end
end


text:
namespace AgileObjects.AgileMapper
{
    using System.Collections.Generic;
    using DataSources.Factories;
    using Extensions.Internal;
    using Members.Population;
    using ObjectPopulation.Enumerables;
    using ObjectPopulation.MapperKeys;
    using ObjectPopulation.RepeatedMappings;
    using Queryables;
    using Queryables.Recursion;

    internal class MappingRuleSetCollection
    {
        #region Default Rule Sets

        private static readonly MappingRuleSet _createNew = new MappingRuleSet(
            Constants.CreateNew,
            MappingRuleSetSettings.ForInMemoryMapping(allowCloneEntityKeyMapping: true),
            CopySourceEnumerablePopulationStrategy.Create,
            default(MapRepeatedCallRepeatMappingStrategy),
            NullMemberPopulationGuardFactory.Create,
            ExistingOrDefaultValueFallbackDataSourceFactory.Create,
            DefaultRootMapperKeyFactory.Create);

        private static readonly MappingRuleSet _overwrite = new MappingRuleSet(
            Constants.Overwrite,
            MappingRuleSetSettings.ForInMemoryMapping(rootHasPopulatedTarget: true),
            OverwriteEnumerablePopulationStrategy.Create,
            default(MapRepeatedCallRepeatMappingStrategy),
            NullMemberPopulationGuardFactory.Create,
            DefaultValueFallbackDataSourceFactory.Create,
            DefaultRootMapperKeyFactory.Create);

        private static readonly MappingRuleSet _project = new MappingRuleSet(
            Constants.Project,
            new MappingRuleSetSettings
            {
                UseMemberInitialisation = true,
                UseSingleRootMappingExpression = true,
                AllowEntityKeyMapping = true,
                AllowCloneEntityKeyMapping = true,
                AllowGuardedBindings = true,
                GuardAccessTo = value => value.Type.IsComplex(),
                ExpressionIsSupported = value => value.CanBeProjected(),
                AllowEnumerableAssignment = true
            },
            ProjectSourceEnumerablePopulationStrategy.Create,
            default(MapToDepthRepeatMappingStrategy),
            NullMemberPopulationGuardFactory.Create,
            DefaultValueFallbackDataSourceFactory.Create,
            QueryProjectorMapperKeyFactory.Create);

        private static readonly MappingRuleSet _merge = new MappingRuleSet(
            Constants.Merge,
            MappingRuleSetSettings.ForInMemoryMapping(rootHasPopulatedTarget: true, allowGuardedBindings: false),
            MergeEnumerablePopulationStrategy.Create,
            default(MapRepeatedCallRepeatMappingStrategy),
            MemberMergePopulationGuardFactory.Create,
            ExistingOrDefaultValueFallbackDataSourceFactory.Create,
            DefaultRootMapperKeyFactory.Create);

        public static readonly MappingRuleSetCollection Default =
            new MappingRuleSetCollection(_createNew, _overwrite, _project, _merge);

        #endregion

        public MappingRuleSetCollection(params MappingRuleSet[] ruleSets)
        {
            All = ruleSets;
        }

        public IList<MappingRuleSet> All { get; }

        public MappingRuleSet CreateNew => _createNew;

        public MappingRuleSet Merge => _merge;

        public MappingRuleSet Overwrite => _overwrite;

        public MappingRuleSet Project => _project;

        public MappingRuleSet GetByName(string name) => All.First(name, (n, rs) => rs.Name == n);
    }
}


text:
<?php

namespace Basster\MovieDbBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class BassterMovieDbBundle extends Bundle
{
}


text:
var upOptions = {
    running: false
};
var current = localStorage.getItem(document.location.host) || localStorage.getItem('current') || 'gelbooru';
var engine = $("engine");
var tagStorage = {};

engine.onchange = function () {
    current = this.value;
    $('current').textContent = current;
    if (current != 'gelbooru') {
        $('title').disable();
    } else {
        $('title').enable();
    }
};
engine.selectedIndex = current == 'gelbooru' ? 0 : (current == 'moebooru' ? 1 : 2);
engine.onchange();

hitSync();

$$('#asFiles,#asFolder').each(function (el) {
    var files = $('files');

    el.onchange = function () {
        if (this.id == 'asFolder' && this.checked) {
            files.writeAttribute({directory: '', mozdirectory: '', webkitdirectory: ''});
        } else {
            files.writeAttribute({directory: false, mozdirectory: false, webkitdirectory: false});
        }
    };
});

RestoreLastSettings();
UploadOptions();

function FilesSelected(selFiles) {
    bat = [];
    header = {};
    $('bat').hide();

    if (upOptions.running) {
        return;
    }
    upOptions = UploadOptions();

    if (upOptions.auth.use && isNaN(upOptions.auth.userID)) {
        alert('Wrong user ID - it must be a number.');
        return;
    }
    if (upOptions.auth.use && upOptions.auth.ticket.length != 40) {
        alert('Wrong ticket - it must be 40 characters long.');
        return;
    }
    upOptions.running = true;

    try {
        var files = [];
        $each(selFiles, function (file) {
            if (IsUploadable(file)) {
                files.push(file);
            }
        });
        SendFiles(files);
    } catch (e) {
        if (typeof e == 'string') {
            alert('Couldn\'t upload - ' + e);
        }
    }
}

function IsUploadable(file) {
    return (typeof file.type == 'string' ? (file.type.substr(0, 6) == 'image/' || file.type.substr(0, 6) == 'video/') : true) && /(jpe?g|gif|png|bmp|webm|mp4)$/i.test(file.name);
}
function IsSidecar(file) {
    return (typeof file.type == 'string' ? file.type == 'text/plain' : true) && /\.txt$/i.test(file.name);
}

function OnFirstUpload(files) {
    SaveLastSettings();
    Log('info', 'Started uploading ' + upOptions.stats.total + ' files.');
    UpdateUpProgress(0);
}

function OnAllUploaded() {
    var msg = 'Finished uploading; ' + upOptions.stats.success + ' uploaded ok + ' +
        upOptions.stats.failed + ' failed = ' +
        upOptions.stats.total + ' images total.';
    var ourBooru = upOptions.uploadURL.match(/^http:\/\/([\w\d-]+)\.booru\.org\//i);

    succesStore();

    upOptions.running = false;
    Log('info end', msg);
    $set('status', '');
    UpdateUpProgress(0);
    if (ourBooru) {
        var baseCtrUpdURL = 'http://booru.org/?action=updateimagecount&updateimagecount[booru]=';
        var image = new Image();
        image.src = baseCtrUpdURL + ourBooru[1] + '&rand=' + Math.random();
    }
    $('files').value = '';
}

function UploadOptions() {
    var rating = {
        when: $('forceRating').checked ? 'always' : 'default',
        set:  $('setSafe').checked ? 's' : $('setQuest').checked ? 'q' : 'e'
    };
    var tagging = {
        when: $getRadio('tag-when'),
        set:  $get('tags').toLowerCase().split(/\s+/)
    };
    var auth = {
        userID: GetCookie('user_id'),
        ticket: GetCookie('pass_hash')
    };
    auth.use = (auth.userID || GetCookie('login')) && auth.ticket;
    var uploadURL = document.location.protocol + '//' + document.location.hostname + boorus[current].uploadPath;

    $('spinner').hide();
    $('infobar').show();
    $('submit').enable();
    $('loggedIn').textContent = auth.use ||
    (localStorage.getItem('auth_token') && (GetCookie('login') || GetCookie('user_name'))) ?
        'logged in' :
        'posting anonymously';
    $('current').textContent = current;

    return {
        delay:     1000,
        uploadURL: uploadURL,
        title:     $('title').checked,
        rating:    rating,
        tagging:   tagging,
        source:    $get('source'),
        stats:     {
            total:   0,
            success: 0,
            failed:  0
        },
        auth:      auth
    };
}

function Log(className, msg) {
    var now = new Date;
    var line = document.createElement('div');

    msg = '[' + now.getHours() + ':' + now.getMinutes() + '] ' + msg;
    $show('log');
    line.className = className;
    line.innerHTML = msg;
    $('log').appendChild(line);
}

function LogSuccess(file) {

    if (localStorage.getItem(document.location.host) != engine.value) {
        storEngine();
    }
    localStorage.setItem(document.location.host, engine.value);

    upOptions.stats.success++;

    if ($('onlyErrors').checked) {
        return;
    }

    Log('success', 'Image ' + file.name + ' was successfully uploaded.');
}

function LogFailure(file, reason) {
    Log('error', 'Couldn\'t upload ' + file.name + ': ' + reason + '.');

    batch(file, reason);

    upOptions.stats.failed++;
}

function SendFiles(files, index) {
    index = index || 0;
    if (index < files.length) {
        if (index == 0) {
            upOptions.stats.total = files.length;
            OnFirstUpload(files);
        }
        SendFile(files[index], function () {
            SendFiles(files, index + 1);
        });
        $set('status', 'Uploading #' + (index + 1) + ' image out of ' + files.length + '...');
    } else {
        OnAllUploaded();
    }
}

function SendFile(file, callback) {
    var reqVars = {
        title:  TitleFor(file),
        rating: RatingFor(file),
        source: upOptions.source,
        submit: 'Upload',
        tags:   TagsFor(file),
        token:  localStorage.getItem('auth_token')
    };
    if (upOptions.auth.use) {
        reqVars.cookies = 'user_id=' + upOptions.auth.userID + '; ' + 'pass_hash=' + upOptions.auth.ticket;
    }
    var xhr = CreateXHRequest();
    xhr.onreadystatechange = function () {
        if (this.readyState == 4) {
            if (current == 'gelbooru') {
                if (this.status == 200 || this.status == 302 || this.status == 304 /*not modified*/) {
                    if (~this.responseText.indexOf('generation failed')) {
                        LogFailure(file, 'thumbnail generation failed, image might be corrupted even if added');
                    }
                    // "mage" instead of "image" because first "I" might be capitalized.
                    if (~this.responseText.indexOf('mage added')) {
                        LogSuccess(file);
                    }
                    else if (~this.responseText.indexOf('already exists.')) {
                        var existId;
                        try {
                            existId = this.responseText.split('can find it ')[1].split('here')[0].split('&id=')[1].replace('">', '');
                        } catch (any) {}

                        if (!!Number(existId)) {
                            LogFailure(file, 'image already exists here')
                        } else {
                            LogFailure(file, 'image has been deleted');
                        }
                    }
                    else if (~this.responseText.indexOf('permission')) {
                        LogFailure(file, 'error, access denied. Try logging in. Stopped');
                        OnAllUploaded();
                        throw 403;
                    } else if (~this.responseText.indexOf('n error occured')) {
                        LogFailure(file, 'image too big? too small? corrupted?');
                    } else {
                        LogFailure(file, 'error, wrong response. Check your posting form URL');
                    }
                } else {
                    LogFailure(file, 'error, ' + xhr.statusCode + ' ' + xhr.statusText);
                }
            } else {
                switch (this.status) {
                    case 200:
                        LogSuccess(file);
                        break;
                    case 201:
                        if (current == 'danbooru') {
                            var uploadResult = JSON.parse(xhr.response).status;

                            if (uploadResult == 'completed') {
                                LogSuccess(file);
                            } else if (~uploadResult.indexOf('error:')) {
                                if (~uploadResult.indexOf('duplicate')) {
                                    LogFailure(file, 'image already exists ' + uploadResult.split('duplicate: ')[1] + '');
                                } else {
                                    LogFailure(file, 'error, ' + uploadResult);
                                }
                            }
                        }
                        break;
                    case 423:
                        LogFailure(file, 'image already exists ' + (JSON.parse(xhr.response).post_id || 'here') + '');
                        break;
                    case 403:
                        LogFailure(file, 'error, access denied. Try logging in. Stopped');
                        OnAllUploaded();
                        throw JSON.parse(xhr.response).reason;
                        break;
                    case 404:
                        LogFailure(file, 'API error, try another booru engine. Stopped');
                        OnAllUploaded();
                        throw 404;
                        break;
                    default:
                        var error;
                        try {
                            error = JSON.parse(xhr.response);
                            if (error.success === true) {
                                LogSuccess(file);
                            }
                            else {
                                LogFailure(file, 'error, ' + error.reason);
                            }
                        } catch(any) {
                            console.log(xhr.response);
                            LogFailure(file, 'error, see console for server response');
                        }
                        break;
                }
            }
            UpdateUpProgress(Math.min(upOptions.stats.success + upOptions.stats.failed, upOptions.stats.total) / upOptions.stats.total);
            setTimeout(callback, upOptions.delay);
        }
    };

    var formData = new FormData();

    for (var name in reqVars) {
        if (boorus[current].fields[name]) {
            formData.append(boorus[current].fields[name], reqVars[name]);
        }
    }

    formData.append(boorus[current].fields.file, file);
    formData.append('filename', file.name);

    xhr.open('POST', upOptions.uploadURL);
    xhr.send(formData);
}

function UpdateUpProgress(percent) {
    WidthOf('progress', WidthOf('progressWr') * percent);
}

function RatingFor(file) {
    return InfoAbout(file)[0];
}

function TagsFor(file) {
    if (upOptions.tagging.when == 'sidecar')
        return NormTags((tagStorage[file.name] || '')+' ')
    else
        return NormTags(InfoAbout(file)[1]);
}

function TitleFor(file) {
    return InfoAbout(file)[2];
}

function InfoAbout(file) {
    var fileName = file.name.toLowerCase();
    var ext = fileName.match(/ *\.(\w{2,4})$/i);
    var rating, tags, title;

    if (ext) {
        fileName = fileName.replace(ext[0], '');
    }
    if (!ext) {
        throw 'File ' + file.name + ' has no extension.';
    } else {
        ext = ext[1];
    }
    rating = fileName.match(/^([sqe])( +|$)/i);
    if (rating) {
        fileName = fileName.replace(rating[0], '');
    }
    if (upOptions.rating.when == 'always' || !rating) {
        rating = upOptions.rating.set;
    } else {
        rating = rating[1];
    }
    tags = fileName;
    title = upOptions.title ? tags.split(/\s+/)[tags.split(/\s+/).length - 1] : '';
    return [rating, tags, title];
}

function NormTags(tags) {
    tags = tags.toLowerCase().split(/\s+/);
    tags.pop();
    if (tags.length >= 2) {
        tags = mkUniq(tags);
    }

    switch (upOptions.tagging.when) {
        case 'force':
            tags = [];
        case 'add':
        case 'sidecar':
            tags = tags.concat(upOptions.tagging.set);
            tags = mkUniq(tags);
    }

    if (tags[0] == '') {
        tags.shift();
    }

    return tags.join(' ');
}

function onSidecarChange() {

    if ($getRadio('tag-when') == 'sidecar') {
        $('files').accept = 'image/*,video/*,text/plain';
    }
    else {
        $('tags').enable();
        $('files').accept = 'image/*,video/*';
    }
    $set('selectStatus','(All files with MIME types other than <tt>image/*, video/*</tt> and\n\textension other than <tt>jpg/jpeg/gif/png/bmp/webm/mp4</tt> will be skipped)');
}

function onFileSelect(files) {
    $set('selectStatus','(All files with MIME types other than <tt>image/*, video/*</tt> and\n\textension other than <tt>jpg/jpeg/gif/png/bmp/webm/mp4</tt> will be skipped)');
    if ($getRadio('tag-when') != 'sidecar') return;

    tagStorage = {};

    files = [].slice.apply(files);
    var images = files.filter(IsUploadable);
    var sidecars = files.filter(IsSidecar);

    var unmatchedImages = [];

    images.forEach(function(img) {
        var sidecar = sidecars.filter(function(file) {return !!~file.name.indexOf(img.name)})[0];

        if (sidecar)
            tagStorage[img.name] = sidecar
        else
            unmatchedImages.push(img.name);
    });

    if (unmatchedImages.length)
        $set('selectStatus', 'Couldn\'t find sidecar matches for '+unmatchedImages.length+' image(s).')

    var matchedSidecars = Object.keys(tagStorage).map(function(key) {return tagStorage[key]});
    if (!matchedSidecars.length) return;
    try {
        function readNext(idx) {
            var reader = new FileReader();

            reader.onload = function(){
                // By lines
                var lines = this.result.split('\n').map(function(line) {return line.trim().replace(/ /g, '_');});
                tagStorage[matchedSidecars[idx].name.replace('.txt','')] = lines.join(' ');

                if (idx < matchedSidecars.length-1)
                    readNext(idx+1);
            };
            reader.readAsText(matchedSidecars[idx]);
        }

        readNext(0);
    } catch (err) {
        console.error(err);
        $set('selectStatus', 'Error reading sidecar files, see console.')
    }
}


text:
require 'helper'

class TestNominetHostDeleteResponse < Test::Unit::TestCase
  context 'NominetEPP::Host::Delete' do
    setup do
      @delete_response = NominetEPP::Host::DeleteResponse.new(load_response('host/delete'))
    end

    should 'be successful' do
      assert @delete_response.success?
      assert_equal 1000, @delete_response.code
    end

    should 'have message' do
      assert_equal 'Command completed successfully', @delete_response.message
    end
  end
end


text:
var webPlayer = false;
var canSendCommand = true;

function sendCommand(text, metadata) {
    markScrollPosition();
    var data = new Object();
    data["command"] = text;
    if (typeof metadata != "undefined") {
        data["metadata"] = metadata;
    }
    UIEvent("RunCommand", JSON.stringify(data));
}

function ASLEvent(event, parameter) {
    UIEvent("ASLEvent", event + ";" + parameter);
}

// RestartGame added by KV
function RestartGame() {
    UIEvent("RestartGame", "");
}

// SaveTranscript added by KV to write/append to GAMENAME-transcript.html in Documents\Quest Transcripts
function SaveTranscript(data) {
    data = data + "<style>*{color:black !important;background:white !important;text-align:left !important}</style>";
    if (!webPlayer && transcriptString != '') { UIEvent("SaveTranscript", data); }
    transcriptString += data;
}

// Added by KV to write/append to GAMENAME-log.txt in Documents\Quest Logs
function WriteToLog(data) {
    if (!webPlayer && data != '' && typeof (data) == 'string') {
        UIEvent("WriteToLog", getTimeAndDateForLog() + " " + data);
    }
}

function goUrl(href) {
    UIEvent("GoURL", href);
}

function sendEndWait() {
    UIEvent("EndWait", "");
}

function doSave() {
    UIEvent("Save", $("#divOutput").html());
}

function UIEvent(cmd, parameter) {
    questCefInterop.uiEvent(cmd, parameter);
}

function disableMainScrollbar() {
    $("body").css("overflow", "hidden");
}

function ui_init() {
    $("#gameTitle").remove();
    $("#cmdExitFullScreen").click(function () {
        UIEvent("ExitFullScreen", "");
    });
}

function updateListEval(listName, listData) {
    updateList(listName, eval("(" + listData + ")"));
}

function showExitFullScreenButton(show) {
    if (eval(show)) {
        $("#cmdExitFullScreen").show();
    }
    else {
        $("#cmdExitFullScreen").hide();
    }
    updateStatusVisibility();
}

function panesVisibleEval(visible) {
    panesVisible(eval(visible));
}

function setCompassDirectionsEval(list) {
    setCompassDirections(eval(list));
}

function selectText(containerid) {
    var range = document.createRange();
    range.selectNodeContents(document.getElementById(containerid));
    var sel = window.getSelection();
    sel.removeAllRanges();
    sel.addRange(range);
}


text:
from __future__ import absolute_import, division, print_function
import errno
import logging
import math
import socket

import scapy.config
import scapy.layers.l2
import scapy.route
from scapy.all import *

from lan_sync_controller.config_loader import SETTINGS

LOG = logging.getLogger(__name__)

def long2net(arg):
    """Convert long to netmask"""
    if (arg <= 0 or arg >= 0xFFFFFFFF):
        raise ValueError("illegal netmask value", hex(arg))
    return 32 - int(round(math.log(0xFFFFFFFF - arg, 2)))

def to_CIDR_notation(bytes_network, bytes_netmask):
    network = scapy.utils.ltoa(bytes_network)
    netmask = long2net(bytes_netmask)
    net = "%s/%s" % (network, netmask)
    if netmask < 16:
        LOG.warning("%s is too big. skipping" % net)
        return None

    return net

def scan_and_get_neighbors(net, interface, timeout=1):
    """Get list interfaces, then scan in each network
    and get available neighbors. Actually, it will  ping`
    to each ip in network, then wait for reply (received packet)
    :param net: (string)
    :param interface: (string)
    :param timeout(integer)
    """
    LOG.info('arping %s on %s' % (net, interface))

    try:
        ans, unans = scapy.layers.l2.arping(net, iface=interface,
                                            timeout=timeout,
                                            verbose=True)
        neighbors = []
        for s, r in ans.res:
            neighbors.append(r.sprintf('%ARP.psrc%'))
        return neighbors
    except socket.error as e:
        if e.errno == errno.EPERM:
            LOG.error('%s. Did you run as root?' % (e.strerror))
        else:
            raise

def scan_udp_port(dst_ip, dst_port, dst_timeout=1):
    """Scan UDP port with specific ip address and port
    This host run code will be source host, define destination
    host and port that you want to scan.
    :param dst_ip: (string) destination ip address
    :param dst_port: (integer) specific port
    :param dst_timeout: (integer)
    """
    udp_scan_resp = sr1(IP(dst=dst_ip) / UDP(dport=dst_port),
                        timeout=dst_timeout)
    if str(type(udp_scan_resp)) == "<type 'NoneType'>":
        retrans = []
        for count in range(0, 3):
            retrans.append(sr1(IP(dst=dst_ip) / UDP(dport=dst_port),
                               timeout=dst_timeout))
            for item in retrans:
                if str(type(item)) != "<type 'NoneType'>":
                    scan_udp_port(dst_ip, dst_port, dst_timeout)
            return 'Open|Filtered'
    elif udp_scan_resp.haslayer(UDP):
        return 'Open'
    elif udp_scan_resp.haslayer(ICMP):
        if int(udp_scan_resp.getlayer(ICMP).type) == 3 and \
                int(udp_scan_resp.getlayer(ICMP).code) == 3:
            return 'Closed'
        elif int(udp_scan_resp.getlayer(ICMP).type) == 3 and \
                int(udp_scan_resp.getlayer(ICMP).code) in [1, 2, 9, 10, 13]:
            return 'Filtered'
        else:
            return 'CHECK'

class NeighborsDetector(object):

    def __init__(self):
        self.port = SETTINGS['default-port']

    def get_all_neighbors(self):
        """Get All Available Neighbors in LAN"""
        result = {}
        for network, netmask, _, interface, address in \
                scapy.config.conf.route.routes:
            # skip loopback network and default gw
            if network == 0 or interface == 'lo' or \
                    address == '127.0.0.1' or address == '0.0.0.0':
                continue

            if netmask <= 0 or netmask == 0xFFFFFFFF:
                continue

            net = to_CIDR_notation(network, netmask)

            if interface != scapy.config.conf.iface:
                msg = ('Skipping %s because scapy currently doesn\'t\
                       support arping on non-primary network \
                       interfaces' % net)
                LOG.warning(msg)
                continue

            if net:
                result[interface] = scan_and_get_neighbors(net, interface)
        return result

    def detect_valid_hosts(self):
        """Detect valid host, which open a given port"""
        neighbors = self.get_all_neighbors()
        valid_host = []
        for neighbor in neighbors.values():
            for _n_ip in neighbor:
                # If the given host opens port, get it.
                if 'Open' in scan_udp_port(_n_ip, self.port):
                    LOG.info('Valid Host was founded: %s' % _n_ip)
                    valid_host.append(_n_ip)
        return valid_host


text:
package edu.utdallas.cs.stormrider.views.materialized;

public class MaterializedViewsException extends RuntimeException
{
	private static final long serialVersionUID = 1207108720172808372L;

	public MaterializedViewsException() 								{ super() ; }
    public MaterializedViewsException( Throwable cause ) 				{ super( cause ) ; }
    public MaterializedViewsException( String msg ) 					{ super( msg ) ; }
    public MaterializedViewsException( String msg, Throwable cause ) 	{ super( msg, cause ) ; }
}


text:
<?php

class Google_Service_DLP_GooglePrivacyDlpV2ListDlpJobsResponse extends Google_Collection
{
  protected $collection_key = 'jobs';
  protected $jobsType = 'Google_Service_DLP_GooglePrivacyDlpV2DlpJob';
  protected $jobsDataType = 'array';
  public $nextPageToken;

  /**
   * @param Google_Service_DLP_GooglePrivacyDlpV2DlpJob[]
   */
  public function setJobs($jobs)
  {
    $this->jobs = $jobs;
  }
  /**
   * @return Google_Service_DLP_GooglePrivacyDlpV2DlpJob[]
   */
  public function getJobs()
  {
    return $this->jobs;
  }
  public function setNextPageToken($nextPageToken)
  {
    $this->nextPageToken = $nextPageToken;
  }
  public function getNextPageToken()
  {
    return $this->nextPageToken;
  }
}


text:
Toggle the visibility of content across items of your screen. Accordion toggle through a number of text blocks with a single click.

NativeBase Accordion renders with pre-defined icons on toggle of text block, header and content style.

![Preview ios accordion-def-headref](https://github.com/GeekyAnts/NativeBase-KitchenSink/raw/v2.6.1/screenshots/ios/accordion.gif)
![Preview android accordion-def-headref](https://github.com/GeekyAnts/NativeBase-KitchenSink/raw/v2.6.1/screenshots/android/accordion.gif)

**Contents:**
* [Icon and Expanded Icon](Components.md#accordion-icon-headref)
* [Icon and Expanded Icon style](Components.md#accordion-icon-style-headref)
* [Header and Content style](Components.md#accordion-header-content-headref)
* [Custom Header and Content](Components.md#accordion-custom-header-content-headref)

*General Syntax*

{% codetabs name="React Native", type="js" -%}
import React, { Component } from "react";
import { Container, Header, Content, Accordion } from "native-base";
const dataArray = [
  { title: "First Element", content: "Lorem ipsum dolor sit amet" },
  { title: "Second Element", content: "Lorem ipsum dolor sit amet" },
  { title: "Third Element", content: "Lorem ipsum dolor sit amet" }
];
export default class AccordionExample extends Component {
  render() {
    return (
      <Container>

        <Content padder>
          <Accordion dataArray={dataArray} expanded={0}/>
        </Content>
      </Container>
    );
  }
}
{%- language name="Vue Native", type="vue" -%}
<template>
  <nb-container>
    <nb-header />
    <nb-content>
      <nb-accordion :dataArray="dataArray" expanded={0}/>
    </nb-content>
  </nb-container>
</template>

{%- endcodetabs %}

**Configuration**

                Property
                Default
                Option
                Description

            dataArray
            Array
             -
            Array of data chunks to render iteratively

            expanded
             -
             -
            Index of accordion set open

            headerStyle
             -
             -
            Style accordion header

            contentStyle
             -
             -
            Style accordion content

            icon
            arrow-down
            user-defined
            Icon when accordion is closed

            expandedIcon
            arrow-up
            user-defined
            Icon when accordion is open

            iconStyle
             -
            user-defined
            Icon style when accordion is closed

            expandedIconStyle
             -
            user-defined
            Icon style when accordion is open

            renderHeader
             -
             -
            Custom design of Accordion header

            renderContent
             -
             -
            Custom design of Accordion content

        onAccordionOpen
             Function
             -
            Callback that is executed when Accordion is opened. It provides two additional metadata: item and index

            onAccordionClose
             Function
             -
            Callback that is executed when Accordion is closed. It provides two additional metadata: item and index


text:
/******************************** MPEG Audio Encoder **************************

   Initial author:       M. Werner
   contents/description: Scale factor estimation

******************************************************************************/

#ifndef _SF_ESTIM_H
#define _SF_ESTIM_H

#include BOSS_FDKAAC_U_common_fix_h //original-code:"common_fix.h"

#include "psy_const.h"
#include "qc_data.h"
#include "interface.h"

#define FORM_FAC_SHIFT  6

void
FDKaacEnc_CalcFormFactor(QC_OUT_CHANNEL   *qcOutChannel[(2)],
               PSY_OUT_CHANNEL  *psyOutChannel[(2)],
               const INT        nChannels);

void
FDKaacEnc_EstimateScaleFactors(PSY_OUT_CHANNEL *psyOutChannel[],
                     QC_OUT_CHANNEL* qcOutChannel[],
                     const int invQuant,
                     const int nChannels);

#endif


text:
package io.github.jeddict.snippet;

public interface SnippetLocation {

    String getTitle();

}


text:
#if !defined(_HttpTransactHeaders_h_)
#define _HttpTransactHeaders_h_

#define ink_time_t time_t

extern int nstrhex(char *d, unsigned int i);

class HttpTransactHeaders
{
public:
  static bool is_this_http_method_supported(int method);
  static bool is_method_cacheable(const HttpConfigParams *http_config_param, const int method);
  static bool is_method_cache_lookupable(int method);
  static bool is_this_a_hop_by_hop_header(const char *field_name_wks);
  static bool is_this_method_supported(int the_scheme, int the_method);

  static void insert_supported_methods_in_response(HTTPHdr *response, int the_scheme);

  static void build_base_response(HTTPHdr *outgoing_response, HTTPStatus status, const char *reason_phrase, int reason_phrase_len,
                                  ink_time_t date);

  static void copy_header_fields(HTTPHdr *src_hdr, HTTPHdr *new_hdr, bool retain_proxy_auth_hdrs, ink_time_t date = 0);

  static void convert_request(HTTPVersion outgoing_ver, HTTPHdr *outgoing_request);
  static void convert_response(HTTPVersion outgoing_ver, HTTPHdr *outgoing_response);
  static void convert_to_0_9_request_header(HTTPHdr *outgoing_request);
  static void convert_to_1_0_request_header(HTTPHdr *outgoing_request);
  static void convert_to_1_1_request_header(HTTPHdr *outgoing_request);
  static void convert_to_0_9_response_header(HTTPHdr *outgoing_response);
  static void convert_to_1_0_response_header(HTTPHdr *outgoing_response);
  static void convert_to_1_1_response_header(HTTPHdr *outgoing_response);

  static ink_time_t calculate_document_age(ink_time_t request_time, ink_time_t response_time, HTTPHdr *base_response,
                                           ink_time_t base_response_date, ink_time_t now);
  static bool does_server_allow_response_to_be_stored(HTTPHdr *resp);
  static bool downgrade_request(bool *origin_server_keep_alive, HTTPHdr *outgoing_request);
  static bool is_method_safe(int method);
  static bool is_method_idempotent(int method);

  static void generate_and_set_squid_codes(HTTPHdr *header, char *via_string, HttpTransact::SquidLogInfo *squid_codes);

  // Removing handle_conditional_headers.  Functionality appears to be elsewhere (issue_revalidate)
  // and the only condition when it does anything causes an assert to go
  // off
  // static void handle_conditional_headers(HttpTransact::CacheLookupInfo * cache_info, HTTPHdr * header);
  static void insert_warning_header(HttpConfigParams *http_config_param, HTTPHdr *header, HTTPWarningCode code,
                                    const char *warn_text = NULL, int warn_text_len = 0);
  static void insert_time_and_age_headers_in_response(ink_time_t request_sent_time, ink_time_t response_received_time,
                                                      ink_time_t now, HTTPHdr *base, HTTPHdr *outgoing);
  static void insert_server_header_in_response(const char *server_tag, int server_tag_size, HTTPHdr *header);
  static void insert_via_header_in_request(HttpTransact::State *s, HTTPHdr *header);
  static void insert_via_header_in_response(HttpTransact::State *s, HTTPHdr *header);
  static void insert_hsts_header_in_response(HttpTransact::State *s, HTTPHdr *header);

  static bool is_request_proxy_authorized(HTTPHdr *incoming_hdr);

  static void insert_basic_realm_in_proxy_authenticate(const char *realm, HTTPHdr *header, bool bRevPrxy);

  static void remove_conditional_headers(HTTPHdr *outgoing);
  static void remove_100_continue_headers(HttpTransact::State *s, HTTPHdr *outgoing);
  static void remove_host_name_from_url(HTTPHdr *outgoing_request);
  static void add_global_user_agent_header_to_request(OverridableHttpConfigParams *http_txn_conf, HTTPHdr *header);
  static void add_server_header_to_response(OverridableHttpConfigParams *http_txn_conf, HTTPHdr *header);
  static void remove_privacy_headers_from_request(HttpConfigParams *http_config_param, OverridableHttpConfigParams *http_txn_conf,
                                                  HTTPHdr *header);

  static int nstrcpy(char *d, const char *as);
};

/*****************************************************************************
 *****************************************************************************
 ****                                                                     ****
 ****                     Inline Utility Routines                         ****
 ****                                                                     ****
 *****************************************************************************
 *****************************************************************************/
inline bool
HttpTransactHeaders::is_this_http_method_supported(int method)
{
  return ((method == HTTP_WKSIDX_GET) || (method == HTTP_WKSIDX_POST) || (method == HTTP_WKSIDX_CONNECT) ||
          (method == HTTP_WKSIDX_DELETE) || (method == HTTP_WKSIDX_PURGE) || (method == HTTP_WKSIDX_HEAD) ||
          (method == HTTP_WKSIDX_OPTIONS) || (method == HTTP_WKSIDX_PUT) || (method == HTTP_WKSIDX_PUSH) ||
          (method == HTTP_WKSIDX_TRACE));
}

inline int
HttpTransactHeaders::nstrcpy(char *d, const char *as)
{
  const char *s = as;
  while (*s)
    *d++ = *s++;
  return s - as;
}

///////////////////////////////////////////////////////////////////////////////
// Name       : is_request_proxy_authorized
// Description: does request authorization meet our authentication requirement
//
// Input      :
// Output     :
//
// Details    :
//   Currently a place holder.
inline bool
HttpTransactHeaders::is_request_proxy_authorized(HTTPHdr *incoming_hdr)
{
  ink_assert(incoming_hdr);
  // TODO: What do we need to do here?
  return true;
}

#endif


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <title>Divya Manian</title>
  <meta name="author" content="Divya Manian">
  <meta name="description" content="About Divya Manian">
  <link rel="icon" type="image/png" href="favicon.png">
  <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700' rel='stylesheet' type='text/css'>

Divya Manian

Divya works at Adobe on tools to help web designers. Previously, she worked at Opera, advocating the use of web technologies while contributing to open source projects and books on web development. She also participates in projects to make gender bias history. She can be reached at hi at nimbu.in

    @divya
    Speaking
    Current Writing
    Past Writing

Divya studied Computer Engineering in Singapore. She abandoned her comfortable first career choice as a device driver developer at Motorola to become in-house designer at a startup and later go freelance.

Open Source Projects

In the throes of a quarter-life crisis, she decided to pursue web technologies with single-minded devotion, leading to collaborative projects such as HTML5 Boilerplate, HTML5 Please,  Move the Web Forward, and more.

Web Opener at Opera

She spent her time advocating web technologies while being involved in spectacular fishpond scandals. She spent her non-work hours writing one book and a chapter of another that benefit Against-Malaria Foundation and Schistosomiasis Control Initiative (so buy her books!)

Product Manager, Adobe

She then joined the Adobe Web Platform team, where she helped organize W3Conf, helped webplatform.org go live, and made CSS features available in browsers. She now works on tools to help the modern web designer.

Leisurely Pursuits

About Feminism: Along with 8 women, she wrote a letter to the Tech Industry to describe the pervasive discrimination that persists in tech industry and advocating for more conversation. It has been covered in Washington Post, NYTimes, PBS, CBS, Elle and more).

Learn to Search: She worked with Joanne McNeil to launch a site to raise awareness on Male Search Illiteracy. Here is a write up about it on The Atlantic.

Fripfrap: She hosts used to host a podcast with Garann Means at fripfrap.io on all things web tech.

Outside of her projects, she can be found haunting thrift shops, sewing machines, Soundcloud or Spotify.

Opinion

<time class="nav-margin right">Oct 29 2014</time>NY Times | Bravado Is Seen as Competence in Men in the Tech World but Not in Women

<time class="nav-margin right">Jun 09 2014</time>Elle Magazine | Women in Tech: Where are we Headed?

<time class="nav-margin right">Jun 08 2014</time>Culture Club | So You Are Sexist, Now What?

<time class="nav-margin right">May 31 2014</time>Time | We Can Finally Talk About Sexism in Tech–So Let's Be Honest

Press/Interviews/Profiles

<time class="nav-margin right">Jun 03 2014</time>Elle Magazine | Can 9 Women Fix The Women In Tech Problem?

<time class="nav-margin right">May 29 2014</time>Alicia Menendez Show | Diversity in the Tech World: Is the Pipeline 'Full of Acid'?

<time class="nav-margin right">May 27 2014</time>Boingboing | Feminism and tech: an overdue and welcome manifesto

<time class="nav-margin right">May 22 2014</time>MotherJones | These Women Are Tired of Being Nice. Read Their Badass Letter About Sexism in Tech.

<time class="nav-margin right">Oct 31 2013</time>The Atlantic | Can't find women for your tech conference?

<time class="nav-margin right">Sep 24 2013</time> Shoptalk Show | With Divya Manian & Garann Means

<time class="nav-margin right">May 01 2013</time>The Breaking Development Podcast | Web Tools for the Open Web with Divya Manian

<time class="nav-margin right">Apr 30 2013</time> .net Magazine | Divya Manian on solving problems

<time class="nav-margin right">Apr 02 2013</time>
    The Bold Italic | Do SF Programmers have a life outside the cubicle?

<time class="nav-margin right">Mar 02 2012</time> The Setup | Divya Manian

<time class="nav-margin right">Feb 01 2012</time> The Web Ahead | Browser Support and Polyfills with Divya Manian

<time class="nav-margin right">Aug 30 2011</time> MozHacks | People of HTML5

Books

<time class="nav-margin right">Nov 21 2012</time> HTML 5 Boilerplate Web Development

<time class="nav-margin right">Nov 21 2012</time> Beginning HTML5 and CSS 3: The Web Evolved

© 2014 Divya Manian


text:
using System;
using System.Collections.Generic;
using System.IO;
using DiscUtils.Streams;

namespace DiscUtils.Iscsi
{
    internal class DiskStream : SparseStream
    {
        private readonly int _blockSize;

        private readonly long _length;
        private readonly long _lun;
        private long _position;
        private readonly Session _session;

        public DiskStream(Session session, long lun, FileAccess access)
        {
            _session = session;
            _lun = lun;

            LunCapacity capacity = session.GetCapacity(lun);
            _blockSize = capacity.BlockSize;
            _length = capacity.LogicalBlockCount * capacity.BlockSize;
            CanWrite = access != FileAccess.Read;
            CanRead = access != FileAccess.Write;
        }

        public override bool CanRead { get; }

        public override bool CanSeek
        {
            get { return true; }
        }

        public override bool CanWrite { get; }

        public override IEnumerable<StreamExtent> Extents
        {
            get { yield return new StreamExtent(0, _length); }
        }

        public override long Length
        {
            get { return _length; }
        }

        public override long Position
        {
            get { return _position; }

            set { _position = value; }
        }

        public override void Flush() {}

        public override int Read(byte[] buffer, int offset, int count)
        {
            if (!CanRead)
            {
                throw new InvalidOperationException("Attempt to read from read-only stream");
            }

            int maxToRead = (int)Math.Min(_length - _position, count);

            long firstBlock = _position / _blockSize;
            long lastBlock = MathUtilities.Ceil(_position + maxToRead, _blockSize);

            byte[] tempBuffer = new byte[(lastBlock - firstBlock) * _blockSize];
            int numRead = _session.Read(_lun, firstBlock, (short)(lastBlock - firstBlock), tempBuffer, 0);

            int numCopied = Math.Min(maxToRead, numRead);
            Array.Copy(tempBuffer, (int)(_position - firstBlock * _blockSize), buffer, offset, numCopied);

            _position += numCopied;

            return numCopied;
        }

        public override long Seek(long offset, SeekOrigin origin)
        {
            long effectiveOffset = offset;
            if (origin == SeekOrigin.Current)
            {
                effectiveOffset += _position;
            }
            else if (origin == SeekOrigin.End)
            {
                effectiveOffset += _length;
            }

            if (effectiveOffset < 0)
            {
                throw new IOException("Attempt to move before beginning of disk");
            }
            _position = effectiveOffset;
            return _position;
        }

        public override void SetLength(long value)
        {
            throw new NotSupportedException();
        }

        public override void Write(byte[] buffer, int offset, int count)
        {
            if (!CanWrite)
            {
                throw new IOException("Attempt to write to read-only stream");
            }

            if (_position + count > _length)
            {
                throw new IOException("Attempt to write beyond end of stream");
            }

            int numWritten = 0;

            while (numWritten < count)
            {
                long block = _position / _blockSize;
                uint offsetInBlock = (uint)(_position % _blockSize);

                int toWrite = count - numWritten;

                // Need to read - we're not handling a full block
                if (offsetInBlock != 0 || toWrite < _blockSize)
                {
                    toWrite = (int)Math.Min(toWrite, _blockSize - offsetInBlock);

                    byte[] blockBuffer = new byte[_blockSize];
                    int numRead = _session.Read(_lun, block, 1, blockBuffer, 0);

                    if (numRead != _blockSize)
                    {
                        throw new IOException("Incomplete read, received " + numRead + " bytes from 1 block");
                    }

                    // Overlay as much data as we have for this block
                    Array.Copy(buffer, offset + numWritten, blockBuffer, (int)offsetInBlock, toWrite);

                    // Write the block back
                    _session.Write(_lun, block, 1, _blockSize, blockBuffer, 0);
                }
                else
                {
                    // Processing at least one whole block, just write (after making sure to trim any partial sectors from the end)...
                    short numBlocks = (short)(toWrite / _blockSize);
                    toWrite = numBlocks * _blockSize;

                    _session.Write(_lun, block, numBlocks, _blockSize, buffer, offset + numWritten);
                }

                numWritten += toWrite;
                _position += toWrite;
            }
        }
    }
}


text:
/*************************************************************************/
/*  scene_debugger.h                                                     */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef SCENE_DEBUGGER_H
#define SCENE_DEBUGGER_H

#include "core/array.h"
#include "core/object.h"
#include "core/pair.h"
#include "core/ustring.h"

class Script;

class SceneDebugger {
public:
	static void initialize();
	static void deinitialize();

#ifdef DEBUG_ENABLED
private:
	static void _save_node(ObjectID id, const String &p_path);
	static void _set_object_property(ObjectID p_id, const String &p_property, const Variant &p_value);
	static void _send_object_id(ObjectID p_id, int p_max_size = 1 << 20);

public:
	static Error parse_message(void *p_user, const String &p_msg, const Array &p_args, bool &r_captured);
	static void add_to_cache(const String &p_filename, Node *p_node);
	static void remove_from_cache(const String &p_filename, Node *p_node);
#endif
};

#ifdef DEBUG_ENABLED
class SceneDebuggerObject {
private:
	void _parse_script_properties(Script *p_script, ScriptInstance *p_instance);

public:
	typedef Pair<PropertyInfo, Variant> SceneDebuggerProperty;
	ObjectID id;
	String class_name;
	List<SceneDebuggerProperty> properties;

	SceneDebuggerObject(ObjectID p_id);
	SceneDebuggerObject() {}

	void serialize(Array &r_arr, int p_max_size = 1 << 20);
	void deserialize(const Array &p_arr);
};

class SceneDebuggerTree {
public:
	struct RemoteNode {
		int child_count;
		String name;
		String type_name;
		ObjectID id;

		RemoteNode(int p_child, const String &p_name, const String &p_type, ObjectID p_id) {
			child_count = p_child;
			name = p_name;
			type_name = p_type;
			id = p_id;
		}

		RemoteNode() {}
	};

	List<RemoteNode> nodes;

	void serialize(Array &r_arr);
	void deserialize(const Array &p_arr);
	SceneDebuggerTree(Node *p_root);
	SceneDebuggerTree() {}
};

class LiveEditor {
private:
	friend class SceneDebugger;
	Map<int, NodePath> live_edit_node_path_cache;
	Map<int, String> live_edit_resource_cache;

	NodePath live_edit_root;
	String live_edit_scene;

	Map<String, Set<Node *>> live_scene_edit_cache;
	Map<Node *, Map<ObjectID, Node *>> live_edit_remove_list;

	void _send_tree();

	void _node_path_func(const NodePath &p_path, int p_id);
	void _res_path_func(const String &p_path, int p_id);

	void _node_set_func(int p_id, const StringName &p_prop, const Variant &p_value);
	void _node_set_res_func(int p_id, const StringName &p_prop, const String &p_value);
	void _node_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE);
	void _res_set_func(int p_id, const StringName &p_prop, const Variant &p_value);
	void _res_set_res_func(int p_id, const StringName &p_prop, const String &p_value);
	void _res_call_func(int p_id, const StringName &p_method, VARIANT_ARG_DECLARE);
	void _root_func(const NodePath &p_scene_path, const String &p_scene_from);

	void _create_node_func(const NodePath &p_parent, const String &p_type, const String &p_name);
	void _instance_node_func(const NodePath &p_parent, const String &p_path, const String &p_name);
	void _remove_node_func(const NodePath &p_at);
	void _remove_and_keep_node_func(const NodePath &p_at, ObjectID p_keep_id);
	void _restore_node_func(ObjectID p_id, const NodePath &p_at, int p_at_pos);
	void _duplicate_node_func(const NodePath &p_at, const String &p_new_name);
	void _reparent_node_func(const NodePath &p_at, const NodePath &p_new_place, const String &p_new_name, int p_at_pos);

	LiveEditor() {
		singleton = this;
		live_edit_root = NodePath("/root");
	};

	static LiveEditor *singleton;

public:
	static LiveEditor *get_singleton();
};
#endif

#endif


text:
namespace Teaq.Tests.FastReflection.SupportingTypes
{
    public sealed class SealedType
    {
        public int Int32Property { get; set; }
    }
}


text:
import XMonad
import qualified XMonad.Hooks.Script as SC
import qualified XMonad.Hooks.ManageDocks as MD
import XMonad.Util.Run as R
import qualified XMonad.Hooks.DynamicLog as DL
import qualified XMonad.StackSet as W
import qualified XMonad.Util.EZConfig as EZ
import XMonad.Actions.SpawnOn (spawnOn)
import qualified Data.Map as M
import qualified Data.List as L
import qualified Data.Char
import XMonad.Actions.Submap (submap)
import qualified XMonad.Actions.CycleWS as CWS
import qualified XMonad.Layout.Grid as GR
import XMonad.StackSet (current, visible, workspace, stack)
import Data.Maybe (isNothing, fromJust, listToMaybe)
import Data.List (findIndices, elemIndex)
import XMonad.Util.Scratchpad (scratchpadSpawnAction, scratchpadManageHook, scratchpadFilterOutWorkspace)
import XMonad.Actions.RotSlaves (rotAllUp, rotAllDown)
import qualified XMonad.Layout.MultiToggle.Instances as IN
import XMonad.Layout.MultiToggle (mkToggle, (??))
import qualified XMonad.Layout.MultiToggle as MT
import qualified XMonad.Actions.FloatKeys as FK
import XMonad.Layout.Tabbed (simpleTabbed)
import XMonad.Hooks.SetWMName (setWMName)
import qualified XMonad.Actions.SwapWorkspaces as SW
import qualified XMonad.Util.NamedScratchpad as SP

-- matching the class name exactly is a pain.
-- I can't remember the exact class name for chromium or firefox.
contains :: String -> String -> Bool
contains x y = L.isInfixOf (map Data.Char.toLower x) (map Data.Char.toLower y)

(=??) :: Query String -> String -> Query Bool
q =?? x = fmap (contains x) q

myTerminal = "urxvt"

-- super not alt (conflicts with emacs)
myModMask = mod4Mask

myExtraWorkspaces = [(xK_0, "0"), (xK_minus, "-"), (xK_equal, "="), (xK_BackSpace, "misc")]

myWorkspaces = (workspaces defaultConfig) ++ xs where
        xs = map snd myExtraWorkspaces

myExtraKeys = mySwapWorkspaceKeys ++  myNavigationMap ++ myNavKeys ++ myBanishKeys ++ myScratchpadKeys ++
        [myVolumeSubmap, myBacklightSubmap, myLaunchSubmap, myAppWindowSubmap]

--myShrinkWindow :: X ()
--myShrinkWindow = withFocused $ FK.keysResizeWindow (-50, -50) (1/2, 1/2)

--myGrowWindow :: X ()
--myGrowWindow = withFocused $ FK.keysResizeWindow (50, 50) (1/2, 1/2)

--data Axis = Horiz | Vert
--data Direction = DirLeft | DirRight | DirUp | DirDown

--myShrinkWindow :: Axis -> X ()
--myShrinkWindow Horiz = withFocused $ FK.keysResizeWindow (0, -50) (0, 0)
--myShrinkWindow Vert = withFocused $ FK.keysResizeWindow (-50, 0) (0, 0)

--myGrowWindow :: Axis -> X ()
--myGrowWindow Horiz = withFocused $ FK.keysResizeWindow (0, 50) (0, 0)
--myGrowWindow Vert = withFocused $ FK.keysResizeWindow (50, 0) (0, 0)

mySwapWorkspaceKeys =
        [ ((myModMask .|. controlMask, k), windows $ SW.swapWithCurrent i)
                | (i, k) <- zip (map show [1..9]) [xK_1 ..]]

-- arrow keys for cycling workspaces.
myNavigationMap =
        [ ((myModMask, xK_Down), CWS.nextWS)
        , ((myModMask, xK_Up), CWS.prevWS)
        , ((myModMask .|. shiftMask, xK_Down), CWS.shiftToNext)
        , ((myModMask .|. shiftMask, xK_Up), CWS.shiftToPrev)
        , ((myModMask, xK_Right), CWS.nextScreen)
        , ((myModMask, xK_Left), CWS.prevScreen)
        , ((myModMask .|. shiftMask, xK_Right), CWS.shiftNextScreen)
        , ((myModMask .|. shiftMask, xK_Left), CWS.shiftPrevScreen)
        , ((myModMask, xK_z), CWS.toggleWS)
        , ((myModMask, xK_f), CWS.moveTo CWS.Next CWS.EmptyWS)
--      , ((myModMask .|. shiftMask, xK_f), moveToNextFree) ]
        , ((myModMask .|. shiftMask, xK_f), CWS.shiftTo CWS.Next CWS.EmptyWS)
        , ((myModMask, xK_y), sendMessage $ MT.Toggle IN.FULL) ]
--      , ((myModMask, xK_u), myGrowWindow Horiz )
--      , ((myModMask .|. shiftMask, xK_u), myShrinkWindow Horiz)
--      , ((myModMask, xK_i), myGrowWindow Vert)
--      , ((myModMask .|. shiftMask, xK_i), myShrinkWindow Vert) ]

myNavKeys = [
        ((myModMask, key), (windows $ W.greedyView ws)) | (key, ws) <- myExtraWorkspaces ]

myBanishKeys = [
        ((myModMask .|. shiftMask, key), (windows $ W.shift ws)) | (key, ws) <- myExtraWorkspaces ]

-- scratchpads =
--        [ SP.NS "gedit" "gedit -s" (title =? "gedit") SP.defaultFloating
--        ]

myScratchpadKeys =
        [ ((myModMask, xK_grave), scratchpadSpawnAction defaultConfig {terminal = myTerminal}) ]

myVolumeSubmap = ((myModMask, xK_v), submap . M.fromList $
        [ ((0, xK_1), amixer 10)
        , ((0, xK_2), amixer 20)
        , ((0, xK_3), amixer 30)
        , ((0, xK_4), amixer 40)
        , ((0, xK_5), amixer 50)
        , ((0, xK_6), amixer 60)
        , ((0, xK_7), amixer 70)
        , ((0, xK_8), amixer 80)
        , ((0, xK_9), amixer 90)
        , ((0, xK_0), amixer 100)
        , ((0, xK_m), run "amixer set Master 1+ toggle")
        ]) where
                run = R.unsafeSpawn
                amixer n = run ("amixer set Master " ++ show n ++ "%")

myBacklightSubmap = ((myModMask, xK_b), submap . M.fromList $
        [ ((0, xK_grave), xbacklight 2)
        , ((0, xK_1), xbacklight 10)
        , ((0, xK_2), xbacklight 20)
        , ((0, xK_3), xbacklight 30)
        , ((0, xK_4), xbacklight 40)
        , ((0, xK_5), xbacklight 50)
        , ((0, xK_6), xbacklight 60)
        , ((0, xK_7), xbacklight 70)
        , ((0, xK_8), xbacklight 80)
        , ((0, xK_9), xbacklight 90)
        , ((0, xK_0), xbacklight 100)
        ]) where
                run = R.unsafeSpawn
                xbacklight n = run ("xbacklight -set " ++ show n ++ "%")

myLaunchSubmap = ((myModMask, xK_c), submap . M.fromList $
        [ ((0, xK_d), run "chromium")
        , ((0, xK_e), run "emacs")
        , ((0, xK_n), run "urxvt -e nmtui")
        , ((0, xK_p), run "pidgin")
        , ((0, xK_a), run "urxvt -e alsamixer")
        , ((0, xK_f), run "firefox")
        , ((0, xK_i), run "ipython qtconsole")
        , ((0, xK_t), run "thunar")
        , ((0, xK_s), run "scrot")
        , ((0, xK_j), run "idea.sh")
        , ((0, xK_m), run "midori")
        , ((0, xK_g), run "gedit")
        , ((0, xK_v), run "virtualbox")
        ]) where
                run = R.unsafeSpawn

-- Mouse bindings blatantly stolen from xmonad.config
-- | Mouse bindings: default actions bound to mouse events
myMouseBindings :: XConfig Layout -> M.Map (KeyMask, Button) (Window -> X ())
myMouseBindings (XConfig {XMonad.modMask = modMask}) = M.fromList
        -- mod-button1 %! Set the window to floating mode and move by dragging
        [ ((modMask .|. shiftMask, button1), \w -> focus w >> mouseMoveWindow w
                >> windows W.shiftMaster)
        -- mod-button2 %! Raise the window to the top of the stack
        , ((modMask, button2), windows . (W.shiftMaster .) . W.focusWindow)
        -- mod-button3 %! Set the window to floating mode and resize by dragging
        , ((modMask, button3), \w -> focus w >> mouseResizeWindow w
                >> windows W.shiftMaster)
        -- you may also bind events to the mouse scroll wheel (button4 and button5)
        ]

appDefaults = composeAll
        [ className =?? "emacs" --> doShift "1"
        , className =?? "pidgin" --> doShift "2"
        , className =?? "virtualbox" --> doShift "3"
        , className =?? "gedit" --> doShift "4"
        , className =?? "chromium" --> doShift "5"
        , className =?? "firefox" --> doShift "6"
        , className =?? "midori" --> doShift "7"
        ]

myAppWindowSubmap = ((myModMask, xK_x), submap . M.fromList $
        [ ((0, xK_e), windows $ W.greedyView "1")
        , ((0, xK_p), windows $ W.greedyView "2")
        , ((0, xK_v), windows $ W.greedyView "3")
        , ((0, xK_g), windows $ W.greedyView "4")
        , ((0, xK_d), windows $ W.greedyView "5")
        , ((0, xK_f), windows $ W.greedyView "6")
        , ((0, xK_m), windows $ W.greedyView "7")
        ])

myManageHook =
        appDefaults
        <+> scratchpadManageHook (W.RationalRect 0.25 0.3 0.5 0.4)
        <+> MD.manageDocks <+> manageHook defaultConfig {terminal = myTerminal}

myLayout = mkToggle (IN.NOBORDERS ?? IN.FULL ?? MT.EOT) (layoutHook defaultConfig ||| GR.Grid ||| simpleTabbed)

myConfig = defaultConfig
        { manageHook = myManageHook
        , workspaces = myWorkspaces
        , layoutHook = MD.avoidStruts myLayout -- (layoutHook defaultConfig ||| GR.Grid)
        , terminal = myTerminal
        , modMask = myModMask
        , borderWidth = 3
        , focusedBorderColor = "#0055FF"
        , normalBorderColor = "#663300"
        , mouseBindings = myMouseBindings
        , startupHook = setWMName "LG3D" >> SC.execScriptHook "startup"
        } `EZ.additionalKeys` myExtraKeys

main = do
        h <- R.spawnPipe "xmobar"
        xmonad $ myConfig
                { logHook = DL.dynamicLogWithPP $ DL.defaultPP { DL.ppOutput = R.hPutStrLn h } }


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/favicon.ico">
	<meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0">
	<link rel="stylesheet" type="text/css" href="../../../../examples/resources/syntax/shCore.css">
	<link rel="stylesheet" type="text/css" href="../../../../examples/resources/demo.css">

	<title>Buttons examples - HTML5 export buttons</title>

Buttons example HTML5 export buttons

The HTML5 export buttons make use of the local file saving features of modern browsers (IE10+, Chrome, Safari, Firefox and Opera) to create files on the
				client-side and then download them without any server interaction required.

Browsers which do not support the required APIs for these button types have the option of using the Flash button alternatives, otherwise the buttons will not
				appear on the end user's page (no errors will be generated if this is the case).

The examples in this section explore the options available for the HTML5 export buttons.

HTML 5 data export

								HTML5 export buttons

								Tab separated values

								File name

								Copy button internationalisation

								Column selectors

								Format output data - orthogonal data

								Format output data - export options

								Excel - Bold text

								Excel - Cell background

								Excel - Customise borders

								PDF - message

								PDF - page size and orientation

								PDF - image

								PDF - open in new window

								Custom file (JSON)

Please refer to the DataTables documentation for full information about its API properties and methods.

					Additionally, there are a wide range of extensions and plug-ins which extend the capabilities of DataTables.

DataTables designed and created by SpryMedia Ltd © 2007-2016

					DataTables is licensed under the MIT license.


text:
package mhst.parkingmap;

import Entity.ObjectDrawerItem;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class DrawerItemCustomAdapter extends ArrayAdapter<ObjectDrawerItem>{
	Context mContext;
    int layoutResourceId;
    ObjectDrawerItem data[] = null;

	public DrawerItemCustomAdapter(Context mContext, int layoutResourceId,
			ObjectDrawerItem[] data) {
		super(mContext, layoutResourceId, data);
        this.layoutResourceId = layoutResourceId;
        this.mContext = mContext;
        this.data = data;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub

		View listItem = convertView;

        LayoutInflater inflater = ((Activity) mContext).getLayoutInflater();
        listItem = inflater.inflate(layoutResourceId, parent, false);

        ImageView imageViewIcon = (ImageView) listItem.findViewById(R.id.imageViewIcon);
        TextView textViewName = (TextView) listItem.findViewById(R.id.textViewName);

        ObjectDrawerItem folder = data[position];

        imageViewIcon.setImageResource(folder.icon);
        textViewName.setText(folder.name);

        return listItem;
	}

}


text:
/*
 * File:   Communications.h
 * Author: User
 *
 * Created on June 7, 2015, 5:50 PM
 */

#ifndef COMMUNICATIONS_H
#define	COMMUNICATIONS_H

#ifdef	__cplusplus
extern "C" {
#endif

#include <xc.h>
#include <stdbool.h>
#include "PinDef.h"
#include "ADDRESSING.h"

    extern void sendData(unsigned char whereToSend);
    extern bool receiveData();
    extern void ToSend(const unsigned char where, const unsigned int what);
    extern volatile int receiveArray[20];
    extern bool Transmit_stall;
    extern volatile unsigned int talkTime, safetyTime;
    void updateComms();
    void checkCommDirection();
    void respondECU();

#ifdef	__cplusplus
}
#endif

#endif	/* COMMUNICATIONS_H */


text:
'use strict';

var createStore = require('fluxible/addons/createStore');
var makeHandlers = require('../lib/fluxible/makeHandlers');
var Actions = require('../constants/Actions');
var _ = require('lodash');
var TimeslotActions = require('../actions/TimeslotActions');
var moment = require('moment');

moment.locale('fr')

module.exports = createStore({
    storeName: 'TimeslotStore',
    handlers: makeHandlers({
        onReceiveTimeslots: Actions.RECEIVE_BUSINESS_TIMESLOTS
    }),
    initialize: function () {
        this.timeslots = {};
    },
    dehydrate: function () {
        return {
            timeslots: this.timeslots
        };
    },
    rehydrate: function (state) {
        this.timeslots = state.timeslots;
    },
    onReceiveTimeslots: function(payload) {
        if (!this.timeslots[payload.id])
            this.timeslots[payload.id] = {};
        _.forEach(payload.timeslots, function(timeslots, date) {
            this.timeslots[payload.id][date] = timeslots;
        }.bind(this));
        this.emitChange();
    },
    getById: function (businessId) {
        return this.timeslots[businessId];
    }
});


text:
.. Licensed to the Apache Software Foundation (ASF) under one
.. or more contributor license agreements.  See the NOTICE file
.. distributed with this work for additional information
.. regarding copyright ownership.  The ASF licenses this file
.. to you 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.

.. highlight:: none

.. _repair:

Repair
------

Cassandra is designed to remain available if one of it's nodes is down or unreachable. However, when a node is down or
unreachable, it needs to eventually discover the writes it missed. Hints attempt to inform a node of missed writes, but
are a best effort, and aren't guaranteed to inform a node of 100% of the writes it missed. These inconsistencies can
eventually result in data loss as nodes are replaced or tombstones expire.

These inconsistencies are fixed with the repair process. Repair synchronizes the data between nodes by comparing their
respective datasets for their common token ranges, and streaming the differences for any out of sync sections between
the nodes. It compares the data with merkle trees, which are a hierarchy of hashes.

Incremental and Full Repairs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

There are 2 types of repairs: full repairs, and incremental repairs. Full repairs operate over all of the data in the
token range being repaired. Incremental repairs only repair data that's been written since the previous incremental repair.

Incremental repairs are the default repair type, and if run regularly, can significantly reduce the time and io cost of
performing a repair. However, it's important to understand that once an incremental repair marks data as repaired, it won't
try to repair it again. This is fine for syncing up missed writes, but it doesn't protect against things like disk corruption,
data loss by operator error, or bugs in Cassandra. For this reason, full repairs should still be run occasionally.

Usage and Best Practices
^^^^^^^^^^^^^^^^^^^^^^^^

Since repair can result in a lot of disk and network io, it's not run automatically by Cassandra. It is run by the operator
via nodetool.

Incremental repair is the default and is run with the following command:

::

    nodetool repair

A full repair can be run with the following command:

::

    nodetool repair --full

Additionally, repair can be run on a single keyspace:

::

    nodetool repair [options] <keyspace_name>

Or even on specific tables:

::

    nodetool repair [options] <keyspace_name> <table1> <table2>

The repair command only repairs token ranges on the node being repaired, it doesn't repair the whole cluster. By default, repair
will operate on all token ranges replicated by the node you're running repair on, which will cause duplicate work if you run it
on every node. The ``-pr`` flag will only repair the "primary" ranges on a node, so you can repair your entire cluster by running
``nodetool repair -pr`` on each node in a single datacenter.

The specific frequency of repair that's right for your cluster, of course, depends on several factors. However, if you're
just starting out and looking for somewhere to start, running an incremental repair every 1-3 days, and a full repair every
1-3 weeks is probably reasonable. If you don't want to run incremental repairs, a full repair every 5 days is a good place
to start.

At a minimum, repair should be run often enough that the gc grace period never expires on unrepaired data. Otherwise, deleted
data could reappear. With a default gc grace period of 10 days, repairing every node in your cluster at least once every 7 days
will prevent this, while providing enough slack to allow for delays.

Other Options
^^^^^^^^^^^^^

``-pr, --partitioner-range``
    Restricts repair to the 'primary' token ranges of the node being repaired. A primary range is just a token range for
    which a node is the first replica in the ring.

``-prv, --preview``
    Estimates the amount of streaming that would occur for the given repair command. This builds the merkle trees, and prints
    the expected streaming activity, but does not actually do any streaming. By default, incremental repairs are estimated,
    add the ``--full`` flag to estimate a full repair.

``-vd, --validate``
    Verifies that the repaired data is the same across all nodes. Similiar to ``--preview``, this builds and compares merkle
    trees of repaired data, but doesn't do any streaming. This is useful for troubleshooting. If this shows that the repaired
    data is out of sync, a full repair should be run.

.. seealso::
    :ref:`nodetool repair docs <nodetool_repair>`

Full Repair Example
^^^^^^^^^^^^^^^^^^^^
Full repair is typically needed to redistribute data after increasing the replication factor of a keyspace or after adding a node to the cluster. Full repair involves streaming SSTables. To demonstrate full repair start with a three node cluster.

::

 [ec2-user@ip-10-0-2-238 ~]$ nodetool status
 Datacenter: us-east-1
 =====================
 Status=Up/Down
 |/ State=Normal/Leaving/Joining/Moving
 --  Address   Load        Tokens  Owns  Host ID                              Rack
 UN  10.0.1.115  547 KiB     256    ?  b64cb32a-b32a-46b4-9eeb-e123fa8fc287  us-east-1b
 UN  10.0.3.206  617.91 KiB  256    ?  74863177-684b-45f4-99f7-d1006625dc9e  us-east-1d
 UN  10.0.2.238  670.26 KiB  256    ?  4dcdadd2-41f9-4f34-9892-1f20868b27c7  us-east-1c

Create a keyspace with replication factor 3:

::

 cqlsh> DROP KEYSPACE cqlkeyspace;
 cqlsh> CREATE KEYSPACE CQLKeyspace
   ... WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 3};

Add a table to the keyspace:

::

 cqlsh> use cqlkeyspace;
 cqlsh:cqlkeyspace> CREATE TABLE t (
            ...   id int,
            ...   k int,
            ...   v text,
            ...   PRIMARY KEY (id)
            ... );

Add table data:

::

 cqlsh:cqlkeyspace> INSERT INTO t (id, k, v) VALUES (0, 0, 'val0');
 cqlsh:cqlkeyspace> INSERT INTO t (id, k, v) VALUES (1, 1, 'val1');
 cqlsh:cqlkeyspace> INSERT INTO t (id, k, v) VALUES (2, 2, 'val2');

A query lists the data added:

::

 cqlsh:cqlkeyspace> SELECT * FROM t;

 id | k | v
 ----+---+------
  1 | 1 | val1
  0 | 0 | val0
  2 | 2 | val2
 (3 rows)

Make the following changes to a three node cluster:

1.       Increase the replication factor from 3 to 4.
2.       Add a 4th node to the cluster

When the replication factor is increased the following message gets output indicating that a full repair is needed as per (`CASSANDRA-13079
<https://issues.apache.org/jira/browse/CASSANDRA-13079>`_):

::

 cqlsh:cqlkeyspace> ALTER KEYSPACE CQLKeyspace
            ... WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 4};
 Warnings :
 When increasing replication factor you need to run a full (-full) repair to distribute the
 data.

Perform a full repair on the keyspace ``cqlkeyspace`` table ``t`` with following command:

::

 nodetool repair -full cqlkeyspace t

Full repair completes in about a second as indicated by the output:

::

[ec2-user@ip-10-0-2-238 ~]$ nodetool repair -full cqlkeyspace t
[2019-08-17 03:06:21,445] Starting repair command #1 (fd576da0-c09b-11e9-b00c-1520e8c38f00), repairing keyspace cqlkeyspace with repair options (parallelism: parallel, primary range: false, incremental: false, job threads: 1, ColumnFamilies: [t], dataCenters: [], hosts: [], previewKind: NONE, # of ranges: 1024, pull repair: false, force repair: false, optimise streams: false)
[2019-08-17 03:06:23,059] Repair session fd8e5c20-c09b-11e9-b00c-1520e8c38f00 for range [(-8792657144775336505,-8786320730900698730], (-5454146041421260303,-5439402053041523135], (4288357893651763201,4324309707046452322], ... , (4350676211955643098,4351706629422088296]] finished (progress: 0%)
[2019-08-17 03:06:23,077] Repair completed successfully
[2019-08-17 03:06:23,077] Repair command #1 finished in 1 second
[ec2-user@ip-10-0-2-238 ~]$

The ``nodetool  tpstats`` command should list a repair having been completed as ``Repair-Task`` > ``Completed`` column value of 1:

::

 [ec2-user@ip-10-0-2-238 ~]$ nodetool tpstats
 Pool Name Active   Pending Completed   Blocked  All time blocked
 ReadStage  0           0           99       0              0
 …
 Repair-Task 0       0           1        0              0
 RequestResponseStage                  0        0        2078        0               0


text:
package io.thesis.collector.flink.rest.samples;

import io.thesis.collector.flink.rest.client.FlinkRestClient;
import io.thesis.collector.flink.rest.client.FlinkRestClientImpl;
import org.junit.Before;
import org.junit.Test;
import org.springframework.web.client.RestTemplate;

import java.util.Map;

import static org.assertj.core.api.Assertions.assertThat;

public final class ClusterInfoCollectorIT {

    private ClusterInfoCollector collector;

    @Before
    public void setUp() {
        final FlinkRestClient flinkRestClient = new FlinkRestClientImpl(new RestTemplate(), "localhost", 8081);
        collector = new ClusterInfoCollector(flinkRestClient);

    }
    @Test
    public void testCollectSample() {
        final Map<String, Object> result = collector.collectSample().join();
        assertThat(result).isNotNull();
        assertThat(result.get(ClusterInfoCollector.SAMPLE_KEY)).isNotNull();
        assertThat(result.get(ClusterInfoCollector.SAMPLE_KEY) instanceof Map).isTrue();
    }
}