text: My try to put all the notes I take in one place !!!!!

redpajama_set_name: RedPajamaGithub


text:
import logging

from furl import furl

from waterbutler.core import utils
from waterbutler.core import metadata

logger = logging.getLogger(__name__)

class BaseGitLabMetadata(metadata.BaseMetadata):

    def __init__(self, raw, path):
        super().__init__(raw)
        self._path_obj = path

    @property
    def provider(self) -> str:
        return 'gitlab'

    @property
    def path(self) -> str:
        return self.build_path()

    @property
    def name(self) -> str:
        return self._path_obj.name

    @property
    def branch_name(self) -> str:
        return self._path_obj.branch_name

    @property
    def commit_sha(self) -> str:
        return self._path_obj.commit_sha

    @property
    def extra(self) -> dict:
        return {
            'commitSha': self.commit_sha,
            'branch': self.branch_name,  # may be None if revision id is a sha
        }

    def build_path(self, *args) -> str:
        return super().build_path(self._path_obj.raw_path)

    def _json_api_links(self, resource) -> dict:
        """Update JSON-API links to add branch, if available"""
        links = super()._json_api_links(resource)

        ref = None
        if self.commit_sha is not None:
            ref = {'commitSha': self.commit_sha}
        elif self.branch_name is not None:
            ref = {'branch': self.branch_name}

        if ref is not None:
            for action, link in links.items():
                links[action] = furl(link).add(ref).url

        for action in ['delete', 'upload', 'new_folder']:
            if action in links:
                links[action] = None

        return links

class GitLabFileMetadata(BaseGitLabMetadata, metadata.BaseFileMetadata):
    """Metadata for files stored on GitLab.

    GitLabFileMetadata objects constructed from tree listings (i.e. metadata objects constructed
    as part of listing the parent folder's contents) will have the ``size`` property set to `None`.
    When metadata for the file is requested directly, the ``size`` will be present.

    The GitLab provider does not support ``modified``, ``modified_utc``, or ``created_utc`` for
    any files.  GitLab also does not do content-type detection, so the content-type is guess in WB
    from the file extension.
    """

    def __init__(self, raw, path, host=None, owner=None, repo=None):
        super().__init__(raw, path)
        self._path_obj = path
        self.host = host
        self.owner = owner
        self.repo = repo

    @property
    def modified(self) -> str:
        return self.raw.get('modified', None)

    @property
    def created_utc(self) -> str:
        created = self.raw.get('created', None)
        if created is not None:
            created = utils.normalize_datetime(created)
        return created

    @property
    def content_type(self) -> str:
        return self.raw.get('mime_type', None)

    @property
    def size(self) -> int:
        return self.raw.get('size', None)

    @property
    def etag(self) -> str:
        return '{}::{}'.format(self.path, self.commit_sha or self.branch_name)

    @property
    def extra(self) -> dict:
        return dict(super().extra, **{
            'webView': self.web_view
        })

    @property
    def web_view(self) -> str:
        return '{}/{}/{}/blob/{}{}'.format(self.host, self.owner, self.repo,
                                           self.branch_name, self.path)

class GitLabFolderMetadata(BaseGitLabMetadata, metadata.BaseFolderMetadata):
    pass

class GitLabRevision(metadata.BaseFileRevisionMetadata):

    @property
    def version_identifier(self) -> str:
        return 'commitSha'

    @property
    def modified(self) -> str:
        return self.raw['committed_date']

    @property
    def version(self) -> str:
        return self.raw['id']

    @property
    def extra(self) -> dict:
        return {
            'user': {
                'name': self.raw['author_name'],
            },
        }


text:
<?php
/*
ADDRESS:	HTTP://ALBERTYW.MIT.EDU/6470/PROCESS/COLLEGELIST.PHP
STATUS:		FINISHED
LAST MODIFIED:	JANUARY 26, 2009
DESCRIPTION:	AJAX FUNCTION TO RETURN COLLEGE
USAGE:		PUBLIC
*/
$startid = $_POST['startid'];
$numberList = $_POST['numberList'];

//Open mySQL Connection
$connection = mysql_connect("localhost", "6470", "6470") or die("mySQL Connection Error
\n");
$database='6470_main';
mysql_select_db($database) or die('Error, could not access database '.$database."\n");

//Find the max number

$endid = $startid+$numberList;
while($startid<$endid && $totalruns<50){
	$result = mysql_query("SELECT * FROM college WHERE id=$startid") or die(mysql_error());
	$row = mysql_fetch_array($result);
	if($row['id']==null){
		$startid++;
		$endid++;
		$totalruns++;
	}else{
		echo $startid.'.  ';//ID of the College
		echo ''.$row['college'].'
';  //College of the College
		$result = mysql_query("SELECT * FROM user WHERE collegeid='$startid'") or die(mysql_error());
		echo 'molemusic members: '.mysql_num_rows($result).'
';
		$startid++;
		$totalruns++;
	}
}
?>


text:
using DragonSpark.Model;
using DragonSpark.Model.Selection;

namespace DragonSpark.Application.Entities.Queries.Runtime;

public interface IRuntimeQuery<in TIn, TOut> : ISelect<TIn, IQueries<TOut>> {}

public interface IRuntimeQuery<T> : IRuntimeQuery<None, T> {}


text:
/**
 *
 */
package tema9;

import utils.verbos.UtilsVerbos;  // CLASE CHEQUEADA

import java.util.ArrayList;

import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;

/**
 * @author andoni
 *
 */
public class TestVerbos extends TestCase {

	private String formaVerbal;
	private String infinitivo;

	/** Chequea si la frase indicada tiene el verbo infinitivo indicado
	 * @param fraseConUnaFormaVerbal
	 * @param infinitivo
	 */
	public TestVerbos(String fraseConUnaFormaVerbal, String infinitivo) {
		super( "testDevolverInfinitivosVerbos" );  // La forma la ponemos tb como nombre de test
		this.formaVerbal = fraseConUnaFormaVerbal;
		this.infinitivo = infinitivo;
	}

	public void testDevolverInfinitivosVerbos() {
		ArrayList<String> verbos = UtilsVerbos.devolverInfinitivosVerbos( formaVerbal );
		assertTrue( verbos != null );
		assertTrue( verbos.size() == 1 );
		assertEquals( verbos.get(0), infinitivo );
	}

	public static Test suite() {
		 TestSuite suite = new TestSuite();
		 // Grupo de test de frases con un sólo verbo,
		 // chequeando el infinitivo del verbo principal
		 suite.addTest( new TestVerbos( "Lo habría sabido", "saber" ));
		 suite.addTest( new TestVerbos( "Luis siguió allí", "seguir" ));
		   // Problema aquí: ambigüedad entre ir y ser en la forma "fue"
		 suite.addTest( new TestVerbos( "Luis fue allí", "ir" ));
		 suite.addTest( new TestVerbos( "Luis fue un gran señor", "ser" ));
		 return suite;
	}

}


text:
package org.hl7.fhir.dstu3.formats;

import java.io.IOException;
import java.math.BigDecimal;

/**
 * Facade to GSON writer, or something that imposes property ordering first
 *
 * @author Grahame
 *
 */
public interface JsonCreator {

  void setIndent(String string);

  void beginObject() throws IOException;

  void endObject() throws IOException;

  void nullValue() throws IOException;

  void name(String name) throws IOException;

  void value(String value) throws IOException;

  void value(Boolean value) throws IOException;

  void value(BigDecimal value) throws IOException;

  void value(Integer value) throws IOException;

  void beginArray() throws IOException;

  void endArray() throws IOException;

  void finish() throws IOException;

  // only used by an creator that actually produces xhtml
  void link(String href);
}


text:
package org.linkedin.util.io.resource;

/**
 * @author ypujante@linkedin.com
 *
 */
public class AcceptAllResourceFilter implements ResourceFilter
{
  /**
   * Stateless so can share an instance
   */
  public static final AcceptAllResourceFilter INSTANCE = new AcceptAllResourceFilter();

  /**
   * Tests whether this resource should be included in the result.
   *
   * @param resource the resource to check
   * @return true if the resource should be included
   */
  @Override
  public boolean accept(Resource resource)
  {
    return true;
  }
}


text:
/********************************************************************************/
/*										*/
/*			    TSS Configuration Properties			*/
/*			     Written by Ken Goldman				*/
/*		       IBM Thomas J. Watson Research Center			*/
/*										*/
/* (c) Copyright IBM Corporation 2015 - 2020.					*/
/*										*/
/* All rights reserved.								*/
/* 										*/
/* Redistribution and use in source and binary forms, with or without		*/
/* modification, are permitted provided that the following conditions are	*/
/* met:										*/
/* 										*/
/* Redistributions of source code must retain the above copyright notice,	*/
/* this list of conditions and the following disclaimer.			*/
/* 										*/
/* Redistributions in binary form must reproduce the above copyright		*/
/* notice, this list of conditions and the following disclaimer in the		*/
/* documentation and/or other materials provided with the distribution.		*/
/* 										*/
/* Neither the names of the IBM Corporation nor the names of its		*/
/* contributors may be used to endorse or promote products derived from		*/
/* this software without specific prior written permission.			*/
/* 										*/
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS		*/
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT		*/
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR	*/
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT		*/
/* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,	*/
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT		*/
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,	*/
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY	*/
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT		*/
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE	*/
/* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.		*/
/********************************************************************************/

/* This is an internal TSS file, subject to change.  Applications should not include it. */

#ifndef TSSPROPERTIES_H
#define TSSPROPERTIES_H

#include <ibmtss/TPM_Types.h>

#ifdef TPM_WINDOWS

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#include <winsock2.h>
#include <windows.h>
#include <specstrings.h>

#ifdef TPM_SKIBOOT
#include <libstb/tpm_chip.h>
#endif /* TPM_SKIBOOT */

#ifdef TPM_WINDOWS_TBSI
#include <tbs.h>
#endif /* TPM_WINDOWS_TBSI */

typedef SOCKET TSS_SOCKET_FD;

#endif /* TPM_WINDOWS */

#ifdef TPM_POSIX
#ifndef TPM_NOSOCKET
typedef int TSS_SOCKET_FD;
#endif 	/* TPM_NOSOCKET */
#endif	/* TPM_POSIX */

/* There doesn't seem to be a portable Unix MAXPATHLEN variable, so pick a large number.  The
   directory length will be (currently) 17 bytes smaller. */
#define TPM_DATA_DIR_PATH_LENGTH 256

#ifdef __cplusplus
extern "C" {
#endif

#include <ibmtss/tss.h>
#include "tssauth.h"

    /* Structure to hold session data within the context */

    typedef struct TSS_SESSIONS {
	TPMI_SH_AUTH_SESSION sessionHandle;
	uint8_t *sessionData;
	uint16_t sessionDataLength;
    } TSS_SESSIONS;

    /* Structure to hold transient or persistent object data within the context */

    typedef struct TSS_OBJECT_PUBLIC {
	TPM_HANDLE objectHandle;
	TPM2B_NAME name;
	TPM2B_PUBLIC objectPublic;
    } TSS_OBJECT_PUBLIC;

    /* Structure to hold NV index  data within the context */

    typedef struct TSS_NVPUBLIC {
	TPMI_RH_NV_INDEX nvIndex;
	TPM2B_NAME name;
	TPMS_NV_PUBLIC	nvPublic;
    } TSS_NVPUBLIC;

    /* Context for TSS global parameters.

       NOTE:  Keep this in sync with TSS_Properties_Init() and TSS_Delete() */

    struct TSS_CONTEXT {

	TSS_AUTH_CONTEXT *tssAuthContext;

	/* directory for persistant storage */
	const char *tssDataDirectory;

	/* encrypt saved session state */
	int tssEncryptSessions;

	/* saved session encryption key.  This seems to port to openssl 1.0 and 1.1, but will have to
	   become a malloced void * for other crypto libraries. */
#ifndef TPM_TSS_NOCRYPTO
	void *tssSessionEncKey;
	void *tssSessionDecKey;
#endif
	/* a minimal TSS with no file support stores the sessions, objects, and NV metadata in a
	   structure.  Scripting will not work, and persistent objects will not work, but a single
	   application will otherwise work. */
#ifdef TPM_TSS_NOFILE
	TSS_SESSIONS sessions[MAX_ACTIVE_SESSIONS];
	TSS_OBJECT_PUBLIC objectPublic[64];
	TSS_NVPUBLIC nvPublic[64];
#endif
	/* ports, host name, server (packet) type for socket interface */
	short tssCommandPort;
	short tssPlatformPort;
	const char *tssServerName;
	const char *tssServerType;

	/* interface type */
	const char *tssInterfaceType;

	/* device driver interface */
	const char *tssDevice;

	/* TRUE for the first time through, indicates that interface open must occur */
	int tssFirstTransmit;
	int tpm12Command;		/* TRUE for TPM 1.2 command */

	/* socket file descriptor */
#ifndef TPM_NOSOCKET
	TSS_SOCKET_FD sock_fd;
#endif 	/* TPM_NOSOCKET */

	/* Linux device file descriptor */
#ifdef TPM_POSIX
	int dev_fd;
#endif	/* TPM_POSIX */

	/* Windows device driver handle */
#ifdef TPM_WINDOWS
#ifdef TPM_WINDOWS_TBSI
	TBS_HCONTEXT hContext;
#endif
#endif

#ifdef TPM_SKIBOOT
	struct tpm_dev *tpm_device;
	struct tpm_driver *tpm_driver;
#endif /* TPM_SKIBOOT */
    };

    TPM_RC TSS_GlobalProperties_Init(void);
    TPM_RC TSS_Properties_Init(TSS_CONTEXT *tssContext);

#ifdef __cplusplus
}
#endif

#endif


text:
"""create sazabi table

Revision ID: a9ed0e36fc6f
Revises:
Create Date: 2018-05-04 18:59:19.019475

"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects.postgresql import UUID

# revision identifiers, used by Alembic.
revision = 'a9ed0e36fc6f'
down_revision = None
branch_labels = None
depends_on = None

def upgrade():
  op.create_table(
      'channel',
      sa.Column('id', UUID, primary_key=True,
                server_default=sa.text("uuid_generate_v4()")),
      sa.Column('channel_name', sa.String, nullable=False),
      sa.Column('channel_url', sa.String, nullable=False),
      sa.Column('live', sa.Boolean, nullable=False, default=False),
      sa.Column('last_updated', sa.DateTime, nullable=True),
      sa.Column('last_change', sa.DateTime, nullable=True)
  )

def downgrade():
  op.drop_table('channel')


text:
exports.verify = (args, cb) => cb(true)

exports.problem = `
Exercise 1

In this exercise, we will take a Mad Lib and convert it into an HTML Document.

create the Mad Lib using the run command:

    $ADVENTURE_COMMAND run

Open the file in your text editor and convert the first line to a 'h1' and wrap each
paragraph in the 'p' tags. Once complete run the verify command.

    $ADVENTURE_COMMAND verify

`


text:
package net.runelite.client.plugins.screenmarkers;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.api.MenuEntry;
import net.runelite.api.widgets.Widget;
import net.runelite.api.widgets.WidgetInfo;
import net.runelite.api.widgets.WidgetItem;
import net.runelite.api.widgets.WidgetType;
import net.runelite.client.ui.overlay.Overlay;
import net.runelite.client.ui.overlay.OverlayLayer;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.OverlayPriority;

class ScreenMarkerWidgetHighlightOverlay extends Overlay
{
	private final ScreenMarkerPlugin plugin;
	private final Client client;

	@Inject
	private ScreenMarkerWidgetHighlightOverlay(final ScreenMarkerPlugin plugin, final Client client)
	{
		this.plugin = plugin;
		this.client = client;
		setPosition(OverlayPosition.DETACHED);
		setLayer(OverlayLayer.ABOVE_WIDGETS);
		setPriority(OverlayPriority.HIGH);
	}

	@Override
	public Dimension render(Graphics2D graphics)
	{
		if (!plugin.isCreatingScreenMarker() || plugin.isDrawingScreenMarker())
		{
			return null;
		}

		final MenuEntry[] menuEntries = client.getMenuEntries();
		if (client.isMenuOpen() || menuEntries.length == 0)
		{
			plugin.setSelectedWidgetBounds(null);
			return null;
		}

		final MenuEntry menuEntry = menuEntries[menuEntries.length - 1];
		final int childIdx = menuEntry.getParam0();
		final int widgetId = menuEntry.getParam1();
		final int groupId = WidgetInfo.TO_GROUP(widgetId);
		final int componentId = WidgetInfo.TO_CHILD(widgetId);

		final Widget widget = client.getWidget(groupId, componentId);
		if (widget == null)
		{
			plugin.setSelectedWidgetBounds(null);
			return null;
		}

		Rectangle bounds = null;
		if (childIdx > -1)
		{
			if (widget.getType() == WidgetType.INVENTORY)
			{
				final WidgetItem widgetItem = widget.getWidgetItem(childIdx);
				if (widgetItem != null)
				{
					bounds = widgetItem.getCanvasBounds();
				}
			}
			else
			{
				final Widget child = widget.getChild(childIdx);
				if (child != null)
				{
					bounds = child.getBounds();
				}
			}
		}
		else
		{
			bounds = widget.getBounds();
		}

		if (bounds == null)
		{
			plugin.setSelectedWidgetBounds(null);
			return null;
		}

		drawHighlight(graphics, bounds);
		plugin.setSelectedWidgetBounds(bounds);

		return null;
	}

	private static void drawHighlight(Graphics2D graphics, Rectangle bounds)
	{
		graphics.setColor(Color.GREEN);
		graphics.draw(bounds);
	}
}


text:
<?php

class Google_Service_CloudAsset_GoogleIdentityAccesscontextmanagerV1EgressFrom extends Google_Collection
{
  protected $collection_key = 'identities';
  public $identities;
  public $identityType;

  public function setIdentities($identities)
  {
    $this->identities = $identities;
  }
  public function getIdentities()
  {
    return $this->identities;
  }
  public function setIdentityType($identityType)
  {
    $this->identityType = $identityType;
  }
  public function getIdentityType()
  {
    return $this->identityType;
  }
}


text:
package org.newdawn.slick;

import org.newdawn.slick.opengl.renderer.Renderer;
import org.newdawn.slick.opengl.renderer.SGL;
import org.newdawn.slick.util.Log;
import org.newdawn.slick.util.ResourceLoader;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.Map.Entry;

/**
 * A font implementation that will parse BMFont format font files. The font files can be output
 * by Hiero, which is included with Slick, and also the AngelCode font tool available at:
 *
 * <a
 * href="http://www.angelcode.com/products/bmfont/">http://www.angelcode.com/products/bmfont/</a>
 *
 * This implementation copes with both the font display and kerning information
 * allowing nicer looking paragraphs of text. Note that this utility only
 * supports the text BMFont format definition file.
 *
 * @author kevin
 * @author Nathan Sweet <misc@n4te.com>
 */
public class AngelCodeFont implements Font {
    /** The renderer to use for all GL operations. */
    private static final SGL GL = Renderer.get();

    /**
     * The line cache size, this is how many lines we can render before starting
     * to regenerate lists.
     */
    private static final int DISPLAY_LIST_CACHE_SIZE = 200;

    /** The highest character that AngelCodeFont will support. */
    private static final int MAX_CHAR = 255;

    /** True if this font should use display list caching. */
    private boolean displayListCaching = true;

    /** The image containing the bitmap font. */
    private Image fontImage;
    /** The characters building up the font. */
    private Glyph[] chars;
    /** The height of a line. */
    private int lineHeight;
    /** The first display list ID. */
    private int baseDisplayListID = -1;
    /** The eldest display list ID. */
    private int eldestDisplayListID;
    /** The eldest display list.  */
    private DisplayList eldestDisplayList;
    /** */
    private boolean singleCase = false;
    /** */
    private short ascent;
    /** */
    private short descent;

    /** The display list cache for rendered lines. */
    private final Map<CharSequence, DisplayList> displayLists = new LinkedHashMap<CharSequence, DisplayList>(DISPLAY_LIST_CACHE_SIZE, 1, true) {
        /**
         *
         */
        private static final long serialVersionUID = 1L;

        /**
         *
         * @param eldest eldest
         * @return false
         */
        protected boolean removeEldestEntry(@Nonnull Entry<CharSequence, DisplayList> eldest) {
            eldestDisplayList = eldest.getValue();
            eldestDisplayListID = eldestDisplayList.id;
            return false;
        }
    };

    /**
     * Create a new font based on a font definition from AngelCode's tool and
     * the font image generated from the tool.
     *
     * @param fntFile
     *            The location of the font defnition file
     * @param image
     *            The image to use for the font
     * @throws SlickException
     *             Indicates a failure to load either file
     */
    public AngelCodeFont(String fntFile, Image image) throws SlickException {
        fontImage = image;

        parseFnt(ResourceLoader.getResourceAsStream(fntFile));
    }

    /**
     * Create a new font based on a font definition from AngelCode's tool and
     * the font image generated from the tool.
     *
     * @param fntFile
     *            The location of the font defnition file
     * @param imgFile
     *            The location of the font image
     * @throws SlickException
     *             Indicates a failure to load either file
     */
    public AngelCodeFont(String fntFile, String imgFile) throws SlickException {
        fontImage = new Image(imgFile);

        parseFnt(ResourceLoader.getResourceAsStream(fntFile));
    }

    /**
     * Create a new font based on a font definition from AngelCode's tool and
     * the font image generated from the tool.
     *
     * @param fntFile
     *            The location of the font defnition file
     * @param image
     *            The image to use for the font
     * @param caching
     *            True if this font should use display list caching
     * @throws SlickException
     *             Indicates a failure to load either file
     */
    public AngelCodeFont(String fntFile, Image image, boolean caching)
            throws SlickException {
        fontImage = image;
        displayListCaching = caching;
        parseFnt(ResourceLoader.getResourceAsStream(fntFile));
    }

    /**
     * Create a new font based on a font definition from AngelCode's tool and
     * the font image generated from the tool.
     *
     * @param fntFile
     *            The location of the font defnition file
     * @param imgFile
     *            The location of the font image
     * @param caching
     *            True if this font should use display list caching
     * @throws SlickException
     *             Indicates a failure to load either file
     */
    public AngelCodeFont(String fntFile, String imgFile, boolean caching)
            throws SlickException {
        fontImage = new Image(imgFile);
        displayListCaching = caching;
        parseFnt(ResourceLoader.getResourceAsStream(fntFile));
    }

    /**
     * Create a new font based on a font definition from AngelCode's tool and
     * the font image generated from the tool.
     *
     * @param name
     *            The name to assign to the font image in the image store
     * @param fntFile
     *            The stream of the font defnition file
     * @param imgFile
     *            The stream of the font image
     * @throws SlickException
     *             Indicates a failure to load either file
     */
    public AngelCodeFont(String name, @Nonnull InputStream fntFile, @Nonnull InputStream imgFile)
            throws SlickException {
        fontImage = new Image(imgFile, name, false);

        parseFnt(fntFile);
    }

    /**
     * Create a new font based on a font definition from AngelCode's tool and
     * the font image generated from the tool.
     *
     * @param name
     *            The name to assign to the font image in the image store
     * @param fntFile
     *            The stream of the font defnition file
     * @param imgFile
     *            The stream of the font image
     * @param caching
     *            True if this font should use display list caching
     * @throws SlickException
     *             Indicates a failure to load either file
     */
    public AngelCodeFont(String name, @Nonnull InputStream fntFile, @Nonnull InputStream imgFile,
            boolean caching) throws SlickException {
        fontImage = new Image(imgFile, name, false);

        displayListCaching = caching;
        parseFnt(fntFile);
    }

    /**
     * Parse the font definition file.
     *
     * @param fntFile
     *            The stream from which the font file can be read
     * @throws SlickException org.newdawn.slick.AngelCodeFont#parseChar(java.lang.String) fails
     */
    private void parseFnt(@Nonnull InputStream fntFile) throws SlickException {
        if (displayListCaching) {
            baseDisplayListID = GL.glGenLists(DISPLAY_LIST_CACHE_SIZE);
            if (baseDisplayListID == 0) displayListCaching = false;
        }

        try (
                final Reader inputStreamReader = new InputStreamReader(fntFile, StandardCharsets.UTF_8);
                final BufferedReader in = new BufferedReader(inputStreamReader)) {
            // now parse the font file
            in.readLine();
            String common = in.readLine();
            if(common != null) {
                descent = parseMetric(common, "descent=");
                parseMetric(common, "leading=");
            }
            in.readLine();

            final Map<Short, List<Short>> kerning = new HashMap<>(64);
            final List<Glyph> charDefs = new ArrayList<>(MAX_CHAR);
            int maxChar = 0;
            boolean done = false;
            while (!done) {
                String line = in.readLine();
                if (line == null) {
                    done = true;
                } else {
                    if (line.startsWith("chars c")) {
                        // ignore
                    } else if (line.startsWith("char")) {
                        Glyph def = parseChar(line);
                        if (def != null) {
                            maxChar = Math.max(maxChar, def.id);
                            charDefs.add(def);
                        }
                    }
                    if (line.startsWith("kernings c")) {
                        // ignore
                    } else if (line.startsWith("kerning")) {
                        StringTokenizer tokens = new StringTokenizer(line, " =");
                        tokens.nextToken(); // kerning
                        tokens.nextToken(); // first
                        short first = Short.parseShort(tokens.nextToken()); // first
                                                                            // value
                        tokens.nextToken(); // second
                        int second = Integer.parseInt(tokens.nextToken()); // second
                                                                            // value
                        tokens.nextToken(); // offset
                        int offset = Integer.parseInt(tokens.nextToken()); // offset
                                                                            // value
                        List<Short> values = kerning.get(first);
                        if (values == null) {
                            values = new ArrayList<>();
                            kerning.put(first, values);
                        }
                        // Pack the character and kerning offset into a short.
                        values.add((short) ((offset << 8) | second));
                    }
                }
            }

            chars = new Glyph[maxChar + 1];
            for (Glyph def : charDefs) {
                chars[def.id] = def;
            }

            // Turn each list of kerning values into a short[] and set on the
            // chardef.
            for (Entry<Short, List<Short>> entry : kerning.entrySet()) {
                short first = entry.getKey();
                List<Short> valueList = entry.getValue();
                short[] valueArray = new short[valueList.size()];
                for (int i=0; i<valueList.size(); i++)
                    valueArray[i] = valueList.get(i);
                chars[first].kerning = valueArray;
            }
        } catch (IOException e) {
            Log.error(e);
            throw new SlickException("Failed to parse font file: " + fntFile);
        }
    }

    /**
     * Returns the sprite sheet image that holds all of the images.
     * @return the image for this bitmap font
     */
    public Image getImage() {
        return fontImage;
    }

    /**
     * If a font has the same glyphs for upper and lower case text, we can
     * minimize its glyph page size by only using one case. If single case
     * is enabled (by default it is disabled), then the getGlyph method
     * (and, in turn, glyph rendering/height/width/etc.) will try to find
     * whichever case exists for the given code point (between 65-90 for
     * upper case characters and 97-122 for lower case).
     *
     * @param enabled true to enable
     */
    public void setSingleCase(boolean enabled) {
        this.singleCase = enabled;
    }

    /**
     * If a font has the same glyphs for upper and lower case text, we can
     * minimize its glyph page size by only using one case. If single case
     * is enabled (by default it is disabled), then the getGlyph method
     * (and, in turn, glyph rendering/height/width/etc.) will try to find
     * whichever case exists for the given code point (between 65-90 for
     * upper case characters and 97-122 for lower case).
     *
     * @return true if single case is enabled
     */
    public boolean isSingleCase() {
        return singleCase;
    }

    /**
     *
     * @param str str
     * @param sub sub
     * @return TODO write some shit
     */
    private short parseMetric(@Nonnull String str, @Nonnull String sub) {
        int ind = str.indexOf(sub);
        if (ind!=-1) {
            String subStr = str.substring(ind+sub.length());
            ind = subStr.indexOf(' ');
            return Short.parseShort(subStr.substring(0, ind!=-1 ? ind : subStr.length()));
        }
        return -1;
    }

    /**
     * Parse a single character line from the definition.
     *
     * @param line
     *            The line to be parsed
     * @return The character definition from the line
     * @throws SlickException Indicates a given character is not valid in an angel code font
     */
    @Nullable
    private Glyph parseChar(String line) throws SlickException {
        StringTokenizer tokens = new StringTokenizer(line, " =");

        tokens.nextToken(); // char
        tokens.nextToken(); // id
        short id = Short.parseShort(tokens.nextToken()); // id value
        if (id < 0) {
            return null;
        }
        if (id > MAX_CHAR) {
            throw new SlickException("Invalid character '" + id
                    + "': SpriteFont does not support characters above "
                    + MAX_CHAR);
        }

        tokens.nextToken(); // x
        short x = Short.parseShort(tokens.nextToken()); // x value
        tokens.nextToken(); // y
        short y = Short.parseShort(tokens.nextToken()); // y value
        tokens.nextToken(); // width
        short width = Short.parseShort(tokens.nextToken()); // width value
        tokens.nextToken(); // height
        short height = Short.parseShort(tokens.nextToken()); // height value
        tokens.nextToken(); // x offset
        short xoffset = Short.parseShort(tokens.nextToken()); // xoffset value
        tokens.nextToken(); // y offset
        short yoffset = Short.parseShort(tokens.nextToken()); // yoffset value
        tokens.nextToken(); // xadvance
        short xadvance = Short.parseShort(tokens.nextToken()); // xadvance

        if (id != ' ') {
            lineHeight = Math.max(height + yoffset, lineHeight);
        }
        Image img = fontImage.getSubImage(x, y, width, height);
        return new Glyph(id, x, y, width, height, xoffset, yoffset, xadvance, img);
    }

    @Override
    public void drawString(float x, float y, @Nonnull CharSequence text) {
        drawString(x, y, text, Color.white);
    }

    @Override
    public void drawString(float x, float y, @Nonnull CharSequence text, @Nonnull Color col) {
        drawString(x, y, text, col, 0, text.length() - 1);
    }

    @Override
    public void drawString(float x, float y, @Nonnull CharSequence text, @Nonnull Color col,
            int startIndex, int endIndex) {
        fontImage.bind();
        col.bind();

        GL.glTranslatef(x, y, 0);
        if (displayListCaching && startIndex == 0 && endIndex == text.length() - 1) {
            DisplayList displayList = displayLists.get(text);
            if (displayList != null) {
                GL.glCallList(displayList.id);
            } else {
                // Compile a new display list.
                displayList = new DisplayList();
                displayList.text = text;
                int displayListCount = displayLists.size();
                if (displayListCount < DISPLAY_LIST_CACHE_SIZE) {
                    displayList.id = baseDisplayListID + displayListCount;
                } else {
                    displayList.id = eldestDisplayListID;
                    displayLists.remove(eldestDisplayList.text);
                }

                displayLists.put(text, displayList);

                GL.glNewList(displayList.id, SGL.GL_COMPILE_AND_EXECUTE);
                render(text, startIndex, endIndex);
                GL.glEndList();
            }
        } else {
            render(text, startIndex, endIndex);
        }
        GL.glTranslatef(-x, -y, 0);
    }

    /**
     * Render based on immediate rendering.
     *
     * @param text The text to be rendered
     * @param start The index of the first character in the string to render
     * @param end The index of the last character in the string to render
     */
    private void render(@Nonnull CharSequence text, int start, int end) {
        GL.glBegin(SGL.GL_QUADS);

        int x = 0, y = 0;
        Glyph lastCharDef = null;

        for (int i = 0; i < text.length(); i++) {
            char id = text.charAt(i);
            if (id == '\n') {
                x = 0;
                y += getLineHeight();
                continue;
            }
            Glyph charDef = getGlyph(id);
            if (charDef == null) {
                continue;
            }
            if (lastCharDef != null)
                x += lastCharDef.getKerning(id);
            else
                x -= charDef.xoffset;

            lastCharDef = charDef;

            if ((i >= start) && (i <= end)) {
                charDef.image.drawEmbedded(x + charDef.xoffset, y + charDef.yoffset, charDef.width, charDef.height);

            }

            x += charDef.xadvance;
        }
        GL.glEnd();
    }

    /**
     * Returns the distance from the y drawing location to the top most pixel of the specified text.
     *
     * @param text
     *            The text that is to be tested
     * @return The yoffset from the y draw location at which text will start
     */
    public int getYOffset(@Nonnull String text) {
        DisplayList displayList = null;
        if (displayListCaching) {
            displayList = displayLists.get(text);
            if (displayList != null && displayList.yOffset != null) return displayList.yOffset.intValue();
        }

        int stopIndex = text.indexOf('\n');
        if (stopIndex == -1) stopIndex = text.length();

        int minYOffset = 10000;
        for (int i = 0; i < stopIndex; i++) {
            Glyph charDef = getGlyph(text.charAt(i));
            if (charDef == null) {
                continue;
            }
            minYOffset = Math.min(charDef.yoffset, minYOffset);
        }

        if (displayList != null) displayList.yOffset = (short) minYOffset;

        return minYOffset;
    }

    @Override
    public int getHeight(@Nonnull CharSequence text) {
        DisplayList displayList = null;
        if (displayListCaching) {
            displayList = displayLists.get(text);
            if (displayList != null && displayList.height != null) return displayList.height.intValue();
        }

        int lines = 0;
        int maxHeight = 0;
        for (int i = 0; i < text.length(); i++) {
            char id = text.charAt(i);
            if (id == '\n') {
                lines++;
                maxHeight = 0;
                continue;
            }
            // ignore space, it doesn't contribute to height
            if (id == ' ') {
                continue;
            }
            Glyph charDef = getGlyph(id);
            if (charDef == null) {
                continue;
            }

            maxHeight = Math.max(charDef.height + charDef.yoffset,
                    maxHeight);
        }

        maxHeight += lines * getLineHeight();

        if (displayList != null) displayList.height = (short) maxHeight;

        return maxHeight;
    }

    @Override
    public int getWidth(@Nonnull CharSequence text) {
        DisplayList displayList = null;
        if (displayListCaching) {
            displayList = displayLists.get(text);
            if (displayList != null && displayList.width != null) return displayList.width.intValue();
        }

        int maxWidth = 0;
        int width = 0;
        Glyph lastCharDef = null;
        for (int i = 0, n = text.length(); i < n; i++) {
            char id = text.charAt(i);
            if (id == '\n') {
                width = 0;
                continue;
            }
            Glyph charDef = getGlyph(id);
            if (charDef == null) {
                continue;
            }

            if (lastCharDef != null)
                width += lastCharDef.getKerning(id);
//            else //first glyph
//                width -= charDef.xoffset;
//
            lastCharDef = charDef;

            //space characters have zero width, so use their xadvance instead
            if (i < n - 1 || charDef.width==0) {
                width += charDef.xadvance;
            } else {
                width += charDef.width + charDef.xoffset;
            }
            maxWidth = Math.max(maxWidth, width);
        }
        if (displayList != null) displayList.width = (short) maxWidth;

        return maxWidth;
    }

    @Override
    public int getLineHeight() {
        return lineHeight;
    }

    /**
     * Requires export from the newest version of Hiero. Alternatively, you
     * could manually add <tt>descent=XX</tt> to the end of the 'common' line
     * in your font file.
     *
     * The descent is the distance from the font's baseline to the
     * bottom of most alphanumeric characters with descenders.
     *
     * @return descent
     */
    public int getDescent() {
        return descent;
    }

    /**
     * Requires export from the newest version of Hiero. Alternatively, you
     * could manually add <tt>ascent=XX</tt> to the end of the 'common' line
     * in your font file.
     *
     * The ascent is the distance from the font's baseline to the top of most
     * alphanumeric characters.
     *
     * @return ascent
     */
    public int getAscent() {
        return ascent;
    }

    /**
     * Returns the character definition for the given character.
     *
     * @param c the desired character
     * @return the CharDef with glyph info
     */
    @Nullable
    Glyph getGlyph(char c) {
        Glyph g = c >= chars.length ? null : chars[c];
        if (g!=null)
            return g;
        if (singleCase) {
            if (c>=65 && c<=90)
                c += 32;
            else if (c>=97 && c<=122)
                c -= 32;
        }
        return c>= chars.length ? null : chars[c];
    }

    /**
     * The definition of a single character as defined in the AngelCode file.
     * format
     *
     * @author kevin
     */
    public static class Glyph {
        /** The id of the character. */
        public final short id;
        /** The x location on the sprite sheet. */
        public final short x;
        /** The y location on the sprite sheet. */
        public final short y;
        /** The width of the character image. */
        public final short width;
        /** The height of the character image. */
        public final short height;
        /** The amount the x position should be offset when drawing the image. */
        public final short xoffset;
        /** The amount the y position should be offset when drawing the image. */
        public final short yoffset;
        /** The amount to move the current position after drawing the character. */
        public final short xadvance;
        /** The sub-image containing the character. */
        public final Image image;
        /** The kerning info for this character. */
        short[] kerning;

        /**
         *
         * @param id id
         * @param x x
         * @param y y
         * @param width width
         * @param height height
         * @param xoffset xoffset
         * @param yoffset yoffset
         * @param xadvance xadvance
         * @param image image
         */
        Glyph(short id, short x, short y, short width, short height,
              short xoffset, short yoffset, short xadvance, Image image) {
            this.id = id;
            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;
            this.xoffset = xoffset;
            this.yoffset = yoffset;
            this.xadvance = xadvance;
            this.image = image;
        }

        @Override
        @Nonnull
        public String toString() {
            return "[CharDef id=" + id + " x=" + x + " y=" + y + "]";
        }

        /**
         * Get the kerning offset between this character and the specified character.
         * @param otherCodePoint The other code point
         * @return the kerning offset
         */
        public int getKerning (int otherCodePoint) {
            if (kerning == null) return 0;
            int low = 0;
            int high = kerning.length - 1;
            while (low <= high) {
                int midIndex = (low + high) >>> 1;
                int value = kerning[midIndex];
                int foundCodePoint = value & 0xff;
                if (foundCodePoint < otherCodePoint)
                    low = midIndex + 1;
                else if (foundCodePoint > otherCodePoint)
                    high = midIndex - 1;
                else
                    return value >> 8;
            }
            return 0;
        }
    }

    /**
     * A descriptor for a single display list.
     *
     * @author Nathan Sweet <misc@n4te.com>
     */
    static private class DisplayList {
        /** The if of the distance list. */
        int id;
        /** The offset of the line rendered. */
        Short yOffset;
        /** The width of the line rendered. */
        Short width;
        /** The height of the line rendered. */
        Short height;
        /** The text that the display list holds. */
        CharSequence text;
    }
}


text:
#include "ExUtil.h"
#include <CppAwait/Log.h>
#include <array>
#include <string>
#include <boost/lexical_cast.hpp>

typedef void (*ExampleFunc)();

void ex_fibonacci();
void ex_iterator();
void ex_comboDetector();
void ex_awaitBasics();
void ex_awaitHttpClient();
void ex_awaitFlickr();
void ex_awaitThread();
void ex_awaitChatServer();
void ex_awaitChatClient();
void ex_stockServer();
void ex_stockClient();

const std::array<std::pair<ExampleFunc, std::string>, 11> EXAMPLES =
{ {
    std::make_pair(&ex_fibonacci, "coroutines - fibonacci sequence generator"),
    std::make_pair(&ex_iterator, "coroutines - collection iterator"),
    std::make_pair(&ex_comboDetector, "coroutines - combo detector"),
    std::make_pair(&ex_awaitBasics, "await - basics"),
    std::make_pair(&ex_awaitHttpClient, "await - HTTP client"),
    std::make_pair(&ex_awaitFlickr, "await - Flickr client"),
    std::make_pair(&ex_awaitThread, "await - threads example"),
    std::make_pair(&ex_awaitChatServer, "await - chat server"),
    std::make_pair(&ex_awaitChatClient, "await - chat client"),
    std::make_pair(&ex_stockServer, "stock price server"),
    std::make_pair(&ex_stockClient, "stock price client")
} };

int main(int argc, char** argv)
{
    // ut::setLogLevel(ut::LOGLEVEL_DEBUG);

    size_t selected = 0;

    if (argc == 2) {
        selected = boost::lexical_cast<size_t>(argv[1]);
    }

    while (selected < 1 || EXAMPLES.size() < selected) {
        printf ("Examples:\n\n");

        for (size_t i = 0; i < EXAMPLES.size(); i++) {
            printf ("%02d: %s\n", (int) (i + 1), EXAMPLES[i].second.c_str());
        }

        printf ("\nSelect: ");
        try {
            const char* line = readLine();
            selected = boost::lexical_cast<size_t>(line);
        } catch (...) {
        }

        printf ("\n---------\n\n");
    }

    auto& example = EXAMPLES[selected - 1];
    example.first();

    printf ("\nDONE\n");

    return 0;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;

using Foundation;
using UIKit;
using Xamarin.Forms;
using XamarinFormsClient.Core;

namespace XamarinFormsClient.iOS
{
    // The UIApplicationDelegate for the application. This class is responsible for launching the
    // User Interface of the application, as well as listening (and optionally responding) to
    // application events from iOS.
    [Register("AppDelegate")]
    public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
    {
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            DependencyService.Register<ASWebAuthenticationSessionBrowser>();

            LoadApplication(new App());

            return base.FinishedLaunching(app, options);
        }
    }
}


text:
"use strict";

var moment = require( 'moment' );
var request = require( 'request' );
var url = 'https://www.googleapis.com/urlshortener/v1/url';

var GoogleUrl = function ( config ) {

  this._config = config || {};

};

GoogleUrl.prototype.shorten = function ( longUrl, done ) {
  this._makeRequest( 'POST', { "longUrl": longUrl }, function ( err, data ) {
    if ( err ) {
      done( err );
    } else {
      done( null, data.id );
    }
  } );
};

GoogleUrl.prototype.expand = function ( shortUrl, done ) {
  this._makeRequest( 'GET', { "shortUrl": shortUrl }, function ( err, data ) {
    if ( err ) {
      done( err );
    } else {
      done( null, data.longUrl );
    }
  } );
};

GoogleUrl.prototype.analytics = function ( shortUrl, done ) {

  var params = {};

  if ( typeof shortUrl === 'object' ) {
    params = shortUrl;
  } else {
    params.shortUrl = shortUrl;
  }

  if ( typeof params.fields !== 'string' || params.fields.length < 1 ) {
    params.fields = 'FULL';
  }

  switch ( params.fields.toUpperCase() ) {

    case 'CLICKS':
      params.fields = 'ANALYTICS_CLICKS';
      break;

    case 'STRINGS':
      params.fields = 'ANALYTICS_TOP_STRINGS';
      break;

    default:
      params.fields = 'FULL';
      break;

  }

  this._makeRequest( 'GET', { shortUrl: params.shortUrl, projection: params.fields }, function ( err, data ) {
    if ( err ) {
      done( err );
    } else {

      // clamp to valid values
      data.analytics = data.analytics || {
        "allTime":  {
          "shortUrlClicks": null,
          "longUrlClicks":  null,
          "referrers":      [],
          "countries":      [],
          "browsers":       [],
          "platforms":      []
        },
        "month":    {
          "shortUrlClicks": null,
          "longUrlClicks":  null,
          "referrers":      [],
          "countries":      [],
          "browsers":       [],
          "platforms":      []
        },
        "week":     {
          "shortUrlClicks": null,
          "longUrlClicks":  null,
          "referrers":      [],
          "countries":      [],
          "browsers":       [],
          "platforms":      []
        },
        "day":      {
          "shortUrlClicks": null,
          "longUrlClicks":  null,
          "referrers":      [],
          "countries":      [],
          "browsers":       [],
          "platforms":      []
        },
        "twoHours": {
          "shortUrlClicks": null,
          "longUrlClicks":  null,
          "referrers":      [],
          "countries":      [],
          "browsers":       [],
          "platforms":      []
        }
      };

      done( null, {
        analytics: normalizeAnalytics( data.analytics ),
        created:   moment( data.created ).toISOString()
      } );

    }
  } );
};

GoogleUrl.prototype._makeRequest = function ( type, payload, done ) {

  var qs = null;

  var requestParams = {
    uri:    url,
    method: type
  };

  payload = payload || {};

  if ( type === 'GET' && typeof payload === 'object' ) {
    qs = payload;
  } else if ( type === 'POST' ) {
    requestParams.json = payload;
  }

  if ( this._config && typeof this._config.key === 'string' && this._config.key.length > 0 ) {
    if ( !qs ) {
      qs = {};
    }
    qs.key = this._config.key;
  }

  if ( qs ) {
    requestParams.qs = qs;
  }

  request( requestParams, function ( err, body, response ) {
      setImmediate( function () {
        if ( err || (response && response.error) ) {
          if ( response && response.error ) {
            done( response.error.message );
          } else {
            done( err );
          }
        } else {

          if ( typeof response === 'string' ) {
            response = JSON.parse( response );
          }

          done( null, response );
        }
      } );
    }
  );

};

function normalizeAnalytics( analytics ) {

  for ( var field in analytics ) {
    if ( analytics.hasOwnProperty( field ) ) {
      normalizeAnalyticsSection( analytics[field] );
    }
  }

  return analytics;
}

var test = {
  created:   "An ISO Date",
  analytics: {
    allTime:  {
      shortUrlClicks: 2,
      longUrlClicks:  3,
      referrers:      [
        { count: 2, "id": "http://HildoerSystems.com/" } /* , ... */
      ],
      countries:      [
        { count: 10, "id": "US" } /* , ... */
      ],
      browsers:       [
        { count: 3, "id": "Firefox" } /* , ... */
      ],
      platforms:      [
        { count: 6, "id": "Mac" } /* , ... */
      ]
    },
    month:    { /* same schema as allTime */ },
    week:     { /* same schema as allTime */ },
    day:      { /* same schema as allTime */ },
    twoHours: { /* same schema as allTime */ }
  }
};

function normalizeAnalyticsSection( section ) {

  for ( var field in section ) {
    if ( section.hasOwnProperty( field ) ) {
      switch ( field ) {
        case 'shortUrlClicks':
        case 'longUrlClicks':
          section[field] = parseInt( section[field], 10 );
          break;
        default:
          normalizeAnalyticsSubSection( section[field] );
          break;
      }
    }
  }

}

function normalizeAnalyticsSubSection( subsection ) {
  for ( var i = 0; i < subsection.length; i++ ) {
    subsection[i].count = parseInt( subsection[i].count, 10 );
  }
}

module.exports = GoogleUrl;


text:
class PrefService;

class PortForwardingController : public KeyedService {
 public:
  explicit PortForwardingController(PrefService* pref_service);

  virtual ~PortForwardingController();

  class Factory : public BrowserContextKeyedServiceFactory {
   public:
    // Returns singleton instance of Factory.
    static Factory* GetInstance();

    // Returns PortForwardingController associated with |profile|.
    static PortForwardingController* GetForProfile(Profile* profile);

   private:
    friend struct DefaultSingletonTraits<Factory>;

    Factory();
    virtual ~Factory();

    // BrowserContextKeyedServiceFactory overrides:
    virtual KeyedService* BuildServiceInstanceFor(
        content::BrowserContext* context) const OVERRIDE;
    DISALLOW_COPY_AND_ASSIGN(Factory);
  };

  typedef int PortStatus;
  typedef std::map<int, PortStatus> PortStatusMap;
  typedef std::map<std::string, PortStatusMap> DevicesStatus;

  DevicesStatus UpdateDeviceList(
      const DevToolsAdbBridge::RemoteDevices& devices);

 private:
  class Connection;
  typedef std::map<std::string, Connection* > Registry;

  void OnPrefsChange();
  bool ShouldCreateConnections();
  void ShutdownConnections();

  scoped_refptr<RefCountedAdbThread> adb_thread_;
  PrefService* pref_service_;
  PrefChangeRegistrar pref_change_registrar_;
  Registry registry_;

  DISALLOW_COPY_AND_ASSIGN(PortForwardingController);
};

#endif  // CHROME_BROWSER_DEVTOOLS_PORT_FORWARDING_CONTROLLER_H_


text:
package proguard.obfuscate;

import proguard.classfile.*;
import proguard.classfile.visitor.MemberVisitor;

/**
 * This MemberVisitor delegates its visits to another given
 * MemberVisitor, but only when the visited member has a new name.
 * Constructors are judged based on the class name.
 *
 * @see ClassObfuscator
 * @see MemberObfuscator
 *
 * @author Eric Lafortune
 */
public class MemberNameFilter implements MemberVisitor
{
    private final MemberVisitor memberVisitor;

    /**
     * Creates a new MemberNameFilter.
     * @param memberVisitor the MemberVisitor to which
     *                      visits will be delegated.
     */
    public MemberNameFilter(MemberVisitor memberVisitor)
    {
        this.memberVisitor = memberVisitor;
    }

    // Implementations for MemberVisitor.

    public void visitProgramField(ProgramClass programClass, ProgramField programField)
    {
        if (hasName(programField))
        {
            memberVisitor.visitProgramField(programClass, programField);
        }
    }

    public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod)
    {
        if (hasName(programClass, programMethod))
        {
            memberVisitor.visitProgramMethod(programClass, programMethod);
        }
    }

    public void visitLibraryField(LibraryClass libraryClass, LibraryField libraryField)
    {
        if (hasName(libraryField))
        {
            memberVisitor.visitLibraryField(libraryClass, libraryField);
        }
    }

    public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod)
    {
        if (hasName(libraryClass, libraryMethod))
        {
            memberVisitor.visitLibraryMethod(libraryClass, libraryMethod);
        }
    }

    // Small utility methods.

    /**
     * Returns whether the given class has a new name.
     */
    private boolean hasName(Clazz clazz)
    {
        return ClassObfuscator.newClassName(clazz) != null;
    }

    /**
     * Returns whether the given method has a new name.
     */
    private boolean hasName(Clazz clazz, Method method)
    {
        return
            hasName(method) ||
            (hasName(clazz) &&
             method.getName(clazz).equals(ClassConstants.METHOD_NAME_INIT));
    }

    /**
     * Returns whether the given class member has a new name.
     */
    private boolean hasName(Member member)
    {
        return MemberObfuscator.newMemberName(member) != null;
    }
}


text:
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;

namespace Azure.Search.Documents.Indexes.Models
{
    public partial class ElisionTokenFilter : IUtf8JsonSerializable
    {
        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
        {
            writer.WriteStartObject();
            if (Articles != null)
            {
                writer.WritePropertyName("articles");
                writer.WriteStartArray();
                foreach (var item in Articles)
                {
                    writer.WriteStringValue(item);
                }
                writer.WriteEndArray();
            }
            writer.WritePropertyName("@odata.type");
            writer.WriteStringValue(ODataType);
            writer.WritePropertyName("name");
            writer.WriteStringValue(Name);
            writer.WriteEndObject();
        }

        internal static ElisionTokenFilter DeserializeElisionTokenFilter(JsonElement element)
        {
            IList<string> articles = default;
            string odataType = default;
            string name = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("articles"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List<string> array = new List<string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(item.GetString());
                        }
                    }
                    articles = array;
                    continue;
                }
                if (property.NameEquals("@odata.type"))
                {
                    odataType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
            }
            return new ElisionTokenFilter(odataType, name, articles);
        }
    }
}


text:
module Fastlane
  VERSION = '1.87.1'.freeze
  DESCRIPTION = "The easiest way to automate building and releasing your iOS and Android apps"
end


text:
dtkComposerNodeGraphEdge::dtkComposerNodeGraphEdge(dtkComposerNode *s, dtkComposerNode *d, int e_id, int r_id) : BaseClass(s, d), m_connexions(QList<QPair<int, int> >() << qMakePair(e_id, r_id)), m_parent(nullptr)
{

}

dtkComposerNodeGraphEdge::dtkComposerNodeGraphEdge(dtkComposerNode *s, dtkComposerNode *d, const QList< QPair<int, int> >& connexions) : BaseClass(s, d), m_connexions(connexions), m_parent(nullptr)
{

}

dtkComposerNodeGraphEdge::dtkComposerNodeGraphEdge(const dtkComposerNodeGraphEdge& o) : BaseClass(o), m_connexions(o.m_connexions), m_parent(o.m_parent), m_src_type(o.m_src_type), m_dst_type(o.m_dst_type)
{

}

dtkComposerNodeGraphEdge::~dtkComposerNodeGraphEdge(void)
{
    m_connexions.clear();
    m_parent = nullptr;
}

dtkComposerNodeGraphEdge& dtkComposerNodeGraphEdge::operator = (const dtkComposerNodeGraphEdge& o)
{
    BaseClass::operator = (o);
    m_connexions = o.m_connexions;
    m_parent = o.m_parent;
    m_src_type = o.m_src_type;
    m_dst_type = o.m_dst_type;

    return *this;
}

bool dtkComposerNodeGraphEdge::operator == (const dtkComposerNodeGraphEdge& o) const
{
    if (BaseClass::operator == (o)) {
        return m_connexions == o.m_connexions;
    }
    return false;
}

void dtkComposerNodeGraphEdge::addConnexion(int e_id, int r_id)
{
    this->addConnexion(qMakePair(e_id, r_id));
}

void dtkComposerNodeGraphEdge::addConnexion(const QPair<int, int>& c)
{
    if (!m_connexions.contains(c)) {
        m_connexions << c;
    }
}

void dtkComposerNodeGraphEdge::removeConnexion(int e_id, int r_id)
{
    this->removeConnexion(qMakePair(e_id, r_id));
}

void dtkComposerNodeGraphEdge::removeConnexion(const QPair<int, int>& c)
{
    m_connexions.removeOne(c);
}

const QList< QPair<int, int> >& dtkComposerNodeGraphEdge::connexions(void) const
{
    return m_connexions;
}

void dtkComposerNodeGraphEdge::setParentNode(dtkComposerNode *n)
{
    m_parent = n;
}

void dtkComposerNodeGraphEdge::setSrcType(const QString & t)
{
    m_src_type = t;
}

void dtkComposerNodeGraphEdge::setDstType(const QString & t)
{
    m_dst_type = t;
}

dtkComposerNode *dtkComposerNodeGraphEdge::parentNode(void) const
{
    return m_parent;
}

QString dtkComposerNodeGraphEdge::srcType(void) const
{
    return m_src_type;
}

QString dtkComposerNodeGraphEdge::dstType(void) const
{
    return m_dst_type;
}

//
// dtkComposerNodeGraphEdge.cpp ends here


text:
package gov.nasa.ensemble.core.jscience;

import gov.nasa.ensemble.core.jscience.util.AmountUtils;
import gov.nasa.ensemble.core.jscience.util.DateUtils;
import gov.nasa.ensemble.emf.model.common.Timepoint;

import java.util.Date;

import javax.measure.quantity.Duration;

import org.jscience.physics.amount.Amount;

public class TemporalOffset {

	private final Timepoint timepoint;
	private final Amount<Duration> offset;

	public TemporalOffset(Timepoint timepoint, Amount<Duration> offset) {
		super();
		if (timepoint == null || offset == null) {
			throw new NullPointerException("null argument not allowed");
		}
		this.timepoint = timepoint;
		this.offset = offset;
	}

	public TemporalOffset setTimepoint(Timepoint timepoint) {
		return new TemporalOffset(timepoint, getOffset());
	}

	public Timepoint getTimepoint() {
		return timepoint;
	}

	public TemporalOffset setOffset(Amount<Duration> offset) {
		return new TemporalOffset(getTimepoint(), offset);
	}

	public Amount<Duration> getOffset() {
		return offset;
	}

	/** Adds this offset to a start/end/duration to compute the absolute time it occurs. */
	public Date getDate(TemporalExtent extent) {
		return extent == null ? null : DateUtils.add(extent.getTimepointDate(timepoint), offset);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((offset == null) ? 0 : AmountUtils.hashCode(offset));
		result = prime * result + ((timepoint == null) ? 0 : timepoint.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		TemporalOffset other = (TemporalOffset) obj;
		if (offset == null) {
			if (other.offset != null) {
				return false;
			}
		} else if (!AmountUtils.equals(offset, other.offset)) {
			return false;
		}
		if (timepoint != other.timepoint) {
			return false;
		}
		return true;
	}

	public TemporalOffset getAsStartOffset(Amount<Duration> duration) {
		if (timepoint == Timepoint.START) {
			return new TemporalOffset(timepoint, offset);
		}

		return new TemporalOffset(Timepoint.START, duration.plus(offset));
	}

	public TemporalOffset getAsEndOffset(Amount<Duration> duration) {
		if (timepoint == Timepoint.END) {
			return new TemporalOffset(timepoint, offset);
		}
		return new TemporalOffset(Timepoint.END, offset.minus(duration));
	}
}


text:
.class public Landroid/text/style/TtsSpan$VerbatimBuilder;
.super Landroid/text/style/TtsSpan$SemioticClassBuilder;
.source "TtsSpan.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Landroid/text/style/TtsSpan;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "VerbatimBuilder"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/text/style/TtsSpan$SemioticClassBuilder",
        "<",
        "Landroid/text/style/TtsSpan$VerbatimBuilder;",
        ">;"
    }
.end annotation

# direct methods
.method public constructor <init>()V
    .locals 1

    const-string/jumbo v0, "android.type.verbatim"

    invoke-direct {p0, v0}, Landroid/text/style/TtsSpan$SemioticClassBuilder;-><init>(Ljava/lang/String;)V

    return-void
.end method

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

    invoke-direct {p0}, Landroid/text/style/TtsSpan$VerbatimBuilder;-><init>()V

    invoke-virtual {p0, p1}, Landroid/text/style/TtsSpan$VerbatimBuilder;->setVerbatim(Ljava/lang/String;)Landroid/text/style/TtsSpan$VerbatimBuilder;

    return-void
.end method

# virtual methods
.method public setVerbatim(Ljava/lang/String;)Landroid/text/style/TtsSpan$VerbatimBuilder;
    .locals 1

    const-string/jumbo v0, "android.arg.verbatim"

    invoke-virtual {p0, v0, p1}, Landroid/text/style/TtsSpan$VerbatimBuilder;->setStringArgument(Ljava/lang/String;Ljava/lang/String;)Landroid/text/style/TtsSpan$Builder;

    move-result-object v0

    check-cast v0, Landroid/text/style/TtsSpan$VerbatimBuilder;

    return-object v0
.end method


text:
package net.nikore.gozer;

import static org.junit.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mockito.runners.MockitoJUnitRunner;

import net.nikore.gozer.config.TestGozerCoreConfig;
import net.nikore.gozer.filters.FilterRegistry;
import net.nikore.gozer.filters.TestGozerFilter;

@RunWith(MockitoJUnitRunner.class)
public class FilterLoader_Test {

  @Mock
  InputStream inputStream;

  @Mock
  FilterRegistry registry;

  FilterLoader loader;

  @Before
  public void before() {
    MockitoAnnotations.initMocks(this);

    this.loader = new DefaultFilterLoader(registry, new TestFilterFactory(), new TestCompiler());
  }

  @Test
  public void testGetFilterFromFile() throws Exception {
    assertTrue(loader.putFilter(inputStream, "test/blah.groovy", 1));
    verify(registry).put(any(String.class), any(Class.class));
  }

  @Test
  public void testGetFiltersByType() throws Exception {
    assertTrue(loader.putFilter(inputStream, "test2/blah2.groovy", 1));

    verify(registry).put(any(String.class), any(Class.class));

    final List<Class<? extends GozerFilter>> filters = new ArrayList<>();
    filters.add(TestGozerFilter.class);
    when(registry.getAllFilters()).thenReturn(filters);
    when(registry.getByFilterType(FilterType.POST)).thenReturn(filters);

    List<Class<? extends GozerFilter>> list = registry.getByFilterType(FilterType.POST);
    assertTrue(list != null);
    assertTrue(list.size() == 1);
    Class<? extends GozerFilter> filter = list.get(0);
    assertTrue(filter != null);
  }

  private static class TestFilterFactory implements FilterFactory {
    @Override
    public GozerFilter newInstance(Class<? extends GozerFilter> clazz) {
      return new TestGozerFilter();
    }
  }

  private static class TestCompiler implements DynamicCodeCompiler {

    @Override
    public Class<? extends GozerFilter> compile(String sCode, String sName) throws Exception {
      return TestGozerFilter.class;
    }

    @Override
    public Class<? extends GozerFilter> compile(InputStream stream, String sName) throws Exception {
      return TestGozerFilter.class;
    }
  }
}


text:
/*------------------------------------------------------------------

[Table of contents]
1. Time picker
2. car list style
3. reservation links
4. castum  selectop for price
5.  accordion
6. scroll menu
7. dropdown animation
8. home active care
9. bootstrap select
10. tabs
11 Swipper
12.Menu
13 backround block with image
14 map
15 Load resize
-------------------------------------------------------------------*/

;
(function($, window, document, undefined) {
    "use strict";

// time picker

    if ($('.timepicker').length) {
        $('.timepicker').datetimepicker({
            datepicker: false,
            format: 'H:i'
        });
    }
    if ($('.datetimepicker').length) {

        $.datetimepicker.setLocale('de');

        $('.datetimepicker').datetimepicker({
            i18n: {
                de: {
                    months: [
                        'Januar', 'Februar', 'März', 'April',
                        'Mai', 'Juni', 'Juli', 'August',
                        'September', 'Oktober', 'November', 'Dezember',
                    ],
                    dayOfWeek: [
                        "So.", "Mo", "Di", "Mi",
                        "Do", "Fr", "Sa.",
                    ]
                }
            },
            timepicker: false,

            format: 'd.m'
        });
    }

$('.wheel-table-cart .fa-times').on('click', function (e) {
   $(this).parent().parent().remove();
});

    // car list style
    $('.wheel-car-list-btn a').on('click', function(event) {
        event.preventDefault();
        var that = $(this),
            newStyle = $('.product-elem-style'),
            thatAttr = that.attr('data-list');

        if (that.hasClass('active')) {
            return false;
        } else {
            that.parent('.wheel-car-list-btn').find('a').removeClass('active')
            that.addClass('active')
            if (newStyle.hasClass('product-elem-style2')) {
                console.log(newStyle.parent());
                newStyle.parent().removeClass('col-lg-4  col-md-6').addClass('col-xs-12')
                newStyle.removeClass('product-elem-style2')
                newStyle.addClass(thatAttr)
            } else {
                newStyle.removeClass('product-elem-style1')
                newStyle.parent().removeClass('col-xs-12').addClass('col-lg-4  col-md-6')
                newStyle.addClass(thatAttr)
            }

        }

    });

    // reservation links

    $('.reservation .wheel-start-form label.promo button').on('click', function(event) {
        event.preventDefault();
        window.location.href = "reservation2.html";
    });

    $('.product-list .wheel-btn').on('click', function(event) {
        event.preventDefault();
        window.location.href = "reservation3.html";
    });
    $('.product-wrap .wheel-btn.style-2').on('click', function(event) {
        event.preventDefault();
        window.location.href = "reservation4.html";
    });

    // add  identical height  to block
    $('.car-item-wrap').css('height', 'auto').equalHeights();

    // castum  selectop for price

    $('.select.select-1 span').on('click', function() {
        $(this).siblings('.list').toggle();
        $(this).toggleClass('active');
    });

    $('.select.select-1 .list li').on('click', function() {
        var tx = $(this).text();
        $('.select.select-1 span').text(tx);
        $(this).parents('.list').toggle();
        $('.select.select-1 span').toggleClass('active');
    });

    $('.select.select-2 span').on('click', function() {
        $(this).siblings('.list').toggle();
        $(this).toggleClass('active');
    });

    $('.select.select-2 .list li').on('click', function() {
        var tx = $(this).text();
        $('.select.select-2 span').text(tx);
        $(this).parents('.list').toggle();
        $('.select.select-2 span').toggleClass('active');
    });

    $('.select.select-3 span').on('click', function() {
        $(this).siblings('.list').toggle();
        $(this).toggleClass('active');
    });

    $('.select.select-3 .list li').on('click', function() {
        var tx = $(this).text();
        $('.select.select-3 span').text(tx);
        $(this).parents('.list').toggle();
        $('.select.select-3 span').toggleClass('active');
    });

    $('.select.select-4 span').on('click', function() {
        $(this).siblings('.list').toggle();
        $(this).toggleClass('active');
    });

    $('.select.select-4 .list li').on('click', function() {
        var tx = $(this).text();
        $('.select.select-4 span').text(tx);
        $(this).parents('.list').toggle();
        $('.select.select-4 span').toggleClass('active');
    });

    // accordion
    var wpcRemoveClass = function(el, _class) {
        if (el.classList)
            el.classList.remove(_class ? _class : 'active');
        else
            el.className = panel.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' ');
    }
    $('.wpc-accordion').on('click', '.panel-title', function() {

        var panel_parent = this.parentNode,
            panel_container = panel_parent.parentNode,
            panels_wrap = panel_container.querySelectorAll('.panel-wrap');

        Array.prototype.forEach.call(panels_wrap, function(panel, i) {
            if (panel !== panel_parent) {
                wpcRemoveClass(panel);
            }
        });

        if (-1 !== this.parentNode.className.indexOf('active')) {
            wpcRemoveClass(panel_parent);
        } else {
            panel_parent.className += ' active';
        }

    });

    // Scroll menu
    function undateMenu() {
        var scrollTop = window.pageYOffset;
        var menu = $('.wheel-menu-wrap ');

        if (scrollTop > 5 || $(window).width() < 993) {

            if (scrollTop > 5) {
                menu.addClass('active-scroll');
            } else {
                menu.removeClass('active-scroll');
            }

        } else if (scrollTop < 5 || $(window).width() > 993) {
            menu.removeClass('active-scroll');
        }
    }

    // home active care
    $('.wheel-collection').on('click', '.wheel-collection-item', function() {

        var activeCar = $('.wheel-collection-text'),
            activeCarImg = $('.wheel-collection-img  .car-img'),
            valueName = $(this).attr('data-name'),
            valueCarClass = $(this).attr('data-carClass'),
            valuePrice = $(this).attr('data-price'),
            valueText = $(this).attr('data-text'),
            valueBags = $(this).attr('data-bags'),
            valuePassenger = $(this).attr('data-passenger'),
            valueSpeed = $(this).attr('data-speed'),
            valueImg = $(this).attr('data-img');

        activeCar.find('.car-name').text(valueName)
        activeCar.find('.car-class').text(valueCarClass)
        activeCar.find('.car-name').text(valueName)
        activeCar.find('.car-text').text(valueText)
        activeCar.find('.car-bags').text(valueBags)
        activeCar.find('.car-passengers').text(valuePassenger)
        activeCar.find('.car-speed').text(valueSpeed)
        activeCarImg.attr('src', valueImg)

        $(this).parents('.swiper-container').find('.wheel-collection-item').removeClass('active-car')
        $(this).addClass('active-car')
    })

    // bootstrap select
    $('.selectpicker').selectpicker({
        style: 'btn-info',
        size: 4
    });

    // tabs
    $('.tabs-header').on('click', 'li:not(.active)', function() {

        var index_el = $(this).index();

        $(this).addClass('active').siblings().removeClass('active');
        $(this).closest('.tabs').find('.tabs-item').removeClass('active').eq(index_el).addClass('active');
        swipers['swiper-' + $(this).closest('.wheel-collection ').find('.tabs-item.active .swiper-container').attr('id')].reInit();
        sliderOpacity()
        var index_el = $(this).index();
        $(this).closest('.wheel-our-menu').find('.tabs-item').removeClass('visible-swiper').hide().eq(index_el).fadeIn(700).addClass('visible-swiper');

    });

    $('  .tabs-header li a ').on('click', function(e) {
        e.preventDefault();
    });

    /*============================*/
    /* 01 - VARIABLES */
    /*============================*/
    var swipers = [],
        winW, winH, winScr, _isresponsive, smPoint = 768,
        mdPoint = 992,
        lgPoint = 1200,
        addPoint = 1600,
        _ismobile = navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i);

    /*========================*/
    /* 02 - PAGE CALCULATIONS */
    /*========================*/
    function pageCalculations() {
        winW = $(window).width();
        winH = $(window).height();
    }

    /*=================================*/
    /* 03 - FUNCTION ON DOCUMENT READY */
    /*=================================*/
    pageCalculations();

    /*============================*/
    /* 04 - FUNCTION ON PAGE LOAD */
    /*============================*/

    $(window).load(function() {
        initSwiper();

        $('.load-wrap').hide();
    });

    /*==============================*/
    /* 05 - FUNCTION ON PAGE RESIZE */
    /*==============================*/
    function resizeCall() {
        pageCalculations();
        $('.swiper-container.initialized[data-slides-per-view="responsive"]').each(function() {
            var thisSwiper = swipers['swiper-' + $(this).attr('id')],
                $t = $(this),
                slidesPerViewVar = updateSlidesPerView($t),
                centerVar = thisSwiper.params.centeredSlides;
            thisSwiper.params.slidesPerView = slidesPerViewVar;
            thisSwiper.reInit();
            if (!centerVar) {
                var paginationSpan = $t.find('.pagination span');
                var paginationSlice = paginationSpan.hide().slice(0, (paginationSpan.length + 1 - slidesPerViewVar));
                if (paginationSlice.length <= 1 || slidesPerViewVar >= $t.find('.swiper-slide').length) $t.addClass('pagination-hidden');
                else $t.removeClass('pagination-hidden');
                paginationSlice.show();
            }
        });
    }
    if (!_ismobile) {
        $(window).resize(function() {
            resizeCall();
        });
    } else {
        window.addEventListener("orientationchange", function() {
            resizeCall();
        }, false);
    }

    /*=====================*/
    /* 06 - SWIPER SLIDERS */
    /*=====================*/

    function initSwiper() {
        var initIterator = 0;
        $('.swiper-container').each(function() {
            var $t = $(this);

            var index = 'swiper-unique-id-' + initIterator;

            $t.addClass('swiper-' + index + ' initialized').attr('id', index);
            $t.find('.pagination').addClass('pagination-' + index);

            var autoPlayVar = parseInt($t.attr('data-autoplay'), 10);
            var mode = $t.attr('data-mode');
            var slidesPerViewVar = $t.attr('data-slides-per-view');
            if (slidesPerViewVar == 'responsive') {
                slidesPerViewVar = updateSlidesPerView($t);
            } else slidesPerViewVar = parseInt(slidesPerViewVar, 10);

            var loopVar = parseInt($t.attr('data-loop'), 10);
            var speedVar = parseInt($t.attr('data-speed'), 10);
            var centerVar = parseInt($t.attr('data-center'), 10);
            swipers['swiper-' + index] = new Swiper('.swiper-' + index, {
                speed: speedVar,
                pagination: '.pagination-' + index,
                loop: loopVar,
                paginationClickable: true,
                autoplay: autoPlayVar,
                slidesPerView: slidesPerViewVar,
                keyboardControl: true,
                calculateHeight: true,
                simulateTouch: true,
                roundLengths: true,
                centeredSlides: centerVar,
                mode: mode || 'horizontal',
                onInit: function(swiper) {
                    $t.find('.swiper-slide').addClass('active');

                    sliderOpacity();
                },
                onSwiperCreated: function() {

                },
                onSlideChangeEnd: function(swiper) {
                    var activeIndex = (loopVar === 1) ? swiper.activeLoopIndex : swiper.activeIndex;
                },
                onSlideChangeStart: function(swiper) {
                    $t.find('.swiper-slide.active').removeClass('active');
                }
            });
            swipers['swiper-' + index].reInit();
            if ($t.attr('data-slides-per-view') == 'responsive') {
                var paginationSpan = $t.find('.pagination span');
                var paginationSlice = paginationSpan.hide().slice(0, (paginationSpan.length + 1 - slidesPerViewVar));
                if (paginationSlice.length <= 1 || slidesPerViewVar >= $t.find('.swiper-slide').length) $t.addClass('pagination-hidden');
                else $t.removeClass('pagination-hidden');
                paginationSlice.show();
            }

            if ($t.find('.default-active').length) {
                swipers['swiper-' + index].swipeTo($t.find('.swiper-slide').index($t.find('.default-active')), 0);
            }

            initIterator++;

        });

    }

    function updateSlidesPerView(swiperContainer) {
        if (winW >= addPoint) return parseInt(swiperContainer.attr('data-add-slides'), 10);
        else if (winW >= lgPoint) return parseInt(swiperContainer.attr('data-lg-slides'), 10);
        else if (winW >= mdPoint) return parseInt(swiperContainer.attr('data-md-slides'), 10);
        else if (winW >= smPoint) return parseInt(swiperContainer.attr('data-sm-slides'), 10);
        else return parseInt(swiperContainer.attr('data-xs-slides'), 10);
    }

    // slider opacity elem

    function sliderOpacity() {
        var elem = $('.wheel-collection .swiper-slide-visible');
        if ($(window).width() > 992) {

            elem.removeClass('wheel-opacity')
            elem.eq(0).addClass('wheel-opacity')
            elem.eq(elem.length - 1).addClass('wheel-opacity')
        }
    }

    //swiper arrows
    $('.swiper-arrow-left').on('click', function() {
        swipers['swiper-' + $(this).parent().attr('id')].swipePrev();
        sliderOpacity()
    });

    $('.swiper-arrow-right').on('click', function() {
        swipers['swiper-' + $(this).parent().attr('id')].swipeNext();
        sliderOpacity()
    });

    $('.swiper-outer-left').on('click', function() {
        swipers['swiper-' + $(this).parent().find('.swiper-container').attr('id')].swipePrev();
    });

    $('.swiper-outer-right').on('click', function() {
        swipers['swiper-' + $(this).parent().find('.swiper-container').attr('id')].swipeNext();
    });

    /*=================================*/
    /* RESPONSIVE MENU */
    /*=================================*/

    var $first_child_link = $('.menu-item-has-children > a').append('');

    $('.nav-menu-icon').on('click', function(e) {
        $(this).toggleClass('active');
        $('.wheel-navigation').toggleClass('active');
        $('html').toggleClass('overflow-html');

    });

    $first_child_link.find('span').on('click', function(e) {
        e.preventDefault();
        var self = $(this),
            parentLi = self.parent();
        self.toggleClass(' fa-angle-down').toggleClass('fa-angle-right ');
        self.closest('li').siblings('.menu-item.menu-item-has-children').removeClass('active').find('span.fa-angle-down').removeClass('fa-angle-down').addClass('fa-angle-right');
        self.closest('li').toggleClass('active');

    });

    /*============================*/
    /* HEADER NAVIGATOR SHOW */
    /*============================*/

    if ($(window).width() >= 993) {

        $(".wheel-nav-menu-icon").on('click', function() {

            var wpc_header = $('.wheel-header');

            if (wpc_header.hasClass('header-animate')) {
                $('.wheel-navigation').css('overflow', 'hidden');
                wpc_header.removeClass('header-animate');
                wpc_header.find("nav").removeClass('slide-active');
            } else {
                wpc_header.find("nav").addClass('slide-active');
                wpc_header.addClass('header-animate');
                setTimeout(function() {
                    $('.wheel-navigation').css('overflow', 'visible');
                }, 500);
            }

        });

    }

    var counters = function() {
        $('.wheel-testimonial-item span ').not('.animated').each(function() {
            if ($(window).scrollTop() >= $(this).offset().top - $(window).height() * 0.7) {
                $(this).addClass('animated').countTo();
            }
        });

        var elemSize = $('.wheel-interest ');
        if (elemSize.length) {
            if ($(window).scrollTop() >= elemSize.offset().top - $(window).height() * 0.7) {
                elemSize.each(function(index, el) {
                    elemSize.eq(index).width($(this).attr('data-size') + '%')
                });

            }
        }

    }

    // backround block with image
    function wpc_add_img_bg2(img_sel, parent_sel) {

        if (!img_sel) {
            console.info('no img selector');
            return false;
        }
        var $parent, _this;

        $(img_sel).each(function() {
            _this = $(this);
            $parent = _this.closest(parent_sel);
            $parent = $parent.length ? $parent : _this.parent();
            $parent.css('background-image', 'url(' + this.src + ')');
            _this.css('visibility', 'hidden');
        });

    }

    wpc_add_img_bg2('.wheel-service-img .wheel-img', '.wheel-service-img');
    wpc_add_img_bg2('.wheel-service-img2 .wheel-img2', '.wheel-service-img2');
    wpc_add_img_bg2('.wheel-news-item2 .wheel-news-item-img img', '.wheel-news-item2 .wheel-news-item-img');
    wpc_add_img_bg2('.product-list .img-wrap img', '.product-list .img-wrap');
    wpc_add_img_bg2('.r-return-block .img-wrap img', '.r-return-block .img-wrap');

    function wpc_add_img_bg(img_sel, parent_sel) {

        if (!img_sel) {
            console.info('no img selector');
            return false;
        }
        var $parent, _this;

        $(img_sel).each(function() {
            _this = $(this);
            $parent = _this.closest(parent_sel);
            $parent = $parent.length ? $parent : _this.parent();
            $parent.css('background-image', 'url(' + this.src + ')');
            _this.hide();
        });

    }

    wpc_add_img_bg('.wheel-deals .wheel-img', '.wheel-deals');
    wpc_add_img_bg('.wheel-start .wheel-img', '.wheel-start');
    wpc_add_img_bg('.wheel-quote .wheel-img', '.wheel-quote');
    wpc_add_img_bg('.wheel-footer .wheel-img', '.wheel-footer');
    wpc_add_img_bg('.wheel-info-img .wheel-img', '.wheel-info-img');
    wpc_add_img_bg('.wheel-app-body .wheel-img', '.wheel-app-body');
    wpc_add_img_bg('.wheel-start3 .wheel-img', '.wheel-start3');

    /*============================*/
    /* map               */
    /*============================*/

    if ($('.wheel-map').length) {
        $('.wheel-map').each(function() {
            initialize(this);
        });
    }

    function initialize(_this) {

        var stylesArray = {
            //style 1
            'style-1': [{ "featureType": "landscape", "stylers": [{ "hue": "#FFBB00" }, { "saturation": 43.400000000000006 }, { "lightness": 37.599999999999994 }, { "gamma": 1 }] }, { "featureType": "road.highway", "stylers": [{ "hue": "#FFC200" }, { "saturation": -61.8 }, { "lightness": 45.599999999999994 }, { "gamma": 1 }] }, { "featureType": "road.arterial", "stylers": [{ "hue": "#FF0300" }, { "saturation": -100 }, { "lightness": 51.19999999999999 }, { "gamma": 1 }] }, { "featureType": "road.local", "stylers": [{ "hue": "#FF0300" }, { "saturation": -100 }, { "lightness": 52 }, { "gamma": 1 }] }, { "featureType": "water", "stylers": [{ "hue": "#0078FF" }, { "saturation": -13.200000000000003 }, { "lightness": 2.4000000000000057 }, { "gamma": 1 }] }, { "featureType": "poi", "stylers": [{ "hue": "#00FF6A" }, { "saturation": -1.0989010989011234 }, { "lightness": 11.200000000000017 }, { "gamma": 1 }] }]
        };

        var styles, map, marker, infowindow,
            lat = $(_this).attr("data-lat"),
            lng = $(_this).attr("data-lng"),
            contentString = $(_this).attr("data-string"),
            image = $(_this).attr("data-marker"),
            styles_attr = $(_this).attr("data-style"),
            zoomLevel = parseInt($(_this).attr("data-zoom"), 10),
            myLatlng = new google.maps.LatLng(lat, lng);

        // style_1
        if (styles_attr == 'style-1') {
            styles = stylesArray[styles_attr];
        }
        // custom
        if (typeof hawa_style_map != 'undefined' && styles_attr == 'custom') {
            styles = hawa_style_map;
        }
        // or default style

        var styledMap = new google.maps.StyledMapType(styles, { name: "Styled Map" });

        var mapOptions = {
            zoom: zoomLevel,
            disableDefaultUI: true,
            center: myLatlng,
            scrollwheel: false,
            mapTypeControlOptions: {
                mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style']
            }
        };

        map = new google.maps.Map(_this, mapOptions);

        map.mapTypes.set('map_style', styledMap);
        map.setMapTypeId('map_style');

        infowindow = new google.maps.InfoWindow({
            content: contentString
        });

        marker = new google.maps.Marker({
            position: myLatlng,
            map: map,
            icon: image
        });

        google.maps.event.addListener(marker, 'click', function() {
            infowindow.open(map, marker);
        });

    }

    // video size
    function videoSize() {
        $('.wheel-info-video iframe').attr('height', '440');
    }

    /*============================*/
    /* LOAD RESIZE               */
    /*============================*/

    $(window).on('scroll', function() {
        counters();
        undateMenu();

    })

    $(window).on('load resize', function() {

        // add  identical height  to block
        $('.car-item-wrap').css('height', 'auto').equalHeights();

        undateMenu();

        $('.wheel-info-img').height($('.wheel-info-text').height())

        if ($(window).width() < 1200) {
            videoSize();
        }
    });

})(jQuery, window, document);