text:
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using AlephNote.Common.Repository;
using AlephNote.Common.Settings;
using AlephNote.Common.Themes;
using AlephNote.PluginInterface.Util;
using MSHC.Lang.Collections;

namespace AlephNote.WPF.Controls
{
	/// <summary>
	/// Interaction logic for TagEditor.xaml
	/// </summary>
	public partial class TagEditor : INotifyPropertyChanged, ITagEditor
	{
		public delegate void TagsSourceChanged(ITagEditor source);

		public static readonly DependencyProperty TagSourceProperty =
			DependencyProperty.Register(
			"TagSource",
			typeof(IList<string>),
			typeof(TagEditor),
			new FrameworkPropertyMetadata(TagsChanged));

		public IList<string> TagSource
		{
			get { return (IList<string>)GetValue(TagSourceProperty); }
			set { SetValue(TagSourceProperty, value); }
		}

		public static readonly DependencyProperty RepositoryProperty =
			DependencyProperty.Register(
			"Repository",
			typeof(NoteRepository),
			typeof(TagEditor),
			new FrameworkPropertyMetadata(null));

		public NoteRepository Repository
		{
			get { return (NoteRepository)GetValue(RepositoryProperty); }
			set { SetValue(RepositoryProperty, value); }
		}

		public static readonly DependencyProperty SettingsProperty =
			DependencyProperty.Register(
			"Settings",
			typeof(AppSettings),
			typeof(TagEditor),
			new FrameworkPropertyMetadata(null));

		public AppSettings Settings
		{
			get { return (AppSettings)GetValue(SettingsProperty); }
			set { SetValue(SettingsProperty, value); }
		}

		public static readonly DependencyProperty ReadonlyProperty =
			DependencyProperty.Register(
			"Readonly",
			typeof(bool),
			typeof(TagEditor),
			new FrameworkPropertyMetadata(false));

		public bool Readonly
		{
			get { return (bool)GetValue(ReadonlyProperty); }
			set { SetValue(ReadonlyProperty, value); }
		}

		public string FormattedText
		{
			get
			{
				return ((TagSource != null) ? string.Join(" ", TagSource.Select(t => $"[{t}]")) : string.Empty) + " " + new TextRange(TagCtrl.Document.ContentStart, TagCtrl.Document.ContentEnd).Text.Trim();
			}
		}

		public event TagsSourceChanged Changed;

		public TagEditor()
		{
			InitializeComponent();

			MainGrid.DataContext = this;

			TagCtrl.PreviewKeyDown += OnKeyDown;
			TagCtrl.TextChanged += OnTextChanged;
		}

		private void OnTextChanged(object sender, TextChangedEventArgs e)
		{
			if (Settings?.IsReadOnlyMode == true) return;
			if (Readonly) return;

			var para = TagCtrl.CaretPosition.Paragraph;

			if (para != null && e.Changes.Any(c => c.RemovedLength > 0))
			{
				var doctags = para.Inlines
					.OfType<InlineUIContainer>()
					.Select(r => r.Child)
					.Cast<ContentPresenter>()
					.Select(p => p.Content.ToString())
					.ToList();

				if (!TagSource.SequenceEqual(doctags))
				{
					TagSource.SynchronizeCollection(doctags);

					Changed?.Invoke(this);
				}
			}

			var text = new TextRange(TagCtrl.Document.ContentStart, TagCtrl.Document.ContentEnd).Text.Trim();

			if (text.Length >= 2 && Repository != null && Settings != null && Settings.TagAutocomplete)
			{
				var hints = Repository
					.EnumerateAllTags()
					.Concat(new[] { AppSettings.TAG_MARKDOWN, AppSettings.TAG_LIST })
					.OrderBy(p => p)
					.Distinct()
					.Except(TagSource)
					.Where(t => t.ToLower().StartsWith(text.ToLower()))
					.ToList();

				if (hints.Any())
				{
					AutocompleteContent.Items.SynchronizeGenericCollection(hints);
					AutocompleteContent.SelectedIndex = -1;

					AutocompletePopup.Width = MainGrid.ActualWidth;
					AutocompletePopup.IsOpen = true;
				}
				else
				{
					AutocompletePopup.IsOpen = false;
				}
			}
			else
			{
				AutocompletePopup.IsOpen = false;
			}

			OnExplicitPropertyChanged("FormattedText");
		}

		private static void TagsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			var editor = ((TagEditor)d);

			var vold = e.OldValue as INotifyCollectionChanged;
			var vnew = e.NewValue as INotifyCollectionChanged;

			if (vold != null) vold.CollectionChanged -= editor.OnTagsCollectionChanged;
			if (vnew != null) vnew.CollectionChanged += editor.OnTagsCollectionChanged;

			editor.RecreateTags();

			editor.Changed?.Invoke(editor);

			editor.OnExplicitPropertyChanged("FormattedText");
		}

		private void OnTagsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
		{
			RecreateTags();

			Changed?.Invoke(this);

			OnExplicitPropertyChanged("FormattedText");
		}

		private void OnKeyDown(object sender, KeyEventArgs e)
		{
			if (Settings?.IsReadOnlyMode == true) return;
			if (Readonly) return;

			if (e.Key == Key.Enter || e.Key == Key.Tab)
			{
				var text = TagCtrl.CaretPosition.GetTextInRun(LogicalDirection.Backward);

				if (string.IsNullOrWhiteSpace(text) && e.Key == Key.Enter)
				{
					e.Handled = true;
				}
				else if (string.IsNullOrWhiteSpace(text) && e.Key == Key.Tab)
				{
					e.Handled = false;
				}
				else
				{
					TagSource.Add(text);
					e.Handled = true;

					Changed?.Invoke(this);
				}

				AutocompletePopup.IsOpen = false;
			}
		}

		private void RecreateTags()
		{
			TagCtrl.TextChanged -= OnTextChanged;

			var para = TagCtrl.CaretPosition.Paragraph;

			if (para == null) return;

			para.Inlines.Clear();

			foreach (var tag in TagSource ?? new List<string>())
			{
				var tokenContainer = CreateTokenContainer(tag);
				para.Inlines.Add(tokenContainer);
			}

			TagCtrl.CaretPosition = TagCtrl.CaretPosition.DocumentEnd;

			TagCtrl.TextChanged += OnTextChanged;
		}

		private InlineUIContainer CreateTokenContainer(object token)
		{
			var presenter = new ContentPresenter
			{
				Content = token,
				ContentTemplate = (DataTemplate)FindResource("TagTemplate"),
			};

			// BaselineAlignment is needed to align with Run
			return new InlineUIContainer(presenter) { BaselineAlignment = BaselineAlignment.Center };
		}

		public event PropertyChangedEventHandler PropertyChanged;

		protected virtual void OnExplicitPropertyChanged(string propertyName)
		{
			PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
		}

		private void AutocompleteContent_Selected(object sender, RoutedEventArgs e)
		{
			if (Settings?.IsReadOnlyMode == true) return;
			if (Readonly) return;

			if (AutocompleteContent.SelectedIndex >= 0 && AutocompleteContent.SelectedValue != null)
			{
				var tag = (string)AutocompleteContent.SelectedValue;

				TagSource.Add(tag);

				Changed?.Invoke(this);

				AutocompletePopup.IsOpen = false;
			}
		}
	}
}


text:
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
 * Hash table
 *
 * The hash function used here is by Bob Jenkins, 1996:
 *    <http://burtleburtle.net/bob/hash/doobs.html>
 *       "By Bob Jenkins, 1996.  bob_jenkins@burtleburtle.net.
 *       You may use this code any way you wish, private, educational,
 *       or commercial.  It's free."
 *
 * The rest of the file is licensed under the BSD license.  See LICENSE.
 */

#include "memcached.h"
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/signal.h>
#include <sys/resource.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <pthread.h>

#define mark_bit(p) __atomic_store_n(&p, (struct _stritem *) ((uintptr_t)p | 1), __ATOMIC_SEQ_CST)
#define unmark_bit(p) __atomic_store_n(&p, (struct _stritem *) ((uintptr_t)p & ~1), __ATOMIC_SEQ_CST)
#define is_marked(p) ((uintptr_t)p & 1)
#define get_pointer(p) ((struct _stritem *) ((uintptr_t)p & ~1))
#define cas(p, v) __sync_bool_compare_and_swap(&p, p, v)
#define increase(p) __atomic_fetch_add(&p, 1, __ATOMIC_SEQ_CST)
#define decrease(p) __atomic_fetch_add(&p, -1, __ATOMIC_SEQ_CST)

static pthread_cond_t maintenance_cond = PTHREAD_COND_INITIALIZER;

typedef  unsigned long  int  ub4;   /* unsigned 4-byte quantities */
typedef  unsigned       char ub1;   /* unsigned 1-byte quantities */

/* how many powers of 2's worth of buckets we use */
unsigned int hashpower = HASHPOWER_DEFAULT;

#define hashsize(n) ((ub4)1<<(n))
#define hashmask(n) (hashsize(n)-1)

/* Main hash table. This is where we look except during expansion. */
static item** primary_hashtable = 0;

/*
 * Previous hash table. During expansion, we look here for keys that haven't
 * been moved over to the primary yet.
 */
static item** old_hashtable = 0;

/* Number of items in the hash table. */
static unsigned int hash_items = 0;

/* Flag: Are we in the middle of expanding now? */
static bool expanding = false;
static bool started_expanding = false;

/*
 * During expansion we migrate values with bucket granularity; this is how
 * far we've gotten so far. Ranges from 0 .. hashsize(hashpower - 1) - 1.
 */
static unsigned int expand_bucket = 0;

void assoc_init(const int hashtable_init) {
    if (hashtable_init) {
        hashpower = hashtable_init;
    }
    primary_hashtable = calloc(hashsize(hashpower), sizeof(void *));
    if (! primary_hashtable) {
        fprintf(stderr, "Failed to init hashtable.\n");
        exit(EXIT_FAILURE);
    }
    STATS_LOCK();
    stats.hash_power_level = hashpower;
    stats.hash_bytes = hashsize(hashpower) * sizeof(void *);
    STATS_UNLOCK();
}

item *assoc_find(const char *key, const size_t nkey, const uint32_t hv) {
    item *it;
    unsigned int oldbucket;

    if (expanding &&
        (oldbucket = (hv & hashmask(hashpower - 1))) >= expand_bucket)
    {
        it = old_hashtable[oldbucket];
    } else {
        it = primary_hashtable[hv & hashmask(hashpower)];
    }

    bool again = true;
    while (again) {
        again = false;
        item *ret = NULL;
        int depth = 0;
        while (it) {
            if (is_marked(it->h_next)) {
                printf("find marked\n");
                break;
                again = true;
            }
            if ((nkey == it->nkey) && (memcmp(key, ITEM_key(it), nkey) == 0)) {
                ret = it;
                MEMCACHED_ASSOC_FIND(key, nkey, depth);
                return ret;
            }
            it = get_pointer(it->h_next);
            ++depth;
            if (again == false) {
                printf("where\n");
                return NULL;
            }
        }

    }
    return NULL;
}

/* returns the address of the item pointer before the key.  if *item == 0,
   the item wasn't found */

static item* _hashitem_before (const char *key, const size_t nkey, const uint32_t hv) {
    item *pos;
    unsigned int oldbucket;

    if (expanding &&
        (oldbucket = (hv & hashmask(hashpower - 1))) >= expand_bucket)
    {
        pos = old_hashtable[oldbucket];
    } else {
        pos = primary_hashtable[hv & hashmask(hashpower)];
    }

    while (get_pointer(pos->h_next) && ((nkey != (get_pointer(pos->h_next))->nkey) || memcmp(key, ITEM_key(get_pointer(pos->h_next)), nkey))) {
        pos = get_pointer(pos->h_next);
//        pos = (struct _stritem **)(((uintptr_t)(&(*pos)->h_next)) & ~1);
    }
    return pos;
}

/* grows the hashtable to the next power of 2. */
static void assoc_expand(void) {
    old_hashtable = primary_hashtable;

    primary_hashtable = calloc(hashsize(hashpower + 1), sizeof(void *));
    if (primary_hashtable) {
        if (settings.verbose > 1)
            fprintf(stderr, "Hash table expansion starting\n");
        hashpower++;
        expanding = true;
        expand_bucket = 0;
        STATS_LOCK();
        stats.hash_power_level = hashpower;
        stats.hash_bytes += hashsize(hashpower) * sizeof(void *);
        stats.hash_is_expanding = 1;
        STATS_UNLOCK();
    } else {
        primary_hashtable = old_hashtable;
        /* Bad news, but we can keep running. */
    }
}

static void assoc_start_expand(void) {
    if (started_expanding)
        return;
    started_expanding = true;
    pthread_cond_signal(&maintenance_cond);
}

/* Note: this isn't an assoc_update.  The key must not already exist to call this */
int assoc_insert(item *it, const uint32_t hv) {
    unsigned int oldbucket;

    if (expanding &&
        (oldbucket = (hv & hashmask(hashpower - 1))) >= expand_bucket)
    {
        it->h_next = old_hashtable[oldbucket];
        cas(old_hashtable[oldbucket], it);
    } else {
        it->h_next = primary_hashtable[hv & hashmask(hashpower)];
        /* If compare and swap fails, try again */
        while (false == cas(primary_hashtable[hv & hashmask(hashpower)], it));
    }

    increase(hash_items);
    if (! expanding && hash_items > (hashsize(hashpower) * 3) / 2) {
        assoc_start_expand();
    }

    MEMCACHED_ASSOC_INSERT(ITEM_key(it), it->nkey, hash_items);
    return 1;
}

void assoc_delete(const char *key, const size_t nkey, const uint32_t hv) {
    while (true) {
        item *before = _hashitem_before(key, nkey, hv);

        if (get_pointer(before->h_next)) {

            /* Some other thread is erasing this node. */
            if (is_marked(before)) {
                break;
                continue;
            }
            mark_bit(before->h_next);

//            item *nxt;
            decrease(hash_items);
            /* The DTrace probe cannot be triggered as the last instruction
             * due to possible tail-optimization by the compiler
             */
            MEMCACHED_ASSOC_DELETE(key, nkey, hash_items);
//            cas(before->h_next, ((struct _stritem *) ((uintptr_t)get_pointer(before->h_next) & ~1))->h_next);
            cas(before->h_next, get_pointer(get_pointer(before->h_next)->h_next));
//            cas(nxt, get_pointer((before)->h_next));

//            cas(before, nxt);
        }
        return;
    }
}

static volatile int do_run_maintenance_thread = 1;

#define DEFAULT_HASH_BULK_MOVE 1
int hash_bulk_move = DEFAULT_HASH_BULK_MOVE;

static void *assoc_maintenance_thread(void *arg) {

    while (do_run_maintenance_thread) {
        int ii = 0;

        /* Lock the cache, and bulk move multiple buckets to the new
         * hash table. */
        item_lock_global();
        mutex_lock(&cache_lock);

        for (ii = 0; ii < hash_bulk_move && expanding; ++ii) {
            item *it, *next;
            int bucket;

            for (it = old_hashtable[expand_bucket]; NULL != it; it = next) {
                next = get_pointer(it->h_next);

                bucket = hash(ITEM_key(it), it->nkey, 0) & hashmask(hashpower);
                it->h_next = primary_hashtable[bucket];
                primary_hashtable[bucket] = it;
            }

            old_hashtable[expand_bucket] = NULL;

            expand_bucket++;
            if (expand_bucket == hashsize(hashpower - 1)) {
                expanding = false;
                free(old_hashtable);
                STATS_LOCK();
                stats.hash_bytes -= hashsize(hashpower - 1) * sizeof(void *);
                stats.hash_is_expanding = 0;
                STATS_UNLOCK();
                if (settings.verbose > 1)
                    fprintf(stderr, "Hash table expansion done\n");
            }
        }

        mutex_unlock(&cache_lock);
        item_unlock_global();

        if (!expanding) {
            /* finished expanding. tell all threads to use fine-grained locks */
            switch_item_lock_type(ITEM_LOCK_GRANULAR);
            slabs_rebalancer_resume();
            /* We are done expanding.. just wait for next invocation */
            mutex_lock(&cache_lock);
            started_expanding = false;
            pthread_cond_wait(&maintenance_cond, &cache_lock);
            /* Before doing anything, tell threads to use a global lock */
            mutex_unlock(&cache_lock);
            slabs_rebalancer_pause();
            switch_item_lock_type(ITEM_LOCK_GLOBAL);
            mutex_lock(&cache_lock);
            assoc_expand();
            mutex_unlock(&cache_lock);
        }
    }
    return NULL;
}

static pthread_t maintenance_tid;

int start_assoc_maintenance_thread() {
    int ret;
    char *env = getenv("MEMCACHED_HASH_BULK_MOVE");
    if (env != NULL) {
        hash_bulk_move = atoi(env);
        if (hash_bulk_move == 0) {
            hash_bulk_move = DEFAULT_HASH_BULK_MOVE;
        }
    }
    if ((ret = pthread_create(&maintenance_tid, NULL,
                              assoc_maintenance_thread, NULL)) != 0) {
        fprintf(stderr, "Can't create thread: %s\n", strerror(ret));
        return -1;
    }
    return 0;
}

void stop_assoc_maintenance_thread() {
    mutex_lock(&cache_lock);
    do_run_maintenance_thread = 0;
    pthread_cond_signal(&maintenance_cond);
    mutex_unlock(&cache_lock);

    /* Wait for the maintenance thread to stop */
    pthread_join(maintenance_tid, NULL);
}

redpajama_set_name: RedPajamaGithub


text:
from core import perf_benchmark

from measurements import memory
import page_sets
from telemetry import benchmark

@benchmark.Enabled('android')
class MemoryMobile(perf_benchmark.PerfBenchmark):
  test = memory.Memory
  page_set = page_sets.MobileMemoryPageSet

  @classmethod
  def Name(cls):
    return 'memory.mobile_memory'

@benchmark.Disabled('yosemite')  # crbug.com/517806
class MemoryTop7Stress(perf_benchmark.PerfBenchmark):
  """Use (recorded) real world web sites and measure memory consumption."""
  test = memory.Memory
  page_set = page_sets.Top7StressPageSet

  @classmethod
  def Name(cls):
    return 'memory.top_7_stress'

@benchmark.Enabled('has tabs')
@benchmark.Disabled('android') # Benchmark uses > 700MB of memory.
class MemoryIdleMultiTab(perf_benchmark.PerfBenchmark):
  """Use (recorded) real world web sites and measure memory consumption
  with many tabs and idle times. """
  test = memory.Memory
  page_set = page_sets.IdleMultiTabCasesPageSet

  def SetExtraBrowserOptions(self, options):
    # This benchmark opens tabs from JavaScript, which does not work
    # with popup-blocking enabled.
    options.AppendExtraBrowserArgs(['--disable-popup-blocking'])

  @classmethod
  def Name(cls):
    return 'memory.idle_multi_tab'

class MemoryLongRunningIdleGmail(perf_benchmark.PerfBenchmark):
  """Use (recorded) real world web sites and measure memory consumption
  of long running idle Gmail page """
  test = memory.Memory
  page_set = page_sets.LongRunningIdleGmailPageSet

  @classmethod
  def Name(cls):
    return 'memory.long_running_idle_gmail'

class MemoryLongRunningIdleGmailBackground(perf_benchmark.PerfBenchmark):
  """Use (recorded) real world web sites and measure memory consumption
  of long running idle Gmail page in background tab"""
  test = memory.Memory
  page_set = page_sets.LongRunningIdleGmailBackgroundPageSet

  @classmethod
  def Name(cls):
    return 'memory.long_running_idle_gmail_background'


text:
minimalist-ENC28J60
===================

Features:

- a truly minimalist initialisation routine for the ENC28J60 ethernet controller
- a small IP implementation
- a small SPI driver talking to the ENC28J60
- programmed for the Atmel Atxmega32A4

Further information
-------------------

These files were part of a bigger project for a bootloader for a µC of the Atmel Xmega processor family.

I put a lot of work into getting the smallest program possible out of it. The project never finished, as the effort was too big to put the complete bootloader into 4 kilobytes of flash, which is the size of the .boot section of the µC.

I'd estimate the NVM size of the compiled code (with compiler size optimization, of course) to about 300 bytes for the ENC28J60 driver and to about 600 bytes for the included files.


text:
<?php

 defined( 'SYSPATH' ) OR die( 'No direct access allowed.' );

 $config['sort_defalut_bot'] = '17_5'; //effet par defaut que possède un bot 17_5 => nom de l'image le _5 veut dire qu'il y a 5 séquence sur l'image

 $config['score_min_attack'] = 1; //c'est le score le plus petit que peut faire un bot ou un joueur

 $config['pourcentage_dodge'] = 10; //Pourcentage de chance d'esquiver une attaque

 $config['game_over_argent'] = 2; //En cas de mort on divise l'argent par 2 sinon false pour ne pas modifier l'argent du joueur

 $config['taille_barre_info_for_fight'] = 120; //taille en pixel des barre info qui se trouve en haut de l image de combat
?>


text:
package org.test.shop.config.cache;

import java.util.LinkedList;

public interface CacheSettings {

	public class Items {
		public static final LinkedList<String> list = new LinkedList<String>() {
			private static final long serialVersionUID = 7602621465003622263L;
			{
				add("timelineview");
				add("shopservhotel2view");
				add("shopservhotel2view_id");

				add("currcourse");
				add("currcourse_id");
				add("currcourse_scrollable");

				add("currcurrency");
				add("currcurrency_id");
				add("currcurrency_scrollable");

				add("dictglobal");
				add("dictglobal_id");
				add("dictglobal_scrollable");

				add("docdocuments");
				add("docdocuments_id");
				add("docdocuments_scrollable");

				add("groupglobal");
				add("groupglobal_id");
				add("groupglobal_scrollable");

				add("infocontactinformation");
				add("infocontactinformation_id");
				add("infocontactinformation_scrollable");

				add("infoservices");
				add("infoservices_id");
				add("infoservices_scrollable");

				add("locationaddress");
				add("locationaddress_id");
				add("locationaddress_scrollable");

				add("locationcities");
				add("locationcities_id");
				add("locationcities_scrollable");

				add("locationcountries");
				add("locationcountries_id");
				add("locationcountries_scrollable");

				add("locationtypeplacement");
				add("locationtypeplacement_id");
				add("locationtypeplacement_scrollable");

				add("paymentaccount");
				add("paymentaccount_id");
				add("paymentaccount_scrollable");

				add("paymentaccountrecord");
				add("paymentaccountrecord_id");
				add("paymentaccountrecord_scrollable");

				add("paymentcontact");
				add("paymentcontact_id");
				add("paymentcontact_scrollable");

				add("paymentcontactrecord");
				add("paymentcontactrecord_id");
				add("paymentcontactrecord_scrollable");

				add("paymentdetails");
				add("paymentdetails_id");
				add("paymentdetails_scrollable");

				add("paymentprice");
				add("paymentprice_id");
				add("paymentprice_scrollable");

				add("paymenttariff");
				add("paymenttariff_id");
				add("paymenttariff_scrollable");

				add("relaccountcontacts");
				add("relaccountcontacts_id");
				add("relaccountcontacts_scrollable");

				add("relcruisecontacts");
				add("relcruisecontacts_id");
				add("relcruisecontacts_scrollable");

				add("relcruisedocs");
				add("relcruisedocs_id");
				add("relcruisedocs_scrollable");

				add("relreqservhoteldocdocumentsforhotel");
				add("relreqservhoteldocdocumentsforhotel_id");
				add("relreqservhoteldocdocumentsforhotel_scrollable");

				add("relreqservhoteldocdocumentsforuser");
				add("relreqservhoteldocdocumentsforuser_id");
				add("relreqservhoteldocdocumentsforuser_scrollable");

				add("relreqservhoteltmcontacteasy");
				add("relreqservhoteltmcontacteasy_id");
				add("relreqservhoteltmcontacteasy_scrollable");

				add("relservhotelcreditcards");
				add("relservhotelcreditcards_id");
				add("relservhotelcreditcards_scrollable");

				add("relservhoteldocdocuments");
				add("relservhoteldocdocuments_id");
				add("relservhoteldocdocuments_scrollable");

				add("relservhotelentertainmentandsport");
				add("relservhotelentertainmentandsport_id");
				add("relservhotelentertainmentandsport_scrollable");

				add("relservhotelfeatures");
				add("relservhotelfeatures_id");
				add("relservhotelfeatures_scrollable");

				add("relservhotelimage");
				add("relservhotelimage_id");
				add("relservhotelimage_scrollable");

				add("relservhotelinfocommercial");
				add("relservhotelinfocommercial_id");
				add("relservhotelinfocommercial_scrollable");

				add("relservhotelinfohotelservices");
				add("relservhotelinfohotelservices_id");
				add("relservhotelinfohotelservices_scrollable");

				add("relservhotelinfopolicies");
				add("relservhotelinfopolicies_id");
				add("relservhotelinfopolicies_scrollable");

				add("relservhotelroomfeatures");
				add("relservhotelroomfeatures_id");
				add("relservhotelroomfeatures_scrollable");

				add("relservhotelroomimage");
				add("relservhotelroomimage_id");
				add("relservhotelroomimage_scrollable");

				add("relservhotelservkidsrule");
				add("relservhotelservkidsrule_id");
				add("relservhotelservkidsrule_scrollable");

				add("relservkidsrulefeatures");
				add("relservkidsrulefeatures_id");
				add("relservkidsrulefeatures_scrollable");

				add("relservtransfertmcontact");
				add("relservtransfertmcontact_id");
				add("relservtransfertmcontact_scrollable");

				add("reltmorderdocdocuments");
				add("reltmorderdocdocuments_id");
				add("reltmorderdocdocuments_scrollable");

				add("reltmorderinfoservices");
				add("reltmorderinfoservices_id");
				add("reltmorderinfoservices_scrollable");

				add("reltmorderservgifts");
				add("reltmorderservgifts_id");
				add("reltmorderservgifts_scrollable");

				add("reltmordertmcontact");
				add("reltmordertmcontact_id");
				add("reltmordertmcontact_scrollable");

				add("reltourdocs");
				add("reltourdocs_id");
				add("reltourdocs_scrollable");

				add("reltourhotels");
				add("reltourhotels_id");
				add("reltourhotels_scrollable");

				add("reltourservices");
				add("reltourservices_id");
				add("reltourservices_scrollable");

				add("reqcruisehotels");
				add("reqcruisehotels_id");
				add("reqcruisehotels_scrollable");

				add("reqcruiseservices");
				add("reqcruiseservices_id");
				add("reqcruiseservices_scrollable");

				add("reqhotelroomsbusy");
				add("reqhotelroomsbusy_id");
				add("reqhotelroomsbusy_scrollable");

				add("reqservhotel");
				add("reqservhotel_id");
				add("reqservhotel_scrollable");

				add("reqservhotelroombusy");
				add("reqservhotelroombusy_id");
				add("reqservhotelroombusy_scrollable");

				add("servcruise");
				add("servcruise_id");
				add("servcruise_scrollable");

				add("servexcursions");
				add("servexcursions_id");
				add("servexcursions_scrollable");

				add("servgifts");
				add("servgifts_id");
				add("servgifts_scrollable");

				add("servhotel");
				add("servhotel_id");
				add("servhotel_scrollable");

				add("servhotelroom");
				add("servhotelroom_id");
				add("servhotelroom_scrollable");

				add("servhotelservices");
				add("servhotelservices_id");
				add("servhotelservices_scrollable");

				add("servinsurances");
				add("servinsurances_id");
				add("servinsurances_scrollable");

				add("servkidsrule");
				add("servkidsrule_id");
				add("servkidsrule_scrollable");

				add("servticketsair");
				add("servticketsair_id");
				add("servticketsair_scrollable");

				add("servticketsrail");
				add("servticketsrail_id");
				add("servticketsrail_scrollable");

				add("servtour");
				add("servtour_id");
				add("servtour_scrollable");

				add("servtransfer");
				add("servtransfer_id");
				add("servtransfer_scrollable");

				add("servtransferroute");
				add("servtransferroute_id");
				add("servtransferroute_scrollable");

				add("servtransferroutepoint");
				add("servtransferroutepoint_id");
				add("servtransferroutepoint_scrollable");

				add("servvisas");
				add("servvisas_id");
				add("servvisas_scrollable");

				add("tmaccount");
				add("tmaccount_id");
				add("tmaccount_scrollable");

				add("tmaccountaddresses");
				add("tmaccountaddresses_id");
				add("tmaccountaddresses_scrollable");

				add("tmaccountcommunications");
				add("tmaccountcommunications_id");
				add("tmaccountcommunications_scrollable");

				add("tmaccountdetails");
				add("tmaccountdetails_id");
				add("tmaccountdetails_scrollable");

				add("tmcommercial");
				add("tmcommercial_id");
				add("tmcommercial_scrollable");

				add("tmcontact");
				add("tmcontact_id");
				add("tmcontact_scrollable");

				add("tmcontactaddresses");
				add("tmcontactaddresses_id");
				add("tmcontactaddresses_scrollable");

				add("tmcontactcommunications");
				add("tmcontactcommunications_id");
				add("tmcontactcommunications_scrollable");

				add("tmcontacteasy");
				add("tmcontacteasy_id");
				add("tmcontacteasy_scrollable");

				add("tmfirms");
				add("tmfirms_id");
				add("tmfirms_scrollable");

				add("tmimage");
				add("tmimage_id");
				add("tmimage_scrollable");

				add("tmincidents");
				add("tmincidents_id");
				add("tmincidents_scrollable");

				add("tmorder");
				add("tmorder_id");
				add("tmorder_scrollable");

				add("tmpolicies");
				add("tmpolicies_id");
				add("tmpolicies_scrollable");

				add("tmuserinfo");
				add("tmuserinfo_id");
				add("tmuserinfo_scrollable");

				add("userroles");
				add("userroles_id");
				add("userroles_scrollable");

				add("users");
				add("users_id");
				add("users_scrollable");

				add("currcourseview");
				add("currcourseview_id");
				add("currcourseview_scrollable");

				add("currcurrencyview");
				add("currcurrencyview_id");
				add("currcurrencyview_scrollable");

				add("dictglobalview");
				add("dictglobalview_id");
				add("dictglobalview_scrollable");

				add("docdocumentsview");
				add("docdocumentsview_id");
				add("docdocumentsview_scrollable");

				add("groupglobalview");
				add("groupglobalview_id");
				add("groupglobalview_scrollable");

				add("infocontactinformationview");
				add("infocontactinformationview_id");
				add("infocontactinformationview_scrollable");

				add("infoservicesview");
				add("infoservicesview_id");
				add("infoservicesview_scrollable");

				add("locationaddressview");
				add("locationaddressview_id");
				add("locationaddressview_scrollable");

				add("locationcitiesview");
				add("locationcitiesview_id");
				add("locationcitiesview_scrollable");

				add("locationcountriesview");
				add("locationcountriesview_id");
				add("locationcountriesview_scrollable");

				add("locationtypeplacementview");
				add("locationtypeplacementview_id");
				add("locationtypeplacementview_scrollable");

				add("otherservicesstoreview");
				add("otherservicesstoreview_id");
				add("otherservicesstoreview_scrollable");

				add("paymentaccountrecordview");
				add("paymentaccountrecordview_id");
				add("paymentaccountrecordview_scrollable");

				add("paymentaccountview");
				add("paymentaccountview_id");
				add("paymentaccountview_scrollable");

				add("paymentcontactrecordview");
				add("paymentcontactrecordview_id");
				add("paymentcontactrecordview_scrollable");

				add("paymentcontactview");
				add("paymentcontactview_id");
				add("paymentcontactview_scrollable");

				add("paymentdetailsview");
				add("paymentdetailsview_id");
				add("paymentdetailsview_scrollable");

				add("paymentpricesimpleview");
				add("paymentpricesimpleview_id");
				add("paymentpricesimpleview_scrollable");

				add("paymentpriceview");
				add("paymentpriceview_id");
				add("paymentpriceview_scrollable");

				add("paymenttariffsimpleview");
				add("paymenttariffsimpleview_id");
				add("paymenttariffsimpleview_scrollable");

				add("paymenttariffview");
				add("paymenttariffview_id");
				add("paymenttariffview_scrollable");

				add("relaccountcontactsview");
				add("relaccountcontactsview_id");
				add("relaccountcontactsview_scrollable");

				add("relcruisecontactsview");
				add("relcruisecontactsview_id");
				add("relcruisecontactsview_scrollable");

				add("relcruisedocsview");
				add("relcruisedocsview_id");
				add("relcruisedocsview_scrollable");

				add("relreqservhoteldocdocumentsforhotelview");
				add("relreqservhoteldocdocumentsforhotelview_id");
				add("relreqservhoteldocdocumentsforhotelview_scrollable");

				add("relreqservhoteldocdocumentsforuserview");
				add("relreqservhoteldocdocumentsforuserview_id");
				add("relreqservhoteldocdocumentsforuserview_scrollable");

				add("relreqservhoteltmcontacteasyview");
				add("relreqservhoteltmcontacteasyview_id");
				add("relreqservhoteltmcontacteasyview_scrollable");

				add("relservhotelcreditcardsview");
				add("relservhotelcreditcardsview_id");
				add("relservhotelcreditcardsview_scrollable");

				add("relservhoteldocdocumentsview");
				add("relservhoteldocdocumentsview_id");
				add("relservhoteldocdocumentsview_scrollable");

				add("relservhotelentertainmentandsportview");
				add("relservhotelentertainmentandsportview_id");
				add("relservhotelentertainmentandsportview_scrollable");

				add("relservhotelfeaturesview");
				add("relservhotelfeaturesview_id");
				add("relservhotelfeaturesview_scrollable");

				add("relservhotelimagesimpleview");
				add("relservhotelimagesimpleview_id");
				add("relservhotelimagesimpleview_scrollable");

				add("relservhotelimageview");
				add("relservhotelimageview_id");
				add("relservhotelimageview_scrollable");

				add("relservhotelinfocommercialview");
				add("relservhotelinfocommercialview_id");
				add("relservhotelinfocommercialview_scrollable");

				add("relservhotelinfohotelservicesview");
				add("relservhotelinfohotelservicesview_id");
				add("relservhotelinfohotelservicesview_scrollable");

				add("relservhotelinfopoliciesview");
				add("relservhotelinfopoliciesview_id");
				add("relservhotelinfopoliciesview_scrollable");

				add("relservhotelroomfeaturesview");
				add("relservhotelroomfeaturesview_id");
				add("relservhotelroomfeaturesview_scrollable");

				add("relservhotelroomimageview");
				add("relservhotelroomimageview_id");
				add("relservhotelroomimageview_scrollable");

				add("relservhotelservkidsruleview");
				add("relservhotelservkidsruleview_id");
				add("relservhotelservkidsruleview_scrollable");

				add("relservkidsrulefeaturesview");
				add("relservkidsrulefeaturesview_id");
				add("relservkidsrulefeaturesview_scrollable");

				add("relservtransfertmcontactview");
				add("relservtransfertmcontactview_id");
				add("relservtransfertmcontactview_scrollable");

				add("reltmorderdocdocumentsview");
				add("reltmorderdocdocumentsview_id");
				add("reltmorderdocdocumentsview_scrollable");

				add("reltmorderinfoservicesview");
				add("reltmorderinfoservicesview_id");
				add("reltmorderinfoservicesview_scrollable");

				add("reltmorderservgiftsview");
				add("reltmorderservgiftsview_id");
				add("reltmorderservgiftsview_scrollable");

				add("reltmordertmcontactview");
				add("reltmordertmcontactview_id");
				add("reltmordertmcontactview_scrollable");

				add("reltourdocsview");
				add("reltourdocsview_id");
				add("reltourdocsview_scrollable");

				add("reltourhotelsview");
				add("reltourhotelsview_id");
				add("reltourhotelsview_scrollable");

				add("reltourservicesview");
				add("reltourservicesview_id");
				add("reltourservicesview_scrollable");

				add("reqcruisehotelsview");
				add("reqcruisehotelsview_id");
				add("reqcruisehotelsview_scrollable");

				add("reqcruiseservicesview");
				add("reqcruiseservicesview_id");
				add("reqcruiseservicesview_scrollable");

				add("reqhotelroomsbusyview");
				add("reqhotelroomsbusyview_id");
				add("reqhotelroomsbusyview_scrollable");

				add("reqservhotelroombusyview");
				add("reqservhotelroombusyview_id");
				add("reqservhotelroombusyview_scrollable");

				add("reqservhotelview");
				add("reqservhotelview_id");
				add("reqservhotelview_scrollable");

				add("servcruiseview");
				add("servcruiseview_id");
				add("servcruiseview_scrollable");

				add("servexcursionsview");
				add("servexcursionsview_id");
				add("servexcursionsview_scrollable");

				add("servgiftsview");
				add("servgiftsview_id");
				add("servgiftsview_scrollable");

				add("servhotelroomview");
				add("servhotelroomview_id");
				add("servhotelroomview_scrollable");

				add("servhotelservicesview");
				add("servhotelservicesview_id");
				add("servhotelservicesview_scrollable");

				add("servhotelsimpleview");
				add("servhotelsimpleview_id");
				add("servhotelsimpleview_scrollable");

				add("servhotelview");
				add("servhotelview_id");
				add("servhotelview_scrollable");

				add("servinsurancesview");
				add("servinsurancesview_id");
				add("servinsurancesview_scrollable");

				add("servkidsruleview");
				add("servkidsruleview_id");
				add("servkidsruleview_scrollable");

				add("servticketsairview");
				add("servticketsairview_id");
				add("servticketsairview_scrollable");

				add("servticketsrailview");
				add("servticketsrailview_id");
				add("servticketsrailview_scrollable");

				add("servtourview");
				add("servtourview_id");
				add("servtourview_scrollable");

				add("servtransferroutepointview");
				add("servtransferroutepointview_id");
				add("servtransferroutepointview_scrollable");

				add("servtransferrouteview");
				add("servtransferrouteview_id");
				add("servtransferrouteview_scrollable");

				add("servtransferview");
				add("servtransferview_id");
				add("servtransferview_scrollable");

				add("servvisasview");
				add("servvisasview_id");
				add("servvisasview_scrollable");

				add("shopservhotel2view");
				add("shopservhotel2view_id");
				add("shopservhotel2view_scrollable");

				add("shopservhotelview");
				add("shopservhotelview_id");
				add("shopservhotelview_scrollable");

				add("tmaccountaddressesview");
				add("tmaccountaddressesview_id");
				add("tmaccountaddressesview_scrollable");

				add("tmaccountcommunicationsview");
				add("tmaccountcommunicationsview_id");
				add("tmaccountcommunicationsview_scrollable");

				add("tmaccountdetailsview");
				add("tmaccountdetailsview_id");
				add("tmaccountdetailsview_scrollable");

				add("tmaccountview");
				add("tmaccountview_id");
				add("tmaccountview_scrollable");

				add("tmcommercialview");
				add("tmcommercialview_id");
				add("tmcommercialview_scrollable");

				add("tmcontactaddressesview");
				add("tmcontactaddressesview_id");
				add("tmcontactaddressesview_scrollable");

				add("tmcontactcommunicationsview");
				add("tmcontactcommunicationsview_id");
				add("tmcontactcommunicationsview_scrollable");

				add("tmcontacteasyview");
				add("tmcontacteasyview_id");
				add("tmcontacteasyview_scrollable");

				add("tmcontactview");
				add("tmcontactview_id");
				add("tmcontactview_scrollable");

				add("tmfirmsview");
				add("tmfirmsview_id");
				add("tmfirmsview_scrollable");

				add("tmimageview");
				add("tmimageview_id");
				add("tmimageview_scrollable");

				add("tmincidentsview");
				add("tmincidentsview_id");
				add("tmincidentsview_scrollable");

				add("tmorderview");
				add("tmorderview_id");
				add("tmorderview_scrollable");

				add("tmpoliciesview");
				add("tmpoliciesview_id");
				add("tmpoliciesview_scrollable");

				add("tmuserinfoview");
				add("tmuserinfoview_id");
				add("tmuserinfoview_scrollable");

				add("userrolesview");
				add("userrolesview_id");
				add("userrolesview_scrollable");

				add("usersview");
				add("usersview_id");
				add("usersview_scrollable");
;
			}
		};

	}

}


text:
/**
 * Automatically generated file. DO NOT MODIFY
 */
package com.islarf6546.gmail.lock_screen_settings;

public final class BuildConfig {
  public static final boolean DEBUG = Boolean.parseBoolean("true");
  public static final String APPLICATION_ID = "com.islarf6546.gmail.lock_screen_settings";
  public static final String BUILD_TYPE = "debug";
  public static final String FLAVOR = "";
  public static final int VERSION_CODE = 1;
  public static final String VERSION_NAME = "1.0";
}


text:
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.165.0] Costa Rica

- 1.16.5 support
- more accurate center location @Kamesuta

## [1.164.0] Costa Del Sol

- add support for 1.16.4

## [1.163.1] Astronaut

- changelog v2
- Release 1.163.1
- Release 1.163.1
- updated the changelog manually the last time
- automatically updating changelog
- Release 1.163.0
- automatically update readme on release
- updated to 1.16.3
- adapted package in switch
- update to 1.16.2'

## [1.162.0] Update to 1.16.2

## [1.161.0] The persistence update

### New
- Updating to 1.16.1
- Add new persistent feature (The WorldBorder data gets attached to the Player when sending to client and removed on reset)
- Dropping 1.13.x support

## [1.152.1] The pre-flattening drop

### New
- Updating to 1.15.2
- Updating from 1.14.1 to 1.14.2
- dropping pre-flattening support

## [1.0]

- Adding multiversion support
- Published version on Spigot-MC


text:
#pragma once
#include <aws/opsworks/OpsWorks_EXPORTS.h>
#include <aws/core/utils/memory/stl/AWSString.h>

namespace Aws
{
namespace OpsWorks
{
namespace Model
{
  enum class AppAttributesKeys
  {
    NOT_SET,
    DocumentRoot,
    RailsEnv,
    AutoBundleOnDeploy,
    AwsFlowRubySettings
  };

namespace AppAttributesKeysMapper
{
AWS_OPSWORKS_API AppAttributesKeys GetAppAttributesKeysForName(const Aws::String& name);

AWS_OPSWORKS_API Aws::String GetNameForAppAttributesKeys(AppAttributesKeys value);
} // namespace AppAttributesKeysMapper
} // namespace Model
} // namespace OpsWorks
} // namespace Aws


text:
This project is defunct and has been superseded by
[https://github.com/mattn/go-sqlite3](https://github.com/mattn/go-sqlite3)
and other sqlite3 database drivers for Go.

---

# SQLite database driver for Go

The SQLite driver supports the generic database API
described here:

[http://github.com/phf/go-db](http://github.com/phf/go-db)

The driver is not yet stable! If you decide to track
it, you should be okay with frequent, potentially
incompatible changes. You have been warned.

To install, clone into $GOROOT/src/pkg/db/sqlite3/
for now.

Special thanks to [Eden Li](https://github.com/eden)
and [Masaaki Yonebayashi](https://github.com/yone098).


text:
module I18nYamlEditor
  # Transformation provides
  module Cast
    # Lists all supported types of conversions
    TYPES = %i[numeric boolean array].freeze

    # Contains a check method for each supported type
    CHECK = {
      numeric: ->(klass) { klass < Numeric },
      boolean: ->(klass) { [TrueClass, FalseClass].include?(klass) },
      array: ->(klass) { klass == Array }
    }.freeze

    # Contains a conversion method for each supported type
    CONVERT = {
      numeric: lambda do |value|
                 num = BigDecimal(value)
                 num.frac.zero? ? num.to_i : num.to_f
               end,
      boolean: ->(value) { value.casecmp('true').zero? },
      array: ->(value) { value.split("\r\n") }
    }.freeze

    # Converts a given value to a specific data type
    def cast(klass, value)
      TYPES.each do |type|
        return CONVERT[type].call(value) if CHECK[type].call(klass)
      end
      value.to_s # String, blank
    end
  end
end


text:
<?php

class RationalOptionPages {
	/* ==========================================================================
	   Vars
	   ========================================================================== */
	protected $attributes = array(
		'input'		=> array(
			'autocomplete'	=> false,
			'autofocus'		=> false,
			'disabled'		=> false,
			'list'			=> false,
			'max'			=> false,
			'maxlength'		=> false,
			'min'			=> false,
			'pattern'		=> false,
			'readonly'		=> false,
			'required'		=> false,
			'size'			=> false,
			'step'			=> false,
		),
		'select'	=> array(
			'multiple'	=> false,
			'size'		=> 4,
		),
		'textarea'	=> array(
			'cols'		=> 20,
			'rows'		=> 2,
			'wrap'		=> 'soft',
		),
	);
	protected $defaults = array(
		'add_menu_page'			=> array(
			'page_title'			=> 'Option Page',
			'menu_title'			=> 'Option Page',
			'capability'			=> 'manage_options',
			'menu_slug'				=> 'option_page',
			'callback'				=> false,
			'icon_url'				=> false,
			'position'				=> null,
		),
		'add_settings_field'	=> array(
			'id'					=> 'settings_field',
			'title'					=> 'Settings Field',
			'callback'				=> false,
			'page'					=> 'option_page',
			'section'				=> 'settings_section',
			'args'					=> false,
		),
		'add_settings_section'	=> array(
			'id'					=> 'settings_section',
			'title'					=> 'Settings Section',
			'callback'				=> false,
			'page'					=> 'option_page',
		),
		'add_submenu_page'		=> array(
			'parent_slug'			=> 'option_page',
			'page_title'			=> 'Sub Option Page',
			'menu_title'			=> 'Sub Option Page',
			'capability'			=> 'manage_options',
			'menu_slug'				=> 'sub_option_page',
			'callback'				=> false,
		),
	);
	protected $errors;
	protected $fields = array(
		'checkbox'		=> array(
			'checked'		=> false,
			'value'			=> 'on',
		),
		'text'			=> array(
			'class'			=> 'regular-text',
			'placeholder'	=> '',
			'value'			=> false,
		),
		'textarea'		=> array(
			'class'			=> 'large-text',
			'placeholder'	=> '',
			'rows'			=> 10,
			'value'			=> false,
		),
		'wp_editor'		=> array(
			'wpautop'			=> true,
			'media_buttons'		=> true,
			'textarea_rows'		=> 'default',
			'tabindex'			=> false,
			'editor_css'		=> false,
			'editor_class'		=> '',
			'editor_height'		=> false,
			'teeny'				=> false,
			'dfw'				=> false,
			'tinymce'			=> true,
			'quicktags'			=> true,
			'drag_drop_upload'	=> false,
		),
	);
	protected $media_script = false;
	protected $notices;
	protected $options;
	protected $pages = array();
	protected $subpages = array();
	protected $points;

	/* ==========================================================================
	   Magic methods
	   ========================================================================== */
	/**
	 * Catches unknown method calls
	 *
	 * @param	string	$method		The method being requested
	 * @param	array	$arguments	Array of arguments passed to the method
	 */
	public function __call( $method, $arguments ) {
		$request = explode( '|', $method );
		$source = $request[0];
		$page_key = !empty( $request[1] ) ? $request[1] : false;
		$section_key = !empty( $request[2] ) ? $request[2] : false;
		$field_key = !empty( $request[3] ) ? $request[3] : false;

		switch ( $source ) {
			case 'add_menu_page':
			case 'add_submenu_page':
				$this->build_menu_page( $page_key );
				break;
			case 'add_settings_section':
				$this->build_settings_section( $page_key, $section_key );
				break;
			case 'add_settings_field':
				$this->build_settings_field( $page_key, $section_key, $field_key );
				break;
			case 'register_setting':
				$input = $this->sanitize_setting( $page_key, $arguments[0] );
				return $input;
				break;
			default:
				$this->submit_notice( $method );
		}
	}

	/**
	 * Class construct method. Configures class and hooks into WordPress.
	 *
	 * @param	array	$pages	Array of option pages
	 */
	public function __construct( $pages = array() ) {
		foreach ( $pages as $page_key => $page_params ) {
			$this->pages[ $page_key ] = $this->validate_page( $page_key, $page_params );
		}
		$this->pages = array_merge( $this->pages, $this->subpages );

		add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
		add_action( 'admin_head', array( $this, 'admin_head' ) );
		add_action( 'admin_init', array( $this, 'admin_init' ) );
		add_action( 'admin_menu', array( $this, 'admin_menu' ) );
		add_action( 'admin_notices', array( $this, 'admin_notices' ) );
	}

	/* ==========================================================================
	   WordPress hooks
	   ========================================================================== */
	/**
	 * Action: admin_enqueue_scripts
	 * Conditionally queue's up jQuery and the media uploader script
	 */
	public function admin_enqueue_scripts() {
		if ( $this->media_script ) {
			wp_enqueue_script( 'jquery' );
			wp_enqueue_media();
		}
	}

	/**
	 * Action: admin_head
	 * Conditionally adds the script to manage media uploads
	 */
	public function admin_head() {
		if ( $this->media_script ) {
?>
<?php	}
	}

	/**
	 * Action: admin_init
	 * Registers settings, adds sections and fields
	 */
	public function admin_init() {
		foreach ( $this->pages as $page_key => $page_params ) {
			// Finalize sanitize
			if ( empty( $page_params['custom'] ) && !is_array( $page_params['sanitize'] ) ) {
				$page_params['sanitize'] = array( $this, $page_params['sanitize'] );
			}

			register_setting(
				$page_key,
				$page_key,
				$page_params['sanitize']
			);

			if ( !empty( $page_params['sections'] ) ) {
				foreach ( $page_params['sections'] as $section_key => $section_params ) {
					// Sort and trim the array for the function
					$sort_order = array_keys( $this->defaults['add_settings_section'] );
					$params = $this->sort_array( $section_params, $sort_order );
					$params = array_slice( $params, 0, count( $this->defaults['add_settings_section'] ) );

					// Finalize callback
					if ( empty( $params['custom'] ) && !is_array( $params['callback'] ) ) {
						$params['callback'] = array( $this, $params['callback'] );
					}

					call_user_func_array( 'add_settings_section', array_values( $params ) );

					if ( !empty( $section_params['fields'] ) ) {
						foreach ( $section_params['fields'] as $field_key => $field_params ) {
							// Check for "media" type for adding script
							if ( !$this->media_script && $field_params['type'] === 'media' ) {
								$this->media_script = true;
							}

							// Sort and trim the array for the function
							$sort_order = array_keys( $this->defaults['add_settings_field'] );
							$params = $this->sort_array( $field_params, $sort_order );
							$params = array_slice( $params, 0, count( $this->defaults['add_settings_field'] ) );

							// Add label wrapper on title
							if (
								!in_array( $field_params['type'], array( 'radio' ) ) &&
								( empty( $field_params['no_label'] ) || $field_params['no_label'] === false )
							) {
								$params['title'] = "".__($params['title'],'text-domain')."";
							}

							// Finalize callback
							if ( empty( $params['custom'] ) && !is_array( $params['callback'] ) ) {
								$params['callback'] = array( $this, $params['callback'] );
							}

							call_user_func_array( 'add_settings_field', array_values( $params ) );
						}
					}
				}
			}
		}
	}

	/**
	 * Action: admin_menu. Adding the option pages to the admin menu.
	 */
	public function admin_menu() {
		$all_pages = array_merge( $this->pages, $this->subpages );

		foreach ( $all_pages as $page ) {
			// Sort and trim the array for the function
			$sort_order = array_keys( $this->defaults[ $page['function'] ] );
			$params = $this->sort_array( $page, $sort_order );
			$params = array_slice( $params, 0, count( $this->defaults[ $page['function'] ] ) );

			// Finalize callback
			$params['callback'] = array( $this, $params['callback'] );

			call_user_func_array( $page['function'], array_values( $params ) );
		}
	}

	/**
	 * Action: admin_notices. Spitting out notices when needed.
	 */
	public function admin_notices() {
		// notice-error, notice-warning, notice-success, or notice-info.
		if ( !empty( $this->errors ) ) {
			foreach ( $this->errors as $error ) {
				echo $error;
			}
		}
		if ( !empty( $this->notices ) ) {
			foreach ( $this->notices as $notice ) {
				echo $notice;
			}
		}

		// update point in array for future reference
		$this->points['admin_notices'] = true;
	}

	/* ==========================================================================
	   Helpers
	   ========================================================================== */
	public function add_page( $page_key, $page_params ) {
		$this->pages[ $page_key ] = $this->validate_page( $page_key, $page_params );
	}

	/**
	 * Builds the menu page
	 *
	 * @param	string	$page_key	The array key of the page needing built
	 */
	protected function build_menu_page( $page_key ) {
		$page = $this->pages[ $page_key ];
		$this->options = get_option( $page_key, array() );
		settings_errors();
		?>

<?php _e($GLOBALS['title'],'text-domain'); ?>
<?php

			if ( !empty( $page['sections'] ) ) {
				?><form action="options.php" method="post"><?php
					settings_errors( $page_key );
					settings_fields( $page_key );
					do_settings_sections( $page['menu_slug'] );
					if ( $this->has_fields( $page ) ) {
						submit_button();
					}
				?></form><?php
			}
		?>
<?php
	}

	/**
	 * Builds the fields themselves
	 *
	 * @param	string	$page_key		The array key of the page
	 * @param	string	$section_key	The array key of the section
	 * @param	string	$field_key		The array key of the field
	 */
	protected function build_settings_field( $page_key, $section_key, $field_key ) {
		$page = $this->pages[ $page_key ];
		$section = $page['sections'][ $section_key ];
		$field = $section['fields'][ $field_key ];

		if ( isset( $field['value'] ) && $field['type'] !== 'checkbox' ) {
			$field['value'] = !empty( $this->options[ $field['id'] ] ) ? $this->options[ $field['id'] ] : $field['value'];
		}

		// Additional attributes
		if ( !empty( $field['attributes'] ) ) {
			$attributes = array();
			foreach ( $field['attributes'] as $attribute => $value ) {
				if ( !empty( $value ) ) {
					$attributes[] = "{$attribute}='{$value}'";
				}
			}
		}

		// Sanitize field values, unless 'sanitize' was set to false for this field.
		if ( ( !isset( $field['sanitize'] ) || $field['sanitize'] ) && $field['type'] !== 'wp_editor' ) {
			if (!empty($field['attributes']) && isset($field['attributes']['multiple']) && $field['attributes']['multiple']) {
				for ( $i = 0; $i < count( $field['value'] ); $i++ ) {
					$field['value'][ $i ] = strip_tags($field['value'][ $i ]);		// Removes HTML tags
					$field['value'][ $i ] = esc_attr($field['value'][ $i ]);		// Escapes field for HTML attributes
				}
			} else {
				$field['value'] = strip_tags($field['value']);		// Removes HTML tags
				$field['value'] = esc_attr($field['value']);		// Escapes field for HTML attributes
			}
		}

		switch ( $field['type'] ) {
			case 'checkbox':
				$checked = $field['checked'] ? 'checked' : '';
				if ( isset( $this->options[ $field['id'] ] ) ) {
					$checked = checked( $field['value'], $this->options[ $field['id'] ], false );
				}
				printf(
					'<input %s %s id="%s" name="%s" title="%s" type="checkbox" value="%s">  %s',
					$checked,																			// checked
					!empty( $field['class'] ) ? "class='{$field['class']}'" : '',						// class
					$field['id'],																		// id
					"{$page_key}[{$field['id']}]",														// name
					$field['title_attr'],																// title
					$field['value'],																	// value
					!empty( $field['text'] ) ? __($field['text'],'text-domain') : ''										// text
				);
				break;
			case 'media':
				$upload_button = sprintf(
					'<input class="button rational-media-upload" type="button" value="Upload">'
				);
				printf(
					'<input %s id="%s" name="%s" %s title="%s" type="text" value="%s" %s>%s%s',
					!empty( $field['class'] ) ? "class='{$field['class']}'" : '',						// class
					$field['id'],																		// id
					"{$page_key}[{$field['id']}]",														// name
					!empty( $field['placeholder'] ) ? 'placeholder="'.__($field['placeholder'],'text-domain').'"' : '',		// placeholder
					$field['title_attr'],																// title
					$field['value'],																	// value
					!empty( $attributes ) ? implode( ' ', $attributes ) : '',							// additional attributes
					$upload_button,																		// upload button
					!empty( $field['text'] ) ? '
'.__($field['text'],'text-domain').'
' : ''				// text
				);
				break;
			case 'radio':
				echo '<fieldset><legend class="screen-reader-text">' . __($field['title'],'text-domain') . '</legend>';
				$c = 0;
				foreach ( $field['choices'] as $value => $label ) {
					$checked = $value === $field['value'] ? 'checked' : '';
					if ( isset( $this->options[ $field['id'] ] ) ) {
						$checked = $value === $this->options[ $field['id'] ] ? 'checked' : '';
					}
					printf(
						'<input %s %s id="%s" name="%s" type="radio" title="%s" value="%s">  %s%s',
						$checked,																			// checked
						!empty( $field['class'] ) ? "class='{$field['class']}'" : '',						// class
						$field['id'],																		// id
						"{$page_key}[{$field['id']}]",														// name
						__($label,'text-domain'),																				// title
						$value,																				// value
						__($label,'text-domain'),																				// label
						$c < count( $field['choices'] ) - 1 ? '
' : ''									// line-break
					);
					$c++;
				}
				echo '</fieldset>';
				break;
			case 'select':
				if (!empty($field['attributes']) && isset($field['attributes']['multiple']) && $field['attributes']['multiple']) {
					$field_tag_name = "{$page_key}[{$field['id']}][]";
					$field_name = "{$field['id']}[]";
				}
				else {
					$field_tag_name = "{$page_key}[{$field['id']}]";
					$field_name = "{$field['id']}";
				}
				printf(
					'<select %s %s id="%s" name="%s" title="%s">',
					!empty( $field['class'] ) ? "class='{$field['class']}'" : '',						// class
                                        !empty( $attributes ) ? implode(' ', $attributes) : '',
					$field['id'],																		// id
					$field_tag_name,														// name
					__($field['title_attr'],'text-domain')																// title
				);
				foreach ( $field['choices'] as $value => $text ) {
					$selected = $value === $field['value'] ? 'selected' : '';
					if ( isset( $this->options[ $field['id'] ] ) ) {
            if (!is_array($this->options[ $field['id'] ] ) ) {
						  $selected = $value === $this->options[ $field['id'] ] ? 'selected="selected"' : '';
						}
						else {
						  $selected = in_array( $value, $this->options[ $field['id'] ] ) ? 'selected="selected"' : '';
						}
					}
					printf(
						'<option %s value="%s">%s</option>',
						$selected,																			// selected
						$value,																				// value
						__($text,'text-domain')																				// text
					);
				}
				echo '</select>';
				break;
			case 'textarea':
				printf(
					'<textarea %s id="%s" name="%s" %s %s %s %s title="%s">%s</textarea>%s',
					!empty( $field['class'] ) ? "class='{$field['class']}'" : '',						// class
					$field['id'],																		// id
					"{$page_key}[{$field['id']}]",														// name
					!empty( $field['placeholder'] ) ? 'placeholder="'.__($field['placeholder'],'text-domain').'"' : '',		// placeholder
					!empty( $field['rows'] ) ? "rows='{$field['rows']}'" : '',							// rows
					!empty( $field['cols'] ) ? "cols='{$field['cols']}'" : '', // cols
					!empty( $field['wrap'] ) ? "wrap='{$field['wrap']}'" : '', // wrap
					$field['title_attr'],																// title
					$field['value'],																	// value
					!empty( $field['text'] ) ? '
'.__($field['text'],'text-domain').'
' : ''				// text
				);
				break;
			case 'wp_editor':
				$field['textarea_name'] = "{$page_key}[{$field['id']}]";
				wp_editor( isset( $field['value'] ) ? $field['value'] : '', $field['id'], array(
					'textarea_name'		=> $field['textarea_name'],
				) );
				echo !empty( $field['text'] ) ? '
'.__($field['text'],'text-domain').'
' : '';
				break;
			default:
				printf(
					'<input %s id="%s" name="%s" %s title="%s" type="%s" value="%s" %s>%s',
					!empty( $field['class'] ) ? "class='{$field['class']}'" : '',						// class
					$field['id'],																		// id
					"{$page_key}[{$field['id']}]",														// name
					!empty( $field['placeholder'] ) ? 'placeholder="'.__($field['placeholder'],'text-domain').'"' : '',		// placeholder
					$field['title_attr'],																// title
					$field['type'],																		// type
					$field['value'],																	// value
					!empty( $attributes ) ? implode( ' ', $attributes ) : '',							// additional attributes
					!empty( $field['text'] ) ? '
'.__($field['text'],'text-domain').'
' : ''				// text
				);
		}
	}

	/**
	 * Builds the settings sections
	 *
	 * @param	string	$page_key		The array key of the page
	 * @param	type	$section_key	The array key of the section
	 */
	protected function build_settings_section( $page_key, $section_key ) {
		$page = $this->pages[ $page_key ];
		$section = $page['sections'][ $section_key ];

		echo !empty( $section['text'] ) ? $section['text'] : '';

		if ( !empty( $section['include'] ) ) {
			include $section['include'];
		}
	}

	/**
	 * Determines if the option page has fields or not
	 *
	 * @param	array	$page	The page array
	 *
	 * @return	boolean			True if fields are found, false otherwise
	 */
	protected function has_fields( $page ) {
		if ( !empty( $page['sections'] ) ) {
			foreach ( $page['sections'] as $section ) {
				if ( !empty( $section['fields'] ) ) {
					return true;
				}
			}
		}
		return false;
	}

	/**
	 * Cleans up the option page submissions before submitting to the DB
	 *
	 * @param	string	$page_key	The array key of the page
	 *
	 * @return	array				The sanitized post input
	 */
	protected function sanitize_setting( $page_key, $input ) {
		$page = $this->pages[ $page_key ];

		if ( !empty( $page['sections'] ) ) {
			foreach ( $page['sections'] as $section ) {
				if ( !empty( $section['fields'] ) ) {
					foreach ( $section['fields'] as $field ) {
						if ( isset( $field['sanitize'] ) && !$field['sanitize'] ) {
							continue;
						}
						switch ( $field['type'] ) {
							case 'select':
								if ( !empty($input[$field['id']]) && !empty($input['attributes']['multiple']) ) {
									$input[ $field['id'] ] = $input[ $field['id'] ];
								}
								break;
							case 'checkbox':
								if ( empty( $input[ $field['id'] ] ) ) {
									$input[ $field['id'] ] = false;
								}
								break;
							case 'wp_editor':
								$input[ $field['id'] ] = wp_kses_post( $input[ $field['id'] ] );
								break;
							default:
								// Sanitize by default; skip if this field's 'sanitize' setting is false.
								$input[ $field['id'] ] = sanitize_text_field( $input[ $field['id'] ] );
						}
					}
				}
			}
		}

		return $input;
	}

	/**
	 * Converts human-readable strings into more machine-friendly formats
	 *
	 * @param	string	$text		String to be formatted
	 * @param	string	$separator	The character that fills in spaces
	 *
	 * @return	string				Formatted text
	 */
	protected function slugify( $text, $separator = '_' ) {
		$text = preg_replace( '~[^\\pL\d]+~u', $separator, $text );
		$text = trim( $text, $separator );
		$text = iconv( 'utf-8', 'windows-1251//TRANSLIT', $text );
		$text = strtolower( $text );
		$text = preg_replace( '~[^-\w]+~', '', $text );
		if ( empty( $text ) ) {
			return 'n-a';
		}
		return $text;
	}

	/**
	 * Sorts one array using a second as a guide
	 *
	 * @param	array	$array			Array to be sorted
	 * @param	array	$order_array	Guide array
	 *
	 * @return	array					Sorted array
	 */
	protected function sort_array( $array, $order_array ) {
		$ordered = array();
		foreach ( $order_array as $key ) {
			if ( array_key_exists( $key, $array ) ) {
				$ordered[ $key ] = $array[ $key ];
				unset( $array[ $key ] );
			}
		}
		return $ordered + $array;
	}

	/**
	 * Conditionally outputs an error in WordPress admin
	 *
	 * @param	string	$error	The error to be output
	 */
	public function submit_error( $error ) {
		$error = sprintf(
			'

%s

',
			is_array( $error ) || is_object( $error ) ? '
' . htmlspecialchars( print_r( $error, true ) ) . '
' : $error
		);
		if ( empty( $this->points['admin_notices'] ) ) {
			$this->errors[] = $error;
		} else {
			echo $error;
		}
	}

	/**
	 * Conditionally outputs a notice in WordPress admin
	 *
	 * @param	string	$notice	The text to be output
	 */
	public function submit_notice( $notice ) {
		$notice = sprintf(
			'

%s

',
			is_array( $notice ) || is_object( $notice ) ? '
' . htmlspecialchars( print_r( $notice, true ) ) . '
' : $notice
		);
		if ( empty( $this->points['admin_notices'] ) ) {
			$this->notices[] = $notice;
		} else {
			echo $notice;
		}
	}

	/**
	 * Validates the field data submitted to the class
	 *
	 * @param	array	$field			Field array
	 * @param	string	$page_key		Array key of the associated page
	 * @param	string	$section_key	Array key of the associated section
	 * @param	string	$field_key		Array key of the field
	 * @param	string	$page			ID of the associated page
	 * @param	type	$section		ID of the associated section
	 *
	 * @return	array					The validated field array
	 */
	protected function validate_field( $field, $page_key, $section_key, $field_key, $page, $section ) {
		// Label
		if ( empty( $field['title'] ) ) {
			$this->submit_error( __('Field parameter "title" is required','text-domain') );
		}

		// ID
		if ( empty( $field['id'] ) ) {
			$field['id'] = $this->slugify( $field['title'] );
		}

		// Callback
		$field['callback'] = empty( $field['callback'] ) ? "add_settings_field|{$page_key}|{$section_key}|{$field_key}" : $field['callback'];

		// Page
		$field['page'] = $page;

		// Section
		$field['section'] = $section;

		// Type
		$field['type'] = empty( $field['type'] ) ? 'text' : $field['type'];

		// Title attribute
		$field['title_attr'] = empty( $field['title_attr'] ) ? __($field['title'],'text-domain') : $field['title_attr'];

		// Choices
		if ( empty( $field['choices'] ) && in_array( $field['type'], array( 'radio', 'select' ) ) ) {
			$this->submit_error( 'Field parameter "choices" is required for the "radio" and "select" type' );
		}

		// Other attributes
		if ( !empty( $field['attributes'] ) ) {
			switch ( $field['type'] ) {
				case 'select':
				case 'textarea':
					$field['attributes'] = wp_parse_args( $field['attributes'], $this->attributes[ $field['type'] ] );
					break;
				default:
					$field['attributes'] = wp_parse_args( $field['attributes'], $this->attributes['input'] );
			}
		}

		// Making sure we haven't missed anything
		switch ( $field['type'] ) {
			case 'checkbox':
				$field = wp_parse_args( $field, $this->fields['checkbox'] );
				break;
			case 'color':
			case 'radio':
			case 'range':
				break;
			case 'date':
				$field['value'] = date( 'Y-m-d', strtotime( $field['value'] ) );
				$field = wp_parse_args( $field, $this->fields['text'] );
				break;
			case 'datetime':
			case 'datetime-local':
				$field['value'] = date( 'Y-m-d\TH:i:s', strtotime( $field['value'] ) );
				$field = wp_parse_args( $field, $this->fields['text'] );
				break;
			case 'month':
				$field['value'] = date( 'Y-m', strtotime( $field['value'] ) );
				$field = wp_parse_args( $field, $this->fields['text'] );
				break;
			case 'textarea':
				$field = wp_parse_args( $field, $this->fields[ $field['type'] ] );
				break;
			case 'time':
				$field['value'] = date( 'H:i:s', strtotime( $field['value'] ) );
				$field = wp_parse_args( $field, $this->fields['text'] );
				break;
			case 'week':
				$field['value'] = date( 'Y-\WW', strtotime( $field['value'] ) );
				$field = wp_parse_args( $field, $this->fields['text'] );
				break;
			case 'wp_editor':
				$field = wp_parse_args( $field, $this->fields['wp_editor'] );
				break;
			default:
				$field = wp_parse_args( $field, $this->fields['text'] );
		}

		return $field;
	}

	/**
	 * Validates the information submitted to the class
	 *
	 * @param	string	$page_key		Array key of the page
	 * @param	array	$page			Array of page parameters
	 * @param	string	$parent_slug	Menu slug of the parent page if there is one
	 *
	 * @return	array					Validated array of page parameters
	 */
	protected function validate_page( $page_key, $page_params, $parent_slug = false ) {
		// Page title
		if ( empty( $page_params['page_title'] ) ) {
			$this->submit_error( __('Page parameter "page_title" is required','text-domain') );
		}

		// Menu title
		if ( empty( $page_params['menu_title'] ) ) {
			$page_params['menu_title'] = __($page_params['page_title'],'text-domain');
		}

		// Menu slug
		if ( empty( $page_params['menu_slug'] ) ) {
			// Basing it off the page title cause it's likely to be more unique than the menu title
			$page_params['menu_slug'] = $this->slugify( $page_params['page_title'] );
		}

		// Menu or submenu item?
		if ( empty( $page_params['parent_slug'] ) && !$parent_slug ) {
			$page_params['function'] = 'add_menu_page';
		} else {
			$page_params['function'] = 'add_submenu_page';
			$page_params['parent_slug'] = $parent_slug ? $parent_slug : $page_params['parent_slug'];
		}

		// Callback
		$page_params['callback'] = "{$page_params['function']}|{$page_key}";

		// Sanitize
		$page_params['sanitize'] = empty( $page_params['sanitize'] ) ? "register_setting|{$page_key}" : $page_params['sanitize'];

		// Make sure we haven't missed anything
		$page_params = wp_parse_args( $page_params, $this->defaults[ $page_params['function'] ] );

		// Subpages?
		if ( !empty( $page_params['subpages'] ) ) {
			foreach ( $page_params['subpages'] as $subpage_key => $subpage ) {
				$this->subpages[ $subpage_key ] = $this->validate_page( $subpage_key, $subpage, $page_params['menu_slug'] );
			}
			unset( $page_params['subpages'] );
		}

		// Sections?
		if ( !empty( $page_params['sections'] ) ) {
			foreach ( $page_params['sections'] as $section_key => $section_params ) {
				$page_params['sections'][ $section_key ] = $this->validate_section( $section_params, $page_key, $section_key, $page_params['menu_slug'] );
			}
		}

		return $page_params;
	}

	/**
	 * Validates the section data submitted to the class
	 *
	 * @param	array	$section		Section array
	 * @param	string	$page_key		Array key of the associated page
	 * @param	string	$section_key	Array key of the associated page
	 * @param	string	$page			ID of the associated page
	 *
	 * @return	array					Validated section array
	 */
	protected function validate_section( $section, $page_key, $section_key, $page ) {
		// Title
		if ( empty( $section['title'] ) ) {
			$this->submit_error( __('Section parameter "title" is required','text-domain') );
		}

		// ID
		if ( empty( $section['id'] ) ) {
			$section['id'] = $this->slugify( $section['title'] );
		}

		// Callback
		$section['callback'] = empty( $section['callback'] ) ? "add_settings_section|{$page_key}|{$section_key}" : $section['callback'];

		// Page
		$section['page'] = $page;

		// Fields?
		if ( !empty( $section['fields'] ) ) {
			foreach ( $section['fields'] as $field_key => $field_params ) {
				$section['fields'][ $field_key ] = $this->validate_field( $field_params, $page_key, $section_key, $field_key, $page, $section['id'] );
			}
		}

		return $section;
	}
}


text:
;window.onload = function () {

    function loadProjectSettings (callback) {
        Fire._JsonLoader('settings.json', function (error, json) {
            if (error) {
                Fire.error(error);
            }
            else {
                callback(json);
            }
        });
    }
    loadProjectSettings(function (settings) {
        // init engine
        var canvas = document.getElementById('GameCanvas');
        Fire.Engine.init(canvas.width, canvas.height, canvas, settings);

        // makes the container's size equals to the frame's size
        Fire.Screen.ContainerStrategy.EqualToFrame.apply();

        // init assets
        Fire.AssetLibrary.init('resource/library');

        // load scene
        var launchUuid = settings.scenes[settings.launchScene];
        Fire.Engine._loadSceneByUuid(launchUuid, null,
            function () {
                // show canvas
                canvas.style.visibility = '';
                var div = document.getElementById('GameDiv');
                if (div) {
                    div.style.backgroundImage = '';
                }
                // play game
                Fire.Engine.play();
            }
        );
    });
};


text:
/**This function is used for initializing data mask**/
function dataMaskIntialise(){
	 $("[data-mask]").inputmask();
 }

 function characters(event){
	 //alert(event);
	 if(event){
		 var r = event.replace(new RegExp("[0-9]", "g"), "");
	 return r.replace(/[^\w\s]/gi, '');
	 }else{
		 return null;
	 }

 }

 function datediff(date1,date2){
	 //var timeDiff = Math.abs(date2.getTime() - date1.getTime());
	 var timeDiff = date2.setHours(0,0,0,0)- date1.setHours(0,0,0,0);
	var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24));
	 return diffDays;
 }

 // this function is to allow only specific special characters
 function addressValidate(event){

	 if(event){
		 return event.replace(/[^\w#-\s]/gi, '');

	 }else{
		 return null;
	 }
 }

 function parseDate(str) {
    var mdy = str.split('/');
    return new Date(mdy[2], mdy[0]-1, mdy[1]);
}

 // this function is used to return the current date
 function currentDate(){
	 var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!

var yyyy = today.getFullYear();
if(dd<10){
    dd='0'+dd
}
if(mm<10){
    mm='0'+mm
}
var today = yyyy+'/'+mm+'/'+dd;
return today;
 }

 $(".numbers").keydown(function (e) {
        // Allow: backspace, delete, tab, escape, enter and .
        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
             // Allow: Ctrl+A, Command+A
            (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
             // Allow: home, end, left, right, down, up
            (e.keyCode >= 35 && e.keyCode <= 40)) {
                 // let it happen, don't do anything
                 return;
        }
        // Ensure that it is a number and stop the keypress
        if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
            e.preventDefault();
        }
    });

	$(".address").keydown(function (e) {
        // Allow: backspace, delete, tab, escape, enter and .
        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
             // Allow: Ctrl+A, Command+A
            (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
             // Allow: home, end, left, right, down, up
            (e.keyCode >= 35 && e.keyCode <= 40)) {
                 // let it happen, don't do anything
                 return;
        }
        // Ensure that it is a number and stop the keypress
        if ((e.shiftKey)) {
            e.preventDefault();
        }
    });

	function datepickerintialise(){
	$('.datepicker').datepicker({
    format: 'mm/dd/yyyy',
     maxDate: '0'
});
}

/*
*this function is used for validating images
*/
function validateImageExtension(v)
             		{
             			  var allowedExtensions = new Array("jpg","JPG","jpeg","JPEG","png");
             			  for(var ct=0;ct<allowedExtensions.length;ct++)
             			  {
             				  sample = v.lastIndexOf(allowedExtensions[ct]);
             				  if(sample != -1){return true;}
             			  }
             			  return false;
             		}

function validateEmail(email) {
             			var reg = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
             			if (reg.test(email))
             				testresults = true;
             			else
             				testresults = false;
             			return (testresults);
             		}

// this function is used for validation
function uploadCsv() {

	if (document.getElementById("csv_file").value == '') {
	  document.getElementById("error-csv").innerHTML = " CSV required";
	  $(".bootstrap-filestyle").css("border", "red solid 1px");
	  return false;
	 } else {
	  document.getElementById("error-csv").innerHTML = "";
	  $(".bootstrap-filestyle").css("border", "none");
	 }
	 var fname = document.getElementById('csv_file').value;
	 var re = /(\.csv)$/i;
	 if (fname != '') {
	  if (!re.exec(fname)) {
	   document.getElementById('error-csv').innerHTML = "Please select csv file format only";
	   $(".bootstrap-filestyle").css("border", "red solid 1px");
	   return false;
	  } else {
	   document.getElementById('error-csv').innerHTML = "";
	   $(".bootstrap-filestyle").css("border", "none");
	  }
	 }
	}

	function brandSubmitForm(is_new){

                  	$('.field-tblacabrands-brand_name>div.help-block').html("");
             	     document.getElementById("tblacabrands-brand_name").style.borderColor = "";
             		  $('.field-tblacabrands-brand_logo>div.help-block').html("");
             	     document.getElementById("tblacabrands-brand_logo").style.borderColor = "";
             		  $('.field-tblacabrands-support_email>div.help-block').html("");
             	     document.getElementById("tblacabrands-support_email").style.borderColor = "";
             		 $('.field-tblacabrands-support_number>div.help-block').html("");
             	     document.getElementById("tblacabrands-support_number").style.borderColor = "";
					  $('.field-tblacabrands-brand_url>div.help-block').html("");
             	     document.getElementById("tblacabrands-brand_url").style.borderColor = "";
             		  $('.field-tblacabrands-brand_status>div.help-block').html("");
             	     document.getElementById("tblacabrands-brand_status").style.borderColor = "";

             	if  (document.getElementById("tblacabrands-brand_name").value == '') {
             		$('.field-tblacabrands-brand_name>div.help-block').css("color","red");
             		 $('.field-tblacabrands-brand_name>div.help-block').html("Brand name required");
             		 $('#tblacabrands-brand_name').css("border-color","red");
             		 document.getElementById("tblacabrands-brand_name").focus();
             		 return false;
             	} else if(document.getElementById("tblacabrands-brand_name").value.length < 3){
             		$('.field-tblacabrands-brand_name>div.help-block').css("color","red");
             		 $('.field-tblacabrands-brand_name>div.help-block').html("Brand name atleast 3 charecters");
             		 $('#tblacabrands-brand_name').css("border-color","red");
             		 document.getElementById("tblacabrands-brand_name").focus();
             		 return false;
             	}else{
             		 $('.field-tblacabrands-brand_name>div.help-block').html("");
             	     document.getElementById("tblacabrands-brand_name").style.borderColor = "";
             	}

           			var filename=document.getElementById("tblacabrands-brand_logo").value;
             		var ext= filename.split('.').pop();

			  if(is_new){

             	if  (document.getElementById("tblacabrands-brand_logo").value == '') {

             		$('.field-tblacabrands-brand_logo>div.help-block').css("color","red");
             		 $('.field-tblacabrands-brand_logo>div.help-block').html("Brand logo required");
             		 $('#tblacabrands-brand_logo').css("border-color","red");
             		 document.getElementById("tblacabrands-brand_logo").focus();
             		 return false;
             	} else if(!validateImageExtension(ext)){

             		$('.field-tblacabrands-brand_logo>div.help-block').css("color","red");
             		 $('.field-tblacabrands-brand_logo>div.help-block').html("Please upload images with 420px X 80px dimensions in JPEG,PNG,JPG formats only");
             		 $('#tblacabrands-brand_logo').css("border-color","red");
             		 document.getElementById("tblacabrands-brand_logo").focus();
             		 return false;

             	}else {
             		 $('.field-tblacabrands-brand_logo>div.help-block').html("");
             	     document.getElementById("tblacabrands-brand_logo").style.borderColor = "";
             	}

             	 }

             		if  (document.getElementById("tblacabrands-brand_logo").value != '') {
             		 if(!validateImageExtension(ext)){

             				$('.field-tblacabrands-brand_logo>div.help-block').css("color","red");
             				 $('.field-tblacabrands-brand_logo>div.help-block').html("Please upload images with 420px X 80px dimensions in JPEG,PNG,JPG formats only");
             				 $('#tblacabrands-brand_logo').css("border-color","red");
             				 document.getElementById("tblacabrands-brand_logo").focus();
             				 return false;

             			}else {
             				 $('.field-tblacabrands-brand_logo>div.help-block').html("");
             			     document.getElementById("tblacabrands-brand_logo").style.borderColor = "";
             			}
             	}

             		if  (document.getElementById("tblacabrands-support_email").value == '') {
             			$('.field-tblacabrands-support_email>div.help-block').css("color","red");
             			 $('.field-tblacabrands-support_email>div.help-block').html("Support email required");
             			 $('#tblacabrands-support_email').css("border-color","red");
             			 document.getElementById("tblacabrands-support_email").focus();
             			 return false;
             	    }else if(!validateEmail(document.getElementById("tblacabrands-support_email").value)){
             			$('.field-tblacabrands-support_email>div.help-block').css("color","red");
             			 $('.field-tblacabrands-support_email>div.help-block').html("Valid email required");
             			 $('#tblacabrands-support_email').css("border-color","red");
             			 document.getElementById("tblacabrands-support_email").focus();
             			 return false;
             		}else {
             			 $('.field-tblacabrands-support_email>div.help-block').html("");
             	     document.getElementById("tblacabrands-support_email").style.borderColor = "";
             		}

             	if  (document.getElementById("tblacabrands-support_number").value == '') {
             		$('.field-tblacabrands-support_number>div.help-block').css("color","red");
             		 $('.field-tblacabrands-support_number>div.help-block').html("Support phone number required");
             		 $('#tblacabrands-support_number').css("border-color","red");
             		 document.getElementById("tblacabrands-support_number").focus();
             		 return false;
             	} else {
             		 $('.field-tblacabrands-support_number>div.help-block').html("");
             	     document.getElementById("tblacabrands-support_number").style.borderColor = "";
             	}
				var re = /^(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1}/;
				 if  (document.getElementById("tblacabrands-brand_url").value == '') {

             		$('.field-tblacabrands-brand_url>div.help-block').css("color","red");
             		 $('.field-tblacabrands-brand_url>div.help-block').html("Url required");
             		 $('#tblacabrands-brand_url').css("border-color","red");
             		 document.getElementById("tblacabrands-brand_url").focus();
             		 return false;
             	} else if(!re.test(document.getElementById("tblacabrands-brand_url").value)){
         			$('.field-tblacabrands-brand_url>div.help-block').css("color","red");
        			 $('.field-tblacabrands-brand_url>div.help-block').html("Valid url required");
        			 $('#tblacabrands-brand_url').css("border-color","red");
        			 document.getElementById("tblacabrands-brand_url").focus();
        			 return false;
        		} else {
             		 $('.field-tblacabrands-brand_url>div.help-block').html("");
             	     document.getElementById("tblacabrands-brand_url").style.borderColor = "";
             	}

             	if  (document.getElementById("tblacabrands-brand_status").value == 0) {

             		$('.field-tblacabrands-brand_status>div.help-block').css("color","red");
             		 $('.field-tblacabrands-brand_status>div.help-block').html("Status required");
             		 $('#tblacabrands-brand_status').css("border-color","red");
             		 document.getElementById("tblacabrands-brand_status").focus();
             		 return false;
             	} else {
             		 $('.field-tblacabrands-brand_status>div.help-block').html("");
             	     document.getElementById("tblacabrands-brand_status").style.borderColor = "";
             	}
             	$('#brand_form').attr('disabled',true);
             	$('#brand-form').submit();

	}


text:
import {useEffect} from 'react'

/**
 * An empty array as the second parameter causes the effect to run once on
 * component mount. A function returned by `fn` will be run on unmount.
 */
export default function useOnMount(fn) {
  useEffect(fn, []) // eslint-disable-line
}


text:
from flask.ext.classy import FlaskView
from flask.ext.login import current_user, current_app
from functools import wraps

def login_required(func):
    """
        Decorator check required login and active user
        :param func:
        :return:
    """
    @wraps(func)
    def decorated_view(*args, **kwargs):
        if current_app.login_manager._login_disabled:
            return func(*args, **kwargs)
        elif not current_user.is_authenticated and not current_user.is_active:
            return current_app.login_manager.unauthorized()
        return func(*args, **kwargs)

    return decorated_view

def admin_required(func):
    """
        Decorator check required login and hava staff or superuser permission
        :param func:
        :return:
    """

    @wraps(func)
    def decorated_view(*args, **kwargs):
        if current_app.login_manager._login_disabled:
            return func(*args, **kwargs)
        elif not current_user.is_authenticated and not current_user.is_active:
            return current_app.login_manager.unauthorized()
        elif not current_user.is_staff and not current_user.is_superuser:
            return current_app.login_manager.unauthorized()
        return func(*args, **kwargs)

    return decorated_view

class LoginRequireMixin(FlaskView):
    decorators = [login_required]

class AdminRequireMixin(LoginRequireMixin):
    decorators = [admin_required]


text:
--TEST--
Test array_fill() function : usage variations  - unexpected values for 'start_key' argument
--SKIPIF--
<?php
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
?>
--FILE--
<?php
/* Prototype  : proto array array_fill(int start_key, int num, mixed val)
 * Description: Create an array containing num elements starting with index start_key each initialized to val
 * Source code: ext/standard/array.c
 */

/*
 * testing array_fill() by passing different unexpected value for 'start_key' argument
 */

echo "*** Testing array_fill() : usage variations ***\n";

// Initialise function arguments not being substituted
$num = 2;
$val = 100;

//get an unset variable
$unset_var = 10;
unset ($unset_var);

//get a resource variable
$fp = fopen(__FILE__, "r");

//define a class
class test
{
  var $t = 10;
  function __toString()
  {
    return "testObject";
  }
}

//array of different values for 'start_key' argument
$values = array(

            // float values
  /* 1  */  10.5,
            -10.5,
            12.3456789000e10,
            12.34567890006E-10,
            .5,

            // array values
  /* 6  */  array(),
            array(0),
            array(1),
            array(1, 2),
            array('color' => 'red', 'item' => 'pen'),

            // null values
  /* 11 */  NULL,
            null,

            // boolean values
  /* 13 */  true,
            false,
            TRUE,
            FALSE,

            // empty string
  /* 17 */  "",
            '',

            // string values
  /* 19 */  "string",
            'string',

            // objects
  /* 21 */  new test(),

            // undefined  variable
            @$undefined_var,

            // unset variable
            @$unset_var,

            // resource variable
  /* 24 */  $fp
);

// loop through each element of the array for start_key
// check the working of array_fill()
echo "--- Testing array_fill() with different values for 'start_key' arg ---\n";
$counter = 1;
for($index = 0; $index < count($values); $index ++)
{
  echo "-- Iteration $counter --\n";
  $start_key = $values[$index];

  var_dump( array_fill($start_key,$num,$val) );

  $counter ++;
}

// close the resource used
fclose($fp);

echo "Done";
?>
--EXPECTF--
*** Testing array_fill() : usage variations ***
--- Testing array_fill() with different values for 'start_key' arg ---
-- Iteration 1 --
array(2) {
  [10]=>
  int(100)
  [11]=>
  int(100)
}
-- Iteration 2 --
array(2) {
  [-10]=>
  int(100)
  [0]=>
  int(100)
}
-- Iteration 3 --
array(2) {
  [-1097262584]=>
  int(100)
  [0]=>
  int(100)
}
-- Iteration 4 --
array(2) {
  [0]=>
  int(100)
  [1]=>
  int(100)
}
-- Iteration 5 --
array(2) {
  [0]=>
  int(100)
  [1]=>
  int(100)
}
-- Iteration 6 --

Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 7 --

Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 8 --

Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 9 --

Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 10 --

Warning: array_fill() expects parameter 1 to be long, array given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 11 --
array(2) {
  [0]=>
  int(100)
  [1]=>
  int(100)
}
-- Iteration 12 --
array(2) {
  [0]=>
  int(100)
  [1]=>
  int(100)
}
-- Iteration 13 --
array(2) {
  [1]=>
  int(100)
  [2]=>
  int(100)
}
-- Iteration 14 --
array(2) {
  [0]=>
  int(100)
  [1]=>
  int(100)
}
-- Iteration 15 --
array(2) {
  [1]=>
  int(100)
  [2]=>
  int(100)
}
-- Iteration 16 --
array(2) {
  [0]=>
  int(100)
  [1]=>
  int(100)
}
-- Iteration 17 --

Warning: array_fill() expects parameter 1 to be long, string given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 18 --

Warning: array_fill() expects parameter 1 to be long, string given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 19 --

Warning: array_fill() expects parameter 1 to be long, string given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 20 --

Warning: array_fill() expects parameter 1 to be long, string given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 21 --

Warning: array_fill() expects parameter 1 to be long, object given in %sarray_fill_variation1.php on line %d
NULL
-- Iteration 22 --
array(2) {
  [0]=>
  int(100)
  [1]=>
  int(100)
}
-- Iteration 23 --
array(2) {
  [0]=>
  int(100)
  [1]=>
  int(100)
}
-- Iteration 24 --

Warning: array_fill() expects parameter 1 to be long, resource given in %sarray_fill_variation1.php on line %d
NULL
Done


text:
package section

import (
	"fmt"
	"math"
	"sort"
	"strings"
	"time"

	cbor "github.com/britram/borat"
	log "github.com/inconshreveable/log15"

	"github.com/netsec-ethz/rains/internal/pkg/keys"
	"github.com/netsec-ethz/rains/internal/pkg/signature"
)

//Zone contains information about the zone
type Zone struct {
	Signatures  []signature.Sig
	SubjectZone string
	Context     string
	Content     []*Assertion
	validSince  int64 //unit: the number of seconds elapsed since January 1, 1970 UTC
	validUntil  int64 //unit: the number of seconds elapsed since January 1, 1970 UTC
	sign        bool  //set to true before signing and false afterwards
}

// UnmarshalMap decodes the output from the CBOR decoder into this struct.
func (z *Zone) UnmarshalMap(m map[int]interface{}) error {
	if sigs, ok := m[0]; ok {
		z.Signatures = make([]signature.Sig, len(sigs.([]interface{})))
		for i, sig := range sigs.([]interface{}) {
			if err := z.Signatures[i].UnmarshalArray(sig.([]interface{})); err != nil {
				return err
			}
		}
	} else {
		return fmt.Errorf("missing signatures from Zone")
	}
	if sz, ok := m[4]; ok {
		z.SubjectZone = sz.(string)
	} else {
		return fmt.Errorf("missing SubjectZone from Zone")
	}
	if ctx, ok := m[6]; ok {
		z.Context = ctx.(string)
	} else {
		return fmt.Errorf("missing Context from Zone")
	}
	// Content is an array of ShardSections and / or Assertionsection.
	if content, ok := m[23]; ok {
		z.Content = make([]*Assertion, 0)
		for _, item := range content.([]interface{}) {
			m := item.(map[int]interface{})
			if _, ok := m[3]; ok {
				// Assertion.
				as := &Assertion{}
				if err := as.UnmarshalMap(m); err != nil {
					return fmt.Errorf("failed to unmarshal Assertion map in Zone: %v", err)
				}
				z.Content = append(z.Content, as)
			} else {
				log.Error("Unsupported section in zone content")
			}
		}
	} else {
		return fmt.Errorf("missing content for Zone")
	}
	return nil
}

func (z *Zone) MarshalCBOR(w *cbor.CBORWriter) error {
	m := make(map[int]interface{})
	m[23] = z.Content
	if len(z.Signatures) > 0 && !z.sign {
		m[0] = z.Signatures
	}
	m[4] = z.SubjectZone
	m[6] = z.Context
	return w.WriteIntMap(m)
}

//AllSigs returns the zone's signatures
func (z *Zone) AllSigs() []signature.Sig {
	return z.Signatures
}

//Sigs returns z's signatures in keyspace
func (z *Zone) Sigs(keySpace keys.KeySpaceID) []signature.Sig {
	return filterSigs(z.Signatures, keySpace)
}

//AddSig adds the given signature
func (z *Zone) AddSig(sig signature.Sig) {
	z.Signatures = append(z.Signatures, sig)
}

//DeleteSig deletes ith signature
func (z *Zone) DeleteSig(i int) {
	z.Signatures = append(z.Signatures[:i], z.Signatures[i+1:]...)
}

//DeleteAllSigs deletes all signature
func (z *Zone) DeleteAllSigs() {
	z.Signatures = []signature.Sig{}
}

//GetContext returns the context of the zone
func (z *Zone) GetContext() string {
	return z.Context
}

//GetSubjectZone returns the zone of the zone
func (z *Zone) GetSubjectZone() string {
	return z.SubjectZone
}

func (z *Zone) AddCtxAndZoneToContent() {
	for _, s := range z.Content {
		s.SetContext(z.Context)
		s.SetSubjectZone(z.SubjectZone)
	}
}

func (z *Zone) RemoveCtxAndZoneFromContent() {
	for _, s := range z.Content {
		s.SetContext("")
		s.SetSubjectZone("")
	}
}

//Begin returns the begining of the interval of this zone.
func (z *Zone) Begin() string {
	return ""
}

//End returns the end of the interval of this zone.
func (z *Zone) End() string {
	return ""
}

//UpdateValidity updates the validity of this zone if the validity period is extended.
//It makes sure that the validity is never larger than maxValidity
func (z *Zone) UpdateValidity(validSince, validUntil int64, maxValidity time.Duration) {
	if z.validSince == 0 {
		z.validSince = math.MaxInt64
	}
	if validSince < z.validSince {
		if validSince > time.Now().Add(maxValidity).Unix() {
			z.validSince = time.Now().Add(maxValidity).Unix()
			log.Warn("newValidSince exceeded maxValidity", "oldValidSince", z.validSince,
				"newValidSince", validSince, "maxValidity", maxValidity)
		} else {
			z.validSince = validSince
		}
	}
	if validUntil > z.validUntil {
		if validUntil > time.Now().Add(maxValidity).Unix() {
			z.validUntil = time.Now().Add(maxValidity).Unix()
			log.Warn("newValidUntil exceeded maxValidity", "oldValidSince", z.validSince,
				"newValidSince", validSince, "maxValidity", maxValidity)
		} else {
			z.validUntil = validUntil
		}
	}
}

//ValidSince returns the earliest validSince date of all contained signatures
func (z *Zone) ValidSince() int64 {
	return z.validSince
}

//ValidUntil returns the latest validUntil date of all contained signatures
func (z *Zone) ValidUntil() int64 {
	return z.validUntil
}

//Hash returns a string containing all information uniquely identifying a shard.
func (z *Zone) Hash() string {
	if z == nil {
		return "Z_nil"
	}
	contentHashes := []string{}
	for _, v := range z.Content {
		contentHashes = append(contentHashes, v.Hash())
	}
	return fmt.Sprintf("Z_%s_%s_[%s]_%v", z.SubjectZone, z.Context, strings.Join(contentHashes, " "),
		z.Signatures)
}

//Sort sorts the content of the zone lexicographically.
func (z *Zone) Sort() {
	for _, s := range z.Content {
		s.Sort()
	}
	sort.Slice(z.Content, func(i, j int) bool {
		return z.Content[i].CompareTo(z.Content[j]) < 0
	})
}

//CompareTo compares two zones and returns 0 if they are equal, 1 if z is greater than zone and -1
//if z is smaller than zone
func (z *Zone) CompareTo(zone *Zone) int {
	if z.SubjectZone < zone.SubjectZone {
		return -1
	} else if z.SubjectZone > zone.SubjectZone {
		return 1
	} else if z.Context < zone.Context {
		return -1
	} else if z.Context > zone.Context {
		return 1
	} else if len(z.Content) < len(zone.Content) {
		return -1
	} else if len(z.Content) > len(zone.Content) {
		return 1
	}
	for i, section := range z.Content {
		if section.CompareTo(zone.Content[i]) != 0 {
			return section.CompareTo(zone.Content[i])
		}
	}
	return 0
}

//String implements Stringer interface
func (z *Zone) String() string {
	if z == nil {
		return "Zone:nil"
	}
	return fmt.Sprintf("Zone:[SZ=%s CTX=%s CONTENT=%v SIG=%v]",
		z.SubjectZone, z.Context, z.Content, z.Signatures)
}

//IsConsistent returns true if all contained assertions and shards are consistent
func (z *Zone) IsConsistent() bool {
	for _, section := range z.Content {
		if sectionHasContextOrSubjectZone(section) {
			log.Warn("Contained section has a subjectZone or context", "section", section)
			return false
		}
	}
	return true
}

//NeededKeys adds to keysNeeded key meta data which is necessary to verify all z's signatures.
func (z *Zone) NeededKeys(keysNeeded map[signature.MetaData]bool) {
	extractNeededKeys(z, keysNeeded)
	for _, section := range z.Content {
		section.NeededKeys(keysNeeded)
	}
}

func (z *Zone) AddSigInMarshaller() {
	z.sign = false
	for _, s := range z.Content {
		s.AddSigInMarshaller()
	}
}
func (z *Zone) DontAddSigInMarshaller() {
	z.sign = true
	for _, s := range z.Content {
		s.DontAddSigInMarshaller()
	}
}


text:
set -x
set -e

# Download the NRS HTML files into /tmp/www.leg.state.nv.us
cd /tmp
wget --recursive --no-parent --no-verbose https://www.leg.state.nv.us/NRS/

# Parse and produce JSON
cd - > /dev/null  # "cd -" echoes the new dir to stdout.
stack exec nrs-parser-exe > nevada-nrs.json

# Upload result to S3
s3cmd put nevada-nrs.json s3://publaw-scraping-results


text:
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<title type="application/xhtml+xml" mode="xml">
click here
</title>
</feed>